Exemple #1
0
    def __createTutorial(self, avId):
        if self.playerDict.get(avId):
            self.notify.warning(str(avId) + " is already in the playerDict!")

        branchZone = self.air.allocateZone()
        streetZone = self.air.allocateZone()
        shopZone = self.air.allocateZone()
        hqZone = self.air.allocateZone()
        # Create a building object
        building = TutorialBuildingAI.TutorialBuildingAI(self.air,
                                                         streetZone,
                                                         shopZone,
                                                         self.gagBlock)
        # Create an HQ object
        hqBuilding = TutorialHQBuildingAI.TutorialHQBuildingAI(self.air,
                                                               streetZone,
                                                               hqZone,
                                                               self.hqBlock)

        def battleOverCallback(zoneId):
            hqBuilding.battleOverCallback()
            building.battleOverCallback()

        # Create a suit planner
        suitPlanner = SuitPlannerTutorialAI.SuitPlannerTutorialAI(
            self.air,
            streetZone,
            battleOverCallback)

        # Create the NPC blocking the tunnel to the playground
        blockerNPC = NPCToons.createNPC(self.air, 20001, NPCToons.NPCToonDict[20001], streetZone,
                                        questCallback=self.__handleBlockDone)
        blockerNPC.setTutorial(1)

        # is the black cat holiday enabled?
        blackCatMgr = None
        if bboard.has(BlackCatHolidayMgrAI.BlackCatHolidayMgrAI.PostName):
            blackCatMgr = DistributedBlackCatMgrAI.DistributedBlackCatMgrAI(
                self.air, avId)
            blackCatMgr.generateWithRequired(streetZone)

        zoneDict={"branchZone" : branchZone,
                  "streetZone" : streetZone,
                  "shopZone" : shopZone,
                  "hqZone" : hqZone,
                  "building" : building,
                  "hqBuilding" : hqBuilding,
                  "suitPlanner" : suitPlanner,
                  "blockerNPC" : blockerNPC,
                  "blackCatMgr" : blackCatMgr,
                  }
        self.playerDict[avId] = zoneDict
        return zoneDict
    def enterTunnel(self):
        npcDesc = NPCToons.NPCToonDict.get(20001)
        self.flippy = NPCToons.createNPC(self.air, 20001, npcDesc, self.zones['street'], 0)

        if simbase.air.wantHalloween:
            self.BlackCatManager = DistributedBlackCatMgrAI.DistributedBlackCatMgrAI(self.air)
            self.BlackCatManager.generateWithRequired(self.zones['street'])

        self.hq.insideDoor0.setDoorLock(FADoorCodes.WRONG_DOOR_HQ)
        self.hq.insideDoor1.setDoorLock(FADoorCodes.UNLOCKED)
        self.hq.door0.setDoorLock(FADoorCodes.GO_TO_PLAYGROUND)
        self.hq.door1.setDoorLock(FADoorCodes.GO_TO_PLAYGROUND)
        self.building.door.setDoorLock(FADoorCodes.GO_TO_PLAYGROUND)