Magic word to remove redeemed code.

This commit is contained in:
Loudrob 2015-05-05 16:25:45 -04:00
parent c623f806cc
commit 48f474c423
2 changed files with 15 additions and 0 deletions

View file

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

View file

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