mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(召唤): 调整召唤物属性和武器配置
- 修改HJM和LGBTFlag的吸引力数值 - 为武器类型枚举添加SUMMON选项 - 优化召唤逻辑,当达到上限时移除最早召唤物 - 调整Shield武器的属性和描述 - 更新Rooster角色的武器配置 - 修复LGBTFlag攻击角度计算问题
This commit is contained in:
@@ -12,7 +12,11 @@ func ai():
|
||||
func attack(type):
|
||||
if type == 0:
|
||||
var tracer = EntityTool.findClosetEntity(position, get_tree(), false, true)
|
||||
var startAngle = position.angle_to_point(tracer.getTrackingAnchor()) + deg_to_rad(randf_range(-1, 1) * 45)
|
||||
var startAngle: float
|
||||
if is_instance_valid(tracer):
|
||||
startAngle = position.angle_to_point(tracer.getTrackingAnchor()) + deg_to_rad(randf_range(-1, 1) * 45)
|
||||
else:
|
||||
startAngle = deg_to_rad(randf_range(0, 360))
|
||||
for i in count:
|
||||
if !is_instance_valid(tracer):
|
||||
break
|
||||
|
||||
@@ -407,10 +407,11 @@ func getMySummons() -> Array[SummonBase]:
|
||||
result.append(entity)
|
||||
return result
|
||||
func summon(who: PackedScene, syncFields: bool = true, lockValue: bool = true) -> SummonBase:
|
||||
if len(getMySummons()) >= fields.get(FieldStore.Entity.SUMMON_MAX):
|
||||
return null
|
||||
var existSummons: Array[SummonBase] = getMySummons()
|
||||
while len(existSummons) >= fields.get(FieldStore.Entity.SUMMON_MAX):
|
||||
existSummons.pop_at(0).tryKill()
|
||||
var instance: SummonBase = who.instantiate()
|
||||
instance.position = position
|
||||
instance.position = get_global_mouse_position()
|
||||
instance.myMaster = self
|
||||
if isPlayer(): instance.add_to_group("players")
|
||||
if syncFields:
|
||||
|
||||
@@ -14,6 +14,7 @@ enum TypeTopic {
|
||||
ENERGY,
|
||||
TEMPERATURE,
|
||||
MAGIC,
|
||||
SUMMON
|
||||
}
|
||||
enum SoulLevel {
|
||||
NORMALIZE = 1,
|
||||
@@ -61,12 +62,14 @@ enum SoulLevel {
|
||||
TypeTopic.ENERGY: "能量",
|
||||
TypeTopic.TEMPERATURE: "熔融",
|
||||
TypeTopic.MAGIC: "魔法",
|
||||
TypeTopic.SUMMON: "召唤",
|
||||
}
|
||||
@export var typeTopicColorMap = {
|
||||
TypeTopic.IMPACT: Color(),
|
||||
TypeTopic.ENERGY: Color(),
|
||||
TypeTopic.TEMPERATURE: Color(),
|
||||
TypeTopic.MAGIC: Color(),
|
||||
TypeTopic.SUMMON: Color(),
|
||||
}
|
||||
@export var soulLevelNameMap = {
|
||||
SoulLevel.NORMALIZE: "归一",
|
||||
|
||||
@@ -22,7 +22,7 @@ static func signBeforeStr(value: float):
|
||||
static func percent(value: float):
|
||||
return value / 100
|
||||
static func shrimpRate(value: float):
|
||||
return floor(value) + int(rate(value - floor(value)))
|
||||
return randi_range(0, floor(value)) + int(rate(value - floor(value)))
|
||||
static func getClosestIntersection(a: Vector2, b: Vector2, r: float) -> Vector2:
|
||||
var ab = b - a
|
||||
var distance = ab.length()
|
||||
|
||||
Reference in New Issue
Block a user