mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-10 20:12:54 +08:00
fix(Bullets/MagicMissle): 修复魔法导弹伤害计算问题
修正当魔法导弹未加速时未造成伤害的问题,并优化销毁条件判断
This commit is contained in:
@@ -12,14 +12,16 @@ func ai():
|
|||||||
accelerating = false
|
accelerating = false
|
||||||
rotation = lerp_angle(rotation, position.angle_to_point(get_global_mouse_position()), 0.1)
|
rotation = lerp_angle(rotation, position.angle_to_point(get_global_mouse_position()), 0.1)
|
||||||
speedV2 += (get_global_mouse_position() - position).normalized() * 1
|
speedV2 += (get_global_mouse_position() - position).normalized() * 1
|
||||||
elif baseDamage < 1:
|
elif speed < 1 || baseDamage < 1:
|
||||||
tryDestroy()
|
tryDestroy()
|
||||||
speedV2 *= 0.995
|
speedV2 *= 0.995
|
||||||
speed = speedV2.length()
|
speed = speedV2.length()
|
||||||
PresetBulletAI.forward(self , speedV2.angle())
|
PresetBulletAI.forward(self , speedV2.angle())
|
||||||
texture.rotation += deg_to_rad(sqrt(speed))
|
texture.rotation += deg_to_rad(sqrt(speed))
|
||||||
|
|
||||||
func succeedToHit(_dmg: float, entity: EntityBase):
|
func succeedToHit(_dmg: float, entity: EntityBase):
|
||||||
|
if !accelerating:
|
||||||
|
entity.takeDamage(baseDamage, true)
|
||||||
if powerScale > 0 && accelerating && roundBullets.count(self ) > 0:
|
if powerScale > 0 && accelerating && roundBullets.count(self ) > 0:
|
||||||
for i in randi_range(1, powerScale):
|
for i in randi_range(1, powerScale):
|
||||||
for bullet in BulletBase.generate(
|
for bullet in BulletBase.generate(
|
||||||
|
|||||||
Reference in New Issue
Block a user