From f9d570701832d8e6f610e755bb05d7325b24be6e Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sun, 10 May 2015 14:56:49 +0300 Subject: [PATCH] Donald NPC in Donalds Dock --- toontown/safezone/DDSafeZoneLoader.py | 47 +++++++++++++++++++------ toontown/toon/NPCToons.py | 20 +++++++++++ toontown/toonbase/TTLocalizerEnglish.py | 16 +++++++++ 3 files changed, 73 insertions(+), 10 deletions(-) diff --git a/toontown/safezone/DDSafeZoneLoader.py b/toontown/safezone/DDSafeZoneLoader.py index 1532cfe8..9b584282 100644 --- a/toontown/safezone/DDSafeZoneLoader.py +++ b/toontown/safezone/DDSafeZoneLoader.py @@ -1,5 +1,10 @@ +from direct.interval.IntervalGlobal import Sequence, Func, Wait from toontown.safezone import SafeZoneLoader from toontown.safezone import DDPlayground +from toontown.chat.ChatGlobals import CFSpeech +from toontown.toon import NPCToons +from toontown.toonbase import TTLocalizer +import random class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): @@ -18,22 +23,44 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): self.swimSound = base.loadSfx('phase_4/audio/sfx/AV_swim_single_stroke.ogg') self.submergeSound = base.loadSfx('phase_5.5/audio/sfx/AV_jump_in_water.ogg') self.boat = self.geom.find('**/donalds_boat') - if self.boat.isEmpty(): - self.notify.error('Boat not found') - else: - wheel = self.boat.find('**/wheel') - if wheel.isEmpty(): - self.notify.warning('Wheel not found') - else: - wheel.hide() - self.boat.stash() self.dockSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_dockcreak.ogg') self.foghornSound = base.loadSfx('phase_5/audio/sfx/SZ_DD_foghorn.ogg') self.bellSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_shipbell.ogg') self.waterSound = base.loadSfx('phase_6/audio/sfx/SZ_DD_waterlap.ogg') + + if not self.boat.isEmpty(): + wheel = self.boat.find('**/wheel') + + if not wheel.isEmpty(): + wheel.hide() + + self.boat.stash() + self.donald = NPCToons.createLocalNPC(7011) + + self.donald.setPos(0, -1, 3.95) + self.donald.reparentTo(self.boat) + self.donald.setHat(48, 0, 0) + + self.donaldSpeech = Sequence() + random.shuffle(TTLocalizer.DonaldChatter) + + for speechText in TTLocalizer.DonaldChatter: + self.donaldSpeech.append(Func(self.donald.setChatAbsolute, speechText, CFSpeech)) + self.donaldSpeech.append(Wait(len(speechText.split(' ')))) + self.donaldSpeech.append(Func(self.donald.clearChat)) + self.donaldSpeech.append(Wait(15)) + + self.donaldSpeech.loop(0) def unload(self): SafeZoneLoader.SafeZoneLoader.unload(self) + + if hasattr(self, 'donald'): + self.donaldSpeech.pause() + self.donald.delete() + del self.donaldSpeech + del self.donald + del self.seagullSound del self.underwaterSound del self.swimSound @@ -42,4 +69,4 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader): del self.bellSound del self.waterSound del self.submergeSound - del self.boat + del self.boat \ No newline at end of file diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index a6ab3356..9a201d7c 100644 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -11576,6 +11576,26 @@ NPCToonDict = {20000: (-1, 'm', 0, NPC_REGULAR), + 7011: (-1, + lnames[7011], + ('fll', + 'ls', + 'm', + 'm', + 0, + 0, + 9, + 0, + 10, + 10, + 0, + 10, + 5, + 27, + 0), + 'm', + 0, + NPC_REGULAR), # Magic Cat SOS # 5 Stars, Sound SOS, Bikehorn 255 damage. "The Bikehorn of Death". 91917: (-1, diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index a466cd50..a82f234b 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -6720,6 +6720,7 @@ NPCToonNames = {20000: 'Tutorial Tom', 7008: 'Ima Cagedtoon', 7009: 'Jimmy Thelock', 7010: 'Little Blinky', + 7011: 'Donald', 91917: 'Magic Cat'} zone2TitleDict = {2513: ('Toon Hall', ''), 2514: ('Toontown Bank', ''), @@ -8928,3 +8929,18 @@ def getPetNameId(name): return 0 PropIdToName = [InventoryHealString, MovieNPCSOSTrap, MovieNPCSOSLure, MovieNPCSOSSound, MovieNPCSOSThrow, MovieNPCSOSSquirt, MovieNPCSOSDrop] +DonaldChatter = ["I'm glad you're here today!", + "You look like you're having fun.", + "Oh boy, I'm having a good day.", + 'I hope you are enjoying your ride!', + 'I like meeting new people.', + 'Have fun in my neighborhood.', + 'I like to make people laugh.', + 'Watch out for the Cogs!', + 'Come aboard!', + "I heard it's snowing at the Brrrgh.", + 'Looks like the trolley is coming!', + 'Sometimes I play trolley games just to eat the fruit pie!', + 'I hope you are enjoying your stay in Toontown!', + 'I like what you are wearing.', + 'I love to play tag. Do you?'] \ No newline at end of file