def load(self): Place.Place.load(self) self.parentFSM.getStateNamed('suitInterior').addChild(self.fsm) self.townBattle = TownBattle.TownBattle('town-battle-done') self.townBattle.load() for i in xrange(1, 3): Suit.loadSuits(i)
def load(self): Place.Place.load(self) self.parentFSM.getStateNamed("cogdoInterior").addChild(self.fsm) self.townBattle = TownBattle.TownBattle("town-battle-done") self.townBattle.load() for i in xrange(1, 3): Suit.loadSuits(i)
def unload(self): BattlePlace.BattlePlace.unload(self) self.parentFSM.getStateNamed('cogHQBossBattle').removeChild(self.fsm) del self.parentFSM del self.fsm self.ignoreAll() for i in xrange(1, 3): Suit.unloadSuits(i)
def load(self, zoneId): self.parentFSMState.addChild(self.fsm) self.music = base.loadMusic(self.musicFile) self.battleMusic = base.loadMusic('phase_9/audio/bgm/encntr_suit_winning.ogg') self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent) self.townBattle.load() Suit.loadSuits(3) self.loadPlaceGeom(zoneId)
def load(self, zoneId): self.parentFSMState.addChild(self.fsm) self.music = base.loadMusic(self.musicFile) self.battleMusic = base.loadMusic( 'phase_9/audio/bgm/encntr_suit_winning.ogg') self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent) self.townBattle.load() Suit.loadSuits(3) self.loadPlaceGeom(zoneId)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(3) dnaFile = 'phase_8/dna/the_burrrgh_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile) self.windSound = map(base.loadSfx, ['phase_8/audio/sfx/SZ_TB_wind_1.ogg', 'phase_8/audio/sfx/SZ_TB_wind_2.ogg', 'phase_8/audio/sfx/SZ_TB_wind_3.ogg']) self.snow = BattleParticles.loadParticleFile('snowdisk.ptf') self.snow.setPos(0, 0, 5) self.snowRender = self.geom.attachNewNode('snowRender') self.snowRender.setDepthWrite(0) self.snowRender.setBin('fixed', 1)
def unload(self): Place.Place.unload(self) self.parentFSM.getStateNamed('suitInterior').removeChild(self.fsm) del self.parentFSM del self.fsm self.ignoreAll() ModelPool.garbageCollect() TexturePool.garbageCollect() self.townBattle.unload() self.townBattle.cleanup() del self.townBattle for i in xrange(1, 3): Suit.unloadSuits(i)
def unload(self): self.unloadPlaceGeom() self.parentFSMState.removeChild(self.fsm) del self.parentFSMState del self.fsm self.townBattle.unload() self.townBattle.cleanup() del self.townBattle del self.battleMusic Suit.unloadSuits(3) Suit.unloadSkelDialog() del self.hood ModelPool.garbageCollect() TexturePool.garbageCollect()
def parseLoadSuit(self, line): token, name, suitType = line suit = Suit.Suit() dna = SuitDNA.SuitDNA() dna.newSuit(suitType) suit.setDNA(dna) self.setVar(name, suit)
def __init__(self, index, collSolid, motionPath=None): self.prop = None self.suit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(Globals.Gameplay.MinionDnaName) self.suit.setDNA(d) self.suit.setScale(Globals.Gameplay.MinionScale) self.suit.nametag3d.stash() self.suit.nametag.destroy() swapAvatarShadowPlacer(self.suit, 'minion-%sShadowPlacer' % index) self.mopathNodePath = NodePath('mopathNodePath') self.suit.reparentTo(self.mopathNodePath) CogdoFlyingObstacle.__init__( self, Globals.Level.ObstacleTypes.Minion, index, self.mopathNodePath, collSolid, motionPath=motionPath, motionPattern=CogdoFlyingObstacle.MotionTypes.Loop, blendMotion=False, instanceModel=False) self.lastPos = None self.suit.loop('neutral') return
def load(self): if self.isLoaded == 1: return None self.isLoaded = 1 gui = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui') guiButton = loader.loadModel('phase_3/models/gui/quit_button') self.head = Suit.attachSuitHead(self, self.suitName) z = self.head.getZ() self.head.setPos(-0.4, -0.1, z + 0.14) self.suitLabel = DirectLabel(parent=self, relief=None, text=self.suitFullName, text_font=ToontownGlobals.getSuitFont(), pos=(-0.4, 0, -0.085), scale=0.07) closeButtonImage = (gui.find('**/CloseBtn_UP'), gui.find('**/CloseBtn_DN'), gui.find('**/CloseBtn_Rllvr')) buttonImage = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')) disabledColor = Vec4(0.5, 0.5, 0.5, 1) base.cr.lmao = self self.summonBuildingButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton1, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.06, text_pos=(0, -0.01), pos=(0.3, 0, 0.35), command=self.issueSummons, extraArgs=['building']) self.summonInvasionButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton2, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.06, text_pos=(0, -0.01), pos=(0.3, 0, 0.225), command=self.issueSummons, extraArgs=['invasion']) self.summonCogdoButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton3, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.06, text_pos=(0, -0.01), pos=(0.3, 0, 0.1), command=self.issueSummons, extraArgs=['cogdo']) self.summonSkelInvasionButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton4, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.051, text_pos=(0, -0.01), pos=(0.3, 0, -0.025), command=self.issueSummons, extraArgs=['skelinvasion']) self.summonWaiterInvasionButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton5, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.056, text_pos=(0, -0.01), pos=(0.3, 0, -0.15), command=self.issueSummons, extraArgs=['waiterinvasion']) self.summonV2InvasionButton = DirectButton(parent=self, relief=None, text=TTLocalizer.SummonDlgButton6, image=buttonImage, image_scale=(1.7, 1, 1), image3_color=disabledColor, text_scale=0.048, text_pos=(0, -0.01), pos=(0.3, 0, -0.275), command=self.issueSummons, extraArgs=['v2invasion']) self.statusLabel = DirectLabel(parent=self, relief=None, text='', text_wordwrap=12, pos=(0.3, 0, 0.3), scale=0.07) self.cancel = DirectButton(parent=self, relief=None, image=closeButtonImage, pos=(0.7, 0, -0.366), command=self.__cancel) gui.removeNode() guiButton.removeNode() self.hide() return
def addSuitHead(self, panel, suitName): panelIndex = self.panels.index(panel) shadow = panel.attachNewNode('shadow') shadowModel = self.shadowModels[panelIndex] shadowModel.copyTo(shadow) coords = SHADOW_SCALE_POS[panelIndex] shadow.setScale(coords[0]) shadow.setPos(coords[1], coords[2], coords[3]) panel.shadow = shadow panel.head = Suit.attachSuitHead(panel, suitName)
def setupEnemy(self, suitAttribs): suitType = suitAttribs[0] self.suit = Suit.Suit() suitDNA = SuitDNA.SuitDNA() suitDNA.newSuit(suitType) self.suit.setDNA(suitDNA) self.suit.pose('walk', 0) self.suitName = 'Enemy-%s' % self.index self.suit.setName(self.suitName) self.suit.nametag3d.stash() self.suit.nametag.destroy() suitPosAttribs = suitAttribs[1] initX, initY, initZ = suitPosAttribs[0] initPos = Point3(initX, initY, initZ) if len(suitPosAttribs) == 3: finalX, finalY, finalZ = suitPosAttribs[1] finalPos = Point3(finalX, finalY, finalZ) posIvalDuration = suitPosAttribs[2] self.clearMoveIval() def getForwardIval(blendTypeStr, self = self): forwardIval = LerpPosInterval(self.suit, posIvalDuration, pos=finalPos, startPos=initPos, name='%s-moveFront' % self.suitName, blendType=blendTypeStr, fluid=1) return forwardIval def getBackwardIval(blendTypeStr, self = self): backwardIval = LerpPosInterval(self.suit, posIvalDuration, pos=initPos, startPos=finalPos, name='%s-moveBack' % self.suitName, blendType=blendTypeStr, fluid=1) return backwardIval if abs(finalZ - initZ) > 0.0: def setIsGoingUp(value): self.isGoingUp = value self.isMovingUpDown = True self.suit.setH(90) self.suit.prop = None if self.suit.prop == None: self.suit.prop = BattleProps.globalPropPool.getProp('propeller') self.suit.prop.setScale(1.1) self.suit.prop.setColor(1, 1, 0.6, 1) head = self.suit.find('**/joint_head') self.suit.prop.reparentTo(head) self.propTrack = Sequence(ActorInterval(self.suit.prop, 'propeller', startFrame=8, endFrame=25, playRate=2.0)) self.animTrack = Sequence(ActorInterval(self.suit, 'landing', startFrame=8, endFrame=28, playRate=0.5), ActorInterval(self.suit, 'landing', startFrame=8, endFrame=28, playRate=-0.5)) self.moveIval = Sequence(Func(setIsGoingUp, True), getForwardIval('easeInOut'), Func(setIsGoingUp, False), getBackwardIval('easeInOut')) self.suitSound = base.loadSfx('phase_4/audio/sfx/TB_propeller.ogg') else: self.isMovingLeftRight = True self.moveIval = Sequence(Func(self.setHeading, finalPos, initPos), getForwardIval('noBlend'), Func(self.setHeading, initPos, finalPos), getBackwardIval('noBlend')) self.suit.setPos(initX, initY, initZ) self.suit.dropShadow.hide() self.setupCollision() return
def makeSuit(self, suitType): suit = Suit.Suit() dna = SuitDNA.SuitDNA() dna.newSuit(suitType) suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): part.hide() suit.loop('neutral')
def createSuitHead(self, suitName): suitDNA = SuitDNA.SuitDNA() suitDNA.newSuit(suitName) suit = Suit.Suit() suit.setDNA(suitDNA) headParts = suit.getHeadParts() head = hidden.attachNewNode('head') for part in headParts: copyPart = part.copyTo(head) copyPart.setDepthTest(1) copyPart.setDepthWrite(1) self.fitGeometry(head, fFlip=1) suit.delete() suit = None return head
def createDiner(self, i): diner = Suit.Suit() diner.dna = SuitDNA.SuitDNA() level = self.dinerInfo[i][2] level -= 4 dept = self.dinerInfo[i][3][i] diner.dna.newSuitRandom(level=level, dept=dept) diner.setDNA(diner.dna) diner.nametag3d.stash() diner.nametag.destroy() if self.useNewAnimations: diner.loop('sit', fromFrame=i) else: diner.pose('landing', 0) locator = self.tableGroup.find('**/chair_%d' % (i + 1)) locatorScale = locator.getNetTransform().getScale()[0] correctHeadingNp = locator.attachNewNode('correctHeading') self.chairLocators[i] = correctHeadingNp heading = self.rotationsPerSeatIndex[i] correctHeadingNp.setH(heading) sitLocator = correctHeadingNp.attachNewNode('sitLocator') base.sitLocator = sitLocator pos = correctHeadingNp.getPos(render) if SuitDNA.getSuitBodyType(diner.dna.name) == 'c': sitLocator.setPos(0.5, 3.65, -3.75) else: sitLocator.setZ(-2.4) sitLocator.setY(2.5) sitLocator.setX(0.5) self.sitLocators[i] = sitLocator diner.setScale(1.0 / locatorScale) diner.reparentTo(sitLocator) newLoc = NodePath('serviceLoc-%d-%d' % (self.index, i)) newLoc.reparentTo(correctHeadingNp) newLoc.setPos(0, 3.0, 1) self.serviceLocs[i] = newLoc base.serviceLoc = newLoc head = diner.find('**/joint_head') newIndicator = DinerStatusIndicator.DinerStatusIndicator(parent=head, pos=Point3( 0, 0, 3.5), scale=5.0) newIndicator.wrtReparentTo(diner) self.dinerStatusIndicators[i] = newIndicator return diner
def __init__(self, cogIndex, suitType, game, cogSpeed): self.cogIndex = cogIndex self.suitType = suitType self.game = game self.cogSpeed = cogSpeed suit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(suitType) suit.setDNA(d) suit.pose('walk', 0) self.suit = suit self.goal = CTGG.NoGoal self.goalId = CTGG.InvalidGoalId self.lastLocalTimeStampFromAI = 0 self.lastPosFromAI = Point3(0, 0, 0) self.lastThinkTime = 0 self.doneAdjust = False self.barrel = CTGG.NoBarrelCarried self.signalledAtReturnPos = False self.defaultPlayRate = 1.0 self.netTimeSentToStartByHit = 0 self.velocity = Vec3(0, 0, 0) self.oldVelocity = Vec3(0, 0, 0) self.acceleration = Vec3(0, 0, 0) self.bodyLength = self.CollisionRadius * 2 self.cruiseDistance = 2 * self.bodyLength self.maxVelocity = self.cogSpeed self.maxAcceleration = 5.0 self.perceptionRange = 6 self.notify.debug('cogSpeed=%s' % self.cogSpeed) self.kaboomSound = loader.loadSfx( 'phase_4/audio/sfx/MG_cannon_fire_alt.ogg') self.kaboom = loader.loadModel( 'phase_4/models/minigames/ice_game_kaboom') self.kaboom.setScale(2.0) self.kaboom.setBillboardPointEye() self.kaboom.hide() self.kaboomTrack = None splatName = 'splat-creampie' self.splat = globalPropPool.getProp(splatName) self.splat.setBillboardPointEye() self.splatType = globalPropPool.getPropType(splatName) self.pieHitSound = globalBattleSoundCache.getSound( 'AA_wholepie_only.ogg') return
def __init__(self, nest, index, suitDnaName = 'le'): FSM.__init__(self, 'CogdoFlyingLegalEagle') self.defaultTransitions = {'Off': ['Roost'], 'Roost': ['TakeOff', 'Off'], 'TakeOff': ['LockOnToon', 'LandOnNest', 'Off'], 'LockOnToon': ['RetreatToNest', 'ChargeUpAttack', 'Off'], 'ChargeUpAttack': ['RetreatToNest', 'Attack', 'Off'], 'Attack': ['RetreatToSky', 'Off'], 'RetreatToSky': ['Cooldown', 'Off'], 'Cooldown': ['LockOnToon', 'LandOnNest', 'Off'], 'RetreatToNest': ['LandOnNest', 'Off'], 'LandOnNest': ['Roost', 'Off']} self.index = index self.nest = nest self.target = None self.isEagleInterested = False self.collSphere = None self.suit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(suitDnaName) self.suit.setDNA(d) self.suit.reparentTo(render) swapAvatarShadowPlacer(self.suit, 'legalEagle-%sShadowPlacer' % index) self.suit.setPos(self.nest.getPos(render)) self.suit.setHpr(-180, 0, 0) self.suit.stash() self.prop = None self.attachPropeller() head = self.suit.find('**/joint_head') self.interestConeOrigin = self.nest.attachNewNode('fakeHeadNodePath') self.interestConeOrigin.setPos(render, head.getPos(render) + Vec3(0, Globals.LegalEagle.InterestConeOffset, 0)) self.attackTargetPos = None self.startOfRetreatToSkyPos = None pathModel = CogdoUtil.loadFlyingModel('legalEaglePaths') self.chargeUpMotionPath = Mopath.Mopath(name='chargeUpMotionPath-%i' % self.index) self.chargeUpMotionPath.loadNodePath(pathModel.find('**/charge_path')) self.retreatToSkyMotionPath = Mopath.Mopath(name='retreatToSkyMotionPath-%i' % self.index) self.retreatToSkyMotionPath.loadNodePath(pathModel.find('**/retreat_path')) audioMgr = base.cogdoGameAudioMgr self._screamSfx = audioMgr.createSfx('legalEagleScream', self.suit) self.initIntervals() self.suit.nametag3d.stash() self.suit.nametag.destroy() return
def __init__( self, serialNum, maze, randomNumGen, cellWalkPeriod, difficulty, suitDnaName='f', startTile=None, ticFreq=MazeGameGlobals.SUIT_TIC_FREQ, walkSameDirectionProb=MazeGameGlobals.WALK_SAME_DIRECTION_PROB, walkTurnAroundProb=MazeGameGlobals.WALK_TURN_AROUND_PROB, uniqueRandomNumGen=True, walkAnimName=None): self.serialNum = serialNum self.maze = maze if uniqueRandomNumGen: self.rng = RandomNumGen(randomNumGen) else: self.rng = randomNumGen self.difficulty = difficulty self._walkSameDirectionProb = walkSameDirectionProb self._walkTurnAroundProb = walkTurnAroundProb self._walkAnimName = walkAnimName or 'walk' self.suit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(suitDnaName) self.suit.setDNA(d) self.suit.nametag3d.stash() self.suit.nametag.destroy() if startTile is None: defaultStartPos = MazeGameGlobals.SUIT_START_POSITIONS[ self.serialNum] self.startTile = (defaultStartPos[0] * self.maze.width, defaultStartPos[1] * self.maze.height) else: self.startTile = startTile self.ticFreq = ticFreq self.ticPeriod = int(cellWalkPeriod) self.cellWalkDuration = float(self.ticPeriod) / float(self.ticFreq) self.turnDuration = 0.6 * self.cellWalkDuration return
def createSuit(self): self.suit = Suit.Suit() suitDNA = SuitDNA.SuitDNA() suitDNA.newSuit('f') self.suit.setDNA(suitDNA) self.suit.nametag3d.stash() self.suit.nametag.destroy() self.suit.loop('neutral') self.suit.setPosHpr(-20, 8, 0, 0, 0, 0) self.suit.reparentTo(self.interior) self.suitWalkTrack = Sequence( self.suit.hprInterval(0.1, Vec3(0, 0, 0)), Func(self.suit.loop, 'walk'), self.suit.posInterval(2, Point3(-20, 20, 0)), Func(self.suit.loop, 'neutral'), Wait(1.0), self.suit.hprInterval(0.1, Vec3(180, 0, 0)), Func(self.suit.loop, 'walk'), self.suit.posInterval(2, Point3(-20, 10, 0)), Func(self.suit.loop, 'neutral'), Wait(1.0)) self.suitWalkTrack.loop()
def loadCogJuror(self): self.cleanupCogJuror() self.cogJuror = Suit.Suit() level = self.randomGenerator.randrange(len(SuitDNA.suitsPerLevel)) self.cogJuror.dna = SuitDNA.SuitDNA() self.cogJuror.dna.newSuitRandom(level=level, dept='l') self.cogJuror.setDNA(self.cogJuror.dna) self.cogJuror.pose('landing', 0) self.cogJuror.reparentTo(self.nodePath) self.cogJuror.prop = None if self.cogJuror.prop == None: self.cogJuror.prop = BattleProps.globalPropPool.getProp( 'propeller') head = self.cogJuror.find('**/joint_head') self.cogJuror.prop.reparentTo(head) self.propTrack = Sequence( ActorInterval(self.cogJuror.prop, 'propeller', startFrame=8, endFrame=25)) return
if music: music.setLoop(1) music.play() notify.info('Loading the default GUI sounds...') DirectGuiGlobals.setDefaultRolloverSound(base.loadSfx('phase_3/audio/sfx/GUI_rollover.ogg')) DirectGuiGlobals.setDefaultClickSound(base.loadSfx('phase_3/audio/sfx/GUI_create_toon_fwd.ogg')) else: music = None import ToontownLoader from direct.gui.DirectGui import * serverVersion = base.config.GetString('server-version', 'no_version_set') version = OnscreenText(serverVersion, pos=(-1.3, -0.975), scale=0.06, fg=Vec4(0, 0, 1, 0.6), align=TextNode.ALeft) version.setPos(0.03,0.03) version.reparentTo(base.a2dBottomLeft) from src.toontown.suit import Suit Suit.loadModels() loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE, 0) from ToonBaseGlobal import * from direct.showbase.MessengerGlobal import * from src.toontown.distributed import ToontownClientRepository cr = ToontownClientRepository.ToontownClientRepository(serverVersion) cr.music = music del music base.initNametagGlobals() base.cr = cr loader.endBulkLoad('init') from src.otp.friends import FriendManager from src.otp.distributed.OtpDoGlobals import * cr.generateGlobalObject(OTP_DO_ID_FRIEND_MANAGER, 'FriendManager') base.startShow(cr) backgroundNodePath.reparentTo(hidden)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(1) dnaFile = 'phase_5/dna/toontown_central_' + str( self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(3) del self.windSound del self.snow del self.snowRender
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(2) dnaFile = 'phase_6/dna/donalds_dock_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
DirectGuiGlobals.setDefaultClickSound( base.loadSfx('phase_3/audio/sfx/GUI_create_toon_fwd.ogg')) else: music = None import ToontownLoader from direct.gui.DirectGui import * serverVersion = base.config.GetString('server-version', 'no_version_set') version = OnscreenText(serverVersion, pos=(-1.3, -0.975), scale=0.06, fg=Vec4(0, 0, 1, 0.6), align=TextNode.ALeft) version.setPos(0.03, 0.03) version.reparentTo(base.a2dBottomLeft) from src.toontown.suit import Suit Suit.loadModels() loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE, 0) from ToonBaseGlobal import * from direct.showbase.MessengerGlobal import * from src.toontown.distributed import ToontownClientRepository cr = ToontownClientRepository.ToontownClientRepository(serverVersion) cr.music = music del music base.initNametagGlobals() base.cr = cr loader.endBulkLoad('init') from src.otp.friends import FriendManager from src.otp.distributed.OtpDoGlobals import * cr.generateGlobalObject(OTP_DO_ID_FRIEND_MANAGER, 'FriendManager') base.startShow(cr)
def unload(self): TownLoader.TownLoader.unload(self) Suit.unloadSuits(2)
def load(self): BattlePlace.BattlePlace.load(self) self.parentFSM.getStateNamed('cogHQBossBattle').addChild(self.fsm) self.townBattle = self.loader.townBattle for i in xrange(1, 3): Suit.loadSuits(i)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(2) dnaFile = 'phase_6/dna/minnies_melody_land_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(3) dnaFile = "phase_2/dna/forest_grove_" + str(self.canonicalBranchZone) + ".pdna" self.createHood(dnaFile)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(1) dnaFile = 'phase_5/dna/toontown_central_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def load(self): CogdoGameMovie.load(self) self.toonDNA = ToonDNA.ToonDNA() self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0) self.toonHead = Toon.Toon() self.toonHead.setDNA(self.toonDNA) self.makeSuit('sc') self.toonHead.getGeomNode().setDepthWrite(1) self.toonHead.getGeomNode().setDepthTest(1) self.toonHead.loop('neutral') self.toonHead.setPosHprScale(-0.73, 0, -1.27, 180, 0, 0, 0.18, 0.18, 0.18) self.toonHead.reparentTo(hidden) self.toonHead.startBlink() self.cogHead = Suit.Suit() self.cogDNA = SuitDNA.SuitDNA() self.cogDNA.newSuit('ms') self.cogHead.setDNA(self.cogDNA) self.cogHead.getGeomNode().setDepthWrite(1) self.cogHead.getGeomNode().setDepthTest(1) self.cogHead.loop('neutral') self.cogHead.setPosHprScale(-0.73, 0, -1.46, 180, 0, 0, 0.14, 0.14, 0.14) self.cogHead.reparentTo(hidden) self.cogHead.nametag3d.hide() self.clipPlane = self.toonHead.attachNewNode(PlaneNode('clip')) self.clipPlane.node().setPlane(Plane(0, 0, 1, 0)) self.clipPlane.setPos(0, 0, 2.45) audioMgr = base.cogdoGameAudioMgr self._cogDialogueSfx = audioMgr.createSfx('cogDialogue') self._toonDialogueSfx = audioMgr.createSfx('toonDialogue') suitData = Globals.SuitData[Globals.SuitTypes.Boss] bossSuit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(suitData['dnaName']) bossSuit.setDNA(d) bossSuit.nametag3d.stash() bossSuit.nametag.destroy() bossSuit.setScale(suitData['scale']) bossSuit.loop('neutral') bossSuit.reparentTo(render) bossSuit.setPos(self._exit, -5, -5, 0) bossSuit.lookAt(self._exit) self._suits.append(bossSuit) self._camHelperNode = NodePath('CamHelperNode') self._camHelperNode.reparentTo(render) dialogue = TTLocalizer.CogdoMazeIntroMovieDialogue introDuration = Globals.IntroDurationSeconds waitDuration = introDuration / len(dialogue) def start(): camera.wrtReparentTo(render) self._exit.open(animate=False) def showBoss(): self._setCamTarget(bossSuit, 20, offset=Point3(0, 0, 7), angle=Point3(0, 15, 0)) bossSuit.loop('victory') self._state = 1 def showExit(): self._setCamTarget(self._exit, 10, offset=Point3(0, 0, 0), angle=Point3(0, 60, 0)) self._exit.close() self._state = 2 showExitIval = Parallel( camera.posInterval(waitDuration * 0.5, (10, -25, 20), other=self._exit, blendType='easeInOut'), Sequence( Wait(waitDuration * 0.25), Func(bossSuit.play, 'effort'), camera.hprInterval(waitDuration * 0.25, (30, -30, 0), blendType='easeInOut'), Func(self._exit.close), Wait(waitDuration * 0.5))) def showWaterCooler(): wc = self._maze.getWaterCoolers()[0] self._setCamTarget(wc, 25, angle=Point3(-30, 60, 0)) camera.wrtReparentTo(self._camHelperNode) self._state = 3 def end(): self._stopUpdateTask() self._ival = Sequence( Func(start), Func(self.displayLine, 'toon', self._getRandomLine(dialogue[0])), showExitIval, Func(showWaterCooler), Func(self.displayLine, 'toon', self._getRandomLine(dialogue[1])), Wait(waitDuration), Func(showBoss), bossSuit.hprInterval(1.0, bossSuit.getHpr() + Point3(180, 0, 0), blendType='easeInOut'), Func(self.displayLine, 'toon', self._getRandomLine(dialogue[2])), Wait(waitDuration - 1.0), Func(end)) self._startUpdateTask()
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(2) dnaFile = 'phase_6/dna/donalds_dock_' + str( self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(3) dnaFile = 'phase_2/dna/forest_grove_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def setSuitHead(self, suitName): self.head = Suit.attachSuitHead(self, suitName) self.head.setX(0.1) self.head.setZ(0.01) self.head.setScale(0.05)
def load(self): CogdoGameMovie.load(self) self.toonDNA = ToonDNA.ToonDNA() self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0) self.toonHead = Toon.Toon() self.toonHead.setDNA(self.toonDNA) self.makeSuit('sc') self.toonHead.getGeomNode().setDepthWrite(1) self.toonHead.getGeomNode().setDepthTest(1) self.toonHead.loop('neutral') self.toonHead.setPosHprScale(-0.73, 0, -1.27, 180, 0, 0, 0.18, 0.18, 0.18) self.toonHead.reparentTo(hidden) self.toonHead.startBlink() self.cogHead = Suit.Suit() self.cogDNA = SuitDNA.SuitDNA() self.cogDNA.newSuit('le') self.cogHead.setDNA(self.cogDNA) self.cogHead.getGeomNode().setDepthWrite(1) self.cogHead.getGeomNode().setDepthTest(1) self.cogHead.loop('neutral') self.cogHead.setPosHprScale(-0.74, 0, -1.79, 180, 0, 0, 0.12, 0.14, 0.14) self.cogHead.reparentTo(hidden) self.cogHead.nametag3d.hide() self.clipPlane = self.toonHead.attachNewNode(PlaneNode('clip')) self.clipPlane.node().setPlane(Plane(0, 0, 1, 0)) self.clipPlane.setPos(0, 0, 2.45) audioMgr = base.cogdoGameAudioMgr self._cogDialogueSfx = audioMgr.createSfx('cogDialogue') self._toonDialogueSfx = audioMgr.createSfx('toonDialogue') def start(): camera.wrtReparentTo(render) self._startUpdateTask() def end(): self._stopUpdateTask() introDuration = Globals.Gameplay.IntroDurationSeconds dialogue = TTLocalizer.CogdoFlyingIntroMovieDialogue waitDur = introDuration / len(dialogue) flyDur = introDuration - waitDur * 0.5 flyThroughIval = Parallel( camera.posInterval(flyDur, self._exit.getPos(render) + Point3(0, -22, 1), blendType='easeInOut'), camera.hprInterval(flyDur, Point3(0, 5, 0), blendType='easeInOut')) self._ival = Sequence( Func(start), Parallel( flyThroughIval, Sequence( Func(self.displayLine, 'cog', self._getRandomLine(dialogue[0])), Wait(waitDur), Func(self.displayLine, 'toon', self._getRandomLine(dialogue[1])), Wait(waitDur), Func(self.displayLine, 'cog', self._getRandomLine(dialogue[2])), Wait(waitDur))), Func(end))
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadTutorialSuit() dnaFile = 'phase_3.5/dna/tutorial_street.pdna' self.createHood(dnaFile, loadStorage=0) self.alterDictionaries()
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(2) dnaFile = 'phase_6/dna/minnies_melody_land_' + str( self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)
def load(self): self.notify.debug('load') DistributedMinigame.load(self) self.defineConstants() groundModels = [ 'phase_4/models/minigames/treehouse_2players', 'phase_4/models/minigames/treehouse_2players', 'phase_4/models/minigames/treehouse_3players', 'phase_4/models/minigames/treehouse_4players' ] index = self.getNumPlayers() - 1 self.ground = loader.loadModel(groundModels[index]) self.ground.setHpr(180, -90, 0) self.dropShadow = loader.loadModel('phase_3/models/props/drop_shadow') self.dropObjModels = {} for objType in DropObjectTypes: if objType.name not in ['anvil', self.fruitName]: continue model = loader.loadModel(objType.modelPath) self.dropObjModels[objType.name] = model modelScales = { 'apple': 0.7, 'orange': 0.7, 'pear': 0.5, 'coconut': 0.7, 'watermelon': 0.6, 'pineapple': 0.45 } if objType.name in modelScales: model.setScale(modelScales[objType.name]) if objType == Name2DropObjectType['pear']: model.setZ(-.6) if objType == Name2DropObjectType['coconut']: model.setP(180) if objType == Name2DropObjectType['watermelon']: model.setH(135) model.setZ(-.5) if objType == Name2DropObjectType['pineapple']: model.setZ(-1.7) if objType == Name2DropObjectType['anvil']: model.setZ(-self.ObjRadius) model.flattenMedium() self.music = base.loadMusic('phase_4/audio/bgm/MG_toontag.ogg') self.sndGoodCatch = base.loadSfx( 'phase_4/audio/sfx/SZ_DD_treasure.ogg') self.sndOof = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_dirt.ogg') self.sndAnvilLand = base.loadSfx( 'phase_4/audio/sfx/AA_drop_anvil_miss.ogg') self.sndPerfect = base.loadSfx('phase_4/audio/sfx/ring_perfect.ogg') self.toonSDs = {} avId = self.localAvId toonSD = CatchGameToonSD.CatchGameToonSD(avId, self) self.toonSDs[avId] = toonSD toonSD.load() if self.WantSuits: suitTypes = ['f', 'tm', 'pp', 'dt'] self.suits = [] for type in suitTypes: suit = Suit.Suit() d = SuitDNA.SuitDNA() d.newSuit(type) suit.setDNA(d) suit.nametag3d.stash() suit.nametag.destroy() suit.pose('walk', 0) self.suits.append(suit) self.__textGen = TextNode('ringGame') self.__textGen.setFont(ToontownGlobals.getSignFont()) self.__textGen.setAlign(TextNode.ACenter) self.introMovie = self.getIntroMovie()
def load(self, zoneId): TownLoader.TownLoader.load(self, zoneId) Suit.loadSuits(3) dnaFile = 'phase_8/dna/daisys_garden_' + str(self.canonicalBranchZone) + '.pdna' self.createHood(dnaFile)