class SZHoodAI(HoodAI):
    """
    AI-side representation of everything in a single safezone neighborhood.

    One subclass of this class exists for every neighborhood in the game.
    HoodAIs are responsible for spawning all TreasurePlanners, ponds,
    and other hood objects, etc.
    """

    def __init__(self, air):
        HoodAI.__init__(self, air)

        self.safezone = self.HOOD
        self.streets = {}

        self.trolley = None
        self.pond = None
        self.buildingMgr = None

        self.createZone()
        self.createStreets()

    def createZone(self):
        HoodAI.createZone(self)
        self.air.dnaStoreMap[self.HOOD] = self.air.loadDNA(
            self.air.genDNAFileName(self.HOOD)).generateData()
        self.createTrolley()
        self.createTreasurePlanner()
        self.buildingMgr = DistributedBuildingMgrAI(
            self.air, self.HOOD, self.air.dnaStoreMap[
                self.HOOD], self.air.trophyMgr)
        NPCToons.createNpcsInZone(self.air, self.HOOD)

    def createStreets(self):
        branchIds = ToontownGlobals.HoodHierarchy.get(self.HOOD, [])
        for branch in branchIds:
            street = StreetAI(self.air, branch)
            self.streets[branch] = street

    def createTrolley(self):
        self.trolley = DistributedTrolleyAI(self.air)
        self.trolley.generateWithRequired(self.safezone)

    def createTreasurePlanner(self):
        treasureType, healAmount, spawnPoints, spawnRate, maxTreasures = TreasureGlobals.SafeZoneTreasureSpawns[
            self.HOOD]
        self.treasurePlanner = SZTreasurePlannerAI(
            self.safezone,
            treasureType,
            healAmount,
            spawnPoints,
            spawnRate,
            maxTreasures)
        self.treasurePlanner.start()

    def spawnObjects(self):
        filename = self.air.genDNAFileName(self.safezone)
        self.air.dnaSpawner.spawnObjects(filename, self.safezone)
Example #2
0
class HoodAI:
    """
    AI-side representation of everything in a single neighborhood.

    One subclass of this class exists for every neighborhood in the game.
    HoodAIs are responsible for spawning all TreasurePlanners, SuitPlanners,
    ponds, and other safezone objects, etc.
    """

    HOOD = None

    def __init__(self, air):
        self.air = air

        self.spawnNpcsIn = [2000]

        self.safezone = self.HOOD
        self.streets = {}

        self.trolley = None
        self.pond = None

        self.createSafeZone()
        self.createStreets()

    def createTreasurePlanner(self):
        treasureType, healAmount, spawnPoints, spawnRate, maxTreasures = TreasureGlobals.SafeZoneTreasureSpawns[
            self.HOOD]
        self.treasurePlanner = SZTreasurePlannerAI(self.safezone, treasureType,
                                                   healAmount, spawnPoints,
                                                   spawnRate, maxTreasures)
        self.treasurePlanner.start()

    def createTrolley(self):
        self.trolley = DistributedTrolleyAI(self.air)
        self.trolley.generateWithRequired(self.safezone)

    def createGate(self):
        self.gate = DistributedPartyGateAI(self.air)
        self.gate.generateWithRequired(self.safezone)

    def createSafeZone(self):
        self.createTrolley()
        self.createTreasurePlanner()
        self.createGate()

    def createStreets(self):
        branchIds = ToontownGlobals.HoodHierarchy.get(self.HOOD, [])
        for branch in branchIds:
            street = StreetAI(self.air, branch)
            self.streets[branch] = street

    def spawnObjects(self):
        filename = self.air.genDNAFileName(self.safezone)

        DNASpawnerAI().spawnObjects(filename, self.safezone)
class SZHoodAI(HoodAI):
    """
    AI-side representation of everything in a single safezone neighborhood.

    One subclass of this class exists for every neighborhood in the game.
    HoodAIs are responsible for spawning all TreasurePlanners, ponds,
    and other hood objects, etc.
    """
    def __init__(self, air):
        HoodAI.__init__(self, air)

        self.safezone = self.HOOD
        self.streets = {}

        self.trolley = None
        self.pond = None
        self.buildingMgr = None

        self.createZone()
        self.createStreets()

    def createZone(self):
        HoodAI.createZone(self)
        self.air.dnaStoreMap[self.HOOD] = self.air.loadDNA(
            self.air.genDNAFileName(self.HOOD)).generateData()
        self.createTrolley()
        self.createTreasurePlanner()
        self.buildingMgr = DistributedBuildingMgrAI(
            self.air, self.HOOD, self.air.dnaStoreMap[self.HOOD],
            self.air.trophyMgr)
        NPCToons.createNpcsInZone(self.air, self.HOOD)

    def createStreets(self):
        branchIds = ToontownGlobals.HoodHierarchy.get(self.HOOD, [])
        for branch in branchIds:
            street = StreetAI(self.air, branch)
            self.streets[branch] = street

    def createTrolley(self):
        self.trolley = DistributedTrolleyAI(self.air)
        self.trolley.generateWithRequired(self.safezone)

    def createTreasurePlanner(self):
        treasureType, healAmount, spawnPoints, spawnRate, maxTreasures = TreasureGlobals.SafeZoneTreasureSpawns[
            self.HOOD]
        self.treasurePlanner = SZTreasurePlannerAI(self.safezone, treasureType,
                                                   healAmount, spawnPoints,
                                                   spawnRate, maxTreasures)
        self.treasurePlanner.start()

    def spawnObjects(self):
        filename = self.air.genDNAFileName(self.safezone)
        self.air.dnaSpawner.spawnObjects(filename, self.safezone)
Example #4
0
class HoodAI:
    """
    AI-side representation of everything in a single neighborhood.

    One subclass of this class exists for every neighborhood in the game.
    HoodAIs are responsible for spawning all TreasurePlanners, SuitPlanners,
    ponds, and other safezone objects, etc.
    """

    HOOD = None

    def __init__(self, air):
        self.air = air
        
        self.spawnNpcsIn = [2000]

        self.safezone = self.HOOD
        self.streets = {}
        
        self.trolley = None
        self.pond = None

        self.createSafeZone()
        self.createStreets()
		
    def createTreasurePlanner(self):
        treasureType, healAmount, spawnPoints, spawnRate, maxTreasures = TreasureGlobals.SafeZoneTreasureSpawns[self.HOOD]
        self.treasurePlanner = SZTreasurePlannerAI(self.safezone, treasureType, healAmount, spawnPoints, spawnRate, maxTreasures)
        self.treasurePlanner.start()
		
    def createTrolley(self):
        self.trolley = DistributedTrolleyAI(self.air)
        self.trolley.generateWithRequired(self.safezone)
		
    def createGate(self):
        self.gate = DistributedPartyGateAI(self.air)
        self.gate.generateWithRequired(self.safezone)
		
    def createSafeZone(self):
        self.createTrolley()
        self.createTreasurePlanner()
        self.createGate()

    def createStreets(self):
        branchIds = ToontownGlobals.HoodHierarchy.get(self.HOOD, [])
        for branch in branchIds:
            street = StreetAI(self.air, branch)
            self.streets[branch] = street

    def spawnObjects(self):
        filename = self.air.genDNAFileName(self.safezone)

        DNASpawnerAI().spawnObjects(filename, self.safezone)
Example #5
0
 def createTrolley(self):
     self.trolley = DistributedTrolleyAI(self.air)
     self.trolley.generateWithRequired(self.safezone)
Example #6
0
 def createTrolley(self):
     self.trolley = DistributedTrolleyAI(self.air)
     self.trolley.generateWithRequired(self.safezone)