mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Toon Hall has been literated!
This commit is contained in:
parent
d0fbe172e2
commit
5bfbeebfae
1 changed files with 5 additions and 82 deletions
|
@ -1,18 +1,11 @@
|
||||||
from direct.interval.IntervalGlobal import *
|
|
||||||
from direct.distributed.ClockDelta import *
|
|
||||||
from direct.showbase import Audio3DManager
|
|
||||||
from DistributedToonInterior import DistributedToonInterior
|
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
|
||||||
from direct.fsm import ClassicFSM, State
|
|
||||||
from direct.distributed import DistributedObject
|
|
||||||
from direct.fsm import State
|
|
||||||
from direct.actor import Actor
|
from direct.actor import Actor
|
||||||
|
from direct.interval.IntervalGlobal import *
|
||||||
|
from direct.showbase import Audio3DManager
|
||||||
from otp.ai.MagicWordGlobal import *
|
from otp.ai.MagicWordGlobal import *
|
||||||
from toontown.toonbase import ToontownGlobals
|
|
||||||
from toontown.toonbase.ToonBaseGlobal import *
|
|
||||||
from toontown.dna.DNAParser import *
|
from toontown.dna.DNAParser import *
|
||||||
from toontown.hood import ZoneUtil
|
from toontown.hood import ZoneUtil
|
||||||
from toontown.toon.DistributedNPCToonBase import DistributedNPCToonBase
|
from toontown.toon import DistributedNPCToonBase
|
||||||
|
from DistributedToonInterior import DistributedToonInterior
|
||||||
import ToonInteriorColors, random
|
import ToonInteriorColors, random
|
||||||
|
|
||||||
class DistributedToonHallInterior(DistributedToonInterior):
|
class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
|
@ -45,7 +38,7 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
del self.dnaStore
|
del self.dnaStore
|
||||||
del self.randomGenerator
|
del self.randomGenerator
|
||||||
self.interior.flattenMedium()
|
self.interior.flattenMedium()
|
||||||
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase):
|
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase.DistributedNPCToonBase):
|
||||||
npcToon.initToonState()
|
npcToon.initToonState()
|
||||||
|
|
||||||
self.createSillyMeter()
|
self.createSillyMeter()
|
||||||
|
@ -400,62 +393,6 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
def exitOff(self):
|
def exitOff(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def enterToon(self):
|
|
||||||
self.toonhallView = (Point3(0, -5, 3),
|
|
||||||
Point3(0, 12.0, 7.0),
|
|
||||||
Point3(0.0, 10.0, 5.0),
|
|
||||||
Point3(0.0, 10.0, 5.0),
|
|
||||||
1)
|
|
||||||
self.setupCollisions(2.5)
|
|
||||||
self.firstEnter = 1
|
|
||||||
self.accept('CamChangeColl' + '-into', self.handleCloseToWall)
|
|
||||||
|
|
||||||
def exitToon(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def handleCloseToWall(self, collEntry):
|
|
||||||
if self.firstEnter == 0:
|
|
||||||
return
|
|
||||||
interiorRopes = self.interior.find('**/*interior_ropes')
|
|
||||||
if interiorRopes == collEntry.getIntoNodePath().getParent():
|
|
||||||
return
|
|
||||||
self.restoreCam()
|
|
||||||
self.accept('CamChangeColl' + '-exit', self.handleAwayFromWall)
|
|
||||||
|
|
||||||
def handleAwayFromWall(self, collEntry):
|
|
||||||
if self.firstEnter == 1:
|
|
||||||
self.cleanUpCollisions()
|
|
||||||
self.setupCollisions(0.75)
|
|
||||||
self.oldView = base.localAvatar.cameraIndex
|
|
||||||
base.localAvatar.addCameraPosition(self.toonhallView)
|
|
||||||
self.firstEnter = 0
|
|
||||||
self.setUpToonHallCam()
|
|
||||||
return
|
|
||||||
flippy = self.interior.find('**/*Flippy*/*NPCToon*')
|
|
||||||
if flippy == collEntry.getIntoNodePath():
|
|
||||||
self.setUpToonHallCam()
|
|
||||||
|
|
||||||
def setupCollisions(self, radius):
|
|
||||||
r = base.localAvatar.getClampedAvatarHeight() * radius
|
|
||||||
cs = CollisionSphere(0, 0, 0, r)
|
|
||||||
cn = CollisionNode('CamChangeColl')
|
|
||||||
cn.addSolid(cs)
|
|
||||||
cn.setFromCollideMask(ToontownGlobals.WallBitmask)
|
|
||||||
cn.setIntoCollideMask(BitMask32.allOff())
|
|
||||||
self.camChangeNP = base.localAvatar.getPart('torso', '1000').attachNewNode(cn)
|
|
||||||
self.cHandlerEvent = CollisionHandlerEvent()
|
|
||||||
self.cHandlerEvent.addInPattern('%fn-into')
|
|
||||||
self.cHandlerEvent.addOutPattern('%fn-exit')
|
|
||||||
base.cTrav.addCollider(self.camChangeNP, self.cHandlerEvent)
|
|
||||||
|
|
||||||
def cleanUpCollisions(self):
|
|
||||||
base.cTrav.removeCollider(self.camChangeNP)
|
|
||||||
self.camChangeNP.detachNode()
|
|
||||||
if hasattr(self, 'camChangeNP'):
|
|
||||||
del self.camChangeNP
|
|
||||||
if hasattr(self, 'cHandlerEvent'):
|
|
||||||
del self.cHandlerEvent
|
|
||||||
|
|
||||||
def cleanUpSounds(self):
|
def cleanUpSounds(self):
|
||||||
|
|
||||||
def __cleanUpSound__(soundFile):
|
def __cleanUpSound__(soundFile):
|
||||||
|
@ -488,22 +425,8 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
__cleanUpSound__(self.arrowSfx)
|
__cleanUpSound__(self.arrowSfx)
|
||||||
del self.arrowSfx
|
del self.arrowSfx
|
||||||
|
|
||||||
def setUpToonHallCam(self):
|
|
||||||
base.localAvatar.setCameraFov(75)
|
|
||||||
base.localAvatar.setCameraSettings(self.toonhallView)
|
|
||||||
|
|
||||||
def restoreCam(self):
|
|
||||||
base.localAvatar.setCameraFov(ToontownGlobals.DefaultCameraFov)
|
|
||||||
if hasattr(self, 'oldView'):
|
|
||||||
base.localAvatar.setCameraPositionByIndex(self.oldView)
|
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
self.setUpToonHallCam()
|
|
||||||
base.localAvatar.removeCameraPosition()
|
|
||||||
base.localAvatar.resetCameraPosition()
|
|
||||||
self.restoreCam()
|
|
||||||
self.ignoreAll()
|
self.ignoreAll()
|
||||||
self.cleanUpCollisions()
|
|
||||||
self.stopSillyMeter()
|
self.stopSillyMeter()
|
||||||
self.enterOff()
|
self.enterOff()
|
||||||
DistributedToonInterior.disable(self)
|
DistributedToonInterior.disable(self)
|
||||||
|
|
Loading…
Reference in a new issue