Exemple #1
0
 def _getBonuses(self, operation):
     hiddenQuests = self._eventsCache.getHiddenQuests()
     finder = finders.getQuestByTokenAndBonus
     baseQuest = finder(hiddenQuests, finders.addQuestTokenFinder(operation.getID()))
     bonuses = baseQuest.getBonuses()
     if not operation.getNextOperationID():
         topBageQuest = finder(hiddenQuests, finders.tokenFinder(finders.PERSONAL_MISSION_BADGES_TOKEN))
         bonuses.extend(topBageQuest.getBonuses())
     return bonuses
Exemple #2
0
 def _getBonuses(self, operation):
     ctx = {'branch': operation.getBranch()}
     hiddenQuests = self._eventsCache.getHiddenQuests()
     finder = finders.getQuestByTokenAndBonus
     baseQuest = finder(hiddenQuests,
                        finders.addQuestTokenFinder(operation))
     bonuses = baseQuest.getBonuses(ctx=ctx)
     if not operation.getNextOperationIDs():
         token = finders.PERSONAL_MISSION_BADGES_TOKEN % operation.getCampaignID(
         )
         topBageQuest = finder(hiddenQuests, finders.tokenFinder(token))
         bonuses.extend(topBageQuest.getBonuses(ctx=ctx))
     return bonuses
Exemple #3
0
    def _getBonuses(self, operation):
        bonusList = []
        if not operation.isAwardAchieved():
            for _, bonuses in operation.getBonuses().iteritems():
                bonusList.extend(bonuses)

        else:
            hiddenQuests = self._eventsCache.getHiddenQuests()
            finder = finders.getQuestByTokenAndBonus
            if not operation.isFullCompleted():
                extrasQuest = finder(hiddenQuests, finders.addQuestTokenFinder(operation.getID()))
                bonusList.extend(extrasQuest.getBonuses())
        return bonusList