| | |
| | | def GetBFStepTime(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFB", 1) # 阶段时间
|
| | | def GetCrystalNPCIDList(): # 水晶资源NPCID列表
|
| | | crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
|
| | | return crystalNPCIDPosDict.keys()
|
| | | return [int(npcID) for npcID in crystalNPCIDPosDict.keys()]
|
| | | def GetGuardNPCIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldGuard", 1) # 守卫NPCID列表
|
| | | def GetPersonBuffIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldPersonBuff", 1) # 个人buffID列表
|
| | | def GetFactionBuffIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFactionBuff", 1) # 阵营buffID列表
|
| | |
| | | # 刷水晶
|
| | | crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
|
| | | for npcID, posInfo in crystalNPCIDPosDict.items():
|
| | | NPCCommon.SummonMapNpc(npcID, posInfo[0], posInfo[1])
|
| | | NPCCommon.SummonMapNpc(int(npcID), posInfo[0], posInfo[1])
|
| | |
|
| | | # 刷守卫
|
| | | rebornGurad()
|
| | |
| | | allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
|
| | |
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
|
| | | PlayerControl.FBNotify("CrossBattlefieldStartFighting")
|
| | | return
|
| | |
|
| | | def allotPlayerFaction(playerID, fightPower, curPlayer, allotStep, tick):
|
| | |
| | |
|
| | | if curPlayer:
|
| | | curPlayer.SetFaction(faction)
|
| | | if isAllot:
|
| | | __RandFactionRebornArea(curPlayer)
|
| | | #if isAllot:
|
| | | __RandFactionRebornArea(curPlayer, False)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | __RandFactionRebornArea(curPlayer)
|
| | | return
|
| | |
|
| | | def __RandFactionRebornArea(curPlayer):
|
| | | def __RandFactionRebornArea(curPlayer, includeCrystal=True):
|
| | | ## 随机阵营复活点: 营地 + 已占领的资源点 随机
|
| | | faction = curPlayer.GetFaction()
|
| | | posInfo = getRandFactionRebornPos(faction)
|
| | | posInfo = getRandFactionRebornPos(faction, includeCrystal)
|
| | | if posInfo:
|
| | | posX, posY = posInfo
|
| | | else:
|
| | |
| | | curPlayer.ResetPos(posX, posY)
|
| | | return
|
| | |
|
| | | def getRandFactionRebornPos(faction):
|
| | | def getRandFactionRebornPos(faction, includeCrystal=True):
|
| | | rebornPosList = []
|
| | | factionSafeAreaRandPosList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFB", 3)
|
| | | if faction and faction <= len(factionSafeAreaRandPosList):
|
| | | safePosX, safePosY, _ = factionSafeAreaRandPosList[faction - 1]
|
| | | rebornPosList.append([safePosX, safePosY, 3])
|
| | |
|
| | | # 包含占领的水晶
|
| | | if includeCrystal:
|
| | | crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
|
| | | worldObj = GetBattleWorld()
|
| | | for npcID, ownerFaction in worldObj.crystalFactionInfo.items():
|
| | | if ownerFaction != faction:
|
| | | continue
|
| | | if npcID not in crystalNPCIDPosDict:
|
| | | if str(npcID) not in crystalNPCIDPosDict:
|
| | | continue
|
| | | posInfo = crystalNPCIDPosDict[npcID]
|
| | | posInfo = crystalNPCIDPosDict[str(npcID)]
|
| | | rebornPosList.append([posInfo[0], posInfo[1], 3])
|
| | |
|
| | | if not rebornPosList:
|