Murdered TTI's promotion system.

This commit is contained in:
Loudrob 2015-05-13 07:41:49 -04:00
parent 7e227afa55
commit 9d54f4f88a
16 changed files with 487 additions and 329 deletions

View file

@ -739,8 +739,6 @@ dclass DistributedToon : DistributedPlayer {
setCogTypes(uint8[] = [0 * 4]) required broadcast ownrecv db; setCogTypes(uint8[] = [0 * 4]) required broadcast ownrecv db;
setCogParts(uint32[] = [0 * 4]) required broadcast ownrecv db; setCogParts(uint32[] = [0 * 4]) required broadcast ownrecv db;
setCogMerits(uint16[] = [0 * 4]) required ownrecv db; setCogMerits(uint16[] = [0 * 4]) required ownrecv db;
setPromotionStatus(uint8[] = [0 * 4]) required broadcast ownrecv db;
requestPromotion(uint8) ownsend airecv;
setCogIndex(int8) broadcast ram; setCogIndex(int8) broadcast ram;
setDisguisePageFlag(int8) ownrecv; setDisguisePageFlag(int8) ownrecv;
setSosPageFlag(int8) ownrecv; setSosPageFlag(int8) ownrecv;

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 30166307 hashVal = 3191861370L
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot

View file

@ -195,7 +195,6 @@ class RewardPanel(DirectFrame):
totalMerits = CogDisguiseGlobals.getTotalMerits(toon, i) totalMerits = CogDisguiseGlobals.getTotalMerits(toon, i)
merits = meritList[i] merits = meritList[i]
self.meritIncLabels[i].hide() self.meritIncLabels[i].hide()
promoStatus = toon.promotionStatus[i]
if CogDisguiseGlobals.isSuitComplete(toon.cogParts, i): if CogDisguiseGlobals.isSuitComplete(toon.cogParts, i):
if not self.trackBarsOffset: if not self.trackBarsOffset:
trackBarOffset = 0.47 trackBarOffset = 0.47
@ -206,19 +205,14 @@ class RewardPanel(DirectFrame):
if totalMerits: if totalMerits:
meritBar['range'] = totalMerits meritBar['range'] = totalMerits
meritBar['value'] = merits meritBar['value'] = merits
if promoStatus != ToontownGlobals.PendingPromotion: if merits == totalMerits:
meritBar['text'] = TTLocalizer.RewardPanelMeritAlert
else:
meritBar['text'] = '%s/%s %s' % (merits, totalMerits, TTLocalizer.RewardPanelMeritBarLabels[i]) meritBar['text'] = '%s/%s %s' % (merits, totalMerits, TTLocalizer.RewardPanelMeritBarLabels[i])
maxSuitType = SuitDNA.suitsPerDept - 1 else:
maxSuitLevel = (SuitDNA.levelsPerSuit-1) + maxSuitType
if toon.cogLevels[i] == maxSuitLevel:
if promoStatus == ToontownGlobals.PendingPromotion:
meritBar['range'] = 1
meritBar['value'] = 1
meritBar['text'] = TTLocalizer.RewardPanelMeritsMaxed
elif promoStatus == ToontownGlobals.PendingPromotion:
meritBar['range'] = 1 meritBar['range'] = 1
meritBar['value'] = 1 meritBar['value'] = 1
meritBar['text'] = TTLocalizer.RewardPanelPromotionPending meritBar['text'] = TTLocalizer.RewardPanelMeritsMaxed
self.resetMeritBarColor(i) self.resetMeritBarColor(i)
else: else:
meritBar.hide() meritBar.hide()
@ -276,12 +270,18 @@ class RewardPanel(DirectFrame):
def incrementMerits(self, toon, dept, newValue, totalMerits): def incrementMerits(self, toon, dept, newValue, totalMerits):
meritBar = self.meritBars[dept] meritBar = self.meritBars[dept]
promoStatus = toon.promotionStatus[dept] oldValue = meritBar['value']
if totalMerits: if totalMerits:
newValue = min(totalMerits, newValue) newValue = min(totalMerits, newValue)
meritBar['range'] = totalMerits meritBar['range'] = totalMerits
meritBar['value'] = newValue meritBar['value'] = newValue
if promoStatus != ToontownGlobals.PendingPromotion: if newValue == totalMerits:
meritBar['text'] = TTLocalizer.RewardPanelMeritAlert
meritBar['barColor'] = (DisguisePage.DeptColors[dept][0],
DisguisePage.DeptColors[dept][1],
DisguisePage.DeptColors[dept][2],
1)
else:
meritBar['text'] = '%s/%s %s' % (newValue, totalMerits, TTLocalizer.RewardPanelMeritBarLabels[dept]) meritBar['text'] = '%s/%s %s' % (newValue, totalMerits, TTLocalizer.RewardPanelMeritBarLabels[dept])
def resetMeritBarColor(self, dept): def resetMeritBarColor(self, dept):

View file

@ -3,8 +3,6 @@ import types
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil from direct.showbase import PythonUtil
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from toontown.battle import SuitBattleGlobals
PartsPerSuit = (17, PartsPerSuit = (17,
14, 14,
12, 12,
@ -14,8 +12,320 @@ PartsPerSuitBitmasks = (131071,
56447, 56447,
56411) 56411)
AllBits = 131071 AllBits = 131071
MinPartLoss = 1 MinPartLoss = 2
MaxPartLoss = 2 MaxPartLoss = 4
MeritsPerLevel = ((100,
130,
160,
190,
800),
(160,
210,
260,
310,
1300),
(260,
340,
420,
500,
2100),
(420,
550,
680,
810,
3400),
(680,
890,
1100,
1310,
5500),
(1100,
1440,
1780,
2120,
8900),
(1780,
2330,
2880,
3430,
14400),
(2880,
3770,
4660,
5500,
23300,
2880,
23300,
2880,
3770,
4660,
5500,
23300,
2880,
3770,
4660,
5500,
6440,
7330,
8220,
9110,
10000,
23300,
2880,
3770,
4660,
5500,
6440,
7330,
8220,
9110,
10000,
23300,
2880,
3770,
4660,
5500,
6440,
7330,
8220,
9110,
10000,
23300,
0),
(60,
80,
100,
120,
500),
(100,
130,
160,
190,
800),
(160,
210,
260,
310,
1300),
(260,
340,
420,
500,
2100),
(420,
550,
680,
810,
3400),
(680,
890,
1100,
1310,
5500),
(1100,
1440,
1780,
2120,
8900),
(1780,
2330,
2880,
3430,
14400,
1780,
14400,
1780,
2330,
2880,
3430,
14400,
1780,
2330,
2880,
3430,
3980,
4530,
5080,
5630,
6180,
14400,
1780,
2330,
2880,
3430,
3980,
4530,
5080,
5630,
6180,
14400,
1780,
2330,
2880,
3430,
3980,
4530,
5080,
5630,
6180,
14400,
0),
(40,
50,
60,
70,
300),
(60,
80,
100,
120,
500),
(100,
130,
160,
190,
800),
(160,
210,
260,
310,
1300),
(260,
340,
420,
500,
2100),
(420,
550,
680,
810,
3400),
(680,
890,
1100,
1310,
5500),
(1100,
1440,
1780,
2120,
8900,
1100,
8900,
1100,
1440,
1780,
2120,
8900,
1100,
1440,
1780,
2120,
2460,
2800,
3140,
3480,
3820,
8900,
1100,
1440,
1780,
2120,
2460,
2800,
3140,
3480,
3820,
8900,
1100,
1440,
1780,
2120,
2460,
2800,
3140,
3480,
3820,
8900,
0),
(20,
30,
40,
50,
200),
(40,
50,
60,
70,
300),
(60,
80,
100,
120,
500),
(100,
130,
160,
190,
800),
(160,
210,
260,
310,
1300),
(260,
340,
420,
500,
2100),
(420,
550,
680,
810,
3400),
(680,
890,
1100,
1310,
5500,
680,
5500,
680,
890,
1100,
1310,
5500,
680,
890,
1100,
1310,
1520,
1730,
1940,
2150,
2360,
5500,
680,
890,
1100,
1310,
1520,
1730,
1940,
2150,
2360,
5500,
680,
890,
1100,
1310,
1520,
1730,
1940,
2150,
2360,
5500,
0))
leftLegUpper = 1 leftLegUpper = 1
leftLegLower = 2 leftLegLower = 2
leftLegFoot = 4 leftLegFoot = 4
@ -121,22 +431,6 @@ PartsQueryNames = ({1: PartNameStrings[0],
65536: PartNameStrings[15]}) 65536: PartNameStrings[15]})
suitTypes = PythonUtil.Enum(('NoSuit', 'NoMerits', 'FullSuit')) suitTypes = PythonUtil.Enum(('NoSuit', 'NoMerits', 'FullSuit'))
def makeMeritHierarchy(baseMerits):
meritHierarchy = []
for _ in xrange(SuitDNA.suitsPerDept):
meritTier = []
for _ in xrange(SuitDNA.levelsPerSuit):
baseMerits += (baseMerits*25) / 100
meritTier.append(baseMerits)
meritHierarchy.append(tuple(meritTier))
baseMerits /= 2
return meritHierarchy
MeritsPerLevel = makeMeritHierarchy(100) # Bossbot
MeritsPerLevel += makeMeritHierarchy(75) # Lawbot
MeritsPerLevel += makeMeritHierarchy(50) # Cashbot
MeritsPerLevel += makeMeritHierarchy(25) # Sellbot
def getNextPart(parts, partIndex, dept): def getNextPart(parts, partIndex, dept):
dept = dept2deptIndex(dept) dept = dept2deptIndex(dept)
needMask = PartsPerSuitBitmasks[dept] & PartsQueryMasks[partIndex] needMask = PartsPerSuitBitmasks[dept] & PartsQueryMasks[partIndex]
@ -146,6 +440,7 @@ def getNextPart(parts, partIndex, dept):
nextPart = nextPart + 1 >> 1 nextPart = nextPart + 1 >> 1
return nextPart return nextPart
def getPartName(partArray): def getPartName(partArray):
index = 0 index = 0
for part in partArray: for part in partArray:
@ -153,14 +448,27 @@ def getPartName(partArray):
return PartsQueryNames[index][part] return PartsQueryNames[index][part]
index += 1 index += 1
def isSuitComplete(parts, dept): def isSuitComplete(parts, dept):
dept = dept2deptIndex(dept) dept = dept2deptIndex(dept)
for p in xrange(len(PartsQueryMasks)): for p in range(len(PartsQueryMasks)):
if getNextPart(parts, p, dept): if getNextPart(parts, p, dept):
return 0 return 0
return 1 return 1
def isPaidSuitComplete(av, parts, dept):
isPaid = 0
base = getBase()
if av and av.getGameAccess() == OTPGlobals.AccessFull:
isPaid = 1
if isPaid:
if isSuitComplete(parts, dept):
return 1
return 0
def getTotalMerits(toon, index): def getTotalMerits(toon, index):
from toontown.battle import SuitBattleGlobals from toontown.battle import SuitBattleGlobals
cogIndex = toon.cogTypes[index] + SuitDNA.suitsPerDept * index cogIndex = toon.cogTypes[index] + SuitDNA.suitsPerDept * index
@ -170,13 +478,15 @@ def getTotalMerits(toon, index):
cogLevel = max(min(cogLevel, len(MeritsPerLevel[cogIndex]) - 1), 0) cogLevel = max(min(cogLevel, len(MeritsPerLevel[cogIndex]) - 1), 0)
return MeritsPerLevel[cogIndex][cogLevel] return MeritsPerLevel[cogIndex][cogLevel]
def getTotalParts(bitString, shiftWidth = 32): def getTotalParts(bitString, shiftWidth = 32):
sum = 0 sum = 0
for shift in xrange(0, shiftWidth): for shift in range(0, shiftWidth):
sum = sum + (bitString >> shift & 1) sum = sum + (bitString >> shift & 1)
return sum return sum
def asBitstring(number): def asBitstring(number):
array = [] array = []
shift = 0 shift = 0
@ -190,19 +500,21 @@ def asBitstring(number):
shift += 1 shift += 1
str = '' str = ''
for i in xrange(0, len(array)): for i in range(0, len(array)):
str = str + array[i] str = str + array[i]
return str return str
def asNumber(bitstring): def asNumber(bitstring):
num = 0 num = 0
for i in xrange(0, len(bitstring)): for i in range(0, len(bitstring)):
if bitstring[i] == '1': if bitstring[i] == '1':
num += pow(2, len(bitstring) - 1 - i) num += pow(2, len(bitstring) - 1 - i)
return num return num
def dept2deptIndex(dept): def dept2deptIndex(dept):
if type(dept) == types.StringType: if type(dept) == types.StringType:
dept = SuitDNA.suitDepts.index(dept) dept = SuitDNA.suitDepts.index(dept)

View file

@ -34,10 +34,9 @@ class DistributedBattleFactoryAI(DistributedLevelBattleAI.DistributedLevelBattle
else: else:
self.notify.debug('toon %d not helpful, skipping merits' % toon.doId) self.notify.debug('toon %d not helpful, skipping merits' % toon.doId)
if self.bossBattle: if self.bossBattle:
self.toonParts[toon.doId] = self.air.cogSuitMgr.recoverPart( self.toonParts[toon.doId] = self.air.cogSuitMgr.recoverPart(toon, self.level.factoryType, self.suitTrack, self.getTaskZoneId(), toons)
toon, 'fullSuit', self.suitTrack, self.notify.debug('toonParts = %s' % self.toonParts)
self.getTaskZoneId(), toons)
self.notify.debug('toonParts = %s' % self.toonParts)
def enterFactoryReward(self): def enterFactoryReward(self):
self.joinableFsm.request('Unjoinable') self.joinableFsm.request('Unjoinable')

View file

@ -70,7 +70,15 @@ class QuestRewardCounter:
cogTypes = av.getCogTypes() cogTypes = av.getCogTypes()
suitHp = 0 suitHp = 0
for dept in HQdepts: for dept in HQdepts:
suitHp += levels[dept] level = levels[dept]
type = cogTypes[dept]
if type >= SuitDNA.suitsPerDept - 1:
for milestoneLevel in ToontownGlobals.CogSuitHPLevels:
if level >= milestoneLevel:
suitHp += 1
else:
break
self.notify.debug('Adding %s hp for cog suits' % suitHp) self.notify.debug('Adding %s hp for cog suits' % suitHp)
self.maxHp += suitHp self.maxHp += suitHp
kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup) kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)

View file

@ -1,27 +1,18 @@
import ShtikerPage
from direct.gui.DirectGui import * from direct.gui.DirectGui import *
from pandac.PandaModules import * from pandac.PandaModules import *
import ShtikerPage
from toontown.battle import SuitBattleGlobals
from toontown.coghq import CogDisguiseGlobals
from toontown.suit import SuitDNA
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.suit import SuitDNA
DeptColors = ( from toontown.battle import SuitBattleGlobals
Vec4(0.647, 0.608, 0.596, 1.0), from toontown.minigame import MinigamePowerMeter
Vec4(0.588, 0.635, 0.671, 1.0), from toontown.coghq import CogDisguiseGlobals
Vec4(0.596, 0.714, 0.659, 1.0), DeptColors = (Vec4(0.647, 0.608, 0.596, 1.0),
Vec4(0.761, 0.678, 0.69, 1.0) Vec4(0.588, 0.635, 0.671, 1.0),
) Vec4(0.596, 0.714, 0.659, 1.0),
Vec4(0.761, 0.678, 0.69, 1.0))
NumParts = max(CogDisguiseGlobals.PartsPerSuit) NumParts = max(CogDisguiseGlobals.PartsPerSuit)
PartNames = ( PartNames = ('lUpleg', 'lLowleg', 'lShoe', 'rUpleg', 'rLowleg', 'rShoe', 'lShoulder', 'rShoulder', 'chest', 'waist', 'hip', 'lUparm', 'lLowarm', 'lHand', 'rUparm', 'rLowarm', 'rHand')
'lUpleg', 'lLowleg', 'lShoe', 'rUpleg', 'rLowleg', 'rShoe', 'lShoulder',
'rShoulder', 'chest', 'waist', 'hip', 'lUparm', 'lLowarm', 'lHand',
'rUparm', 'rLowarm', 'rHand'
)
class DisguisePage(ShtikerPage.ShtikerPage): class DisguisePage(ShtikerPage.ShtikerPage):
meterColor = Vec4(0.87, 0.87, 0.827, 1.0) meterColor = Vec4(0.87, 0.87, 0.827, 1.0)
@ -31,14 +22,13 @@ class DisguisePage(ShtikerPage.ShtikerPage):
ShtikerPage.ShtikerPage.__init__(self) ShtikerPage.ShtikerPage.__init__(self)
self.activeTab = 0 self.activeTab = 0
self.progressTitle = None self.progressTitle = None
return
def load(self): def load(self):
ShtikerPage.ShtikerPage.load(self) ShtikerPage.ShtikerPage.load(self)
gui = loader.loadModel('phase_9/models/gui/cog_disguises')
gui = loader.loadModel('phase_9/models/gui/cog_disguises.bam')
self.frame = DirectFrame(parent=self, relief=None, scale=0.47, pos=(0.02, 1, 0)) self.frame = DirectFrame(parent=self, relief=None, scale=0.47, pos=(0.02, 1, 0))
self.bkgd = DirectFrame( self.bkgd = DirectFrame(parent=self.frame, geom=gui.find('**/base'), relief=None, scale=(0.98, 1, 1))
parent=self.frame, geom=gui.find('**/base'), relief=None, scale=(0.98, 1, 1))
self.bkgd.setTextureOff(1) self.bkgd.setTextureOff(1)
self.tabs = [] self.tabs = []
self.pageFrame = DirectFrame(parent=self.frame, relief=None) self.pageFrame = DirectFrame(parent=self.frame, relief=None)
@ -57,116 +47,51 @@ class DisguisePage(ShtikerPage.ShtikerPage):
textPos = (1.57, -1.05) textPos = (1.57, -1.05)
pageGeom = gui.find('**/page%d' % tabIndex) pageGeom = gui.find('**/page%d' % tabIndex)
tabGeom = gui.find('**/tab%d' % tabIndex) tabGeom = gui.find('**/tab%d' % tabIndex)
tab = DirectButton( tab = DirectButton(parent=self.pageFrame, relief=None, geom=tabGeom, geom_color=DeptColors[tabIndex - 1], text=SuitDNA.suitDeptFullnames[dept], text_font=ToontownGlobals.getSuitFont(), text_pos=textPos, text_roll=-90, text_scale=TTLocalizer.DPtab, text_align=TextNode.ACenter, text1_fg=Vec4(1, 0, 0, 1), text2_fg=Vec4(0.5, 0.4, 0.4, 1), text3_fg=Vec4(0.4, 0.4, 0.4, 1), command=self.doTab, extraArgs=[len(self.tabs)], pressEffect=0)
parent=self.pageFrame, relief=None, geom=tabGeom,
geom_color=DeptColors[tabIndex - 1],
text=SuitDNA.suitDeptFullnames[dept],
text_font=ToontownGlobals.getSuitFont(), text_pos=textPos,
text_roll=-90, text_scale=TTLocalizer.DPtab,
text_align=TextNode.ACenter, text1_fg=Vec4(1, 0, 0, 1),
text2_fg=Vec4(0.5, 0.4, 0.4, 1),
text3_fg=Vec4(0.4, 0.4, 0.4, 1), command=self.doTab,
extraArgs=[len(self.tabs)], pressEffect=0)
self.tabs.append(tab) self.tabs.append(tab)
DirectFrame(parent=tab, relief=None, geom=pageGeom) page = DirectFrame(parent=tab, relief=None, geom=pageGeom)
self.deptLabel = DirectLabel( self.deptLabel = DirectLabel(parent=self.frame, text='', text_font=ToontownGlobals.getSuitFont(), text_scale=TTLocalizer.DPdeptLabel, text_pos=(-0.1, 0.8))
parent=self.frame, text='',
text_font=ToontownGlobals.getSuitFont(),
text_scale=TTLocalizer.DPdeptLabel, text_pos=(-0.1, 0.8))
DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/pipe_frame')) DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/pipe_frame'))
self.tube = DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/tube')) self.tube = DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/tube'))
DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/robot/face')) DirectFrame(parent=self.frame, relief=None, geom=gui.find('**/robot/face'))
DirectLabel( DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_cog_disguises'), geom_pos=(0, 0.1, 0))
parent=self.frame, relief=None, self.meritTitle = DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_merit_progress'), geom_pos=(0, 0.1, 0))
geom=gui.find('**/text_cog_disguises'), geom_pos=(0, 0.1, 0))
self.meritTitle = DirectLabel(
parent=self.frame, relief=None,
geom=gui.find('**/text_merit_progress'), geom_pos=(0, 0.1, 0))
self.meritTitle.hide() self.meritTitle.hide()
self.cogbuckTitle = DirectLabel( self.cogbuckTitle = DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_cashbuck_progress'), geom_pos=(0, 0.1, 0))
parent=self.frame, relief=None,
geom=gui.find('**/text_cashbuck_progress'), geom_pos=(0, 0.1, 0))
self.cogbuckTitle.hide() self.cogbuckTitle.hide()
self.juryNoticeTitle = DirectLabel( self.juryNoticeTitle = DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_jury_notice_progress'), geom_pos=(0, 0.1, 0))
parent=self.frame, relief=None,
geom=gui.find('**/text_jury_notice_progress'), geom_pos=(0, 0.1, 0))
self.juryNoticeTitle.hide() self.juryNoticeTitle.hide()
self.stockOptionTitle = DirectLabel( self.stockOptionTitle = DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_stock_option_progress'), geom_pos=(0, 0.1, 0))
parent=self.frame, relief=None,
geom=gui.find('**/text_stock_option_progress'), geom_pos=(0, 0.1, 0))
self.stockOptionTitle.hide() self.stockOptionTitle.hide()
self.progressTitle = self.meritTitle self.progressTitle = self.meritTitle
self.promotionTitle = DirectLabel( self.promotionTitle = DirectLabel(parent=self.frame, relief=None, geom=gui.find('**/text_ready4promotion'), geom_pos=(0, 0.1, 0))
parent=self.frame, relief=None, self.cogName = DirectLabel(parent=self.frame, relief=None, text='', text_font=ToontownGlobals.getSuitFont(), text_scale=TTLocalizer.DPcogName, text_align=TextNode.ACenter, pos=(-0.948, 0, -1.15))
geom=gui.find('**/text_ready4promotion'), geom_pos=(0, 0.1, 0)) self.cogLevel = DirectLabel(parent=self.frame, relief=None, text='', text_font=ToontownGlobals.getSuitFont(), text_scale=0.09, text_align=TextNode.ACenter, pos=(-0.91, 0, -1.02))
self.cogName = DirectLabel(
parent=self.frame, relief=None, text='',
text_font=ToontownGlobals.getSuitFont(),
text_scale=TTLocalizer.DPcogName, text_align=TextNode.ACenter,
pos=(-0.948, 0, -1.15))
self.cogLevel = DirectLabel(
parent=self.frame, relief=None, text='',
text_font=ToontownGlobals.getSuitFont(), text_scale=0.09,
text_align=TextNode.ACenter, pos=(-0.91, 0, -1.02))
self.partFrame = DirectFrame(parent=self.frame, relief=None) self.partFrame = DirectFrame(parent=self.frame, relief=None)
self.parts = [] self.parts = []
for partNum in xrange(0, 17): for partNum in range(0, NumParts):
self.parts.append( self.parts.append(DirectFrame(parent=self.partFrame, relief=None, geom=gui.find('**/robot/' + PartNames[partNum])))
DirectFrame(parent=self.partFrame, relief=None,
geom=gui.find('**/robot/' + PartNames[partNum])))
self.holes = [] self.holes = []
for partNum in xrange(0, 17): for partNum in range(0, NumParts):
self.holes.append( self.holes.append(DirectFrame(parent=self.partFrame, relief=None, geom=gui.find('**/robot_hole/' + PartNames[partNum])))
DirectFrame(parent=self.partFrame, relief=None,
geom=gui.find('**/robot_hole/' + PartNames[partNum]))) self.cogPartRatio = DirectLabel(parent=self.frame, relief=None, text='', text_font=ToontownGlobals.getSuitFont(), text_scale=0.08, text_align=TextNode.ACenter, pos=(-0.91, 0, -0.82))
self.cogPartRatio = DirectLabel( self.cogMeritRatio = DirectLabel(parent=self.frame, relief=None, text='', text_font=ToontownGlobals.getSuitFont(), text_scale=0.08, text_align=TextNode.ACenter, pos=(0.45, 0, -0.36))
parent=self.frame, relief=None, text='',
text_font=ToontownGlobals.getSuitFont(), text_scale=0.08,
text_align=TextNode.ACenter, pos=(-0.91, 0, -0.82))
self.cogMeritRatio = DirectLabel(
parent=self.frame, relief=None, text='',
text_font=ToontownGlobals.getSuitFont(), text_scale=0.08,
text_align=TextNode.ACenter, pos=(0.45, 0, -0.36))
meterFace = gui.find('**/meter_face_whole') meterFace = gui.find('**/meter_face_whole')
meterFaceHalf = gui.find('**/meter_face_half') meterFaceHalf = gui.find('**/meter_face_half')
self.meterFace = DirectLabel( self.meterFace = DirectLabel(parent=self.frame, relief=None, geom=meterFace, color=self.meterColor, pos=(0.455, 0.0, 0.04))
parent=self.frame, relief=None, geom=meterFace, self.meterFaceHalf1 = DirectLabel(parent=self.frame, relief=None, geom=meterFaceHalf, color=self.meterActiveColor, pos=(0.455, 0.0, 0.04))
color=self.meterColor, pos=(0.455, 0.0, 0.04)) self.meterFaceHalf2 = DirectLabel(parent=self.frame, relief=None, geom=meterFaceHalf, color=self.meterColor, pos=(0.455, 0.0, 0.04))
self.meterFaceHalf1 = DirectLabel(
parent=self.frame, relief=None, geom=meterFaceHalf,
color=self.meterActiveColor, pos=(0.455, 0.0, 0.04))
self.meterFaceHalf2 = DirectLabel(
parent=self.frame, relief=None, geom=meterFaceHalf,
color=self.meterColor, pos=(0.455, 0.0, 0.04))
self.promotionSfx = loader.loadSfx('phase_5/audio/sfx/suit_promotion_sfx.ogg')
self.buttonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui.bam')
upButton = self.buttonModels.find('**//InventoryButtonUp')
downButton = self.buttonModels.find('**/InventoryButtonDown')
rolloverButton = self.buttonModels.find('**/InventoryButtonRollover')
self.promoteButton = DirectButton(
parent=self.frame, relief=None, text='Promote',
text_fg=(0.9, 0.9, 0.9, 1), text_pos=(0, -0.2),
text_font=ToontownGlobals.getSuitFont(),
text_scale=0.6, image=(upButton, downButton, rolloverButton),
image_color=(0.5, 0.5, 0.5, 1), image_scale=(20, 1, 11),
pos=(0.94, 0, -1.125), scale=0.125,
command=self.sendPromotionRequest, extraArgs=[3])
self.promoteButton.hide()
if base.localAvatar.promotionStatus[3] == ToontownGlobals.PendingPromotion:
self.promoteButton.show()
if base.localAvatar.cogLevels[3] == ToontownGlobals.MaxCogSuitLevel:
self.promoteButton['state'] = DGG.DISABLED
self.frame.hide() self.frame.hide()
self.activeTab = 3 self.activeTab = 3
self.updatePage() self.updatePage()
return
def unload(self): def unload(self):
ShtikerPage.ShtikerPage.unload(self) ShtikerPage.ShtikerPage.unload(self)
del self.promotionSfx
self.buttonModels.removeNode()
def enter(self): def enter(self):
self.frame.show() self.frame.show()
ShtikerPage.ShtikerPage.enter(self) ShtikerPage.ShtikerPage.enter(self)
@ -236,10 +161,9 @@ class DisguisePage(ShtikerPage.ShtikerPage):
self.meterFaceHalf2.setR(180 * (progress / 0.5)) self.meterFaceHalf2.setR(180 * (progress / 0.5))
def doTab(self, index): def doTab(self, index):
self.promoteButton.hide()
self.activeTab = index self.activeTab = index
self.tabs[index].reparentTo(self.pageFrame) self.tabs[index].reparentTo(self.pageFrame)
for i in xrange(len(self.tabs)): for i in range(len(self.tabs)):
tab = self.tabs[i] tab = self.tabs[i]
if i == index: if i == index:
tab['text0_fg'] = (1, 0, 0, 1) tab['text0_fg'] = (1, 0, 0, 1)
@ -270,17 +194,3 @@ class DisguisePage(ShtikerPage.ShtikerPage):
self.updatePartsDisplay(index, numParts, numPartsRequired) self.updatePartsDisplay(index, numParts, numPartsRequired)
self.updateMeritBar(index) self.updateMeritBar(index)
self.cogPartRatio['text'] = '%d/%d' % (CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired) self.cogPartRatio['text'] = '%d/%d' % (CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired)
if base.localAvatar.promotionStatus[index] == ToontownGlobals.PendingPromotion:
self.promoteButton['extraArgs'] = [index]
if base.localAvatar.cogLevels[index] == ToontownGlobals.MaxCogSuitLevel:
self.promoteButton['state'] = DGG.DISABLED
else:
self.promoteButton['state'] = DGG.NORMAL
self.promoteButton.show()
def sendPromotionRequest(self, dept):
self.promoteButton.hide()
base.playSfx(self.promotionSfx)
base.localAvatar.promotionStatus[dept] = 0
base.localAvatar.sendUpdate('requestPromotion', [dept])
self.updatePage()

View file

@ -843,19 +843,11 @@ class DistributedBossbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
def __talkAboutPromotion(self, speech): def __talkAboutPromotion(self, speech):
if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel: if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
deptIndex = CogDisguiseGlobals.dept2deptIndex(self.style.dept) newCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
cogLevels = base.localAvatar.getCogLevels() if newCogSuitLevel == ToontownGlobals.MaxCogSuitLevel:
newCogSuitLevel = cogLevels[deptIndex] speech += TTLocalizer.BossbotRTLastPromotion % (ToontownGlobals.MaxCogSuitLevel + 1)
cogTypes = base.localAvatar.getCogTypes() if newCogSuitLevel in ToontownGlobals.CogSuitHPLevels:
maxCogSuitLevel = (SuitDNA.levelsPerSuit-1) + cogTypes[deptIndex] speech += TTLocalizer.BossbotRTHPBoost
if self.prevCogSuitLevel != maxCogSuitLevel:
speech += TTLocalizer.BossbotRTLevelPromotion
if newCogSuitLevel == maxCogSuitLevel:
if newCogSuitLevel != ToontownGlobals.MaxCogSuitLevel:
suitIndex = (SuitDNA.suitsPerDept*deptIndex) + cogTypes[deptIndex]
cogTypeStr = SuitDNA.suitHeadTypes[suitIndex]
cogName = SuitBattleGlobals.SuitAttributes[cogTypeStr]['name']
speech += TTLocalizer.BossbotRTSuitPromotion % cogName
else: else:
speech += TTLocalizer.BossbotRTMaxed % (ToontownGlobals.MaxCogSuitLevel + 1) speech += TTLocalizer.BossbotRTMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
return speech return speech

View file

@ -648,19 +648,11 @@ class DistributedCashbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
def __talkAboutPromotion(self, speech): def __talkAboutPromotion(self, speech):
if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel: if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
deptIndex = CogDisguiseGlobals.dept2deptIndex(self.style.dept) newCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
cogLevels = base.localAvatar.getCogLevels() if newCogSuitLevel == ToontownGlobals.MaxCogSuitLevel:
newCogSuitLevel = cogLevels[deptIndex] speech += TTLocalizer.ResistanceToonLastPromotion % (ToontownGlobals.MaxCogSuitLevel + 1)
cogTypes = base.localAvatar.getCogTypes() if newCogSuitLevel in ToontownGlobals.CogSuitHPLevels:
maxCogSuitLevel = (SuitDNA.levelsPerSuit-1) + cogTypes[deptIndex] speech += TTLocalizer.ResistanceToonHPBoost
if self.prevCogSuitLevel != maxCogSuitLevel:
speech += TTLocalizer.ResistanceToonLevelPromotion
if newCogSuitLevel == maxCogSuitLevel:
if newCogSuitLevel != ToontownGlobals.MaxCogSuitLevel:
suitIndex = (SuitDNA.suitsPerDept*deptIndex) + cogTypes[deptIndex]
cogTypeStr = SuitDNA.suitHeadTypes[suitIndex]
cogName = SuitBattleGlobals.SuitAttributes[cogTypeStr]['name']
speech += TTLocalizer.ResistanceToonSuitPromotion % cogName
else: else:
speech += TTLocalizer.ResistanceToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1) speech += TTLocalizer.ResistanceToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
return speech return speech

View file

@ -1659,19 +1659,11 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
def __talkAboutPromotion(self, speech): def __talkAboutPromotion(self, speech):
if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel: if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
deptIndex = CogDisguiseGlobals.dept2deptIndex(self.style.dept) newCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
cogLevels = base.localAvatar.getCogLevels() if newCogSuitLevel == ToontownGlobals.MaxCogSuitLevel:
newCogSuitLevel = cogLevels[deptIndex] speech += TTLocalizer.WitnessToonLastPromotion % (ToontownGlobals.MaxCogSuitLevel + 1)
cogTypes = base.localAvatar.getCogTypes() if newCogSuitLevel in ToontownGlobals.CogSuitHPLevels:
maxCogSuitLevel = (SuitDNA.levelsPerSuit-1) + cogTypes[deptIndex] speech += TTLocalizer.WitnessToonHPBoost
if self.prevCogSuitLevel != maxCogSuitLevel:
speech += TTLocalizer.WitnessToonLevelPromotion
if newCogSuitLevel == maxCogSuitLevel:
if newCogSuitLevel != ToontownGlobals.MaxCogSuitLevel:
suitIndex = (SuitDNA.suitsPerDept*deptIndex) + cogTypes[deptIndex]
cogTypeStr = SuitDNA.suitHeadTypes[suitIndex]
cogName = SuitBattleGlobals.SuitAttributes[cogTypeStr]['name']
speech += TTLocalizer.WitnessToonSuitPromotion % cogName
else: else:
speech += TTLocalizer.WitnessToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1) speech += TTLocalizer.WitnessToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
return speech return speech

View file

@ -444,20 +444,15 @@ class DistributedSellbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
return bossTrack return bossTrack
def __talkAboutPromotion(self, speech): def __talkAboutPromotion(self, speech):
if self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel: if not self.localToonPromoted:
deptIndex = CogDisguiseGlobals.dept2deptIndex(self.style.dept) pass
cogLevels = base.localAvatar.getCogLevels() elif self.prevCogSuitLevel < ToontownGlobals.MaxCogSuitLevel:
newCogSuitLevel = cogLevels[deptIndex] speech += TTLocalizer.CagedToonPromotion
cogTypes = base.localAvatar.getCogTypes() newCogSuitLevel = localAvatar.getCogLevels()[CogDisguiseGlobals.dept2deptIndex(self.style.dept)]
maxCogSuitLevel = (SuitDNA.levelsPerSuit-1) + cogTypes[deptIndex] if newCogSuitLevel == ToontownGlobals.MaxCogSuitLevel:
if self.prevCogSuitLevel != maxCogSuitLevel: speech += TTLocalizer.CagedToonLastPromotion % (ToontownGlobals.MaxCogSuitLevel + 1)
speech += TTLocalizer.CagedToonLevelPromotion if newCogSuitLevel in ToontownGlobals.CogSuitHPLevels:
if newCogSuitLevel == maxCogSuitLevel: speech += TTLocalizer.CagedToonHPBoost
if newCogSuitLevel != ToontownGlobals.MaxCogSuitLevel:
suitIndex = (SuitDNA.suitsPerDept*deptIndex) + cogTypes[deptIndex]
cogTypeStr = SuitDNA.suitHeadTypes[suitIndex]
cogName = SuitBattleGlobals.SuitAttributes[cogTypeStr]['name']
speech += TTLocalizer.CagedToonSuitPromotion % cogName
else: else:
speech += TTLocalizer.CagedToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1) speech += TTLocalizer.CagedToonMaxed % (ToontownGlobals.MaxCogSuitLevel + 1)
return speech return speech

View file

@ -100,7 +100,6 @@ suitsPerLevel = [1,
1, 1,
1] 1]
suitsPerDept = 8 suitsPerDept = 8
levelsPerSuit = 5
goonTypes = ['pg', 'sg'] goonTypes = ['pg', 'sg']
def getSuitBodyType(name): def getSuitBodyType(name):

View file

@ -180,7 +180,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.gmNameTagEnabled = 0 self.gmNameTagEnabled = 0
self.gmNameTagColor = 'whiteGM' self.gmNameTagColor = 'whiteGM'
self.gmNameTagString = '' self.gmNameTagString = ''
self.promotionStatus = [0, 0, 0, 0]
self.buffs = [] self.buffs = []
self.redeemedCodes = [] self.redeemedCodes = []
self.trueFriends = [] self.trueFriends = []
@ -890,9 +889,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if self.disguisePage: if self.disguisePage:
self.disguisePage.updatePage() self.disguisePage.updatePage()
def getCogTypes(self):
return self.cogTypes
def setCogLevels(self, levels): def setCogLevels(self, levels):
self.cogLevels = levels self.cogLevels = levels
if self.disguisePage: if self.disguisePage:
@ -936,9 +932,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
else: else:
self.putOnSuit(index, rental=True) self.putOnSuit(index, rental=True)
def setPromotionStatus(self, status):
self.promotionStatus = status
def isCog(self): def isCog(self):
if self.cogIndex == -1: if self.cogIndex == -1:
return 0 return 0
@ -2659,15 +2652,6 @@ def zone(zoneId):
base.cr.sendSetZoneMsg(zoneId, [zoneId]) base.cr.sendSetZoneMsg(zoneId, [zoneId])
return 'You have been moved to zone %d.' % zoneId return 'You have been moved to zone %d.' % zoneId
@magicWord(category=CATEGORY_ADMINISTRATOR, types=[int])
def promote(deptIndex):
"""
sends a request to promote the invoker's [deptIndex] Cog disguise.
"""
invoker = spellbook.getInvoker()
invoker.sendUpdate('requestPromotion', [deptIndex])
return 'Your promotion request has been sent.'
@magicWord(category=CATEGORY_ADMINISTRATOR) @magicWord(category=CATEGORY_ADMINISTRATOR)
def blackCat(): def blackCat():
""" """
@ -2687,4 +2671,4 @@ def showParticle(name):
particle.start(spellbook.getTarget()) particle.start(spellbook.getTarget())
return 'Successfully started particle!' return 'Successfully started particle!'
return 'Particle %s does not exist.' % name return 'Particle %s does not exist.' % name

View file

@ -177,7 +177,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.partyReplyInfoBases = [] self.partyReplyInfoBases = []
self.teleportOverride = 0 self.teleportOverride = 0
self._gmDisabled = False self._gmDisabled = False
self.promotionStatus = [0, 0, 0, 0]
self.buffs = [] self.buffs = []
self.redeemedCodes = [] self.redeemedCodes = []
self.trueFriends = [] self.trueFriends = []
@ -1244,38 +1243,31 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def getCogLevels(self): def getCogLevels(self):
return self.cogLevels return self.cogLevels
def incCogLevel(self, deptIndex): def incCogLevel(self, dept):
cogLevel = self.cogLevels[deptIndex] newLevel = self.cogLevels[dept] + 1
maxSuitType = SuitDNA.suitsPerDept - 1 cogTypeStr = SuitDNA.suitHeadTypes[self.cogTypes[dept]]
maxSuitLevel = (SuitDNA.levelsPerSuit-1) + maxSuitType lastCog = self.cogTypes[dept] >= SuitDNA.suitsPerDept - 1
maxCogLevel = (SuitDNA.levelsPerSuit-1) + self.cogTypes[deptIndex] if not lastCog:
if (cogLevel == maxCogLevel) or (cogLevel == maxSuitLevel): maxLevel = SuitBattleGlobals.SuitAttributes[cogTypeStr]['level'] + 4
self.promotionStatus[deptIndex] = ToontownGlobals.PendingPromotion
self.d_setPromotionStatus(self.promotionStatus)
else: else:
self.cogLevels[deptIndex] += 1 maxLevel = ToontownGlobals.MaxCogSuitLevel
if newLevel > maxLevel:
if not lastCog:
self.cogTypes[dept] += 1
self.d_setCogTypes(self.cogTypes)
cogTypeStr = SuitDNA.suitHeadTypes[self.cogTypes[dept]]
self.cogLevels[dept] = SuitBattleGlobals.SuitAttributes[cogTypeStr]['level']
self.d_setCogLevels(self.cogLevels)
else:
self.cogLevels[dept] += 1
self.d_setCogLevels(self.cogLevels) self.d_setCogLevels(self.cogLevels)
self.cogMerits[deptIndex] = 0 if lastCog:
self.d_setCogMerits(self.cogMerits) if self.cogLevels[dept] in ToontownGlobals.CogSuitHPLevels:
self.air.writeServerEvent( maxHp = self.getMaxHp()
'cogSuit', self.doId, maxHp = min(ToontownGlobals.MaxHpLimit, maxHp + 1)
'%s|%s|%s' % (deptIndex, self.cogTypes[deptIndex], self.cogLevels[deptIndex])) self.b_setMaxHp(maxHp)
self.toonUp(maxHp)
def requestPromotion(self, dept): self.air.writeServerEvent('cogSuit', self.doId, '%s|%s|%s' % (dept, self.cogTypes[dept], self.cogLevels[dept]))
if self.promotionStatus[dept] == ToontownGlobals.PendingPromotion:
self.cogTypes[dept] += 1
self.d_setCogTypes(self.cogTypes)
cogTypeStr = SuitDNA.suitHeadTypes[self.cogTypes[dept]]
self.cogLevels[dept] = SuitBattleGlobals.SuitAttributes[cogTypeStr]['level']
self.d_setCogLevels(self.cogLevels)
self.cogMerits[dept] = 0
self.d_setCogMerits(self.cogMerits)
maxHp = self.getMaxHp()
maxHp = min(ToontownGlobals.MaxHpLimit, maxHp + 1)
self.b_setMaxHp(maxHp)
self.toonUp(maxHp)
self.promotionStatus[dept] = ToontownGlobals.WantPromotion
self.d_setPromotionStatus(self.promotionStatus)
def getNumPromotions(self, dept): def getNumPromotions(self, dept):
if dept not in SuitDNA.suitDepts: if dept not in SuitDNA.suitDepts:
@ -1375,15 +1367,19 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def getCogMerits(self): def getCogMerits(self):
return self.cogMerits return self.cogMerits
def b_promote(self, deptIndex): def b_promote(self, dept):
self.promote(deptIndex) self.promote(dept)
self.d_promote(deptIndex) self.d_promote(dept)
def promote(self, deptIndex): def promote(self, dept):
self.incCogLevel(deptIndex) if self.cogLevels[dept] < ToontownGlobals.MaxCogSuitLevel:
self.cogMerits[dept] = 0
self.incCogLevel(dept)
def d_promote(self, deptIndex): def d_promote(self, dept):
merits = self.getCogMerits() merits = self.getCogMerits()
if self.cogLevels[dept] < ToontownGlobals.MaxCogSuitLevel:
merits[dept] = 0
self.d_setCogMerits(merits) self.d_setCogMerits(merits)
def readyForPromotion(self, dept): def readyForPromotion(self, dept):
@ -1417,19 +1413,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def getCogIndex(self): def getCogIndex(self):
return self.cogIndex return self.cogIndex
def setPromotionStatus(self, status):
self.promotionStatus = status
def d_setPromotionStatus(self, status):
self.sendUpdate('setPromotionStatus', [status])
def b_setPromotionStatus(self, status):
self.setPromotionStatus(status)
self.d_setPromotionStatus(status)
def getPromotionStatus(self):
return self.promotionStatus
def b_setDisguisePageFlag(self, flag): def b_setDisguisePageFlag(self, flag):
self.setDisguisePageFlag(flag) self.setDisguisePageFlag(flag)
self.d_setDisguisePageFlag(flag) self.d_setDisguisePageFlag(flag)
@ -4334,22 +4317,16 @@ def maxToon(missingTrack=None):
invoker.b_setEmoteAccess(emotes) invoker.b_setEmoteAccess(emotes)
# Max out their Cog suits: # Max out their Cog suits:
suitDeptCount = len(SuitDNA.suitDepts) invoker.b_setCogParts(
cogParts = [] [
for i in xrange(suitDeptCount): CogDisguiseGlobals.PartsPerSuitBitmasks[0], # Bossbot
cogParts.append(CogDisguiseGlobals.PartsPerSuitBitmasks[i]) CogDisguiseGlobals.PartsPerSuitBitmasks[1], # Lawbot
invoker.b_setCogParts(cogParts) CogDisguiseGlobals.PartsPerSuitBitmasks[2], # Cashbot
maxSuitType = SuitDNA.suitsPerDept - 1 CogDisguiseGlobals.PartsPerSuitBitmasks[3] # Sellbot
invoker.b_setCogTypes([maxSuitType] * suitDeptCount) ]
maxSuitLevel = (SuitDNA.levelsPerSuit-1) + maxSuitType )
invoker.b_setCogLevels([maxSuitLevel] * suitDeptCount) invoker.b_setCogLevels([49] * 4)
cogMerits = [] invoker.b_setCogTypes([7, 7, 7, 7])
for i in xrange(suitDeptCount):
suitIndex = (SuitDNA.suitsPerDept * (i+1)) - 1
suitMerits = CogDisguiseGlobals.MeritsPerLevel[suitIndex]
cogMerits.append(suitMerits[SuitDNA.levelsPerSuit - 1])
invoker.b_setCogMerits(cogMerits)
invoker.b_setPromotionStatus([1] * suitDeptCount)
# Max their Cog gallery: # Max their Cog gallery:
deptCount = len(SuitDNA.suitDepts) deptCount = len(SuitDNA.suitDepts)

View file

@ -2228,12 +2228,12 @@ RewardPanelCongratsStrings = ['Yeah!',
RewardPanelNewGag = 'New %(gagName)s gag for %(avName)s!' RewardPanelNewGag = 'New %(gagName)s gag for %(avName)s!'
RewardPanelUberGag = '%(avName)s earned the %(gagName)s gag with %(exp)s experience points!' RewardPanelUberGag = '%(avName)s earned the %(gagName)s gag with %(exp)s experience points!'
RewardPanelEndTrack = 'Yay! %(avName)s has reached the end of the %(gagName)s Gag Track!' RewardPanelEndTrack = 'Yay! %(avName)s has reached the end of the %(gagName)s Gag Track!'
RewardPanelPromotionPending = 'Pending promotion...'
RewardPanelMeritsMaxed = 'Maxed' RewardPanelMeritsMaxed = 'Maxed'
RewardPanelMeritBarLabels = ['Stock Options', RewardPanelMeritBarLabels = ['Stock Options',
'Jury Notices', 'Jury Notices',
'Cogbucks', 'Cogbucks',
'Merits'] 'Merits']
RewardPanelMeritAlert = 'Ready for promotion!'
RewardPanelCogPart = 'You gained a Cog disguise part!' RewardPanelCogPart = 'You gained a Cog disguise part!'
RewardPanelPromotion = 'Ready for promotion in %s track!' RewardPanelPromotion = 'Ready for promotion in %s track!'
RewardPanelSkip = 'Skip' RewardPanelSkip = 'Skip'
@ -4693,9 +4693,9 @@ BossBattleHowToGetPies = 'Jump up to touch the cage to get pies.'
BossBattleHowToThrowPies = 'Press the Delete key to throw pies!' BossBattleHowToThrowPies = 'Press the Delete key to throw pies!'
CagedToonYippee = 'Yippee!' CagedToonYippee = 'Yippee!'
CagedToonThankYou = "It's great to be free!\x07Thanks for all your help!\x07I am in your debt.\x07Here's my card. If you ever need a hand in battle, give a shout!\x07Just click on your SOS button." CagedToonThankYou = "It's great to be free!\x07Thanks for all your help!\x07I am in your debt.\x07Here's my card. If you ever need a hand in battle, give a shout!\x07Just click on your SOS button."
CagedToonLevelPromotion = "\x07Say--that V.P. Cog left behind your promotion papers.\x07I'll file them for you on the way out, so you'll get your promotion!" CagedToonPromotion = "\x07Say--that V.P. Cog left behind your promotion papers.\x07I'll file them for you on the way out, so you'll get your promotion!"
CagedToonSuitPromotion = "\x07It seems like you've reached the highest level you can for a %s.\x07You can continue upgrading your Cog suit through the disguise page in your Shticker Book.\x07Along with getting a new Cog suit, you will also get a 1 point Laff boost!" CagedToonLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep rescuing Toons!"
CagedToonLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07I'm pretty sure Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep rescuing Toons!" CagedToonHPBoost = "\x07You've rescued a lot of Toons from this HQ.\x07The Toon Council has decided to give you another Laff point. Congratulations!"
CagedToonMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!' CagedToonMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!'
CagedToonGoodbye = 'See ya!' CagedToonGoodbye = 'See ya!'
CagedToonBattleThree = {10: 'Nice jump, %(toon)s. Here are some pies!', CagedToonBattleThree = {10: 'Nice jump, %(toon)s. Here are some pies!',
@ -4723,9 +4723,8 @@ ResistanceToonMoneyInstructions = 'all the Toons near you will gain %s Jellybean
ResistanceToonMoneyAllInstructions = 'all the Toons near you will fill their Jellybean jars' ResistanceToonMoneyAllInstructions = 'all the Toons near you will fill their Jellybean jars'
ResistanceToonRestockInstructions = 'all the Toons near you will restock their "%s" gags' ResistanceToonRestockInstructions = 'all the Toons near you will restock their "%s" gags'
ResistanceToonRestockAllInstructions = 'all the Toons near you will restock all their gags' ResistanceToonRestockAllInstructions = 'all the Toons near you will restock all their gags'
ResistanceToonLevelPromotion = "\x07Say--that C.F.O. Cog left behind your promotion papers.\x07I'll file them for you on the way out, so you'll get your promotion!" ResistanceToonLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep working for the Resistance!"
ResistanceToonSuitPromotion = "\x07It seems like you've reached the highest level you can for a %s.\x07You can continue upgrading your Cog suit through the disguise page in your Shticker Book.\x07Along with getting a new Cog suit, you will also get a 1 point Laff boost!" ResistanceToonHPBoost = "\x07You've done a lot of work for the Resistance.\x07The Toon Council has decided to give you another Laff point. Congratulations!"
ResistanceToonLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07I'm pretty sure Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep working for the Resistance!!"
ResistanceToonMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!' ResistanceToonMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!'
CashbotBossCogAttack = 'Get them!!!' CashbotBossCogAttack = 'Get them!!!'
ResistanceToonWelcome = 'Hey, you made it! Follow me to the main vault before the C.F.O. finds us!' ResistanceToonWelcome = 'Hey, you made it! Follow me to the main vault before the C.F.O. finds us!'
@ -7524,10 +7523,9 @@ WitnessToonSomeJurors = 'Cool! There are %d Toons in the jury!'
WitnessToonAllJurors = 'Awesome! All the jurors are Toons!' WitnessToonAllJurors = 'Awesome! All the jurors are Toons!'
WitnessToonPrepareBattleThree = 'Hurry, touch the witness stand to get evidence.\x07Press the Delete key to throw the evidence at the lawyers, or at the defense pan.' WitnessToonPrepareBattleThree = 'Hurry, touch the witness stand to get evidence.\x07Press the Delete key to throw the evidence at the lawyers, or at the defense pan.'
WitnessToonCongratulations = "You did it! Thank you for a spectacular defense!\x07Here, take these papers the Chief Justice left behind.\x07With it you'll be able to summon Cogs from your Cog Gallery page." WitnessToonCongratulations = "You did it! Thank you for a spectacular defense!\x07Here, take these papers the Chief Justice left behind.\x07With it you'll be able to summon Cogs from your Cog Gallery page."
WitnessToonLevelPromotion = "\x07Say--that C.J. Cog left behind your promotion papers.\x07I'll file them for you on the way out, so you'll get your promotion!" WitnessToonLastPromotion = "\x07Wow, you've reached level %s on your Cog Suit!\x07Cogs don't get promoted higher than that.\x07You can't upgrade your Cog Suit anymore, but you can certainly keep working for the Resistance!"
WitnessToonSuitPromotion = "\x07It seems like you've reached the highest level you can for a %s.\x07You can continue upgrading your Cog suit through the disguise page in your Shticker Book.\x07Along with getting a new Cog suit, you will also get a 1 point Laff boost!" WitnessToonHPBoost = "\x07You've done a lot of work for the Resistance.\x07The Toon Council has decided to give you another Laff point. Congratulations!"
WitnessToonLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07I'm pretty sure Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep working for the Resistance!!" WitnessToonMaxed = '\x07I see that you have a level %s Cog Suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to defend more Toons!'
WitnessToonMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!'
WitnessToonBonus = 'Wonderful! All the lawyers are stunned. Your evidence weight is %s times heavier for %s seconds' WitnessToonBonus = 'Wonderful! All the lawyers are stunned. Your evidence weight is %s times heavier for %s seconds'
WitnessToonJuryWeightBonusSingular = {6: 'This is a tough case. You seated %d Toon juror, so your evidence has a bonus weight of %d.', WitnessToonJuryWeightBonusSingular = {6: 'This is a tough case. You seated %d Toon juror, so your evidence has a bonus weight of %d.',
7: 'This is a very tough case. You seated %d Toon juror, so your evidence has a bonus weight of %d.', 7: 'This is a very tough case. You seated %d Toon juror, so your evidence has a bonus weight of %d.',
@ -8067,10 +8065,9 @@ BossbotGolfSpotAdvice = 'Use the left and right keys to rotate.\nCtrl to fire.'
BossbotRewardSpeech1 = "No! The Chairman won't like this." BossbotRewardSpeech1 = "No! The Chairman won't like this."
BossbotRewardSpeech2 = 'Arrrggghhh!!!!' BossbotRewardSpeech2 = 'Arrrggghhh!!!!'
BossbotRTCongratulations = "You did it! You've demoted the C.E.O.!\x07Here, take these pink slips the C.E.O. left behind.\x07With it you'll be able to fire Cogs in a battle." BossbotRTCongratulations = "You did it! You've demoted the C.E.O.!\x07Here, take these pink slips the C.E.O. left behind.\x07With it you'll be able to fire Cogs in a battle."
BossbotRTLevelPromotion = "\x07Say--that C.E.O. Cog left behind your promotion papers.\x07I'll file them for you on the way out, so you'll get your promotion!" BossbotRTHPBoost = "\x07You've done a lot of work for the Resistance.\x07The Toon Council has decided to give you another Laff point. Congratulations!"
BossbotRTSuitPromotion = "\x07It seems like you've reached the highest level you can for a %s.\x07You can continue upgrading your Cog suit through the disguise page in your Shticker Book.\x07Along with getting a new Cog suit, you will also get a 1 point Laff boost!" BossbotRTMaxed = '\x07I see that you have a level %s Cog Suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to defend more Toons!'
BossbotRTLastPromotion = "\x07Wow, you've reached level %s on your Cog suit!\x07I'm pretty sure Cogs don't get promoted higher than that.\x07You can't upgrade your Cog suit anymore, but you can certainly keep working for the Resistance!!" BossbotRTLastPromotion = "\x07Wow, you've reached level %s on your Cog Suit!\x07Cogs don't get promoted higher than that.\x07You can't upgrade your Cog Suit anymore, but you can certainly keep working for the Resistance!"
BossbotRTMaxed = '\x07I see that you have a level %s Cog suit. Very impressive!\x07On behalf of the Toon Council, thank you for coming back to rescue more Toons!'
GolfAreaAttackTaunt = 'Fore!' GolfAreaAttackTaunt = 'Fore!'
OvertimeAttackTaunts = ["It's time to reorganize.", "Now let's downsize."] OvertimeAttackTaunts = ["It's time to reorganize.", "Now let's downsize."]
ElevatorBossBotBoss = 'Bossbot Clubhouse' ElevatorBossBotBoss = 'Bossbot Clubhouse'

View file

@ -14,8 +14,6 @@ CFOElevatorFov = 43.0
CJElevatorFov = 59.0 CJElevatorFov = 59.0
CEOElevatorFov = 59.0 CEOElevatorFov = 59.0
CBElevatorFov = 42.0 CBElevatorFov = 42.0
WantPromotion = 0
PendingPromotion = 1
CeilingBitmask = BitMask32(256) CeilingBitmask = BitMask32(256)
FloorEventBitmask = BitMask32(16) FloorEventBitmask = BitMask32(16)
PieBitmask = BitMask32(256) PieBitmask = BitMask32(256)
@ -99,11 +97,16 @@ FM_RecoveredItem = 4
SPDonaldsBoat = 3 SPDonaldsBoat = 3
SPMinniesPiano = 4 SPMinniesPiano = 4
CEVirtual = 14 CEVirtual = 14
MaxHpLimit = 145 MaxHpLimit = 137
MaxCarryLimit = 80 MaxCarryLimit = 80
MaxQuestCarryLimit = 4 MaxQuestCarryLimit = 4
GravityValue = 32.174 GravityValue = 32.174
MaxCogSuitLevel = 12 - 1 MaxCogSuitLevel = 50 - 1
CogSuitHPLevels = (15 - 1,
20 - 1,
30 - 1,
40 - 1,
50 - 1)
setInterfaceFont(TTLocalizer.InterfaceFont) setInterfaceFont(TTLocalizer.InterfaceFont)
setSignFont(TTLocalizer.SignFont) setSignFont(TTLocalizer.SignFont)
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog