Files
bl/logic/service/fight/effect/458.go
xinian 3dd2d40c50
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增多个战斗技能效果实现
2026-03-08 10:34:23 +08:00

31 lines
709 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 458 - 若先出手则造成攻击伤害的n%恢复自身体力
type Effect458 struct {
node.EffectNode
}
func (e *Effect458) SkillHit_ex() bool {
if e.Input.FightC.IsFirst(e.Input.Player) { // 先出手
damageDone := e.Ctx().Our.SumDamage
healPercent := e.Args()[0].Div(alpacadecimal.NewFromInt(100)) // n%
healAmount := damageDone.Mul(healPercent)
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 458, &Effect458{})
}