mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器系统): 重构链式机枪并添加新武器
- 修改链式机枪的子弹生成逻辑,使用新的锚点系统 - 调整武器属性包括伤害值、冷却时间和能量消耗 - 为公鸡角色添加蘑菇镐和核弹两种新武器 - 优化公鸡角色的攻击输入检测逻辑
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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]"
|
||||
|
||||
@@ -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
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
@@ -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)):
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user