Poodletooth-iLand/toontown/hood/TTHoodAI.py

56 lines
2.4 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from toontown.hood import HoodAI
from toontown.safezone import ButterflyGlobals
from toontown.safezone import DistributedButterflyAI
from toontown.safezone import DistributedTrolleyAI
from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
2015-06-23 15:20:41 -05:00
from toontown.ai import DistributedEffectMgrAI
2015-03-03 16:10:12 -06:00
class TTHoodAI(HoodAI.HoodAI):
def __init__(self, air):
HoodAI.HoodAI.__init__(self, air,
ToontownGlobals.ToontownCentral,
ToontownGlobals.ToontownCentral)
self.trolley = None
self.startup()
def startup(self):
HoodAI.HoodAI.startup(self)
if simbase.config.GetBool('want-minigames', True):
self.createTrolley()
if simbase.config.GetBool('want-butterflies', True):
self.createButterflies()
2015-06-10 21:20:40 -05:00
2015-05-13 06:00:52 -05:00
NPCToons.createNPC(
simbase.air, 2021,
(ToontownGlobals.ToontownCentral, TTLocalizer.NPCToonNames[2021], ('dss', 'ls', 's', 'm', 13, 41, 13, 13, 1, 6, 1, 6, 0, 18, 0), 'm', 1, NPCToons.NPC_GLOVE),
ToontownGlobals.ToontownCentral, posIndex=0)
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.HALLOWEEN, 12)
2015-06-23 15:20:41 -05:00
self.trickOrTreatMgr.generateWithRequired(2649) # All Fun and Games Shop, Silly Street
2015-06-10 21:20:40 -05:00
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.CHRISTMAS, 14)
2015-06-23 15:20:41 -05:00
self.winterCarolingMgr.generateWithRequired(2659) # Joy Buzzers to the World, Silly Street
2015-03-03 16:10:12 -06:00
def shutdown(self):
HoodAI.HoodAI.shutdown(self)
ButterflyGlobals.clearIndexes(self.zoneId)
def createTrolley(self):
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)
self.trolley.generateWithRequired(self.zoneId)
self.trolley.start()
def createButterflies(self):
2015-06-10 21:20:40 -05:00
playground = ButterflyGlobals.TTC
2015-03-03 16:10:12 -06:00
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.TTC)
2015-06-23 15:20:41 -05:00
2015-03-03 16:10:12 -06:00
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.TTC]):
for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.TTC]):
2015-06-10 21:20:40 -05:00
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId)
2015-03-03 16:10:12 -06:00
butterfly.generateWithRequired(self.zoneId)
2015-06-23 15:20:41 -05:00
butterfly.start()