Esempio n. 1
0
    def createHQ(self, streetZone, shopZone, hqZone):
        interior = DistributedHQInteriorAI(1, self.air, hqZone)
        interior.generateWithRequired(hqZone)
        interior.setTutorial(1)

        desc = NPCToons.NPCToonDict.get(20002)
        npc = NPCToons.createNPC(self.air, 20002, desc, hqZone)
        npc.setTutorial(1)
        npc.setHq(1)

        door0 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            1,
            DoorTypes.EXT_HQ,
            doorIndex=0,
            lockValue=FADoorCodes.DEFEAT_FLUNKY_HQ)
        door1 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            1,
            DoorTypes.EXT_HQ,
            doorIndex=1,
            lockValue=FADoorCodes.DEFEAT_FLUNKY_HQ)
        insideDoor0 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            1,
            DoorTypes.INT_HQ,
            doorIndex=0,
            lockValue=FADoorCodes.TALK_TO_HQ)
        insideDoor1 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            1,
            DoorTypes.INT_HQ,
            doorIndex=1,
            lockValue=FADoorCodes.TALK_TO_HQ)
        door0.setOtherDoor(insideDoor0)
        insideDoor0.setOtherDoor(door0)
        door1.setOtherDoor(insideDoor1)
        insideDoor1.setOtherDoor(door1)
        door0.zoneId = streetZone
        door1.zoneId = streetZone
        insideDoor0.zoneId = hqZone
        insideDoor1.zoneId = hqZone
        door0.generateWithRequired(streetZone)
        door1.generateWithRequired(streetZone)
        door0.sendUpdate('setDoorIndex', [door0.getDoorIndex()])
        door1.sendUpdate('setDoorIndex', [door1.getDoorIndex()])
        insideDoor0.generateWithRequired(hqZone)
        insideDoor1.generateWithRequired(hqZone)
        insideDoor0.sendUpdate('setDoorIndex', [insideDoor0.getDoorIndex()])
        insideDoor1.sendUpdate('setDoorIndex', [insideDoor1.getDoorIndex()])

        self.accept('extHqDoor0-{0}'.format(streetZone), door0.setDoorLock)
        self.accept('extHqDoor1-{0}'.format(streetZone), door1.setDoorLock)
        self.accept('intHqDoor0-{0}'.format(hqZone), insideDoor0.setDoorLock)
        self.accept('intHqDoor1-{0}'.format(hqZone), insideDoor1.setDoorLock)
    def enterToon(self):
        self.d_setState('toon')
        (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId()
        if simbase.config.GetBool(
                'want-new-toonhall', 1) and ZoneUtil.getCanonicalZoneId(
                    interiorZoneId) == ToontownGlobals.ToonHall:
            self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI(
                self.block, self.air, interiorZoneId, self)
        else:
            self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI(
                self.block, self.air, interiorZoneId, self)

        self.interior.generateWithRequired(interiorZoneId)
        door = self.createExteriorDoor()
        insideDoor = DistributedDoorAI.DistributedDoorAI(
            self.air, self.block, DoorTypes.INT_STANDARD)
        door.setOtherDoor(insideDoor)
        insideDoor.setOtherDoor(door)
        door.zoneId = exteriorZoneId
        insideDoor.zoneId = interiorZoneId
        door.generateWithRequired(exteriorZoneId)
        insideDoor.generateWithRequired(interiorZoneId)
        self.door = door
        self.insideDoor = insideDoor
        self.becameSuitTime = 0
        self.knockKnock = DistributedKnockKnockDoorAI.DistributedKnockKnockDoorAI(
            self.air, self.block)
        self.knockKnock.generateWithRequired(exteriorZoneId)
        self.air.writeServerEvent('building-toon', self.doId,
                                  '%s|%s' % (self.zoneId, self.block))
Esempio n. 3
0
 def setup(self, blockNumber):
     self.interior = DistributedGagshopInteriorAI.DistributedGagshopInteriorAI(
         blockNumber, self.air, self.interiorZone)
     self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)
     self.interior.generateWithRequired(self.interiorZone)
     door = DistributedDoorAI.DistributedDoorAI(self.air, blockNumber,
                                                DoorTypes.EXT_STANDARD)
     insideDoor = DistributedDoorAI.DistributedDoorAI(
         self.air, blockNumber, DoorTypes.INT_STANDARD)
     door.setOtherDoor(insideDoor)
     insideDoor.setOtherDoor(door)
     door.zoneId = self.exteriorZone
     insideDoor.zoneId = self.interiorZone
     door.generateWithRequired(self.exteriorZone)
     insideDoor.generateWithRequired(self.interiorZone)
     self.door = door
     self.insideDoor = insideDoor
Esempio n. 4
0
 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()])
Esempio n. 5
0
    def setup(self, blockNumber):
        self.interior = DistributedHQInteriorAI.DistributedHQInteriorAI(
            blockNumber, self.air, self.interiorZone)
        self.interior.generateWithRequired(self.interiorZone)

        self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)

        door0 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                    blockNumber,
                                                    DoorTypes.EXT_HQ,
                                                    doorIndex=0)
        door1 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                    blockNumber,
                                                    DoorTypes.EXT_HQ,
                                                    doorIndex=1)
        insideDoor0 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                          blockNumber,
                                                          DoorTypes.INT_HQ,
                                                          doorIndex=0)
        insideDoor1 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                          blockNumber,
                                                          DoorTypes.INT_HQ,
                                                          doorIndex=1)
        door0.setOtherDoor(insideDoor0)
        insideDoor0.setOtherDoor(door0)
        door1.setOtherDoor(insideDoor1)
        insideDoor1.setOtherDoor(door1)
        door0.zoneId = self.exteriorZone
        door1.zoneId = self.exteriorZone
        insideDoor0.zoneId = self.interiorZone
        insideDoor1.zoneId = self.interiorZone
        door0.generateWithRequired(self.exteriorZone)
        door1.generateWithRequired(self.exteriorZone)
        door0.sendUpdate('setDoorIndex', [door0.getDoorIndex()])
        door1.sendUpdate('setDoorIndex', [door1.getDoorIndex()])
        insideDoor0.generateWithRequired(self.interiorZone)
        insideDoor1.generateWithRequired(self.interiorZone)
        insideDoor0.sendUpdate('setDoorIndex', [insideDoor0.getDoorIndex()])
        insideDoor1.sendUpdate('setDoorIndex', [insideDoor1.getDoorIndex()])
        self.door0 = door0
        self.door1 = door1
        self.insideDoor0 = insideDoor0
        self.insideDoor1 = insideDoor1
    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 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)
 def createExteriorDoor(self):
     result = DistributedDoorAI.DistributedDoorAI(self.air, self.block,
                                                  DoorTypes.EXT_STANDARD)
     return result
    def create(self):
        self.branchZone = self.air.zoneAllocator.allocate()
        self.interiorZone = self.air.zoneAllocator.allocate()
        self.hqZone = self.air.zoneAllocator.allocate()
        
        self.streetInteriorDoor = DistributedDoorAI.DistributedDoorAI(self.air, 2, DoorTypes.EXT_STANDARD, lockValue = FADoorCodes.DEFEAT_FLUNKY_TOM)
        self.interiorDoor = DistributedDoorAI.DistributedDoorAI(self.air, 2, DoorTypes.INT_STANDARD, lockValue = FADoorCodes.TALK_TO_TOM)
        
        self.streetInteriorDoor.setOtherDoor(self.interiorDoor)
        self.interiorDoor.setOtherDoor(self.streetInteriorDoor)
        
        self.acceptDoorEvent(1, {self.interiorDoor: FADoorCodes.UNLOCKED}) # after tom

        self.streetInteriorDoor.generateWithRequired(self.branchZone)
        self.streetInteriorDoor.sendUpdate('setDoorIndex', [self.streetInteriorDoor.getDoorIndex()])
        
        self.interiorDoor.generateWithRequired(self.interiorZone)
        self.interiorDoor.sendUpdate('setDoorIndex', [self.interiorDoor.getDoorIndex()])

        self.tom = NPCToons.createNPC(self.air, 20000, NPCToons.NPCToonDict[20000], self.interiorZone)
        self.tom.setTutorial(1)
        self.tom.b_setParent(1)
        
        self.tomInterior = DistributedTutorialInteriorAI.DistributedTutorialInteriorAI(2, self.air, self.interiorZone)
        self.tomInterior.setTutorialNpcId(self.tom.doId)
        self.tomInterior.generateWithRequired(self.interiorZone)
        
        self.cog = DistributedTutorialSuitAI.DistributedTutorialSuitAI(self.air, self)
        self.cog.setupSuitDNA(1, 0, 'c')
        self.cog.generateWithRequired(self.branchZone)

        self.streetNpc = None
        
        self.hqInterior = DistributedHQInteriorAI.DistributedHQInteriorAI(1, self.air, self.hqZone)
        self.hqInterior.generateWithRequired(self.hqZone)
        self.hqInterior.setTutorial(1)

        self.hqNpc = NPCToons.createNPC(self.air, 20002, NPCToons.NPCToonDict[20002], self.hqZone)
        self.hqNpc.setTutorial(1)
        self.hqNpc.setHq(1)

        self.streetHqDoor = DistributedDoorAI.DistributedDoorAI(self.air, 1, DoorTypes.EXT_HQ, doorIndex = 0, lockValue = FADoorCodes.DEFEAT_FLUNKY_HQ)
        self.streetHqDoor2 = DistributedDoorAI.DistributedDoorAI(self.air, 1, DoorTypes.EXT_HQ, doorIndex = 1, lockValue = FADoorCodes.DEFEAT_FLUNKY_HQ)

        self.hqInsideDoor = DistributedDoorAI.DistributedDoorAI(self.air, 1, DoorTypes.INT_HQ, doorIndex = 0, lockValue = FADoorCodes.TALK_TO_HQ)
        self.hqInsideDoor2 = DistributedDoorAI.DistributedDoorAI(self.air, 1, DoorTypes.INT_HQ, doorIndex = 1, lockValue = FADoorCodes.TALK_TO_HQ)
        
        self.acceptDoorEvent(2, {
                                 self.streetHqDoor: FADoorCodes.GO_TO_PLAYGROUND,
                                 self.streetHqDoor2: FADoorCodes.GO_TO_PLAYGROUND,
                                 self.hqInsideDoor2: FADoorCodes.UNLOCKED,
                                }
                            )
        
        self.streetHqDoor.setOtherDoor(self.hqInsideDoor)
        self.hqInsideDoor.setOtherDoor(self.streetHqDoor)
        
        self.streetHqDoor2.setOtherDoor(self.hqInsideDoor2)
        self.hqInsideDoor2.setOtherDoor(self.streetHqDoor2)

        self.streetHqDoor.generateWithRequired(self.branchZone)
        self.streetHqDoor2.generateWithRequired(self.branchZone)
        
        self.streetHqDoor.sendUpdate('setDoorIndex', [self.streetHqDoor.getDoorIndex()])
        self.streetHqDoor2.sendUpdate('setDoorIndex', [self.streetHqDoor2.getDoorIndex()])
        
        self.hqInsideDoor.generateWithRequired(self.hqZone)
        self.hqInsideDoor2.generateWithRequired(self.hqZone)
        
        self.hqInsideDoor.sendUpdate('setDoorIndex', [self.hqInsideDoor.getDoorIndex()])
        self.hqInsideDoor2.sendUpdate('setDoorIndex', [self.hqInsideDoor2.getDoorIndex()])
        
        self.zones = (20000, self.branchZone, self.interiorZone, self.hqZone)