def setFloorNum(self, num): DistributedCountryClub.notify.debug('floorNum: %s' % num) self.floorNum = num self.layout = CountryClubLayout.CountryClubLayout( self.countryClubId, self.floorNum, self.layoutIndex) self.smallTitleText.setText(TTLocalizer.CountryClubFloorTitle % (self.floorNum + 1))
def createCountryClub(self, countryClubId, players): for avId in players: if bboard.has('countryClubId-%s' % avId): countryClubId = bboard.get('countryClubId-%s' % avId) break numFloors = 1 layoutIndex = None floor = 0 for avId in players: if bboard.has('countryClubFloor-%s' % avId): floor = bboard.get('countryClubFloor-%s' % avId) floor = max(0, floor) floor = min(floor, numFloors - 1) break for avId in players: if bboard.has('countryClubRoom-%s' % avId): roomId = bboard.get('countryClubRoom-%s' % avId) for i in range(numFloors): layout = CountryClubLayout.CountryClubLayout(countryClubId, i) if roomId in layout.getRoomIds(): floor = i else: CountryClubRoomSpecs = CountryClubRoomSpecs roomName = CountryClubRoomSpecs.BossbotCountryClubRoomId2RoomName[roomId] CountryClubManagerAI.notify.warning('room %s (%s) not found in any floor of countryClub %s' % (roomId, roomName, countryClubId)) countryClubZone = self.air.allocateZone() if layoutIndex is None: layoutIndex = random.choice(CountryClubId2Layouts[countryClubId]) countryClub = DistributedCountryClubAI.DistributedCountryClubAI(self.air, countryClubId, countryClubZone, floor, players, layoutIndex) countryClub.generateWithRequired(countryClubZone) return countryClubZone
def __init__(self, air, countryClubId, zoneId, floorNum, avIds, layoutIndex, battleExpAggreg=None): DistributedObjectAI.DistributedObjectAI.__init__(self, air) self.countryClubId = countryClubId self.zoneId = zoneId self.floorNum = floorNum self.avIds = avIds self.layoutIndex = layoutIndex self.blockedRooms = [] self.elevatorList = [] self.battleExpAggreg = battleExpAggreg self.layout = CountryClubLayout.CountryClubLayout( self.countryClubId, self.floorNum, self.layoutIndex) for i in xrange(self.layout.getNumRooms()): if i: self.blockedRooms.append(i)
def setFloorNum(self, num): DistributedCountryClub.notify.debug('floorNum: %s' % num) self.floorNum = num self.layout = CountryClubLayout.CountryClubLayout(self.countryClubId, self.floorNum, self.layoutIndex)