def setup(self, blockNumber):
     self.interior = DistributedHQInteriorAI.DistributedHQInteriorAI(blockNumber, self.air, self.interiorZone)
     self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)
     self.interior.generateWithRequired(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
Exemplo n.º 2
0
    def setup(self, blockNumber):
        # The interior
        self.interior = DistributedHQInteriorAI.DistributedHQInteriorAI(
            blockNumber, self.air, self.interiorZone)

        #desc = (self.interiorZone, "HQ Officer", ('dls', 'ms', 'm', 'm', 6,0,6,6,40,8), "m", 1, 0)
        #self.npc = NPCToons.createNPC(self.air, Quests.ToonHQ, desc, self.interiorZone)

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

        self.interior.generateWithRequired(self.interiorZone)
        # Outside door 0.
        door0 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                    blockNumber,
                                                    DoorTypes.EXT_HQ,
                                                    doorIndex=0)
        # Outside door 1.
        door1 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                    blockNumber,
                                                    DoorTypes.EXT_HQ,
                                                    doorIndex=1)
        # Inside door 0.
        insideDoor0 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                          blockNumber,
                                                          DoorTypes.INT_HQ,
                                                          doorIndex=0)
        # Inside door 1.
        insideDoor1 = DistributedDoorAI.DistributedDoorAI(self.air,
                                                          blockNumber,
                                                          DoorTypes.INT_HQ,
                                                          doorIndex=1)
        # Tell them about each other:
        door0.setOtherDoor(insideDoor0)
        insideDoor0.setOtherDoor(door0)
        door1.setOtherDoor(insideDoor1)
        insideDoor1.setOtherDoor(door1)
        # Put them in the right zones
        door0.zoneId = self.exteriorZone
        door1.zoneId = self.exteriorZone
        insideDoor0.zoneId = self.interiorZone
        insideDoor1.zoneId = self.interiorZone
        # Now that they both now about each other, generate them:
        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()])
        # keep track of them:
        self.door0 = door0
        self.door1 = door1
        self.insideDoor0 = insideDoor0
        self.insideDoor1 = insideDoor1
        return
Exemplo n.º 3
0
    def setup(self, blockNumber):
        # The interior
        self.interior = DistributedHQInteriorAI.DistributedHQInteriorAI(
            blockNumber, self.air, self.interiorZone)

        # We do not use a standard npc toon here becuase these npcs are created on
        # the fly for as many tutorials as we need. The interior zone is not known
        # until the ai allocates a zone, so we fabricate the description here.
        desc = (self.interiorZone, TTLocalizer.TutorialHQOfficerName,
                ('dls', 'ms', 'm', 'm', 6, 0, 6, 6, 0, 10, 0, 10, 2,
                 9), "m", 1, 0)
        self.npc = NPCToons.createNPC(self.air,
                                      Quests.ToonHQ,
                                      desc,
                                      self.interiorZone,
                                      questCallback=self.unlockInsideDoor1)
        # Flag npc as part of tutorial
        self.npc.setTutorial(1)

        self.interior.generateWithRequired(self.interiorZone)
        # Outside door 0. Locked til you defeat the Flunky:
        door0 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            blockNumber,
            DoorTypes.EXT_HQ,
            doorIndex=0,
            lockValue=FADoorCodes.DEFEAT_FLUNKY_HQ)
        # Outside door 1. Always locked.
        door1 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            blockNumber,
            DoorTypes.EXT_HQ,
            doorIndex=1,
            lockValue=FADoorCodes.GO_TO_PLAYGROUND)
        # Inside door 0. Always locked, but the message will change.
        insideDoor0 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            blockNumber,
            DoorTypes.INT_HQ,
            doorIndex=0,
            lockValue=FADoorCodes.TALK_TO_HQ)
        # Inside door 1. Locked til you get your HQ reward.
        insideDoor1 = DistributedDoorAI.DistributedDoorAI(
            self.air,
            blockNumber,
            DoorTypes.INT_HQ,
            doorIndex=1,
            lockValue=FADoorCodes.TALK_TO_HQ)
        # Tell them about each other:
        door0.setOtherDoor(insideDoor0)
        insideDoor0.setOtherDoor(door0)
        door1.setOtherDoor(insideDoor1)
        insideDoor1.setOtherDoor(door1)
        # Put them in the right zones
        door0.zoneId = self.exteriorZone
        door1.zoneId = self.exteriorZone
        insideDoor0.zoneId = self.interiorZone
        insideDoor1.zoneId = self.interiorZone
        # Now that they both now about each other, generate them:
        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()])
        # keep track of them:
        self.door0 = door0
        self.door1 = door1
        self.insideDoor0 = insideDoor0
        self.insideDoor1 = insideDoor1
        # hide the periscope
        self.interior.setTutorial(1)
        return