コード例 #1
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             self.givePinkSlipReward(toon)
             toon.b_promote(self.deptIndex)
コード例 #2
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             if not toon.attemptAddNPCFriend(self.cagedToonNpcId, numCalls=1):
                 self.notify.info('%s.unable to add NPCFriend %s to %s.' % (self.doId, self.cagedToonNpcId, toonId))
             toon.b_promote(self.deptIndex)
コード例 #3
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             for i in xrange(5):
                 toon.addResistanceMessage(self.rewardId)
             toon.b_promote(self.deptIndex)
コード例 #4
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     preferredDept = random.randrange(len(SuitDNA.suitDepts))
     typeWeights = ['single'] * 70 + ['building'] * 27 + ['invasion'] * 3
     preferredSummonType = random.choice(typeWeights)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             self.giveCogSummonReward(toon, preferredDept, preferredSummonType)
             toon.b_promote(self.deptIndex)
コード例 #5
0
 def getBattleExperience(self):
     result = BattleExperienceAI.getBattleExperience(
         8, self.involvedToons, self.toonExp, self.toonSkillPtsGained,
         self.toonOrigQuests, self.toonItems, self.toonOrigMerits,
         self.toonMerits, self.toonParts, self.suitsKilled,
         self.helpfulToons)
     return result
コード例 #6
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons,
                                      self.toonSkillPtsGained,
                                      self.suitsKilled,
                                      ToontownGlobals.dept2cogHQ(self.dept),
                                      self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             if not toon.attemptAddNPCFriend(self.cagedToonNpcId,
                                             numCalls=1):
                 self.notify.info('%s.unable to add NPCFriend %s to %s.' %
                                  (self.doId, self.cagedToonNpcId, toonId))
             toon.b_promote(self.deptIndex)
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             self.givePinkSlipReward(toon)
             toon.b_promote(self.deptIndex)
             toon.addStat(ToontownGlobals.STATS_CEO)
             simbase.air.questManager.toonDefeatedBoss(toon, ToontownGlobals.dept2cogHQ(self.dept), self.dna.dept, self.involvedToons)
         if len(self.involvedToons[:]) == 1 and self.begunSolo:
             isSolo = 1
         else:
             isSolo = 0
         self.air.achievementsManager.ceo(toonId, solo = isSolo)
コード例 #8
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons,
                                      self.toonSkillPtsGained,
                                      self.suitsKilled,
                                      ToontownGlobals.dept2cogHQ(self.dept),
                                      self.helpfulToons)
     preferredDept = random.randrange(len(SuitDNA.suitDepts))
     typeWeights = ['single'] * 70 + ['building'] * 27 + ['invasion'] * 3
     preferredSummonType = random.choice(typeWeights)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             self.giveCogSummonReward(toon, preferredDept,
                                      preferredSummonType)
             toon.b_promote(self.deptIndex)
コード例 #9
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             if not toon.attemptAddNPCFriend(self.cagedToonNpcId, numCalls=self.numSos):
                 self.notify.info('%s.unable to add NPCFriend %s to %s.' % (self.doId, self.cagedToonNpcId, toonId))
             toon.b_promote(self.deptIndex)
             toon.addStat(ToontownGlobals.STATS_VP)
             simbase.air.questManager.toonDefeatedBoss(toon, ToontownGlobals.dept2cogHQ(self.dept), self.dna.dept, self.involvedToons)
         if len(self.involvedToons[:]) == 1 and self.begunSolo:
             isSolo = 1
         else:
             isSolo = 0
         self.air.achievementsManager.vp(toonId, solo = isSolo)
コード例 #10
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     preferredDept = random.randrange(len(SuitDNA.suitDepts))
     typeWeights = ['single'] * 3 + ['building'] * 60 + ['invasion'] * 37
     preferredSummonType = random.choice(typeWeights)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             self.giveCogSummonReward(toon, preferredDept, preferredSummonType)
             toon.b_promote(self.deptIndex)
             toon.addStat(ToontownGlobals.STATS_CJ)
         if len(self.involvedToons) == 1 and self.begunSolo:
             isSolo = 1
         else:
             isSolo = 0
         self.air.achievementsManager.cj(toonId, solo=isSolo)
コード例 #11
0
 def __doneVictory(self, avIds):
     self.d_setBattleExperience()
     self.b_setState('Reward')
     BattleExperienceAI.assignRewards(self.involvedToons, self.toonSkillPtsGained, self.suitsKilled, ToontownGlobals.dept2cogHQ(self.dept), self.helpfulToons)
     for toonId in self.involvedToons:
         toon = self.air.doId2do.get(toonId)
         if toon:
             configMax = simbase.config.GetInt('max-sos-cards', 16)
             if configMax == 8:
                 maxNumCalls = 1
             else:
                 maxNumCalls = 2
             if not toon.attemptAddNPCFriend(self.cagedToonNpcId, numCalls=maxNumCalls):
                 self.notify.info('%s.unable to add NPCFriend %s to %s.' % (self.doId, self.cagedToonNpcId, toonId))
             if self.__shouldPromoteToon(toon):
                 toon.b_promote(self.deptIndex)
                 self.sendUpdateToAvatarId(toonId, 'toonPromoted', [1])
             else:
                 self.sendUpdateToAvatarId(toonId, 'toonPromoted', [0])
コード例 #12
0
    def __doneVictory(self, avIds):
        self.d_setBattleExperience()
        self.b_setState('Reward')
        BattleExperienceAI.assignRewards(self.involvedToons,
                                         self.toonSkillPtsGained,
                                         self.suitsKilled,
                                         ToontownGlobals.dept2cogHQ(self.dept),
                                         self.helpfulToons)
        for toonId in self.involvedToons:
            toon = self.air.doId2do.get(toonId)
            if toon:
                toon.addResistanceMessage(self.rewardId)
                if self.bonusUnites:
                    for x in xrange(self.bonusUnites):
                        toon.addResistanceMessage(ResistanceChat.getRandomId())

                toon.b_promote(self.deptIndex)
                toon.addStat(ToontownGlobals.STATS_CFO)
            if len(self.involvedToons) == 1 and self.begunSolo:
                isSolo = 1
            else:
                isSolo = 0
            self.air.achievementsManager.cfo(toonId, solo=isSolo)
コード例 #13
0
 def getBattleExperience(self):
     result = BattleExperienceAI.getBattleExperience(
         8,
         self.involvedToons,
         self.toonExp,
         self.toonSkillPtsGained,
         self.toonOrigQuests,
         self.toonItems,
         self.toonOrigMerits,
         self.toonMerits,
         self.toonParts,
         self.suitsKilled,
         self.helpfulToons)
     return result