package effect import ( "blazing/logic/service/fight/action" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" ) /** * n回合防御力和对手相同 */ type Effect45 struct { node.EffectNode oldtype uint32 } func (e *Effect45) OnSkill() bool { if !e.Hit() { return true } return true } func (e *Effect45) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) { if !e.Hit() { return } e.oldtype = e.Ctx().Opp.CurrentPet.Info.Prop[1] e.Ctx().Our.CurrentPet.Info.Prop[1] = e.Ctx().Opp.CurrentPet.Info.Prop[1] } func init() { ret := &Effect45{} input.InitEffect(input.EffectType.Skill, 45, ret) } func (e *Effect45) SetArgs(t *input.Input, a ...int) { e.EffectNode.SetArgs(t, a...) e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) } func (e *Effect45) Alive(t ...bool) bool { if e.BoolisFalse(t...) && e.Hit() { //说明到了回合结束取消节点,那么就将变化过的属性变化回来 //还原属性 e.Ctx().Our.CurrentPet.Info.Prop[1] = e.oldtype } return e.EffectNode.Alive(t...) }