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

feat(武器系统): 添加魔法导弹武器及配套子弹逻辑

实现魔法导弹武器系统,包括:
1. 新增HOLD_LOOP发射类型武器
2. 添加魔法导弹子弹类实现追踪和分裂逻辑
3. 修改武器基类支持循环攻击模式
4. 更新角色控制器支持新武器类型
5. 添加相关资源文件和配置
This commit is contained in:
2026-04-18 08:12:27 +08:00
parent 6129902a78
commit 2dd47a4f3e
11 changed files with 196 additions and 34 deletions
+12 -10
View File
@@ -54,24 +54,26 @@ func tryLaunch(action: String, weaponIndex: int):
chargeStartTime[weaponIndex] = Time.get_ticks_msec()
chargeParticle.emitting = true
chargeParticle.speed_scale = 1
elif weapon.emitType == Weapon.EmitType.CLICK_SHOOT:
elif weapon.emitType == Weapon.EmitType.CLICK_SHOOT || weapon.emitType == Weapon.EmitType.HOLD_LOOP:
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)
elif weapon.emitType == Weapon.EmitType.HOLD_SHOOT:
elif weapon.emitType == Weapon.EmitType.HOLD_SHOOT || weapon.emitType == Weapon.EmitType.HOLD_LOOP:
tryAttack(weaponIndex)
if Input.is_action_just_released(action):
if chargeStartTime.has(weaponIndex):
var startTime = chargeStartTime[weaponIndex]
var endTime = Time.get_ticks_msec()
var chargedTime = endTime - startTime
chargeStartTime.erase(weaponIndex)
if len(weapons) > weaponIndex:
var weapon = weapons[weaponIndex]
if weapon.emitType == Weapon.EmitType.CHARGE:
if len(weapons) > weaponIndex:
var weapon = weapons[weaponIndex]
if weapon.emitType == Weapon.EmitType.CHARGE:
if chargeStartTime.has(weaponIndex):
var startTime = chargeStartTime[weaponIndex]
var endTime = Time.get_ticks_msec()
var chargedTime = endTime - startTime
chargeStartTime.erase(weaponIndex)
weapon.chargedTime = chargedTime * self.fields.get(FieldStore.Entity.CHARGE_SPEED)
tryAttack(weaponIndex)
chargeParticle.emitting = false
elif weapon.emitType == Weapon.EmitType.HOLD_LOOP:
weapon.exitLoop(self )