|
|
@@ -244,18 +244,18 @@ const (
|
|
|
type RoleBattle struct {
|
|
|
SaveObject
|
|
|
|
|
|
- incomeTime uint64
|
|
|
- maxIncomeTime uint64
|
|
|
- mapLevel uint32
|
|
|
- mapId uint32
|
|
|
- mapLevelHard uint32 //困难模式
|
|
|
- mapIdHard uint32 //困难模式
|
|
|
- mapRewardCount uint32 //累计的挑战boss成功次数
|
|
|
- mapRewardId uint32
|
|
|
- mapRewardLevel uint32
|
|
|
- mapRewardIdHard uint32 //困难模式
|
|
|
- mapRewardLevelHard uint32 //困难模式
|
|
|
- mapLevelTime uint64
|
|
|
+ incomeTime uint64
|
|
|
+ maxIncomeTime uint64
|
|
|
+ mapLevel uint32
|
|
|
+ mapId uint32
|
|
|
+ mapLevelHard uint32 //困难模式
|
|
|
+ mapIdHard uint32 //困难模式
|
|
|
+ mapRewardCount uint32 //累计的挑战boss成功次数
|
|
|
+ mapRewardId uint32
|
|
|
+ mapRewardLevel uint32
|
|
|
+ //mapRewardIdHard uint32 //困难模式
|
|
|
+ //mapRewardLevelHard uint32 //困难模式
|
|
|
+ mapLevelTime uint64
|
|
|
|
|
|
selfRank uint32
|
|
|
totalRanks uint32
|
|
|
@@ -328,8 +328,8 @@ func (this *RoleBattle) Load(msg interface{}) bool {
|
|
|
this.mapRewardCount = proRole.RoleBattle.RewardMapCount
|
|
|
this.mapRewardId = proRole.RoleBattle.RewardMapId
|
|
|
this.mapRewardLevel = proRole.RoleBattle.RewardMapLevel
|
|
|
- this.mapRewardIdHard = proRole.RoleBattle.RewardMapIdHard
|
|
|
- this.mapRewardLevelHard = proRole.RoleBattle.RewardMapLevelHard
|
|
|
+ //this.mapRewardIdHard = proRole.RoleBattle.RewardMapIdHard
|
|
|
+ //this.mapRewardLevelHard = proRole.RoleBattle.RewardMapLevelHard
|
|
|
this.mapLevelTime = proRole.RoleBattle.MapLevelTime
|
|
|
this.lastRecordBattleAcceTime = proRole.RoleBattle.LastRecordBattleAcceTime
|
|
|
this.battleAcceDuration = proRole.RoleBattle.BattleAcceDuration
|
|
|
@@ -338,21 +338,21 @@ func (this *RoleBattle) Load(msg interface{}) bool {
|
|
|
this.mapId = 1
|
|
|
this.SetDirty(true)
|
|
|
}
|
|
|
- if this.mapRewardId == 0 || this.mapRewardLevel == 0 {
|
|
|
- this.mapRewardId = 1
|
|
|
- this.mapRewardLevel = 1
|
|
|
- this.SetDirty(true)
|
|
|
- }
|
|
|
+ //if this.mapRewardId == 0 || this.mapRewardLevel == 0 {
|
|
|
+ // this.mapRewardId = 1
|
|
|
+ // this.mapRewardLevel = 1
|
|
|
+ // this.SetDirty(true)
|
|
|
+ //}
|
|
|
if this.mapLevelHard == 0 || this.mapIdHard == 0 {
|
|
|
this.mapLevelHard = 1
|
|
|
this.mapIdHard = 1
|
|
|
this.SetDirty(true)
|
|
|
}
|
|
|
- if this.mapRewardIdHard == 0 || this.mapRewardLevelHard == 0 {
|
|
|
- this.mapRewardIdHard = 1
|
|
|
- this.mapRewardLevelHard = 1
|
|
|
- this.SetDirty(true)
|
|
|
- }
|
|
|
+ //if this.mapRewardIdHard == 0 || this.mapRewardLevelHard == 0 {
|
|
|
+ // this.mapRewardIdHard = 1
|
|
|
+ // this.mapRewardLevelHard = 1
|
|
|
+ // this.SetDirty(true)
|
|
|
+ //}
|
|
|
this.getMapRewardShowCount()
|
|
|
|
|
|
this.quickBattle = &serverproto.QuickBattleData{}
|
|
|
@@ -485,6 +485,8 @@ func (this *RoleBattle) Save() {
|
|
|
RushMap: this.rushMap,
|
|
|
LastRecordBattleAcceTime: this.lastRecordBattleAcceTime,
|
|
|
BattleAcceDuration: this.battleAcceDuration,
|
|
|
+ MapIdHard: this.mapIdHard,
|
|
|
+ MapLevelHard: this.mapLevelHard,
|
|
|
//todo...
|
|
|
//MapChallengeNumList: this.mapLevelChallengeNumList, 数据太大后续做优化处理
|
|
|
},
|
|
|
@@ -1056,8 +1058,11 @@ func (this *RoleBattle) BossReward(challengeTime uint32, mapId, mapLevel uint32,
|
|
|
//if ret != serverproto.ErrorCode_ERROR_OK {
|
|
|
// return ret
|
|
|
//}
|
|
|
-
|
|
|
+ isHard := this.role.isHardFight
|
|
|
levelId := this.getLevelId(this.mapId, this.mapLevel)
|
|
|
+ if isHard {
|
|
|
+ levelId = this.getLevelId(this.mapIdHard, this.mapLevelHard)
|
|
|
+ }
|
|
|
levelCfgData, ok := serverproto.LevelCfgLoader[levelId]
|
|
|
if !ok {
|
|
|
return serverproto.ErrorCode_ERROR_BATTLE_LEVEL_DATA_NOT_FOUND
|
|
|
@@ -1108,28 +1113,39 @@ func (this *RoleBattle) BossReward(challengeTime uint32, mapId, mapLevel uint32,
|
|
|
_, ok1 := serverproto.LevelCfgLoader[levelId+1]
|
|
|
if !ok1 {
|
|
|
nextLevelId := this.getLevelId(this.mapId+1, 1)
|
|
|
+ if isHard {
|
|
|
+ nextLevelId = this.getLevelId(this.mapIdHard+1, 1)
|
|
|
+ }
|
|
|
_, ok2 := serverproto.LevelCfgLoader[nextLevelId]
|
|
|
if !ok2 {
|
|
|
util.WarnF("uid=%v BossReward next level cfg data not found!!!", this.role.GetUUid())
|
|
|
} else {
|
|
|
util.InfoF("uid=%v BossReward to next mapId=%v level=%v", this.role.GetUUid(), this.mapId+1, 1)
|
|
|
- this.mapId++
|
|
|
- this.mapLevel = 1
|
|
|
+ if isHard {
|
|
|
+ this.mapIdHard++
|
|
|
+ this.mapLevelHard = 1
|
|
|
+ } else {
|
|
|
+ this.mapId++
|
|
|
+ this.mapLevel = 1
|
|
|
+ //修改地图通关排名(需要通关该关卡)
|
|
|
+ this.addMapRank(1, oldMapId, oldMapLevel, challengeTime, recordTimeStamp)
|
|
|
+ }
|
|
|
this.mapLevelTime = nowTime
|
|
|
this.SetDirty(true)
|
|
|
- //修改地图通关排名(需要通关该关卡)
|
|
|
- this.addMapRank(1, oldMapId, oldMapLevel, challengeTime, recordTimeStamp)
|
|
|
|
|
|
this.changeBattleDataNtf()
|
|
|
}
|
|
|
} else {
|
|
|
- this.mapLevel++
|
|
|
+ if isHard {
|
|
|
+ this.mapLevelHard++
|
|
|
+ } else {
|
|
|
+ this.mapLevel++
|
|
|
+ //修改地图通关排名(需要通关该关卡)
|
|
|
+ this.addMapRank(1, oldMapId, oldMapLevel, challengeTime, recordTimeStamp)
|
|
|
+ }
|
|
|
this.mapLevelTime = nowTime
|
|
|
this.SetDirty(true)
|
|
|
|
|
|
- //修改地图通关排名(需要通关该关卡)
|
|
|
- this.addMapRank(1, oldMapId, oldMapLevel, challengeTime, recordTimeStamp)
|
|
|
-
|
|
|
util.InfoF("uid=%v BossReward to next mapId=%v level=%v", this.role.GetUUid(), this.mapId, this.mapLevel)
|
|
|
this.changeBattleDataNtf()
|
|
|
}
|