| | |
| | |
|
| | |
|
| | | ## 给过关奖励
|
| | | def __GiveFBPassPrize(curPlayer, fbLevel):
|
| | | def __GiveFBPassPrize(curPlayer, fbLevel, moneyDictTotal=None, itemListTotal=None):
|
| | | ipyData = GetTowerIpyData(fbLevel)
|
| | | if not ipyData:
|
| | | return {}
|
| | |
| | | moneyDict = {ShareDefine.TYPE_Price_Rune:addJH, ShareDefine.TYPE_Price_Ysog:RuneMagicEssence}
|
| | | prizeDict = {FBCommon.Over_money:FBCommon.GetJsonMoneyList(moneyDict), FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(prizeItemList)}
|
| | |
|
| | | if isinstance(moneyDictTotal, dict):
|
| | | for moneyType, addValue in moneyDict.items():
|
| | | moneyDictTotal[moneyType] = moneyDictTotal.get(moneyType, 0) + addValue
|
| | | if isinstance(itemListTotal, list):
|
| | | itemListTotal += prizeItemList
|
| | | # for _ in xrange(challengeCnt):
|
| | | # EventReport.WriteEvent_custom_mission_log(curPlayer, ChConfig.CME_FB_TrialTower, ChConfig.CME_Log_End, 1, cmeInfoEx=bossName)
|
| | | return prizeDict
|
| | |
| | | #BOSS复活活动
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_TowerSweep, 1)
|
| | | PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_TowerSweep, 1)
|
| | | return True |
| | | return True
|
| | |
|
| | | def OnPlayerFBQuickPass(curPlayer, mapID, lineID):
|
| | | '''副本快速过关验证
|
| | | @param mapID: 数据地图ID
|
| | | @param lineID: 目标关卡线路ID,可一次性跳多关,由前端发包决定
|
| | | @return: (bossID, quickCnt) 或 None
|
| | | @note: bossID 目标NPCID - 目标关卡所需要挑战的主NPCID,一般是boss,用于验证战力是否满足快速过关
|
| | | @note: quickCnt 本次总共跳过几关 - 默认1
|
| | | '''
|
| | | |
| | | ipyData = GetTowerIpyData(lineID)
|
| | | if not ipyData:
|
| | | return
|
| | | curLineID = __GetTrialLevelCurPassLV(curPlayer)
|
| | | if lineID <= curLineID:
|
| | | GameWorld.DebugLog("符印塔本关已过关, 无法挑战! lineID=%s" % lineID, curPlayer.GetPlayerID())
|
| | | return
|
| | | bossID = ipyData.GetNPCID()
|
| | | quickCnt = 0 #lineID - curLineID
|
| | | |
| | | fromLineID = curLineID + 1
|
| | | for passLineID in range(fromLineID, lineID + 1):
|
| | | # 符印塔lineID可能会跳,这里遍历不输出找不到的lineID
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('RuneTower', passLineID)
|
| | | if not ipyData:
|
| | | continue
|
| | | quickCnt += 1
|
| | | |
| | | return bossID, quickCnt
|
| | |
|
| | | def OnPlayerFBQuickPassResult(curPlayer, mapID, lineID):
|
| | | '''副本快速过关结果
|
| | | '''
|
| | | |
| | | playerID = curPlayer.GetPlayerID() |
| | | curLineID = __GetTrialLevelCurPassLV(curPlayer)
|
| | | fromLineID = curLineID + 1
|
| | | GameWorld.DebugLog("处理快速过关结算: mapID=%s,fromLineID=%s to %s" % (mapID, fromLineID, lineID), playerID)
|
| | | |
| | | moneyDictTotal = {}
|
| | | itemListTotal = []
|
| | | for passLineID in range(fromLineID, lineID + 1):
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('RuneTower', passLineID)
|
| | | if not ipyData:
|
| | | continue
|
| | | |
| | | if ipyData.GetIsNotify():
|
| | | IPY_Data = IpyGameDataPY.IPY_Data()
|
| | | maxLevel = IPY_Data.GetRuneTowerByIndex(IPY_Data.GetRuneTowerCount()-1).GetID()
|
| | | sysMark = 'RuneTowerInfo_1' if passLineID == maxLevel else 'GeRen_liubo_471172'
|
| | | PlayerControl.WorldNotify(0, sysMark, [curPlayer.GetPlayerName(), passLineID / 100])
|
| | | |
| | | #更新关卡
|
| | | SetTrialLevelCurPassLV(curPlayer, passLineID)
|
| | | # 给过关奖励
|
| | | __GiveFBPassPrize(curPlayer, passLineID, moneyDictTotal, itemListTotal)
|
| | | |
| | | #任务
|
| | | EventShell.EventRespons_TrialTowerCnt(curPlayer, passLineID)
|
| | | #每日任务
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_Tower)
|
| | | |
| | | prizeItemList = GameWorld.MergeItemList(itemListTotal)
|
| | | quickPassDict = {FBCommon.Over_money:FBCommon.GetJsonMoneyList(moneyDictTotal), |
| | | FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(prizeItemList),
|
| | | "quickPass":1}
|
| | | __SendTrialTowerOverInfo(curPlayer, passLineID, True, quickPassDict)
|
| | | SyncTrialLevelInfo(curPlayer) # 同步最新关卡信息
|
| | | return
|