Files
bl/logic/service/fight/effect/effect_60.go
2025-11-13 23:48:34 +08:00

43 lines
871 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* n回合内,每回合附加m点固定伤害
*/
func init() {
// t.Duration(-1) //设置成无限回合,到回合数就停止
input.InitEffect(input.EffectType.Skill, 60, &Effect60{})
}
type Effect60 struct {
node.EffectNode
}
// 默认添加回合
func (e *Effect60) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
func (e *Effect60) OnSkill() bool {
if !e.Hit() {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[1]))),
})
return true
}