From d473281e8a260e37049253cb7a4a97548f3d5cf1 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: Sun, 14 Sep 2025 15:17:09 +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=B4KukeMC=E7=9A=84=E6=94=BB=E5=87=BB=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=92=8C=E7=B4=AB=E6=B0=B4=E6=99=B6=E5=AD=90=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为KukeMC角色减少召唤子体数量但增加紫水晶子弹数量,优化战斗节奏 添加紫水晶子弹的显示名称 移除PurpleCrystal类名定义 在EntityBase中新增died信号 --- components/Bullets/PurpleCrystal.tscn | 1 + components/Characters/KukeChild.tscn | 4 +++- scripts/Contents/Bullets/PurpleCrystal.gd | 1 - scripts/Contents/Characters/KukeMC.gd | 10 ++++++---- scripts/Statemachine/EntityBase.gd | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/Bullets/PurpleCrystal.tscn b/components/Bullets/PurpleCrystal.tscn index b46dbc2..b5b2014 100644 --- a/components/Bullets/PurpleCrystal.tscn +++ b/components/Bullets/PurpleCrystal.tscn @@ -19,6 +19,7 @@ animations = [{ [node name="PurpleCrystal" instance=ExtResource("1_45mh7")] script = ExtResource("2_4lnlm") +displayName = "紫水晶" [node name="texture" parent="." index="0"] sprite_frames = SubResource("SpriteFrames_r86b3") diff --git a/components/Characters/KukeChild.tscn b/components/Characters/KukeChild.tscn index 5126795..aff2074 100644 --- a/components/Characters/KukeChild.tscn +++ b/components/Characters/KukeChild.tscn @@ -26,12 +26,14 @@ animations = [{ [node name="KukeChild" instance=ExtResource("1_3ohuq")] script = ExtResource("2_ywxbd") +[node name="collect" parent="sounds" index="4"] +stream = null + [node name="texture" parent="." index="2"] sprite_frames = SubResource("SpriteFrames_5rcbd") animation = &"walk" [node name="normal" type="Node2D" parent="texture/weapons" index="0"] -position = Vector2(47, 11) [node name="statebar" parent="." index="3"] position = Vector2(0, -125) diff --git a/scripts/Contents/Bullets/PurpleCrystal.gd b/scripts/Contents/Bullets/PurpleCrystal.gd index 211a646..e41bbc3 100644 --- a/scripts/Contents/Bullets/PurpleCrystal.gd +++ b/scripts/Contents/Bullets/PurpleCrystal.gd @@ -1,5 +1,4 @@ extends BulletBase -class_name PurpleCrystal func ai(): PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Characters/KukeMC.gd b/scripts/Contents/Characters/KukeMC.gd index 49a6578..bd3dc29 100644 --- a/scripts/Contents/Characters/KukeMC.gd +++ b/scripts/Contents/Characters/KukeMC.gd @@ -5,13 +5,15 @@ func register(): fields[FieldStore.Entity.MAX_HEALTH] = 2500 fields[FieldStore.Entity.OFFSET_SHOOT] = 25 fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.5 - attackCooldownMap[0] = 8000 - attackCooldownMap[1] = 10000 + attackCooldownMap[0] = 4000 + attackCooldownMap[1] = 6000 func spawn(): - for i in 5: - var child = EntityBase.generate(preload("res://components/Characters/KukeChild.tscn"), position + MathTool.randv2_range(500)) + for i in 3: + var child = EntityBase.generate(load("res://components/Characters/KukeChild.tscn"), position + MathTool.randv2_range(500)) child.currentFocusedBoss = currentFocusedBoss child.masterMine = self + for i in 20: + BulletBase.generate(preload("res://components/Bullets/PurpleCrystal.tscn"), self, findWeaponAnchor("normal"), deg_to_rad(randf_range(0, 360))) func ai(): PresetEntityAI.follow(self, currentFocusedBoss, 500) for bullet in get_tree().get_nodes_in_group("bullets"): diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 8535fc4..7ddc817 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -4,6 +4,7 @@ class_name EntityBase # 这是个抽象类 signal hit(damage: float, bullet: BulletBase, crit: bool) signal healed(amount: float) signal healthChanged(health: float) +signal died() signal energyChanged(energy: float, dontChangeDirection: bool) @@ -313,6 +314,7 @@ func tryDie(by: BulletBase = null): UIState.setPanel("GameOver", [displayName, by.launcher.displayName, by.displayName]) EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot() await die() + died.emit() queue_free() func tryHeal(count: float): if inventory[ItemStore.ItemType.APPLE] > 0 and health < fields.get(FieldStore.Entity.MAX_HEALTH):