Add tickets unite and make cog icons a bit smaller in the merits unite

This commit is contained in:
John 2015-06-11 18:35:29 +03:00 committed by Loudrob
parent e9244755fa
commit 468c192c14
4 changed files with 34 additions and 12 deletions

View file

@ -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()

View file

@ -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)

View file

@ -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):

View file

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