Holocausted Welcome Valley

This commit is contained in:
DenialMC 2015-04-07 16:24:15 +03:00
parent 63aa2e6446
commit ad91b21823
60 changed files with 100 additions and 333 deletions

View file

@ -442,7 +442,6 @@ dclass CallbackObject {
}; };
from direct.distributed import DistributedObjectGlobal from direct.distributed import DistributedObjectGlobal
from toontown.ai import WelcomeValleyManager/AI
from toontown.building import DistributedAnimatedProp/AI from toontown.building import DistributedAnimatedProp/AI
from toontown.toon import DistributedToon/AI/UD from toontown.toon import DistributedToon/AI/UD
from toontown.safezone import DistributedTrolley/AI from toontown.safezone import DistributedTrolley/AI
@ -845,12 +844,6 @@ dclass ToontownDistrictStats : DistributedObject {
setStats : setAvatarCount, setNewAvatarCount; setStats : setAvatarCount, setNewAvatarCount;
}; };
dclass WelcomeValleyManager : DistributedObject {
clientSetZone(uint32) airecv clsend;
requestZoneIdMessage(uint32, uint16) airecv clsend;
requestZoneIdResponse(uint32, uint16);
};
dclass DistributedAnimatedProp : DistributedObject { dclass DistributedAnimatedProp : DistributedObject {
setPropId(uint16) required broadcast ram; setPropId(uint16) required broadcast ram;
setAvatarInteract(uint32) required broadcast ram; setAvatarInteract(uint32) required broadcast ram;

View file

@ -6,7 +6,6 @@ class PotentialShard:
self.id = id self.id = id
self.name = None self.name = None
self.population = 0 self.population = 0
self.welcomeValleyPopulation = 0
self.active = 1 self.active = 1
self.available = 1 self.available = 1
return return

View file

@ -218,8 +218,7 @@ class ToontownAIRepository(ToontownInternalRepository):
self.send(datagram) self.send(datagram)
def lookupDNAFileName(self, zoneId): def lookupDNAFileName(self, zoneId):
zoneId = ZoneUtil.getCanonicalZoneId(zoneId) hoodId = ZoneUtil.getHoodId(zoneId)
hoodId = ZoneUtil.getCanonicalHoodId(zoneId)
hood = ToontownGlobals.dnaMap[hoodId] hood = ToontownGlobals.dnaMap[hoodId]
if hoodId == zoneId: if hoodId == zoneId:
zoneId = 'sz' zoneId = 'sz'

View file

@ -1,38 +0,0 @@
from pandac.PandaModules import *
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from direct.showbase import PythonUtil
class WelcomeValleyManager(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('WelcomeValleyManager')
neverDisable = 1
def __init__(self, cr):
DistributedObject.DistributedObject.__init__(self, cr)
def generate(self):
if base.cr.welcomeValleyManager != None:
base.cr.welcomeValleyManager.delete()
base.cr.welcomeValleyManager = self
DistributedObject.DistributedObject.generate(self)
return
def disable(self):
self.ignore(ToontownGlobals.SynchronizeHotkey)
base.cr.welcomeValleyManager = None
DistributedObject.DistributedObject.disable(self)
return
def delete(self):
self.ignore(ToontownGlobals.SynchronizeHotkey)
base.cr.welcomeValleyManager = None
DistributedObject.DistributedObject.delete(self)
return
def requestZoneId(self, origZoneId, callback):
context = self.getCallbackContext(callback)
self.sendUpdate('requestZoneIdMessage', [origZoneId, context])
def requestZoneIdResponse(self, zoneId, context):
self.doCallbackContext(context, [zoneId])

View file

@ -1,18 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class WelcomeValleyManagerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("WelcomeValleyManagerAI")
def clientSetZone(self, todo0):
pass
def toonSetZone(self, doId, newZoneId):
pass #TODO
def requestZoneIdMessage(self, todo0, todo1):
pass
def requestZoneIdResponse(self, todo0, todo1):
pass

View file

@ -104,8 +104,7 @@ class BattlePlace(Place.Place):
self.zoneId = newZoneId self.zoneId = newZoneId
def genDNAFileName(self, zoneId): def genDNAFileName(self, zoneId):
zoneId = ZoneUtil.getCanonicalZoneId(zoneId) hoodId = ZoneUtil.getHoodId(zoneId)
hoodId = ZoneUtil.getCanonicalHoodId(zoneId)
hood = ToontownGlobals.dnaMap[hoodId] hood = ToontownGlobals.dnaMap[hoodId]
phase = ToontownGlobals.streetPhaseMap[hoodId] phase = ToontownGlobals.streetPhaseMap[hoodId]
if hoodId == zoneId: if hoodId == zoneId:

View file

@ -832,7 +832,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
def __teleportToSafeZone(self, toon): def __teleportToSafeZone(self, toon):
self.notify.debug('teleportToSafeZone(%d)' % toon.doId) self.notify.debug('teleportToSafeZone(%d)' % toon.doId)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
if hoodId in base.localAvatar.hoodsVisited: if hoodId in base.localAvatar.hoodsVisited:
target_sz = ZoneUtil.getSafeZoneId(self.zoneId) target_sz = ZoneUtil.getSafeZoneId(self.zoneId)
else: else:

View file

@ -200,7 +200,7 @@ class DistributedBankInterior(DistributedObject):
self.vaultOpenSfx = loader.loadSfx('phase_4/audio/sfx/vault_door_open.ogg') self.vaultOpenSfx = loader.loadSfx('phase_4/audio/sfx/vault_door_open.ogg')
self.vaultCloseSfx = loader.loadSfx('phase_4/audio/sfx/vault_door_close.ogg') self.vaultCloseSfx = loader.loadSfx('phase_4/audio/sfx/vault_door_close.ogg')
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)

View file

@ -38,9 +38,7 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
localAvatar.boardingParty = self localAvatar.boardingParty = self
def announceGenerate(self): def announceGenerate(self):
canonicalZoneId = ZoneUtil.getCanonicalZoneId(self.zoneId) localAvatar.chatMgr.chatInputSpeedChat.addBoardingGroupMenu(self.zoneId)
self.notify.debug('canonicalZoneId = %s' % canonicalZoneId)
localAvatar.chatMgr.chatInputSpeedChat.addBoardingGroupMenu(canonicalZoneId)
if base.config.GetBool('want-singing', 0): if base.config.GetBool('want-singing', 0):
localAvatar.chatMgr.chatInputSpeedChat.addSingingGroupMenu() localAvatar.chatMgr.chatInputSpeedChat.addSingingGroupMenu()

View file

@ -438,7 +438,6 @@ class DistributedBuilding(DistributedObject.DistributedObject):
level = int(self.difficulty / 2) + 1 level = int(self.difficulty / 2) + 1
suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) + str(level)) suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) + str(level))
zoneId = dnaStore.getZoneFromBlockNumber(self.block) zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId] newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP) suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block) buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
@ -541,7 +540,6 @@ class DistributedBuilding(DistributedObject.DistributedObject):
if not suitNP: if not suitNP:
suitNP = loader.loadModel('phase_5/models/cogdominium/%s' % FO_DICT[chr(self.track)]) suitNP = loader.loadModel('phase_5/models/cogdominium/%s' % FO_DICT[chr(self.track)])
zoneId = dnaStore.getZoneFromBlockNumber(self.block) zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId] newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP) suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block) buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
@ -930,8 +928,7 @@ class DistributedBuilding(DistributedObject.DistributedObject):
def getVisZoneId(self): def getVisZoneId(self):
exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block) exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
visZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId) return exteriorZoneId
return visZoneId
def getInteractiveProp(self): def getInteractiveProp(self):
result = None result = None

View file

@ -30,7 +30,6 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
DistributedObjectAI.DistributedObjectAI.__init__(self, air) DistributedObjectAI.DistributedObjectAI.__init__(self, air)
self.block = blockNumber self.block = blockNumber
self.zoneId = zoneId self.zoneId = zoneId
self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
self.trophyMgr = trophyMgr self.trophyMgr = trophyMgr
self.victorResponses = None self.victorResponses = None
self.fsm = ClassicFSM.ClassicFSM( self.fsm = ClassicFSM.ClassicFSM(
@ -205,9 +204,8 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def getExteriorAndInteriorZoneId(self): def getExteriorAndInteriorZoneId(self):
blockNumber = self.block blockNumber = self.block
dnaStore = self.air.dnaStoreMap[self.canonicalZoneId] dnaStore = self.air.dnaStoreMap[self.zoneId]
zoneId = dnaStore.getZoneFromBlockNumber(blockNumber) zoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
interiorZoneId = (zoneId - (zoneId%100)) + 500 + blockNumber interiorZoneId = (zoneId - (zoneId%100)) + 500 + blockNumber
return (zoneId, interiorZoneId) return (zoneId, interiorZoneId)
@ -274,13 +272,11 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def updateSavedBy(self, savedBy): def updateSavedBy(self, savedBy):
if self.savedBy: if self.savedBy:
for (avId, name, dna) in self.savedBy: for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId): self.trophyMgr.removeTrophy(avId, self.numFloors)
self.trophyMgr.removeTrophy(avId, self.numFloors)
self.savedBy = savedBy self.savedBy = savedBy
if self.savedBy: if self.savedBy:
for (avId, name, dna) in self.savedBy: for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId): self.trophyMgr.addTrophy(avId, name, self.numFloors)
self.trophyMgr.addTrophy(avId, name, self.numFloors)
def enterWaitForVictors(self, victorList, savedBy): def enterWaitForVictors(self, victorList, savedBy):
activeToons = [] activeToons = []
@ -387,7 +383,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def enterToon(self): def enterToon(self):
self.d_setState('toon') self.d_setState('toon')
(exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId()
if simbase.config.GetBool('want-new-toonhall', 1) and ZoneUtil.getCanonicalZoneId(interiorZoneId) == ToonHall: if simbase.config.GetBool('want-new-toonhall', 1) and interiorZoneId == ToonHall:
self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI(self.block, self.air, interiorZoneId, self) self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI(self.block, self.air, interiorZoneId, self)
else: else:
self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI(self.block, self.air, interiorZoneId, self) self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI(self.block, self.air, interiorZoneId, self)

View file

@ -8,9 +8,6 @@ from toontown.building import KartShopBuildingAI
from toontown.building import PetshopBuildingAI from toontown.building import PetshopBuildingAI
from toontown.building import BankBuildingAI from toontown.building import BankBuildingAI
from toontown.building import LibraryBuildingAI from toontown.building import LibraryBuildingAI
from toontown.hood import ZoneUtil
# from toontown.building import DistributedAnimBuildingAI
class DistributedBuildingMgrAI: class DistributedBuildingMgrAI:
notify = directNotify.newCategory('DistributedBuildingMgrAI') notify = directNotify.newCategory('DistributedBuildingMgrAI')
@ -18,7 +15,6 @@ class DistributedBuildingMgrAI:
def __init__(self, air, branchId, dnaStore, trophyMgr): def __init__(self, air, branchId, dnaStore, trophyMgr):
self.air = air self.air = air
self.branchId = branchId self.branchId = branchId
self.canonicalBranchId = ZoneUtil.getCanonicalZoneId(self.branchId)
self.dnaStore = dnaStore self.dnaStore = dnaStore
self.trophyMgr = trophyMgr self.trophyMgr = trophyMgr
self.__buildings = {} self.__buildings = {}
@ -172,9 +168,8 @@ class DistributedBuildingMgrAI:
return self.newBuilding(blockNumber, backup=backup) return self.newBuilding(blockNumber, backup=backup)
def newHQBuilding(self, blockNumber): def newHQBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = HQBuildingAI.HQBuildingAI( building = HQBuildingAI.HQBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -182,9 +177,8 @@ class DistributedBuildingMgrAI:
return building return building
def newGagshopBuilding(self, blockNumber): def newGagshopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = GagshopBuildingAI.GagshopBuildingAI( building = GagshopBuildingAI.GagshopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -192,9 +186,8 @@ class DistributedBuildingMgrAI:
return building return building
def newPetshopBuilding(self, blockNumber): def newPetshopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = PetshopBuildingAI.PetshopBuildingAI( building = PetshopBuildingAI.PetshopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -202,9 +195,8 @@ class DistributedBuildingMgrAI:
return building return building
def newKartShopBuilding(self, blockNumber): def newKartShopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = KartShopBuildingAI.KartShopBuildingAI( building = KartShopBuildingAI.KartShopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -212,9 +204,8 @@ class DistributedBuildingMgrAI:
return building return building
def newBankBuilding(self, blockNumber): def newBankBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = BankBuildingAI.BankBuildingAI( building = BankBuildingAI.BankBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -222,9 +213,8 @@ class DistributedBuildingMgrAI:
return building return building
def newLibraryBuilding(self, blockNumber): def newLibraryBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId] dnaStore = self.air.dnaStoreMap[self.branchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber) exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = LibraryBuildingAI.LibraryBuildingAI( building = LibraryBuildingAI.LibraryBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber) self.air, exteriorZoneId, interiorZoneId, blockNumber)

View file

@ -507,7 +507,6 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
'zoneId': zoneId, 'zoneId': zoneId,
'shardId': None, 'shardId': None,
'avId': -1, 'avId': -1,
'allowRedirect': 0,
'doorDoId': self.otherDoId 'doorDoId': self.otherDoId
} }
return request return request

View file

@ -73,7 +73,7 @@ class DistributedGagshopInterior(DistributedObject.DistributedObject):
self.randomGenerator.seed(self.zoneId) self.randomGenerator.seed(self.zoneId)
self.interior = loader.loadModel('phase_4/models/modules/gagShop_interior') self.interior = loader.loadModel('phase_4/models/modules/gagShop_interior')
self.interior.reparentTo(render) self.interior.reparentTo(render)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)
door = self.chooseDoor() door = self.chooseDoor()

View file

@ -25,7 +25,7 @@ class DistributedLibraryInterior(DistributedObject):
door = self.cr.playGame.dnaStore.findNode('door_double_round_ur') door = self.cr.playGame.dnaStore.findNode('door_double_round_ur')
doorNodePath = door.copyTo(doorOrigin) doorNodePath = door.copyTo(doorOrigin)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
doorColor = ToonInteriorColors.colors[hoodId]['TI_door'][0] doorColor = ToonInteriorColors.colors[hoodId]['TI_door'][0]
setupDoor( setupDoor(
doorNodePath, self.interior, doorOrigin, self.cr.playGame.dnaStore, doorNodePath, self.interior, doorOrigin, self.cr.playGame.dnaStore,
@ -68,6 +68,6 @@ class DistributedLibraryInterior(DistributedObject):
_nodePath = nodePath _nodePath = nodePath
if name[8] == 'c': if name[8] == 'c':
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
colors = ToonInteriorColors.colors[hoodId] colors = ToonInteriorColors.colors[hoodId]
_nodePath.setColorScale(generator.choice(colors[category])) _nodePath.setColorScale(generator.choice(colors[category]))

View file

@ -81,7 +81,7 @@ class DistributedPetshopInterior(DistributedObject.DistributedObject):
self.fish.setPos(0, 6, -4) self.fish.setPos(0, 6, -4)
self.fish.setPlayRate(0.7, 'swim') self.fish.setPlayRate(0.7, 'swim')
self.fish.loop('swim') self.fish.loop('swim')
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)
door = self.chooseDoor() door = self.chooseDoor()

View file

@ -66,7 +66,7 @@ class DistributedToonHallInterior(DistributedToonInterior):
self.randomGenerator.seed(self.zoneId) self.randomGenerator.seed(self.zoneId)
interior = self.randomDNAItem('TI_hall', self.dnaStore.findNode) interior = self.randomDNAItem('TI_hall', self.dnaStore.findNode)
self.interior = interior.copyTo(render) self.interior = interior.copyTo(render)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)
doorModelName = 'door_double_round_ul' doorModelName = 'door_double_round_ul'

View file

@ -99,7 +99,7 @@ class DistributedToonInterior(DistributedObject.DistributedObject):
self.randomGenerator.seed(self.zoneId) self.randomGenerator.seed(self.zoneId)
interior = self.randomDNAItem('TI_room', self.dnaStore.findNode) interior = self.randomDNAItem('TI_room', self.dnaStore.findNode)
self.interior = interior.copyTo(render) self.interior = interior.copyTo(render)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)
doorModelName = 'door_double_round_ul' doorModelName = 'door_double_round_ul'

View file

@ -98,7 +98,7 @@ class DistributedTutorialInterior(DistributedObject.DistributedObject):
self.sky.setDepthWrite(0) self.sky.setDepthWrite(0)
self.sky.setBin('background', 100) self.sky.setBin('background', 100)
self.sky.find('**/Sky').reparentTo(self.sky, -1) self.sky.find('**/Sky').reparentTo(self.sky, -1)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) hoodId = ZoneUtil.getHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId] self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior) self.replaceRandomInModel(self.interior)
doorModelName = 'door_double_round_ul' doorModelName = 'door_double_round_ul'

View file

@ -75,7 +75,6 @@ class BossbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = [] visibles = []
for i in xrange(visGroup.getNumVisibles()): for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i))) visibles.append(int(visGroup.getVisible(i)))

View file

@ -69,7 +69,6 @@ class CashbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = [] visibles = []
for i in xrange(visGroup.getNumVisibles()): for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i))) visibles.append(int(visGroup.getVisible(i)))

View file

@ -28,7 +28,6 @@ class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
'zoneId': zoneId, 'zoneId': zoneId,
'shardId': None, 'shardId': None,
'avId': -1, 'avId': -1,
'allowRedirect': 0,
'doorDoId': self.otherDoId} 'doorDoId': self.otherDoId}
return request return request
@ -75,8 +74,7 @@ class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
def setZoneIdAndBlock(self, zoneId, block): def setZoneIdAndBlock(self, zoneId, block):
self.zoneId = zoneId self.zoneId = zoneId
self.block = block self.block = block
canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) if zoneId in (ToontownGlobals.BossbotHQ, ToontownGlobals.BossbotLobby):
if canonicalZoneId in (ToontownGlobals.BossbotHQ, ToontownGlobals.BossbotLobby):
self.doorX = 1.0 self.doorX = 1.0
def enterDoor(self): def enterDoor(self):

View file

@ -77,7 +77,6 @@ class FactoryExterior(BattlePlace.BattlePlace):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = [] visibles = []
for i in xrange(visGroup.getNumVisibles()): for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i))) visibles.append(int(visGroup.getVisible(i)))

View file

@ -27,7 +27,6 @@ class LawbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = [] visibles = []
for i in xrange(visGroup.getNumVisibles()): for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i))) visibles.append(int(visGroup.getVisible(i)))

View file

@ -23,7 +23,6 @@ class SellbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = [] visibles = []
for i in xrange(visGroup.getNumVisibles()): for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i))) visibles.append(int(visGroup.getVisible(i)))

View file

@ -237,7 +237,7 @@ class HoodMgr(DirectObject.DirectObject):
return p return p
def getPhaseFromHood(self, hoodId): def getPhaseFromHood(self, hoodId):
hoodId = ZoneUtil.getCanonicalHoodId(hoodId) hoodId = ZoneUtil.getHoodId(hoodId)
return ToontownGlobals.phaseMap[hoodId] return ToontownGlobals.phaseMap[hoodId]
def getPlaygroundCenterFromId(self, hoodId): def getPlaygroundCenterFromId(self, hoodId):
@ -263,7 +263,6 @@ class HoodMgr(DirectObject.DirectObject):
self.notify.error('No such hood id as: %s' % hoodId) self.notify.error('No such hood id as: %s' % hoodId)
def getFullnameFromId(self, hoodId): def getFullnameFromId(self, hoodId):
hoodId = ZoneUtil.getCanonicalZoneId(hoodId)
return ToontownGlobals.hoodNameMap[hoodId][-1] return ToontownGlobals.hoodNameMap[hoodId][-1]
def addLinkTunnelHooks(self, hoodPart, nodeList, currentZoneId): def addLinkTunnelHooks(self, hoodPart, nodeList, currentZoneId):
@ -278,8 +277,6 @@ class HoodMgr(DirectObject.DirectObject):
zoneStr = nameParts[2] zoneStr = nameParts[2]
hoodId = self.getIdFromName(hoodStr) hoodId = self.getIdFromName(hoodStr)
zoneId = int(zoneStr) zoneId = int(zoneStr)
hoodId = ZoneUtil.getTrueZoneId(hoodId, currentZoneId)
zoneId = ZoneUtil.getTrueZoneId(zoneId, currentZoneId)
linkSphere = linkTunnel.find('**/tunnel_trigger') linkSphere = linkTunnel.find('**/tunnel_trigger')
if linkSphere.isEmpty(): if linkSphere.isEmpty():
linkSphere = linkTunnel.find('**/tunnel_sphere') linkSphere = linkTunnel.find('**/tunnel_sphere')

View file

@ -224,20 +224,19 @@ class PlayGame(StateData.StateData):
def handleWaitForSetZoneResponse(self, requestStatus): def handleWaitForSetZoneResponse(self, requestStatus):
hoodId = requestStatus['hoodId'] hoodId = requestStatus['hoodId']
canonicalHoodId = ZoneUtil.getCanonicalZoneId(hoodId) toHoodPhrase = ToontownGlobals.hoodNameMap[hoodId][0]
toHoodPhrase = ToontownGlobals.hoodNameMap[canonicalHoodId][0] hoodName = ToontownGlobals.hoodNameMap[hoodId][-1]
hoodName = ToontownGlobals.hoodNameMap[canonicalHoodId][-1]
zoneId = requestStatus['zoneId'] zoneId = requestStatus['zoneId']
loaderName = requestStatus['loader'] loaderName = requestStatus['loader']
avId = requestStatus.get('avId', -1) avId = requestStatus.get('avId', -1)
ownerId = requestStatus.get('ownerId', avId) ownerId = requestStatus.get('ownerId', avId)
if base.config.GetBool('want-qa-regression', 0): if base.config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: NEIGHBORHOODS: Visit %s' % hoodName) self.notify.info('QA-REGRESSION: NEIGHBORHOODS: Visit %s' % hoodName)
count = ToontownGlobals.hoodCountMap[canonicalHoodId] count = ToontownGlobals.hoodCountMap[hoodId]
if loaderName == 'safeZoneLoader': if loaderName == 'safeZoneLoader':
count += ToontownGlobals.safeZoneCountMap[canonicalHoodId] count += ToontownGlobals.safeZoneCountMap[hoodId]
elif loaderName == 'townLoader': elif loaderName == 'townLoader':
count += ToontownGlobals.townCountMap[canonicalHoodId] count += ToontownGlobals.townCountMap[hoodId]
if not loader.inBulkBlock: if not loader.inBulkBlock:
if hoodId == ToontownGlobals.MyEstate: if hoodId == ToontownGlobals.MyEstate:
if avId == -1: if avId == -1:
@ -269,7 +268,7 @@ class PlayGame(StateData.StateData):
else: else:
if not hasattr(self, 'dnaStore'): if not hasattr(self, 'dnaStore'):
self.loadDnaStore() self.loadDnaStore()
hoodClass = self.getHoodClassByNumber(canonicalHoodId) hoodClass = self.getHoodClassByNumber(hoodId)
self.hood = hoodClass(self.fsm, self.hoodDoneEvent, self.dnaStore, hoodId) self.hood = hoodClass(self.fsm, self.hoodDoneEvent, self.dnaStore, hoodId)
self.hood.load() self.hood.load()
self.hood.loadLoader(requestStatus) self.hood.loadLoader(requestStatus)
@ -279,8 +278,7 @@ class PlayGame(StateData.StateData):
def handleLeftQuietZone(self): def handleLeftQuietZone(self):
status = self.quietZoneStateData.getRequestStatus() status = self.quietZoneStateData.getRequestStatus()
hoodId = ZoneUtil.getCanonicalZoneId(status['hoodId']) hoodState = self.getHoodStateByNumber(status['hoodId'])
hoodState = self.getHoodStateByNumber(hoodId)
self.fsm.request(hoodState, [status]) self.fsm.request(hoodState, [status])
def handleQuietZoneDone(self): def handleQuietZoneDone(self):

View file

@ -79,7 +79,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.bankManager = None self.bankManager = None
self.catalogManager = None self.catalogManager = None
self.tutorialManager = None self.tutorialManager = None
self.welcomeValleyManager = None
self.newsManager = None self.newsManager = None
self.streetSign = None self.streetSign = None
self.distributedDistrict = None self.distributedDistrict = None

View file

@ -124,7 +124,6 @@ class DistributedHouseDoor(DistributedDoor.DistributedDoor):
'zoneId': zoneId, 'zoneId': zoneId,
'shardId': None, 'shardId': None,
'avId': -1, 'avId': -1,
'allowRedirect': 0,
'doorDoId': self.otherDoId} 'doorDoId': self.otherDoId}
messenger.send('doorDoneEvent', [request]) messenger.send('doorDoneEvent', [request])
return return

View file

@ -62,7 +62,7 @@ class GSHoodAI(HoodAI.HoodAI):
racingPads.append(racingPad) racingPads.append(racingPad)
elif isinstance(dnaGroup, DNAVisGroup): elif isinstance(dnaGroup, DNAVisGroup):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId) zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()): for i in xrange(dnaGroup.getNumChildren()):
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaGroup.at(i), zoneId, area, padType=padType) (foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaGroup.at(i), zoneId, area, padType=padType)
racingPads.extend(foundRacingPads) racingPads.extend(foundRacingPads)
@ -98,11 +98,9 @@ class GSHoodAI(HoodAI.HoodAI):
viewingPadGroups = [] viewingPadGroups = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId) (foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaData, zoneId, zoneId, padType='racing_pad')
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaData, zoneId, area, padType='racing_pad') (foundViewingPads, foundViewingPadGroups) = self.findRacingPads(dnaData, zoneId, zoneId, padType='viewing_pad')
(foundViewingPads, foundViewingPadGroups) = self.findRacingPads(dnaData, zoneId, area, padType='viewing_pad')
self.racingPads.extend(foundRacingPads) self.racingPads.extend(foundRacingPads)
racingPadGroups.extend(foundRacingPadGroups) racingPadGroups.extend(foundRacingPadGroups)
self.viewingPads.extend(foundViewingPads) self.viewingPads.extend(foundViewingPads)

View file

@ -37,7 +37,7 @@ class GZHoodAI(HoodAI.HoodAI):
golfKart.generateWithRequired(zoneId) golfKart.generateWithRequired(zoneId)
golfKarts.append(golfKart) golfKarts.append(golfKart)
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone): elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId) zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()): for i in xrange(dnaGroup.getNumChildren()):
foundGolfKarts = self.findGolfKarts(dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone) foundGolfKarts = self.findGolfKarts(dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
golfKarts.extend(foundGolfKarts) golfKarts.extend(foundGolfKarts)
@ -47,10 +47,8 @@ class GZHoodAI(HoodAI.HoodAI):
self.golfKarts = [] self.golfKarts = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId) foundGolfKarts = self.findGolfKarts(dnaData, zoneId, zoneId, overrideDNAZone=True)
foundGolfKarts = self.findGolfKarts(dnaData, zoneId, area, overrideDNAZone=True)
self.golfKarts.extend(foundGolfKarts) self.golfKarts.extend(foundGolfKarts)
for golfKart in self.golfKarts: for golfKart in self.golfKarts:
golfKart.start() golfKart.start()

View file

@ -84,7 +84,7 @@ class GenericAnimatedProp(AnimatedProp.AnimatedProp):
try: try:
visId = int(splits[2]) visId = int(splits[2])
self.visId = visId self.visId = visId
self.hoodId = ZoneUtil.getCanonicalHoodId(visId) self.hoodId = ZoneUtil.getHoodId(visId)
self.notify.debug('calcHoodId %d from %s' % (self.hoodId, fullString)) self.notify.debug('calcHoodId %d from %s' % (self.hoodId, fullString))
except Exception, generic: except Exception, generic:
if 'Editor' not in fullString: if 'Editor' not in fullString:

View file

@ -44,7 +44,7 @@ class Hood(StateData.StateData):
def getHoodText(self, zoneId): def getHoodText(self, zoneId):
hoodText = base.cr.hoodMgr.getFullnameFromId(self.id) hoodText = base.cr.hoodMgr.getFullnameFromId(self.id)
if self.id != Tutorial: if self.id != Tutorial:
streetName = StreetNames.get(ZoneUtil.getCanonicalBranchZone(zoneId)) streetName = StreetNames.get(ZoneUtil.getBranchZone(zoneId))
if streetName: if streetName:
hoodText = hoodText + '\n' + streetName[-1] hoodText = hoodText + '\n' + streetName[-1]
return hoodText return hoodText
@ -168,8 +168,8 @@ class Hood(StateData.StateData):
elif loaderName == 'townLoader': elif loaderName == 'townLoader':
if not loader.inBulkBlock: if not loader.inBulkBlock:
zoneId = requestStatus['zoneId'] zoneId = requestStatus['zoneId']
toPhrase = StreetNames[ZoneUtil.getCanonicalBranchZone(zoneId)][0] toPhrase = StreetNames[ZoneUtil.getBranchZone(zoneId)][0]
streetName = StreetNames[ZoneUtil.getCanonicalBranchZone(zoneId)][-1] streetName = StreetNames[ZoneUtil.getBranchZone(zoneId)][-1]
loader.beginBulkLoad('hood', TTLocalizer.HeadingToStreet % {'to': toPhrase, loader.beginBulkLoad('hood', TTLocalizer.HeadingToStreet % {'to': toPhrase,
'street': streetName}, townCountMap[self.id], 1, TTLocalizer.TIP_STREET, zoneId) 'street': streetName}, townCountMap[self.id], 1, TTLocalizer.TIP_STREET, zoneId)
self.loadLoader(requestStatus) self.loadLoader(requestStatus)

View file

@ -92,7 +92,7 @@ class HoodAI:
fishingPonds.append(fishingPond) fishingPonds.append(fishingPond)
elif isinstance(dnaGroup, DNAVisGroup): elif isinstance(dnaGroup, DNAVisGroup):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId) zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()): for i in xrange(dnaGroup.getNumChildren()):
(foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaGroup.at(i), zoneId, area) (foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaGroup.at(i), zoneId, area)
fishingPonds.extend(foundFishingPonds) fishingPonds.extend(foundFishingPonds)
@ -120,10 +120,8 @@ class HoodAI:
fishingPondGroups = [] fishingPondGroups = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId) (foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaData, zoneId, zoneId)
(foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaData, zoneId, area)
self.fishingPonds.extend(foundFishingPonds) self.fishingPonds.extend(foundFishingPonds)
fishingPondGroups.extend(foundFishingPondGroups) fishingPondGroups.extend(foundFishingPondGroups)
for fishingPond in self.fishingPonds: for fishingPond in self.fishingPonds:
@ -149,7 +147,6 @@ class HoodAI:
self.partyGates = [] self.partyGates = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
foundPartyGates = self.findPartyGates(dnaData, zoneId) foundPartyGates = self.findPartyGates(dnaData, zoneId)
self.partyGates.extend(foundPartyGates) self.partyGates.extend(foundPartyGates)
@ -167,7 +164,6 @@ class HoodAI:
def createBuildingManagers(self): def createBuildingManagers(self):
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaStore = self.air.dnaStoreMap[zoneId] dnaStore = self.air.dnaStoreMap[zoneId]
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
buildingManager = DistributedBuildingMgrAI.DistributedBuildingMgrAI( buildingManager = DistributedBuildingMgrAI.DistributedBuildingMgrAI(
self.air, zoneId, dnaStore, self.air.trophyMgr) self.air, zoneId, dnaStore, self.air.trophyMgr)
self.buildingManagers.append(buildingManager) self.buildingManagers.append(buildingManager)
@ -177,7 +173,6 @@ class HoodAI:
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
if zoneId == self.zoneId: if zoneId == self.zoneId:
continue continue
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, zoneId) suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, zoneId)
suitPlanner.generateWithRequired(zoneId) suitPlanner.generateWithRequired(zoneId)
suitPlanner.d_setZoneId(zoneId) suitPlanner.d_setZoneId(zoneId)

View file

@ -46,7 +46,7 @@ class OZHoodAI(HoodAI.HoodAI):
picnicTable.generateWithRequired(zoneId) picnicTable.generateWithRequired(zoneId)
picnicTables.append(picnicTable) picnicTables.append(picnicTable)
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone): elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId) zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()): for i in xrange(dnaGroup.getNumChildren()):
foundPicnicTables = self.findPicnicTables( foundPicnicTables = self.findPicnicTables(
dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone) dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
@ -57,11 +57,9 @@ class OZHoodAI(HoodAI.HoodAI):
self.picnicTables = [] self.picnicTables = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundPicnicTables = self.findPicnicTables( foundPicnicTables = self.findPicnicTables(
dnaData, zoneId, area, overrideDNAZone=True) dnaData, zoneId, zoneId, overrideDNAZone=True)
self.picnicTables.extend(foundPicnicTables) self.picnicTables.extend(foundPicnicTables)
for picnicTable in self.picnicTables: for picnicTable in self.picnicTables:
picnicTable.start() picnicTable.start()
@ -78,7 +76,7 @@ class OZHoodAI(HoodAI.HoodAI):
gameTable.setPosHpr(pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2]) gameTable.setPosHpr(pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2])
gameTable.generateWithRequired(zoneId) gameTable.generateWithRequired(zoneId)
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone): elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId) zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()): for i in xrange(dnaGroup.getNumChildren()):
foundGameTables = self.findGameTables( foundGameTables = self.findGameTables(
dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone) dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
@ -89,9 +87,7 @@ class OZHoodAI(HoodAI.HoodAI):
self.gameTables = [] self.gameTables = []
for zoneId in self.getZoneTable(): for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None) dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root': if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundGameTables = self.findGameTables( foundGameTables = self.findGameTables(
dnaData, zoneId, area, overrideDNAZone=True) dnaData, zoneId, zoneId, overrideDNAZone=True)
self.gameTables.extend(foundGameTables) self.gameTables.extend(foundGameTables)

View file

@ -546,10 +546,9 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
zoneId = requestStatus['zoneId'] zoneId = requestStatus['zoneId']
how = requestStatus['how'] how = requestStatus['how']
tunnelOrigin = requestStatus['tunnelOrigin'] tunnelOrigin = requestStatus['tunnelOrigin']
fromZoneId = ZoneUtil.getCanonicalZoneId(self.getZoneId())
tunnelName = requestStatus.get('tunnelName') tunnelName = requestStatus.get('tunnelName')
if tunnelName == None: if tunnelName == None:
tunnelName = base.cr.hoodMgr.makeLinkTunnelName(self.loader.hood.id, fromZoneId) tunnelName = base.cr.hoodMgr.makeLinkTunnelName(self.loader.hood.id, self.getZoneId())
self.doneStatus = {'loader': ZoneUtil.getLoaderName(zoneId), self.doneStatus = {'loader': ZoneUtil.getLoaderName(zoneId),
'where': ZoneUtil.getToonWhereName(zoneId), 'where': ZoneUtil.getToonWhereName(zoneId),
'how': how, 'how': how,

View file

@ -211,29 +211,7 @@ class QuietZoneState(StateData.StateData):
base.cr.handlerArgs = self._requestStatus base.cr.handlerArgs = self._requestStatus
base.cr.setInQuietZone(True) base.cr.setInQuietZone(True)
self.waitForDatabase('WaitForZoneRedirect') self.waitForDatabase('WaitForZoneRedirect')
zoneId = self._requestStatus['zoneId'] self.gotZoneRedirect(self._requestStatus['zoneId'])
avId = self._requestStatus.get('avId', -1)
allowRedirect = self._requestStatus.get('allowRedirect', 1)
if avId != -1:
allowRedirect = 0
if not base.cr.welcomeValleyManager:
newZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
if newZoneId != zoneId:
self.gotZoneRedirect(newZoneId)
return
if allowRedirect and ZoneUtil.isWelcomeValley(zoneId):
self.notify.info('Requesting AI redirect from zone %s.' % zoneId)
if base.slowQuietZone:
def rZI(task, zoneId = zoneId, self = self):
base.cr.welcomeValleyManager.requestZoneId(zoneId, self.gotZoneRedirect)
return Task.done
taskMgr.doMethodLater(base.slowQuietZoneDelay, rZI, 'slowQuietZone-welcomeValleyRedirect')
else:
base.cr.welcomeValleyManager.requestZoneId(zoneId, self.gotZoneRedirect)
else:
self.fsm.request('waitForSetZoneResponse')
def gotZoneRedirect(self, zoneId): def gotZoneRedirect(self, zoneId):
self.notify.info('Redirecting to zone %s.' % zoneId) self.notify.info('Redirecting to zone %s.' % zoneId)

View file

@ -26,7 +26,7 @@ class TrialerForceAcknowledge:
if base.cr.isPaid(): if base.cr.isPaid():
letThrough() letThrough()
return return
if ZoneUtil.getCanonicalHoodId(destHood) in (ToontownGlobals.ToontownCentral, ToontownGlobals.MyEstate, ToontownGlobals.GoofySpeedway): if ZoneUtil.getHoodId(destHood) in (ToontownGlobals.ToontownCentral, ToontownGlobals.MyEstate, ToontownGlobals.GoofySpeedway):
letThrough() letThrough()
return return
else: else:

View file

@ -1,26 +1,20 @@
from toontown.toonbase.ToontownGlobals import * from toontown.toonbase.ToontownGlobals import *
zoneUtilNotify = directNotify.newCategory('ZoneUtil') zoneUtilNotify = directNotify.newCategory('ZoneUtil')
tutorialDict = None tutorialDict = None
def isGoofySpeedwayZone(zoneId): def isGoofySpeedwayZone(zoneId):
return zoneId == 8000 return zoneId == 8000
def isCogHQZone(zoneId): def isCogHQZone(zoneId):
return zoneId >= 10000 and zoneId < 15000 return zoneId >= 10000 and zoneId < 15000
def isMintInteriorZone(zoneId): def isMintInteriorZone(zoneId):
return zoneId in (CashbotMintIntA, CashbotMintIntB, CashbotMintIntC) return zoneId in (CashbotMintIntA, CashbotMintIntB, CashbotMintIntC)
def isDynamicZone(zoneId): def isDynamicZone(zoneId):
return zoneId >= DynamicZonesBegin and zoneId < DynamicZonesEnd return zoneId >= DynamicZonesBegin and zoneId < DynamicZonesEnd
def getStreetName(branchId): def getStreetName(branchId):
global tutorialDict global tutorialDict
if tutorialDict: if tutorialDict:
@ -28,7 +22,6 @@ def getStreetName(branchId):
else: else:
return StreetNames[branchId][-1] return StreetNames[branchId][-1]
def getLoaderName(zoneId): def getLoaderName(zoneId):
if tutorialDict: if tutorialDict:
if zoneId == ToontownCentral: if zoneId == ToontownCentral:
@ -47,21 +40,17 @@ def getLoaderName(zoneId):
loaderName = 'townLoader' loaderName = 'townLoader'
return loaderName return loaderName
def getBranchLoaderName(zoneId): def getBranchLoaderName(zoneId):
return getLoaderName(getBranchZone(zoneId)) return getLoaderName(getBranchZone(zoneId))
def getSuitWhereName(zoneId): def getSuitWhereName(zoneId):
where = getWhereName(zoneId, 0) where = getWhereName(zoneId, 0)
return where return where
def getToonWhereName(zoneId): def getToonWhereName(zoneId):
where = getWhereName(zoneId, 1) where = getWhereName(zoneId, 1)
return where return where
def isPlayground(zoneId): def isPlayground(zoneId):
whereName = getWhereName(zoneId, False) whereName = getWhereName(zoneId, False)
if whereName == 'cogHQExterior': if whereName == 'cogHQExterior':
@ -69,7 +58,6 @@ def isPlayground(zoneId):
else: else:
return zoneId % 1000 == 0 and zoneId < DynamicZonesBegin return zoneId % 1000 == 0 and zoneId < DynamicZonesBegin
def isHQ(zoneId): def isHQ(zoneId):
if zoneId == 2520 or zoneId == 1507 or zoneId == 3508 or zoneId == 4504 or zoneId == 5502 or zoneId == 7503 or zoneId == 9505: if zoneId == 2520 or zoneId == 1507 or zoneId == 3508 or zoneId == 4504 or zoneId == 5502 or zoneId == 7503 or zoneId == 9505:
return True return True
@ -80,14 +68,13 @@ def isPetshop(zoneId):
return True return True
return False return False
def getWhereName(zoneId, isToon): def getWhereName(zoneId, isToon):
if tutorialDict: if tutorialDict:
if zoneId in tutorialDict['interiors']: if zoneId in tutorialDict['interiors']:
where = 'toonInterior' where = 'toonInterior'
elif zoneId in tutorialDict['exteriors']: elif zoneId in tutorialDict['exteriors']:
where = 'street' where = 'street'
elif zoneId == ToontownCentral or zoneId == WelcomeValleyToken: elif zoneId == ToontownCentral:
where = 'playground' where = 'playground'
else: else:
zoneUtilNotify.error('No known zone: ' + str(zoneId)) zoneUtilNotify.error('No known zone: ' + str(zoneId))
@ -128,7 +115,6 @@ def getWhereName(zoneId, isToon):
where = 'street' where = 'street'
return where return where
def getBranchZone(zoneId): def getBranchZone(zoneId):
if tutorialDict: if tutorialDict:
branchId = tutorialDict['branch'] branchId = tutorialDict['branch']
@ -139,40 +125,6 @@ def getBranchZone(zoneId):
branchId -= 500 branchId -= 500
return branchId return branchId
def getCanonicalBranchZone(zoneId):
return getBranchZone(getCanonicalZoneId(zoneId))
def isWelcomeValley(zoneId):
return zoneId == WelcomeValleyToken or zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd
def getCanonicalZoneId(zoneId):
if zoneId == WelcomeValleyToken:
zoneId = ToontownCentral
elif zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd:
zoneId = zoneId % 2000
if zoneId < 1000:
zoneId = zoneId + ToontownCentral
else:
zoneId = zoneId - 1000 + GoofySpeedway
return zoneId
def getTrueZoneId(zoneId, currentZoneId):
if zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd or zoneId == WelcomeValleyToken:
zoneId = getCanonicalZoneId(zoneId)
if currentZoneId >= WelcomeValleyBegin and currentZoneId < WelcomeValleyEnd:
hoodId = getHoodId(zoneId)
offset = currentZoneId - currentZoneId % 2000
if hoodId == ToontownCentral:
return zoneId - ToontownCentral + offset
elif hoodId == GoofySpeedway:
return zoneId - GoofySpeedway + offset + 1000
return zoneId
def getHoodId(zoneId): def getHoodId(zoneId):
if tutorialDict: if tutorialDict:
hoodId = Tutorial hoodId = Tutorial
@ -180,22 +132,12 @@ def getHoodId(zoneId):
hoodId = zoneId - zoneId % 1000 hoodId = zoneId - zoneId % 1000
return hoodId return hoodId
def getSafeZoneId(zoneId): def getSafeZoneId(zoneId):
hoodId = getHoodId(zoneId) hoodId = getHoodId(zoneId)
if hoodId in HQToSafezone: if hoodId in HQToSafezone:
hoodId = HQToSafezone[hoodId] hoodId = HQToSafezone[hoodId]
return hoodId return hoodId
def getCanonicalHoodId(zoneId):
return getHoodId(getCanonicalZoneId(zoneId))
def getCanonicalSafeZoneId(zoneId):
return getSafeZoneId(getCanonicalZoneId(zoneId))
def isInterior(zoneId): def isInterior(zoneId):
if tutorialDict: if tutorialDict:
if zoneId in tutorialDict['interiors']: if zoneId in tutorialDict['interiors']:
@ -206,7 +148,6 @@ def isInterior(zoneId):
r = zoneId % 1000 >= 500 r = zoneId % 1000 >= 500
return r return r
def overrideOn(branch, exteriorList, interiorList): def overrideOn(branch, exteriorList, interiorList):
global tutorialDict global tutorialDict
if tutorialDict: if tutorialDict:
@ -215,13 +156,11 @@ def overrideOn(branch, exteriorList, interiorList):
'exteriors': exteriorList, 'exteriors': exteriorList,
'interiors': interiorList} 'interiors': interiorList}
def overrideOff(): def overrideOff():
global tutorialDict global tutorialDict
tutorialDict = None tutorialDict = None
return return
def getWakeInfo(hoodId = None, zoneId = None): def getWakeInfo(hoodId = None, zoneId = None):
wakeWaterHeight = 0 wakeWaterHeight = 0
showWake = 0 showWake = 0
@ -230,14 +169,13 @@ def getWakeInfo(hoodId = None, zoneId = None):
hoodId = base.cr.playGame.getPlaceId() hoodId = base.cr.playGame.getPlaceId()
if zoneId is None: if zoneId is None:
zoneId = base.cr.playGame.getPlace().getZoneId() zoneId = base.cr.playGame.getPlace().getZoneId()
canonicalZoneId = getCanonicalZoneId(zoneId) if zoneId == DonaldsDock:
if canonicalZoneId == DonaldsDock:
wakeWaterHeight = DDWakeWaterHeight wakeWaterHeight = DDWakeWaterHeight
showWake = 1 showWake = 1
elif canonicalZoneId == ToontownCentral: elif zoneId == ToontownCentral:
wakeWaterHeight = TTWakeWaterHeight wakeWaterHeight = TTWakeWaterHeight
showWake = 1 showWake = 1
elif canonicalZoneId == OutdoorZone: elif zoneId == OutdoorZone:
wakeWaterHeight = OZWakeWaterHeight wakeWaterHeight = OZWakeWaterHeight
showWake = 1 showWake = 1
elif hoodId == MyEstate: elif hoodId == MyEstate:
@ -246,4 +184,4 @@ def getWakeInfo(hoodId = None, zoneId = None):
except AttributeError: except AttributeError:
pass pass
return (showWake, wakeWaterHeight) return (showWake, wakeWaterHeight)

View file

@ -27,7 +27,7 @@ def getDifficulty(trolleyZone):
def getSafezoneId(trolleyZone): def getSafezoneId(trolleyZone):
return ZoneUtil.getCanonicalHoodId(trolleyZone) return ZoneUtil.getHoodId(trolleyZone)
def getScoreMult(trolleyZone): def getScoreMult(trolleyZone):

View file

@ -53,7 +53,7 @@ class PetshopGUI(DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('PetshopGUI.NamePicker') notify = DirectNotifyGlobal.directNotify.newCategory('PetshopGUI.NamePicker')
def __init__(self, doneEvent, petSeed, gender): def __init__(self, doneEvent, petSeed, gender):
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId()) zoneId = ZoneUtil.getSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId) name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId)
self.gui = loader.loadModel('phase_4/models/gui/PetNamePanel') self.gui = loader.loadModel('phase_4/models/gui/PetNamePanel')
self.guiScale = 0.09 self.guiScale = 0.09
@ -201,7 +201,7 @@ class PetshopGUI(DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('PetshopGUI.AdoptPetDlg') notify = DirectNotifyGlobal.directNotify.newCategory('PetshopGUI.AdoptPetDlg')
def __init__(self, doneEvent, petSeed, petNameIndex): def __init__(self, doneEvent, petSeed, petNameIndex):
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId()) zoneId = ZoneUtil.getSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId) name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId)
name = TTLocalizer.getPetName(petNameIndex) name = TTLocalizer.getPetName(petNameIndex)
cost = PetUtil.getPetCostFromSeed(petSeed, zoneId) cost = PetUtil.getPetCostFromSeed(petSeed, zoneId)
@ -326,7 +326,7 @@ class PetshopGUI(DirectObject):
self.petCost = [] self.petCost = []
for i in range(self.numPets): for i in range(self.numPets):
random.seed(self.petSeeds[i]) random.seed(self.petSeeds[i])
zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId()) zoneId = ZoneUtil.getSafeZoneId(base.localAvatar.getZoneId())
name, dna, traitSeed = PetUtil.getPetInfoFromSeed(self.petSeeds[i], zoneId) name, dna, traitSeed = PetUtil.getPetInfoFromSeed(self.petSeeds[i], zoneId)
cost = PetUtil.getPetCostFromSeed(self.petSeeds[i], zoneId) cost = PetUtil.getPetCostFromSeed(self.petSeeds[i], zoneId)
traits = PetTraits.PetTraits(traitSeed, zoneId) traits = PetTraits.PetTraits(traitSeed, zoneId)

View file

@ -149,8 +149,8 @@ class QuestMap(DirectFrame):
continue continue
npcZoneId = NPCToons.getNPCZone(toNpcId) npcZoneId = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZoneId) hoodId = ZoneUtil.getHoodId(npcZoneId)
branchId = ZoneUtil.getCanonicalBranchZone(npcZoneId) branchId = ZoneUtil.getBranchZone(npcZoneId)
if (self.hoodId != hoodId) or (self.zoneId != branchId): if (self.hoodId != hoodId) or (self.zoneId != branchId):
continue continue
@ -189,8 +189,8 @@ class QuestMap(DirectFrame):
def updateMap(self): def updateMap(self):
if self.av: if self.av:
hoodId = ZoneUtil.getCanonicalHoodId(self.av.getLocation()[1]) hoodId = ZoneUtil.getHoodId(self.av.getLocation()[1])
zoneId = ZoneUtil.getCanonicalBranchZone(self.av.getLocation()[1]) zoneId = ZoneUtil.getBranchZone(self.av.getLocation()[1])
try: try:
mapsGeom = loader.loadModel('phase_4/models/questmap/%s_maps' % ToontownGlobals.dnaMap[hoodId]) mapsGeom = loader.loadModel('phase_4/models/questmap/%s_maps' % ToontownGlobals.dnaMap[hoodId])
except: except:

View file

@ -176,9 +176,9 @@ class QuestPoster(DirectFrame):
def teleportToShop(self, npcId): def teleportToShop(self, npcId):
npcZone = NPCToons.getNPCZone(npcId) npcZone = NPCToons.getNPCZone(npcId)
npcHood = ZoneUtil.getCanonicalHoodId(npcZone) npcHood = ZoneUtil.getHoodId(npcZone)
avZone = base.localAvatar.getZoneId() avZone = base.localAvatar.getZoneId()
avHood = ZoneUtil.getCanonicalHoodId(avZone) avHood = ZoneUtil.getHoodId(avZone)
avShard = base.localAvatar.defaultShard avShard = base.localAvatar.defaultShard
avPlace = base.cr.playGame.getPlace() avPlace = base.cr.playGame.getPlace()
hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505} hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505}
@ -263,7 +263,7 @@ class QuestPoster(DirectFrame):
self.chooseButton = DirectButton(parent=self.questFrame, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(0.7, 1, 1), text=TTLocalizer.QuestPageChoose, text_scale=0.06, text_pos=(0, -0.02), pos=(0.285, 0, 0.245), scale=0.65) self.chooseButton = DirectButton(parent=self.questFrame, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(0.7, 1, 1), text=TTLocalizer.QuestPageChoose, text_scale=0.06, text_pos=(0, -0.02), pos=(0.285, 0, 0.245), scale=0.65)
guiButton.removeNode() guiButton.removeNode()
npcZone = NPCToons.getNPCZone(toNpcId) npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone) hoodId = ZoneUtil.getHoodId(npcZone)
self.chooseButton['command'] = callback self.chooseButton['command'] = callback
self.chooseButton['extraArgs'] = [questId] self.chooseButton['extraArgs'] = [questId]
self.unbind(DGG.WITHIN) self.unbind(DGG.WITHIN)
@ -331,7 +331,7 @@ class QuestPoster(DirectFrame):
self.teleportButton.setPos(0.285, 0, -0.15) self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = NPCToons.getNPCName(toNpcId) toNpcName = NPCToons.getNPCName(toNpcId)
toNpcZone = NPCToons.getNPCZone(toNpcId) toNpcZone = NPCToons.getNPCZone(toNpcId)
toNpcHoodId = ZoneUtil.getCanonicalHoodId(toNpcZone) toNpcHoodId = ZoneUtil.getHoodId(toNpcZone)
toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId) toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId)
toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone) toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone) toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)

View file

@ -392,11 +392,11 @@ class LocationBasedQuest(Quest):
if loc is Anywhere: if loc is Anywhere:
return 1 return 1
if ZoneUtil.isPlayground(loc): if ZoneUtil.isPlayground(loc):
if loc == ZoneUtil.getCanonicalHoodId(zoneId): if loc == ZoneUtil.getHoodId(zoneId):
return 1 return 1
else: else:
return 0 return 0
elif loc == ZoneUtil.getCanonicalBranchZone(zoneId): elif loc == ZoneUtil.getBranchZone(zoneId):
return 1 return 1
elif loc == zoneId: elif loc == zoneId:
return 1 return 1
@ -3795,11 +3795,11 @@ def chooseQuestDialogTierNotDone():
def getNpcInfo(npcId): def getNpcInfo(npcId):
npcName = NPCToons.getNPCName(npcId) npcName = NPCToons.getNPCName(npcId)
npcZone = NPCToons.getNPCZone(npcId) npcZone = NPCToons.getNPCZone(npcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone) hoodId = ZoneUtil.getHoodId(npcZone)
hoodName = base.cr.hoodMgr.getFullnameFromId(hoodId) hoodName = base.cr.hoodMgr.getFullnameFromId(hoodId)
buildingArticle = NPCToons.getBuildingArticle(npcZone) buildingArticle = NPCToons.getBuildingArticle(npcZone)
buildingName = NPCToons.getBuildingTitle(npcZone) buildingName = NPCToons.getBuildingTitle(npcZone)
branchId = ZoneUtil.getCanonicalBranchZone(npcZone) branchId = ZoneUtil.getBranchZone(npcZone)
toStreet = ToontownGlobals.StreetNames[branchId][0] toStreet = ToontownGlobals.StreetNames[branchId][0]
streetName = ToontownGlobals.StreetNames[branchId][-1] streetName = ToontownGlobals.StreetNames[branchId][-1]
isInPlayground = ZoneUtil.isPlayground(branchId) isInPlayground = ZoneUtil.isPlayground(branchId)
@ -3819,9 +3819,9 @@ def getNpcLocationDialog(fromNpcId, toNpcId):
fromBranchId = None fromBranchId = None
if fromNpcId: if fromNpcId:
fromNpcZone = NPCToons.getNPCZone(fromNpcId) fromNpcZone = NPCToons.getNPCZone(fromNpcId)
fromBranchId = ZoneUtil.getCanonicalBranchZone(fromNpcZone) fromBranchId = ZoneUtil.getBranchZone(fromNpcZone)
toNpcZone = NPCToons.getNPCZone(toNpcId) toNpcZone = NPCToons.getNPCZone(toNpcId)
toBranchId = ZoneUtil.getCanonicalBranchZone(toNpcZone) toBranchId = ZoneUtil.getBranchZone(toNpcZone)
toNpcName, toHoodName, toBuildingArticle, toBuildingName, toStreetTo, toStreetName, isInPlayground = getNpcInfo(toNpcId) toNpcName, toHoodName, toBuildingArticle, toBuildingName, toStreetTo, toStreetName, isInPlayground = getNpcInfo(toNpcId)
if fromBranchId == toBranchId: if fromBranchId == toBranchId:
if isInPlayground: if isInPlayground:

View file

@ -180,8 +180,8 @@ class MapPage(ShtikerPage.ShtikerPage):
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtSomeonesHome % TTLocalizer.GetPossesive(avName) self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtSomeonesHome % TTLocalizer.GetPossesive(avName)
self.hoodLabel.show() self.hoodLabel.show()
elif zone: elif zone:
hoodName = ToontownGlobals.hoodNameMap.get(ZoneUtil.getCanonicalHoodId(zone), ('',))[-1] hoodName = ToontownGlobals.hoodNameMap.get(ZoneUtil.getHoodId(zone), ('',))[-1]
streetName = ToontownGlobals.StreetNames.get(ZoneUtil.getCanonicalBranchZone(zone), ('',))[-1] streetName = ToontownGlobals.StreetNames.get(ZoneUtil.getBranchZone(zone), ('',))[-1]
if hoodName: if hoodName:
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreHere % (hoodName, streetName) self.hoodLabel['text'] = TTLocalizer.MapPageYouAreHere % (hoodName, streetName)
self.hoodLabel.show() self.hoodLabel.show()

View file

@ -454,18 +454,9 @@ class ShardPage(ShtikerPage.ShtikerPage):
def getCurrentZoneId(self): def getCurrentZoneId(self):
try: try:
zoneId = base.cr.playGame.getPlace().getZoneId() return base.cr.playGame.getPlace().getZoneId()
except: except:
zoneId = None return None
return zoneId
def getCurrentShardId(self):
zoneId = self.getCurrentZoneId()
if zoneId != None and ZoneUtil.isWelcomeValley(zoneId):
return ToontownGlobals.WelcomeValleyToken
else:
return base.localAvatar.defaultShard
def createSuitHead(self, suitName): def createSuitHead(self, suitName):
suitDNA = SuitDNA.SuitDNA() suitDNA = SuitDNA.SuitDNA()
@ -580,7 +571,7 @@ class ShardPage(ShtikerPage.ShtikerPage):
def choseShard(self, shardId): def choseShard(self, shardId):
zoneId = self.getCurrentZoneId() zoneId = self.getCurrentZoneId()
canonicalHoodId = ZoneUtil.getCanonicalHoodId(base.localAvatar.lastHood) canonicalHoodId = ZoneUtil.getHoodId(base.localAvatar.lastHood)
currentShardId = self.getCurrentShardId() currentShardId = self.getCurrentShardId()
if self.currentGroupJoined: if self.currentGroupJoined:

View file

@ -216,7 +216,7 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
self.setPathPosition(0, self.pathStartTime) self.setPathPosition(0, self.pathStartTime)
self.pathState = 1 self.pathState = 1
self.currentLeg = 0 self.currentLeg = 0
self.zoneId = ZoneUtil.getTrueZoneId(self.legList.getZoneId(0), self.branchId) self.zoneId = self.legList.getZoneId(0)
self.legType = self.legList.getType(0) self.legType = self.legList.getType(0)
if self.notify.getDebug(): if self.notify.getDebug():
self.notify.debug('creating suit in zone %s' % self.zoneId) self.notify.debug('creating suit in zone %s' % self.zoneId)
@ -236,7 +236,6 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
self.currentLeg = nextLeg self.currentLeg = nextLeg
self.__beginLegType(self.legList.getType(nextLeg)) self.__beginLegType(self.legList.getType(nextLeg))
zoneId = self.legList.getZoneId(nextLeg) zoneId = self.legList.getZoneId(nextLeg)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.branchId)
if zoneId: if zoneId:
self.__enterZone(zoneId) self.__enterZone(zoneId)
self.notify.debug('Suit %s reached leg %s of %s in zone %s.' % (self.getDoId(), self.notify.debug('Suit %s reached leg %s of %s in zone %s.' % (self.getDoId(),
@ -252,7 +251,7 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
if self.pathState != 1: if self.pathState != 1:
return Task.done return Task.done
nextLeg += 1 nextLeg += 1
while nextLeg + 1 < numLegs and self.legList.getZoneId(nextLeg) == ZoneUtil.getCanonicalZoneId(self.zoneId) and self.legList.getType(nextLeg) == self.legType: while nextLeg + 1 < numLegs and self.legList.getZoneId(nextLeg) == self.zoneId and self.legList.getType(nextLeg) == self.legType:
nextLeg += 1 nextLeg += 1
if nextLeg < numLegs: if nextLeg < numLegs:

View file

@ -62,7 +62,6 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
SuitPlannerBase.SuitPlannerBase.__init__(self) SuitPlannerBase.SuitPlannerBase.__init__(self)
self.air = air self.air = air
self.zoneId = zoneId self.zoneId = zoneId
self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
if simbase.air.wantCogdominiums: if simbase.air.wantCogdominiums:
if not hasattr(self.__class__, 'CogdoPopAdjusted'): if not hasattr(self.__class__, 'CogdoPopAdjusted'):
self.__class__.CogdoPopAdjusted = True self.__class__.CogdoPopAdjusted = True
@ -72,15 +71,13 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
self.hoodInfoIdx = -1 self.hoodInfoIdx = -1
for index in xrange(len(self.SuitHoodInfo)): for index in xrange(len(self.SuitHoodInfo)):
currHoodInfo = self.SuitHoodInfo[index] currHoodInfo = self.SuitHoodInfo[index]
if currHoodInfo[self.SUIT_HOOD_INFO_ZONE] == self.canonicalZoneId: if currHoodInfo[self.SUIT_HOOD_INFO_ZONE] == self.zoneId:
self.hoodInfoIdx = index self.hoodInfoIdx = index
self.currDesired = None self.currDesired = None
self.baseNumSuits = ( self.baseNumSuits = (
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN] + self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN] +
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]) / 2 self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]) / 2
self.targetNumSuitBuildings = SuitBuildingGlobals.buildingMinMax[self.zoneId][0] self.targetNumSuitBuildings = SuitBuildingGlobals.buildingMinMax[self.zoneId][0]
if ZoneUtil.isWelcomeValley(self.zoneId):
self.targetNumSuitBuildings = 0
self.pendingBuildingTracks = [] self.pendingBuildingTracks = []
self.pendingBuildingHeights = [] self.pendingBuildingHeights = []
self.suitList = [] self.suitList = []
@ -360,13 +357,9 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
return False return False
numSuitBuildings = len(self.buildingMgr.getSuitBlocks()) numSuitBuildings = len(self.buildingMgr.getSuitBlocks())
if (random.random() * 100) < SuitBuildingGlobals.buildingChance[self.zoneId]: if (random.random() * 100) < SuitBuildingGlobals.buildingChance[self.zoneId]:
bmax = SuitBuildingGlobals.buildingMinMax[self.zoneId][1] return SuitBuildingGlobals.buildingMinMax[self.zoneId][1] - numSuitBuildings
if ZoneUtil.isWelcomeValley(self.zoneId):
bmax = 0
numNeeded = bmax - numSuitBuildings
else: else:
numNeeded = self.targetNumSuitBuildings - numSuitBuildings return self.targetNumSuitBuildings - numSuitBuildings
return numNeeded
def newSuitShouldAttemptTakeover(self): def newSuitShouldAttemptTakeover(self):
if not self.SUITS_ENTER_BUILDINGS: if not self.SUITS_ENTER_BUILDINGS:
@ -844,8 +837,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
def requestBattle(self, zoneId, suit, toonId): def requestBattle(self, zoneId, suit, toonId):
self.notify.debug('requestBattle() - zone: %s suit: %s toon: %s' % (zoneId, suit.doId, toonId)) self.notify.debug('requestBattle() - zone: %s suit: %s toon: %s' % (zoneId, suit.doId, toonId))
canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) if zoneId not in self.battlePosDict:
if canonicalZoneId not in self.battlePosDict:
return 0 return 0
toon = self.air.doId2do.get(toonId) toon = self.air.doId2do.get(toonId)
if toon.getBattleId() > 0: if toon.getBattleId() > 0:
@ -854,7 +846,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
if toon: if toon:
if hasattr(toon, 'doId'): if hasattr(toon, 'doId'):
toon.b_setBattleId(toonId) toon.b_setBattleId(toonId)
pos = self.battlePosDict[canonicalZoneId] pos = self.battlePosDict[zoneId]
interactivePropTrackBonus = -1 interactivePropTrackBonus = -1
self.battleMgr.newBattle( self.battleMgr.newBattle(
zoneId, zoneId, pos, suit, toonId, self.__battleFinished, zoneId, zoneId, pos, suit, toonId, self.__battleFinished,

View file

@ -514,8 +514,8 @@ class SuitPlannerBase:
self.initDNAInfo() self.initDNAInfo()
def genDNAFileName(self): def genDNAFileName(self):
zoneId = ZoneUtil.getCanonicalZoneId(self.getZoneId()) zoneId = self.getZoneId()
hoodId = ZoneUtil.getCanonicalHoodId(zoneId) hoodId = ZoneUtil.getHoodId(zoneId)
hood = ToontownGlobals.dnaMap[hoodId] hood = ToontownGlobals.dnaMap[hoodId]
phase = ToontownGlobals.streetPhaseMap[hoodId] phase = ToontownGlobals.streetPhaseMap[hoodId]
if hoodId == zoneId: if hoodId == zoneId:

View file

@ -27,7 +27,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI):
if self.isBusy(): if self.isBusy():
self.freeAvatar(avId) self.freeAvatar(avId)
return return
self.petSeeds = self.air.petMgr.getAvailablePets(3, ZoneUtil.getCanonicalHoodId(self.zoneId)) self.petSeeds = self.air.petMgr.getAvailablePets(3, ZoneUtil.getHoodId(self.zoneId))
numGenders = len(PetDNA.PetGenders) numGenders = len(PetDNA.PetGenders)
self.petSeeds *= numGenders self.petSeeds *= numGenders
self.petSeeds.sort() self.petSeeds.sort()
@ -92,7 +92,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI):
av = simbase.air.doId2do.get(avId) av = simbase.air.doId2do.get(avId)
if av: if av:
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
zoneId = ZoneUtil.getCanonicalSafeZoneId(self.zoneId) zoneId = ZoneUtil.getSafeZoneId(self.zoneId)
if petNum not in xrange(0, len(self.petSeeds)): if petNum not in xrange(0, len(self.petSeeds)):
self.air.writeServerEvent('suspicious', avId, 'DistributedNPCPetshopAI.petAdopted and no such pet!') self.air.writeServerEvent('suspicious', avId, 'DistributedNPCPetshopAI.petAdopted and no such pet!')
self.notify.warning('somebody called petAdopted on a non-existent pet! avId: %s' % avId) self.notify.warning('somebody called petAdopted on a non-existent pet! avId: %s' % avId)

View file

@ -424,7 +424,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.defaultZone = ToontownGlobals.ToontownCentral self.defaultZone = ToontownGlobals.ToontownCentral
return return
if ZoneUtil.getCanonicalHoodId(zoneId) == ToontownGlobals.FunnyFarm: if ZoneUtil.getHoodId(zoneId) == ToontownGlobals.FunnyFarm:
self.defaultZone = ToontownGlobals.ToontownCentral self.defaultZone = ToontownGlobals.ToontownCentral
return return
if not base.cr.isPaid() or launcher and not launcher.getPhaseComplete(hoodPhase): if not base.cr.isPaid() or launcher and not launcher.getPhaseComplete(hoodPhase):

View file

@ -3104,9 +3104,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.air.writeServerEvent('suspicious', self.doId, 'bogus cog summons') self.air.writeServerEvent('suspicious', self.doId, 'bogus cog summons')
self.sendUpdate('cogSummonsResponse', ['fail', suitIndex, 0]) self.sendUpdate('cogSummonsResponse', ['fail', suitIndex, 0])
return return
if ZoneUtil.isWelcomeValley(self.zoneId):
self.sendUpdate('cogSummonsResponse', ['fail', suitIndex, 0])
return
returnCode = None returnCode = None
if type == 'single': if type == 'single':
returnCode = self.doSummonSingleCog(suitIndex) returnCode = self.doSummonSingleCog(suitIndex)

View file

@ -97,7 +97,7 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
import DistributedSmartNPCAI import DistributedSmartNPCAI
import DistributedNPCBankerAI import DistributedNPCBankerAI
import DistributedNPCGloveAI import DistributedNPCGloveAI
canonicalZoneId, name, dnaType, gender, protected, type = desc zoneId, name, dnaType, gender, protected, type = desc
if type == NPC_REGULAR: if type == NPC_REGULAR:
npc = DistributedNPCToonAI.DistributedNPCToonAI(air, npcId, questCallback=questCallback) npc = DistributedNPCToonAI.DistributedNPCToonAI(air, npcId, questCallback=questCallback)
elif type == NPC_HQ: elif type == NPC_HQ:
@ -176,8 +176,7 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
def createNpcsInZone(air, zoneId): def createNpcsInZone(air, zoneId):
npcs = [] npcs = []
canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId) npcIdList = zone2NpcDict.get(zoneId, [])
npcIdList = zone2NpcDict.get(canonicalZoneId, [])
for npcId in npcIdList: for npcId in npcIdList:
while npcIdList.count(npcId) > 1: while npcIdList.count(npcId) > 1:
npcIdList.remove(npcId) npcIdList.remove(npcId)
@ -202,7 +201,7 @@ def createLocalNPC(npcId):
if npcId not in NPCToonDict: if npcId not in NPCToonDict:
return None return None
desc = NPCToonDict[npcId] desc = NPCToonDict[npcId]
canonicalZoneId, name, dnaType, gender, protected, type = desc zoneId, name, dnaType, gender, protected, type = desc
npc = Toon.Toon() npc = Toon.Toon()
npc.setName(name) npc.setName(name)
npc.setPickable(0) npc.setPickable(0)

View file

@ -166,8 +166,6 @@ class ToonAvatarDetailPanel(DirectFrame):
if online: if online:
shardName = base.cr.getShardName(av.defaultShard) shardName = base.cr.getShardName(av.defaultShard)
hoodName = base.cr.hoodMgr.getFullnameFromId(av.lastHood) hoodName = base.cr.hoodMgr.getFullnameFromId(av.lastHood)
if ZoneUtil.isWelcomeValley(av.lastHood):
shardName = '%s (%s)' % (TTLocalizer.WelcomeValley[-1], shardName)
if self.playerInfo: if self.playerInfo:
guiButton = loader.loadModel('phase_3/models/gui/quit_button') 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) 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)

View file

@ -245,7 +245,6 @@ class ToonTeleportPanel(DirectFrame):
shardName = 'unknown' shardName = 'unknown'
print 'enterTeleport: %r, %r, %r, %r, %r' % (shardId, shardName, hoodId, zoneId, self.avId) print 'enterTeleport: %r, %r, %r, %r, %r' % (shardId, shardName, hoodId, zoneId, self.avId)
hoodsVisited = base.localAvatar.hoodsVisited hoodsVisited = base.localAvatar.hoodsVisited
canonicalHoodId = ZoneUtil.getCanonicalZoneId(hoodId)
if hoodId == ToontownGlobals.MyEstate: if hoodId == ToontownGlobals.MyEstate:
teleportNotify.debug('enterTeleport: estate') teleportNotify.debug('enterTeleport: estate')
if shardId == base.localAvatar.defaultShard: if shardId == base.localAvatar.defaultShard:
@ -253,10 +252,10 @@ class ToonTeleportPanel(DirectFrame):
place = base.cr.playGame.getPlace() place = base.cr.playGame.getPlace()
place.requestTeleport(hoodId, zoneId, shardId, self.avId) place.requestTeleport(hoodId, zoneId, shardId, self.avId)
unloadTeleportPanel() unloadTeleportPanel()
elif canonicalHoodId not in hoodsVisited + ToontownGlobals.HoodsAlwaysVisited: elif hoodId not in hoodsVisited + ToontownGlobals.HoodsAlwaysVisited:
teleportNotify.debug('enterTeleport: unknownHood') teleportNotify.debug('enterTeleport: unknownHood')
self.fsm.request('unknownHood', [hoodId]) self.fsm.request('unknownHood', [hoodId])
elif canonicalHoodId not in base.cr.hoodMgr.getAvailableZones(): elif hoodId not in base.cr.hoodMgr.getAvailableZones():
print 'hoodId %d not ready' % hoodId print 'hoodId %d not ready' % hoodId
self.fsm.request('unavailableHood', [hoodId]) self.fsm.request('unavailableHood', [hoodId])
else: else:

View file

@ -132,7 +132,6 @@ CashbotHQ = ('to', 'in', 'Cashbot HQ')
LawbotHQ = ('to', 'in', 'Lawbot HQ') LawbotHQ = ('to', 'in', 'Lawbot HQ')
Tutorial = ('to the', 'in the', 'Toon-torial') Tutorial = ('to the', 'in the', 'Toon-torial')
MyEstate = ('to', 'in', 'your house') MyEstate = ('to', 'in', 'your house')
WelcomeValley = ('to', 'in', 'Welcome Valley')
GolfZone = ('to', 'in', lGolfZone) GolfZone = ('to', 'in', lGolfZone)
PartyHood = ('to the', 'in the', lPartyHood) PartyHood = ('to the', 'in the', lPartyHood)
Factory = 'Factory' Factory = 'Factory'
@ -3985,7 +3984,6 @@ QuestPosterDialogNo = 'Cancel'
ShardPageTitle = 'Districts' ShardPageTitle = 'Districts'
ShardPageHelpIntro = 'Each District is a copy of the Toontown world.' ShardPageHelpIntro = 'Each District is a copy of the Toontown world.'
ShardPageHelpWhere = ' You are currently in the "%s" District.' ShardPageHelpWhere = ' You are currently in the "%s" District.'
ShardPageHelpWelcomeValley = ' You are currently in the "Welcome Valley" District, within "%s".'
ShardPageHelpMove = ' To move to a new District, click on its name.' ShardPageHelpMove = ' To move to a new District, click on its name.'
ShardPagePopulationTotal = 'Total Toontown Population:\n%d' ShardPagePopulationTotal = 'Total Toontown Population:\n%d'
ShardPageScrollTitle = 'Name Population' ShardPageScrollTitle = 'Name Population'

View file

@ -20,7 +20,6 @@ def canAccess(avatarId, zoneId, function = ''):
def openToAll(zoneId, avatar): def openToAll(zoneId, avatar):
allowed = False allowed = False
canonicalZoneId = ZoneUtil.getCanonicalHoodId(zoneId)
allowedZones = [ToontownGlobals.ToontownCentral, allowedZones = [ToontownGlobals.ToontownCentral,
ToontownGlobals.MyEstate, ToontownGlobals.MyEstate,
ToontownGlobals.GoofySpeedway, ToontownGlobals.GoofySpeedway,
@ -33,11 +32,11 @@ def openToAll(zoneId, avatar):
for zone in simbase.air.estateMgr.getEstateZones(ownerId): for zone in simbase.air.estateMgr.getEstateZones(ownerId):
specialZones.append(zone) specialZones.append(zone)
if canonicalZoneId in allowedZones or avatar.isInEstate(): if zoneId in allowedZones or avatar.isInEstate():
allowed = True allowed = True
elif zoneId in specialZones: elif zoneId in specialZones:
allowed = True allowed = True
elif canonicalZoneId >= ToontownGlobals.DynamicZonesBegin and not avatar.getTutorialAck(): elif zoneId >= ToontownGlobals.DynamicZonesBegin and not avatar.getTutorialAck():
zoneDict = simbase.air.tutorialManager.playerDict.get(avatar.doId) zoneDict = simbase.air.tutorialManager.playerDict.get(avatar.doId)
if zoneDict: if zoneDict:
allowed = True allowed = True
@ -45,12 +44,11 @@ def openToAll(zoneId, avatar):
def canWearSuit(avatarId, zoneId): def canWearSuit(avatarId, zoneId):
canonicalZoneId = ZoneUtil.getCanonicalHoodId(zoneId)
allowedSuitZones = [ToontownGlobals.LawbotHQ, allowedSuitZones = [ToontownGlobals.LawbotHQ,
ToontownGlobals.CashbotHQ, ToontownGlobals.CashbotHQ,
ToontownGlobals.SellbotHQ, ToontownGlobals.SellbotHQ,
ToontownGlobals.BossbotHQ] ToontownGlobals.BossbotHQ]
if canonicalZoneId in allowedSuitZones: if zoneId in allowedSuitZones:
return True return True
elif zoneId >= ToontownGlobals.DynamicZonesBegin: elif zoneId >= ToontownGlobals.DynamicZonesBegin:
return True return True

View file

@ -180,7 +180,6 @@ HoodHierarchy = {ToontownCentral: (SillyStreet, LoopyLane, PunchlinePlace),
DaisyGardens: (ElmStreet, MapleStreet, OakStreet), DaisyGardens: (ElmStreet, MapleStreet, OakStreet),
DonaldsDreamland: (LullabyLane, PajamaPlace), DonaldsDreamland: (LullabyLane, PajamaPlace),
GoofySpeedway: ()} GoofySpeedway: ()}
WelcomeValleyToken = 0
BossbotHQ = 10000 BossbotHQ = 10000
BossbotLobby = 10100 BossbotLobby = 10100
BossbotCountryClubIntA = 10500 BossbotCountryClubIntA = 10500
@ -209,8 +208,6 @@ MyEstate = 16000
GolfZone = 17000 GolfZone = 17000
PartyHood = 18000 PartyHood = 18000
HoodsAlwaysVisited = [17000, 18000] HoodsAlwaysVisited = [17000, 18000]
WelcomeValleyBegin = 22000
WelcomeValleyEnd = 61000
DynamicZonesBegin = 61000 DynamicZonesBegin = 61000
DynamicZonesEnd = 1 << 20 DynamicZonesEnd = 1 << 20
cogDept2index = {'c': 0, cogDept2index = {'c': 0,

View file

@ -394,7 +394,7 @@ class Street(BattlePlace.BattlePlace):
loaderTexturePath = Filename(str(signTexturePath)) loaderTexturePath = Filename(str(signTexturePath))
alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb' alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb'
inDreamland = False inDreamland = False
if place.zoneId and ZoneUtil.getCanonicalHoodId(place.zoneId) == ToontownGlobals.DonaldsDreamland: if place.zoneId and ZoneUtil.getHoodId(place.zoneId) == ToontownGlobals.DonaldsDreamland:
inDreamland = True inDreamland = True
alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb' alphaPath = 'phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb'
if Filename(signTexturePath).exists(): if Filename(signTexturePath).exists():

View file

@ -51,7 +51,7 @@ class TownLoader(StateData.StateData):
self.parentFSMState.addChild(self.fsm) self.parentFSMState.addChild(self.fsm)
self.loadBattleAnims() self.loadBattleAnims()
self.branchZone = ZoneUtil.getBranchZone(zoneId) self.branchZone = ZoneUtil.getBranchZone(zoneId)
self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId) self.canonicalBranchZone = ZoneUtil.getBranchZone(zoneId)
self.music = base.loadMusic(self.musicFile) self.music = base.loadMusic(self.musicFile)
self.activityMusic = base.loadMusic(self.activityMusicFile) self.activityMusic = base.loadMusic(self.activityMusicFile)
self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_bg.ogg') self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_bg.ogg')
@ -238,7 +238,6 @@ class TownLoader(StateData.StateData):
visGroup = dnaStore.getDNAVisGroupAI(i) visGroup = dnaStore.getDNAVisGroupAI(i)
groupName = base.cr.hoodMgr.extractGroupName(groupFullName) groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
zoneId = int(groupName) zoneId = int(groupName)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
groupNode = self.geom.find('**/' + groupFullName) groupNode = self.geom.find('**/' + groupFullName)
if groupNode.isEmpty(): if groupNode.isEmpty():
self.notify.error('Could not find visgroup') self.notify.error('Could not find visgroup')
@ -264,12 +263,10 @@ class TownLoader(StateData.StateData):
for i in xrange(numVisGroups): for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i) groupFullName = dnaStore.getDNAVisGroupName(i)
zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName)) zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)): for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
visName = dnaStore.getVisibleName(i, j) visName = dnaStore.getVisibleName(i, j)
groupName = base.cr.hoodMgr.extractGroupName(visName) groupName = base.cr.hoodMgr.extractGroupName(visName)
nextZoneId = int(groupName) nextZoneId = int(groupName)
nextZoneId = ZoneUtil.getTrueZoneId(nextZoneId, self.zoneId)
visNode = self.zoneDict[nextZoneId] visNode = self.zoneDict[nextZoneId]
self.nodeDict[zoneId].append(visNode) self.nodeDict[zoneId].append(visNode)