diff --git a/components/Bullets/Needle.tscn b/components/Bullets/Needle.tscn new file mode 100644 index 0000000..f35bf47 --- /dev/null +++ b/components/Bullets/Needle.tscn @@ -0,0 +1,92 @@ +[gd_scene load_steps=14 format=3 uid="uid://bhnhfefm4m87i"] + +[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_yrddj"] +[ext_resource type="Texture2D" uid="uid://d4h0i65n0dveo" path="res://resources/bullets/needle/1.svg" id="2_enod1"] +[ext_resource type="Script" uid="uid://whqgw065ifss" path="res://scripts/Contents/Bullets/Needle.gd" id="2_mjqpl"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_mjqpl"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_enod1") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[sub_resource type="Curve" id="Curve_kvg2u"] +_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_n2a3y"] +curve = SubResource("Curve_kvg2u") + +[sub_resource type="Gradient" id="Gradient_ux5gl"] +colors = PackedColorArray(1, 0.47012484, 0, 1, 1, 0.9023062, 0.70387197, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_ikerd"] +gradient = SubResource("Gradient_ux5gl") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3yvym"] +particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(1, 40, 1) +angle_min = 1.0728835e-05 +angle_max = 360.00003 +spread = 15.0 +initial_velocity_min = -50.0 +initial_velocity_max = 50.0 +gravity = Vector3(0, 200, 0) +scale_max = 5.0 +color_initial_ramp = SubResource("GradientTexture1D_ikerd") +alpha_curve = SubResource("CurveTexture_n2a3y") + +[sub_resource type="Curve" id="Curve_enod1"] +_data = [Vector2(0, 0.4), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_mjqpl"] +curve = SubResource("Curve_enod1") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_enod1"] +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.79999995 +scale_max = 0.79999995 +alpha_curve = SubResource("CurveTexture_mjqpl") + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_enod1"] +size = Vector2(138, 8.765) + +[node name="Needle" instance=ExtResource("1_yrddj")] +script = ExtResource("2_mjqpl") +penerate = 1.0 +lifeTime = 4000.0 + +[node name="texture" parent="." index="0"] +position = Vector2(73, 0) +rotation = 1.5707964 +sprite_frames = SubResource("SpriteFrames_mjqpl") + +[node name="light" type="GPUParticles2D" parent="texture" index="1"] +z_index = -1 +position = Vector2(0, 34) +amount = 50 +preprocess = 1.0 +local_coords = true +process_material = SubResource("ParticleProcessMaterial_3yvym") + +[node name="trail" type="GPUParticles2D" parent="texture" index="2"] +z_index = -1 +texture = ExtResource("2_enod1") +local_coords = true +process_material = SubResource("ParticleProcessMaterial_enod1") + +[node name="hitbox" parent="." index="1"] +position = Vector2(67, 0) +shape = SubResource("RectangleShape2D_enod1") diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index 65b6568..4413a62 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,11 +1,10 @@ -[gd_scene load_steps=21 format=3 uid="uid://dky8574uqc18r"] +[gd_scene load_steps=20 format=3 uid="uid://dky8574uqc18r"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"] [ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] -[ext_resource type="PackedScene" uid="uid://b5ebx8duvgtt5" path="res://components/Weapons/Oxygener.tscn" id="3_0omr3"] +[ext_resource type="PackedScene" uid="uid://c65tbxm3tclw0" path="res://components/Weapons/Hetun.tscn" id="3_da2ca"] [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="PackedScene" uid="uid://cxabqjo7skxev" path="res://components/Weapons/BigLaser.tscn" id="5_joj4g"] [ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"] [ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"] [ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="8_da2ca"] @@ -102,12 +101,9 @@ process_material = SubResource("ParticleProcessMaterial_joj4g") [node name="weaponStore" parent="." index="2"] process_mode = 4 -[node name="Oxygener" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")] -offset_bottom = 446.0 +[node name="Hetun" parent="weaponStore" index="0" instance=ExtResource("3_da2ca")] debugRebuild = false -[node name="BigLaser" parent="weaponStore" index="1" instance=ExtResource("5_joj4g")] - [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Effects/Dustdown.tscn b/components/Effects/Dustdown.tscn new file mode 100644 index 0000000..5c34927 --- /dev/null +++ b/components/Effects/Dustdown.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=12 format=3 uid="uid://bu0uy17pacv6n"] + +[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_1cfxs"] +[ext_resource type="AudioStream" uid="uid://dfn8gusfga5m0" path="res://resources/sounds/effect/Low Squeak.wav" id="2_30wog"] + +[sub_resource type="Curve" id="Curve_1cfxs"] +_data = [Vector2(0.8, 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_30wog"] +curve = SubResource("Curve_1cfxs") + +[sub_resource type="Gradient" id="Gradient_1cfxs"] +colors = PackedColorArray(1, 0.47012484, 0, 1, 1, 0.9023062, 0.70387197, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_30wog"] +gradient = SubResource("Gradient_1cfxs") + +[sub_resource type="Curve" id="Curve_30wog"] +_limits = [0.0, 100.0, 0.0, 1.0] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 100), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_nreia"] +curve = SubResource("Curve_30wog") + +[sub_resource type="Curve" id="Curve_nreia"] +_data = [Vector2(0.8, 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_j1fl3"] +curve = SubResource("Curve_nreia") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_tcn64"] +particle_flag_disable_z = true +angle_min = 1.0728835e-05 +angle_max = 360.00003 +direction = Vector3(-1, 0, 0) +spread = 15.0 +initial_velocity_max = 100.0 +gravity = Vector3(0, 0, 0) +damping_curve = SubResource("CurveTexture_nreia") +scale_max = 4.0 +scale_curve = SubResource("CurveTexture_j1fl3") +color_initial_ramp = SubResource("GradientTexture1D_30wog") +alpha_curve = SubResource("CurveTexture_30wog") + +[node name="Dustdown" instance=ExtResource("1_1cfxs")] +spawnSound = "spawn" + +[node name="spawn" parent="sounds" index="0"] +stream = ExtResource("2_30wog") + +[node name="particles" parent="." index="1"] +lifetime = 2.0 +local_coords = true +process_material = SubResource("ParticleProcessMaterial_tcn64") diff --git a/components/Weapons/Hetun.tscn b/components/Weapons/Hetun.tscn new file mode 100644 index 0000000..c432b6c --- /dev/null +++ b/components/Weapons/Hetun.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=4 format=3 uid="uid://c65tbxm3tclw0"] + +[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_021hd"] +[ext_resource type="Script" uid="uid://tfptal3sgfmy" path="res://scripts/Contents/Weapons/Hetun.gd" id="2_t2ywh"] +[ext_resource type="Texture2D" uid="uid://c1xrf8255jafi" path="res://resources/weapons/hetun.png" id="2_y0xe1"] + +[node name="Hetun" instance=ExtResource("1_021hd")] +script = ExtResource("2_t2ywh") +avatarTexture = ExtResource("2_y0xe1") +displayName = "河豚" +quality = 0 +store = { +"atk": 15, +"count": 10, +"penerate": 0.2 +} +storeType = { +"atk": 1, +"count": 1, +"penerate": 2 +} +descriptionTemplate = "散射5~$count针[b]河豚刺针[/b],每根针造成$atk点伤害,撞上敌人后有$penerate概率反弹。" +cooldown = 2000.0 +debugRebuild = true + +[node name="avatar" parent="container/info" index="0"] +texture = ExtResource("2_y0xe1") + +[node name="name" parent="container/info" index="2"] +displayName = "河豚" +quality = 0 + +[node name="description" parent="container" index="2"] +text = "[center]散射5~[color=cyan]10[/color]针[b]河豚刺针[/b],每根针造成[color=cyan]15[/color]点伤害,撞上敌人后有[color=cyan]20.0%[/color]概率反弹。[/center]" diff --git a/resources/bullets/needle/1.svg b/resources/bullets/needle/1.svg new file mode 100644 index 0000000..adf7a2f --- /dev/null +++ b/resources/bullets/needle/1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/bullets/needle/1.svg.import b/resources/bullets/needle/1.svg.import new file mode 100644 index 0000000..0adc55a --- /dev/null +++ b/resources/bullets/needle/1.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d4h0i65n0dveo" +path="res://.godot/imported/1.svg-7d7231bb3b71752d763553e1d0f756c7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/bullets/needle/1.svg" +dest_files=["res://.godot/imported/1.svg-7d7231bb3b71752d763553e1d0f756c7.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/sounds/effect/Low Squeak.wav b/resources/sounds/effect/Low Squeak.wav new file mode 100644 index 0000000..362a8fd Binary files /dev/null and b/resources/sounds/effect/Low Squeak.wav differ diff --git a/resources/sounds/effect/Low Squeak.wav.import b/resources/sounds/effect/Low Squeak.wav.import new file mode 100644 index 0000000..72982a6 --- /dev/null +++ b/resources/sounds/effect/Low Squeak.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dfn8gusfga5m0" +path="res://.godot/imported/Low Squeak.wav-332cc0edb9200255d263350379684613.sample" + +[deps] + +source_file="res://resources/sounds/effect/Low Squeak.wav" +dest_files=["res://.godot/imported/Low Squeak.wav-332cc0edb9200255d263350379684613.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/weapons/hetun.png b/resources/weapons/hetun.png new file mode 100644 index 0000000..7491b02 Binary files /dev/null and b/resources/weapons/hetun.png differ diff --git a/resources/weapons/hetun.png.import b/resources/weapons/hetun.png.import new file mode 100644 index 0000000..ecd17d2 --- /dev/null +++ b/resources/weapons/hetun.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1xrf8255jafi" +path="res://.godot/imported/hetun.png-d33a239147dba03814e779bbbde3d40e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/weapons/hetun.png" +dest_files=["res://.godot/imported/hetun.png-d33a239147dba03814e779bbbde3d40e.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/scripts/Contents/Bullets/Needle.gd b/scripts/Contents/Bullets/Needle.gd new file mode 100644 index 0000000..79606ed --- /dev/null +++ b/scripts/Contents/Bullets/Needle.gd @@ -0,0 +1,21 @@ +extends BulletBase +class_name NeedleBullet + +var forwarding: bool = false + +func spawn(): + hitbox.disabled = true +func ai(): + PresetBulletAI.forward(self , rotation) + if forwarding: + speed += 0.5 + else: + speed -= 0.25 + if speed <= 0: + forwarding = true + hitbox.disabled = false +func succeedToHit(_dmg: float, entity: EntityBase): + var effect = EffectController.create(ComponentManager.getEffect("Dustdown"), entity.position) + effect.rotation = rotation + effect.shot() + rotation = Vector2.from_angle(rotation).bounce((entity.position - position).normalized()).angle() diff --git a/scripts/Contents/Bullets/Needle.gd.uid b/scripts/Contents/Bullets/Needle.gd.uid new file mode 100644 index 0000000..8618e74 --- /dev/null +++ b/scripts/Contents/Bullets/Needle.gd.uid @@ -0,0 +1 @@ +uid://whqgw065ifss diff --git a/scripts/Contents/Bullets/NuclearBomb.gd b/scripts/Contents/Bullets/NuclearBomb.gd index 5a02879..7dadfe6 100644 --- a/scripts/Contents/Bullets/NuclearBomb.gd +++ b/scripts/Contents/Bullets/NuclearBomb.gd @@ -16,7 +16,7 @@ func spawn(): anchor.global_rotation = 0 func ai(): speed *= 0.99 - PresetBulletAI.forward(self, rotation) + PresetBulletAI.forward(self , rotation) if timeLived() > countdown: tryDestroy() else: diff --git a/scripts/Contents/Weapons/Hetun.gd b/scripts/Contents/Weapons/Hetun.gd new file mode 100644 index 0000000..4e2962f --- /dev/null +++ b/scripts/Contents/Weapons/Hetun.gd @@ -0,0 +1,20 @@ +@tool +extends Weapon + +func update(to: int, origin: Dictionary, _entity: EntityBase): + origin["atk"] += 3 * to * soulLevel + origin["count"] += 5 * (soulLevel - 1) + origin["penerate"] += 0.1 * (soulLevel - 1) + return origin +func attack(entity: EntityBase): + for i in readStore("count"): + for bullet in BulletBase.generate( + ComponentManager.getBullet("Needle"), + entity, + entity.findWeaponAnchor("normal"), + entity.findWeaponAnchor("normal").angle_to_point(get_global_mouse_position()) + deg_to_rad(randf_range(-1, 1) * 30) + ): + if bullet is NeedleBullet: + bullet.baseDamage = readStore("atk") + bullet.penerate = readStore("penerate") + return true diff --git a/scripts/Contents/Weapons/Hetun.gd.uid b/scripts/Contents/Weapons/Hetun.gd.uid new file mode 100644 index 0000000..cab1550 --- /dev/null +++ b/scripts/Contents/Weapons/Hetun.gd.uid @@ -0,0 +1 @@ +uid://tfptal3sgfmy