Files
bl/logic/service/fight/effect/462.go

39 lines
827 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 462 - n回合内受攻击时反弹m点固定伤害
type Effect462 struct {
node.EffectNode
}
func (e *Effect462) Skill_Use_ex() bool {
// 反弹m点固定伤害
bounceDamage := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: alpacadecimal.Min(e.Ctx().Opp.SumDamage, bounceDamage),
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func (e *Effect462) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 462, &Effect462{})
}