diff --git a/components/Bullets/Pipe.tscn b/components/Bullets/Pipe.tscn index 9e1a980..d27eb10 100644 --- a/components/Bullets/Pipe.tscn +++ b/components/Bullets/Pipe.tscn @@ -15,8 +15,8 @@ animations = [{ "speed": 5.0 }] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5ir5"] -size = Vector2(162, 12) +[sub_resource type="CircleShape2D" id="CircleShape2D_vcs8c"] +radius = 83.00603 [node name="Pipe" instance=ExtResource("1_3h25n")] script = ExtResource("2_vcs8c") @@ -29,4 +29,4 @@ scale = Vector2(0.27, 0.27) sprite_frames = SubResource("SpriteFrames_vcs8c") [node name="hitbox" parent="." index="1"] -shape = SubResource("RectangleShape2D_j5ir5") +shape = SubResource("CircleShape2D_vcs8c") diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index b00f0ed..2944a62 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 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"] @@ -10,6 +10,43 @@ [ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="8_da2ca"] [ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="9_0omr3"] +[sub_resource type="Curve" id="Curve_da2ca"] +_data = [Vector2(0.5, 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_0omr3"] +curve = SubResource("Curve_da2ca") + +[sub_resource type="Curve" id="Curve_joj4g"] +_limits = [-360.0, 1.0, 0.0, 1.0] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, -360), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_jluqw"] +curve = SubResource("Curve_joj4g") + +[sub_resource type="Curve" id="Curve_0omr3"] +_data = [Vector2(0.5, 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_joj4g"] +curve = SubResource("Curve_0omr3") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_joj4g"] +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 300.0 +angle_min = 1.0728835e-05 +angle_max = 360.00003 +angle_curve = SubResource("CurveTexture_jluqw") +gravity = Vector3(0, 0, 0) +radial_accel_min = -200.0 +radial_accel_max = -100.0 +scale_min = 7.0 +scale_max = 10.0 +scale_curve = SubResource("CurveTexture_joj4g") +alpha_curve = SubResource("CurveTexture_0omr3") + [sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"] animations = [{ "frames": [], @@ -55,7 +92,13 @@ useStatic = true metadata/_edit_horizontal_guides_ = [-188.0] metadata/_edit_vertical_guides_ = [71.0] -[node name="weaponStore" parent="." index="1"] +[node name="chargeParticle" type="GPUParticles2D" parent="." index="0"] +unique_name_in_owner = true +position = Vector2(0, -54) +amount = 100 +process_material = SubResource("ParticleProcessMaterial_joj4g") + +[node name="weaponStore" parent="." index="2"] process_mode = 4 [node name="Pipe" parent="weaponStore" index="0" instance=ExtResource("3_da2ca")] @@ -72,7 +115,7 @@ stream = ExtResource("5_xnbhq") [node name="hurt" parent="sounds" index="3"] stream = ExtResource("6_m5px1") -[node name="texture" parent="." index="3"] +[node name="texture" parent="." index="4"] position = Vector2(0, -47) sprite_frames = SubResource("SpriteFrames_4v2ol") animation = &"walk" @@ -89,6 +132,6 @@ shape = SubResource("CircleShape2D_h1v0q") [node name="normal" type="Node2D" parent="texture/weapons" index="0"] position = Vector2(56, -69) -[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")] +[node name="statebar" parent="." index="5" node_paths=PackedStringArray("entity")] position = Vector2(0, -150) entity = NodePath("..") diff --git a/components/Effects/PipeFall.tscn b/components/Effects/PipeFall.tscn new file mode 100644 index 0000000..9dc571e --- /dev/null +++ b/components/Effects/PipeFall.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://ukta2xq1l32k"] + +[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_qau47"] +[ext_resource type="AudioStream" uid="uid://7k43qbbcim2l" path="res://resources/sounds/weapon/pipefall.mp3" id="2_4ds2m"] + +[node name="PipeFall" instance=ExtResource("1_qau47")] +spawnSound = "spawn" + +[node name="spawn" parent="sounds" index="0"] +stream = ExtResource("2_4ds2m") diff --git a/components/Weapons/Pipe.tscn b/components/Weapons/Pipe.tscn index abe84cf..f6c6bde 100644 --- a/components/Weapons/Pipe.tscn +++ b/components/Weapons/Pipe.tscn @@ -20,6 +20,8 @@ storeType = { } descriptionTemplate = "按住蓄力扔出钢管,蓄力越久伤害越高。 基础伤害:$atk,蓄力倍率:$charge" +needEnergy = 2.0 +cooldown = 1000.0 [node name="avatar" parent="container/info" index="0"] texture = ExtResource("2_mmtf8") diff --git a/resources/sounds/weapon/pipefall.mp3 b/resources/sounds/weapon/pipefall.mp3 new file mode 100644 index 0000000..c4f7565 Binary files /dev/null and b/resources/sounds/weapon/pipefall.mp3 differ diff --git a/resources/sounds/weapon/pipefall.mp3.import b/resources/sounds/weapon/pipefall.mp3.import new file mode 100644 index 0000000..a982d76 --- /dev/null +++ b/resources/sounds/weapon/pipefall.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://7k43qbbcim2l" +path="res://.godot/imported/pipefall.mp3-a309c798ff22faf6a524405b2ca37197.mp3str" + +[deps] + +source_file="res://resources/sounds/weapon/pipefall.mp3" +dest_files=["res://.godot/imported/pipefall.mp3-a309c798ff22faf6a524405b2ca37197.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/scripts/Contents/Bullets/PipeBullet.gd b/scripts/Contents/Bullets/PipeBullet.gd index 2ef04c6..38383f0 100644 --- a/scripts/Contents/Bullets/PipeBullet.gd +++ b/scripts/Contents/Bullets/PipeBullet.gd @@ -7,3 +7,5 @@ func ai(): PresetBulletAI.forward(self, rotation) texture.rotation += energy * (1 - lifeTimePercent()) / 100 speed = initialSpeed * (1 - lifeTimePercent()) +func destroy(_beacuseMap: bool): + EffectController.create(ComponentManager.getEffect("PipeFall"), position).shot() diff --git a/scripts/Contents/Characters/Rooster.gd b/scripts/Contents/Characters/Rooster.gd index df72da2..3fdeb66 100644 --- a/scripts/Contents/Characters/Rooster.gd +++ b/scripts/Contents/Characters/Rooster.gd @@ -1,6 +1,8 @@ extends EntityBase class_name Rooster +@onready var chargeParticle: GPUParticles2D = $%chargeParticle + func register(): attackCooldownMap[0] = 200 attackCooldownMap[1] = 6000 @@ -11,6 +13,7 @@ func register(): elif bullet is FoxZhua: EffectController.create(ComponentManager.getEffect("BloodFall"), texture.global_position).shot() ) + chargeParticle.emitting = false var chargeStartTime = {} func ai(): @@ -62,6 +65,7 @@ func startCharge(weaponIndex: int): var weapon = weapons[weaponIndex] if weapon.chargable: chargeStartTime[weaponIndex] = Time.get_ticks_msec() + chargeParticle.emitting = true func endCharge(weaponIndex: int): if chargeStartTime.has(weaponIndex): var startTime = chargeStartTime[weaponIndex] @@ -73,3 +77,4 @@ func endCharge(weaponIndex: int): if weapon.chargable: weapon.chargedTime = chargedTime tryAttack(weaponIndex) + chargeParticle.emitting = false diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index 525a21e..2522fbf 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -175,7 +175,7 @@ func tryAttack(entity: EntityBase): entity.useEnergy(needEnergy) return result func charged(base: float, percent: float): - return base * (1 + chargedTime / 50 * percent) + return base * (1 + chargedTime / 75 * percent) # 抽象 func update(_to: int, origin: Dictionary, _entity: EntityBase):