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

feat(Bear): 添加新的攻击类型和音效资源

为Bear角色新增第4种攻击类型,包含环形弹幕攻击效果
添加对应的攻击音效资源文件
更新攻击冷却时间映射和AI逻辑以支持新攻击
This commit is contained in:
2025-09-13 22:03:28 +08:00
parent 63590367a4
commit 15913108bf
4 changed files with 34 additions and 2 deletions
+10 -1
View File
@@ -10,12 +10,13 @@ func register():
attackCooldownMap[1] = 10000
attackCooldownMap[2] = 8000
attackCooldownMap[3] = 13000
attackCooldownMap[4] = 4500
sprintMultiplier = 60
func spawn():
texture.play("walk")
func ai():
PresetEntityAI.follow(self, currentFocusedBoss, 200)
for i in range(4):
for i in len(attackCooldownMap.keys()):
tryAttack(i)
func attack(type):
var weaponPos = findWeaponAnchor("normal")
@@ -48,6 +49,14 @@ func attack(type):
canRunAi = true
await sprintTo(currentFocusedBoss.position + MathTool.randv2_range(400), 0.25)
return false
elif type == 4:
playSound("attack4")
var count = randi_range(8, 12)
for i in range(count):
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), self, findWeaponAnchor("normal"), deg_to_rad(360.0 / count * i)):
bullet.tracer = currentFocusedBoss
await TickTool.millseconds(830.0 / count)
return false
return true
func sprint():
move(Vector2(sign((currentFocusedBoss.position - position).x * sprintMultiplier), 0), true)