diff --git a/logic/service/fight/boss/NewSeIdx_183.go b/logic/service/fight/boss/NewSeIdx_183.go index 0d3109557..9644dd313 100644 --- a/logic/service/fight/boss/NewSeIdx_183.go +++ b/logic/service/fight/boss/NewSeIdx_183.go @@ -9,7 +9,7 @@ type NewSel183 struct { NewSel0 } -func (e *NewSel183) SkillUseed() bool { +func (e *NewSel183) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_224.go b/logic/service/fight/boss/NewSeIdx_224.go index d5577e674..648cf5f43 100644 --- a/logic/service/fight/boss/NewSeIdx_224.go +++ b/logic/service/fight/boss/NewSeIdx_224.go @@ -14,7 +14,7 @@ type NewSel224 struct { NewSel0 } -func (e *NewSel224) SkillUseed() bool { +func (e *NewSel224) Skill_Use() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_283.go b/logic/service/fight/boss/NewSeIdx_283.go index d6e844e63..3dfe8cc17 100644 --- a/logic/service/fight/boss/NewSeIdx_283.go +++ b/logic/service/fight/boss/NewSeIdx_283.go @@ -9,7 +9,7 @@ type NewSel283 struct { NewSel0 } -func (e *NewSel283) SkillUseed() bool { +func (e *NewSel283) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_32.go b/logic/service/fight/boss/NewSeIdx_32.go index c7fd37e5d..e50c06ec1 100644 --- a/logic/service/fight/boss/NewSeIdx_32.go +++ b/logic/service/fight/boss/NewSeIdx_32.go @@ -13,7 +13,7 @@ type NewSel32 struct { NewSel0 } -func (e *NewSel32) OnSkill() bool { +func (e *NewSel32) Skill_Use() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_700.go b/logic/service/fight/boss/NewSeIdx_700.go index 3b9608c31..acc6b0fbc 100644 --- a/logic/service/fight/boss/NewSeIdx_700.go +++ b/logic/service/fight/boss/NewSeIdx_700.go @@ -13,7 +13,7 @@ type NewSel700 struct { NewSel0 } -func (e *NewSel700) SkillUseed() bool { +func (e *NewSel700) Skill_Use() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/boss/NewSeIdx_72.go b/logic/service/fight/boss/NewSeIdx_72.go index 0d7a9e5d8..c13b5d2aa 100644 --- a/logic/service/fight/boss/NewSeIdx_72.go +++ b/logic/service/fight/boss/NewSeIdx_72.go @@ -10,7 +10,7 @@ type NewSel72 struct { NewSel0 } -func (e *NewSel72) SkillUseed() bool { +func (e *NewSel72) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_73.go b/logic/service/fight/boss/NewSeIdx_73.go index 54eb47ae3..c6b359f9d 100644 --- a/logic/service/fight/boss/NewSeIdx_73.go +++ b/logic/service/fight/boss/NewSeIdx_73.go @@ -12,7 +12,7 @@ type NewSel73 struct { NewSel0 } -func (e *NewSel73) SkillUseed() bool { +func (e *NewSel73) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_80.go b/logic/service/fight/boss/NewSeIdx_80.go index d3c03c793..4ee94af5b 100644 --- a/logic/service/fight/boss/NewSeIdx_80.go +++ b/logic/service/fight/boss/NewSeIdx_80.go @@ -10,7 +10,7 @@ type NewSel80 struct { NewSel0 } -func (e *NewSel80) SkillUseed() bool { +func (e *NewSel80) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_83.go b/logic/service/fight/boss/NewSeIdx_83.go index bbd49c623..c8c740719 100644 --- a/logic/service/fight/boss/NewSeIdx_83.go +++ b/logic/service/fight/boss/NewSeIdx_83.go @@ -12,7 +12,7 @@ type NewSel83 struct { NewSel0 } -func (e *NewSel83) SkillUseed() bool { +func (e *NewSel83) Skill_Use() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/effect/effect_prop.go b/logic/service/fight/effect/effect_prop.go index e99d0a260..d8edc66ab 100644 --- a/logic/service/fight/effect/effect_prop.go +++ b/logic/service/fight/effect/effect_prop.go @@ -15,50 +15,47 @@ type Effect3 struct { // ---------------------- // 执行时逻辑 // ---------------------- -func (e *Effect3) OnSkill() bool { +func (e *Effect3) Skill_Use() bool { - // 遍历六项能力值(攻击、防御、速度等) - for i := 0; i < 6; i++ { - if e.Reverse&&i>0 { - // 对对手生效 - e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), e.Level) + for i, v := range e.Ctx().Our.Prop[:] { + if v < 0 { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0) } - if !e.Reverse &&i<0{ - // 对自己生效 - e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), e.Level) + + } + + return true +} + +// Effect3:能力操作类效果(重置/反转/偷取等) +type Effect33 struct { + node.EffectNode + Reverse bool + Level int8 +} + +// ---------------------- +// 执行时逻辑 +// ---------------------- +func (e *Effect33) Skill_Use() bool { + + for i, v := range e.Ctx().Opp.Prop[:] { + if v > 0 { + e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) } + } return true } -// ---------------------- -// 工厂函数 -// ---------------------- -func newEffect3(reverse bool, level int8) *Effect3 { - return &Effect3{ - Reverse: reverse, - Level: level, - } -} - // ---------------------- // 注册所有效果 // ---------------------- func init() { - effects := []struct { - id int - reverse bool - level int8 - }{ - {3, false, 0}, // 解除自身能力下降状态 - {33, true, 0}, // 消除对手能力提升状态 - // {63, false, 0, info.AbilityOpType.BounceWeaken}, // 将能力下降反馈给对手 - // {85, false, -1, info.AbilityOpType.StealStrengthen}, // 将对手提升效果转移到自己 - // {143, true, 1, info.AbilityOpType.Reverse}, // 反转对手能力提升为下降 - } - - for _, e := range effects { - input.InitEffect(input.EffectType.Skill, e.id, newEffect3(e.reverse, e.level)) - } + // {3, false, 0}, // 解除自身能力下降状态 + // {33, true, 0}, // 消除对手能力提升状态{3, false, 0}, // 解除自身能力下降状态 + // {33, true, 0}, // 消除对手能力提升状态 + input.InitEffect(input.EffectType.Skill, 3, &Effect3{}) + input.InitEffect(input.EffectType.Skill, 33, &Effect33{}) } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index c119e9d4f..9f046d95a 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -221,21 +221,9 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) attacker.RecoverEffect() currentSkill = nil if i == 0 { //先手方被控,这时候应该算做未出手状态 - if canUse { - f.TrueFirst = attacker - - attacker.Exec(func(effect input.Effect) bool { - effect.IsFirst(true) - return true - }) - - } else { - - f.TrueFirst = defender - defender.Exec(func(effect input.Effect) bool { - effect.IsFirst(true) - return true - }) + f.TrueFirst = defender + for _, effect := range defender.EffectCache { + effect.IsFirst(true) } } @@ -253,6 +241,10 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) // } } else { + + for _, effect := range attacker.EffectCache { + effect.IsFirst(true) + } f.processSkillAttack(attacker, defender, currentSkill) currentSkill = originalSkill //还原技能 diff --git a/logic/service/fight/node/skill.go b/logic/service/fight/node/skill.go index f4c705b66..4546a9f3f 100644 --- a/logic/service/fight/node/skill.go +++ b/logic/service/fight/node/skill.go @@ -44,7 +44,7 @@ func (e *EffectNode) Skill_Can() bool { // return true // } -// func (e *EffectNode) SkillUseed() bool { +// func (e *EffectNode) Skill_Use() bool { // // if e.Effect != nil { // // if e.Input.CurrentPet.Info.Hp == 0 { // // e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡