def __addArenaExtraData(self, arenaDP): arena = getClientArena() if arena: extraData = arena.extraData or {} descExtra = getPrebattleFullDescription(extraData) arenaTypeID = getArenaTypeID() arenaSubType = getArenaSubTypeName(arenaTypeID) team = arenaDP.getNumberOfTeam() enemy = arenaDP.getNumberOfTeam(True) hasBase = isBaseExists(arenaTypeID, team) opponents = extraData.get('opponents', {}) team1 = opponents.get(str(team), {}).get('name', '#menu:loading/team1') team2 = opponents.get(str(enemy), {}).get('name', '#menu:loading/team2') self.as_setTeamsS(team1, team2) if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES: self.as_setWinTextS(i18n.makeString('#arenas:type/fallout/description')) else: self.as_setWinTextS(getBattleSubTypeWinText(arenaTypeID, 1 if hasBase else 2)) if descExtra: self.as_setBattleTypeNameS(descExtra) self.as_setBattleTypeFrameNumS(arena.guiType + 1) elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]: self.as_setBattleTypeNameS('#arenas:type/%s/name' % arenaSubType) self.as_setBattleTypeFrameNameS(getNecessaryArenaFrameName(arenaSubType, hasBase)) if arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and self.__logArenaUniID == False: self.__logArenaUniID = True from time import strftime, localtime from debug_utils import LOG_NOTE LOG_NOTE('arenaUniqueID: %d | timestamp: %s' % (arena.arenaUniqueID, strftime('%d.%m.%Y %H:%M:%S', localtime()))) else: self.as_setBattleTypeNameS('#menu:loading/battleTypes/%d' % arena.guiType) if arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS: self.as_setBattleTypeFrameNameS(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]) else: self.as_setBattleTypeFrameNumS(arena.guiType + 1)
def __populateData(self, isMutlipleTeams = False): arena = avatar_getter.getArena() arenaDP = g_sessionProvider.getArenaDP() arenaData = ['', 0, '', '', ''] if arena: arenaData = [toUpper(arena.arenaType.name)] descExtra = getPrebattleFullDescription(arena.extraData or {}) arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID) if descExtra: arenaData.extend([arena.guiType + 1, descExtra]) elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]: arenaTypeName = '#arenas:type/%s/name' % arenaSubType arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName]) elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE: arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]) if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints(): arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER)) elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams: arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER)) else: arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType) else: arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType]) myTeamNumber = arenaDP.getNumberOfTeam() getTeamName = g_sessionProvider.getCtx().getTeamName arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))]) teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2 if not isEventBattle(): typeEvent = 'normal' winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase) else: typeEvent = 'fallout' if getIsMultiteam(): winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION) else: winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType) arenaData.append(winText) arenaData.append(typeEvent) vehInfo = arenaDP.getVehicleInfo(arenaDP.getPlayerVehicleID()) pqTipData = [None] * 3 pQuests = vehInfo.player.getPotapovQuests() serverSettings = g_lobbyContext.getServerSettings() isPQEnabled = serverSettings is not None and serverSettings.isPotapovQuestEnabled() if isPQEnabled and (arena.guiType == constants.ARENA_GUI_TYPE.RANDOM or arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and constants.IS_DEVELOPMENT): if len(pQuests): quest = pQuests[0] pqTipData = [quest.getUserName(), quest.getUserMainCondition(), quest.getUserAddCondition()] else: pqTipData = [i18n.makeString('#ingame_gui:potapovQuests/tip'), None, None] arenaData.extend(pqTipData) arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)]) self.__callEx('arenaData', arenaData) return
def _setWinCondition(self): from gui.battle_control import g_sessionProvider arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID) arenaDP = g_sessionProvider.getArenaDP() if self._preBattleTimerUI is not None: if not arena_info.isFalloutBattle(): winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, arenaDP.getNumberOfTeam()) elif arena_info.isFalloutMultiTeam(): winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION) else: winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType) self._preBattleTimerUI.setWinConditionText(winText) return
def new_addArenaExtraData(self, arenaDP): old_addArenaExtraData(self, arenaDP) if not Statistics.myConf['win_chance_enable'] or not Statistics.okCw(): return win_chance = Statistics.getWinChance() if win_chance: arenaTypeID = getArenaTypeID() colour = '#ff0000' if win_chance < 49: colour = '#ff0000' elif win_chance >= 49 and win_chance <= 51: colour = '#ffff00' elif win_chance > 51: colour = '#00ff00' formatz = {'win_chance':win_chance,'color':colour} text = Statistics.myConf['win_chance_text'].format(**formatz) self.as_setWinTextS(getBattleSubTypeWinText(arenaTypeID, 2) + text)
def __populateData(self, isMutlipleTeams = False): arena = avatar_getter.getArena() arenaDP = g_sessionProvider.getArenaDP() arenaData = ['', 0, '', '', ''] if arena: arenaData = [toUpper(arena.arenaType.name)] descExtra = getPrebattleFullDescription(arena.extraData or {}) arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID) if descExtra: arenaData.extend([arena.guiType + 1, descExtra]) elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]: arenaTypeName = '#arenas:type/%s/name' % arenaSubType arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName]) elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE: arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]) if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints(): arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER)) elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams: arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER)) else: arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType) else: arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType]) myTeamNumber = arenaDP.getNumberOfTeam() getTeamName = g_sessionProvider.getCtx().getTeamName arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))]) teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2 if not isEventBattle(): typeEvent = 'normal' winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase) else: typeEvent = 'fallout' if getIsMultiteam(): winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION) else: winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType) arenaData.append(winText) arenaData.append(typeEvent) arenaData.extend(_getQuestsTipData(arena, arenaDP)) arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)]) self.__callEx('arenaData', arenaData)
def _addArenaExtraData(self, arenaDP): arena = getClientArena() if arena: arenaType = arena.arenaType extraData = arena.extraData or {} descExtra = getPrebattleFullDescription(extraData) arenaTypeID = getArenaTypeID() arenaSubType = getArenaSubTypeName(arenaTypeID) team = arenaDP.getNumberOfTeam() enemy = arenaDP.getNumberOfTeam(True) hasBase = isBaseExists(arenaTypeID, team) allyTeamName, enemyTeamName = self._battleCtx.getTeamName(team), self._battleCtx.getTeamName(enemy) if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES: winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType) else: winText = getBattleSubTypeWinText(arenaTypeID, 1 if hasBase else 2) if descExtra: battleTypeLocaleStr = descExtra if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS: battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType] else: battleTypeFrameLabel = 'neutral' elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]: battleTypeLocaleStr = '#arenas:type/%s/name' % arenaSubType battleTypeFrameLabel = getNecessaryArenaFrameName(arenaSubType, hasBase) elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints(): battleTypeFrameLabel = 'resourcePoints' battleTypeLocaleStr = MENU.LOADING_BATTLETYPES_RESOURCEPOINTS else: battleTypeLocaleStr = '#menu:loading/battleTypes/%d' % arena.guiType if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS: battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType] else: battleTypeFrameLabel = 'neutral' arenaInfoData = {'mapName': arenaType.name, 'winText': winText, 'battleTypeLocaleStr': battleTypeLocaleStr, 'battleTypeFrameLabel': battleTypeFrameLabel, 'allyTeamName': allyTeamName, 'enemyTeamName': enemyTeamName} self._setArenaInfo(arenaInfoData)
def getWinString(self, isInBattle = True): return functions.getBattleSubTypeWinText(self._visitor.type.getID(), 1 if self.isBaseExists() else 2)
def getWinString(self, isInBattle = True): return functions.getBattleSubTypeWinText(self._arena.arenaType.id, 1 if self.isBaseExists() else 2)
def getWinString(self, isInBattle=True): return functions.getBattleSubTypeWinText(self._visitor.type.getID(), self._team)