Great progress indeed.

This commit is contained in:
Loudrob 2015-03-27 19:25:31 -04:00
parent 83b204098c
commit 8374e30b74
16 changed files with 159 additions and 42 deletions

View file

@ -1067,6 +1067,7 @@ dclass DistributedToon : DistributedPlayer {
setAnimalSound(uint8 index) ram broadcast ownrecv;
setBuffs(uint32[] = []) required ownrecv db;
setRedeemedCodes(string [] = []) required ownrecv db;
setEmblems(uint32[] = [0, 0]) required ownrecv db;
};
dclass DistributedCCharBase : DistributedObject {

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import *
hashVal = 930195805
hashVal = 3216321797L
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

@ -82,6 +82,7 @@ class ToontownAIRepository(ToontownInternalRepository):
self.wantHousing = self.config.GetBool('want-housing', True)
self.wantPets = self.config.GetBool('want-pets', True)
self.wantParties = self.config.GetBool('want-parties', True)
self.wantEmblems = self.config.GetBool('want-emblems', True)
self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.doLiveUpdates = self.config.GetBool('want-live-updates', False)

View file

@ -150,7 +150,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
self.track = track
self.realTrack = track
self.difficulty = difficulty
self.numFloors = numFloors
self.numFloors = 0
self.becameSuitTime = time.time()
self.fsm.request('clearOutToonInteriorForCogdo')
@ -321,25 +321,38 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
toon = None
if t:
toon = self.getToon(t)
if toon is not None:
if toon != None:
activeToons.append(toon)
continue
for t in victorList:
toon = None
if t:
toon = self.getToon(t)
self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track, self.numFloors, self.zoneId, victorList))
if toon is not None:
self.air.questManager.toonKilledCogdo(toon, self.difficulty, self.numFloors, self.zoneId, activeToons)
for i in xrange(0, 4):
if toon != None:
#self.air.questManager.toonKilledCogdo(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons)
continue
victorList.extend([None, None, None, None])
for i in range(0, 4):
victor = victorList[i]
if (victor is None) or (victor not in self.air.doId2do):
if victor == None or not self.air.doId2do.has_key(victor):
victorList[i] = 0
continue
event = self.air.getAvatarExitEvent(victor)
self.accept(event, self.setVictorExited, extraArgs = [victor])
self.b_setVictorList(victorList)
self.accept(event, self.setVictorExited, extraArgs = [
victor])
self.b_setVictorList(victorList[:4])
self.updateSavedBy(savedBy)
self.victorResponses = [0, 0, 0, 0]
self.victorResponses = [
0,
0,
0,
0]
self.d_setState('waitForVictorsFromCogdo')
def exitWaitForVictorsFromCogdo(self):

View file

@ -8,6 +8,7 @@ ELEVATOR_OFFICE = 5
ELEVATOR_STAGE = 6
ELEVATOR_BB = 7
ELEVATOR_COUNTRY_CLUB = 8
ELEVATOR_FIELD = 9
REJECT_NOREASON = 0
REJECT_SHUFFLE = 1
REJECT_MINLAFF = 2
@ -80,7 +81,14 @@ ElevatorData = {ELEVATOR_NORMAL: {'openTime': 2.0,
'width': 5.875,
'countdown': bboard.get('elevatorCountdown', 15.0),
'sfxVolume': 1.0,
'collRadius': 4}}
'collRadius': 4},
ELEVATOR_FIELD: {'openTime': 2.0,
'closeTime': 2.0,
'width': 3.5,
'countdown': bboard.get('elevatorCountdown', 15.0),
'sfxVolume': 1.0,
'collRadius': 5.6}}
TOON_BOARD_ELEVATOR_TIME = 1.0
TOON_EXIT_ELEVATOR_TIME = 1.0
TOON_VICTORY_EXIT_TIME = 1.0

View file

@ -0,0 +1,69 @@
import CatalogItem
from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil
from direct.gui.DirectGui import *
from toontown.toonbase import ToontownGlobals
from toontown.estate import HouseGlobals
class CatalogHouseItem(CatalogItem.CatalogItem):
def makeNewItem(self, houseId):
self.houseId = houseId
CatalogItem.CatalogItem.makeNewItem(self)
def notOfferedTo(self, avatar):
return 1
def requestPurchase(self, phone, callback):
from toontown.toontowngui import TTDialog
avatar = base.localAvatar
self.requestPurchaseCleanup()
buttonCallback = PythonUtil.Functor(self.__handleFullPurchaseDialog, phone, callback)
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.CatalogPurchaseHouseType, text_wordwrap=15, command=buttonCallback)
self.dialog.show()
def requestPurchaseCleanup(self):
if hasattr(self, 'dialog'):
self.dialog.cleanup()
del self.dialog
def __handleFullPurchaseDialog(self, phone, callback, buttonValue):
from toontown.toontowngui import TTDialog
self.requestPurchaseCleanup()
if buttonValue == DGG.DIALOG_OK:
CatalogItem.CatalogItem.requestPurchase(self, phone, callback)
else:
callback(ToontownGlobals.P_UserCancelled, self)
def getTypeName(self):
return "House Type"
def getName(self):
return TTLocalizer.HouseNames[self.houseId]
def getEmblemPrices(self):
return HouseGlobals.HouseEmblemPrices[self.houseId]
def getPicture(self, avatar):
model = loader.loadModel(HouseGlobals.houseModels[self.houseId])
model.setBin('unsorted', 0, 1)
self.hasPicture = True
return self.makeFrameModel(model)
def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.houseId = di.getUint8()
def encodeDatagram(self, dg, store):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint8(self.houseId)
def recordPurchase(self, av, optional):
house = simbase.air.doId2do.get(av.getHouseId())
if house:
house.b_setHouseType(self.houseId)
return ToontownGlobals.P_ItemAvailable
def getAllHouses():
return [CatalogHouseItem(i) for i in xrange(6)]

View file

@ -323,6 +323,8 @@ class CatalogItemPanel(DirectFrame):
self.buyButton['state'] = DGG.DISABLED
elif self['item'].getEmblemPrices() and not base.localAvatar.isEnoughMoneyAndEmblemsToBuy(self['item'].getPrice(self['type']), self['item'].getEmblemPrices()):
self.buyButton['state'] = DGG.DISABLED
elif self['item'].__class__.__name__ == "CatalogHouseItem" and self['item'].houseId == localAvatar.houseType:
auxText = TTLocalizer.CatalogPurchasedMaxText
elif self['item'].getPrice(self['type']) <= base.localAvatar.getMoney() + base.localAvatar.getBankMoney():
self.buyButton['state'] = DGG.NORMAL
self.buyButton.show()

View file

@ -18,6 +18,7 @@ import CatalogNametagItem
import CatalogToonStatueItem
import CatalogAnimatedFurnitureItem
import CatalogAccessoryItem
import CatalogHouseItem
INVALID_ITEM = 0
FURNITURE_ITEM = 1
CHAT_ITEM = 2
@ -38,6 +39,7 @@ NAMETAG_ITEM = 16
TOON_STATUE_ITEM = 17
ANIMATED_FURNITURE_ITEM = 18
ACCESSORY_ITEM = 19
HOUSE_ITEM = 20
NonPermanentItemTypes = (RENTAL_ITEM,)
CatalogItemTypes = {CatalogInvalidItem.CatalogInvalidItem: INVALID_ITEM,
CatalogFurnitureItem.CatalogFurnitureItem: FURNITURE_ITEM,
@ -58,7 +60,8 @@ CatalogItemTypes = {CatalogInvalidItem.CatalogInvalidItem: INVALID_ITEM,
CatalogNametagItem.CatalogNametagItem: NAMETAG_ITEM,
CatalogToonStatueItem.CatalogToonStatueItem: TOON_STATUE_ITEM,
CatalogAnimatedFurnitureItem.CatalogAnimatedFurnitureItem: ANIMATED_FURNITURE_ITEM,
CatalogAccessoryItem.CatalogAccessoryItem: ACCESSORY_ITEM}
CatalogAccessoryItem.CatalogAccessoryItem: ACCESSORY_ITEM,
CatalogHouseItem.CatalogHouseItem: HOUSE_ITEM}
CatalogItemType2multipleAllowed = {INVALID_ITEM: False,
FURNITURE_ITEM: True,
CHAT_ITEM: False,
@ -78,7 +81,8 @@ CatalogItemType2multipleAllowed = {INVALID_ITEM: False,
NAMETAG_ITEM: False,
TOON_STATUE_ITEM: False,
ANIMATED_FURNITURE_ITEM: True,
ACCESSORY_ITEM: False}
ACCESSORY_ITEM: False,
HOUSE_ITEM: False}
SingleCodeRedemption = (BEAN_ITEM,)
CatalogItemTypeMask = 31
CatalogItemSaleFlag = 128

View file

@ -929,6 +929,12 @@ class CatalogScreen(DirectFrame):
if retCode == ToontownGlobals.P_UserCancelled:
self.update()
return
if item.__class__.__name__ == "CatalogHouseItem":
if retCode == ToontownGlobals.P_ItemAvailable:
localAvatar.houseType = item.houseId
self.update()
self.setClarabelleChat(item.getRequestPurchaseErrorText(retCode), item.getRequestPurchaseErrorTextTimeout())
def __handleGiftPurchaseResponse(self, retCode, item):

View file

@ -86,13 +86,13 @@ class CogdoBarrelRoomIntro(CogdoGameMovie):
def start():
self.frame.show()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0)
def end():
self._dialogueLabel.reparentTo(hidden)
self.toonHead.reparentTo(hidden)
self.frame.hide()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1)
self._stopUpdateTask()
self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Wait(CogdoBarrelRoomConsts.BarrelRoomIntroTimeout), Func(end))

View file

@ -87,13 +87,13 @@ class CogdoElevatorMovie(CogdoGameMovie):
def start():
self.frame.show()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0)
def end():
self._dialogueLabel.reparentTo(hidden)
self.toonHead.reparentTo(hidden)
self.frame.hide()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1)
self._stopUpdateTask()
self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Wait(self.elevatorDuration), Func(end))

View file

@ -91,7 +91,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie):
def start():
self.frame.show()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 0)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 0)
def showShopOwner():
self._setCamTarget(self._shopOwner, -10, offset=Point3(0, 0, 5))
@ -100,7 +100,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie):
self._dialogueLabel.reparentTo(hidden)
self.toonHead.reparentTo(hidden)
self.frame.hide()
base.setCellsAvailable(base.bottomCells + base.leftCells + base.rightCells, 1)
base.setCellsActive(base.bottomCells + base.leftCells + base.rightCells, 1)
self._stopUpdateTask()
self._ival = Sequence(Func(start), Func(self.displayLine, dialogue), Func(showShopOwner), ParallelEndTogether(camera.posInterval(self.cameraMoveDuration, Point3(8, 0, 13), blendType='easeInOut'), camera.hprInterval(0.5, self._camHelperNode.getHpr(), blendType='easeInOut')), Wait(self.introDuration), Func(end))

View file

@ -3,6 +3,7 @@ from toontown.suit import SuitDNA
from direct.directnotify import DirectNotifyGlobal
from toontown.suit import DistributedSuitAI
from toontown.building import SuitBuildingGlobals
from toontown.suit.SuitInvasionGlobals import IFSkelecog, IFWaiter, IFV2
import types, math, random
BASE_RESERVE = 10
@ -137,25 +138,32 @@ class SuitPlannerCogdoInteriorAI:
return lvlList
def __setupSuitInfo(self, suit, bldgTrack, suitLevel, suitType):
suitName, skeleton = simbase.air.suitInvasionManager.getInvadingCog()
if suitName and self.respectInvasions:
suitDeptIndex, suitTypeIndex, flags = simbase.air.suitInvasionManager.getInvadingCog()
if self.respectInvasions:
if suitDeptIndex is not None:
bldgTrack = SuitDNA.suitDepts[suitDeptIndex]
if suitTypeIndex is not None:
suitName = SuitDNA.getSuitName(suitDeptIndex, suitTypeIndex)
suitType = SuitDNA.getSuitType(suitName)
bldgTrack = SuitDNA.getSuitDept(suitName)
suitLevel = min(max(suitLevel, suitType), suitType + 4)
dna = SuitDNA.SuitDNA()
dna.newSuitRandom(suitType, bldgTrack)
suit.dna = dna
self.notify.debug('Creating suit type ' + suit.dna.name + ' of level ' + str(suitLevel) + ' from type ' + str(suitType) + ' and track ' + str(bldgTrack))
suit.setLevel(suitLevel)
return skeleton
return flags
def __genSuitObject(self, suitZone, suitType, bldgTrack, suitLevel, revives = 0):
newSuit = DistributedSuitAI.DistributedSuitAI(simbase.air, None)
skel = self.__setupSuitInfo(newSuit, bldgTrack, suitLevel, suitType)
if skel:
flags = self.__setupSuitInfo(newSuit, bldgTrack, suitLevel, suitType)
if flags & IFSkelecog:
newSuit.setSkelecog(1)
newSuit.setSkeleRevives(revives)
newSuit.generateWithRequired(suitZone)
if flags & IFWaiter:
newSuit.b_setWaiter(1)
if flags & IFV2:
newSuit.b_setSkeleRevives(1)
newSuit.node().setName('suit-%s' % newSuit.doId)
return newSuit

View file

@ -2427,6 +2427,8 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
return True
def tossPie(self, x, y, z, h, p, r, sequence, power, timestamp32):
if not self.validate(self.doId, self.numPies > 0, 'tossPie with no pies available'):
return

Binary file not shown.

View file

@ -9668,22 +9668,23 @@ BoardroomGameTitle = 'Boardroom Hijinks'
BoardroomGameInstructions = 'The COGS are having a meeting to decide what to do with stolen gags. Slide on through and grab as many gag-destruction memos as you can!'
CogdoCraneGameTitle = 'Vend-A-Stomper'
CogdoCraneGameInstructions = 'The COGS are using a coin-operated machine to destroy laff barrels. Use the cranes to pick up and throw money bags, in order to prevent barrel destruction!'
CogdoMazeGameTitle = 'Mover & Shaker\nField Office'
CogdoMazeGameInstructions = 'The big Mover & Shaker Cogs have the code to open the door. Defeat them with your water balloons in order to get it!'
CogdoMazeIntroMovieDialogue = (("This is the Toon Resistance! The Movers & Shakers\nhave our Jokes, and they've locked the exit!",), ('Grab water balloons at coolers, and throw them at Cogs!\nSmall Cogs drop Jokes, BIG COGS open the exit.',), ('The more Jokes you rescue, the bigger your Toon-Up\nat the end. Good luck!',))
CogdoMazeGameDoorOpens = 'THE EXIT IS OPEN FOR 60 SECONDS!\nGET THERE FAST FOR A BIGGER TOON-UP'
CogdoMazeGameTitle = 'Moving & Shaking Dept.'
CogdoMazeGameInstructions = 'The big Mover & Shaker COGs have the code to open the door. Defeat them with your water balloons in order to get it!'
CogdoMazeIntroMovieDialogue = (("This should give you Toons a shiver! We're powering our offices with your Jokes, and yo're powerless to stop us!", "This will make you Toons quake! We've stolen yo're Jokes, and you cannot stop us!", "This may come as an aftershock, but we've stolen your Jokes, and there's nothing you can do about it!"), ("Don't get rattled, Toons! Fill your water balloons, splash the BIG COGs, and retrieve the PASS CODE that opens the exit! Good luck from the Toon Resistance!", 'Are you ready to rumble, Toons? Go to the water coolers and fill up balloons to throw at COGs. Hit the BIG COGs to get the pass code for the exit! Toon Resistance out!', 'Want some good vibrations? Fill your balloons at the water coolers, splash the BIG Movers & Shakers, complete the PASS CODE, and find the way out! Good luck, Toons!'), ("Hmph! I'm a Silver Sprocket Award winner, I don't need this!", "Yo're on shaky ground, Toons!", "Before you know it, you'll all be trembling!"))
CogdoMazeGameDoorOpens = "The Pass Code opened the Exit!\nGet there before it's too late!"
CogdoMazeGameLocalToonFoundExit = "The exit will open when\nyou've busted all four BIG COGS!"
CogdoMazeGameWaitingForToons = 'Waiting for other Toons...'
CogdoMazeGameTimeOut = 'Oh no, time ran out! You lost your jokes.'
CogdoMazeGameTimeAlert = 'Hurry up! 60 seconds to go!'
CogdoMazeGameBossGuiTitle = 'BIG COGS:'
CogdoMazeFindHint = 'Find a Water Cooler'
CogdoMazeGameBossGuiTitle = 'Pass Code:'
CogdoMazeFindHint = 'Find a Water Cooler!'
CogdoMazeThrowHint = "Press 'Ctrl' to throw your water balloon"
CogdoMazeSquashHint = 'Falling objects pop your balloon'
CogdoMazeBossHint = 'Big Cogs take TWO hits to defeat'
CogdoMazeMinionHint = 'Smaller Cogs drop jokes'
CogdoMazeBossHint = 'Big COGs take TWO hits to defeat'
CogdoMazeMinionHint = 'Minions drop bonus Jokes!'
CogdoMazeGameElevatorRewardLaff = 'Great job, Toons!\nYou get a Toon-Up from the jokes you saved!'
CogdoFlyingGameTitle = 'Legal Eagle Offices'
CogdoFlyingGameInstructions = "Fly through the Legal Eagles' lair. Watch out for obstacles and cogs along the way, and don't forget to refuel your helicopter!"
CogdoFlyingGameInstructions = "Fly through the Legal Eagles' lair. Watch out for obstacles and COGs along the way, and don't forget to refuel your helicopter!"
CogdoFlyingIntroMovieDialogue = (("You won't ruffle our feathers, Toons! We're destroying barrels of your Laff, and you cannot stop us!", "A flock of Toons! We're crushing barrels of your Laff in our %s, and there's nothing you can do about it!" % CogdoStomperName, "You can't egg us on, Toons! We're powering our offices with your Laff, and you're powerless to stop us!"), ('This is the Toon Resistance! A little bird told me you can use propellers to fly around, grab Barrel Destruction Memos, and keep Laff from being destroyed! Good luck, Toons!', 'Attention Toons! Wing it with a propeller and collect Barrel Destruction Memos to keep our Laff from being stomped! Toon Resistance out!', 'Toon Resistance here! Cause a flap by finding propellers, flying to the Barrel Destruction Memos, and keeping our Laff from being smashed! Have fun!'), ("Squawk! I'm a Silver Sprocket Award winner, I don't need this!", 'Do your best, Toons! You will find us to be quite talon-ted!', "We'll teach you to obey the pecking order, Toons!"))
CogdoFlyingGameWaiting = 'Waiting for other Toons%s'
CogdoFlyingGameFuelLabel = 'Fuel'
@ -9699,10 +9700,12 @@ CogdoFlyingGameOutOfTime = 'Oh No! You ran out of time!'
CogdoFlyingGameYouMadeIt = 'You made it on time!'
CogdoFlyingGameYouMadeIt = 'Good work, you made it on time!'
CogdoFlyingGameTakingMemos = 'The legal eagles took all your memos!'
CogdoElevatorRewardLaff = 'Great job, Toons!\nYou get a Toon-Up from the jokes you saved!'
CogdoBarrelRoomTitle = 'Stomper Room'
CogdoBarrelRoomIntroDialog = 'Good work, Toons! You have haulted the stompers and are now able to collect some of the stolen laff barrels, but make sure to hurry before the COGs come!'
CogdoExecutiveSuiteTitle = 'Executive Suite'
CogdoExecutiveSuiteIntroMessage = "Oh no, they've got the shop keeper!\nDefeat the Cogs and free the captive."
CogdoExecutiveSuiteIntroMessage = "Oh no, they've got the shop keeper!\nDefeat the COGs and free the captive."
CogdoExecutiveSuiteToonThankYou = 'Thanks for the rescue!\nIf you need help in a fight, use this SOS card to call my friend %s.'
CogdoExecutiveSuiteToonThankYouLawbot = 'Thanks for the rescue!\nThe Lawbots have left behind some sprocket awards that you can use to buy new things in your cattlelog!'
CogdoExecutiveSuiteToonBye = 'Bye!'
SillySurgeTerms = {1: 'Amusing Ascent!',
2: 'Silly Surge!',