class ToontorialBuildingAI:
    def __init__(self, air, street, interior, npcId):

        self.air = air

        self.interior = DistributedTutorialInteriorAI(self.air, interior,
                                                      npcId)

        self.interior.generateWithRequired(interior)
        self.door0 = DistributedDoorAI.DistributedDoorAI(
            self.air, 2, DoorTypes.EXT_STANDARD, doorIndex=0)
        self.insideDoor0 = DistributedDoorAI.DistributedDoorAI(
            self.air, 0, DoorTypes.INT_STANDARD, doorIndex=0)
        self.door0.setOtherDoor(self.insideDoor0)
        self.insideDoor0.setOtherDoor(self.door0)
        self.door0.zoneId = street
        self.insideDoor0.zoneId = interior
        self.door0.generateWithRequired(street)
        self.door0.sendUpdate('setDoorIndex', [self.door0.getDoorIndex()])
        self.insideDoor0.generateWithRequired(interior)
        self.insideDoor0.sendUpdate('setDoorIndex',
                                    [self.insideDoor0.getDoorIndex()])

    def cleanup(self):
        self.door0.requestDelete()
        self.insideDoor0.requestDelete()
        self.interior.requestDelete()
Esempio n. 2
0
    def createShop(self, streetZone, shopZone, hqZone):
        shopInterior = DistributedTutorialInteriorAI(2, self.air, shopZone)

        desc = NPCToons.NPCToonDict.get(20000)
        npc = NPCToons.createNPC(self.air, 20000, desc, shopZone)
        npc.setTutorial(1)
        shopInterior.setTutorialNpcId(npc.doId)
        shopInterior.generateWithRequired(shopZone)

        extShopDoor = DistributedDoorAI.DistributedDoorAI(
            self.air,
            2,
            DoorTypes.EXT_STANDARD,
            lockValue=FADoorCodes.DEFEAT_FLUNKY_TOM)
        intShopDoor = DistributedDoorAI.DistributedDoorAI(
            self.air,
            2,
            DoorTypes.INT_STANDARD,
            lockValue=FADoorCodes.TALK_TO_TOM)
        extShopDoor.setOtherDoor(intShopDoor)
        intShopDoor.setOtherDoor(extShopDoor)
        extShopDoor.zoneId = streetZone
        intShopDoor.zoneId = shopZone
        extShopDoor.generateWithRequired(streetZone)
        extShopDoor.sendUpdate('setDoorIndex', [extShopDoor.getDoorIndex()])
        intShopDoor.generateWithRequired(shopZone)
        intShopDoor.sendUpdate('setDoorIndex', [intShopDoor.getDoorIndex()])

        self.accept('intShopDoor-{0}'.format(shopZone),
                    intShopDoor.setDoorLock)
        self.accept('extShopDoor-{0}'.format(streetZone),
                    extShopDoor.setDoorLock)
class TutorialBuildingAI:
    def __init__(self, air, exteriorZone, interiorZone, blockNumber, tutorialNpcId):
        self.air = air
        self.exteriorZone = exteriorZone
        self.interiorZone = interiorZone
        self.blockNumber = blockNumber
        self.tutorialNpcId = tutorialNpcId

        self.interior = DistributedTutorialInteriorAI(
            self.air, self.blockNumber, self.interiorZone, self.tutorialNpcId)
        self.interior.generateWithRequired(self.interiorZone)

        self.door = DistributedDoorAI.DistributedDoorAI(
            self.air, blockNumber, DoorTypes.EXT_STANDARD)
        self.insideDoor = DistributedDoorAI.DistributedDoorAI(
            self.air, blockNumber, DoorTypes.INT_STANDARD)
        self.door.setOtherDoor(self.insideDoor)
        self.insideDoor.setOtherDoor(self.door)
        self.door.zoneId = self.exteriorZone
        self.insideDoor.zoneId = self.interiorZone
        self.door.generateWithRequired(self.exteriorZone)
        self.insideDoor.generateWithRequired(self.interiorZone)

    def cleanup(self):
        self.door.requestDelete()
        del self.door
        self.insideDoor.requestDelete()
        del self.insideDoor
        self.interior.requestDelete()
        del self.interior
class ToontorialBuildingAI:

    def __init__(self, air, street, interior, npcId):
        self.air = air
        self.interior = DistributedTutorialInteriorAI(self.air, interior, npcId)
        self.interior.generateWithRequired(interior)
        self.door0 = DistributedDoorAI.DistributedDoorAI(self.air, 2, DoorTypes.EXT_STANDARD, doorIndex=0)
        self.insideDoor0 = DistributedDoorAI.DistributedDoorAI(self.air, 0, DoorTypes.INT_STANDARD, doorIndex=0)
        self.door0.setOtherDoor(self.insideDoor0)
        self.insideDoor0.setOtherDoor(self.door0)
        self.door0.zoneId = street
        self.insideDoor0.zoneId = interior
        self.door0.generateWithRequired(street)
        self.door0.sendUpdate('setDoorIndex', [self.door0.getDoorIndex()])
        self.insideDoor0.generateWithRequired(interior)
        self.insideDoor0.sendUpdate('setDoorIndex', [self.insideDoor0.getDoorIndex()])

    def cleanup(self):
        self.door0.requestDelete()
        self.insideDoor0.requestDelete()
        self.interior.requestDelete()
    def createShop(self, streetZone, shopZone, hqZone):
        shopInterior = DistributedTutorialInteriorAI(2, self.air, shopZone)

        desc = NPCToons.NPCToonDict.get(20000)
        npc = NPCToons.createNPC(self.air, 20000, desc, shopZone)
        npc.setTutorial(1)
        shopInterior.setTutorialNpcId(npc.doId)
        shopInterior.generateWithRequired(shopZone)

        extShopDoor = DistributedDoorAI.DistributedDoorAI(self.air, 2, DoorTypes.EXT_STANDARD,
                                        lockValue=FADoorCodes.DEFEAT_FLUNKY_TOM)
        intShopDoor = DistributedDoorAI.DistributedDoorAI(self.air, 2, DoorTypes.INT_STANDARD,
                                        lockValue=FADoorCodes.TALK_TO_TOM)
        extShopDoor.setOtherDoor(intShopDoor)
        intShopDoor.setOtherDoor(extShopDoor)
        extShopDoor.zoneId = streetZone
        intShopDoor.zoneId = shopZone
        extShopDoor.generateWithRequired(streetZone)
        extShopDoor.sendUpdate('setDoorIndex', [extShopDoor.getDoorIndex()])
        intShopDoor.generateWithRequired(shopZone)
        intShopDoor.sendUpdate('setDoorIndex', [intShopDoor.getDoorIndex()])

        self.accept('intShopDoor-{0}'.format(shopZone), intShopDoor.setDoorLock)
        self.accept('extShopDoor-{0}'.format(streetZone), extShopDoor.setDoorLock)