From 468c192c146b38a608432ab75aa6a3231dbb1df3 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 11 Jun 2015 18:35:29 +0300 Subject: [PATCH] Add tickets unite and make cog icons a bit smaller in the merits unite --- toontown/chat/ResistanceChat.py | 26 ++++++++++++++++++++++--- toontown/suit/DistributedCashbotBoss.py | 2 ++ toontown/toon/DistributedToonAI.py | 10 +++------- toontown/toonbase/TTLocalizerEnglish.py | 8 ++++++-- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/toontown/chat/ResistanceChat.py b/toontown/chat/ResistanceChat.py index 48ed1c61..d061ac41 100755 --- a/toontown/chat/ResistanceChat.py +++ b/toontown/chat/ResistanceChat.py @@ -1,6 +1,6 @@ from direct.interval.IntervalGlobal import * from pandac.PandaModules import * -import random +import random, copy from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownBattleGlobals @@ -20,8 +20,9 @@ EFFECT_RADIUS = 30 RESISTANCE_TOONUP = 0 RESISTANCE_RESTOCK = 1 RESISTANCE_MONEY = 2 -RESISTANCE_MERITS = 3 -resistanceMenu = [RESISTANCE_TOONUP, RESISTANCE_RESTOCK, RESISTANCE_MONEY, RESISTANCE_MERITS] +RESISTANCE_TICKETS = 3 +RESISTANCE_MERITS = 4 +resistanceMenu = [RESISTANCE_TOONUP, RESISTANCE_RESTOCK, RESISTANCE_MONEY, RESISTANCE_TICKETS, RESISTANCE_MERITS] resistanceDict = { RESISTANCE_TOONUP: { 'menuName': TTLocalizer.ResistanceToonupMenu, @@ -70,6 +71,13 @@ resistanceDict = { 'values': range(len(SuitDNA.suitDepts)) + [-1], 'extra': TTLocalizer.RewardPanelMeritBarLabels + [TTLocalizer.MovieNPCSOSAll], 'items': range(len(SuitDNA.suitDepts) + 1) + }, + RESISTANCE_TICKETS: { + 'menuName': TTLocalizer.ResistanceTicketsMenu, + 'itemText': TTLocalizer.ResistanceTicketsItem, + 'chatText': TTLocalizer.ResistanceTicketsChat, + 'values': [200, 400, 600, 800, 1200], + 'items': [0, 1, 2, 3, 4] } } @@ -191,6 +199,7 @@ def doEffect(textId, speakingToon, nearbyToons): elif menuIndex == RESISTANCE_MERITS: effect = BattleParticles.loadParticleFile('resistanceEffectSprite.ptf') cogModel = loader.loadModel('phase_3/models/gui/cog_icons') + cogModel.setScale(0.75) cogModel.flattenLight() if itemValue != -1: @@ -207,6 +216,17 @@ def doEffect(textId, speakingToon, nearbyToons): fadeColor = VBase4(0.7, 0.7, 0.7, 1.0) cogModel.removeNode() + elif menuIndex == RESISTANCE_TICKETS: + effect = BattleParticles.loadParticleFile('resistanceEffectSprite.ptf') + model = loader.loadModel('phase_6/models/karting/tickets') + model.flattenLight() + iconDict = {'particles-1': model} + + for name, icon in iconDict.items(): + p = effect.getParticlesNamed(name) + p.renderer.setFromNode(icon) + + fadeColor = VBase4(1, 1, 0, 1) else: return recolorToons = Parallel() diff --git a/toontown/suit/DistributedCashbotBoss.py b/toontown/suit/DistributedCashbotBoss.py index 9c7b09fc..36562c76 100755 --- a/toontown/suit/DistributedCashbotBoss.py +++ b/toontown/suit/DistributedCashbotBoss.py @@ -897,6 +897,8 @@ class DistributedCashbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): instructions = TTLocalizer.ResistanceToonMeritsAllInstructions else: instructions = TTLocalizer.ResistanceToonMeritsInstructions % TTLocalizer.RewardPanelMeritBarLabels[value] + elif menuIndex == ResistanceChat.RESISTANCE_TICKETS: + instructions = TTLocalizer.ResistanceToonTicketsInstructions % value speech = TTLocalizer.ResistanceToonCongratulations % (text, instructions) speech = self.__talkAboutPromotion(speech) self.resistanceToon.setLocalPageChat(speech, 0) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 53b8211a..1ad9ca3b 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -2512,23 +2512,19 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.toonUp(self.maxHp) else: self.toonUp(msgValue) - self.notify.debug('Toon-up for ' + self.name) elif msgType == ResistanceChat.RESISTANCE_RESTOCK: self.inventory.NPCMaxOutInv(msgValue) self.d_setInventory(self.inventory.makeNetString()) - self.notify.debug('Restock for ' + self.name) elif msgType == ResistanceChat.RESISTANCE_MONEY: - if msgValue == -1: - self.addMoney(999999) - else: - self.addMoney(msgValue) - self.notify.debug('Money for ' + self.name) + self.addMoney(msgValue) elif msgType == ResistanceChat.RESISTANCE_MERITS: if msgValue == -1: for i in xrange(len(SuitDNA.suitDepts)): self.doResistanceMerits(i) else: self.doResistanceMerits(msgValue) + elif msgType == ResistanceChat.RESISTANCE_TICKETS: + self.b_setTickets(self.getTickets() + msgValue) def doResistanceMerits(self, dept): if not CogDisguiseGlobals.isSuitComplete(self.cogParts, dept): diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index bdf985f7..c09ccce5 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -4738,8 +4738,9 @@ ResistanceToonName = 'Mata Hairy' ResistanceToonCongratulations = "You did it! Congratulations!\x07You're an asset to the Resistance!\x07Here's a special phrase you can use in a tight spot:\x07%s\x07When you say it, %s.\x07But you can only use it once, so choose that time well!" ResistanceToonToonupInstructions = 'all the Toons near you will gain %s Laff points' ResistanceToonToonupAllInstructions = 'all the Toons near you will gain full Laff points' -ResistanceToonMoneyInstructions = 'all the Toons near you will gain %s Jellybeans' -ResistanceToonMoneyAllInstructions = 'all the Toons near you will fill their Jellybean jars' +ResistanceToonMoneyInstructions = 'all the Toons near you will gain %s jellybeans' +ResistanceToonMoneyAllInstructions = 'all the Toons near you will fill their jellybean jars' +ResistanceToonTicketsInstructions = 'all the Toons near you will gain %s tickets' ResistanceToonRestockInstructions = 'all the Toons near you will restock their "%s" gags' ResistanceToonRestockAllInstructions = 'all the Toons near you will restock all their gags' ResistanceToonMeritsInstructions = 'all the Toons near you will fill part of their %s' @@ -7243,6 +7244,9 @@ ResistanceMeritsChat = 'Toons of the World, Merit-up!' ResistanceMoneyMenu = 'Jellybeans' ResistanceMoneyItem = '%s Jellybeans' ResistanceMoneyChat = 'Toons of the World, Spend Wisely!' +ResistanceTicketsMenu = 'Tickets' +ResistanceTicketsItem = '%s Tickets' +ResistanceTicketsChat = 'Toons of the World, Go Race!' ResistanceEmote1 = NPCToonNames[9228] + ': Welcome to the Resistance!' ResistanceEmote2 = NPCToonNames[9228] + ': Use your new emote to identify yourself to other members.' ResistanceEmote3 = NPCToonNames[9228] + ': Good luck!'