From bd2525a55e2201f53abc06bfeb571b0edc98c2ad 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: Fri, 1 May 2026 06:38:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=88=98=E6=96=97=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=83=BD=E9=87=8F=E5=9D=97=E6=94=BB=E5=87=BB?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=92=8C=E6=89=AB=E5=B8=9A=E5=AD=90=E5=BC=B9?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为扫帚子弹添加基础伤害属性并调整碰撞盒位置 - 扩展能量块攻击冷却时间配置,增加多种攻击类型 - 重构攻击逻辑,支持多类型攻击和互斥控制 - 优化子弹生成逻辑,根据类型执行不同行为 --- components/Bullets/SwingSword.tscn | 5 +++-- scripts/Contents/Characters/EnergyBlock.gd | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/components/Bullets/SwingSword.tscn b/components/Bullets/SwingSword.tscn index 7128ba9..7c18d3c 100644 --- a/components/Bullets/SwingSword.tscn +++ b/components/Bullets/SwingSword.tscn @@ -242,6 +242,7 @@ size = Vector2(259.81308, 36.189156) script = ExtResource("2_23nu4") displayName = "扫帚" speed = 15.0 +baseDamage = 20.0 motionType = 0 penerate = 1.0 autoSpawnAnimation = true @@ -268,8 +269,8 @@ local_coords = true process_material = SubResource("ParticleProcessMaterial_h2e5u") [node name="hitbox" parent="." index="1" unique_id=175349408 node_paths=PackedStringArray("target")] -position = Vector2(439.70004, 16.243788) -rotation = -3.1046665 +position = Vector2(0.3503607, 439.99988) +rotation = -1.5715926 scale = Vector2(2, 2) shape = SubResource("RectangleShape2D_ccsa1") script = ExtResource("3_ihf3m") diff --git a/scripts/Contents/Characters/EnergyBlock.gd b/scripts/Contents/Characters/EnergyBlock.gd index f9b06d5..fb27ffb 100644 --- a/scripts/Contents/Characters/EnergyBlock.gd +++ b/scripts/Contents/Characters/EnergyBlock.gd @@ -7,16 +7,22 @@ func register(): func(damage: float, bullet: BulletBase, _crit: bool): bullet.launcher.storeEnergy(damage) ) - attackCooldownMap[0] = 0 - attackCooldownMap[1] = 3000 + attackCooldownMap[0] = 6000 + attackCooldownMap[1] = 10000 + attackCooldownMap[2] = 4000 + attackCooldownMap[3] = 8000 + attackCooldownMap[4] = 3000 + attackCooldownMap[5] = 2000 + attackCooldownMap[6] = 5000 + attackMutexes = [1, 4] func ai(): - tryAttack(0) - tryAttack(1) + for i in 7: + tryAttack(i, [1, 3]) func attack(type: int): if type == 0: + BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition)) + elif type == 5: var track = getTrackingAnchor() var bullet = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 200) if is_instance_valid(bullet): BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(bullet.position)) - elif type == 1: - BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition))