From 71a26587b4adb83f1ce0810a1b67b1a48c525a8b Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 17 十二月 2024 14:19:17 +0800 Subject: [PATCH] 10337 【越南】【英文】【BT】【砍树】爬塔通关类的支持一键过关 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_RealmTower.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 53 insertions(+), 5 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_RealmTower.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_RealmTower.py index 25a083f..80776a2 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_RealmTower.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_RealmTower.py @@ -67,7 +67,7 @@ return __CheckCanChallenge(curPlayer, nextFloorID) ## 检查可否进行挑战 -def __CheckCanChallenge(curPlayer, floorID): +def __CheckCanChallenge(curPlayer, floorID, checkPre=True): playerID = curPlayer.GetPlayerID() ipyData = GetTowerIpyData(floorID) if not ipyData: @@ -79,7 +79,7 @@ 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 @@ -138,9 +138,10 @@ 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) @@ -308,3 +309,50 @@ 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 -- Gitblit v1.8.0