6805 【后端】【2.0】副本前端化(支持骑乘、宠物的召唤限制处理)
| | |
| | | dict SweepGoodDrop; //扫荡珍稀符印
|
| | | };
|
| | |
|
| | | //地图表格
|
| | |
|
| | | struct tagChinMap
|
| | | {
|
| | | DWORD _MapID; //地图ID
|
| | | BYTE CanRide; //可否骑乘
|
| | | BYTE CanOutPet; //可否召唤宠物
|
| | | };
|
| | |
|
| | | //副本总表
|
| | |
|
| | | struct tagFBFunc
|
| | |
| | | ("dict", "SweepGoodDrop", 0),
|
| | | ),
|
| | |
|
| | | "ChinMap":(
|
| | | ("DWORD", "MapID", 1),
|
| | | ("BYTE", "CanRide", 0),
|
| | | ("BYTE", "CanOutPet", 0),
|
| | | ),
|
| | |
|
| | | "FBFunc":(
|
| | | ("DWORD", "DataMapID", 1),
|
| | | ("BYTE", "DayTimes", 0),
|
| | |
| | | def GetSweepRunePoint(self): return self.SweepRunePoint # 扫荡符印精华
|
| | | def GetSweepYsog(self): return self.SweepYsog # 扫荡魔精
|
| | | def GetSweepGoodDrop(self): return self.SweepGoodDrop # 扫荡珍稀符印 |
| | | |
| | | # 地图表格 |
| | | class IPY_ChinMap(): |
| | | |
| | | def __init__(self): |
| | | self.MapID = 0
|
| | | self.CanRide = 0
|
| | | self.CanOutPet = 0 |
| | | return |
| | | |
| | | def GetMapID(self): return self.MapID # 地图ID
|
| | | def GetCanRide(self): return self.CanRide # 可否骑乘
|
| | | def GetCanOutPet(self): return self.CanOutPet # 可否召唤宠物 |
| | | |
| | | # 副本总表 |
| | | class IPY_FBFunc(): |
| | |
| | | self.ipyNPCDropItemLen = len(self.ipyNPCDropItemCache)
|
| | | self.ipyRuneTowerCache = self.__LoadFileData("RuneTower", IPY_RuneTower)
|
| | | self.ipyRuneTowerLen = len(self.ipyRuneTowerCache)
|
| | | self.ipyChinMapCache = self.__LoadFileData("ChinMap", IPY_ChinMap)
|
| | | self.ipyChinMapLen = len(self.ipyChinMapCache)
|
| | | self.ipyFBFuncCache = self.__LoadFileData("FBFunc", IPY_FBFunc)
|
| | | self.ipyFBFuncLen = len(self.ipyFBFuncCache)
|
| | | self.ipyFBLineCache = self.__LoadFileData("FBLine", IPY_FBLine)
|
| | |
| | | def GetNPCDropItemByIndex(self, index): return self.ipyNPCDropItemCache[index]
|
| | | def GetRuneTowerCount(self): return self.ipyRuneTowerLen
|
| | | def GetRuneTowerByIndex(self, index): return self.ipyRuneTowerCache[index]
|
| | | def GetChinMapCount(self): return self.ipyChinMapLen
|
| | | def GetChinMapByIndex(self, index): return self.ipyChinMapCache[index]
|
| | | def GetFBFuncCount(self): return self.ipyFBFuncLen
|
| | | def GetFBFuncByIndex(self, index): return self.ipyFBFuncCache[index]
|
| | | def GetFBLineCount(self): return self.ipyFBLineLen
|
| | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | PlayerFB.DoExitCustomScene(curPlayer)
|
| | |
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | | |
| | | msgInfo = ""
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetPlayerID(), 0, 0, "RefreshMainServerRole", msgInfo, len(msgInfo))
|
| | | return
|
| | |
| | | import BaseAttack
|
| | | import PassiveBuffEffMng
|
| | | import ChNetSendPack
|
| | | import IpyGameDataPY
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | DefPetRebornHPRate = 100 # 宠物死亡复活血量百分比
|
| | |
| | | # @return BOOL 是否可出战
|
| | | # @remarks 检查当前指定宠物是否可出战
|
| | | def CheckPetCanFight(curPlayer, curPetObj):
|
| | | if not GameWorld.GetMap().GetMapCanOutPet():
|
| | | if not GetMapCanOutPet(curPlayer):
|
| | | #Pet_liubo_314885 此地图禁止宠物
|
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
|
| | | return False
|
| | |
| | | if not rolePet.GetIsBattle():
|
| | | return
|
| | |
|
| | | if not GameWorld.GetMap().GetMapCanOutPet():
|
| | | if not GetMapCanOutPet(curPlayer):
|
| | | #此地图禁止宠物
|
| | | return
|
| | | #召唤宠物出战
|
| | |
| | | # @remarks
|
| | | def DoLogic_PetLoadMapOK(curPlayer):
|
| | |
|
| | | if GameWorld.GetMap().GetMapCanOutPet():
|
| | | if GetMapCanOutPet(curPlayer):
|
| | | #此地图宠物可以上
|
| | | PlayerPet.AutoSummonPet(curPlayer)
|
| | | return
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_314885")
|
| | | return
|
| | |
|
| | | def GetMapCanOutPet(curPlayer):
|
| | | ## 检查本地图可否出战宠物,支持前端自定义场景
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | canOutPet = True if ipyMapData and ipyMapData.GetCanOutPet() else False
|
| | | else:
|
| | | canOutPet = GameWorld.GetMap().GetMapCanOutPet()
|
| | | return canOutPet
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 刷新宠物信息并通知客户端
|
| | | # @param rolePet 宠物实例
|
| | |
| | | import FBHelpBattle
|
| | | import SkillShell
|
| | | import PyGameData
|
| | | import PetControl
|
| | | import NPCCommon
|
| | |
|
| | | import time
|
| | |
| | | PlayerControl.SetCustomMap(curPlayer, mapID, lineID)
|
| | | GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if mapID:
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | |
|
| | | #通知进入状态
|
| | |
| | | if not curPlayer.GetInitOK():
|
| | | return False
|
| | |
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | if not ipyMapData or not ipyMapData.GetCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return False
|
| | | else:
|
| | | #地图不允许骑马 RideLimit_lhs_0
|
| | | if not GameWorld.GetMap().GetMapCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|