34 lines
722 B
Go
34 lines
722 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/battle/node"
|
|
"blazing/logic/service/fight/info"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
/**
|
|
* 给予对象损伤一半,会回复自己的体力
|
|
*/
|
|
type Effect1 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func init() {
|
|
info.NodeM.AddEffect(&Effect1{})
|
|
}
|
|
|
|
// 重写EFFectID
|
|
func (this *Effect1) ID() int {
|
|
this.EffectNode.ParamSize(0) //设置参数个数
|
|
return 1
|
|
}
|
|
|
|
// 重写POST_DAMAGE ,伤害结束后触发回血
|
|
func (this *Effect1) PostDamage() bool {
|
|
|
|
off := this.GetSkill().DamageValue.Div(decimal.NewFromInt(2)) //伤害的一半
|
|
this.GetOwnerPet().Hp += uint32(off.IntPart()) //这里是effect在对方挂载,故回血给自己回血
|
|
return true
|
|
}
|