diff --git a/logic/service/fight/input/effecti.go b/logic/service/fight/input/effecti.go index 912bd702..f78f4502 100644 --- a/logic/service/fight/input/effecti.go +++ b/logic/service/fight/input/effecti.go @@ -32,10 +32,10 @@ type Effect interface { Skill_Use(ctx Ctx) bool //技能PP减少节点 Skill_Useed(ctx Ctx) bool //技能PP减少节点 //OnDefeat(opp *Input) bool // 精灵被击败时触发 - OnSwitchIn(ctx Ctx) bool // 精灵出战 / 上场时触发 - OnSwitchOut(ctx Ctx) bool // 精灵下场时触发 - OnOwnerSwitchIn(ctx Ctx) bool // 所属玩家精灵出战时触发 - OnOwnerSwitchOut(ctx Ctx) bool // 所属玩家精灵下场时触发 + OnSwitchIn(ctx Ctx) bool // 精灵出战 / 上场时触发 + OnSwitchOut(ctx Ctx) bool // 精灵下场时触发 + // OnOwnerSwitchIn(ctx Ctx) bool // 所属玩家精灵出战时触发 + // OnOwnerSwitchOut(ctx Ctx) bool // 所属玩家精灵下场时触发 Turn_End(ctx Ctx) //回合结束计算 PreBattleEnd(ctx Ctx) bool //战斗结束前 diff --git a/logic/service/fight/playeraction.go b/logic/service/fight/playeraction.go index 17da0b0b..b1ce9aad 100644 --- a/logic/service/fight/playeraction.go +++ b/logic/service/fight/playeraction.go @@ -44,12 +44,7 @@ func (f *FightC) ChangePet(c common.PlayerI, id uint32) { } f.Switch = append(f.Switch, ret) f.GetInputByPlayer(c, false).InitAttackValue() //切换精灵消除能力提升 - f.GetInputByPlayer(c, false).Exec(func(t input.Effect) bool { - t.OnOwnerSwitchOut(input.Ctx{}) - - return true - }) f.GetInputByPlayer(c, true).Exec(func(t input.Effect) bool { t.OnSwitchOut(input.Ctx{}) @@ -57,18 +52,14 @@ func (f *FightC) ChangePet(c common.PlayerI, id uint32) { return true }) f.GetInputByPlayer(c, false).CurrentPet, ret.Reason = f.GetInputByPlayer(c, false).GetPet(id) - f.Broadcast(func(ff *input.Input) { //先给自身广播 + f.GetInputByPlayer(c, false).Effects = make([]input.Effect, 0) //清除效果类 + f.Broadcast(func(ff *input.Input) { //先给自身广播 if ff.Player.GetInfo().UserID == c.GetInfo().UserID { ff.Player.SendChangePet(ret.Reason) } }) - f.GetInputByPlayer(c, false).Exec(func(t input.Effect) bool { - t.OnOwnerSwitchIn(input.Ctx{}) - - return true - }) f.GetInputByPlayer(c, true).Exec(func(t input.Effect) bool { t.OnSwitchIn(input.Ctx{}) diff --git a/modules/blazing/model/pet.go b/modules/blazing/model/pet.go index e9b7e10a..69a1a280 100644 --- a/modules/blazing/model/pet.go +++ b/modules/blazing/model/pet.go @@ -282,7 +282,6 @@ func GenPetInfo( // ---- 属性计算 ---- p.CalculatePetPane() - p.Hp = p.MaxHp p.Update(true) diff --git a/modules/blazing/model/petinfo.go b/modules/blazing/model/petinfo.go index fc476f1e..8473624b 100644 --- a/modules/blazing/model/petinfo.go +++ b/modules/blazing/model/petinfo.go @@ -34,12 +34,13 @@ func (p *PetInfo) CalculatePetPane() { naxml := xmlres.NatureRootMap[int(p.Nature)] petxml := xmlres.PetMAP[int(p.ID)] // 计算各项属性 - hp := p.calculatePetHPPanelSize( + p.MaxHp = p.calculatePetHPPanelSize( uint32(petxml.HP), p.Dv, p.Level, p.Ev[0], ) + p.Hp = p.MaxHp // * battle_lv: atk(0), def(1), sp_atk(2), sp_def(3), spd(4), accuracy(5) p.Prop[0] = p.calculatePetPanelSize( uint32(petxml.Atk), @@ -81,6 +82,4 @@ func (p *PetInfo) CalculatePetPane() { naxml.SpeedCorrect, ) - // 设置计算结果 - p.MaxHp = hp }