mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-13 07:07:12 +08:00
refactor(武器系统): 重构Gobo武器行为并移除治疗导弹
删除HealingMissle相关文件,修改Gobo武器行为 Gobo现在会在受到伤害时生成苹果而非发射治疗导弹 更新武器描述和属性以匹配新行为 调整Rooster角色的武器配置
This commit is contained in:
@@ -3,6 +3,8 @@ class_name GoboSummon
|
||||
|
||||
var percent: float = 0.0
|
||||
var healthSinceLastLaunch: float = 0
|
||||
var targetDamage: float = 0.0
|
||||
var count: int = 0
|
||||
|
||||
func initHealth(maxHealth: float):
|
||||
super.initHealth(maxHealth)
|
||||
@@ -12,7 +14,7 @@ func register():
|
||||
fields[FieldStore.Entity.MOVEMENT_SPEED] = 1.5
|
||||
healthChanged.connect(
|
||||
func(newHealth):
|
||||
if healthSinceLastLaunch - newHealth >= 1:
|
||||
if healthSinceLastLaunch - newHealth >= targetDamage:
|
||||
launch()
|
||||
healthSinceLastLaunch = newHealth
|
||||
)
|
||||
@@ -22,11 +24,4 @@ func ai():
|
||||
move(target.position - position)
|
||||
|
||||
func launch():
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("HealingMissle"),
|
||||
self,
|
||||
position,
|
||||
position.angle_to_point(EntityTool.findClosetEntity(myMaster.position, get_tree(), isPlayer(), !isPlayer(), [self]).position)
|
||||
):
|
||||
if bullet is HealingMissleBullet:
|
||||
bullet.baseDamage = health * percent * -1
|
||||
ItemDropped.generate(ItemStore.ItemType.APPLE, count, position)
|
||||
|
||||
Reference in New Issue
Block a user