1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-04 02:37:12 +08:00

fix(MagicMissle): 修复魔法导弹加速逻辑和伤害传递问题

调整加速条件判断,确保只有存在子弹时才加速
修正子弹销毁条件为基于基础伤害值
修复子弹伤害传递问题,确保基础伤害正确传递给分裂子弹
优化场景结构,调整粒子效果和碰撞体位置
This commit is contained in:
2026-04-18 11:39:23 +08:00
parent b691618bed
commit 2d8761f110
2 changed files with 17 additions and 15 deletions
+7 -3
View File
@@ -8,13 +8,16 @@ var roundBullets: Array[MagicMissleBullet]
func ai():
if accelerating:
if roundBullets.count(self ) < 1:
accelerating = false
rotation = lerp_angle(rotation, position.angle_to_point(get_global_mouse_position()), 0.1)
speedV2 += (get_global_mouse_position() - position).normalized() * 1
elif speed < 1:
tryDestroy()
elif baseDamage < 1:
tryDestroy()
speedV2 *= 0.995
speed = speedV2.length()
PresetBulletAI.forward(self , speedV2.angle())
texture.rotation += deg_to_rad(sqrt(speed))
func succeedToHit(_dmg: float, entity: EntityBase):
if powerScale > 0 && accelerating && roundBullets.count(self ) > 0:
@@ -27,8 +30,9 @@ func succeedToHit(_dmg: float, entity: EntityBase):
):
if bullet is MagicMissleBullet:
bullet.position += Vector2.from_angle(bullet.rotation) * 100
bullet.speedV2 += Vector2.from_angle(bullet.rotation) * 30
bullet.speedV2 += Vector2.from_angle(bullet.rotation) * 20
bullet.roundBullets = roundBullets
bullet.powerScale = powerScale - 1
bullet.baseDamage = baseDamage
roundBullets.append(bullet)
powerScale = 0