From a056f75fdb48fb3c1b5cd7a1ddf102e9b5f6f460 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, 26 Sep 2025 22:12:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=AD=90=E5=BC=B9):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E7=81=B5=E9=AD=82=E5=AD=90=E5=BC=B9=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加新的WhiteSoul子弹类型,继承自BulletBase 调整SevenSoul子弹逻辑,使其能生成WhiteSoul子弹 修改Chick角色的攻击冷却时间和子弹数量 更新SevenSoul武器的伤害描述和音效音量 将默认测试波次改为Chick 移除Diamond子弹的自伤逻辑 --- components/Bullets/WhiteSoul.tscn | 57 +++++++++++++++++++++++++++ components/Weapons/SevenSoul.tscn | 3 +- scripts/Contents/Bullets/Diamond.gd | 1 - scripts/Contents/Bullets/SevenSoul.gd | 5 +++ scripts/Contents/Bullets/WhiteSoul.gd | 8 ++++ scripts/Contents/Characters/Chick.gd | 4 +- scripts/Contents/Wave.gd | 2 +- 7 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 components/Bullets/WhiteSoul.tscn create mode 100644 scripts/Contents/Bullets/WhiteSoul.gd diff --git a/components/Bullets/WhiteSoul.tscn b/components/Bullets/WhiteSoul.tscn new file mode 100644 index 0000000..1100df5 --- /dev/null +++ b/components/Bullets/WhiteSoul.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=10 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" path="res://scripts/Contents/Bullets/WhiteSoul.gd" id="2_ld7n7"] +[ext_resource type="Texture2D" uid="uid://wy10fc3bqppg" path="res://resources/bullets/seven-soul/soul.png" id="2_mqva0"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_3yyb4"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_mqva0") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[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 + +[sub_resource type="CurveTexture" id="CurveTexture_bd63g"] +curve = SubResource("Curve_r03vp") + +[sub_resource type="Curve" id="Curve_rtb8e"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.75), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_7ga5a"] +curve = SubResource("Curve_rtb8e") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_u4kq5"] +particle_flag_disable_z = true +direction = Vector3(0, -1, 0) +spread = 0.0 +initial_velocity_min = 150.0 +initial_velocity_max = 150.0 +gravity = Vector3(0, 0, 0) +scale_min = 0.8 +scale_max = 0.8 +scale_curve = SubResource("CurveTexture_7ga5a") +alpha_curve = SubResource("CurveTexture_bd63g") + +[node name="WhiteSoul" instance=ExtResource("1_k41ea")] +texture_filter = 1 +script = ExtResource("2_ld7n7") +speed = 1.0 + +[node name="texture" parent="." index="0"] +rotation = -1.5708 +sprite_frames = SubResource("SpriteFrames_3yyb4") + +[node name="trail" type="GPUParticles2D" parent="texture" index="1"] +amount = 10 +process_material = SubResource("ParticleProcessMaterial_u4kq5") +texture = ExtResource("2_mqva0") +local_coords = true diff --git a/components/Weapons/SevenSoul.tscn b/components/Weapons/SevenSoul.tscn index 0b56476..bc61090 100644 --- a/components/Weapons/SevenSoul.tscn +++ b/components/Weapons/SevenSoul.tscn @@ -18,6 +18,7 @@ cooldown = 2000.0 [node name="attack" parent="sounds" index="0"] stream = ExtResource("4_tmgox") +volume_db = 20.0 [node name="avatar" parent="container/info" index="0"] texture = ExtResource("4_a4r2b") @@ -27,4 +28,4 @@ displayName = "人类灵魂" typeTopic = 3 [node name="description" parent="container" index="2"] -text = "[center]召唤7条人类灵魂,每条以10Hz的频率造成[color=cyan]2[/color]→[color=yellow]3[/color]点伤害。[/center]" +text = "[center]召唤7条人类灵魂,每条以10Hz的频率造成[color=cyan]1[/color]→[color=yellow]2[/color]点伤害。[/center]" diff --git a/scripts/Contents/Bullets/Diamond.gd b/scripts/Contents/Bullets/Diamond.gd index 93f1f4e..d8c11a1 100644 --- a/scripts/Contents/Bullets/Diamond.gd +++ b/scripts/Contents/Bullets/Diamond.gd @@ -6,7 +6,6 @@ const traceTime = 1500 func register(): damage = 2 func ai(): - canDamageSelf = !(timeLived() >= traceTime) PresetBulletAI.forward(self, rotation) if timeLived() < traceTime: PresetBulletAI.trace(self, launcher.currentFocusedBoss.getTrackingAnchor(), 0.05) diff --git a/scripts/Contents/Bullets/SevenSoul.gd b/scripts/Contents/Bullets/SevenSoul.gd index d45cb12..ffe7bd5 100644 --- a/scripts/Contents/Bullets/SevenSoul.gd +++ b/scripts/Contents/Bullets/SevenSoul.gd @@ -9,6 +9,7 @@ var colors = [ "#FDEB0F" ] var index = 0 +var spawnedChild = false @onready var heart = $"%heart" @onready var effect: GPUParticles2D = $"%effect" @@ -16,12 +17,16 @@ var index = 0 func spawn(): modulate = Color(colors[index % colors.size()]) effect.emitting = true + func ai(): rotation_degrees = 360.0 / colors.size() * index + timeLived() / 20000.0 * 360 - index / 6.0 * 360.0 heart.global_rotation_degrees = 0 PresetBulletAI.lockLauncher(self, launcher, true) func applyDot(): if timeLived() > 20000 * ((6.0 - index) / 6.0): + if !spawnedChild: + BulletBase.generate(ComponentManager.getBullet("WhiteSoul"), launcher, heart.global_position, rotation) + spawnedChild = true BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position())) await TickTool.millseconds(100) return true diff --git a/scripts/Contents/Bullets/WhiteSoul.gd b/scripts/Contents/Bullets/WhiteSoul.gd new file mode 100644 index 0000000..7f166c3 --- /dev/null +++ b/scripts/Contents/Bullets/WhiteSoul.gd @@ -0,0 +1,8 @@ +extends BulletBase + +func register(): + speed = 1 +func ai(): + speed *= 1.1 + damage = speed + PresetBulletAI.forward(self, rotation) diff --git a/scripts/Contents/Characters/Chick.gd b/scripts/Contents/Characters/Chick.gd index a438491..6bfbfdf 100644 --- a/scripts/Contents/Characters/Chick.gd +++ b/scripts/Contents/Characters/Chick.gd @@ -6,7 +6,7 @@ class_name Chick func register(): fields[FieldStore.Entity.MAX_HEALTH] = 1000 fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.4 - attackCooldownMap[0] = 200 + attackCooldownMap[0] = 400 attackCooldownMap[1] = 12000 attackCooldownMap[2] = 2000 attackCooldownMap[3] = 3000 @@ -25,7 +25,7 @@ func ai(): func attack(type): if type == 0: var weaponPos = findWeaponAnchor("normal") - for i in randi_range(10, 20): + for i in randi_range(7, 16): BulletBase.generate(ComponentManager.getBullet("Diamond"), self, weaponPos + MathTool.randv2_range(20), rotation + deg_to_rad(randf_range(-90, 90))) elif type == 1: var laserCount = randi_range(2, 4) diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index ad3faae..3062d57 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -30,7 +30,7 @@ static var WAVE_TESTBOSS_CHICK = [ Wave.create("Chick", 0, 0, true, 0, INF, 10), ] static var WAVE_EMPTY = [] -static var data = WAVE_TESTBOSS_BEAR +static var data = WAVE_TESTBOSS_CHICK static func customStart(): if false: