def startConclusion(self, losingTeam):
        DistributedPartyTeamActivity.startConclusion(self, losingTeam)
        if self.isLocalToonPlaying:
            self._rewardFinishedSV.set(False)
            if losingTeam == PartyGlobals.TeamActivityNeitherTeam:
                self.setStatus(TTLocalizer.PartyTeamActivityGameTie)
            else:
                self.setStatus(TTLocalizer.PartyTugOfWarGameEnd)
            self.showStatus()
        if losingTeam == PartyGlobals.TeamActivityNeitherTeam:
            for toonId in self.getToonIdsAsList():
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('neutral')

        else:
            for toonId in self.toonIds[losingTeam]:
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('neutral')

            for toonId in self.toonIds[1 - losingTeam]:
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('victory')

        for ival in self.toonIdsToAnimIntervals.values():
            if ival is not None:
                ival.finish()

        return
Ejemplo n.º 2
0
    def startConclusion(self, losingTeam):
        DistributedPartyTeamActivity.startConclusion(self, losingTeam)
        if self.isLocalToonPlaying:
            self._rewardFinishedSV.set(False)
            if losingTeam == PartyGlobals.TeamActivityNeitherTeam:
                self.setStatus(TTLocalizer.PartyTeamActivityGameTie)
            else:
                self.setStatus(TTLocalizer.PartyTugOfWarGameEnd)
            self.showStatus()
        if losingTeam == PartyGlobals.TeamActivityNeitherTeam:
            for toonId in self.getToonIdsAsList():
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('neutral')

        else:
            for toonId in self.toonIds[losingTeam]:
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('neutral')

            for toonId in self.toonIds[1 - losingTeam]:
                if self.getAvatar(toonId):
                    self.getAvatar(toonId).loop('victory')

        for ival in self.toonIdsToAnimIntervals.values():
            if ival is not None:
                ival.finish()

        return
Ejemplo n.º 3
0
 def startConclusion(self, data):
     DistributedPartyTeamActivity.startConclusion(self, data)
     if self.isLocalToonPlaying:
         winner = 2
         if data[PartyGlobals.TeamActivityTeams.LeftTeam] > data[PartyGlobals.TeamActivityTeams.RightTeam]:
             winner = PartyGlobals.TeamActivityTeams.LeftTeam
         elif data[PartyGlobals.TeamActivityTeams.LeftTeam] < data[PartyGlobals.TeamActivityTeams.RightTeam]:
             winner = PartyGlobals.TeamActivityTeams.RightTeam
         if winner < 2:
             if self.getTeam(base.localAvatar.doId) == winner:
                 resultsText = TTLocalizer.PartyTeamActivityLocalAvatarTeamWins
             else:
                 resultsText = TTLocalizer.PartyTeamActivityWins % TTLocalizer.PartyCogTeams[winner]
         else:
             resultsText = TTLocalizer.PartyTeamActivityGameTie
         self.view.showResults(resultsText, winner, data)
    def startConclusion(self, data):
        # Data is the score of the two teams as a single digit:
        # <leftScore><rightScore>
        #
        # Therefore we split it into two with the computations:
        # leftScore = int(data / 10000)
        # rightScore = data % 10000
        #
        # Team score is 4-digit number from 0000 to 1000
        # Divided by 1000.0 will get you the approximate official distance that
        # was given by the AI

        DistributedPartyTeamActivity.startConclusion(self, data)

        if self.isLocalToonPlaying:
            score = (int(data / 10000), data % 10000)
            winner = 2

            # Left team wins
            if score[PartyGlobals.TeamActivityTeams.LeftTeam] > score[
                    PartyGlobals.TeamActivityTeams.RightTeam]:
                winner = PartyGlobals.TeamActivityTeams.LeftTeam
            # Right team wins
            elif score[PartyGlobals.TeamActivityTeams.LeftTeam] < score[
                    PartyGlobals.TeamActivityTeams.RightTeam]:
                winner = PartyGlobals.TeamActivityTeams.RightTeam

            if winner < 2:
                if self.getTeam(base.localAvatar.doId) == winner:
                    resultsText = TTLocalizer.PartyTeamActivityLocalAvatarTeamWins
                else:
                    resultsText = TTLocalizer.PartyTeamActivityWins % TTLocalizer.PartyCogTeams[
                        winner]
            else:
                resultsText = TTLocalizer.PartyTeamActivityGameTie

            self.view.showResults(resultsText, winner, score)