2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import *
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import ToonHood
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.town import DGTownLoader
|
|
|
|
from toontown.safezone import DGSafeZoneLoader
|
|
|
|
from toontown.toonbase.ToontownGlobals import *
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import SkyUtil
|
2019-11-02 17:27:54 -05:00
|
|
|
|
|
|
|
class DGHood(ToonHood.ToonHood):
|
|
|
|
|
|
|
|
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId):
|
|
|
|
ToonHood.ToonHood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId)
|
|
|
|
self.id = DaisyGardens
|
|
|
|
self.townLoaderClass = DGTownLoader.DGTownLoader
|
|
|
|
self.safeZoneLoaderClass = DGSafeZoneLoader.DGSafeZoneLoader
|
|
|
|
self.storageDNAFile = 'phase_8/dna/storage_DG.dna'
|
|
|
|
self.holidayStorageDNADict = {WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DG.dna'],
|
|
|
|
WACKY_WINTER_DECORATIONS: ['phase_8/dna/winter_storage_DG.dna'],
|
|
|
|
HALLOWEEN_PROPS: ['phase_8/dna/halloween_props_storage_DG.dna'],
|
|
|
|
SPOOKY_PROPS: ['phase_8/dna/halloween_props_storage_DG.dna']}
|
|
|
|
self.skyFile = 'phase_3.5/models/props/TT_sky'
|
|
|
|
self.spookySkyFile = 'phase_3.5/models/props/BR_sky'
|
|
|
|
self.titleColor = (0.8, 0.6, 1.0, 1.0)
|
|
|
|
|
|
|
|
def load(self):
|
|
|
|
ToonHood.ToonHood.load(self)
|
|
|
|
self.parentFSM.getStateNamed('DGHood').addChild(self.fsm)
|
|
|
|
|
|
|
|
def unload(self):
|
|
|
|
self.parentFSM.getStateNamed('DGHood').removeChild(self.fsm)
|
|
|
|
ToonHood.ToonHood.unload(self)
|
|
|
|
|
|
|
|
def enter(self, *args):
|
|
|
|
ToonHood.ToonHood.enter(self, *args)
|
|
|
|
|
|
|
|
def exit(self):
|
|
|
|
ToonHood.ToonHood.exit(self)
|
|
|
|
|
|
|
|
def skyTrack(self, task):
|
|
|
|
return SkyUtil.cloudSkyTrack(task)
|
|
|
|
|
|
|
|
def startSky(self):
|
|
|
|
if not self.sky.getTag('sky') == 'Regular':
|
|
|
|
self.endSpookySky()
|
|
|
|
SkyUtil.startCloudSky(self)
|
|
|
|
|
|
|
|
def startSpookySky(self):
|
|
|
|
if hasattr(self, 'sky') and self.sky:
|
|
|
|
self.stopSky()
|
|
|
|
self.sky = loader.loadModel(self.spookySkyFile)
|
|
|
|
self.sky.setTag('sky', 'Halloween')
|
|
|
|
self.sky.setScale(1.0)
|
|
|
|
self.sky.setDepthTest(0)
|
|
|
|
self.sky.setDepthWrite(0)
|
|
|
|
self.sky.setColor(0.5, 0.5, 0.5, 1)
|
|
|
|
self.sky.setBin('background', 100)
|
|
|
|
self.sky.setFogOff()
|
|
|
|
self.sky.reparentTo(camera)
|
|
|
|
self.sky.setTransparency(TransparencyAttrib.MDual, 1)
|
|
|
|
fadeIn = self.sky.colorScaleInterval(1.5, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0.25), blendType='easeInOut')
|
|
|
|
fadeIn.start()
|
|
|
|
self.sky.setZ(0.0)
|
|
|
|
self.sky.setHpr(0.0, 0.0, 0.0)
|
|
|
|
ce = CompassEffect.make(NodePath(), CompassEffect.PRot | CompassEffect.PZ)
|
|
|
|
self.sky.node().setEffect(ce)
|