oldschool-toontown/toontown/building/GagshopBuildingAI.py

41 lines
1.6 KiB
Python
Raw Normal View History

2019-11-02 17:27:54 -05:00
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
from . import DistributedDoorAI, DistributedGagshopInteriorAI, FADoorCodes, DoorTypes
2019-11-02 17:27:54 -05:00
from toontown.toon import NPCToons
from toontown.quest import Quests
class GagshopBuildingAI:
def __init__(self, air, exteriorZone, interiorZone, blockNumber):
self.air = air
self.exteriorZone = exteriorZone
self.interiorZone = interiorZone
self.setup(blockNumber)
def cleanup(self):
for npc in self.npcs:
npc.requestDelete()
del self.npcs
self.door.requestDelete()
del self.door
self.insideDoor.requestDelete()
del self.insideDoor
self.interior.requestDelete()
del self.interior
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