def __init__(self, cr):
    DistributedObject.__init__(self, cr)
    cr.invasion = self
    self.invasionOn = False
    self.accept('localPieSplat', self.__localPieSplat)
    self.accept('enterSuitAttack', self.__localToonHit)
    self.showFloor = base.render.find('**/ShowFloor')
    self.geom = base.cr.playGame.hood.loader.geom
    self.sky = loader.loadModel(SafezoneInvasionGlobals.CogSkyFile)
    self.sky.setBin('background', 100)
    self.sky.setColor(0.3, 0.3, 0.28, 1)
    self.sky.setTransparency(TransparencyAttrib.MDual, 1)
    self.sky.setDepthTest(0)
    self.sky.setDepthWrite(0)
    self.sky.setFogOff()
    self.sky.setZ((- 20.0))
    ce = CompassEffect.make(NodePath(), (CompassEffect.PRot | CompassEffect.PZ))
    self.sky.node().setEffect(ce)
    self.fadeIn = self.sky.colorScaleInterval(5.0, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0), blendType='easeInOut')
    self.cogSkyBegin = LerpColorScaleInterval(self.geom, 6.0, Vec4(0.4, 0.4, 0.4, 1), blendType='easeInOut')
    self.cogSkyBeginStage = LerpColorScaleInterval(self.showFloor, 6.0, Vec4(0.4, 0.4, 0.4, 1), blendType='easeInOut')
    self.beginSkySequence = Sequence(Func(self.fadeIn.start), Func(self.cogSkyBegin.start), Func(self.cogSkyBeginStage.start))
    self.fadeOut = self.sky.colorScaleInterval(6.0, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.cogSkyEnd = LerpColorScaleInterval(self.geom, 7.0, Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.cogSkyEndStage = LerpColorScaleInterval(self.showFloor, 7.0, Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.endSkySequence = Sequence(Func(self.fadeOut.start), Func(self.cogSkyEnd.start), Func(self.cogSkyEndStage.start), Wait(7), Func(self.sky.removeNode))
    base.cr.playGame.hood.loader.music.stop()
    self.musicEnter = base.loader.loadMusic(SafezoneInvasionGlobals.InvasionMusicEnter)
    self.victoryMusic = base.loader.loadMusic('phase_9/audio/bgm/CogHQ_finale.ogg')
def __init__(self, cr):
    DistributedObject.__init__(self, cr)
    cr.invasion = self
    self.invasionOn = False
    self.accept('localPieSplat', self.__localPieSplat)
    self.accept('enterSuitAttack', self.__localToonHit)
    self.showFloor = base.render.find('**/ShowFloor')
    self.geom = base.cr.playGame.hood.loader.geom
    self.sky = loader.loadModel(SafezoneInvasionGlobals.CogSkyFile)
    self.sky.setBin('background', 100)
    self.sky.setColor(0.3, 0.3, 0.28, 1)
    self.sky.setTransparency(TransparencyAttrib.MDual, 1)
    self.sky.setDepthTest(0)
    self.sky.setDepthWrite(0)
    self.sky.setFogOff()
    self.sky.setZ((- 20.0))
    ce = CompassEffect.make(NodePath(), (CompassEffect.PRot | CompassEffect.PZ))
    self.sky.node().setEffect(ce)
    self.fadeIn = self.sky.colorScaleInterval(5.0, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0), blendType='easeInOut')
    self.cogSkyBegin = LerpColorScaleInterval(self.geom, 6.0, Vec4(0.4, 0.4, 0.4, 1), blendType='easeInOut')
    self.cogSkyBeginStage = LerpColorScaleInterval(self.showFloor, 6.0, Vec4(0.4, 0.4, 0.4, 1), blendType='easeInOut')
    self.beginSkySequence = Sequence(Func(self.fadeIn.start), Func(self.cogSkyBegin.start), Func(self.cogSkyBeginStage.start))
    self.fadeOut = self.sky.colorScaleInterval(6.0, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.cogSkyEnd = LerpColorScaleInterval(self.geom, 7.0, Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.cogSkyEndStage = LerpColorScaleInterval(self.showFloor, 7.0, Vec4(1, 1, 1, 1), blendType='easeInOut')
    self.endSkySequence = Sequence(Func(self.fadeOut.start), Func(self.cogSkyEnd.start), Func(self.cogSkyEndStage.start), Wait(7), Func(self.sky.removeNode))
    base.cr.playGame.hood.loader.music.stop()
    self.musicEnter = base.loader.loadMusic(SafezoneInvasionGlobals.InvasionMusicEnter)
    self.victoryMusic = base.loader.loadMusic('phase_9/audio/bgm/CogHQ_finale.ogg')