示例#1
0
    def makeBattle(self, bossCogPosHpr, battlePosHpr, roundCallback,
                   finishCallback, battleNumber, battleSide):
        if battleNumber == 1:
            battle = DistributedBattleWaitersAI.DistributedBattleWaitersAI(
                self.air, self, roundCallback, finishCallback, battleSide)
        else:
            battle = DistributedBattleDinersAI.DistributedBattleDinersAI(
                self.air, self, roundCallback, finishCallback, battleSide)
        self.setBattlePos(battle, bossCogPosHpr, battlePosHpr)
        battle.suitsKilled = self.suitsKilled
        battle.battleCalc.toonSkillPtsGained = self.toonSkillPtsGained
        battle.toonExp = self.toonExp
        battle.toonOrigQuests = self.toonOrigQuests
        battle.toonItems = self.toonItems
        battle.toonOrigMerits = self.toonOrigMerits
        battle.toonMerits = self.toonMerits
        battle.toonParts = self.toonParts
        battle.helpfulToons = self.helpfulToons
        mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(
            battleNumber)
        battle.battleCalc.setSkillCreditMultiplier(mult)
        activeSuits = self.activeSuitsA
        if battleSide:
            activeSuits = self.activeSuitsB
        for suit in activeSuits:
            battle.addSuit(suit)

        battle.generateWithRequired(self.zoneId)
        return battle
    def makeBattle(self, bossCogPosHpr, battlePosHpr,
                   roundCallback, finishCallback, battleNumber, battleSide):
        """Create and generate one DistributedBattleWaiters."""
        if battleNumber == 1:
            battle = DistributedBattleWaitersAI.DistributedBattleWaitersAI(
                self.air, self, roundCallback, finishCallback, battleSide)
        else:
            battle = DistributedBattleDinersAI.DistributedBattleDinersAI(
                self.air, self, roundCallback, finishCallback, battleSide)

        self.setBattlePos(battle, bossCogPosHpr, battlePosHpr)

        # Just like the DistributedSuitInteriorAI class, we save a
        # reference to our suitsKilled and toonSkillPtsGained
        # structures in each battle we create.  That way, the battle
        # will directly adjust these structures and we accumulate the
        # toon credits for all battles.
        battle.suitsKilled = self.suitsKilled
        battle.battleCalc.toonSkillPtsGained = self.toonSkillPtsGained
        battle.toonExp = self.toonExp
        battle.toonOrigQuests = self.toonOrigQuests
        battle.toonItems = self.toonItems
        battle.toonOrigMerits = self.toonOrigMerits
        battle.toonMerits = self.toonMerits
        battle.toonParts = self.toonParts
        battle.helpfulToons = self.helpfulToons

        # We get a bonus factor applied toward each attack's
        # experience credit.
        mult = ToontownBattleGlobals.getBossBattleCreditMultiplier(battleNumber)

        # We don't, however, get any particular bonus for an invasion
        # here.
        battle.battleCalc.setSkillCreditMultiplier(mult)

        # lets add the initial 4 suits already
        activeSuits = self.activeSuitsA
        if battleSide:
            activeSuits = self.activeSuitsB
        for suit in activeSuits:
            battle.addSuit(suit)

        battle.generateWithRequired(self.zoneId)
        return battle