feat(fight): 新增试炼之塔和勇者之塔地图切换功能,优化战斗效果处理逻辑
This commit is contained in:
@@ -15,16 +15,30 @@ func (h Controller) FRESH_CHOICE_FIGHT_LEVEL(data *fight.C2S_FRESH_CHOICE_FIGHT_
|
||||
switch data.Head.CMD {
|
||||
case 2428: //试炼之塔
|
||||
c.Info.CurrentFreshStage = utils.Max(c.Info.CurrentFreshStage, 1)
|
||||
c.Info.MapID = 500
|
||||
result.CurFightLevel = uint(c.Info.CurrentFreshStage)
|
||||
case 2414: //勇者之塔
|
||||
c.Info.CurrentStage = utils.Max(c.Info.CurrentStage, 1)
|
||||
c.Info.MapID = 600
|
||||
result.CurFightLevel = uint(c.Info.CurrentStage)
|
||||
}
|
||||
result.BossId = []uint32{10}
|
||||
atomic.StoreUint32(&c.Canmon, 0)
|
||||
defer c.GetSpace().EnterMap(c)
|
||||
return result, 0
|
||||
}
|
||||
func (h Controller) FRESH_LEAVE_FIGHT_LEVEL(data *fight.FRESH_LEAVE_FIGHT_LEVEL, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
switch data.Head.CMD {
|
||||
case 2430: //试炼之塔
|
||||
|
||||
c.Info.MapID = 101
|
||||
|
||||
case 2416: //勇者之塔
|
||||
|
||||
c.Info.MapID = 108
|
||||
|
||||
}
|
||||
defer c.GetSpace().LeaveMap(c) //玩家离开地图
|
||||
|
||||
return result, 0
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ func (e *NewSel1) Prop_Befer(in *input.Input, prop int8, level int8, ptype info.
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return true
|
||||
}
|
||||
if in == e.Ctx().Our {
|
||||
return true
|
||||
}
|
||||
|
||||
//能力下降类
|
||||
if ptype == info.AbilityOpType.SUB {
|
||||
|
||||
@@ -26,6 +26,7 @@ func (e *Effect38) OnSkill() bool {
|
||||
|
||||
tt := e.ID()
|
||||
tt.SetEffectType(input.EffectType.Sub)
|
||||
tt.SetCatchTime(e.Ctx().Opp.CurrentPet.Info.CatchTime)
|
||||
|
||||
ee.ID(tt)
|
||||
ee.SetArgs(e.Ctx().Our, e.SideEffectArgs...)
|
||||
@@ -35,7 +36,10 @@ func (e *Effect38) OnSkill() bool {
|
||||
|
||||
// 命中之后
|
||||
func (e *Effect38_sub) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
|
||||
|
||||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||||
return
|
||||
}
|
||||
if e.Args()[0].Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) == -1 {
|
||||
|
||||
e.l.Do(func() {
|
||||
@@ -2,6 +2,7 @@ package fight
|
||||
|
||||
import (
|
||||
"blazing/common/data/xmlres"
|
||||
"blazing/common/utils"
|
||||
"blazing/cool"
|
||||
"context"
|
||||
|
||||
@@ -62,8 +63,8 @@ func (f *FightC) battleLoop() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ff.Player.GetInfo().PetList[j].Hp = ff.AllPet[i].Info.Hp
|
||||
|
||||
ff.Player.GetInfo().PetList[j].Hp = utils.Max(ff.Player.GetInfo().PetList[j].MaxHp,ff.AllPet[i].Info.Hp)
|
||||
ff.Player.GetInfo().PetList[j].SkillList = ff.AllPet[i].Info.SkillList
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user