```
feat(fight_tawor): 优化试炼之塔和勇者之塔战斗逻辑 - 修正函数注释格式,使用正确的缩进格式化参数说明 - 移除硬编码的MapID设置,统一在EnterMap/LeaveMap中处理 - 将进入地图逻辑改为离开地图,优化战斗流程 - 简化退出战斗逻辑,移除重复的MapID设置 refactor(config): 重命名塔配置模型和接口前缀 - 将试炼之塔模型TrialTowerConfig重命名为Tower500Config - 将勇者之塔模型BraveTowerConfig重命名为Tower600Config - 移除重复的业务操作方法,统一使用基础配置 - 更新Boss控制器接口前缀从/monster/boss到/config/boss refactor(boss): 移除不必要的导入和扩展结构 - 移除boss_pet.go中的冗余data包导入 - 移除BossConfigEX扩展结构,简化模型
This commit is contained in:
@@ -14,11 +14,14 @@ import (
|
||||
// FreshChoiceFightLevel 处理玩家选择挑战模式(试炼之塔或勇者之塔)
|
||||
// 根据不同的CMD值设置玩家的挑战状态和地图信息,并返回当前挑战层级信息
|
||||
// 参数:
|
||||
// data: 客户端发送的挑战层级选择请求数据,包含CMD和挑战层级
|
||||
// c: 玩家对象,包含玩家的详细信息
|
||||
//
|
||||
// data: 客户端发送的挑战层级选择请求数据,包含CMD和挑战层级
|
||||
// c: 玩家对象,包含玩家的详细信息
|
||||
//
|
||||
// 返回值:
|
||||
// result: 服务器返回给客户端的挑战层级信息,包含当前战斗层级和Boss ID
|
||||
// err: 错误码,表示处理过程中是否出现错误
|
||||
//
|
||||
// result: 服务器返回给客户端的挑战层级信息,包含当前战斗层级和Boss ID
|
||||
// err: 错误码,表示处理过程中是否出现错误
|
||||
func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEVEL, c *player.Player) (result *fight.S2C_FreshChoiceLevelRequestInfo, err errorcode.ErrorCode) {
|
||||
|
||||
result = &fight.S2C_FreshChoiceLevelRequestInfo{}
|
||||
@@ -26,11 +29,9 @@ func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEV
|
||||
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)
|
||||
}
|
||||
// 设置Boss ID为固定值10
|
||||
@@ -38,20 +39,10 @@ func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEV
|
||||
// 重置玩家的Canmon标志位为0,表示可以刷怪
|
||||
atomic.StoreUint32(&c.Canmon, 0)
|
||||
// 在函数结束时将玩家传送到对应地图
|
||||
defer c.GetSpace().EnterMap(c)
|
||||
defer c.GetSpace().LeaveMap(c)
|
||||
return result, 0
|
||||
}
|
||||
func (h Controller) FreshLeaveFightLevel(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().EnterMap(c)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user