1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-04 18:57:13 +08:00

feat(战斗系统): 添加技能攻击支持并修复武器数组越界问题

- 在EntityBase.gd中添加武器数组越界检查,防止崩溃
- 在Rooster.gd中新增技能攻击输入处理,支持3个技能按键
- 在project.godot中配置技能按键映射(1,2,3键)
This commit is contained in:
2025-09-06 12:02:44 +08:00
parent 6d39f19ea4
commit a563eabab3
3 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -199,7 +199,10 @@ func useEnergy(value: float):
func tryAttack(type: int, needChargeUp: bool = false):
var weapon: Weapon
if isPlayer():
weapon = weapons[type]
if len(weapons) > type:
weapon = weapons[type]
else:
return
var state
if isPlayer():
state = true