1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-04 02:37:12 +08:00

feat(角色): 为熊角色添加新的光枪攻击技能

添加新的光枪攻击类型(类型5),包括:
- 新增光枪子弹预制体及脚本
- 添加光枪音效资源
- 在熊角色中实现光枪攻击逻辑
- 新增光枪轨迹着色器
- 配置攻击冷却时间为5500ms

光枪攻击会发射10-15发彩色追踪子弹,形成环绕效果
This commit is contained in:
2025-09-13 22:46:25 +08:00
parent 15913108bf
commit e31fd1889e
7 changed files with 253 additions and 1 deletions
+11
View File
@@ -11,6 +11,7 @@ func register():
attackCooldownMap[2] = 8000
attackCooldownMap[3] = 13000
attackCooldownMap[4] = 4500
attackCooldownMap[5] = 5500
sprintMultiplier = 60
func spawn():
texture.play("walk")
@@ -18,6 +19,7 @@ func ai():
PresetEntityAI.follow(self, currentFocusedBoss, 200)
for i in len(attackCooldownMap.keys()):
tryAttack(i)
# tryAttack(5)
func attack(type):
var weaponPos = findWeaponAnchor("normal")
if type == 0:
@@ -57,6 +59,15 @@ func attack(type):
bullet.tracer = currentFocusedBoss
await TickTool.millseconds(830.0 / count)
return false
elif type == 5:
var target = currentFocusedBoss.position
var count = randi_range(10, 15)
for i in range(count):
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, target, 0):
bullet.position += Vector2.from_angle(deg_to_rad(360.0 / count * i)) * 1000
bullet.rotation = bullet.position.angle_to_point(target)
await TickTool.millseconds(1670.0 / count)
return false
return true
func sprint():
move(Vector2(sign((currentFocusedBoss.position - position).x * sprintMultiplier), 0), true)