From 2d8761f1101ae9d7db0f121b1e244fd7295512b1 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: Sat, 18 Apr 2026 11:39:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(MagicMissle):=20=E4=BF=AE=E5=A4=8D=E9=AD=94?= =?UTF-8?q?=E6=B3=95=E5=AF=BC=E5=BC=B9=E5=8A=A0=E9=80=9F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E4=BC=A4=E5=AE=B3=E4=BC=A0=E9=80=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整加速条件判断,确保只有存在子弹时才加速 修正子弹销毁条件为基于基础伤害值 修复子弹伤害传递问题,确保基础伤害正确传递给分裂子弹 优化场景结构,调整粒子效果和碰撞体位置 --- components/Bullets/MagicMissle.tscn | 22 ++++++++++------------ scripts/Contents/Bullets/MagicMissle.gd | 10 +++++++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/components/Bullets/MagicMissle.tscn b/components/Bullets/MagicMissle.tscn index b550b51..d44e09b 100644 --- a/components/Bullets/MagicMissle.tscn +++ b/components/Bullets/MagicMissle.tscn @@ -3,7 +3,9 @@ [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_4sjx4"] [ext_resource type="Script" uid="uid://b1y8r5xrhhso" path="res://scripts/Contents/Bullets/MagicMissle.gd" id="2_lrw10"] [ext_resource type="Texture2D" uid="uid://bl1i26ovfpxwc" path="res://resources/bullets/magic-missle/tr.webp" id="2_ross6"] -[ext_resource type="Texture2D" uid="uid://drikpnrvqisb0" path="res://resources/bullets/magic-missle/ninesols.png" id="2_rugh7"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_rugh7"] +height = 76.0 [sub_resource type="Curve" id="Curve_lrw10"] _data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.2, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] @@ -41,25 +43,21 @@ scale_max = 0.9 scale_curve = SubResource("CurveTexture_lrw10") alpha_curve = SubResource("CurveTexture_3jny5") -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_rugh7"] -height = 76.0 - [node name="MagicMissle" unique_id=5571707 instance=ExtResource("1_4sjx4")] script = ExtResource("2_lrw10") penerate = 1.0 penerateDamageReduction = 0.1 [node name="static" type="Sprite2D" parent="texture" parent_id_path=PackedInt32Array(162977358) index="2" unique_id=1008850333] -texture = ExtResource("2_rugh7") - -[node name="trail" type="GPUParticles2D" parent="texture/static" index="0" unique_id=1403224943] -z_index = -1 -position = Vector2(-35, 1) -amount = 50 texture = ExtResource("2_ross6") -visibility_rect = Rect2(-1000, -1000, 2000, 2000) -process_material = SubResource("ParticleProcessMaterial_mgg76") [node name="hitbox" parent="." index="1" unique_id=175349408] rotation = 1.5707964 shape = SubResource("CapsuleShape2D_rugh7") + +[node name="trail" type="GPUParticles2D" parent="." index="2" unique_id=1403224943] +z_index = -1 +amount = 50 +texture = ExtResource("2_ross6") +visibility_rect = Rect2(-1000, -1000, 2000, 2000) +process_material = SubResource("ParticleProcessMaterial_mgg76") diff --git a/scripts/Contents/Bullets/MagicMissle.gd b/scripts/Contents/Bullets/MagicMissle.gd index 157abf4..4ce6b93 100644 --- a/scripts/Contents/Bullets/MagicMissle.gd +++ b/scripts/Contents/Bullets/MagicMissle.gd @@ -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