| | |
| | | import NPCCommon
|
| | | import FBHelpBattle
|
| | | import PlayerActLogin
|
| | | import PlayerPet
|
| | | import PlayerHorse
|
| | |
|
| | | import math
|
| | |
|
| | |
| | | # @param tick 时间戳
|
| | | # @return 布尔值
|
| | | def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
|
| | | if lineID == 0:
|
| | | return True
|
| | | historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID-1, False, [mapID])
|
| | | needStar = IpyGameDataPY.GetFuncCfg('MunekadoLockLimit')
|
| | | if historyStar < needStar:
|
| | | GameWorld.DebugLog(' 上一层评级未达到%s,无法挑战本层!' % needStar)
|
| | | if lineID != 0:
|
| | | historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID-1, False, [mapID])
|
| | | needStar = IpyGameDataPY.GetFuncCfg('MunekadoLockLimit')
|
| | | if historyStar < needStar:
|
| | | GameWorld.DebugLog(' 上一层评级未达到%s,无法挑战本层!' % needStar)
|
| | | return False
|
| | | #坐骑与灵宠总等级
|
| | | needSumLV = IpyGameDataPY.GetFuncEvalCfg('MunekadoLockLimit', 2, {}).get(lineID, 0)
|
| | | if PlayerPet.GetTotalPetLV(curPlayer) + PlayerHorse.GetHorseSumLV(curPlayer) < needSumLV:
|
| | | GameWorld.DebugLog(' 坐骑与灵宠总等级未达到%s,无法挑战本层!' % needSumLV)
|
| | | return False
|
| | | return True
|
| | |
|
| | |
| | | # GameWorld.DebugLog("背包空间不够,发送邮件: mailItemList=%s" % str(prizeItemList), curPlayer.GetPlayerID())
|
| | | # else:
|
| | | # for itemID, itemCnt, isBind in prizeItemList:
|
| | | # ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], event=["MunekadoTrial", False, {}])
|
| | | # ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem], event=["MunekadoTrial", False, {}])
|
| | | #overDict[FBCommon.Over_itemInfo] = FBCommon.GetJsonItemList(prizeItemList)
|
| | | #=======================================================================================
|
| | |
|
| | |
| | | if lineID < 2:
|
| | | GameWorld.DebugLog("前两层不能扫荡!")
|
| | | return
|
| | | historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID-1, False, [mapID])
|
| | | historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
| | | if historyStar < 5:
|
| | | GameWorld.DebugLog("没有S级不能扫荡!")
|
| | | return
|
| | |
| | |
|
| | | ## 更新当前副本星级
|
| | | def __UpdZMSLFBStar(tick, isEnter=False, curPlayer=None):
|
| | | #1-D 2-C 3-B 4-A 5-S
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | curStar = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | | if curStar == 1:
|
| | | return curStar
|
| | | stepStartTick = gameFB.GetGameFBDictByKey(ZMSL_FBStepStartTick)
|
| | | if not stepStartTick:
|
| | | return curStar
|
| | | useSecond = int(math.ceil((tick - stepStartTick) / 1000.0))
|
| | | lineID = FBCommon.GetFBPropertyMark()
|
| | | starTimeList = IpyGameDataPY.GetFuncEvalCfg('MunekadoTrialStarTime').get(lineID,[])
|
| | | wheelNum = gameFB.GetGameFBDictByKey(ZMSL_FBNextRefreshStep)
|
| | | if wheelNum > len(starTimeList):
|
| | | GameWorld.DebugLog(" MunekadoTrialStarTime 配置错误 与波数不等")
|
| | | return
|
| | | stepStar = gameFB.GetGameFBDictByKey(ZMSL_FBStepStar)
|
| | | starTimeInfo = starTimeList[wheelNum-1]
|
| | | updStar = stepStar if stepStar else 5
|
| | | totalStarTime = 0
|
| | | for starTime in starTimeInfo:
|
| | | if updStar == 1:
|
| | | break
|
| | | totalStarTime +=starTime
|
| | | if useSecond >= totalStarTime:
|
| | | updStar = max(1, updStar-1)
|
| | | else:
|
| | | break
|
| | |
|
| | | diffSecond =max(0, totalStarTime -useSecond)
|
| | | |
| | | if curStar == updStar and not isEnter:
|
| | | return curStar
|
| | | |
| | | gameFB.SetGameFBDict(ChConfig.Def_FB_Grade, updStar)
|
| | | |
| | | GameWorld.DebugLog("__UpdFBStar useSecond=%s,curStar=%s,updStar=%s, diffSecond=%s" |
| | | % (useSecond, curStar, updStar, diffSecond))
|
| | | |
| | | if curPlayer:
|
| | | DoFBHelp(curPlayer, tick)
|
| | | if updStar != 1:
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
|
| | | else:
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | DoFBHelp(curPlayer, tick)
|
| | | if updStar != 1:
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
|
| | | |
| | | |
| | | return updStar
|
| | | FBCommon.UpdateFBGrade(tick, FBCommon.GetFBLineGrade(GameWorld.GetGameWorld().GetMapID(), lineID))
|
| | | return
|
| | | #1-D 2-C 3-B 4-A 5-S
|
| | | # gameFB = GameWorld.GetGameFB()
|
| | | # curStar = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | | # if curStar == 1:
|
| | | # return curStar
|
| | | # stepStartTick = gameFB.GetGameFBDictByKey(ZMSL_FBStepStartTick)
|
| | | # if not stepStartTick:
|
| | | # return curStar
|
| | | # useSecond = int(math.ceil((tick - stepStartTick) / 1000.0))
|
| | | # lineID = FBCommon.GetFBPropertyMark()
|
| | | # starTimeList = IpyGameDataPY.GetFuncEvalCfg('MunekadoTrialStarTime').get(lineID,[])
|
| | | # wheelNum = gameFB.GetGameFBDictByKey(ZMSL_FBNextRefreshStep)
|
| | | # if wheelNum > len(starTimeList):
|
| | | # GameWorld.DebugLog(" MunekadoTrialStarTime 配置错误 与波数不等")
|
| | | # return
|
| | | # stepStar = gameFB.GetGameFBDictByKey(ZMSL_FBStepStar)
|
| | | # starTimeInfo = starTimeList[wheelNum-1]
|
| | | # updStar = stepStar if stepStar else 5
|
| | | # totalStarTime = 0
|
| | | # for starTime in starTimeInfo:
|
| | | # if updStar == 1:
|
| | | # break
|
| | | # totalStarTime +=starTime
|
| | | # if useSecond >= totalStarTime:
|
| | | # updStar = max(1, updStar-1)
|
| | | # else:
|
| | | # break
|
| | | #
|
| | | # diffSecond =max(0, totalStarTime -useSecond)
|
| | | # |
| | | # if curStar == updStar and not isEnter:
|
| | | # return curStar
|
| | | # |
| | | # gameFB.SetGameFBDict(ChConfig.Def_FB_Grade, updStar)
|
| | | # |
| | | # GameWorld.DebugLog("__UpdFBStar useSecond=%s,curStar=%s,updStar=%s, diffSecond=%s" |
| | | # % (useSecond, curStar, updStar, diffSecond))
|
| | | # |
| | | # if curPlayer:
|
| | | # DoFBHelp(curPlayer, tick)
|
| | | # if updStar != 1:
|
| | | # curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
|
| | | # else:
|
| | | # playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | # for index in xrange(playerManager.GetPlayerCount()):
|
| | | # curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | # if not curPlayer:
|
| | | # continue
|
| | | # DoFBHelp(curPlayer, tick)
|
| | | # if updStar != 1:
|
| | | # curPlayer.Sync_TimeTick(IPY_GameWorld.tttFlagTake, 0, diffSecond * 1000, True)
|
| | | # |
| | | # |
| | | # return updStar
|
| | |
|
| | | ##副本帮助信息
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict)
|
| | |
|
| | | #给物品
|
| | | ItemControler.GivePlayerItem(curPlayer, exchangeItemID, exchangeItemCount, exchangeItemIsBind, [IPY_GameWorld.rptItem], |
| | | ItemControler.GivePlayerItem(curPlayer, exchangeItemID, exchangeItemCount, 0, [IPY_GameWorld.rptItem], |
| | | event=[ChConfig.ItemGive_TrialExchange, False, {}])
|
| | | #任务
|
| | | EventShell.EventRespons_TrialExchange(curPlayer, costItemID)
|