diff --git a/config/release/dev.prc b/config/release/dev.prc index bea2722d..3c37338e 100644 --- a/config/release/dev.prc +++ b/config/release/dev.prc @@ -20,7 +20,7 @@ dc-file astron/dclass/toon.dc dc-file astron/dclass/otp.dc # Core features: -want-pets #f +want-pets #t want-parties #t want-cogdominiums #f want-achievements #f diff --git a/libpandadna.pyd b/libpandadna.pyd index cbef6e13..1c78821d 100644 Binary files a/libpandadna.pyd and b/libpandadna.pyd differ diff --git a/toontown/building/DistributedBankInterior.py b/toontown/building/DistributedBankInterior.py index a6f2c126..e8a0d79a 100644 --- a/toontown/building/DistributedBankInterior.py +++ b/toontown/building/DistributedBankInterior.py @@ -6,7 +6,7 @@ from pandac.PandaModules import * import random import ToonInteriorColors -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.hood import ZoneUtil from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase from toontown.toonbase.ToonBaseGlobal import * @@ -210,7 +210,7 @@ class DistributedBankInterior(DistributedObject): doorOrigin.setScale(0.8, 0.8, 0.8) doorOrigin.setPos(doorOrigin, 0, -0.025, 0) doorColor = self.randomGenerator.choice(self.colors['TI_door']) - DNADoor.setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) + setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) doorFrame = doorNP.find('door_*_flat') doorFrame.wrtReparentTo(self.interior) doorFrame.setColor(doorColor) diff --git a/toontown/building/DistributedGagshopInterior.py b/toontown/building/DistributedGagshopInterior.py index a445c855..ac17e090 100644 --- a/toontown/building/DistributedGagshopInterior.py +++ b/toontown/building/DistributedGagshopInterior.py @@ -5,7 +5,7 @@ import random from direct.distributed import DistributedObject from direct.directnotify import DirectNotifyGlobal import ToonInteriorColors -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.hood import ZoneUtil from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase @@ -82,7 +82,7 @@ class DistributedGagshopInterior(DistributedObject.DistributedObject): doorOrigin.setScale(0.8, 0.8, 0.8) doorOrigin.setPos(doorOrigin, 0, -0.025, 0) doorColor = self.randomGenerator.choice(self.colors['TI_door']) - DNADoor.setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) + setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) doorFrame = doorNP.find('door_*_flat') doorFrame.wrtReparentTo(self.interior) doorFrame.setColor(doorColor) diff --git a/toontown/building/DistributedHQInterior.py b/toontown/building/DistributedHQInterior.py index e77f5455..34d6566e 100644 --- a/toontown/building/DistributedHQInterior.py +++ b/toontown/building/DistributedHQInterior.py @@ -8,7 +8,7 @@ from pandac.PandaModules import * from toontown.toonbase import TTLocalizer from toontown.toonbase.ToonBaseGlobal import * from toontown.toonbase.ToontownGlobals import * -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase @@ -156,7 +156,7 @@ class DistributedHQInterior(DistributedObject.DistributedObject): doorOrigin.setPos(doorOrigin, 0, -0.025, 0) doorColor = self.randomGenerator.choice(self.colors['TI_door']) triggerId = str(self.block) + '_' + doorOriginIndexStr - DNADoor.setupDoor(doorNP, newNodePath, doorOrigin, self.dnaStore, triggerId, doorColor) + setupDoor(doorNP, newNodePath, doorOrigin, self.dnaStore, triggerId, doorColor) doorFrame = doorNP.find('door_*_flat') doorFrame.setColor(doorColor) del self.dnaStore diff --git a/toontown/building/DistributedLibraryInterior.py b/toontown/building/DistributedLibraryInterior.py index 68c95abf..56179354 100644 --- a/toontown/building/DistributedLibraryInterior.py +++ b/toontown/building/DistributedLibraryInterior.py @@ -2,7 +2,7 @@ from direct.distributed.DistributedObject import DistributedObject import random from toontown.building import ToonInteriorColors -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.hood import ZoneUtil from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase @@ -27,7 +27,7 @@ class DistributedLibraryInterior(DistributedObject): hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId) doorColor = ToonInteriorColors.colors[hoodId]['TI_door'][0] - DNADoor.setupDoor( + setupDoor( doorNodePath, self.interior, doorOrigin, self.cr.playGame.dnaStore, str(self.block), doorColor) diff --git a/toontown/building/DistributedPetshopInterior.py b/toontown/building/DistributedPetshopInterior.py index f4b8f838..77a30ce8 100644 --- a/toontown/building/DistributedPetshopInterior.py +++ b/toontown/building/DistributedPetshopInterior.py @@ -6,7 +6,7 @@ from direct.distributed import DistributedObject from direct.directnotify import DirectNotifyGlobal from direct.actor import Actor import ToonInteriorColors -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.hood import ZoneUtil from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase @@ -90,7 +90,7 @@ class DistributedPetshopInterior(DistributedObject.DistributedObject): doorOrigin.setScale(0.8, 0.8, 0.8) doorOrigin.setPos(doorOrigin, 0, -0.25, 0) doorColor = self.randomGenerator.choice(self.colors['TI_door']) - DNADoor.setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) + setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor) doorFrame = doorNP.find('door_*_flat') doorFrame.wrtReparentTo(self.interior) doorFrame.setColor(doorColor) diff --git a/toontown/building/DistributedToonHallInterior.py b/toontown/building/DistributedToonHallInterior.py index a3f7f533..31974dbc 100644 --- a/toontown/building/DistributedToonHallInterior.py +++ b/toontown/building/DistributedToonHallInterior.py @@ -3,7 +3,7 @@ from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from direct.showbase import Audio3DManager from toontown.toonbase import ToontownGlobals -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * import cPickle from DistributedToonInterior import DistributedToonInterior from direct.directnotify import DirectNotifyGlobal @@ -80,7 +80,7 @@ class DistributedToonHallInterior(DistributedToonInterior): door_origin.setScale(0.8, 0.8, 0.8) door_origin.setPos(door_origin, 0, -0.025, 0) color = self.randomGenerator.choice(self.colors['TI_door']) - DNADoor.setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color) + setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color) doorFrame = doorNP.find('door_*_flat') doorFrame.wrtReparentTo(self.interior) doorFrame.setColor(color) diff --git a/toontown/building/DistributedToonInterior.py b/toontown/building/DistributedToonInterior.py index 6b699dc7..68c0e8ab 100644 --- a/toontown/building/DistributedToonInterior.py +++ b/toontown/building/DistributedToonInterior.py @@ -11,7 +11,7 @@ from direct.fsm import State from direct.interval.IntervalGlobal import * from otp.speedchat import SpeedChatGlobals from pandac.PandaModules import * -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.hood import ZoneUtil from toontown.toon import ToonDNA from toontown.toon import ToonHead @@ -113,7 +113,7 @@ class DistributedToonInterior(DistributedObject.DistributedObject): door_origin.setScale(0.8, 0.8, 0.8) door_origin.setPos(door_origin, 0, -0.025, 0) color = self.randomGenerator.choice(self.colors['TI_door']) - DNADoor.setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color) + setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color) doorFrame = doorNP.find('door_*_flat') doorFrame.wrtReparentTo(self.interior) doorFrame.setColor(color) diff --git a/toontown/coghq/BossbotHQExterior.py b/toontown/coghq/BossbotHQExterior.py index f59b28bc..4af98b26 100644 --- a/toontown/coghq/BossbotHQExterior.py +++ b/toontown/coghq/BossbotHQExterior.py @@ -78,7 +78,7 @@ class BossbotHQExterior(CogHQExterior.CogHQExterior): visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles diff --git a/toontown/coghq/CashbotHQExterior.py b/toontown/coghq/CashbotHQExterior.py index 5367640e..0c2d0769 100644 --- a/toontown/coghq/CashbotHQExterior.py +++ b/toontown/coghq/CashbotHQExterior.py @@ -72,7 +72,7 @@ class CashbotHQExterior(CogHQExterior.CogHQExterior): visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles diff --git a/toontown/coghq/FactoryExterior.py b/toontown/coghq/FactoryExterior.py index ff28c160..dd06f718 100644 --- a/toontown/coghq/FactoryExterior.py +++ b/toontown/coghq/FactoryExterior.py @@ -80,7 +80,7 @@ class FactoryExterior(BattlePlace.BattlePlace): visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles diff --git a/toontown/coghq/LawbotHQExterior.py b/toontown/coghq/LawbotHQExterior.py index cebe9c06..e4e8e189 100644 --- a/toontown/coghq/LawbotHQExterior.py +++ b/toontown/coghq/LawbotHQExterior.py @@ -30,7 +30,7 @@ class LawbotHQExterior(CogHQExterior.CogHQExterior): visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles diff --git a/toontown/coghq/SellbotHQExterior.py b/toontown/coghq/SellbotHQExterior.py index 64105a7f..2afff17d 100644 --- a/toontown/coghq/SellbotHQExterior.py +++ b/toontown/coghq/SellbotHQExterior.py @@ -26,7 +26,7 @@ class SellbotHQExterior(CogHQExterior.CogHQExterior): visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId) visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(visZoneId)) self.zoneVisDict[visZoneId] = visibles diff --git a/toontown/distributed/PlayGame.py b/toontown/distributed/PlayGame.py index 97d761ae..90084be9 100644 --- a/toontown/distributed/PlayGame.py +++ b/toontown/distributed/PlayGame.py @@ -158,7 +158,6 @@ class PlayGame(StateData.StateData): def unloadDnaStore(self): if hasattr(self, 'dnaStore'): - self.dnaStore.cleanup() del self.dnaStore ModelPool.garbageCollect() TexturePool.garbageCollect() diff --git a/toontown/dna/DNAAnimBuilding.py b/toontown/dna/DNAAnimBuilding.py deleted file mode 100644 index 7d4e9382..00000000 --- a/toontown/dna/DNAAnimBuilding.py +++ /dev/null @@ -1,33 +0,0 @@ -import DNALandmarkBuilding -import DNAError -import DNAUtil - -class DNAAnimBuilding(DNALandmarkBuilding.DNALandmarkBuilding): - COMPONENT_CODE = 16 - - def __init__(self, name): - DNALandmarkBuilding.DNALandmarkBuilding.__init__(self, name) - self.animName = '' - - def setAnim(self, anim): - self.animName = anim - - def getAnim(self): - return self.animName - - def makeFromDGI(self, dgi): - DNALandmarkBuilding.DNALandmarkBuilding.makeFromDGI(self, dgi) - self.animName = DNAUtil.dgiExtractString8(dgi) - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.getCode()) - if node is None: - raise DNAError.DNAError('DNAAnimBuilding code ' + self.getCode() + ' not found in dnastore') - node = node.copyTo(nodePath, 0) - node.setName(self.getName()) - node.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - node.setTag('DNAAnim', self.animName) - self.setupSuitBuildingOrigin(nodePath, node) - for child in self.children: - child.traverse(nodePath, dnaStorage) - nodePath.flattenStrong() \ No newline at end of file diff --git a/toontown/dna/DNAAnimProp.py b/toontown/dna/DNAAnimProp.py deleted file mode 100644 index 53032234..00000000 --- a/toontown/dna/DNAAnimProp.py +++ /dev/null @@ -1,36 +0,0 @@ -import DNAProp -from DNAUtil import * - -class DNAAnimProp(DNAProp.DNAProp): - COMPONENT_CODE = 14 - - def __init__(self, name): - DNAProp.DNAProp.__init__(self, name) - self.animName = '' - - def setAnim(self, anim): - self.animName = anim - - def getAnim(self): - return self.animName - - def makeFromDGI(self, dgi): - DNAProp.DNAProp.makeFromDGI(self, dgi) - self.animName = dgiExtractString8(dgi) - - def traverse(self, nodePath, dnaStorage): - node = None - if self.getCode() == 'DCS': - node = ModelNode(self.getName()) - node.setPreserveTransform(ModelNode.PTNet) - node = nodePath.attachNewNode(node, 0) - else: - node = dnaStorage.findNode(self.getCode()) - node = node.copyTo(nodePath, 0) - node.setName(self.getName()) - node.setTag('DNAAnim', self.getAnim()) - node.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - node.setColorScale(self.getColor(), 0) - node.flattenStrong() - for child in self.children: - child.traverse(node, dnaStorage) \ No newline at end of file diff --git a/toontown/dna/DNABattleCell.py b/toontown/dna/DNABattleCell.py deleted file mode 100644 index e59a70cf..00000000 --- a/toontown/dna/DNABattleCell.py +++ /dev/null @@ -1,34 +0,0 @@ -from DNAUtil import * - -class DNABattleCell: - COMPONENT_CODE = 21 - - def __init__(self, width, height, pos): - self.width = width - self.height = height - self.pos = pos - - def setWidth(self, width): - self.width = width - - def getWidth(self): - return self.width - - def setHeight(self, height): - self.height = height - - def getHeight(self): - return self.height - - def setPos(self, pos): - self.pos = pos - - def getPos(self): - return self.pos - - def setWidthHeight(self, width, height): - self.width = width - self.height = height - - def __str__(self): - return 'DNABattleCell width: ' + str(self.width) + ' height: ' + str(self.height) + ' pos: ' + str(self.pos) diff --git a/toontown/dna/DNACornice.py b/toontown/dna/DNACornice.py deleted file mode 100644 index c78c7eea..00000000 --- a/toontown/dna/DNACornice.py +++ /dev/null @@ -1,60 +0,0 @@ -from panda3d.core import LVector4f, LVector3f, DecalEffect -import DNAGroup -import DNAError -import DNAUtil - -class DNACornice(DNAGroup.DNAGroup): - COMPONENT_CODE = 12 - - def __init__(self, name): - DNAGroup.DNAGroup.__init__(self, name) - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setColor(self, color): - self.color = color - - def getColor(self): - return self.color - - def makeFromDGI(self, dgi): - DNAGroup.DNAGroup.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - pParentXScale = nodePath.getParent().getScale().getX() - parentZScale = nodePath.getScale().getZ() - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNACornice code %d not found in DNAStorage' % self.code) - nodePathA = nodePath.attachNewNode('cornice-internal', 0) - node = node.find('**/*_d') - np = node.copyTo(nodePathA, 0) - np.setPosHprScale( - LVector3f(0, 0, 0), - LVector3f(0, 0, 0), - LVector3f(1, pParentXScale/parentZScale, - pParentXScale/parentZScale)) - np.setEffect(DecalEffect.make()) - np.flattenStrong() - node = node.getParent().find('**/*_nd') - np = node.copyTo(nodePathA, 1) - np.setPosHprScale( - LVector3f(0, 0, 0), - LVector3f(0, 0, 0), - LVector3f(1, pParentXScale/parentZScale, - pParentXScale/parentZScale)) - np.flattenStrong() - nodePathA.setPosHprScale( - LVector3f(0, 0, node.getScale().getZ()), - LVector3f(0, 0, 0), - LVector3f(1, 1, 1)) - nodePathA.setColor(self.color) - nodePathA.flattenStrong() \ No newline at end of file diff --git a/toontown/dna/DNADoor.py b/toontown/dna/DNADoor.py deleted file mode 100644 index f6e6efb3..00000000 --- a/toontown/dna/DNADoor.py +++ /dev/null @@ -1,81 +0,0 @@ -from panda3d.core import LVector4f, DecalEffect, NodePath -import DNAGroup -import DNAError -import DNAUtil - -class DNADoor(DNAGroup.DNAGroup): - COMPONENT_CODE = 17 - - def __init__(self, name): - DNAGroup.DNAGroup.__init__(self, name) - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setColor(self, color): - self.color = color - - def getColor(self): - return self.color - - @staticmethod - def setupDoor(doorNodePath, parentNode, doorOrigin, dnaStore, block, color): - doorNodePath.setPosHprScale(doorOrigin, (0, 0, 0), (0, 0, 0), (1, 1, 1)) - doorNodePath.setColor(color, 0) - leftHole = doorNodePath.find('door_*_hole_left') - leftHole.flattenStrong() - leftHole.setName('doorFrameHoleLeft') - rightHole = doorNodePath.find('door_*_hole_right') - rightHole.flattenStrong() - rightHole.setName('doorFrameHoleRight') - leftDoor = doorNodePath.find('door_*_left') - leftDoor.flattenStrong() - leftDoor.setName('leftDoor') - rightDoor = doorNodePath.find('door_*_right') - rightDoor.flattenStrong() - rightDoor.setName('rightDoor') - doorFlat = doorNodePath.find('door_*_flat') - doorFlat.flattenStrong() - leftHole.wrtReparentTo(doorFlat, 0) - rightHole.wrtReparentTo(doorFlat, 0) - doorFlat.setEffect(DecalEffect.make()) - rightDoor.wrtReparentTo(parentNode, 0) - leftDoor.wrtReparentTo(parentNode, 0) - - rightDoor.setColor(color, 0) - leftDoor.setColor(color, 0) - leftHole.setColor((0, 0, 0, 1), 0) - rightHole.setColor((0, 0, 0, 1), 0) - - doorTrigger = doorNodePath.find('door_*_trigger') - doorTrigger.setScale(2, 2, 2) - doorTrigger.wrtReparentTo(parentNode, 0) - doorTrigger.setName('door_trigger_' + block) - - if not dnaStore.getDoorPosHprFromBlockNumber(block): - dnaStore.storeBlockDoor(block, doorOrigin) - - doorNodePath.flattenMedium() - - def makeFromDGI(self, dgi): - DNAGroup.DNAGroup.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - frontNode = nodePath.find('**/*_front') - if not frontNode.getNode(0).isGeomNode(): - frontNode = frontNode.find('**/+GeomNode') - frontNode.setEffect(DecalEffect.make()) - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNADoor code ' + self.code + ' not found in DNAStorage') - doorNode = node.copyTo(frontNode, 0) - doorNode.flattenMedium() - block = dnaStorage.getBlock(nodePath.getName()) - DNADoor.setupDoor(doorNode, nodePath, nodePath.find('**/*door_origin'), dnaStorage, block, self.getColor()) diff --git a/toontown/dna/DNAError.py b/toontown/dna/DNAError.py deleted file mode 100644 index 341949e5..00000000 --- a/toontown/dna/DNAError.py +++ /dev/null @@ -1,2 +0,0 @@ -class DNAError(Exception): - pass \ No newline at end of file diff --git a/toontown/dna/DNAFlatBuilding.py b/toontown/dna/DNAFlatBuilding.py deleted file mode 100644 index 69f5cb10..00000000 --- a/toontown/dna/DNAFlatBuilding.py +++ /dev/null @@ -1,149 +0,0 @@ -from panda3d.core import NodePath, DecalEffect -import DNANode -import DNAWall - -import random - -class DNAFlatBuilding(DNANode.DNANode): - COMPONENT_CODE = 9 - currentWallHeight = 0 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.width = 0 - self.hasDoor = False - - def setWidth(self, width): - self.width = width - - def getWidth(self): - return self.width - - def setCurrentWallHeight(self, currentWallHeight): - DNAFlatBuilding.currentWallHeight = currentWallHeight - - def getCurrentWallHeight(self): - return DNAFlatBuilding.currentWallHeight - - def setHasDoor(self, hasDoor): - self.hasDoor = hasDoor - - def getHasDoor(self): - return self.hasDoor - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.width = dgi.getInt16() / 100.0 - self.hasDoor = dgi.getBool() - - def setupSuitFlatBuilding(self, nodePath, dnaStorage): - name = self.getName() - if name[:2] != 'tb': - return - name = 'sb' + name[2:] - node = nodePath.attachNewNode(name) - node.setPosHpr(self.getPos(), self.getHpr()) - numCodes = dnaStorage.getNumCatalogCodes('suit_wall') - if numCodes < 1: - return - code = dnaStorage.getCatalogCode( - 'suit_wall', random.randint(0, numCodes - 1)) - wallNode = dnaStorage.findNode(code) - if not wallNode: - return - wallNode = wallNode.copyTo(node, 0) - wallScale = wallNode.getScale() - wallScale.setX(self.width) - wallScale.setZ(DNAFlatBuilding.currentWallHeight) - wallNode.setScale(wallScale) - if self.getHasDoor(): - wallNodePath = node.find('wall_*') - doorNode = dnaStorage.findNode('suit_door') - doorNode = doorNode.copyTo(wallNodePath, 0) - doorNode.setScale(NodePath(), (1, 1, 1)) - doorNode.setPosHpr(0.5, 0, 0, 0, 0, 0) - wallNodePath.setEffect(DecalEffect.make()) - node.flattenMedium() - node.stash() - - def setupCogdoFlatBuilding(self, nodePath, dnaStorage): - name = self.getName() - if name[:2] != 'tb': - return - name = 'cb' + name[2:] - node = nodePath.attachNewNode(name) - node.setPosHpr(self.getPos(), self.getHpr()) - numCodes = dnaStorage.getNumCatalogCodes('cogdo_wall') - if numCodes < 1: - return - code = dnaStorage.getCatalogCode( - 'cogdo_wall', random.randint(0, numCodes - 1)) - wallNode = dnaStorage.findNode(code) - if not wallNode: - return - wallNode = wallNode.copyTo(node, 0) - wallScale = wallNode.getScale() - wallScale.setX(self.width) - wallScale.setZ(DNAFlatBuilding.currentWallHeight) - wallNode.setScale(wallScale) - if self.getHasDoor(): - wallNodePath = node.find('wall_*') - doorNode = dnaStorage.findNode('suit_door') - doorNode = doorNode.copyTo(wallNodePath, 0) - doorNode.setScale(NodePath(), (1, 1, 1)) - doorNode.setPosHpr(0.5, 0, 0, 0, 0, 0) - wallNodePath.setEffect(DecalEffect.make()) - node.flattenMedium() - node.stash() - - def traverse(self, nodePath, dnaStorage): - DNAFlatBuilding.currentWallHeight = 0 - node = nodePath.attachNewNode(self.getName()) - internalNode = node.attachNewNode(self.getName() + '-internal') - scale = self.getScale() - scale.setX(self.width) - internalNode.setScale(scale) - node.setPosHpr(self.getPos(), self.getHpr()) - for child in self.children: - if isinstance(child, DNAWall.DNAWall): - child.traverse(internalNode, dnaStorage) - else: - child.traverse(node, dnaStorage) - if DNAFlatBuilding.currentWallHeight == 0: - print 'empty flat building with no walls' - else: - cameraBarrier = dnaStorage.findNode('wall_camera_barrier') - if cameraBarrier is None: - raise DNAError.DNAError('DNAFlatBuilding requires that there is a wall_camera_barrier in storage') - cameraBarrier = cameraBarrier.copyTo(internalNode, 0) - cameraBarrier.setScale((1, 1, DNAFlatBuilding.currentWallHeight)) - internalNode.flattenStrong() - collisionNode = node.find('**/door_*/+CollisionNode') - if not collisionNode.isEmpty(): - collisionNode.setName('KnockKnockDoorSphere_' + dnaStorage.getBlock(self.getName())) - cameraBarrier.wrtReparentTo(nodePath, 0) - wallCollection = internalNode.findAllMatches('wall*') - wallHolder = node.attachNewNode('wall_holder') - wallDecal = node.attachNewNode('wall_decal') - windowCollection = internalNode.findAllMatches('**/window*') - doorCollection = internalNode.findAllMatches('**/door*') - corniceCollection = internalNode.findAllMatches('**/cornice*_d') - wallCollection.reparentTo(wallHolder) - windowCollection.reparentTo(wallDecal) - doorCollection.reparentTo(wallDecal) - corniceCollection.reparentTo(wallDecal) - for i in xrange(wallHolder.getNumChildren()): - iNode = wallHolder.getChild(i) - iNode.clearTag('DNACode') - iNode.clearTag('DNARoot') - wallHolder.flattenStrong() - wallDecal.flattenStrong() - holderChild0 = wallHolder.getChild(0) - wallDecal.getChildren().reparentTo(holderChild0) - holderChild0.reparentTo(internalNode) - holderChild0.setEffect(DecalEffect.make()) - wallHolder.removeNode() - wallDecal.removeNode() - self.setupSuitFlatBuilding(nodePath, dnaStorage) - self.setupCogdoFlatBuilding(nodePath, dnaStorage) - node.flattenStrong() diff --git a/toontown/dna/DNAFlatDoor.py b/toontown/dna/DNAFlatDoor.py deleted file mode 100644 index cb8bb2ef..00000000 --- a/toontown/dna/DNAFlatDoor.py +++ /dev/null @@ -1,14 +0,0 @@ -from panda3d.core import NodePath, DecalEffect -import DNADoor - -class DNAFlatDoor(DNADoor.DNADoor): - COMPONENT_CODE = 18 - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.getCode()) - node = node.copyTo(nodePath, 0) - node.setScale(NodePath(), (1, 1, 1)) - node.setPosHpr((0.5, 0, 0), (0, 0, 0)) - node.setColor(self.getColor()) - node.getNode(0).setEffect(DecalEffect.make()) - node.flattenStrong() \ No newline at end of file diff --git a/toontown/dna/DNAGroup.py b/toontown/dna/DNAGroup.py deleted file mode 100644 index 3f09bc1e..00000000 --- a/toontown/dna/DNAGroup.py +++ /dev/null @@ -1,54 +0,0 @@ -from panda3d.core import PandaNode -import DNAUtil - -class DNAGroup: - COMPONENT_CODE = 1 - - def __init__(self, name): - self.name = name - self.children = [] - self.parent = None - self.visGroup = None - - def add(self, child): - self.children += [child] - - def remove(self, child): - self.children.remove(child) - - def at(self, index): - return self.children[index] - - def setParent(self, parent): - self.parent = parent - self.visGroup = parent.getVisGroup() - - def getParent(self): - return self.parent - - def clearParent(self): - self.parent = None - self.visGroup = None - - def getVisGroup(self): - return self.visGroup - - def getNumChildren(self): - return len(self.children) - - def getName(self): - return self.name - - def setName(self, name): - self.name = name - - def makeFromDGI(self, dgi): - self.name = DNAUtil.dgiExtractString8(dgi) - DNAUtil.dgiExtractString8(dgi) - DNAUtil.dgiExtractString8(dgi) - - def traverse(self, nodePath, dnaStorage): - node = PandaNode(self.name) - nodePath = nodePath.attachNewNode(node, 0) - for child in self.children: - child.traverse(nodePath, dnaStorage) \ No newline at end of file diff --git a/toontown/dna/DNAInteractiveProp.py b/toontown/dna/DNAInteractiveProp.py deleted file mode 100644 index 9ac92754..00000000 --- a/toontown/dna/DNAInteractiveProp.py +++ /dev/null @@ -1,37 +0,0 @@ -from panda3d.core import ModelNode -import DNAAnimProp - -class DNAInteractiveProp(DNAAnimProp.DNAAnimProp): - COMPONENT_CODE = 15 - - def __init__(self, name): - DNAAnimProp.DNAAnimProp.__init__(self, name) - self.cellId = -1 - - def setCellId(self, id): - self.cellId = id - - def getCellId(self): - return cellId - - def makeFromDGI(self, dgi): - DNAAnimProp.DNAAnimProp.makeFromDGI(self, dgi) - self.cellId = dgi.getInt16() - - def traverse(self, nodePath, dnaStorage): - node = None - if self.getCode() == 'DCS': - node = ModelNode(self.getName()) - node.setPreserveTransform(ModelNode.PTNet) - node = nodePath.attachNewNode(node, 0) - else: - node = dnaStorage.findNode(self.getCode()) - node = node.copyTo(nodePath, 0) - node.setName(self.getName()) - node.setTag('DNAAnim', self.getAnim()) - node.setTag('DNACellIndex', str(self.cellId)) - node.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - node.setColorScale(self.getColor(), 0) - node.flattenStrong() - for child in self.children: - child.traverse(node, dnaStorage) \ No newline at end of file diff --git a/toontown/dna/DNALandmarkBuilding.py b/toontown/dna/DNALandmarkBuilding.py deleted file mode 100644 index fb7bd4d8..00000000 --- a/toontown/dna/DNALandmarkBuilding.py +++ /dev/null @@ -1,79 +0,0 @@ -from panda3d.core import LVector4f -import DNANode -import DNAUtil -import DNAError - -class DNALandmarkBuilding(DNANode.DNANode): - COMPONENT_CODE = 13 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.code = '' - self.wallColor = LVector4f(1, 1, 1, 1) - self.title = '' - self.article = '' - self.buildingType = '' - self.door = None - - def setArticle(self, article): - self.article = article - - def getArticle(self): - return self.article - - def setBuildingType(self, buildingType): - self.buildingType = buildingType - - def getBuildingType(self): - return self.buildingType - - def setTitle(self, title): - self.title = title - - def getTitle(self): - return self.title - - def getCode(self): - return self.code - - def setCode(self, code): - self.code = code - - def setWallColor(self, color): - self.wallColor = color - - def getWallColor(self): - return self.wallColor - - def setupSuitBuildingOrigin(self, nodePathA, nodePathB): - if (self.getName()[:2] == 'tb') and (self.getName()[3].isdigit()) and (self.getName().find(':') != -1): - name = self.getName() - name = 's' + name[1:] - node = nodePathB.find('**/*suit_building_origin') - if node.isEmpty(): - node = nodePathA.attachNewNode(name) - node.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - else: - node.wrtReparentTo(nodePathA, 0) - node.setName(name) - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.wallColor = DNAUtil.dgiExtractColor(dgi) - self.title = DNAUtil.dgiExtractString8(dgi) - self.article = DNAUtil.dgiExtractString8(dgi) - self.buildingType = DNAUtil.dgiExtractString8(dgi) - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNALandmarkBuilding code ' + self.code + ' not found in DNAStorage') - npA = nodePath - nodePath = node.copyTo(nodePath, 0) - nodePath.setName(self.getName()) - nodePath.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - self.setupSuitBuildingOrigin(npA, nodePath) - for child in self.children: - child.traverse(nodePath, dnaStorage) - nodePath.flattenStrong() \ No newline at end of file diff --git a/toontown/dna/DNALoader.py b/toontown/dna/DNALoader.py deleted file mode 100644 index f4545f77..00000000 --- a/toontown/dna/DNALoader.py +++ /dev/null @@ -1,220 +0,0 @@ -from pandac.PandaModules import * -from direct.distributed.PyDatagramIterator import PyDatagramIterator -from direct.distributed.PyDatagram import PyDatagram -from direct.stdpy.file import * - -import DNAUtil -import DNAError -import DNAAnimBuilding -import DNAAnimProp -import DNACornice -import DNADoor -import DNAFlatBuilding -import DNAFlatDoor -import DNAGroup -import DNAInteractiveProp -import DNALandmarkBuilding -import DNANode -import DNAProp -import DNASign -import DNASignBaseline -import DNASignGraphic -import DNASignText -import DNAStreet -import DNAVisGroup -import DNAWall -import DNAWindows -import DNABattleCell -import DNASuitPoint - -import zlib -import sys -sys.setrecursionlimit(10000) - -compClassTable = { -1: DNAGroup.DNAGroup, -2: DNAVisGroup.DNAVisGroup, -3: DNANode.DNANode, -4: DNAProp.DNAProp, -5: DNASign.DNASign, -6: DNASignBaseline.DNASignBaseline, -7: DNASignText.DNASignText, -8: DNASignGraphic.DNASignGraphic, -9: DNAFlatBuilding.DNAFlatBuilding, -10: DNAWall.DNAWall, -11: DNAWindows.DNAWindows, -12: DNACornice.DNACornice, -13: DNALandmarkBuilding.DNALandmarkBuilding, -14: DNAAnimProp.DNAAnimProp, -15: DNAInteractiveProp.DNAInteractiveProp, -16: DNAAnimBuilding.DNAAnimBuilding, -17: DNADoor.DNADoor, -18: DNAFlatDoor.DNAFlatDoor, -19: DNAStreet.DNAStreet -} - -childlessComps = ( -7, # DNASignText -11, # DNAWindows -12, # DNACornice -17, # DNADoor -18, # DNAFlatDoor -19 # DNAStreet -) - -class DNALoader: - def __init__(self): - self.dnaStorage = None - self.prop = None - - def destroy(self): - del self.dnaStorage - del self.prop - - def handleStorageData(self, dgi): - # Catalog Codes - numRoots = dgi.getUint16() - for _ in xrange(numRoots): - root = DNAUtil.dgiExtractString8(dgi) - numCodes = dgi.getUint8() - for i in xrange(numCodes): - code = DNAUtil.dgiExtractString8(dgi) - self.dnaStorage.storeCatalogCode(root, code) - - # Textures - numTextures = dgi.getUint16() - for _ in xrange(numTextures): - code = DNAUtil.dgiExtractString8(dgi) - filename = DNAUtil.dgiExtractString8(dgi) - self.dnaStorage.storeTexture(code, loader.pdnaTexture(filename, okMissing=True)) - - # Fonts - numFonts = dgi.getUint16() - for _ in xrange(numFonts): - code = DNAUtil.dgiExtractString8(dgi) - filename = DNAUtil.dgiExtractString8(dgi) - self.dnaStorage.storeFont(code, loader.pdnaFont(filename)) - - # Nodes - self.handleNode(dgi, target = self.dnaStorage.storeNode) - self.handleNode(dgi, target = self.dnaStorage.storeHoodNode) - self.handleNode(dgi, target = self.dnaStorage.storePlaceNode) - - # Blocks - numBlocks = dgi.getUint16() - for _ in xrange(numBlocks): - number = dgi.getUint8() - zone = dgi.getUint16() - title = DNAUtil.dgiExtractString8(dgi) - article = DNAUtil.dgiExtractString8(dgi) - bldgType = DNAUtil.dgiExtractString8(dgi) - self.dnaStorage.storeBlock(number, title, article, bldgType, zone) - - # Suit Points - numPoints = dgi.getUint16() - for _ in xrange(numPoints): - index = dgi.getUint16() - pointType = dgi.getUint8() - x, y, z = (dgi.getInt32() / 100.0 for i in xrange(3)) - graph = dgi.getUint8() - landmarkBuildingIndex = dgi.getInt8() - self.dnaStorage.storeSuitPoint(DNASuitPoint.DNASuitPoint(index, pointType, LVector3f(x, y, z), landmarkBuildingIndex)) - - # Suit Edges - numEdges = dgi.getUint16() - for _ in xrange(numEdges): - index = dgi.getUint16() - numPoints = dgi.getUint16() - for i in xrange(numPoints): - endPoint = dgi.getUint16() - zoneId = dgi.getUint16() - self.dnaStorage.storeSuitEdge(index, endPoint, zoneId) - - # Battle Cells - numCells = dgi.getUint16() - for _ in xrange(numCells): - w = dgi.getUint8() - h = dgi.getUint8() - x, y, z = (dgi.getInt32() / 100.0 for i in xrange(3)) - self.dnaStorage.storeBattleCell(DNABattleCell.DNABattleCell(w, h, LVector3f(x, y, z))) - - def handleCompData(self, dgi): - while True: - propCode = dgi.getUint8() - if propCode == 255: - if self.prop == None: - raise DNAError.DNAError('Unexpected 255 found.') - prop = self.prop.getParent() - if prop is not None: - self.prop = prop - else: - assert self.prop.getName() == 'root' - elif propCode in compClassTable: - propClass = compClassTable[propCode] - if propClass.__init__.func_code.co_argcount > 1: - newComp = propClass('unnamed_comp') - else: - newComp = propClass() - if propCode == 2: - newComp.makeFromDGI(dgi, self.dnaStorage) - self.dnaStorage.storeDNAVisGroup(newComp) - else: - newComp.makeFromDGI(dgi) - else: - raise DNAError.DNAError('Invalid prop code: %d' % propCode) - if dgi.getRemainingSize(): - if propCode != 255: - if self.prop is not None: - newComp.setParent(self.prop) - self.prop.add(newComp) - if propCode not in childlessComps: - self.prop = newComp - continue - break - - def handleNode(self, dgi, target = None): - if target is None: - return - numNodes = dgi.getUint16() - for _ in xrange(numNodes): - code = DNAUtil.dgiExtractString8(dgi) - file = DNAUtil.dgiExtractString8(dgi) - node = DNAUtil.dgiExtractString8(dgi) - np = NodePath(loader.pdnaModel(file)) - if node: - newNode = np.find('**/' + node).copyTo(NodePath()) - np.removeNode() - np = newNode - np.setTag('DNACode', code) - np.setTag('DNARoot', node) - target(np, code) - - def loadDNAFileBase(self, dnaStorage, file): - self.dnaStorage = dnaStorage - dnaFile = open(file, 'rb') - dnaData = dnaFile.read() - dg = PyDatagram(dnaData) - dgi = PyDatagramIterator(dg) - dnaFile.close() - header = dgi.extractBytes(5) - if header != 'PDNA\n': - raise DNAError.DNAError('Invalid header: %s' % (header)) - compressed = dgi.getBool() - dgi.skipBytes(1) - if compressed: - data = dgi.getRemainingBytes() - data = zlib.decompress(data) - dg = PyDatagram(data) - dgi = PyDatagramIterator(dg) - self.handleStorageData(dgi) - self.handleCompData(dgi) - - def loadDNAFile(self, dnaStorage, file): - self.loadDNAFileBase(dnaStorage, file) - nodePath = NodePath(PandaNode('dna')) - self.prop.traverse(nodePath, self.dnaStorage) - return nodePath - - def loadDNAFileAI(self, dnaStorage, file): - self.loadDNAFileBase(dnaStorage, file) - return self.prop diff --git a/toontown/dna/DNANode.py b/toontown/dna/DNANode.py deleted file mode 100644 index aada75c6..00000000 --- a/toontown/dna/DNANode.py +++ /dev/null @@ -1,55 +0,0 @@ -from panda3d.core import LVector3f, PandaNode -import DNAGroup - -class DNANode(DNAGroup.DNAGroup): - COMPONENT_CODE = 3 - - def __init__(self, name): - DNAGroup.DNAGroup.__init__(self, name) - self.pos = LVector3f() - self.hpr = LVector3f() - self.scale = LVector3f(1, 1, 1) - - def getPos(self): - return self.pos - - def setPos(self, pos): - self.pos = pos - - def getHpr(self): - return self.hpr - - def setHpr(self, hpr): - self.hpr = hpr - - def getScale(self): - return self.scale - - def setScale(self, scale): - self.scale = scale - - def makeFromDGI(self, dgi): - DNAGroup.DNAGroup.makeFromDGI(self, dgi) - - x = dgi.getInt32() / 100.0 - y = dgi.getInt32() / 100.0 - z = dgi.getInt32() / 100.0 - self.pos = LVector3f(x, y, z) - - h = dgi.getInt32() / 100.0 - p = dgi.getInt32() / 100.0 - r = dgi.getInt32() / 100.0 - self.hpr = LVector3f(h, p, r) - - sx = dgi.getInt16() / 100.0 - sy = dgi.getInt16() / 100.0 - sz = dgi.getInt16() / 100.0 - self.scale = LVector3f(sx, sy, sz) - - def traverse(self, nodePath, dnaStorage): - node = PandaNode(self.name) - node = nodePath.attachNewNode(node, 0) - node.setPosHprScale(self.pos, self.hpr, self.scale) - for child in self.children: - child.traverse(node, dnaStorage) - node.flattenMedium() \ No newline at end of file diff --git a/toontown/dna/DNAParser.py b/toontown/dna/DNAParser.py index 7e816c4a..132df6d1 100644 --- a/toontown/dna/DNAParser.py +++ b/toontown/dna/DNAParser.py @@ -1,11 +1,6 @@ from direct.stdpy import threading -import DNALoader -from DNAStorage import DNAStorage -from DNASuitPoint import DNASuitPoint -from DNAGroup import DNAGroup -from DNAVisGroup import DNAVisGroup -from DNADoor import DNADoor +from libpandadna import * class DNABulkLoader: def __init__(self, storage, files): @@ -20,37 +15,44 @@ class DNABulkLoader: del self.dnaFiles def loadDNABulk(dnaStorage, file): - dnaLoader = DNALoader.DNALoader() + dnaLoader = DNALoader() fileu = '../resources/' + file fileo = 'resources/' + file try: dnaLoader.loadDNAFile(dnaStorage, fileu) except: dnaLoader.loadDNAFile(dnaStorage, fileo) - dnaLoader.destroy() def loadDNAFile(dnaStorage, file): print 'Reading DNA file...', file - dnaLoader = DNALoader.DNALoader() + dnaLoader = DNALoader() fileu = '../resources/' + file fileo = 'resources/' + file try: node = dnaLoader.loadDNAFile(dnaStorage, fileu) except: node = dnaLoader.loadDNAFile(dnaStorage, fileo) - dnaLoader.destroy() if node.node().getNumChildren() > 0: return node.node() return None def loadDNAFileAI(dnaStorage, file): - dnaLoader = DNALoader.DNALoader() + dnaLoader = DNALoader() fileu = '../resources/' + file fileo = 'resources/' + file try: data = dnaLoader.loadDNAFileAI(dnaStorage, fileu) except: data = dnaLoader.loadDNAFileAI(dnaStorage, fileo) - dnaLoader.destroy() return data +def setupDoor(a, b, c, d, e, f): + try: + e = int(str(e).split('_')[0]) + + except: + print 'setupDoor: error parsing', e + e = 9999 + + DNADoor.setupDoor(a, b, c, d, e, f) + diff --git a/toontown/dna/DNAProp.py b/toontown/dna/DNAProp.py deleted file mode 100644 index 5c430129..00000000 --- a/toontown/dna/DNAProp.py +++ /dev/null @@ -1,66 +0,0 @@ -from panda3d.core import LVector4f, ModelNode -import DNANode -import DNAUtil - -class DNAProp(DNANode.DNANode): - COMPONENT_CODE = 4 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - - def getCode(self): - return self.code - - def setCode(self, code): - self.code = code - - def getColor(self): - return self.color - - def setColor(self, color): - self.color = color - - def smartFlatten(self, node): - if 'trolley' in self.name: - return - elif self.children: - node.flattenMedium() - elif 'HQTelescopeAnimatedProp' in self.name: - node.flattenMedium() - elif node.find('**/water1*').isEmpty(): - node.flattenStrong() - elif not node.find('**/water').isEmpty(): - water = node.find('**/water') - water.setTransparency(1) - water.setColor(1, 1, 1, 0.8) - node.flattenStrong() - elif not node.find('**/water1*').isEmpty(): - water = node.find('**/water1*') - water.setTransparency(1) - water.setColorScale(1.0, 1.0, 1.0, 1.0) - water.setBin('water', 51, 1) - node.flattenStrong() - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - if self.code == 'DCS': - node = ModelNode(self.name) - node.setPreserveTransform(ModelNode.PTNet) - node = nodePath.attachNewNode(node) - else: - node = dnaStorage.findNode(self.code) - if node is None: - return - node = node.copyTo(nodePath, 0) - node.setPosHprScale(self.pos, self.hpr, self.scale) - node.setName(self.name) - node.setColorScale(self.color, 0) - #self.smartFlatten(node) - for child in self.children: - child.traverse(node, dnaStorage) diff --git a/toontown/dna/DNASign.py b/toontown/dna/DNASign.py deleted file mode 100644 index 839f73a8..00000000 --- a/toontown/dna/DNASign.py +++ /dev/null @@ -1,44 +0,0 @@ -from panda3d.core import LVector4f, NodePath, DecalEffect -import DNANode -import DNAUtil - -class DNASign(DNANode.DNANode): - COMPONENT_CODE = 5 - - def __init__(self): - DNANode.DNANode.__init__(self, '') - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - - def getCode(self): - return self.code - - def setCode(self, code): - self.code = code - - def getColor(self): - return self.color - - def setColor(self, color): - self.color = color - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - sign = dnaStorage.findNode(self.code) - if not sign: - sign = NodePath(self.name) - signOrigin = nodePath.find('**/*sign_origin') - if not signOrigin: - signOrigin = nodePath - node = sign.copyTo(signOrigin) - #node.setDepthOffset(50) - node.setPosHprScale(signOrigin, self.pos, self.hpr, self.scale) - node.setPos(node, 0, -0.1, 0) - node.setColor(self.color) - for child in self.children: - child.traverse(node, dnaStorage) - node.flattenStrong() diff --git a/toontown/dna/DNASignBaseline.py b/toontown/dna/DNASignBaseline.py deleted file mode 100644 index 22f9f726..00000000 --- a/toontown/dna/DNASignBaseline.py +++ /dev/null @@ -1,30 +0,0 @@ -from panda3d.core import BamFile, NodePath, StringStream, decompressString -import DNANode - -class DNASignBaseline(DNANode.DNANode): - COMPONENT_CODE = 6 - - def __init__(self): - DNANode.DNANode.__init__(self, '') - self.data = '' - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.data = dgi.getString() - if len(self.data): - self.data = decompressString(self.data) - - def traverse(self, nodePath, dnaStorage): - node = nodePath.attachNewNode('baseline', 0) - node.setPosHpr(self.pos, self.hpr) - node.setPos(node, 0, -0.1, 0) - if self.data: - bf = BamFile() - ss = StringStream() - ss.setData(self.data) - bf.openRead(ss) - signText = NodePath(bf.readNode()) - signText.reparentTo(node) - node.flattenStrong() - for child in self.children: - child.traverse(nodePath, dnaStorage) \ No newline at end of file diff --git a/toontown/dna/DNASignGraphic.py b/toontown/dna/DNASignGraphic.py deleted file mode 100644 index cf120e05..00000000 --- a/toontown/dna/DNASignGraphic.py +++ /dev/null @@ -1,62 +0,0 @@ -from panda3d.core import LVector4f, DecalEffect -import DNANode -import DNAError -import DNAUtil - -class DNASignGraphic(DNANode.DNANode): - COMPONENT_CODE = 8 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - self.width = 0 - self.height = 0 - self.bDefaultColor = True - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setWidth(self, width): - self.width = width - - def getWidth(self): - return self.width - - def setHeight(self, height): - self.height = height - - def getHeight(self): - return self.height - - def setColor(self, color): - self.color = color - self.bDefaultColor = False - - def getColor(self): - return self.Color - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - self.width = dgi.getInt16() / 100.0 - self.height = dgi.getInt16() / 100.0 - self.bDefaultColor = dgi.getBool() - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNASignGraphic code ' + self.code + ' not found in storage') - node = node.copyTo(nodePath, 0) - node.setScale(self.scale) - node.setScale(node, self.getParent().scale) - node.setPosHpr(self.getParent().pos, self.getParent().hpr) - node.setPos(node, 0, -0.1, 0) - node.setColor(self.color) - node.flattenStrong() - for child in self.children: - child.traverse(node, dnaStorage) \ No newline at end of file diff --git a/toontown/dna/DNASignText.py b/toontown/dna/DNASignText.py deleted file mode 100644 index 33f96766..00000000 --- a/toontown/dna/DNASignText.py +++ /dev/null @@ -1,8 +0,0 @@ -import DNANode - -class DNASignText(DNANode.DNANode): - COMPONENT_CODE = 7 - - def __init__(self): - DNANode.DNANode.__init__(self, '') - self.letters = '' \ No newline at end of file diff --git a/toontown/dna/DNAStorage.py b/toontown/dna/DNAStorage.py deleted file mode 100644 index 3026d429..00000000 --- a/toontown/dna/DNAStorage.py +++ /dev/null @@ -1,308 +0,0 @@ -from pandac.PandaModules import * -from DNAError import DNAError -from DNASuitPoint import DNASuitPoint -from DNASuitPath import DNASuitPath -from DNASuitEdge import DNASuitEdge - -class DNAStorage: - def __init__(self): - self.suitPoints = [] - self.suitPointMap = {} - self.DNAGroups = {} - self.DNAVisGroups = [] - self.suitEdges = {} - self.battleCells = [] - self.nodes = {} - self.hoodNodes = {} - self.placeNodes = {} - self.fonts = {} - self.blockTitles = {} - self.blockArticles = {} - self.blockBuildingTypes = {} - self.blockDoors = {} - self.blockNumbers = [] - self.blockZones = {} - self.textures = {} - self.catalogCodes = {} - - def getSuitPath(self, startPoint, endPoint, minPathLen=40, maxPathLen=300): - path = DNASuitPath() - path.addPoint(startPoint) - while path.getNumPoints() < maxPathLen: - startPointIndex = startPoint.getIndex() - if startPointIndex == endPoint.getIndex(): - if path.getNumPoints() >= minPathLen: - break - if startPointIndex not in self.suitEdges: - raise DNAError('Could not find DNASuitPath.') - edges = self.suitEdges[startPointIndex] - for edge in edges: - startPoint = edge.getEndPoint() - startPointType = startPoint.getPointType() - if startPointType != DNASuitPoint.FRONT_DOOR_POINT: - if startPointType != DNASuitPoint.SIDE_DOOR_POINT: - break - else: - raise DNAError('Could not find DNASuitPath.') - path.addPoint(startPoint) - return path - - def getSuitEdgeTravelTime(self, startIndex, endIndex, suitWalkSpeed): - startPoint = self.suitPointMap.get(startIndex) - endPoint = self.suitPointMap.get(endIndex) - if (not startPoint) or (not endPoint): - return 0.0 - distance = (endPoint.getPos()-startPoint.getPos()).length() - return distance / suitWalkSpeed - - def getSuitEdgeZone(self, startIndex, endIndex): - return self.getSuitEdge(startIndex, endIndex).getZoneId() - - def getAdjacentPoints(self, point): - path = DNASuitPath() - startIndex = point.getIndex() - if startIndex not in self.suitEdges: - return path - for edge in self.suitEdges[startIndex]: - path.addPoint(edge.getEndPoint()) - return path - - def storeSuitPoint(self, suitPoint): - if not isinstance(suitPoint, DNASuitPoint): - raise TypeError('suitPoint must be an instance of DNASuitPoint') - self.suitPoints.append(suitPoint) - self.suitPointMap[suitPoint.getIndex()] = suitPoint - - def getSuitPointAtIndex(self, index): - return self.suitPoints[index] - - def getSuitPointWithIndex(self, index): - return self.suitPointMap.get(index) - - def resetSuitPoints(self): - self.suitPoints = [] - self.suitPointMap = {} - self.suitEdges = {} - - def resetTextures(self): - self.textures = {} - - def resetHood(self): - self.resetBlockNumbers() - - def findDNAGroup(self, node): - return self.DNAGroups[node] - - def removeDNAGroup(self, dnagroup): - for node, group in self.DNAGroups.items(): - if group == dnagroup: - del self.DNAGroups[node] - - def resetDNAGroups(self): - self.DNAGroups = {} - - def getNumDNAVisGroups(self): - return len(self.DNAVisGroups) - - def getDNAVisGroupName(self, i): - return self.DNAVisGroups[i].getName() - - def storeDNAVisGroup(self, group): - self.DNAVisGroups.append(group) - - def storeSuitEdge(self, startIndex, endIndex, zoneId): - startPoint = self.getSuitPointWithIndex(startIndex) - endPoint = self.getSuitPointWithIndex(endIndex) - edge = DNASuitEdge(startPoint, endPoint, zoneId) - self.suitEdges.setdefault(startIndex, []).append(edge) - return edge - - def getSuitEdge(self, startIndex, endIndex): - edges = self.suitEdges[startIndex] - for edge in edges: - if edge.getEndPoint().getIndex() == endIndex: - return edge - - def removeBattleCell(self, cell): - self.battleCells.remove(cell) - - def storeBattleCell(self, cell): - self.battleCells.append(cell) - - def resetBattleCells(self): - self.battleCells = [] - - def findNode(self, code): - if code in self.nodes: - return self.nodes[code] - if code in self.hoodNodes: - return self.hoodNodes[code] - if code in self.placeNodes: - return self.placeNodes[code] - - def resetNodes(self): - for node in self.nodes: - self.nodes[node].removeNode() - self.nodes = {} - - def resetHoodNodes(self): - for node in self.hoodNodes: - self.hoodNodes[node].removeNode() - self.hoodNodes = {} - - def resetPlaceNodes(self): - for node in self.placeNodes: - self.placeNodes[node].removeNode() - self.placeNodes = {} - - def storeNode(self, node, code): - self.nodes[code] = node - - def storeHoodNode(self, node, code): - self.hoodNodes[code] = node - - def storePlaceNode(self, node, code): - self.placeNodes[code] = node - - def findFont(self, code): - if code in self.fonts: - return self.fonts[code] - - def resetFonts(self): - self.fonts = {} - - def storeFont(self, font, code): - self.fonts[code] = font - - def getBlock(self, name): - block = name[name.find(':')-2:name.find(':')] - if not block[0].isdigit(): - block = block[1:] - return block - - def getBlockBuildingType(self, blockNumber): - if blockNumber in self.blockBuildingTypes: - return self.blockBuildingTypes[blockNumber] - - def getTitleFromBlockNumber(self, blockNumber): - if blockNumber in self.blockTitles: - return self.blockTitles[blockNumber] - return '' - - def getDoorPosHprFromBlockNumber(self, blockNumber): - key = str(blockNumber) - if key in self.blockDoors: - return self.blockDoors[key] - - def storeBlockDoor(self, blockNumber, door): - self.blockDoors[str(blockNumber)] = door - - def storeBlockTitle(self, blockNumber, title): - self.blockTitles[blockNumber] = title - - def storeBlockArticle(self, blockNumber, article): - self.blockArticles[blockNumber] = article - - def storeBlockBuildingType(self, blockNumber, buildingType): - self.blockBuildingTypes[blockNumber] = buildingType - - def storeBlock(self, blockNumber, title, article, bldgType, zoneId): - self.storeBlockNumber(blockNumber) - self.storeBlockTitle(blockNumber, title) - self.storeBlockArticle(blockNumber, article) - self.storeBlockBuildingType(blockNumber, bldgType) - self.storeBlockZone(blockNumber, zoneId) - - def storeTexture(self, name, texture): - self.textures[name] = texture - - def resetDNAVisGroups(self): - self.DNAVisGroups = [] - - def resetDNAVisGroupsAI(self): - self.resetDNAVisGroups() - - def getNumDNAVisGroupsAI(self): - return self.getNumDNAVisGroups() - - def getNumSuitPoints(self): - return len(self.suitPoints) - - def getNumVisiblesInDNAVisGroup(self, i): - return self.DNAVisGroups[i].getNumVisibles() - - def getVisibleName(self, i, j): - return self.DNAVisGroups[i].getVisibleName(j) - - def getDNAVisGroupAI(self, i): - return self.DNAVisGroups[i] - - def storeCatalogCode(self, category, code): - if not category in self.catalogCodes: - self.catalogCodes[category] = [] - self.catalogCodes[category].append(code) - - def getNumCatalogCodes(self, category): - if category not in self.catalogCodes: - return -1 - return len(self.catalogCodes[category]) - - def resetCatalogCodes(self): - self.catalogCodes = {} - - def getCatalogCode(self, category, index): - return self.catalogCodes[category][index] - - def findTexture(self, name): - if name in self.textures: - return self.textures[name] - - def discoverContinuity(self): - return 1 # TODO - - def resetBlockNumbers(self): - self.blockNumbers = [] - self.blockZones = {} - self.blockArticles = {} - self.resetBlockDoors() - self.blockTitles = {} - self.blockBuildingTypes = {} - - def getNumBlockNumbers(self): - return len(self.blockNumbers) - - def storeBlockNumber(self, blockNumber): - self.blockNumbers.append(blockNumber) - - def getBlockNumberAt(self, index): - return self.blockNumbers[index] - - def getZoneFromBlockNumber(self, blockNumber): - if blockNumber in self.blockZones: - return self.blockZones[blockNumber] - - def storeBlockZone(self, blockNumber, zoneId): - self.blockZones[blockNumber] = zoneId - - def resetBlockZones(self): - self.blockZones = {} - - def resetBlockDoors(self): - self.blockDoors = {} - - def cleanup(self): - self.resetBattleCells() - self.resetBlockNumbers() - self.resetDNAGroups() - self.resetDNAVisGroups() - self.resetDNAVisGroupsAI() - self.resetFonts() - self.resetHood() - self.resetHoodNodes() - self.resetNodes() - self.resetPlaceNodes() - self.resetSuitPoints() - self.resetTextures() - self.resetCatalogCodes() - ModelPool.garbageCollect() - TexturePool.garbageCollect() diff --git a/toontown/dna/DNAStreet.py b/toontown/dna/DNAStreet.py deleted file mode 100644 index 58700268..00000000 --- a/toontown/dna/DNAStreet.py +++ /dev/null @@ -1,121 +0,0 @@ -from panda3d.core import LVector4f -import DNANode -import DNAError -import DNAUtil - -class DNAStreet(DNANode.DNANode): - COMPONENT_CODE = 19 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.code = '' - self.streetTexture = '' - self.sideWalkTexture = '' - self.curbTexture = '' - self.streetColor = LVector4f(1, 1, 1, 1) - self.sidewalkColor = LVector4f(1, 1, 1, 1) - self.curbColor = LVector4f(1, 1, 1, 1) - self.setTexCnt = 0 - self.setColCnt = 0 - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setStreetTexture(self, texture): - self.streetTexture = texture - - def getStreetTexture(self): - return self.streetTexture - - def setSidewalkTexture(self, texture): - self.sidewalkTexture = texture - - def getSidewalkTexture(self): - return self.sidewalkTexture - - def setCurbTexture(self, texture): - self.curbTexture = texture - - def getCurbTexture(self): - return self.curbTexture - - def setStreetColor(self, color): - self.streetColor = color - - def getStreetColor(self): - return self.streetColor - - def setSidewalkColor(self, color): - self.SidewalkColor = color - - def getSidewalkColor(self): - return self.sidewalkColor - - def getCurbColor(self): - return self.curbColor - - def setTextureColor(self, color): - self.Color = color - - def setTexture(self, texture): - if self.setTexCnt == 0: - self.streetTexture = texture - if self.setTexCnt == 1: - self.sidewalkTexture = texture - if self.setTexCnt == 2: - self.curbTexture = texture - self.setTexCnt += 1 - - def setColor(self, color): - if self.setColCnt == 0: - self.streetColor = color - if self.setColCnt == 1: - self.sidewalkColor = color - if self.setColCnt == 2: - self.curbColor = color - self.setColCnt += 1 - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.streetTexture = DNAUtil.dgiExtractString8(dgi) - self.sidewalkTexture = DNAUtil.dgiExtractString8(dgi) - self.curbTexture = DNAUtil.dgiExtractString8(dgi) - self.streetColor = DNAUtil.dgiExtractColor(dgi) - self.sideWalkColor = DNAUtil.dgiExtractColor(dgi) - self.curbColor = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNAStreet code ' + self.code + ' not found in DNAStorage') - nodePath = node.copyTo(nodePath, 0) - node.setName(self.getName()) - streetTexture = dnaStorage.findTexture(self.streetTexture) - sidewalkTexture = dnaStorage.findTexture(self.sidewalkTexture) - curbTexture = dnaStorage.findTexture(self.curbTexture) - if streetTexture is None: - raise DNAError.DNAError('street texture not found in DNAStorage : ' + self.streetTexture) - if sidewalkTexture is None: - raise DNAError.DNAError('sidewalk texture not found in DNAStorage : ' + self.sidewalkTexture) - if curbTexture is None: - raise DNAError.DNAError('curb texture not found in DNAStorage : ' + self.curbTexture) - streetNode = nodePath.find('**/*_street') - sidewalkNode = nodePath.find('**/*_sidewalk') - curbNode = nodePath.find('**/*_curb') - - if not streetNode.isEmpty(): - streetNode.setTexture(streetTexture, 1) - streetNode.setColorScale(self.streetColor, 0) - if not sidewalkNode.isEmpty(): - sidewalkNode.setTexture(sidewalkTexture, 1) - sidewalkNode.setColorScale(self.sidewalkColor, 0) - if not curbNode.isEmpty(): - curbNode.setTexture(curbTexture, 1) - curbNode.setColorScale(self.curbColor, 0) - - nodePath.setPosHprScale(self.getPos(), self.getHpr(), self.getScale()) - nodePath.flattenStrong() diff --git a/toontown/dna/DNASuitEdge.py b/toontown/dna/DNASuitEdge.py deleted file mode 100644 index ed8c4dd7..00000000 --- a/toontown/dna/DNASuitEdge.py +++ /dev/null @@ -1,17 +0,0 @@ -class DNASuitEdge: - def __init__(self, startpt, endpt, zoneId): - self.startpt = startpt - self.endpt = endpt - self.zoneId = zoneId - - def getEndPoint(self): - return self.endpt - - def getStartPoint(self): - return self.startpt - - def getZoneId(self): - return self.zoneId - - def setZoneId(self, zoneId): - self.zoneId = zoneId \ No newline at end of file diff --git a/toontown/dna/DNASuitPath.py b/toontown/dna/DNASuitPath.py deleted file mode 100644 index ded8b4a6..00000000 --- a/toontown/dna/DNASuitPath.py +++ /dev/null @@ -1,18 +0,0 @@ -class DNASuitPath: - def __init__(self): - self.suitPoints = [] - - def getNumPoints(self): - return len(self.suitPoints) - - def getPointIndex(self, pointIndex): - return self.suitPoints[pointIndex].getIndex() - - def addPoint(self, point): - self.suitPoints.append(point) - - def getPoint(self, pointIndex): - return self.suitPoints[pointIndex] - - def reversePath(self): - self.suitPoints.reverse() \ No newline at end of file diff --git a/toontown/dna/DNASuitPoint.py b/toontown/dna/DNASuitPoint.py deleted file mode 100644 index 3b449d2c..00000000 --- a/toontown/dna/DNASuitPoint.py +++ /dev/null @@ -1,89 +0,0 @@ -class DNASuitPoint: - COMPONENT_CODE = 20 - STREET_POINT = 0 - FRONT_DOOR_POINT = 1 - SIDE_DOOR_POINT = 2 - COGHQ_IN_POINT = 3 - COGHQ_OUT_POINT = 4 - - def __init__(self, index, pointType, pos, landmarkBuildingIndex=-1): - self.index = index - self.pointType = pointType - self.pos = pos - self.graphId = 0 - self.landmarkBuildingIndex = landmarkBuildingIndex - - def __str__(self): - pointType = self.getPointType() - if pointType == DNASuitPoint.STREET_POINT: - pointTypeStr = 'STREET_POINT' - elif pointType == DNASuitPoint.FRONT_DOOR_POINT: - pointTypeStr = 'FRONT_DOOR_POINT' - elif pointType == DNASuitPoint.SIDE_DOOR_POINT: - pointTypeStr = 'SIDE_DOOR_POINT' - elif pointType == DNASuitPoint.COGHQ_IN_POINT: - pointTypeStr = 'COGHQ_IN_POINT' - elif pointType == DNASuitPoint.COGHQ_OUT_POINT: - pointTypeStr = 'COGHQ_OUT_POINT' - else: - pointTypeStr = '**invalid**' - return 'DNASuitPoint index: %d, pointType: %s, pos: %s' % ( - self.getIndex(), pointTypeStr, self.getPos()) - - def setIndex(self, index): - self.index = index - - def getIndex(self): - return self.index - - def getGraphId(self): - return self.graphId - - def getLandmarkBuildingIndex(self): - return self.landmarkBuildingIndex - - def getPos(self): - return self.pos - - def isTerminal(self): - return self.pointType <= 2 - - def setGraphId(self, id): - self.graphId = id - - def setLandmarkBuildingIndex(self, index): - self.landmarkBuildingIndex = index - - def setPointType(self, pointType): - if isinstance(pointType, int): - if type == DNASuitPoint.STREET_POINT: - self.pointType = DNASuitPoint.STREET_POINT - elif type == DNASuitPoint.FRONT_DOOR_POINT: - self.pointType = DNASuitPoint.FRONT_DOOR_POINT - elif pointType == DNASuitPoint.SIDE_DOOR_POINT: - self.pointType = DNASuitPoint.SIDE_DOOR_POINT - elif pointType == DNASuitPoint.COGHQ_IN_POINT: - self.pointType = DNASuitPoint.COGHQ_IN_POINT - elif pointType == DNASuitPoint.COGHQ_OUT_POINT: - self.pointType = DNASuitPoint.COGHQ_OUT_POINT - else: - raise TypeError('%i is not a valid DNASuitPointType' % pointType) - elif isinstance(pointType, str): - if type == 'STREET_POINT': - self.pointType = DNASuitPoint.STREET_POINT - elif type == 'FRONT_DOOR_POINT': - self.pointType = DNASuitPoint.FRONT_DOOR_POINT - elif pointType == 'SIDE_DOOR_POINT': - self.pointType = DNASuitPoint.SIDE_DOOR_POINT - elif pointType == 'COGHQ_IN_POINT': - self.pointType = DNASuitPoint.COGHQ_IN_POINT - elif pointType == 'COGHQ_OUT_POINT': - self.pointType = DNASuitPoint.COGHQ_OUT_POINT - else: - raise TypeError('%s is not a valid DNASuitPointType' % pointType) - - def getPointType(self): - return self.pointType - - def setPos(self, pos): - self.pos = pos diff --git a/toontown/dna/DNAUtil.py b/toontown/dna/DNAUtil.py deleted file mode 100644 index 26d2b55b..00000000 --- a/toontown/dna/DNAUtil.py +++ /dev/null @@ -1,9 +0,0 @@ -from panda3d.core import LVector4f - -def dgiExtractString8(dgi): - return dgi.extractBytes(dgi.getUint8()) - -def dgiExtractColor(dgi): - a, b, c, d = (dgi.getUint8() / 255.0 for _ in xrange(4)) - return LVector4f(a, b, c, d) - diff --git a/toontown/dna/DNAVisGroup.py b/toontown/dna/DNAVisGroup.py deleted file mode 100644 index 4a8e5e9d..00000000 --- a/toontown/dna/DNAVisGroup.py +++ /dev/null @@ -1,72 +0,0 @@ -from panda3d.core import LVector3f -import DNAGroup -import DNABattleCell -import DNAUtil - -class DNAVisGroup(DNAGroup.DNAGroup): - COMPONENT_CODE = 2 - - def __init__(self, name): - DNAGroup.DNAGroup.__init__(self, name) - self.visibles = [] - self.suitEdges = [] - self.battleCells = [] - - def getVisGroup(self): - return self - - def addBattleCell(self, battleCell): - self.battleCells.append(battleCell) - - def addSuitEdge(self, suitEdge): - self.suitEdges.append(suitEdge) - - def addVisible(self, visible): - self.visibles.append(visible) - - def getBattleCell(self, i): - return self.battleCells[i] - - def getNumBattleCells(self): - return len(self.battleCells) - - def getNumSuitEdges(self): - return len(self.suitEdges) - - def getNumVisibles(self): - return len(self.visibles) - - def getSuitEdge(self, i): - return self.suitEdges[i] - - def getVisibleName(self, i): - return self.visibles[i] - - def removeBattleCell(self, cell): - self.battleCells.remove(cell) - - def removeSuitEdge(self, edge): - self.suitEdges.remove(edge) - - def removeVisible(self, visible): - self.visibles.remove(visible) - - def makeFromDGI(self, dgi, dnaStorage): - DNAGroup.DNAGroup.makeFromDGI(self, dgi) - - numEdges = dgi.getUint16() - for _ in xrange(numEdges): - index = dgi.getUint16() - endPoint = dgi.getUint16() - self.addSuitEdge(dnaStorage.getSuitEdge(index, endPoint)) - - numVisibles = dgi.getUint16() - for _ in xrange(numVisibles): - self.addVisible(DNAUtil.dgiExtractString8(dgi)) - - numCells = dgi.getUint16() - for _ in xrange(numCells): - w = dgi.getUint8() - h = dgi.getUint8() - x, y, z = [dgi.getInt32() / 100.0 for i in xrange(3)] - self.addBattleCell(DNABattleCell.DNABattleCell(w, h, LVector3f(x, y, z))) \ No newline at end of file diff --git a/toontown/dna/DNAWall.py b/toontown/dna/DNAWall.py deleted file mode 100644 index e28cd85b..00000000 --- a/toontown/dna/DNAWall.py +++ /dev/null @@ -1,52 +0,0 @@ -from panda3d.core import LVector4f -import DNANode -import DNAFlatBuilding -import DNAError -import DNAUtil - -class DNAWall(DNANode.DNANode): - COMPONENT_CODE = 10 - - def __init__(self, name): - DNANode.DNANode.__init__(self, name) - self.code = '' - self.height = 10 - self.color = LVector4f(1, 1, 1, 1) - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setColor(self, color): - self.color = color - - def getColor(self): - return self.color - - def setHeight(self, height): - self.height = height - - def getHeight(self): - return self.height - - def makeFromDGI(self, dgi): - DNANode.DNANode.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.height = dgi.getInt16() / 100.0 - self.color = DNAUtil.dgiExtractColor(dgi) - - def traverse(self, nodePath, dnaStorage): - node = dnaStorage.findNode(self.code) - if node is None: - raise DNAError.DNAError('DNAWall code ' + self.code + ' not found in DNAStorage') - node = node.copyTo(nodePath, 0) - self.pos.setZ(DNAFlatBuilding.DNAFlatBuilding.currentWallHeight) - self.scale.setZ(self.height) - node.setPosHprScale(self.pos, self.hpr, self.scale) - node.setColor(self.color) - for child in self.children: - child.traverse(node, dnaStorage) - node.flattenStrong() - DNAFlatBuilding.DNAFlatBuilding.currentWallHeight += self.height \ No newline at end of file diff --git a/toontown/dna/DNAWindows.py b/toontown/dna/DNAWindows.py deleted file mode 100644 index d3d5f92c..00000000 --- a/toontown/dna/DNAWindows.py +++ /dev/null @@ -1,103 +0,0 @@ -from panda3d.core import LVector4f, NodePath, DecalEffect -import DNAGroup -import DNAError -import DNAUtil - -import random - -class DNAWindows(DNAGroup.DNAGroup): - COMPONENT_CODE = 11 - - def __init__(self, name): - DNAGroup.DNAGroup.__init__(self, name) - self.code = '' - self.color = LVector4f(1, 1, 1, 1) - self.windowCount = 0 - - def setCode(self, code): - self.code = code - - def getCode(self): - return self.code - - def setColor(self, color): - self.color = color - - def getColor(self): - return self.color - - def setWindowCount(self, windowCount): - self.windowCount = windowCount - - def getWindowCount(self): - return self.windowCount - - @staticmethod - def setupWindows(parentNode, dnaStorage, code, windowCount, color, hpr, - scale): - stripped = code[:-1] - node_r = dnaStorage.findNode(stripped + 'r') - node_l = dnaStorage.findNode(stripped + 'l') - if (node_r is None) or (node_l is None): - raise DNAError.DNAError('DNAWindows code %s not found in' - 'DNAStorage' % code) - - def makeWindow(x, y, z, parentNode, color, scale, hpr, flip=False): - node = node_r if not flip else node_l - window = node.copyTo(parentNode, 0) - window.setColor(color) - window.setScale(NodePath(), scale) - window.setHpr(hpr) - window.setPos(x, 0, z) - window.setEffect(DecalEffect.make()) - window.flattenStrong() - - offset = lambda: random.random() % 0.0375 - if windowCount == 1: - makeWindow(offset() + 0.5, 0, offset() + 0.5, - parentNode, color, scale, hpr) - elif windowCount == 2: - makeWindow(offset() + 0.33, 0, offset() + 0.5, - parentNode, color, scale, hpr) - makeWindow(offset() + 0.66, 0, offset() + 0.5, - parentNode, color, scale, hpr, True) - elif windowCount == 3: - makeWindow(offset() + 0.33, 0, offset() + 0.66, - parentNode, color, scale, hpr) - makeWindow(offset() + 0.66, 0, offset() + 0.66, - parentNode, color, scale, hpr, True) - makeWindow(offset() + 0.5, 0, offset() + 0.33, - parentNode, color, scale, hpr) - elif windowCount == 4: - makeWindow(offset() + 0.33, 0, offset() + 0.25, - parentNode, color, scale, hpr) - makeWindow(offset() + 0.66, 0, offset() + 0.25, - parentNode, color, scale, hpr, True) - makeWindow(offset() + 0.33, 0, offset() + 0.66, - parentNode, color, scale, hpr) - makeWindow(offset() + 0.66, 0, offset() + 0.66, - parentNode, color, scale, hpr, True) - else: - raise NotImplementedError('Invalid window count ' + str(windowCount)) - - def makeFromDGI(self, dgi): - DNAGroup.DNAGroup.makeFromDGI(self, dgi) - self.code = DNAUtil.dgiExtractString8(dgi) - self.color = DNAUtil.dgiExtractColor(dgi) - self.windowCount = dgi.getUint8() - - def traverse(self, nodePath, dnaStorage): - if self.getWindowCount() == 0: - return - parentX = nodePath.getParent().getScale().getX() - scale = random.random() % 0.0375 - if parentX <= 5.0: - scale += 1.0 - elif parentX <= 10.0: - scale += 1.15 - else: - scale += 1.3 - hpr = (0, 0, 0) - DNAWindows.setupWindows(nodePath, dnaStorage, self.getCode(), - self.getWindowCount(), self.getColor(), hpr, - scale) \ No newline at end of file diff --git a/toontown/estate/DistributedHouse.py b/toontown/estate/DistributedHouse.py index 2b4cccec..2ba6f396 100644 --- a/toontown/estate/DistributedHouse.py +++ b/toontown/estate/DistributedHouse.py @@ -19,7 +19,7 @@ from toontown.hood import Place import HouseGlobals from toontown.building import ToonInteriorColors from direct.showbase.MessengerGlobal import messenger -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * from toontown.nametag.NametagGroup import NametagGroup from toontown.nametag.Nametag import Nametag @@ -115,7 +115,7 @@ class DistributedHouse(DistributedObject.DistributedObject): self.randomGenerator.seed(self.doId) houseColor = HouseGlobals.stairWood color = Vec4(houseColor[0], houseColor[1], houseColor[2], 1) - DNADoor.setupDoor(doorNP, door_origin, door_origin, self.dnaStore, str(self.doId), color) + setupDoor(doorNP, door_origin, door_origin, self.dnaStore, str(self.doId), color) self.__setupNamePlate() self.__setupFloorMat() self.__setupNametag() diff --git a/toontown/estate/DistributedHouseInterior.py b/toontown/estate/DistributedHouseInterior.py index 0f932e7c..136b5da1 100644 --- a/toontown/estate/DistributedHouseInterior.py +++ b/toontown/estate/DistributedHouseInterior.py @@ -13,7 +13,7 @@ from toontown.catalog import CatalogWallpaperItem from toontown.catalog import CatalogFlooringItem from toontown.catalog import CatalogMouldingItem from toontown.catalog import CatalogWainscotingItem -from toontown.dna.DNAParser import DNADoor +from toontown.dna.DNAParser import * WindowPlugNames = ('**/windowcut_a*', '**/windowcut_b*', '**/windowcut_c*', '**/windowcut_d*', '**/windowcut_e*', '**/windowcut_f*') RoomNames = ('**/group2', '**/group1') WallNames = ('ceiling*', 'wall_side_middle*', 'wall_front_middle*', 'windowcut_*') @@ -66,7 +66,7 @@ class DistributedHouseInterior(DistributedObject.DistributedObject): doorNP = door.copyTo(door_origin) houseColor = HouseGlobals.atticWood color = Vec4(houseColor[0], houseColor[1], houseColor[2], 1) - DNADoor.setupDoor(doorNP, door_origin, door_origin, dnaStore, str(self.houseId), color) + setupDoor(doorNP, door_origin, door_origin, dnaStore, str(self.houseId), color) doorFrame = doorNP.find('door_*_flat') doorFrame.setColor(color) self.interior.flattenMedium() diff --git a/toontown/pets/PetNameGenerator.py b/toontown/pets/PetNameGenerator.py deleted file mode 100644 index a7a5bcbd..00000000 --- a/toontown/pets/PetNameGenerator.py +++ /dev/null @@ -1,88 +0,0 @@ -import random -from toontown.toonbase import ToontownGlobals -from toontown.toonbase import TTLocalizer -import os -from direct.showbase import AppRunnerGlobal -from direct.directnotify import DirectNotifyGlobal -from pandac.PandaModules import * - -class PetNameGenerator: - notify = DirectNotifyGlobal.directNotify.newCategory('PetNameGenerator') - boyFirsts = [] - girlFirsts = [] - neutralFirsts = [] - - def __init__(self): - self.generateLists() - - def generateLists(self): - self.boyFirsts = [] - self.girlFirsts = [] - self.neutralFirsts = [] - self.nameDictionary = {} - searchPath = DSearchPath() - if AppRunnerGlobal.appRunner: - searchPath.appendDirectory(Filename.expandFrom('$TT_3_ROOT/phase_3/etc')) - else: - searchPath.appendDirectory(Filename('/phase_3/etc')) - if os.path.expandvars('$TOONTOWN') != '': - searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$TOONTOWN/src/configfiles'))) - else: - searchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('toontown/src/configfiles'))) - searchPath.appendDirectory(Filename('.')) - if __debug__: - filename = '../resources/phase_3/etc/'+TTLocalizer.PetNameMaster - else: - filename = '/phase_3/etc/'+TTLocalizer.PetNameMaster - input = open(filename, 'r') - if not input: - self.notify.error('PetNameGenerator: Error opening name list text file.') - currentLine = input.readline() - while currentLine: - if currentLine.lstrip()[0:1] != '#': - a1 = currentLine.find('*') - a2 = currentLine.find('*', a1 + 1) - self.nameDictionary[int(currentLine[0:a1])] = (int(currentLine[a1 + 1:a2]), currentLine[a2 + 1:len(currentLine) - 1].strip()) - currentLine = input.readline() - - masterList = [self.boyFirsts, self.girlFirsts, self.neutralFirsts] - for tu in self.nameDictionary.values(): - masterList[tu[0]].append(tu[1]) - - return 1 - - def getName(self, uniqueID): - try: - return self.nameDictionary[uniqueID][1] - except: - return self.nameDictionary[0][1] - - def returnUniqueID(self, name): - newtu = [(), (), ()] - newtu[0] = (0, name) - newtu[1] = (1, name) - newtu[2] = (2, name) - for tu in self.nameDictionary.items(): - for g in newtu: - if tu[1] == g: - return tu[0] - - return -1 - - def randomName(self, gender = None, seed = None): - S = random.getstate() - if seed is not None: - random.seed(seed) - if gender is None: - gender = random.choice([0, 1]) - retString = '' - firstList = self.neutralFirsts[:] - if gender == 0: - firstList += self.boyFirsts - elif gender == 1: - firstList += self.girlFirsts - else: - self.error('Must be boy or girl.') - retString += random.choice(firstList) - random.setstate(S) - return retString diff --git a/toontown/pets/PetUtil.py b/toontown/pets/PetUtil.py index c7afbcfa..8eb1c11a 100644 --- a/toontown/pets/PetUtil.py +++ b/toontown/pets/PetUtil.py @@ -1,16 +1,12 @@ from toontown.pets import PetDNA, PetTraits, PetConstants -from toontown.pets import PetNameGenerator +from toontown.toonbase import TTLocalizer from direct.showbase import PythonUtil -import random def getPetInfoFromSeed(seed, safezoneId): - S = random.getstate() - random.seed(seed) dnaArray = PetDNA.getRandomPetDNA(safezoneId) gender = PetDNA.getGender(dnaArray) - nameString = PetNameGenerator.PetNameGenerator().randomName(gender=gender, seed=seed + safezoneId) + nameString = TTLocalizer.getRandomPetName(gender=gender, seed=seed + safezoneId) traitSeed = PythonUtil.randUint31() - random.setstate(S) return (nameString, dnaArray, traitSeed) diff --git a/toontown/pets/PetshopGUI.py b/toontown/pets/PetshopGUI.py index b19e827f..caaf1a99 100644 --- a/toontown/pets/PetshopGUI.py +++ b/toontown/pets/PetshopGUI.py @@ -10,7 +10,6 @@ from toontown.hood import ZoneUtil from toontown.pets import Pet, PetConstants from toontown.pets import PetDNA from toontown.pets import PetDetail -from toontown.pets import PetNameGenerator from toontown.pets import PetTraits from toontown.pets import PetUtil from toontown.toonbase import TTLocalizer @@ -66,14 +65,12 @@ class PetshopGUI(DirectObject): self.petModel.reparentTo(self.petView) self.petModel.setH(225) self.petModel.enterNeutralHappy() - self.ng = PetNameGenerator.PetNameGenerator() - if gender == 1: - self.allNames = self.ng.boyFirsts + self.allNames = TTLocalizer.NeutralPetNames + if gender == 0: + self.allNames += TTLocalizer.BoyPetNames else: - self.allNames = self.ng.girlFirsts - self.allNames += self.ng.neutralFirsts + self.allNames += TTLocalizer.GirlPetNames self.allNames.sort() - self.checkNames() self.letters = [] for name in self.allNames: if name[0:TTLocalizer.PGUIcharLength] not in self.letters: @@ -87,7 +84,7 @@ class PetshopGUI(DirectObject): self.rebuildNameList() self.randomButton = DirectButton(parent=self, relief=None, image=(self.gui.find('**/RandomUpButton'), self.gui.find('**/RandomDownButton'), self.gui.find('**/RandomRolloverButton')), scale=self.guiScale, text=TTLocalizer.RandomButton, text_pos=(-0.8, -5.7), text_scale=0.8, text_fg=text2Color, pressEffect=False, command=self.randomName) self.nameResult = DirectLabel(parent=self, relief=None, scale=self.guiScale, text='', text_align=TextNode.ACenter, text_pos=(-1.85, 2.6), text_fg=text0Color, text_scale=0.6, text_wordwrap=8) - self.submitButton = DirectButton(parent=self, relief=None, image=(self.gui.find('**/SubmitUpButton'), self.gui.find('**/SubmitDownButton'), self.gui.find('**/SubmitRolloverButton')), scale=self.guiScale, text=TTLocalizer.PetshopAdopt, text_pos=(3.3, -5.7), text_scale=TTLocalizer.PGUIsubmitButton, text_fg=text0Color, pressEffect=False, command=lambda : messenger.send(doneEvent, [self.ng.returnUniqueID(self.curName)])) + self.submitButton = DirectButton(parent=self, relief=None, image=(self.gui.find('**/SubmitUpButton'), self.gui.find('**/SubmitDownButton'), self.gui.find('**/SubmitRolloverButton')), scale=self.guiScale, text=TTLocalizer.PetshopAdopt, text_pos=(3.3, -5.7), text_scale=TTLocalizer.PGUIsubmitButton, text_fg=text0Color, pressEffect=False, command=lambda : messenger.send(doneEvent, [TTLocalizer.getPetNameId(self.curName)])) model = loader.loadModel('phase_4/models/gui/PetShopInterface') modelScale = 0.1 cancelImageList = (model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelButtonRollover')) @@ -95,12 +92,6 @@ class PetshopGUI(DirectObject): self.cancelButton = DirectButton(parent=self, relief=None, pos=(-0.04, 0, -0.47), image=cancelImageList, geom=cancelIcon, scale=modelScale, pressEffect=False, command=lambda : messenger.send(doneEvent, [-1])) self.randomName() - def checkNames(self): - if __dev__: - for name in self.allNames: - if not name.replace(' ', '').isalpha(): - self.notify.warning('Bad name:%s' % name) - def destroy(self): self.petModel.delete() DirectFrame.destroy(self) @@ -208,7 +199,7 @@ class PetshopGUI(DirectObject): def __init__(self, doneEvent, petSeed, petNameIndex): zoneId = ZoneUtil.getCanonicalSafeZoneId(base.localAvatar.getZoneId()) name, dna, traitSeed = PetUtil.getPetInfoFromSeed(petSeed, zoneId) - name = PetNameGenerator.PetNameGenerator().getName(petNameIndex) + name = TTLocalizer.getPetName(petNameIndex) cost = PetUtil.getPetCostFromSeed(petSeed, zoneId) model = loader.loadModel('phase_4/models/gui/AdoptPet') modelPos = (0, 0, -0.3) diff --git a/toontown/suit/DistributedSuit.py b/toontown/suit/DistributedSuit.py index 66b3e1de..d0ae7471 100644 --- a/toontown/suit/DistributedSuit.py +++ b/toontown/suit/DistributedSuit.py @@ -24,7 +24,7 @@ from toontown.chat.ChatGlobals import * from toontown.distributed.DelayDeletable import DelayDeletable from toontown.nametag import NametagGlobals from toontown.nametag.NametagGlobals import * -from toontown.suit.SuitLegList import * +from libpandadna import * from toontown.toonbase import ToontownGlobals @@ -56,7 +56,7 @@ class DistributedSuit(DistributedSuitBase.DistributedSuitBase, DelayDeletable): self.pathState = 0 self.path = None self.localPathState = 0 - self.currentLeg = -1 + self.currentLeg = 0 self.pathStartTime = 0.0 self.legList = None self.initState = None @@ -220,7 +220,7 @@ class DistributedSuit(DistributedSuitBase.DistributedSuitBase, DelayDeletable): self.maxPathLen = maxPathLen self.path = None self.pathLength = 0 - self.currentLeg = -1 + self.currentLeg = 0 self.legList = None if self.maxPathLen == 0 or not self.verifySuitPlanner() or start not in self.sp.pointIndexes or end not in self.sp.pointIndexes: return @@ -343,13 +343,13 @@ class DistributedSuit(DistributedSuitBase.DistributedSuitBase, DelayDeletable): return Task.done def doPathLeg(self, leg, time): - self.fsm.request(leg.getTypeName(), [leg, time]) + self.fsm.request(SuitLeg.getTypeName(leg.getType()), [leg, time]) return 0 def stopPathNow(self): name = self.taskName('move') taskMgr.remove(name) - self.currentLeg = -1 + self.currentLeg = 0 def calculateHeading(self, a, b): xdelta = b[0] - a[0] diff --git a/toontown/suit/DistributedSuitAI.py b/toontown/suit/DistributedSuitAI.py index 561fb010..8a526830 100644 --- a/toontown/suit/DistributedSuitAI.py +++ b/toontown/suit/DistributedSuitAI.py @@ -8,7 +8,7 @@ import SuitPlannerBase import SuitBase import SuitDialog import SuitDNA -from SuitLegList import * +from libpandadna import * from direct.directnotify import DirectNotifyGlobal from toontown.battle import SuitBattleGlobals from toontown.building import FADoorCodes @@ -364,4 +364,4 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI): self.sp.cogdoTakeOver(blockNumber, difficulty, self.buildingHeight) else: dept = SuitDNA.getSuitDept(self.dna.name) - self.sp.suitTakeOver(blockNumber, dept, difficulty, self.buildingHeight) \ No newline at end of file + self.sp.suitTakeOver(blockNumber, dept, difficulty, self.buildingHeight) diff --git a/toontown/suit/DistributedSuitPlannerAI.py b/toontown/suit/DistributedSuitPlannerAI.py index fc026769..7e8688e9 100644 --- a/toontown/suit/DistributedSuitPlannerAI.py +++ b/toontown/suit/DistributedSuitPlannerAI.py @@ -15,7 +15,7 @@ from toontown.building import SuitBuildingGlobals from toontown.dna.DNAParser import DNASuitPoint from toontown.hood import ZoneUtil from toontown.suit.SuitInvasionGlobals import IFSkelecog, IFWaiter, IFV2 -from toontown.suit.SuitLegList import * +from libpandadna import * from toontown.toon import NPCToons from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownGlobals diff --git a/toontown/suit/SuitBase.py b/toontown/suit/SuitBase.py index 561d3726..a26deb37 100644 --- a/toontown/suit/SuitBase.py +++ b/toontown/suit/SuitBase.py @@ -1,5 +1,5 @@ import SuitDNA -from SuitLegList import * +from libpandadna import * import SuitTimings from direct.directnotify import DirectNotifyGlobal from direct.distributed.ClockDelta import * diff --git a/toontown/suit/SuitLegList.py b/toontown/suit/SuitLegList.py deleted file mode 100644 index 3f65174e..00000000 --- a/toontown/suit/SuitLegList.py +++ /dev/null @@ -1,225 +0,0 @@ -from toontown.dna.DNAParser import DNASuitPoint -from toontown.suit import SuitTimings -from toontown.toonbase import ToontownGlobals - - -class SuitLeg: - TWalkFromStreet = 0 - TWalkToStreet = 1 - TWalk = 2 - TFromSky = 3 - TToSky = 4 - TFromSuitBuilding = 5 - TToSuitBuilding = 6 - TToToonBuilding = 7 - TFromCogHQ = 8 - TToCogHQ = 9 - TOff = 10 - TypeToName = { - TWalkFromStreet: 'WalkFromStreet', - TWalkToStreet: 'WalkToStreet', - TWalk: 'Walk', - TFromSky: 'FromSky', - TToSky: 'ToSky', - TFromSuitBuilding: 'FromSuitBuilding', - TToSuitBuilding: 'ToSuitBuilding', - TToToonBuilding: 'ToToonBuilding', - TFromCogHQ: 'FromCogHQ', - TToCogHQ: 'ToCogHQ', - TOff: 'Off' - } - - def __init__(self, startTime, zoneId, blockNumber, pointA, pointB, type): - self.startTime = startTime - self.zoneId = zoneId - self.blockNumber = blockNumber - self.pointA = pointA - self.pointB = pointB - self.type = type - - self.posA = self.pointA.getPos() - self.posB = self.pointB.getPos() - - distance = (self.posB - self.posA).length() - self.legTime = distance / ToontownGlobals.SuitWalkSpeed - self.endTime = self.startTime + self.getLegTime() - - def getStartTime(self): - return self.startTime - - def getZoneId(self): - return self.zoneId - - def getBlockNumber(self): - return self.blockNumber - - def getPointA(self): - return self.pointA - - def getPointB(self): - return self.pointB - - def getType(self): - return self.type - - def getPosA(self): - return self.posA - - def getPosB(self): - return self.posB - - def getLegTime(self): - if self.type in (SuitLeg.TWalk, SuitLeg.TWalkFromStreet, - SuitLeg.TWalkToStreet): - return self.legTime - if self.type == SuitLeg.TFromSky: - return SuitTimings.fromSky - if self.type == SuitLeg.TToSky: - return SuitTimings.toSky - if self.type == SuitLeg.TFromSuitBuilding: - return SuitTimings.fromSuitBuilding - if self.type == SuitLeg.TToSuitBuilding: - return SuitTimings.toSuitBuilding - if self.type in (SuitLeg.TToToonBuilding, SuitLeg.TToCogHQ, - SuitLeg.TFromCogHQ): - return SuitTimings.toToonBuilding - return 0.0 - - def getEndTime(self): - return self.endTime - - def getPosAtTime(self, time): - if self.type in (SuitLeg.TFromSky, SuitLeg.TFromSuitBuilding, - SuitLeg.TFromCogHQ): - return self.posA - elif self.type in (SuitLeg.TToSky, SuitLeg.TToSuitBuilding, - SuitLeg.TToToonBuilding, SuitLeg.TToCogHQ, - SuitLeg.TOff): - return self.posB - - delta = self.posB - self.posA - return self.posA + (delta * (time/self.getLegTime())) - - def getTypeName(self): - if self.type in SuitLeg.TypeToName: - return SuitLeg.TypeToName[self.type] - return '**invalid**' - - -class SuitLegList: - def __init__(self, path, dnaStore): - self.path = path - self.dnaStore = dnaStore - - self.legs = [] - - # First, add the initial SuitLeg: - self.add(self.path.getPoint(0), self.path.getPoint(1), self.getFirstLegType()) - - # Next, connect each of the points in our path through SuitLegs: - for i in xrange(self.path.getNumPoints() - 1): - pointA = self.path.getPoint(i) - pointB = self.path.getPoint(i + 1) - pointTypeA = pointA.getPointType() - pointTypeB = pointB.getPointType() - legType = self.getLegType(pointTypeA, pointTypeB) - - if pointTypeA == DNASuitPoint.COGHQ_OUT_POINT: - # We're going out of a door, so we'll need to insert a door - # leg before the move: - self.add(pointA, pointB, SuitLeg.TFromCogHQ) - - self.add(pointA, pointB, legType) - - if pointTypeB == DNASuitPoint.COGHQ_IN_POINT: - # We're going into a door, so we'll need to insert a door leg - # after the move: - self.add(pointA, pointB, SuitLeg.TToCogHQ) - - # Add the last SuitLeg: - numPoints = self.path.getNumPoints() - pointA = self.path.getPoint(numPoints - 2) - pointB = self.path.getPoint(numPoints - 1) - self.add(pointA, pointB, self.getLastLegType()) - - # Finally, take down the suit: - self.add(pointA, pointB, SuitLeg.TOff) - - def add(self, pointA, pointB, legType): - zoneId = self.dnaStore.getSuitEdgeZone(pointA.getIndex(), pointB.getIndex()) - landmarkBuildingIndex = pointB.getLandmarkBuildingIndex() - if landmarkBuildingIndex == -1: - landmarkBuildingIndex = pointA.getLandmarkBuildingIndex() - startTime = 0.0 - if len(self.legs) > 0: - startTime = self.legs[-1].getEndTime() - leg = SuitLeg(startTime, zoneId, landmarkBuildingIndex, pointA, pointB, legType) - self.legs.append(leg) - - def getFirstLegType(self): - if self.path.getPoint(0).getPointType() == DNASuitPoint.SIDE_DOOR_POINT: - return SuitLeg.TFromSuitBuilding - else: - return SuitLeg.TFromSky - - def getLegType(self, pointTypeA, pointTypeB): - if pointTypeA in (DNASuitPoint.FRONT_DOOR_POINT, - DNASuitPoint.SIDE_DOOR_POINT): - return SuitLeg.TWalkToStreet - if pointTypeB in (DNASuitPoint.FRONT_DOOR_POINT, - DNASuitPoint.SIDE_DOOR_POINT): - return SuitLeg.TWalkFromStreet - return SuitLeg.TWalk - - def getLastLegType(self): - endPoint = self.path.getPoint(self.path.getNumPoints() - 1) - endPointType = endPoint.getPointType() - if endPointType == DNASuitPoint.FRONT_DOOR_POINT: - return SuitLeg.TToToonBuilding - if endPointType == DNASuitPoint.SIDE_DOOR_POINT: - return SuitLeg.TToSuitBuilding - return SuitLeg.TToSky - - def getNumLegs(self): - return len(self.legs) - - def getLeg(self, index): - return self.legs[index] - - def getType(self, index): - return self.legs[index].getType() - - def getLegTime(self, index): - return self.legs[index].getLegTime() - - def getZoneId(self, index): - return self.legs[index].getZoneId() - - def getBlockNumber(self, index): - return self.legs[index].getBlockNumber() - - def getPointA(self, index): - return self.legs[index].getPointA() - - def getPointB(self, index): - return self.legs[index].getPointB() - - def getStartTime(self, index): - return self.legs[index].getStartTime() - - def getLegIndexAtTime(self, time, startLegIndex): - for i, leg in enumerate(self.legs): - if leg.getEndTime() > time: - break - return i - - def isPointInRange(self, point, lowTime, highTime): - legIndex = self.getLegIndexAtTime(lowTime, 0) - while legIndex < self.getNumLegs(): - leg = self.legs[legIndex] - if leg.getEndTime() > highTime: - break - if (leg.pointA == point) or (leg.pointB == point): - return True - legIndex += 1 - return False diff --git a/toontown/toon/DistributedNPCPetclerkAI.py b/toontown/toon/DistributedNPCPetclerkAI.py index bbd0c134..46a620fd 100644 --- a/toontown/toon/DistributedNPCPetclerkAI.py +++ b/toontown/toon/DistributedNPCPetclerkAI.py @@ -104,7 +104,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI): if av.petId != 0: simbase.air.petMgr.deleteToonsPet(avId) gender = petNum % len(PetDNA.PetGenders) - if nameIndex not in xrange(0, TTLocalizer.PetNameIndexMAX): + if nameIndex not in xrange(0, len(TTLocalizer.PetNameDictionary) - 1): self.air.writeServerEvent('avoid_crash', avId, "DistributedNPCPetclerkAI.petAdopted and didn't have valid nameIndex!") self.notify.warning("somebody called petAdopted and didn't have valid nameIndex to adopt! avId: %s" % avId) return diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 44624226..15994b99 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -1,6 +1,7 @@ from toontown.toonbase.TTLocalizerEnglishProperty import * from toontown.catalog import CatalogAccessoryItemGlobals from otp.otpbase import OTPLocalizer as OL +import random OL.SpeedChatStaticText = OL.SpeedChatStaticTextToontown.copy() for key in OL.SpeedChatStaticTextCommon.iterkeys(): OL.SpeedChatStaticText[key] = OL.SpeedChatStaticTextCommon[key] @@ -5362,8 +5363,6 @@ PickAName = 'Try the PickAName game!\nClick here -->' PickANameButton = 'Pick-A-Name' RejectNameText = 'That name is not allowed. Please try again.' WaitingForNameSubmission = 'Submitting your name...' -PetNameMaster = 'PetNameMasterEnglish.txt' -PetNameIndexMAX = 2713 PetshopUnknownName = 'Name: ???' PetshopDescGender = 'Gender:\t%s' PetshopDescCost = 'Cost:\t%s Jellybeans' @@ -9773,3 +9772,40 @@ def getBuffString(buffId, buffTime): def getBuffPosterString(buffId): return buffIdStrings[buffId][1] + +BoyPetNames = ['Achilles', 'Adolfo', 'Adonis', 'Aesop', 'Agamemnon', 'Ahab', 'Ahmed', 'Ajax', 'Alastair', 'Alberto', 'Alexander', 'Alfonso', 'Alonzo', 'Amadeus', 'Ambrose', 'Andre', 'Angelo', 'Angus', 'Antoine', 'Anton', 'Antonio', 'Archibald', 'Archimedes', 'Arnold', 'Atilla', 'Attaboy', 'Avi', 'Barney', 'Bart', 'Bartleby', 'Basil', 'Baxter', 'Beardsley', 'Beauchamp', 'Beauregard', 'Ben', 'Benny', 'Bernie', 'Billygoat', 'Bluebeard', 'Bo', 'Bogart', 'Bogie', 'Bowser', 'Brando', 'Bruce', 'Bruno', 'Brutus', 'Bubba', 'Buck', 'Buster', 'Butch', 'Cagney', 'Carlton', 'Casanova', 'Casper', 'Cecil', 'Cedric', 'Charlie', 'Chekhov', 'Chico', 'Chief', 'Chip', 'Chuck', 'Chuckie', 'Chucko', 'Clancy', 'Clark', 'Claude', 'Clayton', 'Cliff', 'Clive', 'Clyde', 'Cody', 'Colonel', 'Confucius', 'Conrad', 'Cooper', 'Cowboy', 'Cyril', 'Dagwood', 'Dante', 'Deano', 'Donahue', 'Donatello', 'Drysdale', 'Duke', 'Dweezil', 'Eddie', 'Edgar', 'Edison', 'Eggman', 'Einstein', 'Elmer', 'Elwood', 'Emerson', 'Emmet', 'Errol', 'Ethan', 'Fafnir', 'Farnsworth', 'Felix', 'Fenimore', 'Fenwick', 'Ferdinand', 'Fergus', 'Fido', 'Figaro', 'Filbert', 'Fitzgerald', 'Floyd', 'Frampton', 'Fred', 'Gabriel', 'Garfunkel', 'General', 'Genghis', 'Gershwin', 'Gladiator', 'Gladstone', 'Gorilla', 'Grampa', 'Gramps', 'Groucho', 'Gulliver', 'Gunther', 'Gus', 'Hamlet', 'Harold', 'Harpo', 'Harvey', 'Haseltine', 'Heathcliff', 'Hector', 'Hemingway', 'Hendrix', 'Herbert', 'Hercules', 'Herman', 'Hermes', 'Higgins', 'Hobart', 'Homestar', 'Horace', 'Horatio', 'Horton', 'Houdini', 'Humphrey', 'Ichabod', 'Iggy', 'Ignatius', 'Ignatz', 'Igor', 'Ike', 'Iron Ike', 'Ironside', 'Irving', 'Irwin', 'Isaac', 'Ishmael', 'Ivan', 'Ivanhoe', 'Jack', 'Jake', 'Jasper', 'Jaymo', 'Jerry', 'Jethro', 'Jimmy', 'Jonah', 'Karloff', 'Kasper', 'Keanu', 'Kilroy', 'King', 'Kingfish', 'Kirby', 'Kissinger', 'Lambert', 'Lancelot', 'Lazarus', 'Leonardo', 'Lindbergh', 'Linus', 'Lionel', 'Luigi', 'Macarthur', 'Macbeth', 'Mack', 'Malcolm', 'Mandrake', 'Marcel', 'Marco', 'Mario', 'Marmalade', 'Matador', 'Maurice', 'Maximilian', 'Maxwell', 'Maynard', 'Melville', 'Merlin', 'Michelangelo', 'Milo', 'Moe', 'Morissey', 'Mortimer', 'Mozart', 'Mugsy', 'Muldoon', 'Nabokov', 'Napoleon', 'Narcissus', 'Nelson', 'Nero', 'Nimoy', 'Nimrod', 'Norbert', 'Norman', 'Norris', 'Obadiah', 'Odysseus', 'Ogden', 'Olaf', 'Omar', 'Opie', 'Opus', 'Oswald', 'Othello', 'Otto', 'Pablo', 'Paco', 'Paddington', 'Pancho', 'Paolo', 'Pappy', 'Pavarotti', 'Pavlov', 'Peabody', 'Petey', 'Picasso', 'Pierre', 'Pinkerton', 'Pippin', 'Poindexter', 'Pop', 'Popperton', 'Poseidon', 'Prince', 'Puccini', 'Puck', 'Pugsly', 'Pushkin', 'Quigley', 'Quimby', 'Quincy', 'Reggie', 'Regis', 'Reinhold', 'Rembrandt', 'Renoir', 'Reuben', 'Rex', 'Rhett', 'Ricardo', 'Richter', 'Rocky', 'Roderick', 'Romeo', 'Romulus', 'Roosevelt', 'Rover', 'Rudolph', 'Rudy', 'Rufus', 'Rupert', 'Salvador', 'Sandeep', 'Schubert', 'Scooby', 'Scotty', 'Scruffy', 'Sebastian', 'Seymour', 'Shakespeare', 'Shatner', 'Siegfried', 'Sigmund', 'Simon', 'Sinbad', 'Skyler', 'Snowman', 'Snyder', 'Socrates', 'Sorcerer', 'Spalding', 'Spanky', 'Spencer', 'Spinoza', 'Spock', 'Stallion', 'Steinbeck', 'Stradivarius', 'T Bone', 'Tchaikovsky', 'Terminator', 'Tesla', 'Thaxter', 'Theo', 'Theodore', 'Thessalus', 'Throckmorton', 'Tiberius', 'Tiger', 'Tobias', 'Tolkein', 'Toreador', 'Travis', 'Travolta', 'Triton', 'Ulysses', 'Umberto', 'Victor', 'Vincent', 'Vinnie', 'Virgil', 'Vlad', 'Vladimir', 'Voltaire', 'Vonnegut', 'Wainwright', 'Waldo', 'Waldorf', 'Walter', 'Warhol', 'Watson', 'Wayne', 'Wilbur', 'Wilfred', 'Wilhelm', 'Winston', 'Wiseguy', 'Wolfgang', 'Woodbury', 'Woodrow', 'Wyatt', 'Xanthus', 'Xavier', 'Zeus', 'Zorro'] +GirlPetNames = ['Abby', 'Adorabelle', 'Aggie', 'Akiko', 'Allessandria', 'Amaryllis', 'Ambrosia', 'Andrea', 'Anita', 'Annette', 'Annie', 'Antionette', 'April', 'Arabella', 'Ariel', 'Ashley', 'Athena', 'Babette', 'Babs', 'Babydoll', 'Ballerina', 'Beatrice', 'Bertie', 'Beulah', 'Beverly', 'Bianca', 'Blossom', 'Bozette', 'Brittany', 'Buttercup', 'Callalilly', 'Candy', 'Carmen', 'Carnation', 'Cassandra', 'Cece', 'Celeste', 'Chanel', 'Chantilly', 'Charlotte', 'Chelsea', 'Cher', 'Cherry', 'Chickie', 'Chloe', 'Cindy', 'Cinnamon', 'Cissy', 'Claire', 'Clementine', 'Cleopatra', 'Coco', 'Cowgirl', 'Daffodil', 'Dagmar', 'Daisy', 'Daphne', 'Dee Dee', 'Delilah', 'Dixie', 'Dolly', 'Dot', 'Dottie', 'Duchess', 'Edith', 'Electra', 'Elsie', 'Elvira', 'Emerald', 'Europa', 'Fannie', 'Fatima', 'Felicity', 'Fifi', 'Flopsy', 'Flower', 'Funnygirl', 'Gabby', 'Garbo', 'Geranium', 'Gidget', 'Gigi', 'Ginger', 'Goldie', 'Granny', 'Guinevere', 'Gwen', 'Hannah', 'Heidi', 'Henrietta', 'Hera', 'Hermione', 'Hildegard', 'Honey', 'Honeysuckle', 'Hortense', 'Iris', 'Ivy', 'Jade', 'Jaquelin', 'Jasmine', 'Jewel', 'Jo', 'Josephine', 'Joy', 'Juliet', 'June', 'Juniper', 'Kandy', 'Kate', 'Katrina', 'Koko', 'Kornelia', 'Krystal', 'Lacey', 'Lady', 'Lambchop', 'Lapis Lazuli', 'Lassie', 'Laverne', 'Leonora', 'Libby', 'Libra', 'Lilac', 'Lily', 'Lipstick', 'Lisa', 'Lottie', 'Lovebird', 'Lovesong', 'Lucretia', 'Lucy', 'Lulu', 'Luna', 'MK', 'Mabel', 'Magenta', 'Maggie', 'Mamacita', 'Mantissa', 'Maxine', 'Mayflower', 'Medusa', 'Melody', 'Mercedes', 'Meriwether', 'Mermaid', 'Mildred', 'Minerva', 'Missy', 'Mitzi', 'Mocha', 'Molly', 'Mona Lisa', 'Moneypenny', 'Monique', 'Mopsy', 'Nadia', 'Nancy', 'Nannygoat', 'Naomi', 'Nellybelle', 'Nightingale', 'Nikita', 'Odelia', 'Olga', 'Olive', 'Olympia', 'Oona', 'Opal', 'Ophelia', 'Organdy', 'Pandora', 'Patrikia', 'Penelope', 'Penny', 'Petinka', 'Petunia', 'Phoebe', 'Phoenicia', 'Pixie', 'Poinsettia', 'Pookie', 'Precious', 'Prettipaws', 'Primrose', 'Princess', 'Pudgette', 'Queenie', 'Raphael', 'Rapunzel', 'Raquel', 'Rosabelle', 'Rosebud', 'Roxanne', 'Roxy', 'Ruby', 'Sable', 'Sabrina', 'Sadie', 'Saffron', 'Sage', 'Sapphire', 'Sassafras', 'Savannah', 'Scarlett', 'Scheherazade', 'Serenade', 'Sienna', 'Silky', 'Sissy', 'Snoogie', 'Snookie', 'Sonja', 'Sophia', 'Sophie', 'Sorceress', 'Summer', 'Sunbonnet', 'Sunny', 'Sunshine', 'Tabitha', 'Tasha', 'Titania', 'Tootsie', 'Topaz', 'Trixie', 'Truffles', 'Tulip', 'Twiggy', 'Velma', 'Venice', 'Venus', 'Veronica', 'Vicki', 'Victoria', 'Viola', 'Violet', 'Wallflower', 'Winnie', 'Winona', 'Yum Yum', 'Zelda', 'Zsa Zsa'] +NeutralPetNames = ['Abner', 'Abracadabra', 'Acacia', 'Ace', 'Admiral', 'Aglet', 'Akimbo', 'Alabaster', 'Alcatraz', 'Alchemy', 'Alfalfa', 'Alien', 'Allegro', 'Alto', 'Amazon', 'Ambassador', 'Amethyst', 'Amnesia', 'Ampersand', 'Anaconda', 'Anchovy', 'Andretti', 'Andromeda', 'Angstrom', 'Animal', 'Antergy', 'Anubus', 'Apogee', 'Apollo', 'Applesauce', 'Apprentice', 'Apricot', 'Aquarius', 'Aramis', 'Archer', 'Arf', 'Argus', 'Argyle', 'Aristotle', 'Arizona', 'Arrow', 'Arsenio', 'Asimov', 'Asparagus', 'Asphalt', 'Astro', 'Atom', 'Augie', 'August', 'Avalanche', 'Avalon', 'Avenger', 'Avis', 'Axel', 'Axle', 'Azalea', 'Aztec', 'Azure', 'Babbit', 'Babble', 'Babbler', 'Baby', 'Babykins', 'Baccarat', 'Backgammon', 'Badger', 'Baggy', 'Bailey', 'Baja', 'Balboa', 'Baldo', 'Baldric', 'Baldy', 'Ballyhoo', 'Bambino', 'Bamboo', 'Bamboozle', 'Bamboozler', 'Banana', 'Bandit', 'Bandito', 'Bangle', 'Banjo', 'Banshee', 'Banzai', 'Barbarian', 'Bargraph', 'Barky', 'Barnacle', 'Barracuda', 'Bashful', 'Bazooka', 'Beaker', 'Bean', 'Beaner', 'Beanstalk', 'Beany', 'Bear', 'Beauty', 'Beaver', 'Beep', 'Beeper', 'Beepy', 'Beethoven', 'Beezneez', 'Begonia', 'Bellyflop', 'Benson', 'Bentley', 'Beppo', 'Bermuda', 'Betatest', 'Bewitched', 'Big Red', 'Big Shot', 'Bigbelly', 'Bigfoot', 'Bijou', 'Bindle', 'Bing', 'Bingo', 'Binky', 'Biscuit', 'Bitsy', 'Bizzy', 'Blackberry', 'Blackbird', 'Blackfoot', 'Blackie', 'Blackjack', 'Blacktop', 'Blanket', 'Blaze', 'Bleary', 'Blimp', 'Blimpo', 'Blimpy', 'Blip Blop', 'Blizzard', 'Blockhead', 'Blondie', 'Blooper', 'Blorange', 'Blot', 'Blotto', 'Bluebell', 'Blueberry', 'Bluegrass', 'Bluenose', 'Blueprint', 'Blunder', 'Blurp', 'Boa', 'Bobbin', 'Bobo', 'Bobtail', 'Bodyguard', 'Boggs', 'Bojangles', 'Bolt', 'Bombshell', 'Bonbon', 'Bones', 'Bongo', 'Bonkers', 'Bono', 'Bonsai', 'Boo Boo', 'Boober', 'Boogeyman', 'Boom Boom', 'Boomer', 'Boots', 'Borax', 'Borg', 'Bosco', 'Bottlecap', 'Bottlenose', 'Boulder', 'Bounce Bounce', 'Bouncer', 'Bouncy', 'Bowtie', 'Bowzer', 'Boyd', 'Bozo', 'Brahms', 'Brainchild', 'Bratwurst', 'Bravo', 'Briar', 'Brie', 'Broadway', 'Broccoli', 'Bronco', 'Brooklyn', 'Brouhaha', 'Brownie', 'Bruiser', 'Bubblegum', 'Bubbles', 'Bubo', 'Buccaneer', 'Buckaroo', 'Buckeye', 'Buckingham', 'Buckle', 'Buckshot', 'Buckskin', 'Buckwheat', 'Budapest', 'Buddy', 'Buffalo', 'Buffoon', 'Bug', 'Bugaboo', 'Bugeye', 'Bugsy', 'Bullet', 'Bullwinkle', 'Bumblebee', 'Bumbler', 'Bumper', 'Bumpkin', 'Bumpus', 'Bumpy', 'Bungee', 'Bunko', 'Bunyan', 'Burbank', 'Butterball', 'Butterscotch', 'Buzz', 'Buzzard', 'Buzzy', 'Byte', 'Caboodle', 'Caboose', 'Cadbury', 'Cadet', 'Caesar', 'Calculus', 'Calico', 'Callisto', 'Calypso', 'Calzone', 'Cambridge', 'Camelot', 'Camembert', 'Cameo', 'Campbell', 'Canoe', 'Cap', 'Cappy', 'Capricorn', 'Captain', 'Caramba', 'Caramel', 'Cargo', 'Carlos', 'Carpool', 'Caruso', 'Casablanca', 'Casbah', 'Casey', 'Cashmere', 'Cassidy', 'Castaway', 'Catamaran', 'Caviar', 'Cayenne', 'Cerebro', 'Cha Cha', 'Challenger', 'Chamberlain', 'Chamomile', 'Champ', 'Chaos', 'Charade', 'Charcoal', 'Charger', 'Charmed', 'Chaser', 'Chasm', 'Checkers', 'Cheesecake', 'Cheesy', 'Cheetah', 'Chester', 'Chewie', 'Chicory', 'Chiffon', 'Chigger', 'Chili', 'Chili Bean', 'Chipmunk', 'Chipper', 'Chips', 'Chocolate', 'Choo Choo', 'Chopin', 'Chopper', 'Chops', 'Chopsticks', 'Chowder', 'Chowderhead', 'Chromium', 'Chubby', 'Chuckles', 'Chutzpah', 'Cinder', 'Citrus', 'Clipper', 'Cloud', 'Cloudy', 'Clover', 'Clue', 'Clueless', 'Clunky', 'Coach', 'Cobol', 'Cobra', 'Cocoa', 'Coconut', 'Cola', 'Colorado', 'Comet', 'Comma', 'Confetti', 'Connecticut', 'Cookie', 'Cooter', 'Copper', 'Coral', 'Corduroy', 'Corky', 'Cornball', 'Corncob', 'Cornelia', 'Cornmo', 'Corny', 'Corona', 'Coronet', 'Cosmo', 'Cottontail', 'Couscous', 'Coyote', 'Crackers', 'Cranberry', 'Crash', 'Crawdad', 'Creamy', 'Creeper', 'Creepy', 'Crescent', 'Cricket', 'Critter', 'Croissant', 'Crouton', 'Crufty', 'Cruiser', 'Crumb', 'Crumbly', 'Cruncher', 'Crunchy', 'Cucamonga', 'Cucaracha', 'Cuckoo', 'Cucumber', 'Cuddles', 'Cupcake', 'Cupid', 'Curmudgeon', 'Curry', 'Cutie', 'Cutie Pie', 'Cypress', 'DJ', 'Dakota', 'Dali', 'Damascus', 'Dancer', 'Dandelion', 'Danger', 'Database', 'Dazzle', 'Dazzler', 'Dazzy', 'December', 'Delaware', 'Delphi', 'Detonator', 'Detour', 'Detroit', 'Deuce', 'Dewfall', 'Diamond', 'Dice', 'Diego', 'Digby', 'Digger', 'Digit', 'Dimples', 'Dingo', 'Dingus', 'Dinky', 'Divot', 'Dizzy', 'Doc', 'Dodger', 'Dodo', 'Dolby', 'Donut', 'Doodad', 'Doodah', 'Doodle', 'Draco', 'Dracula', 'Drawers', 'Dreadnought', 'Dream', 'Dreamer', 'Dreamweaver', 'Dreamy', 'Drippy', 'Droopy', 'Drummer', 'Dumpling', 'Durango', 'Dustmop', 'Dynamite', 'Dynamo', 'Eagle', 'Ebony', 'Eccentric', 'Echo', 'Eclipse', 'Ecstatic', 'Edge', 'Egad', 'Egghead', 'Eggnog', 'Eggtoss', 'Egypt', 'Elderberry', 'Electron', 'Elf', 'Elijah', 'Elvis', 'Email', 'Ember', 'Encore', 'Enoch', 'Epcot', 'Epic', 'Epilog', 'Equinox', 'Ergo', 'Escapade', 'Eskimo', 'Espresso', 'Euclid', 'Euphoria', 'Euphrates', 'Excalibur', 'Exeter', 'Eyespy', 'Faberge', 'Fable', 'Facepuff', 'Fahrenheit', 'Fairbanks', 'Fairfax', 'Faith', 'Faithful', 'Fajita', 'Falafel', 'Falcon', 'Fancy', 'Fandango', 'Fang', 'Fangtastic', 'Fantasia', 'Fats', 'Fatso', 'Fatty', 'Faust', 'Fax', 'Fearless', 'Feather', 'Feedback', 'Fellini', 'Ferrari', 'Fester', 'Fetch', 'Fiddler', 'Fiddlesticks', 'Fiesta', 'Filibuster', 'Fingerprint', 'Fingers', 'Fink', 'Fishbone', 'Fishface', 'Fishhook', 'Fizz', 'Fizzle', 'Fizzy', 'Flabby', 'Flagpole', 'Flame', 'Flannel', 'Flapjack', 'Flash', 'Flatfoot', 'Flicker', 'Fling', 'Flip', 'Flipper', 'Flop', 'Flopper', 'Floppy', 'Florida', 'Fluffster', 'Fluffy', 'Flurry', 'Flute', 'Fog', 'Fogarty', 'Fondue', 'Fortran', 'Fox', 'Foxy', 'Frankfurter', 'Freckles', 'Freebie', 'Freezerburn', 'French Toast', 'Friday', 'Frogface', 'Frogmar', 'Frost', 'Frosty', 'Fruitcake', 'Frump', 'Frumpson', 'Frumpy', 'Fudd', 'Fuddles', 'Fudge', 'Fugitive', 'Fuji', 'Fungus', 'Funky', 'Furball', 'Furface', 'Fusebox', 'Fuzzball', 'Fuzzy', 'Fuzzyface', 'Fuzzykins', 'Gabardine', 'Galaxy', 'Gallop', 'Gambit', 'Gambler', 'Gangway', 'Garlic', 'Garlicbreath', 'Garnet', 'Garth', 'Gavotte', 'Gecko', 'Geewhiz', 'Gem', 'Gemini', 'Gerbil', 'Gewgaw', 'Ghost', 'Giddyup', 'Giggles', 'Gingerbread', 'Gingersnap', 'Glick', 'Gnash', 'Gnasher', 'Gnocchi', 'Gnome', 'Gobbledegook', 'Gobbler', 'Goblet', 'Goblin', 'Gobo', 'Gogo', 'Goiter', 'Goliath', 'Gomer', 'Goober', 'Gooch', 'Gooey', 'Googol', 'Goose', 'Gooseberry', 'Goosebump', 'Gopher', 'Gouda', 'Governor', 'Gracie', 'Graffiti', 'Graham', 'Granite', 'Granola', 'Gravlax', 'Gremlin', 'Grep', 'Grok', 'Grue', 'Grumpus', 'Grumpy', 'Grungy', 'Guffaw', 'Gumbo', 'Gumdrop', 'Gump', 'Gumpus', 'Gumshoe', 'Gypsy', 'Gyro', 'Haggis', 'Haha', 'Hairball', 'Half Pint', 'Halibut', 'Halifax', 'Halloweenie', 'Halo', 'Halogen', 'Hambone', 'Hamburger', 'Hammer', 'Hammerhead', 'Hammerstein', 'Hammy', 'Hamster', 'Happy', 'Harlequin', 'Harley', 'Harmonica', 'Harmony', 'Harvard', 'Havoc', 'Hawk', 'Hawkeye', 'Hayseed', 'Haywire', 'Hazel', 'Heartbreaker', 'Heathrow', 'Heckler', 'Hedgehog', 'Heehee', 'Hemlock', 'Herringbone', 'Hiccup', 'Hifi', 'Hip Hip', 'Hippo', 'Hippodrome', 'Hoagie', 'Hobo', 'Hoho', 'Holmes', 'Honeybee', 'Hooligan', 'Hoops', 'Hoosier', 'Horoscope', 'Hot Dog', 'Hotfoot', 'Hotshot', 'Houston', 'Howard', 'Huckleberry', 'Huffy', 'Huggy', 'Hugo', 'Humdinger', 'Humdrum', 'Hurricane', 'Hydraulic', 'Hypnos', 'IOU', 'Iapyx', 'Ibex', 'Icarus', 'Icky', 'Icon', 'Icy', 'Idiom', 'Idlewild', 'Igloo', 'Iguana', 'Illogical', 'Illusion', 'Imagine', 'Imp', 'Impy', 'Imus', 'Indigo', 'Indy', 'Inferno', 'Infinity', 'Infrared', 'Ingot', 'Inkblot', 'Inkwell', 'Innie', 'Input', 'Insomnia', 'Intro', 'Iodine', 'Iota', 'Itchy', 'Ivory', 'Izzat', 'Izzy', 'Jabber', 'Jabberwock', 'Jackaroo', 'Jackhammer', 'Jackpot', 'Jackrabbit', 'Jacuzzi', 'Jag', 'Jaguar', 'Jalapeno', 'Jambalaya', 'Jamboree', 'January', 'Jargon', 'Java', 'Jaws', 'Jaybird', 'Jester', 'Jet', 'Jicko', 'Jiffy', 'Jigsaw', 'Jimjam', 'Jingle', 'Jinx', 'Jitterbug', 'Jocko', 'Jojo', 'Joker', 'Jokester', 'Joliet', 'Joplin', 'Jordie', 'Jove', 'Joyride', 'Jubilee', 'Jughead', 'Jujitsu', 'Jukebox', 'July', 'Jumbo', 'Jumpy', 'Junior', 'Juno', 'Kabob', 'Kabuki', 'Kafka', 'Kahuna', 'Kalamazoo', 'Kaleidoscope', 'Kalmuk', 'Kansas', 'Kappa', 'Karamazov', 'Karate', 'Karma', 'Katmandu', 'Katsumi', 'Kayak', 'Keepsake', 'Kellogg', 'Kelvin', 'Ketchup', 'Kewpie', 'Keyboard', 'Keyring', 'Khaki', 'Kibbles', 'Kiddo', 'Kielbasa', 'Kilimanjaro', 'Kilowatt', 'Kimono', 'Kinetic', 'Kipling', 'Kismet', 'Kissyface', 'Kitten', 'Klinger', 'Klondike', 'Kludge', 'Klute', 'Klutz', 'Klutzy', 'Knickerbocker', 'Knievel', 'Knish', 'Knock Knock', 'Knockwurst', 'Knoop', 'Knucklebone', 'Knuckles', 'Koala', 'Kodiak', 'Kong', 'Kookaburra', 'Kooky', 'Kool Beanz', 'Kornball', 'Kosmix', 'Krakatoa', 'Kramer', 'Krispy', 'Krooner', 'Lab Rat', 'Labyrinth', 'Lacquer', 'Laddie', 'Ladybug', 'Lambada', 'Lamborghini', 'Lampoon', 'Lamster', 'Landmark', 'Landshark', 'Lanky', 'Lapper', 'Laptop', 'Lasagna', 'Laser', 'Latex', 'Lava', 'Lava Lamp', 'Lavender', 'Layaway', 'Leafy', 'Leaky', 'Lefty', 'Legend', 'Lemming', 'Lemonade', 'Lentil', 'Lettuce', 'Lexy', 'Lickety Split', 'Lickums', 'Licky', 'Licorice', 'Lightning', 'Lima', 'Limbo', 'Limey', 'Linguini', 'Link', 'Lintball', 'Lionheart', 'Lithgow', 'Litmus', 'Littlefoot', 'Liverpool', 'Liverwurst', 'Lizard', 'Lobo', 'Lofty', 'Logan', 'Logical', 'Lollipop', 'London', 'Longfellow', 'Longshot', 'Loofah', 'Looney', 'Loopy', 'Lotus', 'Luau', 'Lucky', 'Ludwig', 'Lullaby', 'Lumpy', 'Lunatic', 'Lynx', 'Lyrical', 'Macaroni', 'Macaroon', 'Macho', 'Macintosh', 'Mackerel', 'Mad Max', 'Madison', 'Maestro', 'Mage', 'Magic', 'Magma', 'Magnet', 'Magnolia', 'Magnus', 'Magoo', 'Magpie', 'Mahogany', 'Majestic', 'Malibu', 'Mambo', 'Mango', 'Manhattan', 'Manitoba', 'Mantra', 'Maple Syrup', 'Maraschino', 'Marathon', 'Mariachi', 'Marquee', 'Marshmallow', 'Martian', 'Marzipan', 'Mascot', 'Matchmaker', 'Matzoh', 'Maverick', 'Max', 'Maybe', 'Mayhem', 'Mazy', 'Meanie', 'Meatball', 'Meatloaf', 'Melange', 'Melbourne', 'Mellifluent', 'Melrose', 'Memo', 'Memphis', 'Menthol', 'Meow Meow', 'Meringue', 'Mesopotamia', 'Mesquite', 'Meta', 'Metric', 'Metro', 'Mezzo', 'Miami', 'Microfilm', 'Microwave', 'Midas', 'Midget', 'Midnight', 'Mikado', 'Milestone', 'Milkshake', 'Minty', 'Minuet', 'Minus', 'Mischief', 'Misery', 'Mist', 'Misty', 'Mittens', 'Mo', 'Mobius', 'Modesta', 'Mohair', 'Mohawk', 'Mojo', 'Molasses', 'Mole', 'Molecule', 'Monday', 'Mongoose', 'Monkey', 'Monogram', 'Montgomery', 'Monty', 'Moocher', 'Moochie', 'Moonbeam', 'Moondancer', 'Moondoggie', 'Moonmist', 'Moose', 'Mooshoo', 'Moptop', 'Mork', 'Morocco', 'Mosaic', 'Moscow', 'Motley', 'Moustache', 'Moxie', 'Mudpie', 'Muffin', 'Mulberry', 'Mumbles', 'Mumford', 'Mumpy', 'Munchkin', 'Murphy', 'Mushmouth', 'Mushroom', 'Mustang', 'Mustard', 'Mutt', 'Muttzie', 'Mylar', 'Nacho', 'Nameless', 'Nardek', 'Nashville', 'Naugahyde', 'Navel', 'Naxos', 'Nectarine', 'Ned', 'Needle', 'Needler', 'Needles', 'Nehru', 'Neon', 'Neptune', 'Network', 'Neuron', 'Neutron', 'Nevada', 'Newt', 'Newton', 'Niagara', 'Nibbler', 'Nibbles', 'Nibbly', 'Niccolo', 'Nickel', 'Nifty', 'Niftykins', 'Nightmare', 'Nim', 'Nimbus', 'Nitro', 'Nix', 'Nixy', 'Noisemaker', 'Nomad', 'Noname', 'Noodles', 'Nooly', 'Norbie', 'Nostrildamus', 'Nosy', 'November', 'Nugget', 'Numbers', 'Nutmeg', 'Oasis', 'Oatcake', 'Oatmeal', 'Oberon', 'Oblong', 'Oboe', 'Obsession', 'Octagon', 'October', 'Oddjob', 'Odzanends', 'Offbeat', 'Ogee', 'Ohio', 'Oink Oink', 'Oinker', 'Okeedoke', 'Okra', 'Oleander', 'Omega', 'Omelet', 'Onion', 'Onionbreath', 'Onionhead', 'Ono', 'Onomatopoeia', 'Onyx', 'Oozy', 'Opaque', 'Opossum', 'Orangeade', 'Orbit', 'Orchid', 'Oregano', 'Original', 'Oriole', 'Orlando', 'Oroonoko', 'Orpheus', 'Orville', 'Oscar', 'Osmosis', 'Ostrich', 'Outie', 'Outlaw', 'Outlet', 'Outrageous', 'Owl', 'Ox', 'Oyster', 'Ozzie', 'PJ', 'Pacemaker', 'Pachyderm', 'Padlock', 'Pagoda', 'Paisley', 'Paladin', 'Palomino', 'Panache', 'Panda', 'Pandemonium', 'Panfried', 'Pantaloon', 'Panther', 'Paprika', 'Papyrus', 'Parachute', 'Paradise', 'Parakeet', 'Parallax', 'Paris', 'Parmesan', 'Parsley', 'Parsnip', 'Pascal', 'Pasternak', 'Patches', 'Patchouli', 'Patchwork', 'Patience', 'Pauper', 'Paws', 'Peachy', 'Peanut', 'Pearl', 'Pebbles', 'Pecan', 'Peck Peck', 'Peepers', 'Peewee', 'Pegasus', 'Pele', 'Pendragon', 'Penguin', 'Peoria', 'Pepper', 'Peppermint', 'Pepperoni', 'Peppy', 'Percival', 'Periwinkle', 'Peroxide', 'Persephone', 'Perseus', 'Persnickety', 'Pesto', 'Pesty', 'Petra', 'Petros', 'Pettibones', 'Phantom', 'Philadelphia', 'Phoenix', 'Phynotaprox', 'Piano', 'Piccolo', 'Pickles', 'Pickwick', 'Pico', 'Piecewise', 'Pigpen', 'Pilaf', 'Pimento', 'Ping', 'Ping Pong', 'Pip', 'Pipsqueak', 'Pistachio', 'Piston', 'Pitabread', 'Pixel', 'Pizza', 'Pizzazz', 'Plato', 'Plumb Bob', 'Plumpy', 'Plunko', 'Pluto', 'Pocket', 'Poco', 'Poe', 'Pointer', 'Pointy', 'Pokey', 'Polaris', 'Polifax', 'Pollywog', 'Poltergeist', 'Pom Pom', 'Poofball', 'Poofy', 'Popcorn', 'Poppy', 'Porcupine', 'Porkchop', 'Portobello', 'Postcard', 'Potbelly', 'Potpie', 'Potzy', 'Pouncer', 'Powder', 'Prancer', 'Preston', 'Pretzel', 'Priscilla', 'Prissy', 'Procyon', 'Prodigy', 'Proton', 'Providence', 'Prowler', 'Proxy', 'Pudding', 'Puddles', 'Pudgy', 'Puff', 'Puffball', 'Puffin', 'Puffy', 'Pugnose', 'Pumpernickel', 'Pumpkin', 'Punch', 'Punky', 'Puree', 'Purrfect', 'Pygmy', 'Pyrex', 'Python', 'Quack Quack', 'Quagmire', 'Quartz', 'Quasar', 'Quasi', 'Queasy', 'Quenby', 'Quesadilla', 'Quester', 'Quetzal', 'Quibbler', 'Quicksand', 'Quicksilver', 'Quinn', 'Quippy', 'Quiqui', 'Quirky', 'Quixote', 'Quizzical', 'Quizzix', 'Rabbit', 'Raccoon', 'Racecar', 'Rachel', 'Radar', 'Radcliffe', 'Radish', 'Radium', 'Radix', 'Radman', 'Raffle', 'Ragamuffin', 'Ragdoll', 'Ragmop', 'Rags', 'Ragtime', 'Ragweed', 'Rainbow', 'Rainstorm', 'Rainwater', 'Raisin', 'Rambler', 'Ramrod', 'Ranger', 'Rascal', 'Raspberry', 'Rathbone', 'Rattler', 'Raven', 'Ravioli', 'Rawhide', 'Raymond', 'Razzmatazz', 'Reactor', 'Recall', 'Recycler', 'Redwood', 'Relay', 'Relic', 'Relish', 'Renegade', 'Repeat', 'Rescuer', 'Retread', 'Rewind', 'Rhapsody', 'Rhinestone', 'Rhino', 'Rhymer', 'Rhythm', 'Ribbons', 'Rickrack', 'Ricochet', 'Riddler', 'Riddles', 'Riffraff', 'Rigatoni', 'Righty', 'Ringleader', 'Ringo', 'Riot', 'Ripley', 'Ripple', 'Ripples', 'Risky', 'Ritz', 'Ritzy', 'Roamer', 'Robin', 'Rocco', 'Rocket', 'Rockhead', 'Rockwell', 'Rococo', 'Rogue', 'Rolex', 'Rollo', 'Roly Poly', 'Ronno', 'Rookie', 'Rooster', 'Roscoe', 'Rosebug', 'Rothchild', 'Rowf', 'Rowser', 'Ruffles', 'Ruggelah', 'Ruggles', 'Rumba', 'Runaway', 'Runt', 'Rushmore', 'Rusty', 'Sabotage', 'Safari', 'Saga', 'Saggy', 'Sagittarius', 'Sahara', 'Salamander', 'Salazar', 'Salinger', 'Salisbury', 'Salsa', 'Salty', 'Sam', 'Samba', 'Sammy', 'Samson', 'Samurai', 'Sandman', 'Sandy', 'Santana', 'Santiago', 'Sasha', 'Sashimi', 'Sasquatch', 'Sassy', 'Satchel', 'Satire', 'Saturn', 'Saucer', 'Saucy', 'Sausage', 'Savage', 'Saxophone', 'Scallop', 'Scamp', 'Scamper', 'Scandal', 'Scarecrow', 'Scary', 'Schlemmer', 'Schmooze', 'Schnook', 'Schnookie', 'Scone', 'Scoops', 'Scoot', 'Scooter', 'Scorpio', 'Scorpion', 'Scoundrel', 'Scout', 'Scrabble', 'Scrambler', 'Scrappy', 'Scrooge', 'Scrumptious', 'Scupper', 'Seagull', 'Seismic', 'Seltzer', 'Seneca', 'September', 'Sepulveda', 'Serengeti', 'Shackles', 'Shamrock', 'Shangri La', 'Sharky', 'Shazam', 'Sheba', 'Shelby', 'Sheldrake', 'Shelley', 'Shelton', 'Shenanigan', 'Shep', 'Sherbet', 'Sherlock', 'Sherwood', 'Shiny', 'Shmunday', 'Shoeless', 'Shogun', 'Shortcake', 'Shortstack', 'Shortstop', 'Shorty', 'Showboat', 'Showoff', 'Shredder', 'Shrimpy', 'Shylock', 'Sideshow', 'Sideways', 'Sidney', 'Silhouette', 'Silverspoon', 'Siren', 'Skeet', 'Skeeter', 'Skelton', 'Skidder', 'Skidoo', 'Skidsy', 'Skinky', 'Skipper', 'Skippy', 'Skunk', 'Skunkmuffin', 'Skunky', 'Sky', 'Skyrocket', 'Slappy', 'Slate', 'Slick', 'Slicker', 'Slippers', 'Sloth', 'Slothful', 'Slugger', 'Sly', 'Smarty', 'Smartypants', 'Smash', 'Smasher', 'Smilestone', 'Smocks', 'Smoke', 'Smoky', 'Smoocher', 'Smoothie', 'Smores', 'Smug', 'Snaggletooth', 'Snapdragon', 'Snappy', 'Snaps', 'Snarly', 'Sneaker', 'Sneakers', 'Sneezer', 'Sneezy', 'Snickers', 'Sniffer', 'Sniffler', 'Sniffles', 'Sniffy', 'Snooker', 'Snookums', 'Snooper', 'Snoots', 'Snooty', 'Snowball', 'Snowberry', 'Snowbunny', 'Snowcap', 'Snowflake', 'Snowpea', 'Snowshoe', 'Snowy', 'Snuffles', 'Snuffy', 'Snugglepot', 'Snuggles', 'Socks', 'Sodapop', 'Soho', 'Sojourner', 'Solo', 'Sonar', 'Sorbet', 'Souffle', 'Soupbowl', 'Soupy', 'Sourball', 'Sourdough', 'Southpaw', 'Spacey', 'Spades', 'Spaghetti', 'Spam', 'Sparkler', 'Sparkplug', 'Sparky', 'Sparrow', 'Sparx', 'Speck', 'Speckles', 'Spectro', 'Spectrum', 'Speedy', 'Spex', 'Sphinx', 'Spicy', 'Spider', 'Spiffy', 'Spike', 'Spiky', 'Spinach', 'Spinner', 'Spiral', 'Spirit', 'Spiro', 'Spitfire', 'Splash', 'Splashy', 'Spoiler', 'Spoof', 'Spooky', 'Sport', 'Sporty', 'Spot', 'Spots', 'Spotty', 'Spring', 'Springbok', 'Springy', 'Sprinkle', 'Sprinkles', 'Spud', 'Spunky', 'Sputnik', 'Spy', 'Squash', 'Squeak', 'Squeaky', 'Squid', 'Squiddly', 'Squidface', 'Squiggle', 'Squiggly', 'Squishy', 'Stalactite', 'Stalagmite', 'Starbuck', 'Stardust', 'Starfire', 'Stargazer', 'Starlight', 'Steamy', 'Steely', 'Stereopsis', 'Sterling', 'Stethoscope', 'Stetson', 'Stewart', 'Sticky', 'Stinger', 'Stingy', 'Stinkwell', 'Stinky', 'Stony', 'Storm', 'Stormy', 'Stowaway', 'Strange', 'Strawberry', 'Strep', 'Stretch', 'Stretchy', 'Stripe', 'Striper', 'Stripes', 'Strudel', 'Stubby', 'Stumpy', 'Sudsy', 'Suede', 'Sugar', 'Sugarbaby', 'Sulfur', 'Sultan', 'Sumo', 'Sundance', 'Sundown', 'Sunflower', 'Sunset', 'Superdoodle', 'Surprise', 'Sushi', 'Swabbie', 'Swampy', 'Sweathog', 'Sweetheart', 'Sweetie Pie', 'Sweetness', 'Sweets', 'Swift', 'Swifty', 'Swizzle', 'Sylvester', 'Synergy', 'Syrup', 'TNT', 'Tablespoon', 'Tabloid', 'Taboo', 'Tacky', 'Taco', 'Tacos', 'Tadpole', 'Taffeta', 'Taffy', 'Tagalong', 'Tags', 'Tahiti', 'Taj', 'Takeout', 'Talisman', 'Tallahassee', 'Tallulah', 'Talon', 'Tamale', 'Tambourine', 'Tandem', 'Tanglewood', 'Tango', 'Tank', 'Tanker', 'Tanner', 'Tantrum', 'Tapestry', 'Tapioca', 'Tapper', 'Tarantula', 'Tardy', 'Target', 'Tarkington', 'Tartan', 'Tasty', 'Tatsu', 'Tatters', 'Tattletale', 'Tattoo', 'Taurus', 'Tawny', 'Taxbreak', 'Taxcut', 'Taxi', 'Taxicab', 'Teacup', 'Teaky', 'Teapot', 'Teaspoon', 'Technicolor', 'Teddy', 'Teehee', 'Teevee', 'Telegram', 'Telepath', 'Telescope', 'Telex', 'Tempest', 'Templeton', 'Tempo', 'Tenderfoot', 'Tennessee', 'Tennisball', 'Tennyson', 'Terence', 'Teriyaki', 'Terror', 'Texas', 'Textbook', 'Thackeray', 'Thaddeus', 'Tharp', 'Tharpo', 'Theoretical', 'Theory', 'Thermos', 'Thickie', 'Thimble', 'Thistle', 'Thorny', 'Thriller', 'Thud', 'Thumbtack', 'Thunder', 'Thunderbird', 'Thurgood', 'Thursday', 'Thyme', 'Tickets', 'Tidbit', 'Tilly', 'Tilted', 'Timbuktu', 'Tinkles', 'Tinsel', 'Tintin', 'Tiny', 'Tipperary', 'Tipsy', 'Titanium', 'Tizzy', 'Toad', 'Toadstool', 'Toady', 'Toaster', 'Toby', 'Toco', 'Toffee', 'Tofu', 'Tokyo', 'Toledo', 'Tomato', 'Tomorrow', 'Tonic', 'Toodleoo', 'Toodles', 'Toot', 'Tooter', 'Toothsome', 'Toothy', 'Tootles', 'Toots', 'Topeka', 'Topper', 'Topsy', 'Tornado', 'Torpedo', 'Tortellini', 'Tortoni', 'Totem', 'Toto', 'Totsy', 'Toucan', 'Toupee', 'Toy', 'Toybox', 'Tracer', 'Trailblazer', 'Tramp', 'Trampoline', 'Trancer', 'Trapper', 'Traveller', 'Treasure', 'Treetop', 'Trekker', 'Trickster', 'Trickstick', 'Tricky', 'Trident', 'Trilogy', 'Trinidad', 'Trinket', 'Trio', 'Tripper', 'Troll', 'Tropix', 'Trouble', 'Trout', 'Trumpet', 'Trusty', 'Tsunami', 'Tuba', 'Tubbo', 'Tubby', 'Tuesday', 'Tuffy', 'Tugboat', 'Tumblebumble', 'Tumbler', 'Tumbleweed', 'Tunafish', 'Tundra', 'Turbo', 'Turkey', 'Turnip', 'Turtleneck', 'Tutu', 'Twaddler', 'Twain', 'Tweezer', 'Twerp', 'Twiggs', 'Twilight', 'Twinkle', 'Twirler', 'Twister', 'Twittery', 'Tycoon', 'Typhoon', 'UFO', 'Ubu', 'Ugly', 'Ukelele', 'Ultimate', 'Ultra', 'Ultrasonic', 'Ultra', 'Umber', 'Umbrella', 'Umpire', 'Underfoot', 'Underwood', 'Unicorn', 'Unique', 'Upbeat', 'Upshot', 'Upside', 'Upstart', 'Uptight', 'Urchin', 'Ursula', 'Utoo', 'Utopia', 'Vacuum', 'Vagabond', 'Valentine', 'Valerie', 'Valiant', 'Vamp', 'Vanderbilt', 'Vanilla', 'Vanity', 'Vaudeville', 'Vegas', 'Velvet', 'Venezuela', 'Vermicelli', 'Vermont', 'Vern', 'Vernon', 'Vertigo', 'Vexy', 'Vibes', 'Victrola', 'Video', 'Viking', 'Vinaigrette', 'Vintage', 'Viper', 'Virtuosity', 'Vivian', 'Voodoo', 'Vulcan', 'Vulture', 'Wabble', 'Wabbler', 'Wacky', 'Waddle', 'Waddler', 'Waddles', 'Wafer', 'Waffle', 'Waffler', 'Waffles', 'Wag', 'Waggles', 'Wags', 'Wagtail', 'Wahoo', 'Waikiki', 'Wallaby', 'Wallaroo', 'Walnut', 'Walnuts', 'Walrus', 'Waltzy', 'Wanderer', 'Warthog', 'Warty', 'Wasco', 'Waterberry', 'Watergate', 'Wavy', 'Waxy', 'Weasel', 'Weaver', 'Webster', 'Wedgewood', 'Wedgie', 'Wednesday', 'Weekend', 'Weepy', 'Weezer', 'Weezie', 'Welcome', 'Wellington', 'Wembly', 'Wendy', 'Wesley', 'Whatchamacallit', 'Whatever', 'Wheatcake', 'Wheedler', 'Whim', 'Whimsy', 'Whipple', 'Whirlwind', 'Whisker', 'Whiskers', 'Whisper', 'Whistler', 'Whistlestop', 'Whittaker', 'Whiz', 'Whizzer', 'Wholesale', 'Whoopdedoo', 'Whoopie', 'Wiggle', 'Wiggler', 'Wiggles', 'Wiggly', 'Wildberry', 'Wildcat', 'Wildflower', 'Wildwood', 'Willy', 'Wily', 'Wimbledon', 'Wimpster', 'Wimpy', 'Windjammer', 'Wing', 'Wink', 'Winker', 'Winkle', 'Winkles', 'Winky', 'Winx', 'Wiretap', 'Wisecrack', 'Wispy', 'Wisteria', 'Wizard', 'Wizkid', 'Wobble', 'Wobbler', 'Wobbles', 'Wobbly', 'Wolverine', 'Wonder', 'Wonderbunny', 'Wonton', 'Wooble', 'Woobles', 'Woobly', 'Woodchuck', 'Woodstock', 'Woodwind', 'Woof Woof', 'Woofer', 'Woolly', 'Woolworth', 'Wordsworth', 'Worm', 'Wormy', 'Wrex', 'Wriggler', 'Wriggles', 'Wriggly', 'Wrinkle', 'Wrinkler', 'Wrinkles', 'Wuggums', 'Wumpus', 'Wuzzie', 'Wyoming', 'Xanadu', 'Xenobia', 'Xifto', 'Xinx', 'Xinxu', 'Xippy', 'Xowie', 'Xoxo', 'Xoxxy', 'Xpresso', 'Yahoo', 'Yammie', 'Yancy', 'Yappy', 'Yardstick', 'Yasu', 'Yeasty', 'Yellowstone', 'Yelper', 'Yertle', 'Yesterday', 'Yeti', 'Yippie', 'Yodeler', 'Yoga', 'Yoko', 'Yonder', 'Yonkers', 'Yorty', 'Yosemite', 'Yukon', 'Yummy', 'Yutu', 'Yvonne', 'Zack', 'Zadok', 'Zaftig', 'Zaire', 'Zapata', 'Zappa', 'Zazen', 'Zebu', 'Zebulon', 'Zen', 'Zenith', 'Zenzen', 'Zepellin', 'Zephyr', 'Zeppo', 'Zero', 'Zesty', 'Zigzag', 'Zilch', 'Zillion', 'Zing', 'Zinger', 'Zingy', 'Zipcode', 'Zircon', 'Zodiac', 'Zoltan', 'Zonk', 'Zoo', 'Zooble', 'Zoom', 'Zoomer', 'Zoomy', 'Zowie', 'Zucchini', 'Zylon'] +PetNameDictionary = {} +id = 0 + +for dictionary in [BoyPetNames, GirlPetNames, NeutralPetNames]: + for name in dictionary: + PetNameDictionary[id] = name + id += 1 + +def getPetName(uniqueID): + try: + return PetNameDictionary[uniqueID] + except: + return PetNameDictionary[0] + +def getRandomPetName(gender = None, seed = None): + if seed is not None: + random.seed(seed) + + nameList = list(NeutralPetNames) + + if gender == 0: + nameList += BoyPetNames + else: + nameList += GirlPetNames + + return random.choice(nameList) + +def getPetNameId(name): + for key, value in PetNameDictionary.items(): + if name == value: + return key + + return 0 diff --git a/toontown/town/TownLoader.py b/toontown/town/TownLoader.py index 62895240..fcd35e5d 100644 --- a/toontown/town/TownLoader.py +++ b/toontown/town/TownLoader.py @@ -254,7 +254,7 @@ class TownLoader(StateData.StateData): self.zoneDict[zoneId] = groupNode visibles = [] for i in xrange(visGroup.getNumVisibles()): - visibles.append(int(visGroup.visibles[i])) + visibles.append(int(visGroup.getVisible(i))) visibles.append(ZoneUtil.getBranchZone(zoneId)) self.zoneVisDict[zoneId] = visibles fadeDuration = 0.5 @@ -377,4 +377,4 @@ class TownLoader(StateData.StateData): result = None if zoneId in self.zoneIdToInteractivePropDict: result = self.zoneIdToInteractivePropDict[zoneId] - return result \ No newline at end of file + return result