diff --git a/components/Bullets/Volcano.tscn b/components/Bullets/Volcano.tscn index 938aa2e..a54d46d 100644 --- a/components/Bullets/Volcano.tscn +++ b/components/Bullets/Volcano.tscn @@ -4,27 +4,96 @@ [ext_resource type="Script" uid="uid://ci5hswfhck5as" path="res://scripts/Contents/Bullets/Volcano.gd" id="2_w1utg"] [ext_resource type="Texture2D" uid="uid://ctmxadaowx5ps" path="res://resources/weapons/Volcano.webp" id="2_wwxm2"] +[sub_resource type="Animation" id="Animation_w1utg"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("anchor/texture:position:x") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("%hitbox:position:x") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(167.5, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("%hitbox:disabled") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + [sub_resource type="Animation" id="Animation_oinqg"] resource_name = "destroy" length = 0.5 step = 0.1 -[sub_resource type="Animation" id="Animation_ynxlt"] -resource_name = "loop" +[sub_resource type="Animation" id="Animation_o5h0y"] +resource_name = "stab" +length = 0.5 loop_mode = 1 -step = 0.1 +step = 0.05 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("anchor/texture:position:x") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0, 0, 0), +"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0, 300, -0.083333336, -8.333334, 0, 0, 150, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0, 0.25, 0.5) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("%hitbox:position:x") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0, 2, 0), +"points": PackedFloat32Array(165, -0.25, 0, 0.25, 0, 315, -0.041666668, 0, 0.041666668, 0, 165, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0, 0.25, 0.5) +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("%hitbox:disabled") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.25, 0.4), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [true, false, true, false] +} [sub_resource type="Animation" id="Animation_kmogx"] resource_name = "spawn" -[sub_resource type="Animation" id="Animation_w1utg"] -length = 0.001 - [sub_resource type="AnimationLibrary" id="AnimationLibrary_w1utg"] _data = { &"RESET": SubResource("Animation_w1utg"), &"destroy": SubResource("Animation_oinqg"), -&"loop": SubResource("Animation_ynxlt"), +&"loop": SubResource("Animation_o5h0y"), &"spawn": SubResource("Animation_kmogx") } @@ -78,6 +147,8 @@ size = Vector2(113, 34) script = ExtResource("2_w1utg") penerate = 1.0 lifeTime = 6000.0 +autoLoopAnimation = true +recoil = 1.0 [node name="animator" parent="texture" index="0"] libraries = { @@ -86,18 +157,20 @@ libraries = { [node name="anchor" type="Node2D" parent="texture" index="1"] -[node name="trail" type="GPUParticles2D" parent="texture/anchor" index="0"] -position = Vector2(167, 0) -scale = Vector2(1.4999999, 1.4999999) -amount = 100 -process_material = SubResource("ParticleProcessMaterial_xrrxo") - -[node name="texture" type="Sprite2D" parent="texture/anchor" index="1"] -position = Vector2(151.3249, 0) +[node name="texture" type="Sprite2D" parent="texture/anchor" index="0"] +position = Vector2(150, 0) rotation = 0.7853982 scale = Vector2(1.5, 1.5) texture = ExtResource("2_wwxm2") +[node name="trail" type="GPUParticles2D" parent="texture/anchor/texture" index="0"] +z_index = -1 +position = Vector2(7.3893127, -7.3893127) +rotation = -0.7853982 +scale = Vector2(0.9999999, 0.9999999) +amount = 100 +process_material = SubResource("ParticleProcessMaterial_xrrxo") + [node name="hitbox" parent="." index="1"] position = Vector2(167.5, 0) shape = SubResource("RectangleShape2D_w1utg") diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index 54bd264..ed0215e 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"] +[gd_scene load_steps=15 format=3 uid="uid://bm7ymrri6pykb"] [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"] @@ -7,6 +7,7 @@ [ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="3_b0fgx"] [ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_jluqw"] [ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"] +[ext_resource type="PackedScene" uid="uid://u0djqwuuysp8" path="res://components/Weapons/Volcano.tscn" id="4_jluqw"] [ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"] [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"] @@ -50,6 +51,9 @@ process_mode = 4 offset_bottom = 350.0 debugRebuild = false +[node name="Volcano" parent="weaponStore" index="1" instance=ExtResource("4_jluqw")] +debugRebuild = false + [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Weapons/Volcano.tscn b/components/Weapons/Volcano.tscn index de7f0dd..c3fe3f7 100644 --- a/components/Weapons/Volcano.tscn +++ b/components/Weapons/Volcano.tscn @@ -8,22 +8,20 @@ script = ExtResource("2_ihngx") avatarTexture = ExtResource("2_hh01t") displayName = "火山" -quality = 3 +quality = 4 typeTopic = 2 costBeachball = 300 store = { -"atk": 25, -"count": 2.0, +"atk": 10, "life": 5, -"rotate": 1.0 +"rotate": 0.1 } storeType = { "atk": 1, -"count": 1, "life": 0, -"rotate": 3 +"rotate": 2 } -descriptionTemplate = "召唤$count支[b]火山[/b],以$rotate的速度旋转,接触时造成$atk点伤害,在$life秒后停止。" +descriptionTemplate = "召唤1支[b]火山[/b],以$rotate的效率跟随鼠标指向,接触时造成$atk点伤害。" cooldown = 5000.0 debugRebuild = true @@ -38,8 +36,8 @@ count = 1 [node name="name" parent="container/info" index="2"] displayName = "火山" -quality = 3 +quality = 4 typeTopic = 2 [node name="description" parent="container" index="2"] -text = "[center]召唤[color=cyan]2[/color]支[b]火山[/b],以[color=cyan]1.0°[/color]的速度旋转,接触时造成[color=cyan]25[/color]点伤害,在[color=cyan]5.00[/color]秒后停止。[/center]" +text = "[center]召唤1支[b]火山[/b],以[color=cyan]10%[/color]的效率跟随鼠标指向,接触时造成[color=cyan]10[/color]点伤害。[/center]" diff --git a/scripts/Contents/Bullets/Volcano.gd b/scripts/Contents/Bullets/Volcano.gd index a975141..d56f917 100644 --- a/scripts/Contents/Bullets/Volcano.gd +++ b/scripts/Contents/Bullets/Volcano.gd @@ -3,6 +3,12 @@ class_name Volcano var rotates: float = 0 +func register(): + animator.speed_scale = launcher.fields.get(FieldStore.Entity.ATTACK_SPEED) func ai(): - PresetBulletAI.selfRotate(self, rotates) PresetBulletAI.lockLauncher(self, launcher, true) + rotation = lerp_angle( + rotation, + position.angle_to_point(get_global_mouse_position()), + rotates + ) diff --git a/scripts/Contents/Characters/KukeChild.gd b/scripts/Contents/Characters/KukeChild.gd index bdb36f1..fa4ae6e 100644 --- a/scripts/Contents/Characters/KukeChild.gd +++ b/scripts/Contents/Characters/KukeChild.gd @@ -21,4 +21,5 @@ func attack(type): elif type == 1: BulletBase.generate(ComponentManager.getBullet("HeavyCrystal"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position)) func kill(): - masterMine.tryHeal(100) + if is_instance_valid(masterMine): + masterMine.tryHeal(100) diff --git a/scripts/Contents/Weapons/Volcano.gd b/scripts/Contents/Weapons/Volcano.gd index 0040a92..5ec9a55 100644 --- a/scripts/Contents/Weapons/Volcano.gd +++ b/scripts/Contents/Weapons/Volcano.gd @@ -3,14 +3,12 @@ extends Weapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 3 * to * soulLevel - origin["count"] = soulLevel + 1 - origin["rotate"] += 0.05 * to * soulLevel + origin["rotate"] += 0.015 * to * soulLevel origin["life"] += 0.1 * to * soulLevel return origin func attack(entity: EntityBase): - for i in readStore("count"): - for j in BulletBase.generate(ComponentManager.getBullet("Volcano"), entity, entity.findWeaponAnchor("normal"), deg_to_rad(360.0 / readStore("count") * i), false, false, true, true): - var bullet: Volcano = j - bullet.damage = readStore("atk") - bullet.rotates = readStore("rotate") - bullet.lifeTime = readStore("life") * 1000 + for j in BulletBase.generate(ComponentManager.getBullet("Volcano"), entity, entity.findWeaponAnchor("normal"), entity.position.angle_to_point(entity.get_global_mouse_position()), false, false, true, true): + var bullet: Volcano = j + bullet.damage = readStore("atk") + bullet.rotates = readStore("rotate") + bullet.lifeTime = readStore("life") * 1000