From 11dcce50c95589878730665cbeb63ce10dd03bdf 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, 28 Jan 2026 22:50:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=AD=A6=E5=99=A8=E7=B3=BB=E7=BB=9F):?= =?UTF-8?q?=20=E9=87=8D=E6=9E=84Gobo=E6=AD=A6=E5=99=A8=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E5=B9=B6=E7=A7=BB=E9=99=A4=E6=B2=BB=E7=96=97=E5=AF=BC=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除HealingMissle相关文件,修改Gobo武器行为 Gobo现在会在受到伤害时生成苹果而非发射治疗导弹 更新武器描述和属性以匹配新行为 调整Rooster角色的武器配置 --- components/Bullets/HealingMissle.tscn | 27 ------------------- components/Characters/Rooster.tscn | 11 ++++---- components/Weapons/Gobo.tscn | 13 +++++---- scripts/Contents/Bullets/HealingMissle.gd | 5 ---- scripts/Contents/Bullets/HealingMissle.gd.uid | 1 - scripts/Contents/Summons/Gobo.gd | 13 +++------ scripts/Contents/Weapons/Gobo.gd | 3 +++ 7 files changed, 19 insertions(+), 54 deletions(-) delete mode 100644 components/Bullets/HealingMissle.tscn delete mode 100644 scripts/Contents/Bullets/HealingMissle.gd delete mode 100644 scripts/Contents/Bullets/HealingMissle.gd.uid diff --git a/components/Bullets/HealingMissle.tscn b/components/Bullets/HealingMissle.tscn deleted file mode 100644 index 9fc1bd5..0000000 --- a/components/Bullets/HealingMissle.tscn +++ /dev/null @@ -1,27 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://ds6yxgj6r8f4v"] - -[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_1wl5l"] -[ext_resource type="Texture2D" uid="uid://dpvk6pja35rdb" path="res://resources/items/apple-white.png" id="2_0jb7f"] -[ext_resource type="Script" uid="uid://d2ubbdwexom6t" path="res://scripts/Contents/Bullets/HealingMissle.gd" id="2_nxr84"] - -[sub_resource type="SpriteFrames" id="SpriteFrames_nxr84"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": ExtResource("2_0jb7f") -}], -"loop": true, -"name": &"default", -"speed": 5.0 -}] - -[node name="HealingMissle" instance=ExtResource("1_1wl5l")] -script = ExtResource("2_nxr84") -speed = 1.0 -lifeTime = 5000.0 -allowFriendlyDamage = true - -[node name="texture" parent="." index="0"] -modulate = Color(0.0068707466, 1, 0, 1) -scale = Vector2(0.44360867, 0.44360867) -sprite_frames = SubResource("SpriteFrames_nxr84") diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index 6cf793e..2581378 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] [ext_resource type="PackedScene" uid="uid://dldnbpubu2jgm" path="res://components/Weapons/GrassWall.tscn" id="3_0omr3"] [ext_resource type="PackedScene" uid="uid://blwoev5sencdh" path="res://components/Weapons/Gobo.tscn" id="3_jluqw"] -[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_joj4g"] +[ext_resource type="PackedScene" uid="uid://dlaks67h2osms" path="res://components/Weapons/ChainGun.tscn" id="3_joj4g"] [ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"] [ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"] [ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"] @@ -60,11 +60,12 @@ metadata/_edit_vertical_guides_ = [71.0] [node name="weaponStore" parent="." index="1"] process_mode = 4 -[node name="Gobo" parent="weaponStore" index="0" instance=ExtResource("3_jluqw")] -offset_bottom = 446.0 +[node name="ChainGun" parent="weaponStore" index="0" instance=ExtResource("3_joj4g")] +offset_bottom = 374.0 -[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_joj4g")] -offset_bottom = 350.0 +[node name="Gobo" parent="weaponStore" index="1" instance=ExtResource("3_jluqw")] +offset_bottom = 446.0 +debugRebuild = false [node name="GrassWall" parent="weaponStore" index="2" instance=ExtResource("3_0omr3")] diff --git a/components/Weapons/Gobo.tscn b/components/Weapons/Gobo.tscn index db5c642..09017f7 100644 --- a/components/Weapons/Gobo.tscn +++ b/components/Weapons/Gobo.tscn @@ -11,19 +11,20 @@ displayName = "Gobo" quality = 4 typeTopic = 4 store = { -"atk": 50, +"atk": 100, +"count": 1, "health": 200, "percent": 0.1 } storeType = { "atk": 1, +"count": 1, "health": 1, "percent": 2 } -descriptionTemplate = "召唤[b]Gobo[/b],Gobo会自主行动,每受到$atk点伤害后会发射一枚[b]疗愈导弹[/b]。 -[b]疗愈导弹[/b]命中障碍物或友军时对其产生Gobo剩余生命值×$percent点的治疗。 -Gobo初始拥有$health点生命值。" +descriptionTemplate = "召唤[b]Gobo[/b],Gobo会自主行动,每受到$atk点伤害后会生产$count颗[b]苹果[/b]。Gobo初始拥有$health点生命值。" cooldown = 1000.0 +debugRebuild = true [node name="avatar" parent="container/info" index="0"] texture = ExtResource("2_tw58e") @@ -34,6 +35,4 @@ quality = 4 typeTopic = 4 [node name="description" parent="container" index="2"] -text = "[center]召唤[b]Gobo[/b],Gobo会自主行动,每受到[color=cyan]50[/color]点伤害后会发射一枚[b]疗愈导弹[/b]。 -[b]疗愈导弹[/b]命中障碍物或友军时对其产生Gobo剩余生命值×[color=cyan]10.0%[/color]点的治疗。 -Gobo初始拥有[color=cyan]200[/color]点生命值。[/center]" +text = "[center]召唤[b]Gobo[/b],Gobo会自主行动,每受到[color=cyan]100[/color]点伤害后会生产[color=cyan]1[/color]颗[b]苹果[/b]。Gobo初始拥有[color=cyan]200[/color]点生命值。[/center]" diff --git a/scripts/Contents/Bullets/HealingMissle.gd b/scripts/Contents/Bullets/HealingMissle.gd deleted file mode 100644 index 7bdc218..0000000 --- a/scripts/Contents/Bullets/HealingMissle.gd +++ /dev/null @@ -1,5 +0,0 @@ -extends BulletBase -class_name HealingMissleBullet - -func ai(): - PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Bullets/HealingMissle.gd.uid b/scripts/Contents/Bullets/HealingMissle.gd.uid deleted file mode 100644 index 4561a5b..0000000 --- a/scripts/Contents/Bullets/HealingMissle.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d2ubbdwexom6t diff --git a/scripts/Contents/Summons/Gobo.gd b/scripts/Contents/Summons/Gobo.gd index 2953bb8..b3423eb 100644 --- a/scripts/Contents/Summons/Gobo.gd +++ b/scripts/Contents/Summons/Gobo.gd @@ -3,6 +3,8 @@ class_name GoboSummon var percent: float = 0.0 var healthSinceLastLaunch: float = 0 +var targetDamage: float = 0.0 +var count: int = 0 func initHealth(maxHealth: float): super.initHealth(maxHealth) @@ -12,7 +14,7 @@ func register(): fields[FieldStore.Entity.MOVEMENT_SPEED] = 1.5 healthChanged.connect( func(newHealth): - if healthSinceLastLaunch - newHealth >= 1: + if healthSinceLastLaunch - newHealth >= targetDamage: launch() healthSinceLastLaunch = newHealth ) @@ -22,11 +24,4 @@ func ai(): move(target.position - position) func launch(): - for bullet in BulletBase.generate( - ComponentManager.getBullet("HealingMissle"), - self, - position, - position.angle_to_point(EntityTool.findClosetEntity(myMaster.position, get_tree(), isPlayer(), !isPlayer(), [self]).position) - ): - if bullet is HealingMissleBullet: - bullet.baseDamage = health * percent * -1 + ItemDropped.generate(ItemStore.ItemType.APPLE, count, position) diff --git a/scripts/Contents/Weapons/Gobo.gd b/scripts/Contents/Weapons/Gobo.gd index 8d96fe7..b1c84a3 100644 --- a/scripts/Contents/Weapons/Gobo.gd +++ b/scripts/Contents/Weapons/Gobo.gd @@ -4,10 +4,13 @@ extends Weapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["health"] += 5 * to * soulLevel origin["percent"] += 0.02 * to * soulLevel + origin["count"] *= to * soulLevel return origin func attack(entity: EntityBase): var gobo = entity.summon(ComponentManager.getSummon("Gobo")) if gobo is GoboSummon: + gobo.targetDamage = readStore("atk") gobo.percent = readStore("percent") + gobo.count = readStore("count") gobo.initHealth(readStore("health")) return true