def __init__(self, cr):
     DistributedObject.DistributedObject.__init__(self, cr)
     self.barrelRoom = CogdoBarrelRoom.CogdoBarrelRoom()
     self.index = None
     self.state = None
     self.model = None
     self.collSphere = None
     self.collNode = None
     self.collNodePath = None
     self.availableTex = None
     self.usedTex = None
     self.brLaff = 0
Esempio n. 2
0
    def __init__(self, cr):
        DistributedObject.DistributedObject.__init__(self, cr)
        self.toons = []
        self.activeIntervals = {}
        self.openSfx = base.loadSfx('phase_5/audio/sfx/elevator_door_open.ogg')
        self.closeSfx = base.loadSfx(
            'phase_5/audio/sfx/elevator_door_close.ogg')
        self.suits = []
        self.reserveSuits = []
        self.joiningReserves = []
        self.distBldgDoId = None
        self._CogdoGameRepeat = config.GetBool('cogdo-game-repeat', 0)
        self.currentFloor = -1
        self.elevatorName = self.__uniqueName('elevator')
        self.floorModel = None
        self.elevatorOutOpen = 0
        self.BottomFloor_SuitPositions = [
            Point3(0, 15, 0),
            Point3(10, 20, 0),
            Point3(-7, 24, 0),
            Point3(-10, 0, 0)
        ]

        self.BottomFloor_SuitHs = [75, 170, -91, -44]

        self.Cubicle_SuitPositions = [
            Point3(0, 18, 0),
            Point3(10, 12, 0),
            Point3(-9, 11, 0),
            Point3(-3, 13, 0)
        ]

        self.Cubicle_SuitHs = [170, 56, -52, 10]

        self.BossOffice_SuitPositions = [
            Point3(0, 15, 0),
            Point3(10, 20, 0),
            Point3(-10, 6, 0),
            Point3(-17, 30, 0)
        ]

        self.BossOffice_SuitHs = [170, 120, 12, 38]

        self._wantBarrelRoom = config.GetBool('cogdo-want-barrel-room', 1)
        self.barrelRoom = CogdoBarrelRoom.CogdoBarrelRoom()
        self.brResults = [[], []]
        self.barrelRoomIntroTrack = None
        self.penthouseOutroTrack = None
        self.penthouseOutroChatDoneTrack = None
        self.penthouseIntroTrack = None
        self.waitMusic = base.loadMusic(
            'phase_7/audio/bgm/encntr_toon_winning_indoor.ogg')
        self.elevatorMusic = base.loadMusic(
            'phase_7/audio/bgm/tt_elevator.ogg')
        self.fsm = ClassicFSM.ClassicFSM('DistributedCogdoInterior', [
            State.State('WaitForAllToonsInside',
                        self.enterWaitForAllToonsInside,
                        self.exitWaitForAllToonsInside, ['Elevator']),
            State.State('Elevator', self.enterElevator, self.exitElevator,
                        ['Game', 'BattleIntro', 'BarrelRoomIntro']),
            State.State('Game', self.enterGame, self.exitGame, [
                'Resting', 'Failed', 'BattleIntro', 'BarrelRoomIntro',
                'Elevator'
            ]),
            State.State('BarrelRoomIntro', self.enterBarrelRoomIntro,
                        self.exitBarrelRoomIntro, ['CollectBarrels', 'Off']),
            State.State('CollectBarrels', self.enterCollectBarrels,
                        self.exitCollectBarrels, ['BarrelRoomReward', 'Off']),
            State.State('BarrelRoomReward', self.enterBarrelRoomReward,
                        self.exitBarrelRoomReward,
                        ['Battle', 'ReservesJoining', 'BattleIntro', 'Off']),
            State.State('BattleIntro', self.enterBattleIntro,
                        self.exitBattleIntro,
                        ['Battle', 'ReservesJoining', 'Off']),
            State.State('Battle', self.enterBattle, self.exitBattle,
                        ['Resting', 'Reward', 'ReservesJoining']),
            State.State('ReservesJoining', self.enterReservesJoining,
                        self.exitReservesJoining, ['Battle']),
            State.State('Resting', self.enterResting, self.exitResting,
                        ['Elevator']),
            State.State('Reward', self.enterReward, self.exitReward, ['Off']),
            State.State('Failed', self.enterFailed, self.exitFailed, ['Off']),
            State.State('Off', self.enterOff, self.exitOff,
                        ['Elevator', 'WaitForAllToonsInside', 'Battle'])
        ], 'Off', 'Off')

        self.fsm.enterInitialState()
        self._haveEntranceElevator = StateVar(False)
        self._stashEntranceElevator = StateVar(False)
        self._stashEntranceElevatorFC = FunctionCall(
            self._doStashEntranceElevator, self._haveEntranceElevator,
            self._stashEntranceElevator)
        self._entranceElevCallbacks = []
        self._doEntranceElevCallbacksFC = FunctionCall(
            self._doEntranceElevCallbacks, self._haveEntranceElevator)
        self.cage = None
        self.shopOwnerNpcId = None
        self.shopOwnerNpc = None
        self._movie = None
        self.SOSToonName = None
        self.FOType = None