From 735a140306caa1564013864b93f43b8a14cbdc6f 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: Wed, 4 Feb 2026 22:12:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8):=20=E5=A2=9E=E5=BC=BAH?= =?UTF-8?q?XD=E6=AD=A6=E5=99=A8=E6=95=88=E6=9E=9C=E5=B9=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4MTY=E8=A7=92=E8=89=B2=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为HXD武器添加同类敌人额外暴击伤害效果,并修正反弹次数描述 调整MTY角色的攻击冷却时间并优化冲刺逻辑 --- components/Weapons/HXD.tscn | 4 ++-- scripts/Contents/Bullets/HXD.gd | 5 +++++ scripts/Contents/Characters/MTY.gd | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/components/Weapons/HXD.tscn b/components/Weapons/HXD.tscn index f64f14f..71cf2c5 100644 --- a/components/Weapons/HXD.tscn +++ b/components/Weapons/HXD.tscn @@ -19,7 +19,7 @@ storeType = { "atk": 1, "count": 1 } -descriptionTemplate = "发射$count颗[b]茴香豆[/b],在敌人间反弹,每颗茴香豆最多可以反弹$atk次,每次反弹对敌人造成$atk点伤害,有[color=yellow]1/4[/color]的概率不计入反弹总次数。散射[color=red]+4°[/color],反弹时伤害[color=red]-4%[/color]" +descriptionTemplate = "发射$count颗[b]茴香豆[/b],在敌人间反弹,每颗茴香豆最多可以反弹$atk次,每次反弹对敌人造成$atk点伤害,有[color=yellow]1/4[/color]的概率反弹次数[color=yellow]+1[/color]。散射[color=red]+4°[/color],反弹时伤害[color=red]-4%[/color],命中同类敌人时额外造成一次[color=yellow]必定暴击[/color]的伤害。" cooldown = 1000.0 debugRebuild = true @@ -35,4 +35,4 @@ quality = 3 typeTopic = 3 [node name="description" parent="container" index="2"] -text = "[center]发射[color=cyan]4[/color]颗[b]茴香豆[/b],在敌人间反弹,每颗茴香豆最多可以反弹[color=cyan]4[/color]次,每次反弹对敌人造成[color=cyan]4[/color]点伤害,有[color=yellow]1/4[/color]的概率不计入反弹总次数。散射[color=red]+4°[/color],反弹时伤害[color=red]-4%[/color][/center]" +text = "[center]发射[color=cyan]4[/color]颗[b]茴香豆[/b],在敌人间反弹,每颗茴香豆最多可以反弹[color=cyan]4[/color]次,每次反弹对敌人造成[color=cyan]4[/color]点伤害,有[color=yellow]1/4[/color]的概率反弹次数[color=yellow]+1[/color]。散射[color=red]+4°[/color],反弹时伤害[color=red]-4%[/color],命中同类敌人时额外造成一次[color=yellow]必定暴击[/color]的伤害。[/center]" diff --git a/scripts/Contents/Bullets/HXD.gd b/scripts/Contents/Bullets/HXD.gd index 4a5ee79..2c57264 100644 --- a/scripts/Contents/Bullets/HXD.gd +++ b/scripts/Contents/Bullets/HXD.gd @@ -3,12 +3,17 @@ class_name HXDBullet var bouncedTime: int = 0 var maxBouncedTime: int = 0 +var lastHit: EntityBase func spawn(): texture.play(str(randi_range(0, 2))) func ai(): PresetBulletAI.forward(self, rotation) func succeedToHit(_dmg: float, entity: EntityBase): + if is_instance_valid(lastHit): + if lastHit.get_class() == entity.get_class(): + entity.bulletHit(self, true) + lastHit = entity if bouncedTime < maxBouncedTime: var newEntity = EntityTool.findClosetEntity(position, get_tree(), !launcher.isPlayer(), launcher.isPlayer(), [entity]) if is_instance_valid(newEntity): diff --git a/scripts/Contents/Characters/MTY.gd b/scripts/Contents/Characters/MTY.gd index 35227ae..a2df06c 100644 --- a/scripts/Contents/Characters/MTY.gd +++ b/scripts/Contents/Characters/MTY.gd @@ -4,7 +4,7 @@ class_name MTY func register(): fields[FieldStore.Entity.MAX_HEALTH] = 400 fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9 - attackCooldownMap[0] = 1000 + attackCooldownMap[0] = 2000 attackCooldownMap[1] = 250 sprintMultiplier = 5 func spawn(): @@ -22,5 +22,6 @@ func attack(type: int): func sprint(): var target = BulletTool.findClosetBulletCanDamage(position, get_tree(), self) if is_instance_valid(target): - var dir = (target.position - position).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90)) - move(dir.normalized() * sprintMultiplier, true) + if position.distance_to(target.position) <= 200: + var dir = (target.position - position).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90)) + move(dir.normalized() * sprintMultiplier, true)