本文整理汇总了Python中toontown.hood.ZoneUtil.isWelcomeValley方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.isWelcomeValley方法的具体用法?Python ZoneUtil.isWelcomeValley怎么用?Python ZoneUtil.isWelcomeValley使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.isWelcomeValley方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateSavedBy
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def updateSavedBy(self, savedBy):
if self.savedBy:
for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId):
self.trophyMgr.removeTrophy(avId, self.numFloors)
self.savedBy = savedBy
if self.savedBy:
for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId):
self.trophyMgr.addTrophy(avId, name, self.numFloors)
示例2: __showData
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def __showData(self):
av = self.avatar
online = 1
if base.cr.isFriend(self.avId):
online = base.cr.isFriendOnline(self.avId)
if online:
shardName = base.cr.getShardName(av.defaultShard)
hoodName = base.cr.hoodMgr.getFullnameFromId(av.lastHood)
if ZoneUtil.isWelcomeValley(av.lastHood):
shardName = '%s (%s)' % (TTLocalizer.WelcomeValley[-1], shardName)
if self.playerInfo:
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
self.gotoAvatarButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.1, text=TTLocalizer.AvatarShowPlayer, text_scale=0.07, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.44, 0, 0.41), command=self.__showAvatar)
text = TTLocalizer.AvatarDetailPanelOnlinePlayer % {'district': shardName,
'location': hoodName,
'player': self.playerInfo.playerName}
else:
text = TTLocalizer.AvatarDetailPanelOnline % {'district': shardName,
'location': hoodName}
else:
text = TTLocalizer.AvatarDetailPanelOffline % {'last_seen': TTLocalizer.getLastSeenString(self.avatar.getLastSeen())}
self.dataText['text'] = text
self.__updateTrackInfo()
self.__updateTrophyInfo()
self.__updateLaffInfo()
return
示例3: getCurrentShardId
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def getCurrentShardId(self):
zoneId = self.getCurrentZoneId()
if zoneId != None and ZoneUtil.isWelcomeValley(zoneId):
return ToontownGlobals.WelcomeValleyToken
else:
return base.localAvatar.defaultShard
示例4: __init__
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def __init__(self, air, zoneId):
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
SuitPlannerBase.SuitPlannerBase.__init__(self)
self.air = air
self.zoneId = zoneId
self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
if simbase.air.wantCogdominiums:
if not hasattr(self.__class__, 'CogdoPopAdjusted'):
self.__class__.CogdoPopAdjusted = True
for index in xrange(len(self.SuitHoodInfo)):
SuitBuildingGlobals[self.zoneId][0] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][0])
SuitBuildingGlobals[self.zoneId][1] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][1])
self.hoodInfoIdx = -1
for index in xrange(len(self.SuitHoodInfo)):
currHoodInfo = self.SuitHoodInfo[index]
if currHoodInfo[self.SUIT_HOOD_INFO_ZONE] == self.canonicalZoneId:
self.hoodInfoIdx = index
self.currDesired = None
self.baseNumSuits = (
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN] +
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]) / 2
self.targetNumSuitBuildings = SuitBuildingGlobals.buildingMinMax[self.zoneId][0]
if ZoneUtil.isWelcomeValley(self.zoneId):
self.targetNumSuitBuildings = 0
self.pendingBuildingTracks = []
self.pendingBuildingHeights = []
self.suitList = []
self.numFlyInSuits = 0
self.numBuildingSuits = 0
self.numAttemptingTakeover = 0
self.zoneInfo = {}
self.zoneIdToPointMap = None
self.cogHQDoors = []
self.battleList = []
self.battleMgr = BattleManagerAI.BattleManagerAI(self.air)
self.setupDNA()
if self.notify.getDebug():
self.notify.debug('Creating a building manager AI in zone' + str(self.zoneId))
self.buildingMgr = self.air.buildingManagers.get(self.zoneId)
if self.buildingMgr:
(blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, animBldgBlocks) = self.buildingMgr.getDNABlockLists()
for currBlock in blocks:
bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self)
for currBlock in animBldgBlocks:
bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self)
self.dnaStore.resetBlockNumbers()
self.initBuildingsAndPoints()
numSuits = simbase.config.GetInt('suit-count', -1)
if numSuits >= 0:
self.currDesired = numSuits
suitHood = simbase.config.GetInt('suits-only-in-hood', -1)
if suitHood >= 0:
if self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_ZONE] != suitHood:
self.currDesired = 0
self.suitCountAdjust = 0
示例5: countNumNeededBuildings
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def countNumNeededBuildings(self):
if not self.buildingMgr:
return False
numSuitBuildings = len(self.buildingMgr.getSuitBlocks())
if int(random.random() * 100) < self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_BWEIGHT]:
bmax = SuitBuildingGlobals.buildingMinMax[self.zoneId][1]
if ZoneUtil.isWelcomeValley(self.zoneId):
bmax = 0
numNeeded = bmax - numSuitBuildings
else:
numNeeded = self.targetNumSuitBuildings - numSuitBuildings
return numNeeded
示例6: countNumNeededBuildings
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def countNumNeededBuildings(self):
if not self.buildingMgr:
return False
numSuitBuildings = len(self.buildingMgr.getSuitBlocks())
if (random.random() * 100) < SuitBuildingGlobals.buildingChance[self.zoneId]:
bmax = SuitBuildingGlobals.buildingMinMax[self.zoneId][1]
if ZoneUtil.isWelcomeValley(self.zoneId):
bmax = 0
numNeeded = bmax - numSuitBuildings
else:
numNeeded = self.targetNumSuitBuildings - numSuitBuildings
return numNeeded
示例7: newAnimBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def newAnimBuilding(self, blockNumber, blockData = None):
return
building = DistributedAnimBuildingAI.DistributedAnimBuildingAI(self.air, blockNumber, self.branchID, self.trophyMgr)
building.generateWithRequired(self.branchID)
if blockData:
building.track = blockData.get('track', 'c')
building.difficulty = int(blockData.get('difficulty', 1))
building.numFloors = int(blockData.get('numFloors', 1))
if not ZoneUtil.isWelcomeValley(building.zoneId):
building.updateSavedBy(blockData.get('savedBy'))
else:
self.notify.warning('we had a cog building in welcome valley %d' % building.zoneId)
building.becameSuitTime = blockData.get('becameSuitTime', time.time())
if blockData['state'] == 'suit':
building.setState('suit')
else:
building.setState('toon')
else:
building.setState('toon')
self.__buildings[blockNumber] = building
return building
示例8: newAnimBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def newAnimBuilding(self, blockNumber, blockData=None):
return
building = DistributedAnimBuildingAI.DistributedAnimBuildingAI(
self.air, blockNumber, self.branchID, self.trophyMgr
)
building.generateWithRequired(self.branchID)
if blockData:
building.track = blockData.get("track", "c")
building.difficulty = int(blockData.get("difficulty", 1))
building.numFloors = int(blockData.get("numFloors", 1))
if not ZoneUtil.isWelcomeValley(building.zoneId):
building.updateSavedBy(blockData.get("savedBy"))
else:
self.notify.warning("we had a cog building in welcome valley %d" % building.zoneId)
building.becameSuitTime = blockData.get("becameSuitTime", time.time())
if blockData["state"] == "suit":
building.setState("suit")
else:
building.setState("toon")
else:
building.setState("toon")
self.__buildings[blockNumber] = building
return building
示例9: newBuilding
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def newBuilding(self, blockNumber, blockData = None):
building = DistributedBuildingAI.DistributedBuildingAI(self.air, blockNumber, self.branchID, self.trophyMgr)
if blockData:
building.difficulty = int(blockData.get('difficulty', 1))
_track = blockData.get('track', 'c')
if _track == "x":
_track = random.choice("cmls")
_realTrack = _track
if blockData['state'] == 'suit' and building.difficulty == 19:
_realTrack = "x"
building.track = _track
building.realTrack = blockData.get('track', 'c')
building.numFloors = int(blockData.get('numFloors', 1))
building.numFloors = max(0, min(5, building.numFloors))
if not ZoneUtil.isWelcomeValley(building.zoneId):
building.updateSavedBy(blockData.get('savedBy'))
else:
self.notify.warning('we had a cog building in welcome valley %d' % building.zoneId)
building.becameSuitTime = blockData.get('becameSuitTime', time.time())
building.generateWithRequired(self.branchID)
if blockData['state'] == 'suit':
building.setState('suit')
elif blockData['state'] == 'cogdo':
building.setState('cogdo')
else:
building.setState('toon')
else:
building.generateWithRequired(self.branchID)
building.setState('toon')
self.__buildings[blockNumber] = building
return building
示例10: __init__
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isWelcomeValley [as 别名]
def __init__(self, air, zoneId):
DistributedObjectAI.DistributedObjectAI.__init__(self, air)
SuitPlannerBase.SuitPlannerBase.__init__(self)
self.air = air
self.zoneId = zoneId
self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
if config.GetBool("want-cogdos", False):
if not hasattr(self.__class__, "CogdoPopAdjusted"):
self.__class__.CogdoPopAdjusted = True
for index in xrange(len(self.SuitHoodInfo)):
hoodInfo = self.SuitHoodInfo[index]
hoodInfo[self.SUIT_HOOD_INFO_BMIN] = int(
0.5 + self.CogdoPopFactor * hoodInfo[self.SUIT_HOOD_INFO_BMIN]
)
hoodInfo[self.SUIT_HOOD_INFO_BMAX] = int(
0.5 + self.CogdoPopFactor * hoodInfo[self.SUIT_HOOD_INFO_BMAX]
)
self.hoodInfoIdx = -1
for index in range(len(self.SuitHoodInfo)):
currHoodInfo = self.SuitHoodInfo[index]
if currHoodInfo[self.SUIT_HOOD_INFO_ZONE] == self.canonicalZoneId:
self.hoodInfoIdx = index
self.currDesired = None
self.baseNumSuits = (
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN]
+ self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]
) / 2
self.targetNumSuitBuildings = self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_BMIN]
if ZoneUtil.isWelcomeValley(self.zoneId):
self.targetNumSuitBuildings = 0
self.pendingBuildingTracks = []
self.pendingBuildingHeights = []
self.suitList = []
self.numFlyInSuits = 0
self.numBuildingSuits = 0
self.numAttemptingTakeover = 0
self.zoneInfo = {}
self.zoneIdToPointMap = None
self.cogHQDoors = []
self.battleList = []
self.battleMgr = BattleManagerAI.BattleManagerAI(self.air)
self.setupDNA()
if self.notify.getDebug():
self.notify.debug("Creating a building manager AI in zone" + str(self.zoneId))
self.buildingMgr = self.air.buildingManagers.get(self.zoneId)
if self.buildingMgr:
blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks, animBldgBlocks = (
self.buildingMgr.getDNABlockLists()
)
for currBlock in blocks:
bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self)
for currBlock in animBldgBlocks:
bldg = self.buildingMgr.getBuilding(currBlock)
bldg.setSuitPlannerExt(self)
self.initBuildingsAndPoints()
numSuits = config.GetInt("suit-count", -1)
if numSuits >= 0:
self.currDesired = numSuits
suitHood = config.GetInt("suits-only-in-hood", -1)
if suitHood >= 0:
if self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_ZONE] != suitHood:
self.currDesired = 0
self.suitCountAdjust = 0
self.air.suitPlanners[zoneId] = self
return