37 lines
635 B
Go
37 lines
635 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
/**
|
|
* 给予对象损伤一半,会回复自己的体力
|
|
*/
|
|
type Effect1 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func initskill(id int, e input.Effect) {
|
|
input.InitEffect(input.EffectType.Skill, id, e)
|
|
}
|
|
func init() {
|
|
initskill(1, &Effect1{})
|
|
|
|
}
|
|
|
|
// 命中之后
|
|
func (e *Effect1) OnSkill() bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
|
|
e.Input.Heal(
|
|
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(2)),
|
|
)
|
|
return true
|
|
}
|