Files
bl/logic/service/fight/boss/NewSeIdx_53.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

37 lines
993 B
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/action"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 53. 敌我双方每回合恢复n%HP不超过最大血量a1: n
type NewSel53 struct {
NewSel0
}
func (e *NewSel53) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurPet[0].Info.CatchTime {
return
}
// 计算恢复的HP量
maxHP := e.Ctx().Our.CurPet[0].GetMaxHP()
healAmount := maxHP.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
// 恢复我方HP
e.Ctx().Our.Heal(e.Ctx().Our, nil, healAmount)
// 恢复敌方HP
oppMaxHP := e.Ctx().Opp.CurPet[0].GetMaxHP()
oppHealAmount := oppMaxHP.Mul(e.Args()[0]).Div(alpacadecimal.NewFromInt(100))
e.Ctx().Opp.Heal(e.Ctx().Opp, nil, oppHealAmount)
}
func init() {
input.InitEffect(input.EffectType.NewSel, 53, &NewSel53{})
}