1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(武器系统): 添加单发武器功能并调整子弹参数

- 在武器结构中新增oneShoot属性用于支持单发武器
- 修改Tree武器的cooldown为0并设置为单发模式
- 调整Parrier子弹的动画轨迹参数
- 更新Rooster角色的武器发射逻辑以支持单发武器
This commit is contained in:
2026-03-18 22:23:31 +08:00
parent 238450bf11
commit a1510abeb9
4 changed files with 16 additions and 7 deletions
+1 -1
View File
@@ -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)
}
+2 -1
View File
@@ -5,4 +5,5 @@
[node name="Tree" instance=ExtResource("1_0lbwr")]
script = ExtResource("2_jsuc8")
cooldown = 200.0
oneShoot = true
cooldown = 0.0
+9 -2
View File
@@ -49,14 +49,21 @@ 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 len(weapons) > weaponIndex:
var weapon = weapons[weaponIndex]
if chargeStartTime.has(weaponIndex):
chargeParticle.speed_scale += 0.01 * self.fields.get(FieldStore.Entity.CHARGE_SPEED)
else:
elif !weapon.oneShoot:
tryAttack(weaponIndex)
if Input.is_action_just_released(action):
if chargeStartTime.has(weaponIndex):
+1
View File
@@ -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
}