| | |
| | | return __CheckCanChallenge(curPlayer, nextFloorID) |
| | | |
| | | ## 检查可否进行挑战 |
| | | def __CheckCanChallenge(curPlayer, floorID): |
| | | def __CheckCanChallenge(curPlayer, floorID, checkPre=True): |
| | | playerID = curPlayer.GetPlayerID() |
| | | ipyData = GetTowerIpyData(floorID) |
| | | if not ipyData: |
| | |
| | | GameWorld.DebugLog("该境界塔层已过关: floorID=%s" % floorID, playerID) |
| | | return False |
| | | |
| | | if floorID > curFloorID + 1: |
| | | if checkPre and floorID > curFloorID + 1: |
| | | GameWorld.DebugLog("上一层未过关: floorID=%s > curFloorID=%s+1" % (floorID, curFloorID), playerID) |
| | | return False |
| | | |
| | |
| | | return |
| | | |
| | | ## 获取BossID |
| | | def __GetRealmTowerBossID(): |
| | | gameFB = GameWorld.GetGameFB() |
| | | floorID = gameFB.GetGameFBDictByKey(FBDict_Floor) |
| | | def __GetRealmTowerBossID(floorID=-1): |
| | | if floorID == -1: |
| | | gameFB = GameWorld.GetGameFB() |
| | | floorID = gameFB.GetGameFBDictByKey(FBDict_Floor) |
| | | ipyData = GetTowerIpyData(floorID) |
| | | if not ipyData: |
| | | GameWorld.ErrLog("__GetRealmTowerBossID() can not find %s in RealmTowerNPC.txt" % floorID) |
| | |
| | | |
| | | StartfloorID(curPlayer, floorID, tick) |
| | | return |
| | | |
| | | def OnPlayerFBQuickPass(curPlayer, mapID, lineID): |
| | | '''副本快速过关验证 |
| | | @param mapID: 数据地图ID |
| | | @param lineID: 目标关卡线路ID,可一次性跳多关,由前端发包决定 |
| | | @return: (bossID, quickCnt) 或 None |
| | | @note: bossID 目标NPCID - 目标关卡所需要挑战的主NPCID,一般是boss,用于验证战力是否满足快速过关 |
| | | @note: quickCnt 本次总共跳过几关 - 默认1 |
| | | ''' |
| | | |
| | | if not __CheckCanChallenge(curPlayer, lineID, False): |
| | | return |
| | | curLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RealmTowerFloor) |
| | | bossID = __GetRealmTowerBossID(lineID) |
| | | quickCnt = lineID - curLineID |
| | | |
| | | return bossID, quickCnt |
| | | |
| | | def OnPlayerFBQuickPassResult(curPlayer, mapID, lineID): |
| | | '''副本快速过关结果 |
| | | ''' |
| | | |
| | | playerID = curPlayer.GetPlayerID() |
| | | curLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RealmTowerFloor) |
| | | fromLineID = curLineID + 1 |
| | | GameWorld.DebugLog("处理快速过关结算: mapID=%s,fromLineID=%s to %s" % (mapID, fromLineID, lineID), playerID) |
| | | |
| | | itemListTotal = [] |
| | | for floorID in range(fromLineID, lineID + 1): |
| | | ipyData = GetTowerIpyData(floorID) |
| | | if not ipyData: |
| | | continue |
| | | |
| | | #更新关卡 |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RealmTowerFloor, floorID) |
| | | GameWorld.DebugLog('更新境界塔快速过关: floorID=%s' % floorID, playerID) |
| | | |
| | | # 给过关奖励 |
| | | giveItemList = ipyData.GetRewardItemList() |
| | | itemListTotal += giveItemList |
| | | |
| | | prizeItemList = GameWorld.MergeItemList(itemListTotal) |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, prizeItemList, None, ["RealmTower", False, {}]) |
| | | quickPassDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(prizeItemList), "quickPass":1} |
| | | __SendRealmTowerOverInfo(curPlayer, floorID, True, quickPassDict) |
| | | SyncRealmTowerInfo(curPlayer) |
| | | return |