diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index fd12a42f..c9a94df2 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -896,7 +896,7 @@ dclass DistributedToon : DistributedPlayer { setTrackAccess(uint16[] = [0,0,0,0,1,1,0]) required broadcast ownrecv db; setTrackProgress(int8 = -1, uint32 = 0) required ownrecv db; setTrackBonusLevel(int8[] = [-1,-1,-1,-1,-1,-1,-1]) required broadcast ownrecv db; - setInventory(blob = [0*7, 0*7, 0*7, 0*7, 1, 0*6, 1, 0*6, 0*7]) required ownrecv db; + setInventory(blob = [0*7, 0*7, 0*7, 0*7, 0, 0*6, 0, 0*6, 0*7]) required ownrecv db; setMaxNPCFriends(uint16 = 16) required ownrecv db; setNPCFriendsDict(FriendEntry[] = []) required ownrecv db; setDefaultShard(uint32 = 0) required ownrecv broadcast db; diff --git a/config/release/dev.prc b/config/release/dev.prc index 8cc1e031..c5dcd433 100644 --- a/config/release/dev.prc +++ b/config/release/dev.prc @@ -37,5 +37,5 @@ want-glove-npc #t # Developer options: show-population #t -force-skip-tutorial #t +force-skip-tutorial #f want-instant-parties #t \ No newline at end of file diff --git a/toontown/ai/QuestManagerAI.py b/toontown/ai/QuestManagerAI.py index d7d53dfb..71125c5f 100644 --- a/toontown/ai/QuestManagerAI.py +++ b/toontown/ai/QuestManagerAI.py @@ -11,7 +11,6 @@ QuestToNpcIdIndex = 2 QuestRewardIdIndex = 3 QuestProgressIndex = 4 - class QuestManagerAI: notify = directNotify.newCategory('QuestManagerAI') diff --git a/toontown/battle/Movie.py b/toontown/battle/Movie.py index 0d2c5884..98ae4a2a 100644 --- a/toontown/battle/Movie.py +++ b/toontown/battle/Movie.py @@ -53,6 +53,7 @@ class Movie(DirectObject.DirectObject): self.hasBeenReset = 0 self.reset() self.rewardHasBeenReset = 0 + self.tutRewardDialog = None self.resetReward() return @@ -299,47 +300,29 @@ class Movie(DirectObject.DirectObject): self.rewardHasBeenReset = 0 self.rewardPanel = RewardPanel.RewardPanel(name) self.rewardCallback = callback - self.questList = self.rewardPanel.getQuestIntervalList(base.localAvatar, [0, - 1, - 1, - 0], [base.localAvatar], base.localAvatar.quests[0], [], [base.localAvatar.getDoId()]) + self.questList = self.rewardPanel.getQuestIntervalList(base.localAvatar, [0, 1, 1, 0], [base.localAvatar], base.localAvatar.quests[0], [], [base.localAvatar.getDoId()]) camera.setPosHpr(0, 8, base.localAvatar.getHeight() * 0.66, 179, 15, 0) - self.playTutorialReward_1() + self.rewardPanel.initGagFrame(base.localAvatar, [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0], noSkip=True) + self.playTutorialReward_1(None, self.toonRewardDicts[0]['earnedExp']) - def playTutorialReward_1(self): - self.tutRewardDialog_1 = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward1, command=self.playTutorialReward_2, style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8) - self.tutRewardDialog_1.hide() - self._deleteTrack() - self.track = Sequence(name='tutorial-reward-1') - self.track.append(Func(self.rewardPanel.initGagFrame, base.localAvatar, [0, - 0, - 0, - 0, - 0, - 0, - 0], [0, - 0, - 0, - 0], noSkip=True)) - self.track += self.rewardPanel.getTrackIntervalList(base.localAvatar, THROW_TRACK, 0, 1, 0) - self.track.append(Func(self.tutRewardDialog_1.show)) - self.track.start() - return - - def playTutorialReward_2(self, value): - self.tutRewardDialog_1.cleanup() - self.tutRewardDialog_2 = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward2, command=self.playTutorialReward_3, style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8) - self.tutRewardDialog_2.hide() - self._deleteTrack() - self.track = Sequence(name='tutorial-reward-2') - self.track.append(Wait(1.0)) - self.track += self.rewardPanel.getTrackIntervalList(base.localAvatar, SQUIRT_TRACK, 0, 1, 0) - self.track.append(Func(self.tutRewardDialog_2.show)) - self.track.start() - return - - def playTutorialReward_3(self, value): - self.tutRewardDialog_2.cleanup() + def playTutorialReward_1(self, result, earnedXp, tutTrack=0): + if self.tutRewardDialog: + self.tutRewardDialog.cleanup() + elif tutTrack >= len(earnedXp): + self.playTutorialReward_2() + return + + xp = earnedXp[tutTrack] + + if xp > 0: + self.tutRewardDialog = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward1 % (xp, TTLocalizer.BattleGlobalTracks[tutTrack].capitalize()), command=self.playTutorialReward_1, extraArgs=[earnedXp, tutTrack + 1], style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8) + sequence = Sequence() + sequence += self.rewardPanel.getTrackIntervalList(base.localAvatar, tutTrack, 0, xp, 0) + sequence.start() + else: + self.playTutorialReward_1(None, earnedXp, tutTrack + 1) + + def playTutorialReward_2(self, value=None): from toontown.toon import Toon from toontown.toon import ToonDNA @@ -355,40 +338,28 @@ class Movie(DirectObject.DirectObject): self.tutorialTom = Toon.Toon() dna = ToonDNA.ToonDNA() - dnaList = ('dls', 'ms', 'm', 'm', 7, 0, 7, 7, 2, 6, 2, 6, 2, 16) - dna.newToonFromProperties(*dnaList) + dna.newToonFromProperties(*('dls', 'ms', 'm', 'm', 7, 0, 7, 7, 2, 6, 2, 6, 2, 16)) self.tutorialTom.setDNA(dna) self.tutorialTom.setName(TTLocalizer.NPCToonNames[20000]) self.tutorialTom.setPickable(0) self.tutorialTom.setPlayerType(NametagGlobals.CCNonPlayer) self.tutorialTom.uniqueName = uniqueName - if base.config.GetString('language', 'english') == 'japanese': - self.tomDialogue03 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward01.ogg') - self.tomDialogue04 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward02.ogg') - self.tomDialogue05 = base.loadSfx('phase_3.5/audio/dial/CC_tom_movie_tutorial_reward03.ogg') - self.musicVolume = base.config.GetFloat('tutorial-music-volume', 0.5) - else: - self.tomDialogue03 = None - self.tomDialogue04 = None - self.tomDialogue05 = None - self.musicVolume = 0.9 + self.musicVolume = 0.9 music = base.cr.playGame.place.loader.battleMusic if self.questList: - self.track1 = Sequence(Wait(1.0), Func(self.rewardPanel.initQuestFrame, base.localAvatar, copy.deepcopy(base.localAvatar.quests)), Wait(1.0), Sequence(*self.questList), Wait(1.0), Func(self.rewardPanel.hide), Func(camera.setPosHpr, render, 34, 19.88, 3.48, -90, -2.36, 0), Func(base.localAvatar.animFSM.request, 'neutral'), Func(base.localAvatar.setPosHpr, 40.31, 22.0, -0.47, 150.0, 360.0, 0.0), Wait(0.5), Func(self.tutorialTom.reparentTo, render), Func(self.tutorialTom.show), Func(self.tutorialTom.setPosHpr, 40.29, 17.9, -0.47, 11.31, 0.0, 0.07), Func(self.tutorialTom.animFSM.request, 'TeleportIn'), Wait(1.517), Func(self.tutorialTom.animFSM.request, 'neutral'), Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat1), Func(self.tutorialTom.addActive), Func(music.setVolume, self.musicVolume), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward3, 0, None, [self.tomDialogue03]), name='tutorial-reward-3a') - self.track2 = Sequence(Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat2), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward4, 1, None, [self.tomDialogue04]), Func(self.tutorialTom.setPlayRate, 1.5, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.5), Func(self.tutorialTom.loop, 'right-hand'), name='tutorial-reward-3b') - self.track3 = Parallel(Sequence(Func(self.tutorialTom.setPlayRate, -1.8, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.8), Func(self.tutorialTom.animFSM.request, 'neutral'), name='tutorial-reward-3ca'), Sequence(Wait(0.5), Func(self.tutorialTom.setChatAbsolute, TTLocalizer.MovieTutorialReward5, CFSpeech | CFTimeout, self.tomDialogue05), Wait(1.0), Func(self.tutorialTom.animFSM.request, 'TeleportOut'), Wait(self.tutorialTom.getDuration('teleport')), Wait(1.0), Func(self.playTutorialReward_4, 0), name='tutorial-reward-3cb'), name='tutorial-reward-3c') + self.track1 = Sequence(Wait(1.0), Func(self.rewardPanel.initQuestFrame, base.localAvatar, copy.deepcopy(base.localAvatar.quests)), Wait(1.0), Sequence(*self.questList), Wait(1.0), Func(self.rewardPanel.hide), Func(camera.setPosHpr, render, 34, 19.88, 3.48, -90, -2.36, 0), Func(base.localAvatar.animFSM.request, 'neutral'), Func(base.localAvatar.setPosHpr, 40.31, 22.0, -0.47, 150.0, 360.0, 0.0), Wait(0.5), Func(self.tutorialTom.reparentTo, render), Func(self.tutorialTom.show), Func(self.tutorialTom.setPosHpr, 40.29, 17.9, -0.47, 11.31, 0.0, 0.07), Func(self.tutorialTom.animFSM.request, 'TeleportIn'), Wait(1.517), Func(self.tutorialTom.animFSM.request, 'neutral'), Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat1), Func(self.tutorialTom.addActive), Func(music.setVolume, self.musicVolume), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward3, 0, None, [None]), name='tutorial-reward-3a') + self.track2 = Sequence(Func(self.acceptOnce, self.tutorialTom.uniqueName('doneChatPage'), doneChat2), Func(self.tutorialTom.setLocalPageChat, TTLocalizer.MovieTutorialReward4, 1, None, [None]), Func(self.tutorialTom.setPlayRate, 1.5, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.5), Func(self.tutorialTom.loop, 'right-hand'), name='tutorial-reward-3b') + self.track3 = Parallel(Sequence(Func(self.tutorialTom.setPlayRate, -1.8, 'right-hand-start'), Func(self.tutorialTom.play, 'right-hand-start'), Wait(self.tutorialTom.getDuration('right-hand-start') / 1.8), Func(self.tutorialTom.animFSM.request, 'neutral'), name='tutorial-reward-3ca'), Sequence(Wait(0.5), Func(self.tutorialTom.setChatAbsolute, TTLocalizer.MovieTutorialReward5, CFSpeech | CFTimeout), Wait(1.0), Func(self.tutorialTom.animFSM.request, 'TeleportOut'), Wait(self.tutorialTom.getDuration('teleport')), Wait(1.0), Func(self.playTutorialReward_3, 0), name='tutorial-reward-3cb'), name='tutorial-reward-3c') self.track1.start() else: - self.playTutorialReward_4(0) - return + self.playTutorialReward_3() - def playTutorialReward_4(self, value): + def playTutorialReward_3(self, value=None): base.localAvatar.setH(270) self.tutorialTom.removeActive() self.tutorialTom.delete() self.questList = None self.rewardCallback() - return def stop(self): if self.track: diff --git a/toontown/quest/QuestParser.py b/toontown/quest/QuestParser.py index e78864bb..7d53d83e 100644 --- a/toontown/quest/QuestParser.py +++ b/toontown/quest/QuestParser.py @@ -432,12 +432,12 @@ class NPCMoviePlayer(DirectObject.DirectObject): iList.append(self.parseFunction(line)) elif command == 'BLACK_CAT_LISTEN': iList.append(self.parseBlackCatListen(line)) - elif command == 'SHOW_THROW_SQUIRT_PREVIEW': + elif command == 'SHOW_PREVIEW': if uponTimeout: - self.notify.error('SHOW_THROW_SQUIRT_PREVIEW not allowed in an UPON_TIMEOUT') - nextEvent = 'doneThrowSquirtPreview' + self.notify.error('SHOW_PREVIEW not allowed in an UPON_TIMEOUT') + nextEvent = 'donePreview' iList.append(Func(self.acceptOnce, nextEvent, self.playNextChapter, [nextEvent])) - iList.append(self.parseThrowSquirtPreview(line)) + iList.append(self.parsePreview(line)) self.closePreviousChapter(iList) chapterList = [] self.currentEvent = nextEvent @@ -989,14 +989,14 @@ class NPCMoviePlayer(DirectObject.DirectObject): return Func(disableBlackCatListen) - def parseThrowSquirtPreview(self, line): - oldTrackAccess = [None] + def parsePreview(self, line): + oldTrackAccess = None def grabCurTrackAccess(oldTrackAccess = oldTrackAccess): - oldTrackAccess[0] = copy.deepcopy(base.localAvatar.getTrackAccess()) + oldTrackAccess = copy.deepcopy(base.localAvatar.getTrackAccess()) def restoreTrackAccess(oldTrackAccess = oldTrackAccess): - base.localAvatar.setTrackAccess(oldTrackAccess[0]) + base.localAvatar.setTrackAccess(oldTrackAccess) minGagLevel = ToontownBattleGlobals.MIN_LEVEL_INDEX + 1 maxGagLevel = ToontownBattleGlobals.MAX_LEVEL_INDEX + 1 @@ -1007,15 +1007,15 @@ class NPCMoviePlayer(DirectObject.DirectObject): if newGagLevel == curGagLevel: return curGagLevel = newGagLevel - base.localAvatar.setTrackAccess([0, - 0, - 0, - 0, - curGagLevel, - curGagLevel, - 0]) + access = [0, 0, 0, 0, 0, 0] + + for i in len(access): + if oldTrackAccess[i] == 1: + access[i] = newGagLevel + + base.localAvatar.setTrackAccess(access) - return Sequence(Func(grabCurTrackAccess), LerpFunctionInterval(updateGagLevel, fromData=1, toData=7, duration=0.3), WaitInterval(3.5), LerpFunctionInterval(updateGagLevel, fromData=7, toData=1, duration=0.3), Func(restoreTrackAccess), Func(messenger.send, 'doneThrowSquirtPreview')) + return Sequence(Func(grabCurTrackAccess), LerpFunctionInterval(updateGagLevel, fromData=1, toData=7, duration=0.3), WaitInterval(3.5), LerpFunctionInterval(updateGagLevel, fromData=7, toData=1, duration=0.3), Func(restoreTrackAccess), Func(messenger.send, 'donePreview')) searchPath = DSearchPath() if __debug__: diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 69c0aa22..fd9cbcdc 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -4849,8 +4849,7 @@ NPCForceAcknowledgeMessage7 = "Don't forget to make a friend!\n\n\n\n\n\n\nClick NPCForceAcknowledgeMessage8 = 'Great! You made a new friend!\n\n\n\n\n\n\n\n\nYou should go back at Toon Headquarters now.' NPCForceAcknowledgeMessage9 = 'Good job using the phone!\n\n\n\n\n\n\n\n\nReturn to Toon Headquarters to claim your reward.' ToonSleepString = '. . . ZZZ . . .' -MovieTutorialReward1 = 'You received 1 Throw point! When you get 10, you will get a new gag!' -MovieTutorialReward2 = 'You received 1 Squirt point! When you get 10, you will get a new gag!' +MovieTutorialReward1 = 'You received %s %s point! When you get 10, you will get a new gag!' MovieTutorialReward3 = 'Good job! You completed your first ToonTask!' MovieTutorialReward4 = 'Go to Toon Headquarters for your reward!' MovieTutorialReward5 = 'Have fun!' @@ -5547,7 +5546,7 @@ QuestScript110_2 = 'The book is full of good stuff.' QuestScript110_3 = "Open it, and I'll show you." QuestScript110_4 = "The map shows where you've been." QuestScript110_5 = 'Turn the page to see your gags...' -QuestScript110_6 = 'Uh oh! You have no gags! I will assign you a task.' +QuestScript110_6 = 'You can see your gags here.' QuestScript110_7 = 'Turn the page to see your tasks.' QuestScript110_8 = 'Take a ride on the trolley, and earn jelly beans to buy gags!' QuestScript110_9 = 'To get to the trolley, go out the door behind me and head for the playground.' @@ -5565,7 +5564,7 @@ QuestScriptGagShop_1 = 'Welcome to the Gag Shop!' QuestScriptGagShop_1a = 'This is where Toons come to buy gags to use against the Cogs.' QuestScriptGagShop_3 = 'To buy gags, click on the gag buttons. Try getting some now!' QuestScriptGagShop_4 = 'Good! You can use these gags in battle against the Cogs.' -QuestScriptGagShop_5 = "Here's a peek at the advanced throw and squirt gags..." +QuestScriptGagShop_5 = "Here's a peek at the advanced gags..." QuestScriptGagShop_6 = "When you're done buying gags, click this button to return to the Playground." QuestScriptGagShop_7 = 'Normally you can use this button to play another Trolley Game...' QuestScriptGagShop_8 = "...but there's no time for another game right now. You're needed in Toon HQ!" diff --git a/toontown/tutorial/DistributedBattleTutorialAI.py b/toontown/tutorial/DistributedBattleTutorialAI.py index e3143f4e..2f837856 100644 --- a/toontown/tutorial/DistributedBattleTutorialAI.py +++ b/toontown/tutorial/DistributedBattleTutorialAI.py @@ -14,3 +14,9 @@ class DistributedBattleTutorialAI(DistributedBattleAI): def startRewardTimer(self): pass # We don't want a reward timer in the tutorial. + + def exitReward(self): + av = simbase.air.doId2do.get(self.air.getAvatarIdFromSender()) + + if av: + av.b_setQuests([[101, 1, 1000, 100, 1]]) \ No newline at end of file diff --git a/toontown/tutorial/TutorialManagerAI.py b/toontown/tutorial/TutorialManagerAI.py index 290af9d5..29c6b1d5 100644 --- a/toontown/tutorial/TutorialManagerAI.py +++ b/toontown/tutorial/TutorialManagerAI.py @@ -165,12 +165,14 @@ class TutorialManagerAI(DistributedObjectAI): av.b_setRewardHistory(0, []) av.b_setHp(15) av.b_setMaxHp(15) - av.inventory.zeroInv(killUber=True) - av.inventory.addItem(ToontownBattleGlobals.THROW_TRACK, 0) - av.inventory.addItem(ToontownBattleGlobals.SQUIRT_TRACK, 0) + access = av.getTrackAccess() + + for i in len(access): + if access[i] == 1: + av.inventory.addItem(i, 1) + av.d_setInventory(av.inventory.makeNetString()) - av.experience.zeroOutExp() av.d_setExperience(av.experience.makeNetString())