mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
Merge branch 'cogdo' of https://gitlab.com/toontown-created/src
This commit is contained in:
commit
7052349f62
34 changed files with 326 additions and 128 deletions
|
@ -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;
|
||||
|
|
|
@ -21,7 +21,7 @@ dc-file astron/dclass/united.dc
|
|||
# Core features:
|
||||
want-pets #t
|
||||
want-parties #t
|
||||
want-cogdominiums #f
|
||||
want-cogdominiums #t
|
||||
want-achievements #f
|
||||
|
||||
# Chat:
|
||||
|
|
0
darwin/start-game-localhost.sh
Normal file → Executable file
0
darwin/start-game-localhost.sh
Normal file → Executable file
19
findterm.py
Normal file
19
findterm.py
Normal file
|
@ -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('*****')
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'):
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
69
toontown/catalog/CatalogHouseItem.py
Normal file
69
toontown/catalog/CatalogHouseItem.py
Normal 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)]
|
||||
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
self.update()
|
||||
|
|
|
@ -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)
|
||||
CogdoGameMovie.unload(self)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
BIN
toontown/toon/Documents - Shortcut.lnk
Normal file
BIN
toontown/toon/Documents - Shortcut.lnk
Normal file
Binary file not shown.
|
@ -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!',
|
||||
|
@ -9804,4 +9807,4 @@ def getPetNameId(name):
|
|||
|
||||
return 0
|
||||
|
||||
PropIdToName = [InventoryHealString, MovieNPCSOSTrap, MovieNPCSOSLure, MovieNPCSOSSound, MovieNPCSOSThrow, MovieNPCSOSSquirt, MovieNPCSOSDrop]
|
||||
PropIdToName = [InventoryHealString, MovieNPCSOSTrap, MovieNPCSOSLure, MovieNPCSOSSound, MovieNPCSOSThrow, MovieNPCSOSSquirt, MovieNPCSOSDrop]
|
||||
|
|
Loading…
Reference in a new issue