Files
bl/logic/service/fight/boss/NewSeIdx_46.go
2026-04-04 04:28:04 +08:00

46 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 46. 若自身5回合内体力被降到0会余下1点体力并且体力全恢复恢复后回合数重新计算。
// TODO: 需要了解如何实现体力归零时的保命和恢复效果
type NewSel46 struct {
NewSel0
// 记录上次恢复后的回合数
lastRecoveryRound uint32
}
func (e *NewSel46) Action_end_ex() bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet[0].Info.CatchTime {
return true
}
// 获取当前回合数
r := e.Ctx().Our.FightC.GetOverInfo()
// 检查是否在5回合内
if r.Round-e.lastRecoveryRound <= 5 {
// 检查体力是否被降到0
if e.Ctx().Our.CurrentPet[0].Info.Hp <= 0 {
// 体力降到0保留1点体力恢复满
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(1))
e.Ctx().Our.Heal(e.Ctx().Our, nil, e.Ctx().Our.CurrentPet[0].GetMaxHP().Sub(alpacadecimal.NewFromInt(1)))
// 更新恢复后的回合数
e.lastRecoveryRound = r.Round
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 46, &NewSel46{})
}