35 lines
606 B
Go
35 lines
606 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
/**
|
|
* 恢复自身最大体力的1/n
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 43, &Effect43{
|
|
EffectNode: node.EffectNode{},
|
|
})
|
|
|
|
}
|
|
|
|
type Effect43 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect43) OnSkill(ctx input.Ctx) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
|
|
e.Input.Heal(&action.SelectSkillAction{}, decimal.NewFromInt(int64(e.Input.MaxHp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))))
|
|
|
|
return true
|
|
}
|