36 lines
658 B
Go
36 lines
658 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
/**
|
|
* 降低对方 1/n 的 体力
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 28, &Effect28{
|
|
EffectNode: node.EffectNode{},
|
|
})
|
|
|
|
}
|
|
|
|
type Effect28 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect28) OnSkill(ctx input.Ctx) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
|
|
ctx.DamageZone.Type = info.DamageType.Fixed
|
|
ctx.DamageZone.Damage = decimal.NewFromInt(int64(ctx.CurrentPet.Info.Hp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
|
ctx.Input.Damage(ctx)
|
|
return true
|
|
}
|