general: start working on goofy speedway

This commit is contained in:
John Cote 2019-12-01 19:25:05 -05:00
parent cb98eab37f
commit b2e2c0f68b
4 changed files with 71 additions and 34 deletions

View file

@ -1,4 +1,5 @@
from direct.directnotify import DirectNotifyGlobal
from panda3d.core import *
from libtoontown import *
from otp.ai.AIZoneData import AIZoneDataStore
@ -17,6 +18,7 @@ from toontown.hood.BRHoodDataAI import BRHoodDataAI
from toontown.hood.DDHoodDataAI import DDHoodDataAI
from toontown.hood.DGHoodDataAI import DGHoodDataAI
from toontown.hood.DLHoodDataAI import DLHoodDataAI
from toontown.hood.GSHoodDataAI import GSHoodDataAI
from toontown.hood.MMHoodDataAI import MMHoodDataAI
from toontown.hood.TTHoodDataAI import TTHoodDataAI
from toontown.pets.PetManagerAI import PetManagerAI
@ -193,6 +195,12 @@ class ToontownAIRepository(ToontownInternalRepository):
)
self.generateHood(DGHoodDataAI, ToontownGlobals.DaisyGardens)
# Goofy Speedway
self.zoneTable[ToontownGlobals.GoofySpeedway] = (
(ToontownGlobals.GoofySpeedway, 1, 0),
)
self.generateHood(GSHoodDataAI, ToontownGlobals.GoofySpeedway)
# Donald's Dreamland
self.zoneTable[ToontownGlobals.DonaldsDreamland] = (
(ToontownGlobals.DonaldsDreamland, 1, 0), (ToontownGlobals.LullabyLane, 1, 1),
@ -216,6 +224,27 @@ class ToontownAIRepository(ToontownInternalRepository):
return 'phase_%s/dna/%s_%s.dna' % (phase, hood, canonicalZoneId)
def lookupDNAFileName(self, dnaFileName):
searchPath = DSearchPath()
searchPath.appendDirectory(Filename('resources/phase_3.5/dna'))
searchPath.appendDirectory(Filename('resources/phase_4/dna'))
searchPath.appendDirectory(Filename('resources/phase_5/dna'))
searchPath.appendDirectory(Filename('resources/phase_5.5/dna'))
searchPath.appendDirectory(Filename('resources/phase_6/dna'))
searchPath.appendDirectory(Filename('resources/phase_8/dna'))
searchPath.appendDirectory(Filename('resources/phase_9/dna'))
searchPath.appendDirectory(Filename('resources/phase_10/dna'))
searchPath.appendDirectory(Filename('resources/phase_11/dna'))
searchPath.appendDirectory(Filename('resources/phase_12/dna'))
searchPath.appendDirectory(Filename('resources/phase_13/dna'))
filename = Filename(dnaFileName)
found = vfs.resolveFilename(filename, searchPath)
if not found:
self.notify.warning('lookupDNAFileName - %s not found on:' % dnaFileName)
print searchPath
else:
return filename.getFullpath()
def loadDNAFileAI(self, dnaStore, dnaFileName):
return loadDNAFileAI(dnaStore, dnaFileName)
@ -225,6 +254,12 @@ class ToontownAIRepository(ToontownInternalRepository):
def findPartyHats(self, dnaData, zoneId):
return [] # TODO
def findRacingPads(self, dnaData, zoneId, area, type='racing_pad'):
return [], [] # TODO
def findLeaderBoards(self, dnaData, zoneId):
return [] # TODO
def getTrackClsends(self):
return False

View file

@ -131,7 +131,7 @@ class Char(Avatar.Avatar):
self.initializeDropShadow()
self.initializeNametag3d()
self.nametag3d.setBin('fixed', 0)
if self.name == 'chip' or self.name == 'dale' or self.name == 'police_chip' or self.name == 'jailbird_dale':
if self._name == 'chip' or self._name == 'dale' or self._name == 'police_chip' or self._name == 'jailbird_dale':
self.find('**/drop-shadow').setScale(0.33)
def setLODs(self):
@ -148,40 +148,40 @@ class Char(Avatar.Avatar):
def generateChar(self):
dna = self.style
self.name = dna.getCharName()
self._name = dna.getCharName()
self.geoEyes = 0
if len(LODModelDict[dna.name]) > 1:
self.setLODs()
filePrefix = ModelDict[dna.name]
if self.name == 'mickey':
if self._name == 'mickey':
height = 3.0
elif self.name == 'vampire_mickey':
elif self._name == 'vampire_mickey':
height = 3.0
elif self.name == 'minnie':
elif self._name == 'minnie':
height = 3.0
elif self.name == 'witch_minnie':
elif self._name == 'witch_minnie':
height = 3.0
elif self.name == 'goofy':
elif self._name == 'goofy':
height = 4.8
elif self.name == 'super_goofy':
elif self._name == 'super_goofy':
height = 4.8
elif self.name == 'donald' or self.name == 'donald-wheel' or self.name == 'franken_donald':
elif self._name == 'donald' or self._name == 'donald-wheel' or self._name == 'franken_donald':
height = 4.5
elif self.name == 'daisy' or self.name == 'sockHop_daisy':
elif self._name == 'daisy' or self._name == 'sockHop_daisy':
height = 4.5
elif self.name == 'pluto':
elif self._name == 'pluto':
height = 3.0
elif self.name == 'western_pluto':
elif self._name == 'western_pluto':
height = 4.5
elif self.name == 'clarabelle':
elif self._name == 'clarabelle':
height = 3.0
elif self.name == 'chip':
elif self._name == 'chip':
height = 2.0
elif self.name == 'dale':
elif self._name == 'dale':
height = 2.0
elif self.name == 'police_chip':
elif self._name == 'police_chip':
height = 2.0
elif self.name == 'jailbird_dale':
elif self._name == 'jailbird_dale':
height = 2.0
self.lodStrings = []
for lod in LODModelDict[self.style.name]:
@ -193,7 +193,7 @@ class Char(Avatar.Avatar):
lodName = lodStr
else:
lodName = 'lodRoot'
if self.name == 'goofy':
if self._name == 'goofy':
self.loadModel(filePrefix + '-' + lodStr, lodName=lodName)
else:
self.loadModel(filePrefix + lodStr, lodName=lodName)
@ -216,7 +216,7 @@ class Char(Avatar.Avatar):
self.setHeight(height)
self.loadDialogue(dna.name)
self.ears = []
if self.name == 'mickey' or self.name == 'vampire_mickey' or self.name == 'minnie':
if self._name == 'mickey' or self._name == 'vampire_mickey' or self._name == 'minnie':
for bundle in self.getPartBundleDict().values():
bundle = bundle['modelRoot'].getBundle()
earNull = bundle.findChild('sphere3')
@ -251,7 +251,7 @@ class Char(Avatar.Avatar):
self.rpupil = None
self.eyesOpen = None
self.eyesClosed = None
if self.name == 'mickey' or self.name == 'minnie':
if self._name == 'mickey' or self._name == 'minnie':
self.eyesOpen = loader.loadTexture('phase_3/maps/eyes1.jpg', 'phase_3/maps/eyes1_a.rgb')
self.eyesClosed = loader.loadTexture('phase_3/maps/mickey_eyes_closed.jpg', 'phase_3/maps/mickey_eyes_closed_a.rgb')
self.eyes = self.find('**/1200/**/eyes')
@ -261,14 +261,14 @@ class Char(Avatar.Avatar):
for lodName in self.getLODNames():
self.drawInFront('joint_pupil?', 'eyes*', -3, lodName=lodName)
elif (self.name == 'witch_minnie' or
self.name == 'vampire_mickey' or
self.name == 'super_goofy' or
self.name == 'western_pluto' or
self.name == 'police_chip' or
self.name == 'jailbird_dale' or
self.name == 'franken_donald' or
self.name == 'sockHop_daisy'):
elif (self._name == 'witch_minnie' or
self._name == 'vampire_mickey' or
self._name == 'super_goofy' or
self._name == 'western_pluto' or
self._name == 'police_chip' or
self._name == 'jailbird_dale' or
self._name == 'franken_donald' or
self._name == 'sockHop_daisy'):
self.geoEyes = 1
self.eyeOpenList = []
self.eyeCloseList = []
@ -284,7 +284,7 @@ class Char(Avatar.Avatar):
for part in self.eyeCloseList:
part.hide()
elif self.name == 'pluto':
elif self._name == 'pluto':
self.eyesOpen = loader.loadTexture('phase_6/maps/plutoEyesOpen.jpg', 'phase_6/maps/plutoEyesOpen_a.rgb')
self.eyesClosed = loader.loadTexture('phase_6/maps/plutoEyesClosed.jpg', 'phase_6/maps/plutoEyesClosed_a.rgb')
self.eyes = self.find('**/1000/**/eyes')
@ -293,7 +293,7 @@ class Char(Avatar.Avatar):
for lodName in self.getLODNames():
self.drawInFront('joint_pupil?', 'eyes*', -3, lodName=lodName)
elif self.name == 'daisy':
elif self._name == 'daisy':
self.geoEyes = 1
self.eyeOpenList = []
self.eyeCloseList = []
@ -311,12 +311,12 @@ class Char(Avatar.Avatar):
for part in self.eyeCloseList:
part.hide()
elif self.name == 'donald-wheel':
elif self._name == 'donald-wheel':
self.eyes = self.find('**/eyes')
self.lpupil = self.find('**/joint_pupilL')
self.rpupil = self.find('**/joint_pupilR')
self.drawInFront('joint_pupil?', 'eyes*', -3)
elif self.name == 'chip' or self.name == 'dale':
elif self._name == 'chip' or self._name == 'dale':
self.eyesOpen = loader.loadTexture('phase_6/maps/dale_eye1.jpg', 'phase_6/maps/dale_eye1_a.rgb')
self.eyesClosed = loader.loadTexture('phase_6/maps/chip_dale_eye1_blink.jpg', 'phase_6/maps/chip_dale_eye1_blink_a.rgb')
self.eyes = self.find('**/eyes')
@ -332,12 +332,12 @@ class Char(Avatar.Avatar):
if self.eyesClosed:
self.eyesClosed.setMinfilter(Texture.FTLinear)
self.eyesClosed.setMagfilter(Texture.FTLinear)
if self.name == 'mickey':
if self._name == 'mickey':
pupilParent = self.rpupil.getParent()
pupilOffsetNode = pupilParent.attachNewNode('pupilOffsetNode')
pupilOffsetNode.setPos(0, 0.025, 0)
self.rpupil.reparentTo(pupilOffsetNode)
self.__blinkName = 'blink-' + self.name
self.__blinkName = 'blink-' + self._name
return
def swapCharModel(self, charStyle):

View file

@ -6,6 +6,7 @@ from otp.distributed.TelemetryLimiter import RotationLimitToH, TLGatherAllAvs
from toontown.toonbase import ToontownGlobals
from toontown.building import Elevator
from pandac.PandaModules import *
from libotp import *
class FactoryExterior(BattlePlace.BattlePlace):
notify = DirectNotifyGlobal.directNotify.newCategory('FactoryExterior')

View file

@ -3,6 +3,7 @@ import HoodDataAI, ZoneUtil
from toontown.toonbase import ToontownGlobals
from toontown.racing import DistributedStartingBlockAI
from pandac.PandaModules import *
from libtoontown import *
from toontown.racing.RaceGlobals import *
from toontown.classicchars import DistributedGoofySpeedwayAI
if __debug__: