class IntroductionScene(CogTVScreen, FSM): '''Maybe have some boss like the chairman saying something - kind of like tti's blimp plan''' def __init__(self): CogTVScreen.__init__(self, 'IntroductionScene') FSM.__init__(self, 'IntroductionScene') self.hqLobby = loader.loadModel('phase_9/models/cogHQ/SellbotHQLobby') self.hqLobby.reparentTo(self) self.vp = BossCog() dna = SuitDNA() dna.newBossCog('s') self.vp.setDNA(dna) self.vp.reparentTo(self) self.vp.setPosHpr(6, 35, 0, 168, 0, 0) self.vp.loop('Bb_neutral') def delete(self): if self.vp is not None: self.vp.delete() self.vp = None if self.hqLobby is not None: self.hqLobby.removeNode() self.hqLobby = None IntroductionScene.delete(self) def enterSceneOne(self): self.setCamPos(1, -.5, 18, 0, 0, 0)
class CashbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'CashbotScene') FSM.__init__(self, 'CashbotScene') self.background = loader.loadModel('phase_10/models/cogHQ/EndVault.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('m') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(21.66, -117.47, 2.92, 228.01, 0, 0) self.boss.loop('Bb_neutral') self.subordinates = [] for name, (x, y, z, h, p, r) in (('rb', (33.41, -135.55, 14.68, 251.57, 0, 0)), ('mb', (38.75, -126.4, 14.68, 210.96, 0, 0))): subordinate = Suit.Suit() dna = SuitDNA() dna.newSuit(name) subordinate.setDNA(dna) subordinate.nametag.setNametag2d(None) subordinate.nametag.setNametag3d(None) subordinate.reparentTo(hidden) subordinate.setPosHpr(x, y, z, h, p, r) self.subordinates.append(subordinate) def delete(self): for subordinate in self.subordinates[:]: subordinate.delete() self.subordinates.remove(subordinate) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) def enterPhase1(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) for subordinate in self.subordinates: subordinate.loop('neutral') subordinate.reparentTo(self) def enterPhase2(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) def defaultExit(self): for subordinate in self.subordinates: subordinate.reparentTo(hidden)
class IntroductionScene(CogTVScreen, FSM): def __init__(self): CogTVScreen.__init__(self, 'IntroductionScene') FSM.__init__(self, 'IntroductionScene') self.hqLobby = loader.loadModel('phase_9/models/cogHQ/SellbotHQLobby') self.hqLobby.reparentTo(self) self.vp = BossCog() dna = SuitDNA() dna.newBossCog('s') self.vp.setDNA(dna) self.vp.reparentTo(self) self.vp.setPosHpr(6, 35, 0, 168, 0, 0) self.vp.loop('Bb_neutral') def delete(self): if self.vp is not None: self.vp.delete() self.vp = None if self.hqLobby is not None: self.hqLobby.removeNode() self.hqLobby = None IntroductionScene.delete(self) def enterSceneOne(self): self.setCamPos(1, -0.5, 18, 0, 0, 0)
class BossbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'BossbotScene') FSM.__init__(self, 'BossbotScene') self.background = loader.loadModel('phase_12/models/bossbotHQ/BanquetInterior_1.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('c') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(0, 236.89, 0, 180, 0, 0) self.boss.loop('Bb_neutral') def delete(self): if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0) def enterPhase1(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0) def enterPhase2(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0)
class BossbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'BossbotScene') FSM.__init__(self, 'BossbotScene') self.background = loader.loadModel( 'phase_12/models/bossbotHQ/BanquetInterior_1.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('c') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(0, 236.89, 0, 180, 0, 0) self.boss.loop('Bb_neutral') def delete(self): if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0) def enterPhase1(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0) def enterPhase2(self): self.setCameraPosHpr(0, 203.5, 23.5, 0, 354, 0)
class LawbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'LawbotScene') FSM.__init__(self, 'LawbotScene') self.background = loader.loadModel('phase_11/models/lawbotHQ/LawbotCourtroom3.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('l') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(-3.7, 0, 71.24, 180, 0, 0) self.boss.loop('Bb_neutral') self.chairs = [] chairModel = loader.loadModel('phase_11/models/lawbotHQ/LB_chairA.bam') for x, y, z, h, p, r in ((-16.5, 3.73, 81.58, 23.2, 0, 0), (8.5, 3.73, 81.58, 336.8, 0, 0)): chair = chairModel.copyTo(self) chair.setPosHpr(x, y, z, h, p, r) self.chairs.append(chair) chairModel.removeNode() self.couches = [] couchModel = loader.loadModel('phase_11/models/lawbotHQ/LB_couchA.bam') for x, y, z, h, p, r in ((-16.28, 19.88, 81.58, 23.2, 0, 0), (8.55, 19.42, 81.58, 333.43, 0, 0)): couch = couchModel.copyTo(self) couch.setPosHpr(x, y, z, h, p, r) self.couches.append(couch) couchModel.removeNode() def delete(self): for couch in self.couches[:]: couch.removeNode() self.couches.remove(couch) for chair in self.chairs[:]: chair.removeNode() self.chairs.remove(chair) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0) def enterPhase1(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0) def enterPhase2(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0)
class SellbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'SellbotScene') FSM.__init__(self, 'SellbotScene') self.background = loader.loadModel('phase_9/models/cogHQ/SellbotHQLobby.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('s') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(6.36, 34.23, 0, 169.7, 0, 0) self.boss.loop('Bb_neutral') self.subordinates = [] for name, (x, y, z, h, p, r) in (('mh', (-2.76, 16.68, 11.63, 195.95, 0, 0)), ('ms', (7.18, 14.98, 12.57, 153.43, 0, 0)), ('tf', (-1.55, 62.22, 15.27, 180, 0, 0))): subordinate = Suit.Suit() dna = SuitDNA() dna.newSuit(name) subordinate.setDNA(dna) subordinate.nametag.setNametag2d(None) subordinate.nametag.setNametag3d(None) subordinate.reparentTo(hidden) subordinate.setPosHpr(x, y, z, h, p, r) self.subordinates.append(subordinate) def delete(self): for subordinate in self.subordinates[:]: subordinate.delete() self.subordinates.remove(subordinate) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) def enterPhase1(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) for subordinate in self.subordinates: subordinate.loop('neutral') subordinate.reparentTo(self) def enterPhase2(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) def defaultExit(self): for subordinate in self.subordinates: subordinate.reparentTo(hidden)
class LawbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'LawbotScene') FSM.__init__(self, 'LawbotScene') self.background = loader.loadModel( 'phase_11/models/lawbotHQ/LawbotCourtroom3.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('l') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(-3.7, 0, 71.24, 180, 0, 0) self.boss.loop('Bb_neutral') self.chairs = [] chairModel = loader.loadModel('phase_11/models/lawbotHQ/LB_chairA.bam') for x, y, z, h, p, r in ((-16.5, 3.73, 81.58, 23.2, 0, 0), (8.5, 3.73, 81.58, 336.8, 0, 0)): chair = chairModel.copyTo(self) chair.setPosHpr(x, y, z, h, p, r) self.chairs.append(chair) chairModel.removeNode() self.couches = [] couchModel = loader.loadModel('phase_11/models/lawbotHQ/LB_couchA.bam') for x, y, z, h, p, r in ((-16.28, 19.88, 81.58, 23.2, 0, 0), (8.55, 19.42, 81.58, 333.43, 0, 0)): couch = couchModel.copyTo(self) couch.setPosHpr(x, y, z, h, p, r) self.couches.append(couch) couchModel.removeNode() def delete(self): for couch in self.couches[:]: couch.removeNode() self.couches.remove(couch) for chair in self.chairs[:]: chair.removeNode() self.chairs.remove(chair) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0) def enterPhase1(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0) def enterPhase2(self): self.setCameraPosHpr(-3.84, -29.84, 93.08, 0, 348, 0)
class SellbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'SellbotScene') FSM.__init__(self, 'SellbotScene') self.background = loader.loadModel( 'phase_9/models/cogHQ/SellbotHQLobby.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('s') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(6.36, 34.23, 0, 169.7, 0, 0) self.boss.loop('Bb_neutral') self.subordinates = [] for name, (x, y, z, h, p, r) in (('mh', (-2.76, 16.68, 11.63, 195.95, 0, 0)), ('ms', (7.18, 14.98, 12.57, 153.43, 0, 0)), ('tf', (-1.55, 62.22, 15.27, 180, 0, 0))): subordinate = Suit.Suit() dna = SuitDNA() dna.newSuit(name) subordinate.setDNA(dna) subordinate.nametag.setNametag2d(None) subordinate.nametag.setNametag3d(None) subordinate.reparentTo(hidden) subordinate.setPosHpr(x, y, z, h, p, r) self.subordinates.append(subordinate) def delete(self): for subordinate in self.subordinates[:]: subordinate.delete() self.subordinates.remove(subordinate) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) def enterPhase1(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) for subordinate in self.subordinates: subordinate.loop('neutral') subordinate.reparentTo(self) def enterPhase2(self): self.setCameraPosHpr(0.9, -0.6, 17.72, 354.81, 0, 0) def defaultExit(self): for subordinate in self.subordinates: subordinate.reparentTo(hidden)
class CashbotScene(TelevisionScene, FSM): def __init__(self): TelevisionScene.__init__(self, 'CashbotScene') FSM.__init__(self, 'CashbotScene') self.background = loader.loadModel( 'phase_10/models/cogHQ/EndVault.bam') self.background.reparentTo(self) self.boss = BossCog() dna = SuitDNA() dna.newBossCog('m') self.boss.setDNA(dna) self.boss.reparentTo(self) self.boss.setPosHpr(21.66, -117.47, 2.92, 228.01, 0, 0) self.boss.loop('Bb_neutral') self.subordinates = [] for name, (x, y, z, h, p, r) in (('rb', (33.41, -135.55, 14.68, 251.57, 0, 0)), ('mb', (38.75, -126.4, 14.68, 210.96, 0, 0))): subordinate = Suit.Suit() dna = SuitDNA() dna.newSuit(name) subordinate.setDNA(dna) subordinate.nametag.setNametag2d(None) subordinate.nametag.setNametag3d(None) subordinate.reparentTo(hidden) subordinate.setPosHpr(x, y, z, h, p, r) self.subordinates.append(subordinate) def delete(self): for subordinate in self.subordinates[:]: subordinate.delete() self.subordinates.remove(subordinate) if self.boss is not None: self.boss.delete() self.boss = None if self.background is not None: self.background.removeNode() self.background = None TelevisionScene.delete(self) def enterPhase0(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) def enterPhase1(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) for subordinate in self.subordinates: subordinate.loop('neutral') subordinate.reparentTo(self) def enterPhase2(self): self.setCameraPosHpr(48.05, -142.49, 20.16, 48.01, 0, 0) def defaultExit(self): for subordinate in self.subordinates: subordinate.reparentTo(hidden)