diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index c9a94df2..5db015ae 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -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 { @@ -2160,6 +2161,7 @@ dclass DistCogdoFlyingGame : DistCogdoGame { dclass DistCogdoBoardroomGame : DistCogdoLevelGame { }; + dclass DistributedHQInterior : DistributedObject { setZoneIdAndBlock(uint32, uint16) required broadcast ram; setLeaderBoard(blob) required broadcast ram; diff --git a/config/release/dev.prc b/config/release/dev.prc index 275b7fe8..7ac6a986 100644 --- a/config/release/dev.prc +++ b/config/release/dev.prc @@ -21,7 +21,8 @@ dc-file astron/dclass/united.dc # Core features: want-pets #t want-parties #t -want-cogdominiums #f +want-cogdominiums #t +want-lawbot-cogdo #t want-achievements #f # Chat: @@ -37,4 +38,6 @@ want-glove-npc #t # Developer options: show-population #t -want-instant-parties #t \ No newline at end of file +want-instant-parties #t +cogdo-pop-factor 1.5 +cogdo-ratio 0.5 \ No newline at end of file diff --git a/config/release/test.prc b/config/release/test.prc index a7f318d7..4f3287ec 100644 --- a/config/release/test.prc +++ b/config/release/test.prc @@ -11,7 +11,8 @@ shard-mid-pop 150 want-housing #t want-pets #f want-parties #t -want-cogdominiums #f +want-cogdominiums #t +want-lawbot-cogdo #f want-achievements #f boarding-group-merges #t @@ -21,6 +22,8 @@ disable-sos-card 91918 # Optional: want-chestnut-park-construction #t +cogdo-pop-factor 1.5 +cogdo-ratio 0.4 # Temporary: want-phone-quest #f diff --git a/darwin/start-game-localhost.sh b/darwin/start-game-localhost.sh old mode 100644 new mode 100755 diff --git a/findterm.py b/findterm.py new file mode 100644 index 00000000..513f7426 --- /dev/null +++ b/findterm.py @@ -0,0 +1,19 @@ +import glob + +def processFile(f,t): + data = open(f,'rb').read() + lines = data.replace('\r\n','\n').split('\n') + lines_found = [] + for i,x in enumerate(lines): + if t in x: + lines_found.append(i+1) + + return lines_found + +term = raw_input('>') +for x in glob.glob('toontown/*/*.py'): + r = processFile(x,term) + if r: + print x,r + +raw_input('*****') \ No newline at end of file diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 666f16d8..f0e371ae 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -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 diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 35c96eff..e4d77978 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -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) diff --git a/toontown/building/DistributedBuilding.py b/toontown/building/DistributedBuilding.py index bcb64bb5..323d21fe 100644 --- a/toontown/building/DistributedBuilding.py +++ b/toontown/building/DistributedBuilding.py @@ -18,8 +18,9 @@ from toontown.distributed import DelayDelete from toontown.toon import TTEmote from otp.avatar import Emote from toontown.hood import ZoneUtil +import sys FO_DICT = {'s': 'tt_m_ara_cbe_fieldOfficeMoverShaker', - 'l': 'tt_m_ara_cbe_fieldOfficeMoverShaker', + 'l': 'tt_m_ara_cbe_fieldOfficeLegalEagle', 'm': 'tt_m_ara_cbe_fieldOfficeMoverShaker', 'c': 'tt_m_ara_cbe_fieldOfficeMoverShaker'} @@ -537,6 +538,8 @@ class DistributedBuilding(DistributedObject.DistributedObject): dnaStore = self.cr.playGame.dnaStore level = int(self.difficulty / 2) + 1 suitNP = dnaStore.findNode(FO_DICT[chr(self.track)]) + if not suitNP: + suitNP = loader.loadModel('phase_5/models/cogdominium/%s' % FO_DICT[chr(self.track)]) zoneId = dnaStore.getZoneFromBlockNumber(self.block) zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId) newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId] @@ -551,7 +554,7 @@ class DistributedBuilding(DistributedObject.DistributedObject): textNode.setFont(ToontownGlobals.getSuitFont()) textNode.setAlign(TextNode.ACenter) textNode.setWordwrap(12.0) - textNode.setText(buildingTitle) + textNode.setText(buildingTitle.decode(sys.getdefaultencoding())) textHeight = textNode.getHeight() zScale = (textHeight + 2) / 3.0 signOrigin = suitBuildingNP.find('**/sign_origin;+s') @@ -562,12 +565,12 @@ class DistributedBuilding(DistributedObject.DistributedObject): signTextNodePath = backgroundNP.attachNewNode(textNode.generate()) signTextNodePath.setPosHprScale(0.0, 0.0, -0.13 + textHeight * 0.1 / zScale, 0.0, 0.0, 0.0, 0.1 * 8.0 / 20.0, 0.1, 0.1 / zScale) signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0) - frontNP = suitBuildingNP.find('**/*_front/+GeomNode;+s') + frontNP = suitBuildingNP.find('**/*_front') backgroundNP.wrtReparentTo(frontNP) frontNP.node().setEffect(DecalEffect.make()) suitBuildingNP.setName('cb' + str(self.block) + ':_landmark__DNARoot') suitBuildingNP.setPosHprScale(nodePath, 15.463, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) - suitBuildingNP.flattenMedium() + #suitBuildingNP.flattenMedium() suitBuildingNP.setColorScale(0.6, 0.6, 0.6, 1.0) self.loadElevator(suitBuildingNP, cogdo=True) return suitBuildingNP diff --git a/toontown/building/DistributedBuildingAI.py b/toontown/building/DistributedBuildingAI.py index 73e2969f..3a75b4e9 100644 --- a/toontown/building/DistributedBuildingAI.py +++ b/toontown/building/DistributedBuildingAI.py @@ -19,6 +19,7 @@ from otp.ai.AIBaseGlobal import * from toontown.cogdominium.CogdoLayout import CogdoLayout from toontown.cogdominium.DistributedCogdoElevatorExtAI import DistributedCogdoElevatorExtAI from toontown.cogdominium.DistributedCogdoInteriorAI import DistributedCogdoInteriorAI +from toontown.cogdominium.CogdoLayout import CogdoLayout from toontown.cogdominium.SuitPlannerCogdoInteriorAI import SuitPlannerCogdoInteriorAI from toontown.hood import ZoneUtil from toontown.toonbase.ToontownGlobals import ToonHall @@ -65,6 +66,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): ], 'off', 'off') self.fsm.enterInitialState() self.track = 'c' + self.realTrack = 'c' self.difficulty = 1 self.numFloors = 0 self.savedBy = None @@ -138,20 +140,17 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): self.becameSuitTime = time.time() self.fsm.request('clearOutToonInterior') - def cogdoTakeOver(self, difficulty, buildingHeight): + def cogdoTakeOver(self, difficulty, buildingHeight, track = 's'): + print 'Building %s (%s): cogdoTakeOver' % (self.doId, self.zoneId) if not self.isToonBlock(): - return + return None + self.updateSavedBy(None) - (minFloors, maxFloors) = self._getMinMaxFloors(difficulty) - if buildingHeight is None: - numFloors = random.randint(minFloors, maxFloors) - else: - numFloors = buildingHeight + 1 - if (numFloors < minFloors) or (numFloors > maxFloors): - numFloors = random.randint(minFloors, maxFloors) - self.track = 'c' + + self.track = track + self.realTrack = track self.difficulty = difficulty - self.numFloors = numFloors + self.numFloors = 0 self.becameSuitTime = time.time() self.fsm.request('clearOutToonInteriorForCogdo') @@ -322,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): @@ -473,7 +485,10 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): return Task.done def enterBecomingCogdo(self): - self.sendUpdate('setSuitData', [ord(self.track), self.difficulty, self.numFloors]) + self.sendUpdate('setSuitData', [ + ord(self.realTrack), + self.difficulty, + self.numFloors]) self.d_setState('becomingCogdo') name = self.taskName(str(self.block) + '_becomingCogdo-timer') taskMgr.doMethodLater(SuitBuildingGlobals.TO_SUIT_BLDG_TIME, self.becomingCogdoTask, name) @@ -497,7 +512,10 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): return Task.done def enterCogdo(self): - self.sendUpdate('setSuitData', [ord(self.track), self.difficulty, self.numFloors]) + self.sendUpdate('setSuitData', [ + ord(self.realTrack), + self.difficulty, + self.numFloors]) (zoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() self._cogdoLayout = CogdoLayout(self.numFloors) self.planner = SuitPlannerCogdoInteriorAI(self._cogdoLayout, self.difficulty, self.track, interiorZoneId) @@ -505,7 +523,6 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId() self.elevator = DistributedCogdoElevatorExtAI(self.air, self) self.elevator.generateWithRequired(exteriorZoneId) - self.air.writeServerEvent('building-cogdo', self.doId, '%s|%s|%s' % (self.zoneId, self.block, self.numFloors)) def exitCogdo(self): del self.planner @@ -520,7 +537,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): return DistributedSuitInteriorAI.DistributedSuitInteriorAI(self.air, self.elevator) def _createCogdoInterior(self): - return DistributedCogdoInteriorAI(self.air, self.elevator) + return DistributedCogdoInteriorAI(self.air, self) def createSuitInterior(self): self.interior = self._createSuitInterior() @@ -531,8 +548,8 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI): def createCogdoInterior(self): self.interior = self._createCogdoInterior() (dummy, interiorZoneId) = self.getExteriorAndInteriorZoneId() - self.interior.fsm.request('WaitForAllToonsInside') self.interior.generateWithRequired(interiorZoneId) + self.interior.b_setState('WaitForAllToonsInside') def deleteSuitInterior(self): if hasattr(self, 'interior'): diff --git a/toontown/building/DistributedElevatorInt.py b/toontown/building/DistributedElevatorInt.py index b36b686e..16a242b7 100644 --- a/toontown/building/DistributedElevatorInt.py +++ b/toontown/building/DistributedElevatorInt.py @@ -11,6 +11,8 @@ from direct.fsm import State from toontown.hood import ZoneUtil from toontown.toonbase import TTLocalizer +from toontown.cogdominium.CogdoInterior import CogdoInterior + class DistributedElevatorInt(DistributedElevator.DistributedElevator): def __init__(self, cr): @@ -22,6 +24,9 @@ class DistributedElevatorInt(DistributedElevator.DistributedElevator): self.rightDoor = self.bldg.rightDoorOut DistributedElevator.DistributedElevator.setupElevator(self) + if isinstance(base.cr.playGame.getPlace(), CogdoInterior): + self.elevatorSphereNodePath.setY(self.elevatorSphereNodePath, -3) + def forcedExit(self, avId): target_sz = base.localAvatar.defaultZone base.cr.playGame.getPlace().fsm.request('teleportOut', [{'loader': ZoneUtil.getLoaderName(target_sz), diff --git a/toontown/building/ElevatorConstants.py b/toontown/building/ElevatorConstants.py index a8bbcb26..37119887 100644 --- a/toontown/building/ElevatorConstants.py +++ b/toontown/building/ElevatorConstants.py @@ -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 diff --git a/toontown/building/SuitBuildingGlobals.py b/toontown/building/SuitBuildingGlobals.py index 63dd8d5b..61fd40dc 100644 --- a/toontown/building/SuitBuildingGlobals.py +++ b/toontown/building/SuitBuildingGlobals.py @@ -166,45 +166,45 @@ CLEAR_OUT_TOON_BLDG_TIME = 4 TO_SUIT_BLDG_TIME = 8 buildingMinMax = { - ToontownGlobals.SillyStreet: (config.GetInt('silly-street-building-min', 0), - config.GetInt('silly-street-building-max', 3)), - ToontownGlobals.LoopyLane: (config.GetInt('loopy-lane-building-min', 0), - config.GetInt('loopy-lane-building-max', 3)), - ToontownGlobals.PunchlinePlace: (config.GetInt('punchline-place-building-min', 0), - config.GetInt('punchline-place-building-max', 3)), - ToontownGlobals.BarnacleBoulevard: (config.GetInt('barnacle-boulevard-building-min', 1), - config.GetInt('barnacle-boulevard-building-max', 5)), - ToontownGlobals.SeaweedStreet: (config.GetInt('seaweed-street-building-min', 1), - config.GetInt('seaweed-street-building-max', 5)), - ToontownGlobals.LighthouseLane: (config.GetInt('lighthouse-lane-building-min', 1), - config.GetInt('lighthouse-lane-building-max', 5)), - ToontownGlobals.ElmStreet: (config.GetInt('elm-street-building-min', 2), - config.GetInt('elm-street-building-max', 6)), - ToontownGlobals.MapleStreet: (config.GetInt('maple-street-building-min', 2), - config.GetInt('maple-street-building-max', 6)), - ToontownGlobals.OakStreet: (config.GetInt('oak-street-building-min', 2), - config.GetInt('oak-street-building-max', 6)), - ToontownGlobals.AltoAvenue: (config.GetInt('alto-avenue-building-min', 3), - config.GetInt('alto-avenue-building-max', 7)), - ToontownGlobals.BaritoneBoulevard: (config.GetInt('baritone-boulevard-building-min', 3), - config.GetInt('baritone-boulevard-building-max', 7)), - ToontownGlobals.TenorTerrace: (config.GetInt('tenor-terrace-building-min', 3), - config.GetInt('tenor-terrace-building-max', 7)), - ToontownGlobals.WalrusWay: (config.GetInt('walrus-way-building-min', 5), - config.GetInt('walrus-way-building-max', 10)), - ToontownGlobals.SleetStreet: (config.GetInt('sleet-street-building-min', 5), - config.GetInt('sleet-street-building-max', 10)), - ToontownGlobals.PolarPlace: (config.GetInt('polar-place-building-min', 5), - config.GetInt('polar-place-building-max', 10)), - ToontownGlobals.LullabyLane: (config.GetInt('lullaby-lane-building-min', 6), - config.GetInt('lullaby-lane-building-max', 12)), - ToontownGlobals.PajamaPlace: (config.GetInt('pajama-place-building-min', 6), - config.GetInt('pajama-place-building-max', 12)), - ToontownGlobals.SellbotHQ: (0, 0), - ToontownGlobals.SellbotFactoryExt: (0, 0), - ToontownGlobals.CashbotHQ: (0, 0), - ToontownGlobals.LawbotHQ: (0, 0), - ToontownGlobals.BossbotHQ: (0, 0) + ToontownGlobals.SillyStreet: [config.GetInt('silly-street-building-min', 0), + config.GetInt('silly-street-building-max', 3)], + ToontownGlobals.LoopyLane: [config.GetInt('loopy-lane-building-min', 0), + config.GetInt('loopy-lane-building-max', 3)], + ToontownGlobals.PunchlinePlace: [config.GetInt('punchline-place-building-min', 0), + config.GetInt('punchline-place-building-max', 3)], + ToontownGlobals.BarnacleBoulevard: [config.GetInt('barnacle-boulevard-building-min', 1), + config.GetInt('barnacle-boulevard-building-max', 5)], + ToontownGlobals.SeaweedStreet: [config.GetInt('seaweed-street-building-min', 1), + config.GetInt('seaweed-street-building-max', 5)], + ToontownGlobals.LighthouseLane: [config.GetInt('lighthouse-lane-building-min', 1), + config.GetInt('lighthouse-lane-building-max', 5)], + ToontownGlobals.ElmStreet: [config.GetInt('elm-street-building-min', 2), + config.GetInt('elm-street-building-max', 6)], + ToontownGlobals.MapleStreet: [config.GetInt('maple-street-building-min', 2), + config.GetInt('maple-street-building-max', 6)], + ToontownGlobals.OakStreet: [config.GetInt('oak-street-building-min', 2), + config.GetInt('oak-street-building-max', 6)], + ToontownGlobals.AltoAvenue: [config.GetInt('alto-avenue-building-min', 3), + config.GetInt('alto-avenue-building-max', 7)], + ToontownGlobals.BaritoneBoulevard: [config.GetInt('baritone-boulevard-building-min', 3), + config.GetInt('baritone-boulevard-building-max', 7)], + ToontownGlobals.TenorTerrace: [config.GetInt('tenor-terrace-building-min', 3), + config.GetInt('tenor-terrace-building-max', 7)], + ToontownGlobals.WalrusWay: [config.GetInt('walrus-way-building-min', 5), + config.GetInt('walrus-way-building-max', 10)], + ToontownGlobals.SleetStreet: [config.GetInt('sleet-street-building-min', 5), + config.GetInt('sleet-street-building-max', 10)], + ToontownGlobals.PolarPlace: [config.GetInt('polar-place-building-min', 5), + config.GetInt('polar-place-building-max', 10)], + ToontownGlobals.LullabyLane: [config.GetInt('lullaby-lane-building-min', 6), + config.GetInt('lullaby-lane-building-max', 12)], + ToontownGlobals.PajamaPlace: [config.GetInt('pajama-place-building-min', 6), + config.GetInt('pajama-place-building-max', 12)], + ToontownGlobals.SellbotHQ: [0, 0], + ToontownGlobals.SellbotFactoryExt: [0, 0], + ToontownGlobals.CashbotHQ: [0, 0], + ToontownGlobals.LawbotHQ: [0, 0], + ToontownGlobals.BossbotHQ: [0, 0] } buildingChance = { diff --git a/toontown/catalog/CatalogHouseItem.py b/toontown/catalog/CatalogHouseItem.py new file mode 100644 index 00000000..2dbd8bb6 --- /dev/null +++ b/toontown/catalog/CatalogHouseItem.py @@ -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)] + \ No newline at end of file diff --git a/toontown/catalog/CatalogItemPanel.py b/toontown/catalog/CatalogItemPanel.py index 9a08d5d3..93031eca 100644 --- a/toontown/catalog/CatalogItemPanel.py +++ b/toontown/catalog/CatalogItemPanel.py @@ -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() diff --git a/toontown/catalog/CatalogItemTypes.py b/toontown/catalog/CatalogItemTypes.py index 8162ba12..88bbde83 100644 --- a/toontown/catalog/CatalogItemTypes.py +++ b/toontown/catalog/CatalogItemTypes.py @@ -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 diff --git a/toontown/catalog/CatalogScreen.py b/toontown/catalog/CatalogScreen.py index 5e5a5fa7..9a3fc8a4 100644 --- a/toontown/catalog/CatalogScreen.py +++ b/toontown/catalog/CatalogScreen.py @@ -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): @@ -1090,4 +1096,4 @@ class CatalogScreen(DirectFrame): self.scrollList.hide() self.showEmblems() self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOff - self.update() \ No newline at end of file + self.update() diff --git a/toontown/cogdominium/CogdoBarrelRoomMovies.py b/toontown/cogdominium/CogdoBarrelRoomMovies.py index 3b709c16..34a156e8 100644 --- a/toontown/cogdominium/CogdoBarrelRoomMovies.py +++ b/toontown/cogdominium/CogdoBarrelRoomMovies.py @@ -39,7 +39,7 @@ class CogdoBarrelRoomIntro(CogdoGameMovie): suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() - suit.setScale(1, 1, 2) + suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): @@ -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)) @@ -115,4 +115,4 @@ class CogdoBarrelRoomIntro(CogdoGameMovie): self.toonHead.removeNode() self.toonHead.delete() del self.toonHead - CogdoGameMovie.unload(self) \ No newline at end of file + CogdoGameMovie.unload(self) diff --git a/toontown/cogdominium/CogdoElevatorMovie.py b/toontown/cogdominium/CogdoElevatorMovie.py index 67fb0256..03a25933 100644 --- a/toontown/cogdominium/CogdoElevatorMovie.py +++ b/toontown/cogdominium/CogdoElevatorMovie.py @@ -40,7 +40,7 @@ class CogdoElevatorMovie(CogdoGameMovie): suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() - suit.setScale(1, 1, 2) + suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): @@ -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)) diff --git a/toontown/cogdominium/CogdoExecutiveSuiteMovies.py b/toontown/cogdominium/CogdoExecutiveSuiteMovies.py index 96709977..0377ba18 100644 --- a/toontown/cogdominium/CogdoExecutiveSuiteMovies.py +++ b/toontown/cogdominium/CogdoExecutiveSuiteMovies.py @@ -44,7 +44,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie): suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() - suit.setScale(1, 1, 2) + suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): @@ -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)) diff --git a/toontown/cogdominium/CogdoFlyingGame.py b/toontown/cogdominium/CogdoFlyingGame.py index 9cb6d892..1a083855 100644 --- a/toontown/cogdominium/CogdoFlyingGame.py +++ b/toontown/cogdominium/CogdoFlyingGame.py @@ -28,6 +28,7 @@ class CogdoFlyingGame(DirectObject): self.index2LegalEagle = {} self.legalEagles = [] self.isGameComplete = False + self.localPlayer = None self._hints = {'targettedByEagle': False, 'invulnerable': False} @@ -169,7 +170,7 @@ class CogdoFlyingGame(DirectObject): self.guiMgr.onstage() if not Globals.Dev.InfiniteTimeLimit: - self.guiMgr.startTimer(Globals.Gameplay.SecondsUntilGameOver, self._handleTimerExpired, keepHidden=True) + self.guiMgr.startTimer(Globals.Gameplay.SecondsUntilGameOver, self._handleTimerExpired) def exit(self): self.ignore(CogdoFlyingObstacle.EnterEventName) diff --git a/toontown/cogdominium/CogdoFlyingGameMovies.py b/toontown/cogdominium/CogdoFlyingGameMovies.py index 1f1b577a..1180d58a 100644 --- a/toontown/cogdominium/CogdoFlyingGameMovies.py +++ b/toontown/cogdominium/CogdoFlyingGameMovies.py @@ -41,7 +41,7 @@ class CogdoFlyingGameIntro(CogdoGameMovie): suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() - suit.setScale(1, 1, 2) + suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): @@ -71,6 +71,7 @@ class CogdoFlyingGameIntro(CogdoGameMovie): self.cogHead.loop('neutral') self.cogHead.setPosHprScale(-0.74, 0, -1.79, 180, 0, 0, 0.12, 0.14, 0.14) self.cogHead.reparentTo(hidden) + self.cogHead.nametag3d.hide() self.clipPlane = self.toonHead.attachNewNode(PlaneNode('clip')) self.clipPlane.node().setPlane(Plane(0, 0, 1, 0)) self.clipPlane.setPos(0, 0, 2.45) diff --git a/toontown/cogdominium/CogdoMazeGameGlobals.py b/toontown/cogdominium/CogdoMazeGameGlobals.py index 221c24b1..638f2736 100644 --- a/toontown/cogdominium/CogdoMazeGameGlobals.py +++ b/toontown/cogdominium/CogdoMazeGameGlobals.py @@ -201,7 +201,7 @@ MapGuiFgColor = (0.5, 0.5, 0.5, 1) -MapGuiPos = (1.05, 0.0, -0.71) +MapGuiPos = (-0.283, 0, 0.29) MapGuiScale = 0.225 MapGuiSuitMarkerFlashColor = (1.0, 0.0, 0.0) MapGuiSuitMarkerSize = 0.075 diff --git a/toontown/cogdominium/CogdoMazeGameGuis.py b/toontown/cogdominium/CogdoMazeGameGuis.py index 52b20e89..b3e31fe1 100644 --- a/toontown/cogdominium/CogdoMazeGameGuis.py +++ b/toontown/cogdominium/CogdoMazeGameGuis.py @@ -1,5 +1,5 @@ from direct.gui.DirectLabel import DirectLabel -from direct.gui.DirectGui import DirectFrame, DGG +from direct.gui.DirectGui import * from direct.task.Task import Task from direct.interval.MetaInterval import Sequence, Parallel from direct.interval.FunctionInterval import Wait, Func @@ -19,6 +19,7 @@ class CogdoMazeMapGui(MazeMapGui): self._initModel() self.setPos(*Globals.MapGuiPos) self.setScale(Globals.MapGuiScale) + self.reparentTo(base.a2dBottomRight) def destroy(self): for marker in self._suit2marker.values(): diff --git a/toontown/cogdominium/CogdoMazeGameMovies.py b/toontown/cogdominium/CogdoMazeGameMovies.py index c5ed394e..ff9a8efa 100644 --- a/toontown/cogdominium/CogdoMazeGameMovies.py +++ b/toontown/cogdominium/CogdoMazeGameMovies.py @@ -45,7 +45,7 @@ class CogdoMazeGameIntro(CogdoGameMovie): suit.setStyle(dna) suit.isDisguised = 1 suit.generateSuit() - suit.setScale(1, 1, 2) + suit.setScale(1.05, 1.05, 2.05) suit.setPos(0, 0, -4.4) suit.reparentTo(self.toonHead) for part in suit.getHeadParts(): @@ -75,6 +75,7 @@ class CogdoMazeGameIntro(CogdoGameMovie): self.cogHead.loop('neutral') self.cogHead.setPosHprScale(-0.73, 0, -1.46, 180, 0, 0, 0.14, 0.14, 0.14) self.cogHead.reparentTo(hidden) + self.cogHead.nametag3d.hide() self.clipPlane = self.toonHead.attachNewNode(PlaneNode('clip')) self.clipPlane.node().setPlane(Plane(0, 0, 1, 0)) self.clipPlane.setPos(0, 0, 2.45) diff --git a/toontown/cogdominium/DistCogdoFlyingGameAI.py b/toontown/cogdominium/DistCogdoFlyingGameAI.py index 3412000d..520fce73 100644 --- a/toontown/cogdominium/DistCogdoFlyingGameAI.py +++ b/toontown/cogdominium/DistCogdoFlyingGameAI.py @@ -119,8 +119,7 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI): return self.totalMemos from otp.ai.MagicWordGlobal import * - -@magicWord(category=CATEGORY_MODERATOR) +@magicWord(category=CATEGORY_PROGRAMMER) def endFly(): if hasattr(simbase.air, 'cogdoGame'): game = simbase.air.cogdoGame diff --git a/toontown/cogdominium/DistCogdoMazeGame.py b/toontown/cogdominium/DistCogdoMazeGame.py index a79cd4d6..80c4e2f6 100644 --- a/toontown/cogdominium/DistCogdoMazeGame.py +++ b/toontown/cogdominium/DistCogdoMazeGame.py @@ -230,8 +230,7 @@ class DistCogdoMazeGame(DistCogdoGame, DistCogdoMazeGameBase): self.game.handleToonDisconnected(toonId) from otp.ai.MagicWordGlobal import * - -@magicWord(category=CATEGORY_MODERATOR) +@magicWord(category=CATEGORY_PROGRAMMER) def revealMap(): if hasattr(base.cr, 'cogdoGame'): game = base.cr.cogdoGame diff --git a/toontown/cogdominium/DistCogdoMazeGameAI.py b/toontown/cogdominium/DistCogdoMazeGameAI.py index eb748399..fed6fc8d 100644 --- a/toontown/cogdominium/DistCogdoMazeGameAI.py +++ b/toontown/cogdominium/DistCogdoMazeGameAI.py @@ -240,8 +240,7 @@ class DistCogdoMazeGameAI(DistCogdoGameAI): self.removeAll() from otp.ai.MagicWordGlobal import * - -@magicWord(category=CATEGORY_MODERATOR) +@magicWord(category=CATEGORY_PROGRAMMER) def endMaze(): if hasattr(simbase.air, 'cogdoGame'): maze = simbase.air.cogdoGame diff --git a/toontown/cogdominium/DistributedCogdoInterior.py b/toontown/cogdominium/DistributedCogdoInterior.py index 0fabdb02..0b90b072 100644 --- a/toontown/cogdominium/DistributedCogdoInterior.py +++ b/toontown/cogdominium/DistributedCogdoInterior.py @@ -32,6 +32,7 @@ PAINTING_DICT = {'s': 'tt_m_ara_crg_paintingMoverShaker', 'c': 'tt_m_ara_crg_paintingMoverShaker'} from toontown.nametag.NametagGlobals import * +from toontown.chat.ChatGlobals import * class DistributedCogdoInterior(DistributedObject.DistributedObject): id = 0 @@ -811,7 +812,23 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): else: speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName - track.append(Sequence(Func(camera.wrtReparentTo, localAvatar), Func(camera.setPos, 0, -9, 9), Func(camera.lookAt, Point3(5, 15, 0)), Parallel(self.cage.posInterval(0.75, self.cagePos[1], blendType='easeOut'), SoundInterval(self.cageLowerSfx, duration=0.5)), Parallel(self.cageDoor.hprInterval(0.5, VBase3(0, 90, 0), blendType='easeOut'), Sequence(SoundInterval(self.cageDoorSfx), duration=0)), Wait(0.25), Func(self.shopOwnerNpc.wrtReparentTo, render), Func(self.shopOwnerNpc.setScale, 1), Func(self.shopOwnerNpc.loop, 'walk'), Func(self.shopOwnerNpc.headsUp, Point3(0, 10, 0)), ParallelEndTogether(self.shopOwnerNpc.posInterval(1.5, Point3(0, 10, 0)), self.shopOwnerNpc.hprInterval(0.5, VBase3(180, 0, 0), blendType='easeInOut')), Func(self.shopOwnerNpc.setChatAbsolute, TTLocalizer.CagedToonYippee, CFSpeech), ActorInterval(self.shopOwnerNpc, 'jump'), Func(self.shopOwnerNpc.loop, 'neutral'), Func(self.shopOwnerNpc.headsUp, localAvatar), Func(self.shopOwnerNpc.setLocalPageChat, speech, 0), Func(camera.lookAt, self.shopOwnerNpc, Point3(0, 0, 2)))) + track.append(Sequence(Func(camera.wrtReparentTo, localAvatar), + Func(camera.setPos, 0, -9, 9), + Func(camera.lookAt, Point3(5, 15, 0)), + Parallel(self.cage.posInterval(0.75, self.cagePos[1], blendType='easeOut'), + SoundInterval(self.cageLowerSfx, duration=0.5)), + Parallel(self.cageDoor.hprInterval(0.5, VBase3(0, 90, 0), blendType='easeOut'), + Sequence(SoundInterval(self.cageDoorSfx), duration=0)), + Wait(0.25), + Func(self.shopOwnerNpc.wrtReparentTo, render), + Func(self.shopOwnerNpc.setScale, 1), + Func(self.shopOwnerNpc.loop, 'walk'), + Func(self.shopOwnerNpc.headsUp, Point3(0, 10, 0)), + ParallelEndTogether(self.shopOwnerNpc.posInterval(1.5, Point3(0, 10, 0)), self.shopOwnerNpc.hprInterval(0.5, VBase3(180, 0, 0), blendType='easeInOut')), + Func(self.shopOwnerNpc.setChatAbsolute, TTLocalizer.CagedToonYippee, CFSpeech), ActorInterval(self.shopOwnerNpc, 'jump'), + Func(self.shopOwnerNpc.loop, 'neutral'), Func(self.shopOwnerNpc.headsUp, localAvatar), + Func(self.shopOwnerNpc.setLocalPageChat, speech, 0), + Func(camera.lookAt, self.shopOwnerNpc, Point3(0, 0, 2)))) self.activeIntervals[trackName] = track self.accept('doneChatPage', self.__outroPenthouseChatDone) return track diff --git a/toontown/cogdominium/SuitPlannerCogdoInteriorAI.py b/toontown/cogdominium/SuitPlannerCogdoInteriorAI.py index d2a604fd..b333df41 100644 --- a/toontown/cogdominium/SuitPlannerCogdoInteriorAI.py +++ b/toontown/cogdominium/SuitPlannerCogdoInteriorAI.py @@ -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: - suitType = SuitDNA.getSuitType(suitName) - bldgTrack = SuitDNA.getSuitDept(suitName) - suitLevel = min(max(suitLevel, suitType), suitType + 4) + 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) + 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 diff --git a/toontown/estate/DistributedPhoneAI.py b/toontown/estate/DistributedPhoneAI.py index 3741bf97..e6bc5c05 100644 --- a/toontown/estate/DistributedPhoneAI.py +++ b/toontown/estate/DistributedPhoneAI.py @@ -108,6 +108,27 @@ class DistributedPhoneAI(DistributedFurnitureItemAI): else: return + def _getEmblemPrices(): + if config.GetBool('catalog-emblems-OR', False): + ep = list(item.getEmblemPrices()) + if len(ep) != 2: + return [] + + if all(ep): + ep[payMethod] = 0 + + else: + ep = item.getEmblemPrices() + + return ep + + def charge(): + ep = _getEmblemPrices() + if ep: + av.subtractEmblems(ep) + + av.takeMoney(item.getPrice(priceType)) + if item.getDeliveryTime(): if len(av.onOrder) > 5: self.sendUpdateToAvatarId(avId, 'requestPurchaseResponse', [context, ToontownGlobals.P_OnOrderListFull]) diff --git a/toontown/estate/HouseGlobals.py b/toontown/estate/HouseGlobals.py index 4f4de731..a8c5035d 100644 --- a/toontown/estate/HouseGlobals.py +++ b/toontown/estate/HouseGlobals.py @@ -110,3 +110,12 @@ HALF_DAY_PERIOD = 1050 HALF_NIGHT_PERIOD = 300 FIREWORKS_MOVIE_CLEAR = 0 FIREWORKS_MOVIE_GUI = 1 + +HouseEmblemPrices = ( + (50, 20), # bungalo + (200, 75), # tiki + (200, 75), # tepee + (500, 250), # castle + (350, 150), # cupcake + (400, 200) # cabin + ) diff --git a/toontown/safezone/DistributedPicnicTable.py b/toontown/safezone/DistributedPicnicTable.py index ab7626f0..ab16e0be 100644 --- a/toontown/safezone/DistributedPicnicTable.py +++ b/toontown/safezone/DistributedPicnicTable.py @@ -500,10 +500,10 @@ class DistributedPicnicTable(DistributedNode.DistributedNode): self.tableclothSphereNode.setCollideMask(BitMask32(0)) def enterOff(self): - base.setCellsAvailable(base.leftCells + base.bottomCells, 0) + base.setCellsActive(base.leftCells + base.bottomCells, 0) def exitOff(self): - base.setCellsAvailable(base.bottomCells, 0) + base.setCellsActive(base.bottomCells, 0) def enterChooseMode(self): self.winTrack = Sequence(autoFinish=1) diff --git a/toontown/suit/DistributedSuitAI.py b/toontown/suit/DistributedSuitAI.py index 0c34ab73..05635e6b 100644 --- a/toontown/suit/DistributedSuitAI.py +++ b/toontown/suit/DistributedSuitAI.py @@ -363,8 +363,9 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI): if not self.sp.buildingMgr.isSuitBlock(blockNumber): self.notify.debug('Suit %s taking over building %s in %s' % (self.getDoId(), blockNumber, self.zoneId)) difficulty = self.getActualLevel() - 1 + + dept = SuitDNA.getSuitDept(self.dna.name) if self.buildingDestinationIsCogdo: - self.sp.cogdoTakeOver(blockNumber, difficulty, self.buildingHeight) + self.sp.cogdoTakeOver(blockNumber, difficulty, self.buildingHeight, dept) else: - dept = SuitDNA.getSuitDept(self.dna.name) self.sp.suitTakeOver(blockNumber, dept, difficulty, self.buildingHeight) diff --git a/toontown/suit/DistributedSuitPlannerAI.py b/toontown/suit/DistributedSuitPlannerAI.py index 7e8688e9..30a15d1b 100644 --- a/toontown/suit/DistributedSuitPlannerAI.py +++ b/toontown/suit/DistributedSuitPlannerAI.py @@ -21,10 +21,16 @@ from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownGlobals +ALLOWED_FO_TRACKS = 's' +if config.GetBool('want-lawbot-cogdo', True): + ALLOWED_FO_TRACKS += 'l' + +DEFAULT_COGDO_RATIO = .5 + class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlannerBase.SuitPlannerBase): notify = directNotify.newCategory('DistributedSuitPlannerAI') CogdoPopFactor = config.GetFloat('cogdo-pop-factor', 1.5) - CogdoRatio = min(1.0, max(0.0, config.GetFloat('cogdo-ratio', 0.5))) + CogdoRatio = min(1.0, max(0.0, config.GetFloat('cogdo-ratio', DEFAULT_COGDO_RATIO))) MAX_SUIT_TYPES = 6 POP_UPKEEP_DELAY = 10 POP_ADJUST_DELAY = 300 @@ -55,8 +61,8 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan if not hasattr(self.__class__, 'CogdoPopAdjusted'): self.__class__.CogdoPopAdjusted = True for index in xrange(len(self.SuitHoodInfo)): - SuitBuildingGlobals[self.zoneId][0] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][0]) - SuitBuildingGlobals[self.zoneId][1] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals[self.zoneId][1]) + SuitBuildingGlobals.buildingMinMax[self.zoneId][0] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals.buildingMinMax[self.zoneId][0]) + SuitBuildingGlobals.buildingMinMax[self.zoneId][1] = int(0.5 + self.CogdoPopFactor * SuitBuildingGlobals.buildingMinMax[self.zoneId][1]) self.hoodInfoIdx = -1 for index in xrange(len(self.SuitHoodInfo)): currHoodInfo = self.SuitHoodInfo[index] @@ -370,8 +376,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan cogdoTakeover=None, minPathLen=None, maxPathLen=None): possibles = [] backup = [] - if cogdoTakeover is None: - cogdoTakeover = False + if toonBlockTakeover is not None: suit.attemptingTakeover = 1 blockNumber = toonBlockTakeover @@ -384,6 +389,9 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan if not NPCToons.isZoneProtected(intZoneId): if blockNumber in self.buildingFrontDoors: possibles.append((blockNumber, self.buildingFrontDoors[blockNumber])) + if cogdoTakeover is None: + if suit.dna.dept in ALLOWED_FO_TRACKS: + cogdoTakeover = random.random() < self.CogdoRatio elif self.buildingMgr: for blockNumber in self.buildingMgr.getSuitBlocks(): track = self.buildingMgr.getBuildingTrack(blockNumber) @@ -568,11 +576,11 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan return building.suitTakeOver(suitTrack, difficulty, buildingHeight) - def cogdoTakeOver(self, blockNumber, difficulty, buildingHeight): + def cogdoTakeOver(self, blockNumber, difficulty, buildingHeight, dept): if self.pendingBuildingHeights.count(buildingHeight) > 0: - self.pendingBuildingHeights.remove(buildingHeight) + self.pendingBuildingHeights.remove(buildingHeight) building = self.buildingMgr.getBuilding(blockNumber) - building.cogdoTakeOver(difficulty, buildingHeight) + building.cogdoTakeOver(difficulty, buildingHeight, dept) def recycleBuilding(self): bmin = SuitBuildingGlobals.buildingMinMax[self.zoneId][0] diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index baa9ebe7..8e977dc2 100644 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -1153,6 +1153,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute self.monthlyCatalog = CatalogItemList.CatalogItemList(monthlyCatalog) self.weeklyCatalog = CatalogItemList.CatalogItemList(weeklyCatalog) self.backCatalog = CatalogItemList.CatalogItemList(backCatalog) + if config.GetBool('want-house-types', False): + from toontown.catalog import CatalogHouseItem + self.backCatalog.extend(CatalogHouseItem.getAllHouses()) if self.catalogNotify == ToontownGlobals.NewItems: self.catalogNotify = ToontownGlobals.OldItems diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 9715bd8b..d484a7b3 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -2389,7 +2389,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def getBankMoney(self): return self.bankMoney - + def b_setEmblems(self, emblems): self.setEmblems(emblems) self.d_setEmblems(emblems) @@ -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 @@ -5177,3 +5179,25 @@ def immortal(): av = spellbook.getTarget() if spellbook.getInvokerAccess() >= 500 else spellbook.getInvoker() av.setImmortalMode(not av.immortalMode) return 'Toggled immortal mode %s for %s' % ('ON' if av.immortalMode else 'OFF', av.getName()) + +@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int]) +def summoncogdo(track="s", difficulty=5): + tracks = ['s'] + if config.GetBool('want-lawbot-cogdo', True): + tracks.append('l') + if track not in tracks: + return "Invalid track!" + + av = spellbook.getInvoker() + building = av.findClosestDoor() + if building == None: + return "No bldg found!" + + building.cogdoTakeOver(difficulty, 2, track) + return 'Successfully spawned cogdo with track %s and difficulty %d' % (track, difficulty) + +@magicWord(category=CATEGORY_PROGRAMMER, types=[int, int]) +def emblems(silver=10, gold=10): + spellbook.getTarget().addEmblems((gold, silver)) + return 'Restocked with Gold: %s Silver: %d' % (gold, silver) + diff --git a/toontown/toon/Documents - Shortcut.lnk b/toontown/toon/Documents - Shortcut.lnk new file mode 100644 index 00000000..1abdc062 Binary files /dev/null and b/toontown/toon/Documents - Shortcut.lnk differ diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 8d6140da..ce7b0714 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -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 you're powerless to stop us!", "This will make you Toons quake! We've stolen your 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!", "You'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!', @@ -9744,6 +9747,9 @@ PickTrackTitle = 'Pick your third track!' PickTrackNotice = 'Choose a track!' UnknownTrack = 'None' +HouseNames = ("Bungalow", "Tiki", "Teepee", "Castle", "Cupcake", "Cabin") +CatalogPurchaseHouseType = "When you buy a new house type, the current one is replaced by it. To recover the old type, you'll need to buy it back. Continue?" + # Buffs buffIdStrings = { @@ -9804,4 +9810,4 @@ def getPetNameId(name): return 0 -PropIdToName = [InventoryHealString, MovieNPCSOSTrap, MovieNPCSOSLure, MovieNPCSOSSound, MovieNPCSOSThrow, MovieNPCSOSSquirt, MovieNPCSOSDrop] \ No newline at end of file +PropIdToName = [InventoryHealString, MovieNPCSOSTrap, MovieNPCSOSLure, MovieNPCSOSSound, MovieNPCSOSThrow, MovieNPCSOSSquirt, MovieNPCSOSDrop]