46 lines
897 B
Go
46 lines
897 B
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/action"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
|
||
"github.com/shopspring/decimal"
|
||
)
|
||
|
||
/**
|
||
* n回合,若自己先手,则伤害的1/5回复体力
|
||
*/
|
||
|
||
func init() {
|
||
t := &Effect116{
|
||
EffectNode: node.EffectNode{},
|
||
}
|
||
// t.Duration(-1) //设置成无限回合,到回合数就停止
|
||
input.InitEffect(input.EffectType.Skill, 116, t)
|
||
|
||
}
|
||
|
||
type Effect116 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
// 默认添加回合
|
||
func (e *Effect116) SetArgs(t *input.Input, a ...int) {
|
||
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
||
|
||
}
|
||
func (e *Effect116) Skill_Useed() bool {
|
||
if !e.Hit() {
|
||
return true
|
||
}
|
||
|
||
if e.Input.FightC.IsFirst(e.Input.Player) {
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.DamageZone.Damage.Div(decimal.NewFromInt(5)))
|
||
}
|
||
|
||
return true
|
||
}
|