From 48f474c4233035007e65bf1f362a0a6fd23290bc Mon Sep 17 00:00:00 2001 From: Loudrob Date: Tue, 5 May 2015 16:25:45 -0400 Subject: [PATCH] Magic word to remove redeemed code. --- toontown/toon/DistributedToonAI.py | 14 ++++++++++++++ toontown/toonbase/TTLocalizerEnglish.py | 1 + 2 files changed, 15 insertions(+) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 4db2f393..f5f1f3ee 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -4234,6 +4234,11 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.redeemedCodes.append(code) self.b_setRedeemedCodes(self.redeemedCodes) + def removeCode(self, code): + if self.isCodeRedeemed(code): + self.redeemedCodes.remove(code) + self.b_setRedeemedCodes(self.redeemedCodes) + @magicWord(category=CATEGORY_PROGRAMMER, types=[str, int, int]) def cheesyEffect(value, hood=0, expire=0): @@ -5121,3 +5126,12 @@ def emblems(silver=10, gold=10): @magicWord(category=CATEGORY_PROGRAMMER) def catalog(): simbase.air.catalogManager.deliverCatalogFor(spellbook.getTarget()) + +@magicWord(category=CATEGORY_PROGRAMMER, types=[str]) +def remCode(code): + av = spellbook.getTarget() + if av.isCodeRedeemed(code): + av.removeCode(code) + return 'Player can now reuse the code %s' % code + else: + return "Player hasn't redeemed this code!" diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 65960bfd..39cec280 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3869,6 +3869,7 @@ CdrResultInvalidCode = "You've entered an invalid code. Please check the code an CdrResultExpiredCode = "We're sorry. This code has expired." CdrResultMailboxFull = 'Your mailbox is full. Please remove an item, then enter your code again.' CdrResultAlreadyRedeemed = "You've already redeemed this item!" +CdrResultNotReady = "This code can't be used yet!" TrackPageTitle = 'Gag Track Training' TrackPageShortTitle = 'Gag Training' TrackPageSubtitle = 'Complete ToonTasks to learn how to use new gags!'