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() bool { t := &Effect69_sub{ EffectNode: node.EffectNode{}, } tt := e.ID() tt.SetEffectType(input.EffectType.Sub) t.ID(tt) t.SetArgs(e.Input, e.SideEffectArgs...) t.Duration(e.SideEffectArgs[0]) e.Ctx().Opp.AddEffect(e.Ctx().Our, 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 }