From 73adc34aef0b8b36919f74c70d56fe3a8a68babf 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, 11 Apr 2026 11:05:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=AD=A6=E5=99=A8=E5=92=8C=E5=AD=90=E5=BC=B9=E7=9A=84=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=92=8C=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为LGBTFlag添加500点最大生命值 - 调整NuclearBomb的旋转逻辑和AcidBulletBase的移动行为 - 重写WhiteSoul子弹逻辑,增加随机大小和速度 - 修改Oxygener武器,允许使用能量替代篮球消耗 - 更新多个场景文件,优化属性和描述 --- components/Bullets/AcidBulletBase.tscn | 7 ++-- components/Bullets/WhiteSoul.tscn | 44 ++++++++++++++++++++-- components/Summons/LGBTFlag.tscn | 8 ++-- components/Weapons/CursorKnife.tscn | 20 +++++----- components/Weapons/Oxygener.tscn | 19 ++++++---- components/Weapons/WhiteSoul.tscn | 8 +++- scripts/Contents/Bullets/AcidBulletBase.gd | 2 +- scripts/Contents/Bullets/NuclearBomb.gd | 2 +- scripts/Contents/Bullets/WhiteSoul.gd | 14 ++++++- scripts/Contents/Summons/LGBTFlag.gd | 1 + scripts/Contents/Weapons/Oxygener.gd | 4 +- scripts/Contents/Weapons/WhiteSoul.gd | 14 ++++--- 12 files changed, 103 insertions(+), 40 deletions(-) diff --git a/components/Bullets/AcidBulletBase.tscn b/components/Bullets/AcidBulletBase.tscn index 08b5215..8c6b54b 100644 --- a/components/Bullets/AcidBulletBase.tscn +++ b/components/Bullets/AcidBulletBase.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://qx8h1dcbyy1j"] +[gd_scene format=3 uid="uid://qx8h1dcbyy1j"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_hfsul"] [ext_resource type="Script" uid="uid://wt1fn2vjtlen" path="res://scripts/Contents/Bullets/AcidBulletBase.gd" id="2_y4hkm"] @@ -15,11 +15,12 @@ animations = [{ "speed": 5.0 }] -[node name="AcidBulletBase" instance=ExtResource("1_hfsul")] +[node name="AcidBulletBase" unique_id=1827668506 instance=ExtResource("1_hfsul")] script = ExtResource("2_y4hkm") acidType = 0 displayName = "酸液" +speed = 15.0 lifeTime = 1000.0 -[node name="texture" parent="." index="0"] +[node name="texture" parent="." index="0" unique_id=162977358] sprite_frames = SubResource("SpriteFrames_3gf7s") diff --git a/components/Bullets/WhiteSoul.tscn b/components/Bullets/WhiteSoul.tscn index 2e4646e..75788fd 100644 --- a/components/Bullets/WhiteSoul.tscn +++ b/components/Bullets/WhiteSoul.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://gnenrlcspjuq"] +[gd_scene format=3 uid="uid://gnenrlcspjuq"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_k41ea"] [ext_resource type="Script" uid="uid://iylhd18nf5a1" path="res://scripts/Contents/Bullets/WhiteSoul.gd" id="2_ld7n7"] @@ -15,6 +15,38 @@ animations = [{ "speed": 5.0 }] +[sub_resource type="Animation" id="Animation_b8ukb"] +resource_name = "destroy" +length = 0.5 +step = 0.1 + +[sub_resource type="Animation" id="Animation_7gepi"] +resource_name = "loop" +loop_mode = 1 +step = 0.1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 6.28319] +} + +[sub_resource type="Animation" id="Animation_vrtf3"] +resource_name = "spawn" + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_tinfk"] +_data = { +&"destroy": SubResource("Animation_b8ukb"), +&"loop": SubResource("Animation_7gepi"), +&"spawn": SubResource("Animation_vrtf3") +} + [sub_resource type="Curve" id="Curve_r03vp"] _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] point_count = 2 @@ -41,18 +73,22 @@ scale_max = 0.8 scale_curve = SubResource("CurveTexture_7ga5a") alpha_curve = SubResource("CurveTexture_bd63g") -[node name="WhiteSoul" instance=ExtResource("1_k41ea")] +[node name="WhiteSoul" unique_id=1863464355 instance=ExtResource("1_k41ea")] texture_filter = 1 script = ExtResource("2_ld7n7") displayName = "怪物灵魂" speed = 20.0 +penerate = 0.5 autoDestroyOnHitMap = false -[node name="texture" parent="." index="0"] +[node name="texture" parent="." index="0" unique_id=162977358] rotation = -1.5708 sprite_frames = SubResource("SpriteFrames_3yyb4") -[node name="trail" type="GPUParticles2D" parent="texture" index="1"] +[node name="animator" parent="texture" index="0" unique_id=1114087117] +libraries/ = SubResource("AnimationLibrary_tinfk") + +[node name="trail" type="GPUParticles2D" parent="texture" index="1" unique_id=1079331435] amount = 10 texture = ExtResource("2_mqva0") preprocess = 1.0 diff --git a/components/Summons/LGBTFlag.tscn b/components/Summons/LGBTFlag.tscn index 9d58171..a684651 100644 --- a/components/Summons/LGBTFlag.tscn +++ b/components/Summons/LGBTFlag.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=6 format=3 uid="uid://b83iw0a062qp"] +[gd_scene format=3 uid="uid://b83iw0a062qp"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_fktqv"] [ext_resource type="Script" uid="uid://11fi3jjdm810" path="res://scripts/Contents/Summons/LGBTFlag.gd" id="2_6d456"] @@ -20,9 +20,9 @@ animations = [{ [sub_resource type="RectangleShape2D" id="RectangleShape2D_r6sud"] size = Vector2(112, 70) -[node name="LGBTFlag" instance=ExtResource("1_fktqv")] +[node name="LGBTFlag" unique_id=1526099188 instance=ExtResource("1_fktqv")] script = ExtResource("2_6d456") -attraction = 0.75 +attraction = 1.0 [node name="texture" parent="." index="3"] sprite_frames = SubResource("SpriteFrames_r6sud") @@ -36,4 +36,4 @@ texture = ExtResource("3_r6sud") position = Vector2(0, 15) shape = SubResource("RectangleShape2D_r6sud") -[node name="normal" type="Node2D" parent="texture/weapons" index="0"] +[node name="normal" type="Node2D" parent="texture/weapons" index="0" unique_id=482903999] diff --git a/components/Weapons/CursorKnife.tscn b/components/Weapons/CursorKnife.tscn index 2a6a399..0814a5c 100644 --- a/components/Weapons/CursorKnife.tscn +++ b/components/Weapons/CursorKnife.tscn @@ -1,16 +1,17 @@ -[gd_scene load_steps=5 format=3 uid="uid://dgxvgsipl0gr1"] +[gd_scene format=3 uid="uid://dgxvgsipl0gr1"] [ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_bri6r"] [ext_resource type="Script" uid="uid://jyalew2bgcnk" path="res://scripts/Contents/Weapons/CursorKnife.gd" id="2_sn7uu"] [ext_resource type="Texture2D" uid="uid://blnryfwabfo5v" path="res://resources/weapons/CursorKnife.png" id="3_mdipf"] [ext_resource type="AudioStream" uid="uid://b3y226i1875iq" path="res://resources/sounds/effect/cursor.wav" id="4_vttri"] -[node name="CursorKnife" instance=ExtResource("1_bri6r")] +[node name="CursorKnife" unique_id=873917839 instance=ExtResource("1_bri6r")] script = ExtResource("2_sn7uu") avatarTexture = ExtResource("3_mdipf") displayName = "光标刃轮" typeTopic = 1 costBeachball = 350 +oneShoot = true store = { "atk": 10, "speed": 0.004 @@ -20,21 +21,22 @@ storeType = { "speed": 2 } descriptionTemplate = "造成$atk点伤害,攻击速度+$speed。" -cooldown = 300.0 -debugRebuild = true -[node name="attack" parent="sounds" index="0"] +[node name="attack" parent="sounds" parent_id_path=PackedInt32Array(1775425991) index="0" unique_id=853583292] stream = ExtResource("4_vttri") -[node name="avatar" parent="container/info" index="0"] +[node name="avatar" parent="container/info" parent_id_path=PackedInt32Array(1625294072) index="0" unique_id=1021985889] texture = ExtResource("3_mdipf") -[node name="beachball" parent="container/info/infos" index="1"] +[node name="beachball" parent="container/info/infos" parent_id_path=PackedInt32Array(492799150) index="1" unique_id=653442983] count = 350 -[node name="name" parent="container/info/displays" index="0"] +[node name="name" parent="container/info/displays" parent_id_path=PackedInt32Array(784441328) index="0" unique_id=1576068972] displayName = "光标刃轮" typeTopic = 1 -[node name="description" parent="container" index="2"] +[node name="description" parent="container" parent_id_path=PackedInt32Array(575698869) index="2" unique_id=566230682] text = "[center]造成[color=cyan]10[/color]点伤害,攻击速度+[color=cyan]0.4%[/color]。[/center]" + +[node name="tease" parent="container" parent_id_path=PackedInt32Array(575698869) index="3" unique_id=689277044] +visible = false diff --git a/components/Weapons/Oxygener.tscn b/components/Weapons/Oxygener.tscn index 2bd9e7b..d50fc13 100644 --- a/components/Weapons/Oxygener.tscn +++ b/components/Weapons/Oxygener.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=4 format=3 uid="uid://b5ebx8duvgtt5"] +[gd_scene format=3 uid="uid://b5ebx8duvgtt5"] [ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_8jd12"] [ext_resource type="Script" uid="uid://bjraoa0lwchon" path="res://scripts/Contents/Weapons/Oxygener.gd" id="2_thqd2"] [ext_resource type="Texture2D" uid="uid://gpwxs56alc7m" path="res://resources/weapons/oxygener.png" id="2_xmkcx"] -[node name="Oxygener" instance=ExtResource("1_8jd12")] +[node name="Oxygener" unique_id=742545556 instance=ExtResource("1_8jd12")] script = ExtResource("2_thqd2") avatarTexture = ExtResource("2_xmkcx") displayName = "氧化加农炮" @@ -24,17 +24,22 @@ storeType = { "max-n": 1, "min-n": 1 } -descriptionTemplate = "高速喷出[b]火焰[/b],造成$fireatk点伤害。小概率喷出[b]硝化火[/b],召唤$min-n~$max-n滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成$atk点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射$count次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b]。" +descriptionTemplate = "高速喷出[b]火焰[/b],造成$fireatk点伤害。小概率喷出[b]硝化火[/b],召唤$min-n~$max-n滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成$atk点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射$count次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b], +如果没有则消耗[color=yellow]5[/color]点[b]能量[/b]。" cooldown = 50.0 debugRebuild = true -[node name="avatar" parent="container/info" index="0"] +[node name="avatar" parent="container/info" parent_id_path=PackedInt32Array(1625294072) index="0" unique_id=1021985889] texture = ExtResource("2_xmkcx") -[node name="name" parent="container/info/displays" index="0"] +[node name="name" parent="container/info/displays" parent_id_path=PackedInt32Array(784441328) index="0" unique_id=1576068972] displayName = "氧化加农炮" quality = 0 typeTopic = 2 -[node name="description" parent="container" index="2"] -text = "[center]高速喷出[b]火焰[/b],造成[color=cyan]5.00[/color]点伤害。小概率喷出[b]硝化火[/b],召唤[color=cyan]2[/color]~[color=cyan]7[/color]滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成[color=cyan]10.00[/color]点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射[color=cyan]1[/color]次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b]。[/center]" +[node name="description" parent="container" parent_id_path=PackedInt32Array(575698869) index="2" unique_id=566230682] +text = "[center]高速喷出[b]火焰[/b],造成[color=cyan]5.00[/color]点伤害。小概率喷出[b]硝化火[/b],召唤[color=cyan]2[/color]~[color=cyan]7[/color]滴[b]浓硝酸[/b]围绕在火焰旁,每滴造成[color=cyan]10.00[/color]点伤害。[b]火焰[/b]具有高额击退效果,[b]浓硝酸[/b]液滴的射程较短,每发射[color=cyan]1[/color]次火焰会消耗[color=yellow]1[/color]个[b]篮球[/b], +如果没有则消耗[color=yellow]5[/color]点[b]能量[/b]。[/center]" + +[node name="tease" parent="container" parent_id_path=PackedInt32Array(575698869) index="3" unique_id=689277044] +visible = false diff --git a/components/Weapons/WhiteSoul.tscn b/components/Weapons/WhiteSoul.tscn index 2c303f9..f13e16f 100644 --- a/components/Weapons/WhiteSoul.tscn +++ b/components/Weapons/WhiteSoul.tscn @@ -20,8 +20,9 @@ storeType = { "count": 1, "radius": 0.0 } -descriptionTemplate = "从天而降$count支目标位于鼠标位置半径$radius内的怪物灵魂,造成$atk点伤害。" +descriptionTemplate = "从天而降$count支目标位于半径$radius内的[b]怪物灵魂[/b],造成$atk点伤害,穿透+[color=yellow]50%[/color]。" sources = Array[String](["Terraria", "Undertale"]) +debugRebuild = true [node name="avatar" parent="container/info" parent_id_path=PackedInt32Array(1625294072) index="0" unique_id=1021985889] texture = ExtResource("2_kcegs") @@ -37,4 +38,7 @@ quality = 3 text = "Terraria × Undertale" [node name="description" parent="container" parent_id_path=PackedInt32Array(575698869) index="2" unique_id=566230682] -text = "[center]从天而降[color=cyan]1[/color]支目标位于鼠标位置半径[color=cyan]100.00[/color]内的怪物灵魂,造成[color=cyan]10[/color]点伤害。[/center]" +text = "[center]从天而降[color=cyan]1[/color]支目标位于半径[color=cyan]100.00[/color]内的[b]怪物灵魂[/b],造成[color=cyan]10[/color]点伤害,穿透+[color=yellow]50%[/color]。[/center]" + +[node name="tease" parent="container" parent_id_path=PackedInt32Array(575698869) index="3" unique_id=689277044] +visible = false diff --git a/scripts/Contents/Bullets/AcidBulletBase.gd b/scripts/Contents/Bullets/AcidBulletBase.gd index 1857bbb..950b323 100644 --- a/scripts/Contents/Bullets/AcidBulletBase.gd +++ b/scripts/Contents/Bullets/AcidBulletBase.gd @@ -22,4 +22,4 @@ func ai(): position = storm.position + Vector2.from_angle(deg_to_rad((lifeTimePercent() + randomPercent) * 360)) * 150 * (1 - lifeTimePercent()) rotation = storm.position.angle_to_point(position) + deg_to_rad(90) else: - tryDestroy() + PresetBulletAI.forward(self , rotation) diff --git a/scripts/Contents/Bullets/NuclearBomb.gd b/scripts/Contents/Bullets/NuclearBomb.gd index 7dadfe6..917ab81 100644 --- a/scripts/Contents/Bullets/NuclearBomb.gd +++ b/scripts/Contents/Bullets/NuclearBomb.gd @@ -13,8 +13,8 @@ func spawn(): hitbox.disabled = true hitbox.shape.radius = radius warnbg.size = Vector2.ONE * 2 * radius - anchor.global_rotation = 0 func ai(): + anchor.global_rotation = 0 speed *= 0.99 PresetBulletAI.forward(self , rotation) if timeLived() > countdown: diff --git a/scripts/Contents/Bullets/WhiteSoul.gd b/scripts/Contents/Bullets/WhiteSoul.gd index 6be588f..36d3b4c 100644 --- a/scripts/Contents/Bullets/WhiteSoul.gd +++ b/scripts/Contents/Bullets/WhiteSoul.gd @@ -1,6 +1,16 @@ extends BulletBase +class_name WhiteSoulBullet +var floorPos: Vector2 + +func spawn(): + hitbox.disabled = true + scale *= randf_range(0.7, 1.3) + speed *= randf_range(0.85, 1.15) func ai(): - PresetBulletAI.forward(self, rotation) - if position.y > CameraManager.instance.position.y + QuickUI.getWindowSize().y / 2: + scale += Vector2.ONE * 0.005 + PresetBulletAI.forward(self , rotation) + if position.distance_to(floorPos) < 50: tryDestroy() + elif position.distance_to(floorPos) < 100: + hitbox.disabled = false diff --git a/scripts/Contents/Summons/LGBTFlag.gd b/scripts/Contents/Summons/LGBTFlag.gd index 65f0490..6489980 100644 --- a/scripts/Contents/Summons/LGBTFlag.gd +++ b/scripts/Contents/Summons/LGBTFlag.gd @@ -6,6 +6,7 @@ var count: int = 0 var angle: float = 0 func register(): + fields[FieldStore.Entity.MAX_HEALTH] = 500 attackCooldownMap[0] = 1000 func ai(): tryAttack(0) diff --git a/scripts/Contents/Weapons/Oxygener.gd b/scripts/Contents/Weapons/Oxygener.gd index ac19c0e..31759ba 100644 --- a/scripts/Contents/Weapons/Oxygener.gd +++ b/scripts/Contents/Weapons/Oxygener.gd @@ -8,8 +8,10 @@ func update(to: int, origin: Dictionary, _entity: EntityBase): origin["count"] *= soulLevel return origin func checkAttack(entity: EntityBase) -> bool: - return entity.useItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}) + return entity.hasItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}) || entity.isEnergyEnough(5) func attack(entity: EntityBase): + if !entity.useItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}): + entity.useEnergy(5) for bullet in BulletBase.generate( ComponentManager.getBullet("OxygenFire"), entity, diff --git a/scripts/Contents/Weapons/WhiteSoul.gd b/scripts/Contents/Weapons/WhiteSoul.gd index 655c320..5938907 100644 --- a/scripts/Contents/Weapons/WhiteSoul.gd +++ b/scripts/Contents/Weapons/WhiteSoul.gd @@ -8,11 +8,13 @@ func update(to, origin, _entity): return origin func attack(entity: EntityBase): for i in readStore("count"): - var myPos = get_global_mouse_position() + QuickUI.getWindowSize() * Vector2(randf_range(-1, 1) * 0.25, -1) - for j in BulletBase.generate(ComponentManager.getBullet("WhiteSoul"), entity, - myPos, - myPos.angle_to_point(get_global_mouse_position() + MathTool.sampleInCircle(readStore("radius"))) + var myFloor = get_global_mouse_position() + MathTool.sampleInCircle(readStore("radius")) + for bullet in BulletBase.generate(ComponentManager.getBullet("WhiteSoul"), entity, + get_global_mouse_position() + QuickUI.getWindowSize() * Vector2(randf_range(-1, 1) * 0.25, -1), + 0 ): - if j is BulletBase: - j.baseDamage = readStore("atk") + if bullet is WhiteSoulBullet: + bullet.look_at(myFloor) + bullet.floorPos = myFloor + bullet.baseDamage = readStore("atk") return true