April Toons Week (doodles talk, low gravity in Estate, speedchat menu) added!

This commit is contained in:
John 2015-04-09 14:05:29 +03:00
parent 7b2fea85bb
commit 7b3ded4f3f
15 changed files with 45 additions and 154 deletions

View file

@ -329,7 +329,6 @@ from toontown.coghq import DistributedSinkingPlatform/AI
from toontown.suit import DistributedGoon/AI
from toontown.suit import DistributedGridGoon/AI
from toontown.coghq import BattleBlocker/AI
from toontown.ai import DistributedAprilToonsMgr/AI
from toontown.ai import DistributedBlackCatMgr/AI
from toontown.ai import DistributedReportMgr/AI
from toontown.ai import DistributedPolarPlaceEffectMgr/AI
@ -1210,8 +1209,6 @@ dclass DistributedTargetGame : DistributedMinigame {
};
dclass EstateManager : DistributedObject {
startAprilFools() broadcast;
stopAprilFools() broadcast;
getEstateZone(uint32 avId) airecv clsend;
setEstateZone(uint32 ownerId, uint32 zoneId);
setAvHouseId(uint32, uint32[]) broadcast;
@ -2421,12 +2418,6 @@ dclass DistributedPetProxy : DistributedPet {
setDominantMood(string) broadcast ram;
};
dclass DistributedAprilToonsMgr : DistributedObject {
setEventActive(uint8 eventId, bool) broadcast;
requestEventsList() clsend airecv;
requestEventsListResp(uint8 []);
};
dclass DistributedBlackCatMgr : DistributedObject {
doBlackCatTransformation() broadcast;
requestBlackCatTransformation() airecv clsend;

View file

@ -1618,20 +1618,6 @@ SpeedChatStaticTextToontown = {100: 'Hi!',
21206: 'Speak!',
30100: "Happy April Toons' Week!",
30101: "Welcome to my April Toons' Week party!",
30102: 'The Silly Meter is back in Toon Hall!',
30110: 'Mickey is in Daisy Gardens.',
30111: 'Daisy is in Toontown Central.',
30112: 'Minnie is in The Brrrgh.',
30113: 'Pluto is in Melodyland.',
30114: 'Donald is sleepwalking at the Speedway.',
30115: 'Goofy is in Dreamland.',
30120: 'Mickey is acting like Daisy!',
30121: 'Daisy is acting like Mickey!',
30122: 'Minnie is acting like Pluto!',
30123: 'Pluto is acting like Minnie!',
30124: 'Pluto is talking!',
30125: 'Goofy is acting like Donald!',
30126: 'Donald is dreaming he is Goofy!',
30130: 'Watch how far I can jump.',
30131: 'Wow, you jumped really far!',
30132: 'Hey, Doodles can talk!',
@ -2312,8 +2298,6 @@ KartRacingMenuSections = [-1,
'TAUNTS']
AprilToonsMenuSections = [-1,
'GREETINGS',
'PLAYGROUNDS',
'CHARACTERS',
'ESTATES']
SillyHolidayMenuSections = [-1, 'WORLD', 'BATTLE']
CarolMenuSections = [-1]

View file

@ -1,43 +0,0 @@
from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase.AprilToonsGlobals import *
from toontown.toonbase import ToontownGlobals
class DistributedAprilToonsMgr(DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('AprilToonsMgr')
def __init__(self, cr):
DistributedObject.__init__(self, cr)
cr.aprilToonsMgr = self
self.events = []
def announceGenerate(self):
DistributedObject.announceGenerate(self)
self.d_requestEventsList()
def d_requestEventsList(self):
self.notify.debug("Requesting events list from AI.")
self.sendUpdate('requestEventsList', [])
def requestEventsListResp(self, eventIds):
self.events = eventIds
self.checkActiveEvents()
def isEventActive(self, eventId):
# NOTE: Possible race condition where the client checks for if an event is active
# *before* it gets a response from the AI.
if not base.cr.config.GetBool('want-april-toons', False):
# If this DO is generated but we don't want april toons, always return
# false regardless.
return False
return eventId in self.events
def setEventActive(self, eventId, active):
if active and eventId not in self.events:
self.events.append(eventId)
elif not active and eventId in self.events:
del self.events[eventId]
def checkActiveEvents(self):
if self.isEventActive(EventGlobalGravity):
base.localAvatar.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 0.75)

View file

@ -1,35 +0,0 @@
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from otp.ai.MagicWordGlobal import *
from direct.task import Task
from toontown.toonbase.AprilToonsGlobals import *
class DistributedAprilToonsMgrAI(DistributedObjectAI):
def __init__(self, air):
DistributedObjectAI.__init__(self, air)
# Define the default events we want for this year
self.events = [EventRandomDialogue,
EventRandomEffects,
EventEstateGravity,
EventGlobalGravity]
def getEvents(self):
return self.events
def isEventActive(self, eventId):
if not self.air.config.GetBool('want-april-toons', False):
# If this DO is generated but we don't want april toons, always return
# false regardless.
return False
return eventId in self.events
def requestEventsList(self):
avId = self.air.getAvatarIdFromSender()
self.sendUpdateToAvatarId(avId, 'requestEventsListResp', [self.getEvents()])
def toggleEvent(self, eventId):
if eventId in self.getEvents():
del self.getEvents()[eventId]
self.sendUpdate('setEventActive', [eventId, False])
else:
self.getEvents().append(eventId)
self.sendUpdate('setEventActive', [eventId, True])

View file

@ -34,6 +34,15 @@ Holidays = {
'startMessage': TTLocalizer.BlackCatHolidayStart,
'ongoingMessage': TTLocalizer.BlackCatHolidayStart,
'endMessage': TTLocalizer.BlackCatHolidayEnd
},
ToontownGlobals.APRIL_TOONS_WEEK: {
'startMonth': 4,
'startDay': 1,
'endMonth': 4,
'endDay': 7,
'startMessage': TTLocalizer.AprilToonsWeekStart,
'ongoingMessage': TTLocalizer.AprilToonsWeekStart,
'endMessage': TTLocalizer.AprilToonsWeekEnd
}
}

View file

@ -1,4 +1,5 @@
from direct.distributed.DistributedObject import DistributedObject
from toontown.estate import Estate
from toontown.toonbase import ToontownGlobals
import HolidayGlobals
@ -54,8 +55,18 @@ class NewsManager(DistributedObject):
if id == ToontownGlobals.LAUGHING_MAN:
for toon in base.cr.toons.values():
toon.generateLaughingMan()
elif id == ToontownGlobals.APRIL_TOONS_WEEK:
if isinstance(base.cr.playGame.getPlace(), Estate.Estate):
base.localAvatar.startAprilToonsControls()
base.localAvatar.chatMgr.chatInputSpeedChat.addAprilToonsMenu()
def endSpecialHoliday(self, id):
if id == ToontownGlobals.LAUGHING_MAN:
for toon in base.cr.toons.values():
toon.swapToonHead(laughingMan=toon.getWantLaughingMan())
elif id == ToontownGlobals.APRIL_TOONS_WEEK:
if isinstance(base.cr.playGame.getPlace(), Estate.Estate):
base.localAvatar.stopAprilToonsControls()
base.localAvatar.chatMgr.chatInputSpeedChat.removeAprilToonsMenu()

View file

@ -124,11 +124,7 @@ class Estate(Place.Place):
self.loader.enterAnimatedProps(i)
self.loader.geom.reparentTo(render)
# The client April Toons Manager is currently broken, so we have to do this hacky thing instead. :(
#if hasattr(base.cr, 'aprilToonsMgr'):
#if self.isEventActive(AprilToonsGlobals.EventEstateGravity):
#base.localAvatar.startAprilToonsControls()
if base.config.GetBool('want-april-toons'):
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK):
base.localAvatar.startAprilToonsControls()
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
@ -136,7 +132,7 @@ class Estate(Place.Place):
def exit(self):
base.localAvatar.stopChat()
if base.config.GetBool('want-april-toons'):
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK):
base.localAvatar.stopAprilToonsControls()
self._telemLimiter.destroy()
del self._telemLimiter
@ -362,11 +358,7 @@ class Estate(Place.Place):
if hasattr(self, 'walkStateData'):
self.walkStateData.fsm.request('walking')
self.toonSubmerged = 0
# The client April Toons Manager is currently broken, so we have to do this hacky thing instead. :(
#if hasattr(base.cr, 'aprilToonsMgr'):
#if self.isEventActive(AprilToonsGlobals.EventEstateGravity):
#base.localAvatar.startAprilToonsControls()
if base.config.GetBool('want-april-toons'):
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK):
base.localAvatar.startAprilToonsControls()
def __setUnderwaterFog(self):

View file

@ -69,11 +69,3 @@ class EstateManager(DistributedObject.DistributedObject):
def removeFriend(self, ownerId, avId):
self.notify.debug('removeFriend ownerId = %s, avId = %s' % (ownerId, avId))
self.sendUpdate('removeFriend', [ownerId, avId])
def startAprilFools(self):
if isinstance(base.cr.playGame.getPlace(), Estate.Estate):
base.cr.playGame.getPlace().startAprilFoolsControls()
def stopAprilFools(self):
if isinstance(base.cr.playGame.getPlace(), Estate.Estate):
base.cr.playGame.getPlace().stopAprilFoolsControls()

View file

@ -29,6 +29,7 @@ Component2IconDict = {'boredom': 'Bored',
from toontown.nametag import *
from toontown.nametag.NametagGlobals import *
from toontown.chat.ChatGlobals import *
class Pet(Avatar.Avatar):
notify = DirectNotifyGlobal.directNotify.newCategory('Pet')
@ -280,7 +281,7 @@ class Pet(Avatar.Avatar):
moodIcons = loader.loadModel('phase_4/models/char/petEmotes')
self.moodIcons = self.attachNewNode('moodIcons')
self.moodIcons.setScale(2.0)
self.moodIcons.setZ(3.65)
self.moodIcons.setZ(4.65)
moods = moodIcons.findAllMatches('**/+GeomNode')
for moodNum in range(0, moods.getNumPaths()):
mood = moods.getPath(moodNum)
@ -295,13 +296,8 @@ class Pet(Avatar.Avatar):
return
def showMood(self, mood):
if hasattr(base.cr, 'newsManager') and base.cr.newsManager:
holidayIds = base.cr.newsManager.getHolidayIdList()
if (ToontownGlobals.APRIL_FOOLS_COSTUMES in holidayIds or ToontownGlobals.SILLYMETER_EXT_HOLIDAY in holidayIds) and not mood == 'confusion':
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK) and mood != 'confusion':
self.speakMood(mood)
return
else:
self.clearChat()
else:
self.clearChat()
mood = Component2IconDict[mood]
@ -322,12 +318,7 @@ class Pet(Avatar.Avatar):
return
def speakMood(self, mood):
if self.moodModel:
self.moodModel.hide()
if base.config.GetBool('want-speech-bubble', 1):
self.nametag.setChat(random.choice(TTLocalizer.SpokenMoods[mood]), CFSpeech)
else:
self.nametag.setChat(random.choice(TTLocalizer.SpokenMoods[mood]), CFThought)
self.setChatAbsolute(random.choice(TTLocalizer.SpokenMoods[mood]), CFSpeech)
def getGenderString(self):
if self.style:

View file

@ -13,10 +13,8 @@ from otp.otpbase import OTPLocalizer
from SCSpecialMenu import SCSpecialMenu
AprilToonsMenu = [
(OTPLocalizer.AprilToonsMenuSections[1], [30100, 30102]),
(OTPLocalizer.AprilToonsMenuSections[2], [30110, 30111, 30112, 30113, 30114, 30115]),
(OTPLocalizer.AprilToonsMenuSections[3], [30120, 30121, 30122, 30123, 30124, 30125, 30126]),
(OTPLocalizer.AprilToonsMenuSections[4], [30130, 30131, 30132, 30133]),
(OTPLocalizer.AprilToonsMenuSections[1], [30100]),
(OTPLocalizer.AprilToonsMenuSections[2], [30130, 30131, 30132, 30133]),
(OTPLocalizer.AprilToonsMenuSections[0], [30140, 30141])
]

View file

@ -1763,3 +1763,9 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.petId = petId
if self.isLocal():
base.cr.addPetToFriendsMap()
def startAprilToonsControls(self):
self.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 0.75)
def stopAprilToonsControls(self):
self.controlManager.currentControls.setGravity(ToontownGlobals.GravityValue * 2.0)

View file

@ -1187,6 +1187,9 @@ class Toon(Avatar.Avatar, ToonHead):
return self.shoes
def getDialogueArray(self):
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.APRIL_TOONS_WEEK):
animalType = random.choice(TTLocalizer.AnimalToSpecies.keys())
else:
animalType = self.style.getType()
if animalType == 'dog':
dialogueArray = DogDialogueArray

View file

@ -1,10 +0,0 @@
# Events
EventRandomDialogue = 1 # Scrambles the dialogue SFX of toons
EventRandomEffects = 2 # Random cheesy effects (non-poof) are applied to the toon at random intervals
EventEstateGravity = 3 # Enables low gravity in estates
EventGlobalGravity = 4 # Enables low gravity everywhere
# Constants
RandomCheesyList = [1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 11, 11]
RandomCheesyMinTime = 3
RandomCheesyMaxTime = 60

View file

@ -7217,6 +7217,8 @@ FishBingoTypeBlockout = 'BLOCKOUT!'
SillySaturdayStart = "It's time for Silly Saturday! Saturdays are silly with Fish Bingo and Grand Prix throughout the day!"
SillySaturdayOngoing = 'Welcome! Silly Saturday is currently in progress.'
SillySaturdayEnd = 'Silly Saturday is over. Hope you had fun. See you next week!'
AprilToonsWeekStart = "It's April Toons Week!"
AprilToonsWeekEnd = 'April Toons Week is over. See you next year!'
FishBingoStart = "It's time for Fish Bingo! Go to any available pier to play!"
FishBingoOngoing = 'Welcome! Fish Bingo is currently in progress.'
FishBingoEnd = 'Hope you had fun playing Fish Bingo.'

View file

@ -847,7 +847,7 @@ MORE_XP_HOLIDAY = 25
HALLOWEEN_PROPS = 26
HALLOWEEN_COSTUMES = 27
DECEMBER_INVASION = 28
APRIL_FOOLS_COSTUMES = 29
APRIL_TOONS_WEEK = 29
OCTOBER31_FIREWORKS = 31
NOVEMBER19_FIREWORKS = 32
SELLBOT_SURPRISE_1 = 33