From 64f11d75b280f18855b0a2dc188d5d6f2ba41c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Thu, 30 Apr 2026 06:42:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AD=90=E5=BC=B9=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0SPRINT=E8=BF=90=E5=8A=A8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=B9=B6=E5=A4=84=E7=90=86=E7=A2=B0=E6=92=9E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为子弹系统新增SPRINT运动类型,并在Parrier子弹中处理其碰撞逻辑。当SPRINT类型子弹碰撞时,会销毁子弹并使发射者速度反向衰减。 --- scripts/Contents/Bullets/Parrier.gd | 3 +++ scripts/Statemachine/BulletBase.gd | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/Contents/Bullets/Parrier.gd b/scripts/Contents/Bullets/Parrier.gd index 11f4920..da17866 100644 --- a/scripts/Contents/Bullets/Parrier.gd +++ b/scripts/Contents/Bullets/Parrier.gd @@ -54,6 +54,9 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞 bullet.tryDestroy() elif bullet.motionType == BulletBase.MotionType.SWING: bullet.hitbox.disabled = true + elif bullet.motionType == BulletBase.MotionType.SPRINT: + bullet.tryDestroy() + bullet.launcher.velocity *= -0.1 elif bullet.motionType == BulletBase.MotionType.SUMMON || bullet.motionType == BulletBase.MotionType.MAGIC: launcher.storeEnergy(sqrt(bullet.baseDamage)) var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100) diff --git a/scripts/Statemachine/BulletBase.gd b/scripts/Statemachine/BulletBase.gd index e85cbfc..9fb7d32 100644 --- a/scripts/Statemachine/BulletBase.gd +++ b/scripts/Statemachine/BulletBase.gd @@ -2,10 +2,11 @@ extends Area2D class_name BulletBase enum MotionType { - SWING, - PROJECTILE, - MAGIC, - SUMMON + SWING, # 挥舞(近战攻击) + PROJECTILE, # 射弹 + MAGIC, # 魔法 + SUMMON, # 召唤 + SPRINT, # 冲撞 } @export var displayName: String = "未知子弹"