1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-01 17:01:53 +08:00

feat(角色): 为熊角色添加阶段转换功能

添加阶段转换系统,当熊的生命值低于50%时进入第二阶段
- 添加mask精灵用于阶段变化视觉效果
- 实现enterStage和exitStage方法处理阶段转换
- 添加stageAnimator处理转换动画
- 调整攻击7的音效播放位置
This commit is contained in:
2025-09-14 13:35:02 +08:00
parent 997d6d1fe8
commit 054baa4a71
4 changed files with 212 additions and 4 deletions
+9 -1
View File
@@ -2,6 +2,7 @@ extends EntityBase
class_name Bear # 攻击方式模仿泰拉瑞亚光之女皇
@onready var sprintParticle: GPUParticles2D = $"%sprintParticle"
@onready var mask: Sprite2D = $"%mask"
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 2000
@@ -15,12 +16,19 @@ func register():
attackCooldownMap[6] = 10000
attackCooldownMap[7] = 9000
sprintMultiplier = 80
healthChanged.connect(
func(newHealth):
setStage(1 if newHealth < fields[FieldStore.Entity.MAX_HEALTH] * 0.5 else 0)
)
func spawn():
texture.play("walk")
func ai():
PresetEntityAI.follow(self, currentFocusedBoss, 400)
for i in len(attackCooldownMap.keys()):
tryAttack(i)
func enterStage(stage):
mask.visible = !!stage
await TickTool.millseconds(2000)
func attack(type):
var weaponPos = findWeaponAnchor("normal")
if type == 0:
@@ -82,11 +90,11 @@ func attack(type):
await TickTool.millseconds(100)
return false
elif type == 7:
playSound("attack7")
var angle = deg_to_rad(70)
for j in 4:
var initAngle = randf_range(0, 360)
if !is_instance_valid(currentFocusedBoss): return false
playSound("attack7")
for i in 16:
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, currentFocusedBoss.position, 0):
bullet.rotation_degrees += initAngle