Example #1
0
    def Spawn(self, dept = None):
        from src.coginvasion.cog.DistributedSuitAI import DistributedSuitAI
        from src.coginvasion.cog import Dept, SuitBank, Variant
        from src.coginvasion.arcade.BatchCogSpawnerAI import BatchCogSpawnerAI
        import random
        
        level, availableSuits = SuitBank.chooseLevelAndGetAvailableSuits(
            [1, 4], random.choice([Dept.BOSS, Dept.SALES, Dept.CASH, Dept.LAW]) if not dept else dept, False)

        plan = random.choice(availableSuits)
        suit = DistributedSuitAI(self.air)
        suit.setPos(self.cEntity.getOrigin())
        suit.setHpr(self.cEntity.getAngles())
        suit.setBattleZone(self.dispatch)
        variant = Variant.NORMAL
        suit.setLevel(level)
        suit.setSuit(plan, variant)
        suit.generateWithRequired(self.dispatch.zoneId)
        #suit.d_setHood(suit.hood)
        suit.b_setPlace(self.dispatch.zoneId)
        suit.b_setName(plan.getName())
        suit.spawnGeneric()
        self.spawned.append(suit)
        
        if self.hasSpawnFlags(self.DoSupaFlyIn):
            suit.changeSchedule(suit.getScheduleByName("SUPA_FLY_IN_MOVE"))
            
        if self.spawnScript:
            self.spawnScript.ExecuteScript(suit)
            
        BatchCogSpawnerAI.NumSuits += 1
        
        self.dispatchOutput("OnSpawnCog")
        
        return suit
Example #2
0
 def setSuit(self, plan, variant=0):
     DistributedSuitAI.setSuit(self, plan, variant, self.tutorial)