feat(common/utils): 添加时间范围检查工具函数 添加了 IsCurrentTimeInRange 函数用于判断当前时间是否在指定的 HH:MM 时间区间内,支持当前日期的时间比较功能。 refactor(logic/controller): 重构 Boss 挑战逻辑并集成配置服务 - 集成 service 模块替代原有硬编码逻辑 - 重构 PlayerFightBoss 方法,使用新的配置数据结构 - 移除已废弃的 processMonID 函数和相关注释代码 refactor(logic/space): 优化地图 Boss 信息管理和天气系统 - 更新地图 Boss 数据
This commit is contained in:
@@ -68,19 +68,19 @@ func (h Controller) GetMapPlayerList(data *space.ListMapPlayerInboundInfo, c *pl
|
||||
if atomic.LoadUint32(&c.GetSpace().TimeBoss.Flag) == 1 {
|
||||
c.SendPackCmd(2022, &c.GetSpace().TimeBoss)
|
||||
}
|
||||
if c.GetSpace().MapBossInfo.Pos != 200 {
|
||||
var t info.MapBossSInfo
|
||||
t.INFO = append(t.INFO, c.GetSpace().MapBossInfo)
|
||||
c.SendPackCmd(2021, &t)
|
||||
if len(c.GetSpace().MapBossSInfo.INFO) > 0 {
|
||||
c.SendPackCmd(2021, &c.GetSpace().MapBossSInfo)
|
||||
|
||||
}
|
||||
c.SendPackCmd(50004, &info.S2C_50004{Id: uint32(c.GetSpace().Weather)}) //获取天气
|
||||
|
||||
return nil, -1
|
||||
}
|
||||
func (h Controller) AttackBoss(data *space.AttackBossInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
|
||||
if atomic.LoadInt32(&c.GetSpace().MapBossInfo.Hp) > 0 {
|
||||
atomic.AddInt32(&c.GetSpace().MapBossInfo.Hp, -1)
|
||||
for _, v := range c.GetSpace().MapBossSInfo.INFO {
|
||||
if atomic.LoadInt32(&v.Hp) > 0 {
|
||||
atomic.AddInt32(&v.Hp, -1)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user