diff --git a/components/Bullets/ChainGun.tscn b/components/Bullets/ChainGun.tscn index a490f04..d210f31 100644 --- a/components/Bullets/ChainGun.tscn +++ b/components/Bullets/ChainGun.tscn @@ -8,6 +8,7 @@ [node name="ChainGun" instance=ExtResource("1_0gg4y")] script = ExtResource("2_l7jtn") +lifeTime = 50.0 [node name="texture" parent="." index="0"] sprite_frames = SubResource("SpriteFrames_cl70o") @@ -16,5 +17,9 @@ sprite_frames = SubResource("SpriteFrames_cl70o") position = Vector2(74, 0) texture = ExtResource("2_4hyk3") +[node name="anchor" type="Node2D" parent="texture/node" index="0"] +unique_name_in_owner = true +position = Vector2(25, 0) + [node name="hitbox" parent="." index="1"] disabled = true diff --git a/components/Characters/Rooster.tscn b/components/Characters/Rooster.tscn index cf47f00..62aac5e 100644 --- a/components/Characters/Rooster.tscn +++ b/components/Characters/Rooster.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://bm7ymrri6pykb"] +[gd_scene load_steps=21 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" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"] @@ -16,6 +16,8 @@ [ext_resource type="PackedScene" uid="uid://bb1uh8k7gkhr7" path="res://components/Weapons/VectorStar.tscn" id="6_fvy5n"] [ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"] [ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"] +[ext_resource type="PackedScene" uid="uid://dwsyn746hr25d" path="res://components/Weapons/MushroomPickaxe.tscn" id="9_85j0d"] +[ext_resource type="PackedScene" uid="uid://b2qhes4apaxsj" path="res://components/Weapons/NuclearBomb.tscn" id="10_ncj2v"] [sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"] animations = [{ @@ -65,6 +67,11 @@ debugRebuild = false [node name="BigLaser" parent="weaponStore" index="5" instance=ExtResource("4_plqwu")] +[node name="MushroomPickaxe" parent="weaponStore" index="6" instance=ExtResource("9_85j0d")] +debugRebuild = false + +[node name="NuclearBomb" parent="weaponStore" index="7" instance=ExtResource("10_ncj2v")] + [node name="sprint" parent="sounds" index="0"] stream = ExtResource("4_66s6c") diff --git a/components/Weapons/ChainGun.tscn b/components/Weapons/ChainGun.tscn index e738dec..31532f6 100644 --- a/components/Weapons/ChainGun.tscn +++ b/components/Weapons/ChainGun.tscn @@ -9,10 +9,9 @@ script = ExtResource("2_ponmu") avatarTexture = ExtResource("2_ghn43") displayName = "链式机枪" costBeachball = 400 -store = { -"atk": 2 -} -cooldown = 50.0 +needEnergy = 1.0 +cooldown = 66.0 +debugRebuild = true [node name="avatar" parent="container/info" index="0"] texture = ExtResource("2_ghn43") @@ -27,4 +26,4 @@ text = "400" displayName = "链式机枪" [node name="description" parent="container" index="2"] -text = "[center]造成[color=cyan]2[/color]→[color=yellow]3[/color]点伤害。[/center]" +text = "[center]造成[color=cyan]10[/color]→[color=yellow]7[/color]点伤害。[/center]" diff --git a/scripts/Contents/Bullets/ChainGun.gd b/scripts/Contents/Bullets/ChainGun.gd index dc3cb19..9d4b646 100644 --- a/scripts/Contents/Bullets/ChainGun.gd +++ b/scripts/Contents/Bullets/ChainGun.gd @@ -1,6 +1,9 @@ extends BulletBase +@onready var anchor: Node2D = $"%anchor" + +func spawn(): + for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation): + i.damage = damage func ai(): - PresetBulletAI.faceToMouse(self) -func applyDot(): - pass \ No newline at end of file + PresetBulletAI.lockLauncher(self, launcher, true) \ No newline at end of file diff --git a/scripts/Contents/Characters/Rooster.gd b/scripts/Contents/Characters/Rooster.gd index 0850646..cb84ad9 100644 --- a/scripts/Contents/Characters/Rooster.gd +++ b/scripts/Contents/Characters/Rooster.gd @@ -15,11 +15,11 @@ func ai(): texture.play("idle") if Input.is_action_pressed("attack"): tryAttack(0) - elif Input.is_action_pressed("attack2"): + if Input.is_action_pressed("attack2"): tryAttack(1) - elif Input.is_action_pressed("smallSkill"): + if Input.is_action_pressed("smallSkill"): tryAttack(2) - elif Input.is_action_pressed("superSkill"): + if Input.is_action_pressed("superSkill"): tryAttack(3) for i in range(3): if Input.is_action_pressed("cardSkill" + str(i)): diff --git a/scripts/Contents/Weapons/ChainGun.gd b/scripts/Contents/Weapons/ChainGun.gd index 67500cd..2322881 100644 --- a/scripts/Contents/Weapons/ChainGun.gd +++ b/scripts/Contents/Weapons/ChainGun.gd @@ -2,9 +2,8 @@ extends Weapon func update(to, origin, _entity): - origin["atk"] += 1 * to * soulLevel + origin["atk"] += 2 * to * soulLevel return origin func attack(entity: EntityBase): - var weaponPos = entity.findWeaponAnchor("normal") - for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), entity, weaponPos, (get_global_mouse_position() - weaponPos).angle()): + for i in BulletBase.generate(ComponentManager.getBullet("ChainGun"), entity, entity.texture.global_position, (get_global_mouse_position() - entity.texture.global_position).angle()): i.damage = readStore("atk")