oldschool-toontown/toontown/hood/BossbotHQ.py

43 lines
1.7 KiB
Python
Raw Normal View History

from . import CogHood
2019-11-02 22:27:54 +00:00
from toontown.toonbase import ToontownGlobals
from toontown.coghq import BossbotCogHQLoader
from toontown.hood import ZoneUtil
class BossbotHQ(CogHood.CogHood):
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId):
CogHood.CogHood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId)
self.id = ToontownGlobals.BossbotHQ
self.cogHQLoaderClass = BossbotCogHQLoader.BossbotCogHQLoader
self.storageDNAFile = None
self.skyFile = 'phase_9/models/cogHQ/cog_sky'
self.titleColor = (0.5, 0.5, 0.5, 1.0)
return
def load(self):
CogHood.CogHood.load(self)
self.sky.hide()
self.parentFSM.getStateNamed('BossbotHQ').addChild(self.fsm)
def unload(self):
self.parentFSM.getStateNamed('BossbotHQ').removeChild(self.fsm)
del self.cogHQLoaderClass
CogHood.CogHood.unload(self)
def enter(self, *args):
CogHood.CogHood.enter(self, *args)
localAvatar.setCameraFov(ToontownGlobals.CogHQCameraFov)
base.camLens.setNearFar(ToontownGlobals.BossbotHQCameraNear, ToontownGlobals.BossbotHQCameraFar)
def exit(self):
localAvatar.setCameraFov(ToontownGlobals.DefaultCameraFov)
base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, ToontownGlobals.DefaultCameraFar)
CogHood.CogHood.exit(self)
def spawnTitleText(self, zoneId, floorNum = None):
if ZoneUtil.isMintInteriorZone(zoneId):
text = '%s\n%s' % (ToontownGlobals.StreetNames[zoneId][-1], TTLocalizer.MintFloorTitle % (floorNum + 1))
self.doSpawnTitleText(text)
else:
CogHood.CogHood.spawnTitleText(self, zoneId)