def acceptedIntoTeam(self, spawnPoint):
     TeamMinigame.acceptedIntoTeam(self)
     self.sendUpdate('readyToStart')
     self.fsm.request('waitForOthers')
     pos, hpr = self.spawnPointsByTeam[self.team][spawnPoint]
     base.localAvatar.setPos(pos)
     base.localAvatar.setHpr(hpr)
 def incrementTeamScore(self, team):
     TeamMinigame.incrementTeamScore(self, team)
     if team == BLUE:
         self.blueScoreLbl.setText('BLUE: ' + str(self.scoreByTeam[team]))
         ToontownIntervals.start(ToontownIntervals.getPulseLargerIval(self.blueScoreLbl, 'blueScorePulse'))
     else:
         if team == RED:
             self.redScoreLbl.setText('RED: ' + str(self.scoreByTeam[team]))
             ToontownIntervals.start(ToontownIntervals.getPulseLargerIval(self.redScoreLbl, 'redScorePulse'))
    def __init__(self, cr):
        try:
            self.DistributedDodgeballGame_initialized
            return
        except:
            self.DistributedDodgeballGame_initialized = 1

        DistributedToonFPSGame.__init__(self, cr)
        TeamMinigame.__init__(self, 'BlueSnow', ('phase_4/maps/db_blue_neutral.png',
                                                 'phase_4/maps/db_blue_hover.png',
                                                 'phase_4/maps/db_blue_hover.png'), 'RedIce', ('phase_4/maps/db_red_neutral.png',
                                                                                               'phase_4/maps/db_red_hover.png',
                                                                                               'phase_4/maps/db_red_hover.png'))
        self.fsm.addState(State('chooseTeam', self.enterChooseTeam, self.exitChooseTeam, ['waitForOthers']))
        self.fsm.addState(State('scrollBy', self.enterScrollBy, self.exitScrollBy, ['countdown']))
        self.fsm.addState(State('countdown', self.enterCountdown, self.exitCountdown, ['play']))
        self.fsm.addState(State('announceGameOver', self.enterAnnGameOver, self.exitAnnGameOver, ['displayWinners']))
        self.fsm.addState(State('displayWinners', self.enterDisplayWinners, self.exitDisplayWinners, ['gameOver']))
        self.fsm.getStateNamed('waitForOthers').addTransition('chooseTeam')
        self.fsm.getStateNamed('waitForOthers').addTransition('scrollBy')
        self.fsm.getStateNamed('play').addTransition('announceGameOver')
        self.firstPerson = DodgeballFirstPerson(self)
        self.scrollBySeq = None
        self.infoText = None
        self.redScoreLbl = None
        self.blueScoreLbl = None
        self.infoText = getAlertText()
        self.spawnPointsByTeam = {BLUE: [
                [
                 Point3(5, 15, 0), Vec3(180, 0, 0)],
                [
                 Point3(15, 15, 0), Vec3(180, 0, 0)],
                [
                 Point3(-5, 15, 0), Vec3(180, 0, 0)],
                [
                 Point3(-15, 15, 0), Vec3(180, 0, 0)]], 
           RED: [
               [
                Point3(5, -15, 0), Vec3(0, 0, 0)],
               [
                Point3(15, -15, 0), Vec3(0, 0, 0)],
               [
                Point3(-5, -15, 0), Vec3(0, 0, 0)],
               [
                Point3(-15, -15, 0), Vec3(0, 0, 0)]]}
        self.winnerMusic = base.loadMusic('phase_9/audio/bgm/encntr_hall_of_fame.mid')
        self.loserMusic = base.loadMusic('phase_9/audio/bgm/encntr_sting_announce.mid')
        self.danceSound = base.loadSfx('phase_3.5/audio/sfx/ENC_Win.ogg')
        self.sky = None
        self.arena = None
        self.fog = None
        self.snow = None
        self.snowRender = None
        self.trees = []
        self.snowballs = []
        return
    def __init__(self, cr):
        try:
            self.DistributedDodgeballGame_initialized
            return
        except:
            self.DistributedDodgeballGame_initialized = 1

        DistributedToonFPSGame.__init__(self, cr)

        TeamMinigame.__init__(self, "BlueSnow", ('phase_4/maps/db_blue_neutral.png',
                                               'phase_4/maps/db_blue_hover.png',
                                               'phase_4/maps/db_blue_hover.png'),
                                    "RedIce", ('phase_4/maps/db_red_neutral.png',
                                               'phase_4/maps/db_red_hover.png',
                                               'phase_4/maps/db_red_hover.png'))

        self.fsm.addState(State('chooseTeam', self.enterChooseTeam, self.exitChooseTeam, ['waitForOthers']))
        self.fsm.addState(State('scrollBy', self.enterScrollBy, self.exitScrollBy, ['countdown']))
        self.fsm.addState(State('countdown', self.enterCountdown, self.exitCountdown, ['play']))
        self.fsm.getStateNamed('waitForOthers').addTransition('chooseTeam')
        self.fsm.getStateNamed('waitForOthers').addTransition('scrollBy')

        self.firstPerson = DodgeballFirstPerson(self)

        self.scrollBySeq = None
        self.infoText = None

        self.infoText = getAlertText()

        self.spawnPointsByTeam = {
            BLUE: [
                [Point3(5, 15, 0), Vec3(180, 0, 0)],
                [Point3(15, 15, 0), Vec3(180, 0, 0)],
                [Point3(-5, 15, 0), Vec3(180, 0, 0)],
                [Point3(-15, 15, 0), Vec3(180, 0, 0)]],
            RED: [
                [Point3(5, -15, 0), Vec3(0, 0, 0)],
                [Point3(15, -15, 0), Vec3(0, 0, 0)],
                [Point3(-5, -15, 0), Vec3(0, 0, 0)],
                [Point3(-15, -15, 0), Vec3(0, 0, 0)]]}

        # Environment vars
        self.sky = None
        self.arena = None
        self.fog = None
        self.snow = None
        self.snowRender = None
        self.trees = []
        self.snowballs = []
 def teamWon(self, team, time=0):
     TeamMinigame.teamWon(self, team, time)
     base.localAvatar.disableAvatarControls()
     self.firstPerson.end()
     self.deleteTimer()
     self.fsm.request('announceGameOver', [time])