diff --git a/components/Bullets/BlockWall.tscn b/components/Bullets/BlockWall.tscn new file mode 100644 index 0000000..b9a0e11 --- /dev/null +++ b/components/Bullets/BlockWall.tscn @@ -0,0 +1,20 @@ +[gd_scene format=3 uid="uid://cch4xtc70ad5c"] + +[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_3kq6o"] +[ext_resource type="Texture2D" uid="uid://cqcakyrw4vbfn" path="res://resources/bullets/blockwall/blockwall.svg" id="2_k65pw"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_3x2nv"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_k65pw") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="BulletBase" unique_id=5571707 instance=ExtResource("1_3kq6o")] + +[node name="texture" parent="." index="0" unique_id=162977358] +sprite_frames = SubResource("SpriteFrames_3x2nv") diff --git a/components/Bullets/Daoli.tscn b/components/Bullets/Daoli.tscn new file mode 100644 index 0000000..6f522e5 --- /dev/null +++ b/components/Bullets/Daoli.tscn @@ -0,0 +1,28 @@ +[gd_scene format=3 uid="uid://b6ysa5wejv2hd"] + +[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_tgmam"] +[ext_resource type="Texture2D" uid="uid://dp6memu16bc7b" path="res://resources/bullets/wood/daoli.png" id="2_cl8cv"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_odnqa"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_cl8cv") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_21d8r"] +radius = 18.0 + +[node name="Daoli" unique_id=5571707 instance=ExtResource("1_tgmam")] + +[node name="texture" parent="." index="0" unique_id=162977358] +scale = Vector2(0.07520806, 0.07520806) +sprite_frames = SubResource("SpriteFrames_odnqa") + +[node name="hitbox" parent="." index="1" unique_id=175349408] +position = Vector2(4, 4) +shape = SubResource("CircleShape2D_21d8r") diff --git a/components/Bullets/Wood.tscn b/components/Bullets/Wood.tscn index e6007e8..ad1e307 100644 --- a/components/Bullets/Wood.tscn +++ b/components/Bullets/Wood.tscn @@ -3,6 +3,9 @@ [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_yfmqu"] [ext_resource type="Script" uid="uid://bkopn3gee3qp1" path="res://scripts/Contents/Bullets/Wood.gd" id="2_f5eiv"] [ext_resource type="Texture2D" uid="uid://bols4gt28y3a" path="res://resources/bullets/wood/wood.png" id="3_dol0b"] +[ext_resource type="AudioStream" uid="uid://lwsltsv0tk0t" path="res://resources/sounds/effect/xiangkan.wav" id="4_7fjhq"] +[ext_resource type="Texture2D" uid="uid://chn486hoa86bs" path="res://resources/bullets/wood/mother.png" id="4_dth5r"] +[ext_resource type="Texture2D" uid="uid://dp6memu16bc7b" path="res://resources/bullets/wood/daoli.png" id="5_8j03k"] [sub_resource type="SpriteFrames" id="SpriteFrames_dth5r"] animations = [{ @@ -15,6 +18,106 @@ animations = [{ "speed": 5.0 }] +[sub_resource type="Animation" id="Animation_7i45i"] +resource_name = "destroy" +length = 0.5 +step = 0.1 + +[sub_resource type="Animation" id="Animation_vvrml"] +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_7cf0r"] +resource_name = "spawn" + +[sub_resource type="Animation" id="Animation_0q72p"] +resource_name = "xiangkan" +length = 2.0 +step = 0.1 +tracks/0/type = "audio" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("audio") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("4_7fjhq") +}], +"times": PackedFloat32Array(0) +} +tracks/0/use_blend = true + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_vaf4v"] +_data = { +&"destroy": SubResource("Animation_7i45i"), +&"loop": SubResource("Animation_vvrml"), +&"spawn": SubResource("Animation_7cf0r"), +&"xiangkan": SubResource("Animation_0q72p") +} + +[sub_resource type="Curve" id="Curve_dol0b"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.1, 1), 0.0, 0.0, 0, 0, Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 4 + +[sub_resource type="CurveTexture" id="CurveTexture_dth5r"] +curve = SubResource("Curve_dol0b") + +[sub_resource type="Curve" id="Curve_8j03k"] +_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_7fjhq"] +curve = SubResource("Curve_8j03k") + +[sub_resource type="Gradient" id="Gradient_7i45i"] +colors = PackedColorArray(1, 0, 0, 1, 1, 0.8451766, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_vvrml"] +gradient = SubResource("Gradient_7i45i") + +[sub_resource type="Curve" id="Curve_7cf0r"] +_data = [Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_0q72p"] +curve = SubResource("Curve_7cf0r") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vaf4v"] +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 50.0 +angle_min = 1.0728835e-05 +angle_max = 360.00003 +angle_curve = SubResource("CurveTexture_7fjhq") +direction = Vector3(-1, 0, 0) +spread = 0.0 +initial_velocity_min = 200.0 +initial_velocity_max = 500.0 +gravity = Vector3(0, 0, 0) +radial_accel_min = -100.0 +radial_accel_max = -100.0 +scale_min = 10.0 +scale_max = 20.0 +scale_curve = SubResource("CurveTexture_0q72p") +color_initial_ramp = SubResource("GradientTexture1D_vvrml") +alpha_curve = SubResource("CurveTexture_dth5r") + [sub_resource type="RectangleShape2D" id="RectangleShape2D_8j03k"] size = Vector2(244, 32) @@ -23,10 +126,43 @@ script = ExtResource("2_f5eiv") displayName = "浮木" penerate = 1.0 lifeTime = 5000.0 +metadata/_edit_vertical_guides_ = [200.0, -260.0] [node name="texture" parent="." index="0" unique_id=162977358] scale = Vector2(0.4, 0.4) sprite_frames = SubResource("SpriteFrames_dth5r") +[node name="animator" parent="texture" index="0" unique_id=1114087117] +libraries/ = SubResource("AnimationLibrary_vaf4v") + +[node name="audio" parent="texture" index="1" unique_id=1167114186] +max_distance = 10000.0 + +[node name="trail" type="GPUParticles2D" parent="texture" index="2" unique_id=1380786582] +z_index = 1 +position = Vector2(-322.50006, -10.000002) +amount = 150 +local_coords = true +process_material = SubResource("ParticleProcessMaterial_vaf4v") + +[node name="mother" type="Node2D" parent="texture" index="3" unique_id=673246472] +unique_name_in_owner = true +scale = Vector2(0.99999994, 0.99999994) + +[node name="motherStatic" type="Sprite2D" parent="texture/mother" index="0" unique_id=1786534151] +position = Vector2(0, -170.00002) +scale = Vector2(0.24794728, 0.24794728) +texture = ExtResource("4_dth5r") + +[node name="daoli" type="Node2D" parent="texture" index="4" unique_id=1077452115] +unique_name_in_owner = true +position = Vector2(222.5, 0) +scale = Vector2(0.99999994, 0.99999994) + +[node name="daoliStatic" type="Sprite2D" parent="texture/daoli" index="0" unique_id=1212418046] +position = Vector2(0, -92.5) +scale = Vector2(0.18411627, 0.18411627) +texture = ExtResource("5_8j03k") + [node name="hitbox" parent="." index="1" unique_id=175349408] shape = SubResource("RectangleShape2D_8j03k") diff --git a/components/Characters/Deepsea.tscn b/components/Characters/Deepsea.tscn index c32926a..5c362ab 100644 --- a/components/Characters/Deepsea.tscn +++ b/components/Characters/Deepsea.tscn @@ -3,6 +3,7 @@ [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_g8my0"] [ext_resource type="Script" uid="uid://be0o0iwf26hvx" path="res://scripts/Contents/Characters/Deepsea.gd" id="2_1qdp4"] [ext_resource type="Texture2D" uid="uid://c6kpcsu1yohak" path="res://resources/characters/deepsea/0.png" id="2_5y3f7"] +[ext_resource type="AudioStream" uid="uid://b5tswrcvrd3js" path="res://resources/sounds/effect/sddl.wav" id="3_hk3hc"] [sub_resource type="SpriteFrames" id="SpriteFrames_5y3f7"] animations = [{ @@ -24,6 +25,10 @@ size = Vector2(165, 349) script = ExtResource("2_1qdp4") displayName = "深海" +[node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="7" unique_id=1216852444] +stream = ExtResource("3_hk3hc") +volume_db = 5.0 + [node name="texture" parent="." index="3"] sprite_frames = SubResource("SpriteFrames_5y3f7") diff --git a/resources/bullets/blockwall/blockwall.svg b/resources/bullets/blockwall/blockwall.svg new file mode 100644 index 0000000..7ec475e --- /dev/null +++ b/resources/bullets/blockwall/blockwall.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/bullets/blockwall/blockwall.svg.import b/resources/bullets/blockwall/blockwall.svg.import new file mode 100644 index 0000000..b856972 --- /dev/null +++ b/resources/bullets/blockwall/blockwall.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cqcakyrw4vbfn" +path="res://.godot/imported/blockwall.svg-184482e9533ab61f4cc5d6105129e900.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/blockwall/blockwall.svg" +dest_files=["res://.godot/imported/blockwall.svg-184482e9533ab61f4cc5d6105129e900.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/resources/bullets/wood/daoli.png b/resources/bullets/wood/daoli.png new file mode 100644 index 0000000..c5b2e8e Binary files /dev/null and b/resources/bullets/wood/daoli.png differ diff --git a/resources/bullets/wood/daoli.png.import b/resources/bullets/wood/daoli.png.import new file mode 100644 index 0000000..c2c4c77 --- /dev/null +++ b/resources/bullets/wood/daoli.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dp6memu16bc7b" +path="res://.godot/imported/daoli.png-f771eac8a350ac407156a2c50b8e0c26.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/wood/daoli.png" +dest_files=["res://.godot/imported/daoli.png-f771eac8a350ac407156a2c50b8e0c26.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/resources/bullets/wood/mother.png b/resources/bullets/wood/mother.png new file mode 100644 index 0000000..62114a9 Binary files /dev/null and b/resources/bullets/wood/mother.png differ diff --git a/resources/bullets/wood/mother.png.import b/resources/bullets/wood/mother.png.import new file mode 100644 index 0000000..16a62de --- /dev/null +++ b/resources/bullets/wood/mother.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chn486hoa86bs" +path="res://.godot/imported/mother.png-0c772c2962e357099e72b539c446a5e7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/wood/mother.png" +dest_files=["res://.godot/imported/mother.png-0c772c2962e357099e72b539c446a5e7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/resources/sounds/effect/sddl.wav b/resources/sounds/effect/sddl.wav new file mode 100644 index 0000000..c023053 Binary files /dev/null and b/resources/sounds/effect/sddl.wav differ diff --git a/resources/sounds/effect/sddl.wav.import b/resources/sounds/effect/sddl.wav.import new file mode 100644 index 0000000..5e5ca57 --- /dev/null +++ b/resources/sounds/effect/sddl.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://b5tswrcvrd3js" +path="res://.godot/imported/sddl.wav-8fa1e14d07753ba380d691c1f3ea590c.sample" + +[deps] + +source_file="res://resources/sounds/effect/sddl.wav" +dest_files=["res://.godot/imported/sddl.wav-8fa1e14d07753ba380d691c1f3ea590c.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=2 diff --git a/resources/sounds/effect/xiangkan.wav b/resources/sounds/effect/xiangkan.wav new file mode 100644 index 0000000..aff5873 Binary files /dev/null and b/resources/sounds/effect/xiangkan.wav differ diff --git a/resources/sounds/effect/xiangkan.wav.import b/resources/sounds/effect/xiangkan.wav.import new file mode 100644 index 0000000..bb9c958 --- /dev/null +++ b/resources/sounds/effect/xiangkan.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://lwsltsv0tk0t" +path="res://.godot/imported/xiangkan.wav-5f54c2287f9a2499d18a3312aa54b2b8.sample" + +[deps] + +source_file="res://resources/sounds/effect/xiangkan.wav" +dest_files=["res://.godot/imported/xiangkan.wav-5f54c2287f9a2499d18a3312aa54b2b8.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=2 diff --git a/scripts/Contents/Bullets/Wood.gd b/scripts/Contents/Bullets/Wood.gd index 46981f1..c14a6c6 100644 --- a/scripts/Contents/Bullets/Wood.gd +++ b/scripts/Contents/Bullets/Wood.gd @@ -2,12 +2,32 @@ extends BulletBase class_name WoodBullet var speedV2: Vector2 = Vector2.ZERO +var shooted: bool = false + +@onready var mother: Node2D = $%mother +@onready var daoli: Node2D = $%daoli func spawn(): speedV2 = Vector2.from_angle(rotation) * 10 func ai(): + mother.global_rotation = 0 + daoli.global_rotation = 0 if is_instance_valid(launcher.currentFocusedBoss): - speedV2 += (launcher.currentFocusedBoss.position - launcher.position).normalized() * 1 + speedV2 += (launcher.currentFocusedBoss.position - launcher.position).normalized() * 1.0 speed = speedV2.length() / 2.0 rotation = speedV2.angle() PresetBulletAI.forward(self , rotation) + if !shooted && launcher.currentFocusedBoss.position.distance_to(daoli.global_position) < 300: + animator.play("xiangkan") + for i in randf_range(2, 6): + for bullet in BulletBase.generate( + ComponentManager.getBullet("Diamond"), + launcher, + daoli.global_position + MathTool.sampleInCircle(20), + 0 + ): + if bullet is Diamond: + bullet.look_at(launcher.currentFocusedBoss.position) + bullet.rotation += deg_to_rad(180) + bullet.rotation += deg_to_rad(randf_range(-1, 1) * 45) + shooted = true diff --git a/scripts/Contents/Characters/Deepsea.gd b/scripts/Contents/Characters/Deepsea.gd index af3350f..23fae1b 100644 --- a/scripts/Contents/Characters/Deepsea.gd +++ b/scripts/Contents/Characters/Deepsea.gd @@ -5,8 +5,8 @@ func register(): fields[FieldStore.Entity.MAX_HEALTH] = 2000 fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9 fields[FieldStore.Entity.OFFSET_SHOOT] = 2 - attackCooldownMap[0] = 1000 - attackCooldownMap[1] = 2000 + attackCooldownMap[0] = 2000 + attackCooldownMap[1] = 5000 func ai(): PresetEntityAI.follow(self , currentFocusedBoss) for i in 2: @@ -17,3 +17,4 @@ func attack(type: int): elif type == 1: for i in 3: BulletBase.generate(ComponentManager.getBullet("Wood"), self , position, position.angle_to_point(currentFocusedBoss.position) + i * deg_to_rad(20)) + return true diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index 4127e0a..235f7a1 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -49,8 +49,8 @@ static var WAVE_TESTBOSS_CHICK = [ Wave.create("Chick", 0, 0, true, 0, INF, 1), ] static var WAVE_JUSTJOKE = [ - Wave.create("Kernyr", 0, 0, true, 0, INF, 1), - Wave.create("CyberCat", 0, 0, true, 0, INF, 1), + # Wave.create("Kernyr", 0, 0, true, 0, INF, 1), + # Wave.create("CyberCat", 0, 0, true, 0, INF, 1), Wave.create("Deepsea", 0, 0, true, 0, INF, 1) ] static var WAVE_MOWING = [