diff --git a/components/Abstracts/EntityBase.tscn b/components/Abstracts/EntityBase.tscn index 2418b84..d090686 100644 --- a/components/Abstracts/EntityBase.tscn +++ b/components/Abstracts/EntityBase.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 format=3 uid="uid://cvogxi7mktumf"] +[gd_scene load_steps=36 format=3 uid="uid://cvogxi7mktumf"] [ext_resource type="Script" path="res://scripts/Statemachine/EntityBase.gd" id="1_mvol6"] [ext_resource type="Texture2D" uid="uid://dwwpkn4q07ja2" path="res://icon.svg" id="2_7lpu0"] @@ -212,6 +212,47 @@ color_ramp = SubResource("GradientTexture1D_j8vyx") color_initial_ramp = SubResource("GradientTexture1D_j74g5") alpha_curve = SubResource("CurveTexture_r5gvu") +[sub_resource type="Curve" id="Curve_bdwpn"] +_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_vvfxd"] +curve = SubResource("Curve_bdwpn") + +[sub_resource type="Curve" id="Curve_kwqoa"] +_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_065by"] +curve = SubResource("Curve_kwqoa") + +[sub_resource type="Gradient" id="Gradient_futl5"] +colors = PackedColorArray(1, 0, 0, 1, 0.394531, 0, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_4n0se"] +gradient = SubResource("Gradient_futl5") + +[sub_resource type="Gradient" id="Gradient_qttew"] +colors = PackedColorArray(1, 1, 1, 1, 0.597656, 0.597656, 0.597656, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_joqdg"] +gradient = SubResource("Gradient_qttew") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_f3xas"] +particle_flag_disable_z = true +angle_min = 1.07288e-05 +angle_max = 360.0 +angle_curve = SubResource("CurveTexture_065by") +direction = Vector3(-1, 0, 0) +spread = 180.0 +initial_velocity_max = 150.0 +gravity = Vector3(0, 200, 0) +scale_min = 3.0 +scale_max = 8.0 +color_ramp = SubResource("GradientTexture1D_joqdg") +color_initial_ramp = SubResource("GradientTexture1D_4n0se") +alpha_curve = SubResource("CurveTexture_vvfxd") + [sub_resource type="CircleShape2D" id="CircleShape2D_34h7q"] [node name="EntityBase" type="CharacterBody2D"] @@ -274,6 +315,14 @@ z_index = -1 amount = 300 process_material = SubResource("ParticleProcessMaterial_kndb2") +[node name="deadParticle" type="GPUParticles2D" parent="texture"] +unique_name_in_owner = true +emitting = false +amount = 100 +process_material = SubResource("ParticleProcessMaterial_f3xas") +one_shot = true +explosiveness = 1.0 + [node name="statebar" parent="." instance=ExtResource("2_uje1g")] unique_name_in_owner = true position = Vector2(0, -100) diff --git a/components/Bullets/ChickLaser.tscn b/components/Bullets/ChickLaser.tscn index a0b7790..b1fab27 100644 --- a/components/Bullets/ChickLaser.tscn +++ b/components/Bullets/ChickLaser.tscn @@ -208,10 +208,10 @@ metadata/_edit_vertical_guides_ = [705.0] [node name="rect" parent="texture" index="0"] material = SubResource("ShaderMaterial_x6ivr") -offset_left = 204.0 -offset_top = 25.0 -offset_right = 254.0 -offset_bottom = 525.0 +offset_left = 188.0 +offset_top = 0.0 +offset_right = 238.0 +offset_bottom = 500.0 [node name="particles" parent="texture/rect" index="0"] position = Vector2(25, 250) @@ -221,7 +221,7 @@ lifetime = 0.1 visibility_rect = Rect2(-50, -250, 100, 500) [node name="launcher" parent="texture/rect" index="1"] -position = Vector2(25, -21) +position = Vector2(25, -13.9999) scale = Vector2(0.525, 0.525) [node name="animator" parent="texture" index="1"] diff --git a/components/Characters/Chick.tscn b/components/Characters/Chick.tscn index b49b80e..6e2aabd 100644 --- a/components/Characters/Chick.tscn +++ b/components/Characters/Chick.tscn @@ -1,12 +1,15 @@ -[gd_scene load_steps=9 format=3 uid="uid://b0ncrvm8u4pox"] +[gd_scene load_steps=12 format=3 uid="uid://b0ncrvm8u4pox"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_goqmy"] [ext_resource type="Script" path="res://scripts/Contents/Characters/Chick.gd" id="2_r6bub"] [ext_resource type="Texture2D" uid="uid://7pkplcqqxvnp" path="res://resources/characters/chick/chick-a.svg" id="2_syddq"] [ext_resource type="Texture2D" uid="uid://dj5dvqb8gsedr" path="res://resources/characters/chick/chick-b.svg" id="3_064jv"] [ext_resource type="AudioStream" uid="uid://b7pxuov1id0ho" path="res://resources/sounds/effect/Pew.mp3" id="3_ik1xf"] +[ext_resource type="AudioStream" uid="uid://bgo8p1l77xrbe" path="res://resources/sounds/effect/Magic Spell.wav" id="4_2qabh"] [ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="4_mrsne"] +[ext_resource type="AudioStream" uid="uid://cee6rxv2uqynh" path="res://resources/sounds/effect/Flame.ogg" id="5_vcsbb"] [ext_resource type="PackedScene" uid="uid://dny25qkcvtaa2" path="res://components/Effects/FirePot.tscn" id="6_kvx3n"] +[ext_resource type="AudioStream" uid="uid://dn6bijr513wyp" path="res://resources/sounds/effect/Drum Boing.wav" id="7_qjhwc"] [sub_resource type="SpriteFrames" id="SpriteFrames_xji3d"] animations = [{ @@ -41,10 +44,19 @@ appleCount = Vector2i(2, 4) [node name="hurt" parent="sounds" index="3"] stream = ExtResource("3_ik1xf") +[node name="attack0" parent="sounds" index="5"] +stream = ExtResource("4_2qabh") + [node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="6"] stream = ExtResource("4_mrsne") volume_db = -10.0 +[node name="attack2" type="AudioStreamPlayer2D" parent="sounds" index="7"] +stream = ExtResource("5_vcsbb") + +[node name="attack3" type="AudioStreamPlayer2D" parent="sounds" index="8"] +stream = ExtResource("7_qjhwc") + [node name="texture" parent="." index="1"] position = Vector2(0, -37) sprite_frames = SubResource("SpriteFrames_xji3d") diff --git a/components/Effects/DeadBlood.tscn b/components/Effects/DeadBlood.tscn new file mode 100644 index 0000000..d3a28ae --- /dev/null +++ b/components/Effects/DeadBlood.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=12 format=3 uid="uid://b3hoapgh61w3e"] + +[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_neao1"] +[ext_resource type="AudioStream" uid="uid://bjtxl0ec0dfw5" path="res://resources/sounds/effect/Squish Pop.wav" id="2_sjht3"] + +[sub_resource type="Curve" id="Curve_w5fhr"] +_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_py1or"] +curve = SubResource("Curve_w5fhr") + +[sub_resource type="Curve" id="Curve_ux33m"] +_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_kt65p"] +curve = SubResource("Curve_ux33m") + +[sub_resource type="Gradient" id="Gradient_ydyr0"] +colors = PackedColorArray(1, 0, 0, 1, 0.394531, 0, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_8qmb3"] +gradient = SubResource("Gradient_ydyr0") + +[sub_resource type="Gradient" id="Gradient_4t65b"] +colors = PackedColorArray(1, 1, 1, 1, 0.597656, 0.597656, 0.597656, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_ltuue"] +gradient = SubResource("Gradient_4t65b") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_g7bcr"] +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 10.0 +angle_min = 1.07288e-05 +angle_max = 360.0 +angle_curve = SubResource("CurveTexture_kt65p") +direction = Vector3(-1, 0, 0) +spread = 180.0 +initial_velocity_max = 200.0 +gravity = Vector3(0, 200, 0) +scale_min = 5.0 +scale_max = 10.0 +color_ramp = SubResource("GradientTexture1D_ltuue") +color_initial_ramp = SubResource("GradientTexture1D_8qmb3") +alpha_curve = SubResource("CurveTexture_py1or") + +[node name="DeadBlood" instance=ExtResource("1_neao1")] +spawnSound = "spawn" + +[node name="spawn" parent="sounds" index="0"] +stream = ExtResource("2_sjht3") + +[node name="particles" parent="." index="1"] +amount = 100 +process_material = SubResource("ParticleProcessMaterial_g7bcr") diff --git a/resources/sounds/effect/Drum Boing.wav b/resources/sounds/effect/Drum Boing.wav new file mode 100644 index 0000000..bb31651 Binary files /dev/null and b/resources/sounds/effect/Drum Boing.wav differ diff --git a/resources/sounds/effect/Drum Boing.wav.import b/resources/sounds/effect/Drum Boing.wav.import new file mode 100644 index 0000000..8d7cd63 --- /dev/null +++ b/resources/sounds/effect/Drum Boing.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dn6bijr513wyp" +path="res://.godot/imported/Drum Boing.wav-f090a9e9e01992567c3fb709b5b41857.sample" + +[deps] + +source_file="res://resources/sounds/effect/Drum Boing.wav" +dest_files=["res://.godot/imported/Drum Boing.wav-f090a9e9e01992567c3fb709b5b41857.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/resources/sounds/effect/Flame.ogg b/resources/sounds/effect/Flame.ogg new file mode 100644 index 0000000..ef203e0 Binary files /dev/null and b/resources/sounds/effect/Flame.ogg differ diff --git a/resources/sounds/effect/Flame.ogg.import b/resources/sounds/effect/Flame.ogg.import new file mode 100644 index 0000000..62562fd --- /dev/null +++ b/resources/sounds/effect/Flame.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cee6rxv2uqynh" +path="res://.godot/imported/Flame.ogg-03a5b18aeebb75d3cec38a59046a469e.oggvorbisstr" + +[deps] + +source_file="res://resources/sounds/effect/Flame.ogg" +dest_files=["res://.godot/imported/Flame.ogg-03a5b18aeebb75d3cec38a59046a469e.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/resources/sounds/effect/Magic Spell.wav b/resources/sounds/effect/Magic Spell.wav new file mode 100644 index 0000000..5caecf8 Binary files /dev/null and b/resources/sounds/effect/Magic Spell.wav differ diff --git a/resources/sounds/effect/Magic Spell.wav.import b/resources/sounds/effect/Magic Spell.wav.import new file mode 100644 index 0000000..e75ec73 --- /dev/null +++ b/resources/sounds/effect/Magic Spell.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bgo8p1l77xrbe" +path="res://.godot/imported/Magic Spell.wav-5293554c522fa39b42ee6fbe9a20cc35.sample" + +[deps] + +source_file="res://resources/sounds/effect/Magic Spell.wav" +dest_files=["res://.godot/imported/Magic Spell.wav-5293554c522fa39b42ee6fbe9a20cc35.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/resources/sounds/effect/Squish Pop.wav b/resources/sounds/effect/Squish Pop.wav new file mode 100644 index 0000000..3e2b5c2 Binary files /dev/null and b/resources/sounds/effect/Squish Pop.wav differ diff --git a/resources/sounds/effect/Squish Pop.wav.import b/resources/sounds/effect/Squish Pop.wav.import new file mode 100644 index 0000000..a1fdb9d --- /dev/null +++ b/resources/sounds/effect/Squish Pop.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bjtxl0ec0dfw5" +path="res://.godot/imported/Squish Pop.wav-f3096dbf743894be425e11fe0e37111d.sample" + +[deps] + +source_file="res://resources/sounds/effect/Squish Pop.wav" +dest_files=["res://.godot/imported/Squish Pop.wav-f3096dbf743894be425e11fe0e37111d.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/scripts/Contents/Characters/Chick.gd b/scripts/Contents/Characters/Chick.gd index 2c10d0b..b8321fd 100644 --- a/scripts/Contents/Characters/Chick.gd +++ b/scripts/Contents/Characters/Chick.gd @@ -40,10 +40,8 @@ func attack(type): firepot.shot() BulletBase.generate(preload("res://components/Bullets/FireScan.tscn"), self, weaponPos, target) elif type == 3: - trailing = true BulletBase.generate(preload("res://components/Bullets/ChickSprint.tscn"), self, position, 0) - await trySprint() - trailing = false + trySprint() return true func sprint(): move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true) diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 1be7707..e50f25a 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -55,7 +55,7 @@ var inventoryMax = { @export var defaultCooldownUnit: float = 100 @export var isBoss: bool = false @export var displayName: String = "未知实体" -@export var sprintMultiplier: float = 3 +@export var sprintMultiplier: float = 5 @export var drops: Array[ItemStore.ItemType] = [] @export var dropCounts: Array[Vector2] = [] @export var appleCount: Vector2i = Vector2(0, 2) # 死亡后掉落的苹果数量 @@ -203,10 +203,12 @@ func tryAttack(type: int, needChargeUp: bool = false): attack(type) return state func trySprint(): + trailing = true playSound("sprint") sprint() sprinting = true await TickTool.until(func(): return !sprinting) + trailing = false func tryDie(by: BulletBase): for drop in range(min(len(drops), len(dropCounts))): var item = drops[drop] @@ -220,6 +222,7 @@ func tryDie(by: BulletBase): ) or isBoss: for i in randi_range(appleCount.x, appleCount.y): ItemDropped.generate(ItemStore.ItemType.APPLE, 1, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset)) + EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot() await die() if isPlayer() and UIState.player == self: UIState.setPanel("GameOver")