From a1510abeb9f175df7b1c27ce7022bec21d486116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Wed, 18 Mar 2026 22:23:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E5=8F=91=E6=AD=A6=E5=99=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E8=B0=83=E6=95=B4=E5=AD=90=E5=BC=B9=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在武器结构中新增oneShoot属性用于支持单发武器 - 修改Tree武器的cooldown为0并设置为单发模式 - 调整Parrier子弹的动画轨迹参数 - 更新Rooster角色的武器发射逻辑以支持单发武器 --- components/Bullets/Parrier.tscn | 2 +- components/Weapons/Tree.tscn | 3 ++- scripts/Contents/Characters/Rooster.gd | 17 ++++++++++++----- scripts/Structs/Weapon.gd | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/components/Bullets/Parrier.tscn b/components/Bullets/Parrier.tscn index 7c223af..706c2e2 100644 --- a/components/Bullets/Parrier.tscn +++ b/components/Bullets/Parrier.tscn @@ -97,7 +97,7 @@ tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { "handle_modes": PackedInt32Array(2, 2), -"points": PackedFloat32Array(1, 0, 0, 0.3, 0, 0, -1, 0, 0, 0), +"points": PackedFloat32Array(1, 0, 0, 0.1, 0, 0, -1, 0, 0, 0), "times": PackedFloat32Array(0, 1) } diff --git a/components/Weapons/Tree.tscn b/components/Weapons/Tree.tscn index 9deb604..0bd088b 100644 --- a/components/Weapons/Tree.tscn +++ b/components/Weapons/Tree.tscn @@ -5,4 +5,5 @@ [node name="Tree" instance=ExtResource("1_0lbwr")] script = ExtResource("2_jsuc8") -cooldown = 200.0 +oneShoot = true +cooldown = 0.0 diff --git a/scripts/Contents/Characters/Rooster.gd b/scripts/Contents/Characters/Rooster.gd index 5fac0e3..bed3a06 100644 --- a/scripts/Contents/Characters/Rooster.gd +++ b/scripts/Contents/Characters/Rooster.gd @@ -49,15 +49,22 @@ func tryLaunch(action: String, weaponIndex: int): if Input.is_action_just_pressed(action): if len(weapons) > weaponIndex: var weapon = weapons[weaponIndex] - if weapon.chargable and weapon.canAttackBy(self): + if weapon.chargable and weapon.canAttackBy(self ): chargeStartTime[weaponIndex] = Time.get_ticks_msec() chargeParticle.emitting = true chargeParticle.speed_scale = 1 + if Input.is_action_just_pressed(action): + if len(weapons) > weaponIndex: + var weapon = weapons[weaponIndex] + if weapon.oneShoot: + tryAttack(weaponIndex) if Input.is_action_pressed(action): - if chargeStartTime.has(weaponIndex): - chargeParticle.speed_scale += 0.01 * self.fields.get(FieldStore.Entity.CHARGE_SPEED) - else: - tryAttack(weaponIndex) + if len(weapons) > weaponIndex: + var weapon = weapons[weaponIndex] + if chargeStartTime.has(weaponIndex): + chargeParticle.speed_scale += 0.01 * self.fields.get(FieldStore.Entity.CHARGE_SPEED) + elif !weapon.oneShoot: + tryAttack(weaponIndex) if Input.is_action_just_released(action): if chargeStartTime.has(weaponIndex): var startTime = chargeStartTime[weaponIndex] diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index f18be06..1e3e67c 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -9,6 +9,7 @@ class_name Weapon @export var soulLevel: int = 1 @export var costBeachball: int = 500 @export var chargable: bool = false +@export var oneShoot: bool = false @export var store: Dictionary = { "atk": 10 }