Scavenger hunts!! :D

This commit is contained in:
John 2015-06-23 23:20:41 +03:00
parent 44920579d1
commit 2c8ac1add9
30 changed files with 136 additions and 335 deletions

View file

@ -334,8 +334,6 @@ from toontown.ai import DistributedReportMgr/AI
from toontown.ai import DistributedPolarPlaceEffectMgr/AI from toontown.ai import DistributedPolarPlaceEffectMgr/AI
from toontown.ai import DistributedEffectMgr/AI from toontown.ai import DistributedEffectMgr/AI
from toontown.ai import DistributedResistanceEmoteMgr/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 DistributedMint/AI
from toontown.coghq import DistributedMintRoom/AI from toontown.coghq import DistributedMintRoom/AI
from toontown.coghq import DistributedMintBattle/AI from toontown.coghq import DistributedMintBattle/AI
@ -639,7 +637,7 @@ dclass DistributedToon : DistributedPlayer {
setSpeedChatStyleIndex(uint8 = 1) required ownsend broadcast db; setSpeedChatStyleIndex(uint8 = 1) required ownsend broadcast db;
setTrophyScore(uint16) broadcast ownrecv ram; setTrophyScore(uint16) broadcast ownrecv ram;
setTeleportAccess(uint32[] = []) required ownrecv db; setTeleportAccess(uint32[] = []) required ownrecv db;
setScavengerHunt(uint32[] = []) required ownrecv db; setScavengerHunt(uint16[] = []) required ownrecv db;
checkTeleportAccess(uint16) airecv ownsend; checkTeleportAccess(uint16) airecv ownsend;
setTeleportOverride(uint8) clsend airecv; setTeleportOverride(uint8) clsend airecv;
battleSOS(uint32) ownrecv clsend; battleSOS(uint32) ownrecv clsend;
@ -716,9 +714,6 @@ dclass DistributedToon : DistributedPlayer {
setCurrentKart(uint32) broadcast ownrecv ram; setCurrentKart(uint32) broadcast ownrecv ram;
squish(uint8) ownsend airecv; squish(uint8) ownsend airecv;
announceBingo() broadcast ownrecv; announceBingo() broadcast ownrecv;
trickOrTreatTargetMet(uint32) ownrecv;
trickOrTreatMilestoneMet() ownrecv;
winterCarolingTargetMet(uint32) ownrecv;
setCogSummonsEarned(uint8[] = [0*32]) required ownrecv db; setCogSummonsEarned(uint8[] = [0*32]) required ownrecv db;
reqCogSummons(char [0-256], uint32) ownsend airecv; reqCogSummons(char [0-256], uint32) ownsend airecv;
cogSummonsResponse(string, uint32, uint32) ownrecv; cogSummonsResponse(string, uint32, uint32) ownrecv;
@ -2433,23 +2428,13 @@ dclass DistributedPolarPlaceEffectMgr : DistributedObject {
dclass DistributedEffectMgr : DistributedObject { dclass DistributedEffectMgr : DistributedObject {
setHoliday(uint8) required broadcast; setHoliday(uint8) required broadcast;
requestEffect() airecv clsend; requestEffect() airecv clsend;
effectDone(); effectDone(uint8);
}; };
dclass DistributedResistanceEmoteMgr : DistributedObject { dclass DistributedResistanceEmoteMgr : DistributedObject {
addResistanceEmote() clsend airecv; addResistanceEmote() clsend airecv;
}; };
dclass DistributedTrickOrTreatTarget : DistributedObject {
doScavengerHunt(int8);
requestScavengerHunt() airecv clsend;
};
dclass DistributedWinterCarolingTarget : DistributedObject {
doScavengerHunt(int8) broadcast;
requestScavengerHunt() airecv clsend;
};
dclass DistributedVehicle : DistributedSmoothNode { dclass DistributedVehicle : DistributedSmoothNode {
setOwner(uint32) required broadcast ram; setOwner(uint32) required broadcast ram;
setState(char, uint32) broadcast ram; setState(char, uint32) broadcast ram;

View file

@ -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

View file

@ -1,2 +0,0 @@
want-christmas #t
active-holidays 4, 57

View file

@ -1,2 +0,0 @@
want-halloween #t
active-holidays 26, 27, 13

View file

@ -1,2 +0,0 @@
# Distribution:
distribution en

View file

@ -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

View file

@ -3,8 +3,10 @@ from otp.otpbase.OTPLocalizer import SpeedChatStaticText
SCStaticTextMsgEvent = 'SCStaticTextMsg' SCStaticTextMsgEvent = 'SCStaticTextMsg'
def decodeSCStaticTextMsg(textId): def decodeSCStaticTextMsg(textId):
return SpeedChatStaticText.get(textId, None) if 30200 <= textId <= 30205:
textId += 20
return SpeedChatStaticText.get(textId, None)
class SCStaticTextTerminal(SCTerminal): class SCStaticTextTerminal(SCTerminal):

View file

@ -35,5 +35,15 @@ class DistributedEffectMgr(DistributedObject):
self.sendUpdate('requestEffect') self.sendUpdate('requestEffect')
def effectDone(self): def effectDone(self, amount):
holidayInfo = HolidayGlobals.getHoliday(self.holiday)
self.cr.newsManager.broadcastHoliday(holidayInfo, 'effectMessage') 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)

View file

@ -21,11 +21,23 @@ class DistributedEffectMgrAI(DistributedObjectAI):
if not av: if not av:
return return
holiday = HolidayGlobals.getHoliday(self.holiday) holidayInfo = HolidayGlobals.getHoliday(self.holiday)
expireTime = int(HolidayGlobals.getUnixTime(HolidayGlobals.getEndDate(holiday)) / 60) expireTime = int(HolidayGlobals.getUnixTime(HolidayGlobals.getEndDate(holidayInfo)) / 60)
self.sendUpdateToAvatarId(avId, 'effectDone') if 'scavengerHunt' in holidayInfo:
self.doEffect(expireTime) scavengerHunt = av.getScavengerHunt()
def doEffect(self, expireTime): 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) 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])

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -1,6 +1,11 @@
from toontown.toonbase import ToontownGlobals, TTLocalizer from toontown.toonbase import ToontownGlobals, TTLocalizer
import calendar, datetime import calendar, datetime
TRICK_OR_TREAT = 0
WINTER_CAROLING = 1
CAROLING_REWARD = 100
SCAVENGER_HUNT_LOCATIONS = 6
Holidays = { Holidays = {
ToontownGlobals.LAUGHING_MAN: { ToontownGlobals.LAUGHING_MAN: {
'startMonth': 6, 'startMonth': 6,
@ -56,6 +61,30 @@ Holidays = {
'speedchatIndexes': [30450], # It's easy to be green! 'speedchatIndexes': [30450], # It's easy to be green!
'effectMessage': TTLocalizer.GreenToonEffectMsg, 'effectMessage': TTLocalizer.GreenToonEffectMsg,
'effectDelay': 10 '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
} }
} }

View file

@ -62,6 +62,10 @@ class NewsManager(DistributedObject):
base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu() base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu()
elif id == ToontownGlobals.IDES_OF_MARCH: elif id == ToontownGlobals.IDES_OF_MARCH:
base.localAvatar.chatMgr.chatInputSpeedChat.addIdesOfMarchMenu() 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): def endSpecialHoliday(self, id):
if id == ToontownGlobals.LAUGHING_MAN: if id == ToontownGlobals.LAUGHING_MAN:
@ -74,3 +78,7 @@ class NewsManager(DistributedObject):
base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu() base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu()
elif id == ToontownGlobals.IDES_OF_MARCH: 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()

View file

@ -88,8 +88,6 @@ class ToontownAIRepository(ToontownInternalRepository):
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True) self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False) self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0) 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 self.cogSuitMessageSent = False

View file

@ -2,10 +2,6 @@ from otp.speedchat.SCTerminal import SCTerminal
from otp.otpbase.OTPLocalizer import SpeedChatStaticText from otp.otpbase.OTPLocalizer import SpeedChatStaticText
SCStaticTextMsgEvent = 'SCStaticTextMsg' SCStaticTextMsgEvent = 'SCStaticTextMsg'
def decodeSCStaticTextMsg(textId):
return SpeedChatStaticText.get(textId, None)
class TTSCWhiteListTerminal(SCTerminal): class TTSCWhiteListTerminal(SCTerminal):
def __init__(self, textId, parentMenu = None): def __init__(self, textId, parentMenu = None):

View file

@ -1,9 +1,7 @@
from pandac.PandaModules import *
from direct.interval.IntervalGlobal 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.DirectFrame import DirectFrame
from direct.gui.DirectLabel import DirectLabel from direct.gui.DirectLabel import DirectLabel
from toontown.toonbase import ToontownGlobals, TTLocalizer
class ScavengerHuntEffect: class ScavengerHuntEffect:
images = None images = None
@ -11,7 +9,9 @@ class ScavengerHuntEffect:
def __init__(self, beanAmount): def __init__(self, beanAmount):
if not ScavengerHuntEffect.images: if not ScavengerHuntEffect.images:
ScavengerHuntEffect.images = loader.loadModel('phase_4/models/props/tot_jar') 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)) self.npRoot = DirectFrame(parent=aspect2d, relief=None, scale=0.75, pos=(0, 0, 0.6))
if beanAmount > 0: if beanAmount > 0:
self.npRoot.setColorScale(VBase4(1, 1, 1, 0)) self.npRoot.setColorScale(VBase4(1, 1, 1, 0))
self.jar = DirectFrame(parent=self.npRoot, relief=None, image=ScavengerHuntEffect.images.find('**/tot_jar')) 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.npRoot.setColorScale(VBase4(1, 1, 1, 0))
self.attemptFailedMsg() 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)) 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): def play(self):
if self.npRoot: if self.npRoot:
self.track.start() self.track.start()
def stop(self): def stop(self):
if self.track != None: if self.track != None and self.track.isPlaying():
if self.track.isPlaying():
self.track.finish() 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)
def destroy(self): def destroy(self):
self.stop() self.stop()
self.track = None self.track = None
if hasattr(self, 'eventImage') and self.eventImage: if hasattr(self, 'eventImage') and self.eventImage:
self.eventImage.detachNode() self.eventImage.detachNode()
del self.eventImage del self.eventImage
@ -67,53 +57,38 @@ class ScavengerHuntEffect:
if hasattr(self, 'npRoot') and self.npRoot: if hasattr(self, 'npRoot') and self.npRoot:
self.npRoot.destroy() self.npRoot.destroy()
del self.npRoot del self.npRoot
return
class TrickOrTreatTargetEffect(ScavengerHuntEffect): class TrickOrTreatTargetEffect(ScavengerHuntEffect):
def __init__(self, beanAmount): def __init__(self, beanAmount):
ScavengerHuntEffect.__init__(self, beanAmount) ScavengerHuntEffect.__init__(self, beanAmount)
if beanAmount > 0: if beanAmount > 0:
self.pumpkin = DirectFrame(parent=self.eventImage, relief=None, image=ScavengerHuntEffect.images.find('**/tot_pumpkin_tall')) self.pumpkin = DirectFrame(parent=self.eventImage, relief=None, image=ScavengerHuntEffect.images.find('**/tot_pumpkin_tall'))
return
def attemptFailedMsg(self): 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()) 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): def destroy(self):
if hasattr(self, 'pumpkin') and self.pumpkin: if hasattr(self, 'pumpkin') and self.pumpkin:
self.pumpkin.destroy() self.pumpkin.destroy()
ScavengerHuntEffect.destroy(self)
ScavengerHuntEffect.destroy(self)
class WinterCarolingEffect(ScavengerHuntEffect): class WinterCarolingEffect(ScavengerHuntEffect):
def __init__(self, beanAmount): def __init__(self, beanAmount):
ScavengerHuntEffect.__init__(self, beanAmount) ScavengerHuntEffect.__init__(self, beanAmount)
if beanAmount > 0: if beanAmount > 0:
sm = loader.loadModel('phase_5.5/models/estate/tt_m_prp_ext_snowman_icon') 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) self.snowman = DirectFrame(parent=self.eventImage, relief=None, image=sm, scale=20.0)
return
def attemptFailedMsg(self): 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()) 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): def destroy(self):
if hasattr(self, 'snowman') and self.snowman: if hasattr(self, 'snowman') and self.snowman:
self.snowman.destroy() self.snowman.destroy()
ScavengerHuntEffect.destroy(self) ScavengerHuntEffect.destroy(self)
class TrickOrTreatMilestoneEffect:
def __init__(self):
pass
def play(self):
pass
def stop(self):
pass

View file

@ -2,7 +2,7 @@ from toontown.hood import HoodAI
from toontown.safezone import DistributedTrolleyAI from toontown.safezone import DistributedTrolleyAI
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedPolarPlaceEffectMgrAI from toontown.ai import DistributedPolarPlaceEffectMgrAI
from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
class BRHoodAI(HoodAI.HoodAI): class BRHoodAI(HoodAI.HoodAI):
def __init__(self, air): def __init__(self, air):
@ -23,9 +23,11 @@ class BRHoodAI(HoodAI.HoodAI):
self.PolarPlaceEffectManager = DistributedPolarPlaceEffectMgrAI.DistributedPolarPlaceEffectMgrAI(self.air) self.PolarPlaceEffectManager = DistributedPolarPlaceEffectMgrAI.DistributedPolarPlaceEffectMgrAI(self.air)
self.PolarPlaceEffectManager.generateWithRequired(3821) self.PolarPlaceEffectManager.generateWithRequired(3821)
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(3707) # Snowplace Like Home, Sleet Street
self.TrickOrTreatTargetManager.generateWithRequired(3707)
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
self.winterCarolingMgr.generateWithRequired(3828) # Snowman's Land, Polar Place
def createTrolley(self): def createTrolley(self):
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air) self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)

View file

@ -2,8 +2,7 @@ from toontown.hood import HoodAI
from toontown.safezone import DistributedBoatAI from toontown.safezone import DistributedBoatAI
from toontown.safezone import DistributedTrolleyAI from toontown.safezone import DistributedTrolleyAI
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
class DDHoodAI(HoodAI.HoodAI): class DDHoodAI(HoodAI.HoodAI):
def __init__(self, air): def __init__(self, air):
@ -23,9 +22,11 @@ class DDHoodAI(HoodAI.HoodAI):
self.createTrolley() self.createTrolley()
self.createBoat() self.createBoat()
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(1834) # Rudderly Ridiculous, Lighthouse Lane
self.TrickOrTreatTargetManager.generateWithRequired(1834)
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
self.winterCarolingMgr.generateWithRequired(1707) # Gifts with a Porpoise, Seaweed Street
def createTrolley(self): def createTrolley(self):
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air) self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)

View file

@ -4,7 +4,7 @@ from toontown.safezone import DistributedButterflyAI
from toontown.safezone import DistributedDGFlowerAI from toontown.safezone import DistributedDGFlowerAI
from toontown.safezone import DistributedTrolleyAI from toontown.safezone import DistributedTrolleyAI
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedEffectMgrAI, DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
class DGHoodAI(HoodAI.HoodAI): 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 = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.IDES_OF_MARCH, 15)
self.greenToonMgr.generateWithRequired(5819) self.greenToonMgr.generateWithRequired(5819)
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(5620) # Rake It Inn, Elm Street
self.TrickOrTreatTargetManager.generateWithRequired(5620)
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
self.winterCarolingMgr.generateWithRequired(5626) # Pine Needle Crafts, Elm Street
def shutdown(self): def shutdown(self):
HoodAI.HoodAI.shutdown(self) HoodAI.HoodAI.shutdown(self)
@ -52,6 +54,7 @@ class DGHoodAI(HoodAI.HoodAI):
def createButterflies(self): def createButterflies(self):
playground = ButterflyGlobals.DG playground = ButterflyGlobals.DG
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.DG) ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.DG)
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.DG]): for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.DG]):
for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.DG]): for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.DG]):
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId) butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId)

View file

@ -2,8 +2,7 @@ from toontown.hood import HoodAI
from toontown.safezone import DistributedTrolleyAI, DistributedPillowAI from toontown.safezone import DistributedTrolleyAI, DistributedPillowAI
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedResistanceEmoteMgrAI from toontown.ai import DistributedResistanceEmoteMgrAI
from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
class DLHoodAI(HoodAI.HoodAI): class DLHoodAI(HoodAI.HoodAI):
def __init__(self, air): def __init__(self, air):
@ -20,12 +19,15 @@ class DLHoodAI(HoodAI.HoodAI):
if simbase.config.GetBool('want-minigames', True): if simbase.config.GetBool('want-minigames', True):
self.createTrolley() self.createTrolley()
self.resistanceEmoteManager = DistributedResistanceEmoteMgrAI.DistributedResistanceEmoteMgrAI(self.air) self.resistanceEmoteManager = DistributedResistanceEmoteMgrAI.DistributedResistanceEmoteMgrAI(self.air)
self.resistanceEmoteManager.generateWithRequired(9720) self.resistanceEmoteManager.generateWithRequired(9720)
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(9619) # Relax to the Max, Lullaby Lane
self.TrickOrTreatTargetManager.generateWithRequired(9619)
self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
self.winterCarolingMgr.generateWithRequired(9722) # Dream On Talent Agency, Pajama Place
self.createPillow() self.createPillow()

View file

@ -2,7 +2,7 @@ from toontown.hood import HoodAI
from toontown.safezone import DistributedTrolleyAI from toontown.safezone import DistributedTrolleyAI
from toontown.safezone import DistributedMMPianoAI from toontown.safezone import DistributedMMPianoAI
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
class MMHoodAI(HoodAI.HoodAI): class MMHoodAI(HoodAI.HoodAI):
def __init__(self, air): def __init__(self, air):
@ -24,9 +24,11 @@ class MMHoodAI(HoodAI.HoodAI):
self.piano = DistributedMMPianoAI.DistributedMMPianoAI(self.air) self.piano = DistributedMMPianoAI.DistributedMMPianoAI(self.air)
self.piano.generateWithRequired(self.zoneId) self.piano.generateWithRequired(self.zoneId)
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(4835) # Ursatz for Really Kool Katz, Tenor Terrace
self.TrickOrTreatTargetManager.generateWithRequired(4835)
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): def createTrolley(self):
self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air) self.trolley = DistributedTrolleyAI.DistributedTrolleyAI(self.air)

View file

@ -5,9 +5,7 @@ from toontown.safezone import DistributedTrolleyAI
from toontown.toon import NPCToons from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.ai import DistributedTrickOrTreatTargetAI from toontown.ai import DistributedEffectMgrAI
from toontown.ai import DistributedWinterCarolingTargetAI
class TTHoodAI(HoodAI.HoodAI): class TTHoodAI(HoodAI.HoodAI):
def __init__(self, air): 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, 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) ToontownGlobals.ToontownCentral, posIndex=0)
if simbase.air.wantHalloween: self.trickOrTreatMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.TRICK_OR_TREAT, 12)
self.TrickOrTreatTargetManager = DistributedTrickOrTreatTargetAI.DistributedTrickOrTreatTargetAI(self.air) self.trickOrTreatMgr.generateWithRequired(2649) # All Fun and Games Shop, Silly Street
self.TrickOrTreatTargetManager.generateWithRequired(2649)
if simbase.air.wantChristmas: self.winterCarolingMgr = DistributedEffectMgrAI.DistributedEffectMgrAI(self.air, ToontownGlobals.WINTER_CAROLING, 14)
self.WinterCarolingTargetManager = DistributedWinterCarolingTargetAI.DistributedWinterCarolingTargetAI(self.air) self.winterCarolingMgr.generateWithRequired(2659) # Joy Buzzers to the World, Silly Street
self.WinterCarolingTargetManager.generateWithRequired(2649)
def shutdown(self): def shutdown(self):
HoodAI.HoodAI.shutdown(self) HoodAI.HoodAI.shutdown(self)
@ -52,6 +48,7 @@ class TTHoodAI(HoodAI.HoodAI):
def createButterflies(self): def createButterflies(self):
playground = ButterflyGlobals.TTC playground = ButterflyGlobals.TTC
ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.TTC) ButterflyGlobals.generateIndexes(self.zoneId, ButterflyGlobals.TTC)
for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.TTC]): for i in xrange(0, ButterflyGlobals.NUM_BUTTERFLY_AREAS[ButterflyGlobals.TTC]):
for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.TTC]): for _ in xrange(0, ButterflyGlobals.NUM_BUTTERFLIES[ButterflyGlobals.TTC]):
butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId) butterfly = DistributedButterflyAI.DistributedButterflyAI(self.air, playground, i, self.zoneId)

View file

@ -83,7 +83,7 @@ VictoryPartiesMenu = [
] ]
WinterMenu = [ WinterMenu = [
(OTPLocalizer.WinterMenuSections[0], [30200, 30201, 30202, 30203, 30204, 30205]), (OTPLocalizer.WinterMenuSections[0], range(30200, 30206)),
(OTPLocalizer.WinterMenuSections[1], [30275, 30276, 30277]) (OTPLocalizer.WinterMenuSections[1], [30275, 30276, 30277])
] ]

View file

@ -1672,12 +1672,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.effect = TrickOrTreatTargetEffect(beanAmount) self.effect = TrickOrTreatTargetEffect(beanAmount)
self.effect.play() self.effect.play()
def trickOrTreatMilestoneMet(self):
if self.effect:
self.effect.stop()
self.effect = TrickOrTreatMilestoneEffect()
self.effect.play()
def winterCarolingTargetMet(self, beanAmount): def winterCarolingTargetMet(self, beanAmount):
if self.effect: if self.effect:
self.effect.stop() self.effect.stop()

View file

@ -1590,7 +1590,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime) self.b_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime)
self.b_setScavengerHunt([]) self.b_setScavengerHunt([])
return 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_setCheesyEffect(ToontownGlobals.CENormal, hoodId, expireTime)
self.b_setScavengerHunt([]) self.b_setScavengerHunt([])
return return

View file

@ -421,15 +421,6 @@ class DistributedToonUD(DistributedObjectUD):
def announceBingo(self): def announceBingo(self):
pass pass
def trickOrTreatTargetMet(self, todo0):
pass
def trickOrTreatMilestoneMet(self):
pass
def winterCarolingTargetMet(self, todo0):
pass
def setCogSummonsEarned(self, todo0): def setCogSummonsEarned(self, todo0):
pass pass

View file

@ -7985,6 +7985,9 @@ WinterDecorationsStart = "It's Winter Holiday time in Toontown!"
WinterDecorationsEnd = 'Winter Holiday is over - Happy New Year!' WinterDecorationsEnd = 'Winter Holiday is over - Happy New Year!'
WackyWinterDecorationsStart = 'Brrr! Silly Meter goes from silly to chilly!' 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!' 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!' 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!' KartingTicketsHolidayStart = 'Get double tickets from Practice races at Goofy Speedway today!'
IdesOfMarchStart = 'Toons go GREEN!' IdesOfMarchStart = 'Toons go GREEN!'