def invokeSuitPlanner(self, buildingCode, skelecog, skelecogRandom=0, dept=None): if dept is None: dept = self.dna.dept planner = SuitPlannerInteriorAI.SuitPlannerInteriorAI( 1, buildingCode, dept, self.zoneId) planner.respectInvasions = 0 suits = planner.genFloorSuits(0) if skelecog: for suit in suits['activeSuits']: wantSkelecog = 1 if skelecogRandom: wantSkelecog = random.randint(0, 1) suit.b_setSkelecog(wantSkelecog) for reserve in suits['reserveSuits']: wantSkelecog = 1 if skelecogRandom: wantSkelecog = random.randint(0, 1) suit = reserve[0] suit.b_setSkelecog(wantSkelecog) return suits
def invokeSuitPlanner(self, buildingCode, skelecog): planner = SuitPlannerInteriorAI.SuitPlannerInteriorAI( 1, buildingCode, self.dna.dept, self.zoneId) planner.respectInvasions = 0 suits = planner.genFloorSuits(0) if skelecog: for suit in suits['activeSuits']: suit.b_setSkelecog(1) for reserve in suits['reserveSuits']: suit = reserve[0] suit.b_setSkelecog(1) return suits
def enterSuit(self): self.sendUpdate('setSuitData', [ord(self.track), self.difficulty, self.numFloors]) (zoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() self.planner = SuitPlannerInteriorAI.SuitPlannerInteriorAI( self.numFloors, self.difficulty, self.track, interiorZoneId) self.d_setState('suit') (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() self.elevator = DistributedElevatorExtAI.DistributedElevatorExtAI( self.air, self) self.elevator.generateWithRequired(exteriorZoneId) self.air.writeServerEvent( 'building-cog', self.doId, '%s|%s|%s|%s' % (self.zoneId, self.block, self.track, self.numFloors))
def invokeSuitPlanner(self, buildingCode, skelecog): # Creates a suit planner to generate suits to emerge from the # boss cog's belly. The buildingCode is the level number to # use from the table in SuitBuildingGlobals.py; skelecog is # true to generate skeleton cogs. The return value is the # dictionary { 'activeSuits' : suits, 'reserveSuits' : suits } planner = SuitPlannerInteriorAI.SuitPlannerInteriorAI( 1, buildingCode, self.dna.dept, self.zoneId) planner.respectInvasions = 0 suits = planner.genFloorSuits(0) if skelecog: # These cogs have already been generated, so we must do a # distributed setSkelecog for suit in suits['activeSuits']: suit.b_setSkelecog(1) for reserve in suits['reserveSuits']: suit = reserve[0] suit.b_setSkelecog(1) return suits