Ejemplo n.º 1
0
    def _showAward(self, ctx):
        LOG_DEBUG('Show personal mission bonus award!', ctx)
        data = ctx[1].data
        achievements = []
        for recordIdx, value in data.get('popUpRecords', []):
            factory = getAchievementFactory(DB_ID_TO_RECORD[recordIdx])
            if factory is not None:
                a = factory.create(value=int(value))
                if a is not None:
                    achievements.append(a)

        if achievements:
            quests_events.showAchievementsAward(achievements)
        return
Ejemplo n.º 2
0
    def _showAward(self, ctx):
        achievements = []
        for vehTypeCompDescr, battleResult in ctx[1].data.iteritems():
            for recordIdx, value in battleResult.get('popUpRecords') or {}:
                recordName = DB_ID_TO_RECORD[recordIdx]
                if recordName in POTAPOV_QUESTS_GROUP:
                    factory = getAchievementFactory(recordName)
                    if factory is not None:
                        a = factory.create(value=int(value))
                        if a is not None:
                            achievements.append(a)

        if achievements:
            quests_events.showAchievementsAward(achievements)
Ejemplo n.º 3
0
    def _showAward(self, ctx):
        achievements = []
        popUpRecords = ctx[1].data.get('popUpRecords', [])
        for recordIdx, value in popUpRecords:
            recordName = DB_ID_TO_RECORD[recordIdx]
            if recordName in PERSONAL_MISSIONS_GROUP:
                factory = getAchievementFactory(recordName)
                if factory is not None:
                    a = factory.create(value=int(value))
                    if a is not None:
                        achievements.append(a)

        if achievements:
            quests_events.showAchievementsAward(achievements)
        return
Ejemplo n.º 4
0
    def _showAward(self, ctx):
        achievements = []
        popUpRecords = ctx[1].data.get('popUpRecords', {})
        for recordIdx, value in popUpRecords.iteritems():
            recordName = DB_ID_TO_RECORD[recordIdx]
            if recordName in POTAPOV_QUESTS_GROUP:
                factory = getAchievementFactory(recordName)
                if factory is not None:
                    a = factory.create(value=int(value))
                    if a is not None:
                        achievements.append(a)

        if achievements:
            quests_events.showAchievementsAward(achievements)
        return
Ejemplo n.º 5
0
    def _showAward(self, ctx):
        data = ctx[1].data
        completedQuestIDs = set(data.get('completedQuestIDs', set()))
        achievements = []
        tokens = {}
        for recordIdx, value in data.get('popUpRecords') or {}:
            factory = getAchievementFactory(DB_ID_TO_RECORD[recordIdx])
            if factory is not None:
                a = factory.create(value=int(value))
                if a is not None:
                    achievements.append(a)

        for tokenID, tokenData in (data.get('tokens') or {}).iteritems():
            tokens[tokenID] = tokenData.get('count', 1)

        if len(achievements):
            quests_events.showAchievementsAward(achievements)
        for tID, tCount in tokens.iteritems():
            self.__tryToShowTokenAward(tID, tCount, completedQuestIDs)