mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 19:52:37 -06:00
Scavenger hunts!! :D
This commit is contained in:
parent
44920579d1
commit
2c8ac1add9
30 changed files with 136 additions and 335 deletions
21
dependencies/astron/dclass/stride.dc
vendored
21
dependencies/astron/dclass/stride.dc
vendored
|
@ -334,8 +334,6 @@ from toontown.ai import DistributedReportMgr/AI
|
|||
from toontown.ai import DistributedPolarPlaceEffectMgr/AI
|
||||
from toontown.ai import DistributedEffectMgr/AI
|
||||
from toontown.ai import DistributedResistanceEmoteMgr/AI
|
||||
from toontown.ai import DistributedTrickOrTreatTarget/AI
|
||||
from toontown.ai import DistributedWinterCarolingTarget/AI
|
||||
from toontown.coghq import DistributedMint/AI
|
||||
from toontown.coghq import DistributedMintRoom/AI
|
||||
from toontown.coghq import DistributedMintBattle/AI
|
||||
|
@ -639,7 +637,7 @@ dclass DistributedToon : DistributedPlayer {
|
|||
setSpeedChatStyleIndex(uint8 = 1) required ownsend broadcast db;
|
||||
setTrophyScore(uint16) broadcast ownrecv ram;
|
||||
setTeleportAccess(uint32[] = []) required ownrecv db;
|
||||
setScavengerHunt(uint32[] = []) required ownrecv db;
|
||||
setScavengerHunt(uint16[] = []) required ownrecv db;
|
||||
checkTeleportAccess(uint16) airecv ownsend;
|
||||
setTeleportOverride(uint8) clsend airecv;
|
||||
battleSOS(uint32) ownrecv clsend;
|
||||
|
@ -716,9 +714,6 @@ dclass DistributedToon : DistributedPlayer {
|
|||
setCurrentKart(uint32) broadcast ownrecv ram;
|
||||
squish(uint8) ownsend airecv;
|
||||
announceBingo() broadcast ownrecv;
|
||||
trickOrTreatTargetMet(uint32) ownrecv;
|
||||
trickOrTreatMilestoneMet() ownrecv;
|
||||
winterCarolingTargetMet(uint32) ownrecv;
|
||||
setCogSummonsEarned(uint8[] = [0*32]) required ownrecv db;
|
||||
reqCogSummons(char [0-256], uint32) ownsend airecv;
|
||||
cogSummonsResponse(string, uint32, uint32) ownrecv;
|
||||
|
@ -2433,23 +2428,13 @@ dclass DistributedPolarPlaceEffectMgr : DistributedObject {
|
|||
dclass DistributedEffectMgr : DistributedObject {
|
||||
setHoliday(uint8) required broadcast;
|
||||
requestEffect() airecv clsend;
|
||||
effectDone();
|
||||
effectDone(uint8);
|
||||
};
|
||||
|
||||
dclass DistributedResistanceEmoteMgr : DistributedObject {
|
||||
addResistanceEmote() clsend airecv;
|
||||
};
|
||||
|
||||
dclass DistributedTrickOrTreatTarget : DistributedObject {
|
||||
doScavengerHunt(int8);
|
||||
requestScavengerHunt() airecv clsend;
|
||||
};
|
||||
|
||||
dclass DistributedWinterCarolingTarget : DistributedObject {
|
||||
doScavengerHunt(int8) broadcast;
|
||||
requestScavengerHunt() airecv clsend;
|
||||
};
|
||||
|
||||
dclass DistributedVehicle : DistributedSmoothNode {
|
||||
setOwner(uint32) required broadcast ram;
|
||||
setState(char, uint32) broadcast ram;
|
||||
|
@ -3298,4 +3283,4 @@ dclass TTSFriendsManager : DistributedObjectGlobal {
|
|||
};
|
||||
|
||||
dclass ARGManager : DistributedObjectGlobal {
|
||||
};
|
||||
};
|
38
dependencies/config/events/grand-opening.prc
vendored
38
dependencies/config/events/grand-opening.prc
vendored
|
@ -1,38 +0,0 @@
|
|||
# Safe zones:
|
||||
want-donalds-dock #f
|
||||
want-daisys-garden #f
|
||||
want-minnies-melodyland #f
|
||||
want-the-burrrgh #f
|
||||
want-donalds-dreamland #f
|
||||
want-goofy-speedway #f
|
||||
want-outdoor-zone #f
|
||||
want-golf-zone #f
|
||||
|
||||
# Safe zone settings:
|
||||
want-treasure-planners #f
|
||||
|
||||
# Cog headquarters:
|
||||
want-cog-headquarters #f
|
||||
|
||||
# Trolley minigames:
|
||||
want-minigames #f
|
||||
|
||||
# Cog buildings:
|
||||
silly-street-building-min 14
|
||||
silly-street-building-max 14
|
||||
silly-street-building-chance 100.0
|
||||
loopy-lane-building-min 14
|
||||
loopy-lane-building-max 14
|
||||
loopy-lane-building-chance 100.0
|
||||
punchline-place-building-min 14
|
||||
punchline-place-building-max 14
|
||||
punchline-place-building-chance 100.0
|
||||
|
||||
# Core features:
|
||||
want-fishing #f
|
||||
want-housing #f
|
||||
want-pets #f
|
||||
want-parties #t
|
||||
|
||||
# Optional:
|
||||
want-talkative-tyler #f
|
2
dependencies/config/holidays/christmas.prc
vendored
2
dependencies/config/holidays/christmas.prc
vendored
|
@ -1,2 +0,0 @@
|
|||
want-christmas #t
|
||||
active-holidays 4, 57
|
2
dependencies/config/holidays/halloween.prc
vendored
2
dependencies/config/holidays/halloween.prc
vendored
|
@ -1,2 +0,0 @@
|
|||
want-halloween #t
|
||||
active-holidays 26, 27, 13
|
2
dependencies/config/release/dev.prc
vendored
2
dependencies/config/release/dev.prc
vendored
|
@ -38,4 +38,4 @@ show-population #t
|
|||
want-instant-parties #t
|
||||
cogdo-pop-factor 1.5
|
||||
cogdo-ratio 0.5
|
||||
default-directnotify-level info
|
||||
default-directnotify-level info
|
2
dependencies/config/release/en.prc
vendored
2
dependencies/config/release/en.prc
vendored
|
@ -1,2 +0,0 @@
|
|||
# Distribution:
|
||||
distribution en
|
23
dependencies/config/release/test.prc
vendored
23
dependencies/config/release/test.prc
vendored
|
@ -1,23 +0,0 @@
|
|||
# Distribution:
|
||||
distribution test
|
||||
|
||||
# Server:
|
||||
server-version SERVER_VERSION
|
||||
client-agents 8
|
||||
shard-low-pop 100
|
||||
shard-mid-pop 150
|
||||
|
||||
# Core features:
|
||||
want-housing #t
|
||||
want-pets #f
|
||||
want-parties #t
|
||||
want-cogdominiums #t
|
||||
want-lawbot-cogdo #f
|
||||
boarding-group-merges #t
|
||||
|
||||
# Optional:
|
||||
cogdo-pop-factor 1.5
|
||||
cogdo-ratio 0.4
|
||||
|
||||
# Staff events:
|
||||
cfo-staff-event #f
|
|
@ -3,8 +3,10 @@ from otp.otpbase.OTPLocalizer import SpeedChatStaticText
|
|||
SCStaticTextMsgEvent = 'SCStaticTextMsg'
|
||||
|
||||
def decodeSCStaticTextMsg(textId):
|
||||
return SpeedChatStaticText.get(textId, None)
|
||||
if 30200 <= textId <= 30205:
|
||||
textId += 20
|
||||
|
||||
return SpeedChatStaticText.get(textId, None)
|
||||
|
||||
class SCStaticTextTerminal(SCTerminal):
|
||||
|
||||
|
|
|
@ -35,5 +35,15 @@ class DistributedEffectMgr(DistributedObject):
|
|||
|
||||
self.sendUpdate('requestEffect')
|
||||
|
||||
def effectDone(self):
|
||||
self.cr.newsManager.broadcastHoliday(holidayInfo, 'effectMessage')
|
||||
def effectDone(self, amount):
|
||||
holidayInfo = HolidayGlobals.getHoliday(self.holiday)
|
||||
|
||||
self.cr.newsManager.broadcastHoliday(holidayInfo, 'effectMessage')
|
||||
|
||||
if 'scavengerHunt' in holidayInfo:
|
||||
type = holidayInfo['scavengerHunt']
|
||||
|
||||
if type == HolidayGlobals.TRICK_OR_TREAT:
|
||||
base.localAvatar.trickOrTreatTargetMet(amount)
|
||||
elif type == HolidayGlobals.WINTER_CAROLING:
|
||||
base.localAvatar.winterCarolingTargetMet(amount)
|
|
@ -21,11 +21,23 @@ class DistributedEffectMgrAI(DistributedObjectAI):
|
|||
if not av:
|
||||
return
|
||||
|
||||
holiday = HolidayGlobals.getHoliday(self.holiday)
|
||||
expireTime = int(HolidayGlobals.getUnixTime(HolidayGlobals.getEndDate(holiday)) / 60)
|
||||
holidayInfo = HolidayGlobals.getHoliday(self.holiday)
|
||||
expireTime = int(HolidayGlobals.getUnixTime(HolidayGlobals.getEndDate(holidayInfo)) / 60)
|
||||
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone')
|
||||
self.doEffect(expireTime)
|
||||
|
||||
def doEffect(self, expireTime):
|
||||
av.b_setCheesyEffect(self.effectId, 0, expireTime)
|
||||
if 'scavengerHunt' in holidayInfo:
|
||||
scavengerHunt = av.getScavengerHunt()
|
||||
|
||||
if self.zoneId in scavengerHunt:
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone', [0])
|
||||
else:
|
||||
scavengerHunt.append(self.zoneId)
|
||||
av.b_setScavengerHunt(scavengerHunt)
|
||||
av.addMoney(HolidayGlobals.CAROLING_REWARD)
|
||||
|
||||
if len(scavengerHunt) == HolidayGlobals.SCAVENGER_HUNT_LOCATIONS:
|
||||
av.b_setCheesyEffect(self.effectId, 0, expireTime)
|
||||
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone', [HolidayGlobals.CAROLING_REWARD])
|
||||
else:
|
||||
av.b_setCheesyEffect(self.effectId, 0, expireTime)
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone', [0])
|
|
@ -1,40 +0,0 @@
|
|||
from otp.speedchat import SpeedChatGlobals
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed import DistributedObject
|
||||
from direct.interval.IntervalGlobal import *
|
||||
|
||||
class DistributedTrickOrTreatTarget(DistributedObject.DistributedObject):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrickOrTreatTarget')
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObject.DistributedObject.__init__(self, cr)
|
||||
self.triggered = False
|
||||
self.triggerDelay = 15
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObject.DistributedObject.announceGenerate(self)
|
||||
DistributedTrickOrTreatTarget.notify.debug('announceGenerate')
|
||||
self.accept(SpeedChatGlobals.SCStaticTextMsgEvent, self.phraseSaid)
|
||||
|
||||
def phraseSaid(self, phraseId):
|
||||
self.notify.debug('Checking if phrase was said')
|
||||
helpPhrase = 10003
|
||||
|
||||
def reset():
|
||||
self.triggered = False
|
||||
|
||||
if phraseId == helpPhrase and not self.triggered:
|
||||
self.triggered = True
|
||||
self.d_requestScavengerHunt()
|
||||
taskMgr.doMethodLater(self.triggerDelay, reset, 'ScavengerHunt-phrase-reset', extraArgs=[])
|
||||
|
||||
def delete(self):
|
||||
self.ignore(SpeedChatGlobals.SCStaticTextMsgEvent)
|
||||
DistributedObject.DistributedObject.delete(self)
|
||||
|
||||
def d_requestScavengerHunt(self):
|
||||
self.sendUpdate('requestScavengerHunt', [])
|
||||
|
||||
def doScavengerHunt(self, amount):
|
||||
DistributedTrickOrTreatTarget.notify.debug('doScavengerHunt')
|
||||
base.localAvatar.trickOrTreatTargetMet(amount)
|
|
@ -1,30 +0,0 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
from direct.fsm.FSM import FSM
|
||||
|
||||
class DistributedTrickOrTreatTargetAI(DistributedObjectAI, FSM):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedTrickOrTreatTargetAI")
|
||||
|
||||
def __init__(self, air):
|
||||
DistributedObjectAI.__init__(self, air)
|
||||
FSM.__init__(self, 'TrickOrTreatTargeFSM')
|
||||
self.air = air
|
||||
|
||||
def enterOff(self):
|
||||
self.requestDelete()
|
||||
|
||||
def requestScavengerHunt(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
av = self.air.doId2do.get(avId)
|
||||
if av is None:
|
||||
return
|
||||
scavengerHunt = av.getScavengerHunt()
|
||||
if self.zoneId in scavengerHunt:
|
||||
self.sendUpdateToAvatarId(avId, 'doScavengerHunt', [0])
|
||||
else:
|
||||
self.sendUpdateToAvatarId(avId, 'doScavengerHunt', [100])
|
||||
scavengerHunt.append(self.zoneId)
|
||||
av.b_setScavengerHunt(scavengerHunt)
|
||||
av.addMoney(100)
|
||||
if len(scavengerHunt) == 6:
|
||||
av.b_setCheesyEffect(12, 0, 0)
|
|
@ -1,43 +0,0 @@
|
|||
from otp.speedchat import SpeedChatGlobals
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed import DistributedObject
|
||||
from direct.interval.IntervalGlobal import *
|
||||
|
||||
class DistributedWinterCarolingTarget(DistributedObject.DistributedObject):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedWinterCarolingTarget')
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObject.DistributedObject.__init__(self, cr)
|
||||
self.triggered = False
|
||||
self.triggerDelay = 15
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObject.DistributedObject.announceGenerate(self)
|
||||
DistributedWinterCarolingTarget.notify.debug('announceGenerate')
|
||||
self.accept(SpeedChatGlobals.SCStaticTextMsgEvent, self.phraseSaid)
|
||||
|
||||
def phraseSaid(self, phraseId):
|
||||
self.notify.debug('Checking if phrase was said')
|
||||
helpPhrases = []
|
||||
for i in xrange(6):
|
||||
helpPhrases.append(30220 + i)
|
||||
|
||||
def reset():
|
||||
self.triggered = False
|
||||
|
||||
if phraseId in helpPhrases and not self.triggered:
|
||||
self.triggered = True
|
||||
self.d_requestScavengerHunt()
|
||||
taskMgr.doMethodLater(self.triggerDelay, reset, 'ScavengerHunt-phrase-reset', extraArgs=[])
|
||||
|
||||
def delete(self):
|
||||
self.ignore(SpeedChatGlobals.SCStaticTextMsgEvent)
|
||||
DistributedObject.DistributedObject.delete(self)
|
||||
|
||||
def d_requestScavengerHunt(self):
|
||||
self.sendUpdate('requestScavengerHunt', [])
|
||||
|
||||
def doScavengerHunt(self, amount):
|
||||
DistributedWinterCarolingTarget.notify.debug('doScavengerHunt')
|
||||
av = base.localAvatar
|
||||
av.winterCarolingTargetMet(amount)
|
|
@ -1,29 +0,0 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
from direct.fsm.FSM import FSM
|
||||
|
||||
class DistributedWinterCarolingTargetAI(DistributedObjectAI, FSM):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedWinterCarolingTargetAI")
|
||||
|
||||
def __init__(self, air):
|
||||
DistributedObjectAI.__init__(self, air)
|
||||
FSM.__init__(self, 'WinterCarolingFSM')
|
||||
self.air = air
|
||||
|
||||
def enterOff(self):
|
||||
self.requestDelete()
|
||||
|
||||
def requestScavengerHunt(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
av = self.air.doId2do.get(avId)
|
||||
if av is None:
|
||||
return
|
||||
scavengerHunt = av.getScavengerHunt()
|
||||
if self.zoneId in scavengerHunt:
|
||||
self.sendUpdate('doScavengerHunt', [0])
|
||||
else:
|
||||
self.sendUpdate('doScavengerHunt', [100])
|
||||
scavengerHunt.append(self.zoneId)
|
||||
av.b_setScavengerHunt(scavengerHunt)
|
||||
if len(scavengerHunt) == 6:
|
||||
av.b_setCheesyEffect(14, 0, 0)
|
|
@ -1,6 +1,11 @@
|
|||
from toontown.toonbase import ToontownGlobals, TTLocalizer
|
||||
import calendar, datetime
|
||||
|
||||
TRICK_OR_TREAT = 0
|
||||
WINTER_CAROLING = 1
|
||||
CAROLING_REWARD = 100
|
||||
SCAVENGER_HUNT_LOCATIONS = 6
|
||||
|
||||
Holidays = {
|
||||
ToontownGlobals.LAUGHING_MAN: {
|
||||
'startMonth': 6,
|
||||
|
@ -56,6 +61,30 @@ Holidays = {
|
|||
'speedchatIndexes': [30450], # It's easy to be green!
|
||||
'effectMessage': TTLocalizer.GreenToonEffectMsg,
|
||||
'effectDelay': 10
|
||||
},
|
||||
ToontownGlobals.WINTER_CAROLING: {
|
||||
'startMonth': 12,
|
||||
'startDay': 14,
|
||||
'endMonth': 1,
|
||||
'endDay': 4,
|
||||
'startMessage': TTLocalizer.WinterCarolingStart,
|
||||
'ongoingMessage': TTLocalizer.WinterCarolingStart,
|
||||
'endMessage': TTLocalizer.WinterCarolingEnd,
|
||||
'speedchatIndexes': range(30200, 30206),
|
||||
'effectDelay': 15,
|
||||
'scavengerHunt': WINTER_CAROLING
|
||||
},
|
||||
ToontownGlobals.TRICK_OR_TREAT: {
|
||||
'startMonth': 10,
|
||||
'startDay': 13,
|
||||
'endMonth': 10,
|
||||
'endDay': 31,
|
||||
'startMessage': TTLocalizer.TrickOrTreatStart,
|
||||
'ongoingMessage': TTLocalizer.TrickOrTreatStart,
|
||||
'endMessage': TTLocalizer.TrickOrTreatEnd,
|
||||
'speedchatIndexes': [10003],
|
||||
'effectDelay': 15,
|
||||
'scavengerHunt': TRICK_OR_TREAT
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,10 @@ class NewsManager(DistributedObject):
|
|||
base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu()
|
||||
elif id == ToontownGlobals.IDES_OF_MARCH:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.addIdesOfMarchMenu()
|
||||
elif id == ToontownGlobals.TRICK_OR_TREAT:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.addHalloweenMenu()
|
||||
elif id == ToontownGlobals.WINTER_CAROLING:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.addWinterMenu()
|
||||
|
||||
def endSpecialHoliday(self, id):
|
||||
if id == ToontownGlobals.LAUGHING_MAN:
|
||||
|
@ -73,4 +77,8 @@ class NewsManager(DistributedObject):
|
|||
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu()
|
||||
elif id == ToontownGlobals.IDES_OF_MARCH:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeIdesOfMarchMenu()
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeIdesOfMarchMenu()
|
||||
elif id == ToontownGlobals.TRICK_OR_TREAT:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeHalloweenMenu()
|
||||
elif id == ToontownGlobals.WINTER_CAROLING:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeWinterMenu()
|
|
@ -88,8 +88,6 @@ class ToontownAIRepository(ToontownInternalRepository):
|
|||
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
|
||||
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
|
||||
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
|
||||
self.wantHalloween = self.config.GetBool('want-halloween', False)
|
||||
self.wantChristmas = self.config.GetBool('want-christmas', False)
|
||||
|
||||
self.cogSuitMessageSent = False
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@ from otp.speedchat.SCTerminal import SCTerminal
|
|||
from otp.otpbase.OTPLocalizer import SpeedChatStaticText
|
||||
SCStaticTextMsgEvent = 'SCStaticTextMsg'
|
||||
|
||||
def decodeSCStaticTextMsg(textId):
|
||||
return SpeedChatStaticText.get(textId, None)
|
||||
|
||||
|
||||
class TTSCWhiteListTerminal(SCTerminal):
|
||||
|
||||
def __init__(self, textId, parentMenu = None):
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
from pandac.PandaModules import *
|
||||
from direct.interval.IntervalGlobal import *
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from direct.gui.DirectFrame import DirectFrame
|
||||
from direct.gui.DirectLabel import DirectLabel
|
||||
from toontown.toonbase import ToontownGlobals, TTLocalizer
|
||||
|
||||
class ScavengerHuntEffect:
|
||||
images = None
|
||||
|
@ -11,7 +9,9 @@ class ScavengerHuntEffect:
|
|||
def __init__(self, beanAmount):
|
||||
if not ScavengerHuntEffect.images:
|
||||
ScavengerHuntEffect.images = loader.loadModel('phase_4/models/props/tot_jar')
|
||||
|
||||
self.npRoot = DirectFrame(parent=aspect2d, relief=None, scale=0.75, pos=(0, 0, 0.6))
|
||||
|
||||
if beanAmount > 0:
|
||||
self.npRoot.setColorScale(VBase4(1, 1, 1, 0))
|
||||
self.jar = DirectFrame(parent=self.npRoot, relief=None, image=ScavengerHuntEffect.images.find('**/tot_jar'))
|
||||
|
@ -32,29 +32,19 @@ class ScavengerHuntEffect:
|
|||
self.npRoot.setColorScale(VBase4(1, 1, 1, 0))
|
||||
self.attemptFailedMsg()
|
||||
self.track = Sequence(LerpColorScaleInterval(self.npRoot, 1, colorScale=VBase4(1, 1, 1, 1), startColorScale=VBase4(1, 1, 1, 0)), Wait(5), LerpColorScaleInterval(self.npRoot, 1, colorScale=VBase4(1, 1, 1, 0), startColorScale=VBase4(1, 1, 1, 1)), Func(self.destroy))
|
||||
return
|
||||
|
||||
def play(self):
|
||||
if self.npRoot:
|
||||
self.track.start()
|
||||
|
||||
def stop(self):
|
||||
if self.track != None:
|
||||
if self.track.isPlaying():
|
||||
self.track.finish()
|
||||
return
|
||||
|
||||
def cleanupIntervals(self, interval):
|
||||
while len(interval) > 0:
|
||||
if isinstance(interval[0], Sequence) or isinstance(interval[0], Parallel):
|
||||
self.cleanupIntervals(interval[0])
|
||||
interval.pop(0)
|
||||
else:
|
||||
interval.pop(0)
|
||||
if self.track != None and self.track.isPlaying():
|
||||
self.track.finish()
|
||||
|
||||
def destroy(self):
|
||||
self.stop()
|
||||
self.track = None
|
||||
|
||||
if hasattr(self, 'eventImage') and self.eventImage:
|
||||
self.eventImage.detachNode()
|
||||
del self.eventImage
|
||||
|
@ -67,53 +57,38 @@ class ScavengerHuntEffect:
|
|||
if hasattr(self, 'npRoot') and self.npRoot:
|
||||
self.npRoot.destroy()
|
||||
del self.npRoot
|
||||
return
|
||||
|
||||
|
||||
class TrickOrTreatTargetEffect(ScavengerHuntEffect):
|
||||
|
||||
def __init__(self, beanAmount):
|
||||
ScavengerHuntEffect.__init__(self, beanAmount)
|
||||
|
||||
if beanAmount > 0:
|
||||
self.pumpkin = DirectFrame(parent=self.eventImage, relief=None, image=ScavengerHuntEffect.images.find('**/tot_pumpkin_tall'))
|
||||
return
|
||||
|
||||
def attemptFailedMsg(self):
|
||||
pLabel = DirectLabel(parent=self.npRoot, relief=None, pos=(0.0, 0.0, -0.15), text=TTLocalizer.TrickOrTreatMsg, text_fg=(0.95, 0.5, 0.0, 1.0), text_scale=0.12, text_font=ToontownGlobals.getSignFont())
|
||||
return
|
||||
|
||||
def destroy(self):
|
||||
if hasattr(self, 'pumpkin') and self.pumpkin:
|
||||
self.pumpkin.destroy()
|
||||
ScavengerHuntEffect.destroy(self)
|
||||
|
||||
ScavengerHuntEffect.destroy(self)
|
||||
|
||||
class WinterCarolingEffect(ScavengerHuntEffect):
|
||||
|
||||
def __init__(self, beanAmount):
|
||||
ScavengerHuntEffect.__init__(self, beanAmount)
|
||||
|
||||
if beanAmount > 0:
|
||||
sm = loader.loadModel('phase_5.5/models/estate/tt_m_prp_ext_snowman_icon')
|
||||
self.snowman = DirectFrame(parent=self.eventImage, relief=None, image=sm, scale=20.0)
|
||||
return
|
||||
|
||||
def attemptFailedMsg(self):
|
||||
pLabel = DirectLabel(parent=self.npRoot, relief=None, pos=(0.0, 0.0, -0.15), text=TTLocalizer.WinterCarolingMsg, text_fg=(0.9, 0.9, 1.0, 1.0), text_scale=0.12, text_font=ToontownGlobals.getSignFont())
|
||||
return
|
||||
|
||||
def destroy(self):
|
||||
if hasattr(self, 'snowman') and self.snowman:
|
||||
self.snowman.destroy()
|
||||
ScavengerHuntEffect.destroy(self)
|
||||
|
||||
|
||||
class TrickOrTreatMilestoneEffect:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def play(self):
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
ScavengerHuntEffect.destroy(self)
|
|
@ -2,7 +2,7 @@ from toontown.hood import HoodAI
|
|||
from toontown.safezone import DistributedTrolleyAI
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedPolarPlaceEffectMgrAI
|
||||
from toontown.ai import DistributedTrickOrTreatTargetAI
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class BRHoodAI(HoodAI.HoodAI):
|
||||
def __init__(self, air):
|
||||
|
@ -22,12 +22,14 @@ class BRHoodAI(HoodAI.HoodAI):
|
|||
|
||||
self.PolarPlaceEffectManager = DistributedPolarPlaceEffectMgrAI.DistributedPolarPlaceEffectMgrAI(self.air)
|
||||
self.PolarPlaceEffectManager.generateWithRequired(3821)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(3707)
|
||||
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(3707) # Snowplace Like Home, Sleet Street
|
||||
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(3828) # Snowman's Land, Polar Place
|
||||
|
||||
def createTrolley(self):
|
||||
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)
|
||||
self.trolley.generateWithRequired(self.zoneId)
|
||||
self.trolley.start()
|
||||
self.trolley.start()
|
|
@ -2,8 +2,7 @@ from toontown.hood import HoodAI
|
|||
from toontown.safezone import DistributedBoatAI
|
||||
from toontown.safezone import DistributedTrolleyAI
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedTrickOrTreatTargetAI
|
||||
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class DDHoodAI(HoodAI.HoodAI):
|
||||
def __init__(self, air):
|
||||
|
@ -23,9 +22,11 @@ class DDHoodAI(HoodAI.HoodAI):
|
|||
self.createTrolley()
|
||||
self.createBoat()
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(1834)
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(1834) # Rudderly Ridiculous, Lighthouse Lane
|
||||
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(1707) # Gifts with a Porpoise, Seaweed Street
|
||||
|
||||
def createTrolley(self):
|
||||
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)
|
||||
|
@ -35,4 +36,4 @@ class DDHoodAI(HoodAI.HoodAI):
|
|||
def createBoat(self):
|
||||
self.boat = DistributedBoatAI.DistributedBoatAI(self.air)
|
||||
self.boat.generateWithRequired(self.zoneId)
|
||||
self.boat.start()
|
||||
self.boat.start()
|
|
@ -4,7 +4,7 @@ from toontown.safezone import DistributedButterflyAI
|
|||
from toontown.safezone import DistributedDGFlowerAI
|
||||
from toontown.safezone import DistributedTrolleyAI
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedEffectMgrAI, DistributedTrickOrTreatTargetAI
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class DGHoodAI(HoodAI.HoodAI):
|
||||
|
||||
|
@ -30,9 +30,11 @@ class DGHoodAI(HoodAI.HoodAI):
|
|||
self.greenToonMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.IDES_OF_MARCH, 15)
|
||||
self.greenToonMgr.generateWithRequired(5819)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(5620)
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(5620) # Rake It Inn, Elm Street
|
||||
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(5626) # Pine Needle Crafts, Elm Street
|
||||
|
||||
def shutdown(self):
|
||||
HoodAI.HoodAI.shutdown(self)
|
||||
|
@ -52,8 +54,9 @@ class DGHoodAI(HoodAI.HoodAI):
|
|||
def createButterflies(self):
|
||||
playground = ButterflyGlobals.DG
|
||||
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.DG)
|
||||
|
||||
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.DG]):
|
||||
for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.DG]):
|
||||
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId)
|
||||
butterfly.generateWithRequired(self.zoneId)
|
||||
butterfly.start()
|
||||
butterfly.start()
|
|
@ -2,8 +2,7 @@ from toontown.hood import HoodAI
|
|||
from toontown.safezone import DistributedTrolleyAI, DistributedPillowAI
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedResistanceEmoteMgrAI
|
||||
from toontown.ai import DistributedTrickOrTreatTargetAI
|
||||
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class DLHoodAI(HoodAI.HoodAI):
|
||||
def __init__(self, air):
|
||||
|
@ -20,12 +19,15 @@ class DLHoodAI(HoodAI.HoodAI):
|
|||
|
||||
if simbase.config.GetBool('want-minigames', True):
|
||||
self.createTrolley()
|
||||
|
||||
self.resistanceEmoteManager = DistributedResistanceEmoteMgrAI.DistributedResistanceEmoteMgrAI(self.air)
|
||||
self.resistanceEmoteManager.generateWithRequired(9720)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(9619)
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(9619) # Relax to the Max, Lullaby Lane
|
||||
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(9722) # Dream On Talent Agency, Pajama Place
|
||||
|
||||
self.createPillow()
|
||||
|
||||
|
@ -36,4 +38,4 @@ class DLHoodAI(HoodAI.HoodAI):
|
|||
|
||||
def createPillow(self):
|
||||
self.pillow = DistributedPillowAI.DistributedPillowAI(self.air)
|
||||
self.pillow.generateWithRequired(self.zoneId)
|
||||
self.pillow.generateWithRequired(self.zoneId)
|
|
@ -2,7 +2,7 @@ from toontown.hood import HoodAI
|
|||
from toontown.safezone import DistributedTrolleyAI
|
||||
from toontown.safezone import DistributedMMPianoAI
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedTrickOrTreatTargetAI
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class MMHoodAI(HoodAI.HoodAI):
|
||||
def __init__(self, air):
|
||||
|
@ -24,11 +24,13 @@ class MMHoodAI(HoodAI.HoodAI):
|
|||
self.piano = DistributedMMPianoAI.DistributedMMPianoAI(self.air)
|
||||
self.piano.generateWithRequired(self.zoneId)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(4835)
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(4835) # Ursatz for Really Kool Katz, Tenor Terrace
|
||||
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(4614) # Shave and a Haircut for a Song, Alto Avenue
|
||||
|
||||
def createTrolley(self):
|
||||
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)
|
||||
self.trolley.generateWithRequired(self.zoneId)
|
||||
self.trolley.start()
|
||||
self.trolley.start()
|
|
@ -5,9 +5,7 @@ from toontown.safezone import DistributedTrolleyAI
|
|||
from toontown.toon import NPCToons
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from toontown.ai import DistributedTrickOrTreatTargetAI
|
||||
from toontown.ai import DistributedWinterCarolingTargetAI
|
||||
|
||||
from toontown.ai import DistributedEffectMgrAI
|
||||
|
||||
class TTHoodAI(HoodAI.HoodAI):
|
||||
def __init__(self, air):
|
||||
|
@ -32,13 +30,11 @@ class TTHoodAI(HoodAI.HoodAI):
|
|||
(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)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air)
|
||||
self.TrickOrTreatTargetManager.generateWithRequired(2649)
|
||||
self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
|
||||
self.trickOrTreatMgr.generateWithRequired(2649) # All Fun and Games Shop, Silly Street
|
||||
|
||||
if simbase.air.wantChristmas:
|
||||
self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(self.air)
|
||||
self.WinterCarolingTargetManager.generateWithRequired(2649)
|
||||
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
|
||||
self.winterCarolingMgr.generateWithRequired(2659) # Joy Buzzers to the World, Silly Street
|
||||
|
||||
def shutdown(self):
|
||||
HoodAI.HoodAI.shutdown(self)
|
||||
|
@ -52,8 +48,9 @@ class TTHoodAI(HoodAI.HoodAI):
|
|||
def createButterflies(self):
|
||||
playground = ButterflyGlobals.TTC
|
||||
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.TTC)
|
||||
|
||||
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.TTC]):
|
||||
for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.TTC]):
|
||||
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId)
|
||||
butterfly.generateWithRequired(self.zoneId)
|
||||
butterfly.start()
|
||||
butterfly.start()
|
|
@ -83,7 +83,7 @@ VictoryPartiesMenu = [
|
|||
]
|
||||
|
||||
WinterMenu = [
|
||||
(OTPLocalizer.WinterMenuSections[0], [30200, 30201, 30202, 30203, 30204, 30205]),
|
||||
(OTPLocalizer.WinterMenuSections[0], range(30200, 30206)),
|
||||
(OTPLocalizer.WinterMenuSections[1], [30275, 30276, 30277])
|
||||
]
|
||||
|
||||
|
|
|
@ -1672,12 +1672,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
self.effect = TrickOrTreatTargetEffect(beanAmount)
|
||||
self.effect.play()
|
||||
|
||||
def trickOrTreatMilestoneMet(self):
|
||||
if self.effect:
|
||||
self.effect.stop()
|
||||
self.effect = TrickOrTreatMilestoneEffect()
|
||||
self.effect.play()
|
||||
|
||||
def winterCarolingTargetMet(self, beanAmount):
|
||||
if self.effect:
|
||||
self.effect.stop()
|
||||
|
|
|
@ -1590,7 +1590,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime)
|
||||
self.b_setScavengerHunt([])
|
||||
return
|
||||
elif (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_PROPS)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_COSTUMES)) and (not simbase.air.wantHalloween) and effect == ToontownGlobals.CEPumpkin:
|
||||
elif (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_PROPS)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN_COSTUMES)) and (not simbase.air.newsManager.isHolidayRunning(ToontownGlobals.TRICK_OR_TREAT)) and effect == ToontownGlobals.CEPumpkin:
|
||||
self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime)
|
||||
self.b_setScavengerHunt([])
|
||||
return
|
||||
|
|
|
@ -421,15 +421,6 @@ class DistributedToonUD(DistributedObjectUD):
|
|||
def announceBingo(self):
|
||||
pass
|
||||
|
||||
def trickOrTreatTargetMet(self, todo0):
|
||||
pass
|
||||
|
||||
def trickOrTreatMilestoneMet(self):
|
||||
pass
|
||||
|
||||
def winterCarolingTargetMet(self, todo0):
|
||||
pass
|
||||
|
||||
def setCogSummonsEarned(self, todo0):
|
||||
pass
|
||||
|
||||
|
|
|
@ -7985,6 +7985,9 @@ WinterDecorationsStart = "It's Winter Holiday time in Toontown!"
|
|||
WinterDecorationsEnd = 'Winter Holiday is over - Happy New Year!'
|
||||
WackyWinterDecorationsStart = 'Brrr! Silly Meter goes from silly to chilly!'
|
||||
WinterCarolingStart = 'Caroling has come to Toontown. Sing for your Snowman Head - see the Blog for details!'
|
||||
WinterCarolingEnd = 'Caroling is over. See you next year.'
|
||||
TrickOrTreatStart = 'Happy Halloween! Trick or treat throughout Toontown to get a nifty Halloween pumpkin head reward!'
|
||||
TrickOrTreatEnd = 'Halloween is over. See you next year.'
|
||||
ExpandedClosetsStart = 'Attention Toons: For a limited time, Members can purchase the new 50 item Closet from the Cattlelog for the low price of 50 Jellybeans!'
|
||||
KartingTicketsHolidayStart = 'Get double tickets from Practice races at Goofy Speedway today!'
|
||||
IdesOfMarchStart = 'Toons go GREEN!'
|
||||
|
|
Loading…
Reference in a new issue