Files
bl/logic/service/fight/effect/effect_69.go

50 lines
939 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 下n回合对手使用体力药剂时效果变成减少相应的体力
*/
type Effect69 struct {
node.EffectNode
}
type Effect69_sub struct {
node.EffectNode
}
func init() {
t := &Effect69{
EffectNode: node.EffectNode{},
}
//t.Owner(true)
//t.Duration(5)
input.InitEffect(input.EffectType.Skill, 69, t)
}
func (e *Effect69) OnSkill(ctx input.Ctx) bool {
t := &Effect69_sub{
EffectNode: node.EffectNode{},
}
t.ID(e.ID() + int(input.EffectType.Sub)) //子效果ID
t.SetArgs(e.Input, e.SideEffectArgs...)
t.Duration(e.SideEffectArgs[0])
ctx.AddEffect(t)
return true
}
func (e *Effect69_sub) Heal_Pre(f action.BattleActionI, t *int) bool {
if _, ok := f.(*action.UseItemAction); ok {
*t = -*t // 把t指向的值取反直接作用于外部变量
}
return true
}