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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user