Merge remote-tracking branch 'origin/beta-wip' into estates
This commit is contained in:
commit
1f8e641731
47 changed files with 433 additions and 173 deletions
|
@ -58,6 +58,7 @@ smooth-lag 0.4
|
|||
estate-day-night #t
|
||||
want-instant-parties #t
|
||||
show-total-population #f
|
||||
want-toontorial #f
|
||||
|
||||
|
||||
# Chat stuff
|
||||
|
|
|
@ -309,6 +309,7 @@ from toontown.cogdominium import DistCogdoCrane/AI
|
|||
from toontown.cogdominium import DistCogdoCraneMoneyBag/AI
|
||||
from toontown.cogdominium import DistCogdoCraneCog/AI
|
||||
from toontown.parties.GlobalPartyManager/AI/UD import GlobalPartyManager/AI/UD
|
||||
from toontown.uberdog.ARGManager/AI/UD import ARGManager/AI/UD
|
||||
|
||||
struct GiftItem {
|
||||
blob Item;
|
||||
|
@ -629,6 +630,10 @@ dclass DistributedToon : DistributedPlayer {
|
|||
magicTeleportRequest(uint32 requesterId) ownrecv;
|
||||
magicTeleportResponse(uint32 requesterId, uint32 hoodId) ownsend airecv;
|
||||
magicTeleportInitiate(uint32 hoodId, uint32 zoneId) ownrecv;
|
||||
|
||||
// Temporary ping-pong fields.
|
||||
ping(string data) ownrecv;
|
||||
pong(string data) ownsend airecv;
|
||||
};
|
||||
|
||||
dclass DistributedCCharBase : DistributedObject {
|
||||
|
@ -3294,6 +3299,8 @@ dclass ClientServicesManager : DistributedObjectGlobal {
|
|||
chooseAvatar(uint32 avId) clsend;
|
||||
|
||||
systemMessage(uint16 code, string params[]);
|
||||
|
||||
reportPlayer(uint32 avId, uint8 category) clsend;
|
||||
};
|
||||
|
||||
dclass RATManager : DistributedObjectGlobal {
|
||||
|
@ -3389,3 +3396,6 @@ dclass DistributedTrashcanZeroMgr : DistributedPhaseEventMgr {
|
|||
|
||||
dclass DistributedSillyMeterMgr : DistributedPhaseEventMgr {
|
||||
};
|
||||
|
||||
dclass ARGManager : DistributedObjectGlobal {
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ want-golf #f
|
|||
# Temporary modifications for unimplemented features go here.
|
||||
want-sbhq #t
|
||||
want-cbhq #t
|
||||
want-lbhq #f
|
||||
want-lbhq #t
|
||||
want-bbhq #f
|
||||
want-pets #f
|
||||
want-old-fireworks #t
|
||||
|
|
|
@ -22,6 +22,7 @@ OTP_DO_ID_GUILDS = 4650
|
|||
OTP_DO_ID_ESCROW = 4660
|
||||
OTP_DO_ID_CLIENT_SERVICES_MANAGER = 4665
|
||||
OTP_DO_ID_TTR_FRIENDS_MANAGER = 4666
|
||||
OTP_DO_ID_TTR_ARG_MANAGER = 4667
|
||||
OTP_DO_ID_GLOBAL_PARTY_MANAGER = 4477
|
||||
OTP_DO_ID_PIRATES_AVATAR_MANAGER = 4674
|
||||
OTP_DO_ID_PIRATES_CREW_MANAGER = 4675
|
||||
|
|
|
@ -10,6 +10,9 @@ class MarginManager(PandaNode):
|
|||
self.visiblePopups = set()
|
||||
|
||||
def addGridCell(self, x, y, a2d):
|
||||
# Yucky!
|
||||
nodePath = NodePath.anyPath(self)
|
||||
a2d.reparentTo(nodePath)
|
||||
cell = MarginCell(self)
|
||||
cell.reparentTo(a2d)
|
||||
cell.setScale(0.2)
|
||||
|
|
|
@ -77,7 +77,7 @@ class WhisperPopup(MarginPopup, ClickablePopup):
|
|||
|
||||
def __updateClickRegion(self):
|
||||
if self.isDisplayed() and self.active:
|
||||
self.updateClickRegion(self.left, self.right, self.bottom, self.top)
|
||||
self.updateClickRegion(-1, 1, self.bottom, self.top)
|
||||
else:
|
||||
self.stashClickRegion()
|
||||
|
||||
|
|
|
@ -83,11 +83,11 @@ class Nametag(ClickablePopup):
|
|||
self.nameFg, self.nameBg, self.chatFg, self.chatBg = NAMETAG_COLORS[cc][self.getClickState()]
|
||||
|
||||
self.innerNP.node().removeAllChildren()
|
||||
if self.contents&self.CThought and self.chatFlags&CFThought:
|
||||
if self.contents & self.CThought and self.chatFlags & CFThought:
|
||||
self.showThought()
|
||||
elif self.contents&self.CSpeech and self.chatFlags&CFSpeech:
|
||||
elif self.contents & self.CSpeech and self.chatFlags&CFSpeech:
|
||||
self.showSpeech()
|
||||
elif self.contents&self.CName and self.displayName:
|
||||
elif self.contents & self.CName and self.displayName:
|
||||
self.showName()
|
||||
|
||||
def showBalloon(self, balloon, text):
|
||||
|
|
|
@ -208,9 +208,9 @@ WHISPER_COLORS = {
|
|||
# Click FG BG
|
||||
((1.0, 0.5, 0.5, 1.0), (1.0, 1.0, 1.0, 0.8)),
|
||||
# Hover FG BG
|
||||
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.9, 0.6)),
|
||||
((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.2, 0.6)),
|
||||
# Disable FG BG
|
||||
((0.0, 0.0, 0.0, 1.0), (0.2, 0.7, 0.8, 0.6)),
|
||||
((0.0, 0.0, 0.0, 1.0), (0.9, 0.6, 0.1, 0.6)),
|
||||
),
|
||||
# TODO: WTToontownBoardingGroup
|
||||
}
|
||||
|
|
|
@ -311,3 +311,4 @@ class NametagGroup:
|
|||
for tag in self.nametags:
|
||||
if isinstance(tag, MarginPopup):
|
||||
tag.unmanage(manager)
|
||||
tag.destroy()
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4469f9f491d02f3a60fedb8fdd0c907f4f591f6e
|
||||
Subproject commit f98377694b2c0580659acd748d99b93e42cc5ed2
|
|
@ -742,7 +742,7 @@ def avatarBehindHighShot(avatar, duration):
|
|||
|
||||
|
||||
def avatarBehindHighRightShot(avatar, duration):
|
||||
return heldRelativeShot(avatar, 4, -7, 5 + avatar.getHeight(), 30, -35, 0, duration, 'avatarBehindHighShot')
|
||||
return heldRelativeShot(avatar, 7, -3, 5 + avatar.getHeight(), 45, -30, 0, duration, 'avatarBehindHighShot')
|
||||
|
||||
|
||||
def avatarBehindThreeQuarterRightShot(avatar, duration):
|
||||
|
|
|
@ -473,11 +473,14 @@ def createSuitReactionToTrain(battle, suit, hp, lure, trapProp):
|
|||
anim = 'flatten'
|
||||
suitReact = ActorInterval(suit, anim)
|
||||
cogGettingHit = getSoundTrack('TL_train_cog.ogg', node=toon)
|
||||
suitTrack.append(Func(suit.loop, 'neutral'))
|
||||
hideTrack = Sequence()
|
||||
hideTrack.append(Wait(2.0))
|
||||
hideTrack.append(LerpColorScaleInterval(trapProp, 1.0, Point4(1, 1, 1, 0)))
|
||||
hideTrack.append(showDamage)
|
||||
suitTrack.append(Func(suit.loop, 'lured'))
|
||||
suitTrack.append(Wait(timeToGetHit + TRAIN_MATERIALIZE_TIME))
|
||||
suitTrack.append(updateHealthBar)
|
||||
suitTrack.append(Parallel(suitReact, cogGettingHit))
|
||||
suitTrack.append(showDamage)
|
||||
suitTrack.append(Parallel(suitReact, cogGettingHit, hideTrack))
|
||||
curDuration = suitTrack.getDuration()
|
||||
timeTillEnd = TOTAL_TRAIN_TIME - curDuration
|
||||
if timeTillEnd > 0:
|
||||
|
@ -525,19 +528,26 @@ def createIncomingTrainInterval(battle, suit, hp, lure, trapProp):
|
|||
materializeIval = Parallel()
|
||||
materializeIval.append(LerpColorScaleInterval(train, TRAIN_MATERIALIZE_TIME, Point4(1, 1, 1, 1)))
|
||||
for tunnel in tunnels:
|
||||
materializeIval.append(LerpColorScaleInterval(tunnel, TRAIN_MATERIALIZE_TIME, Point4(1, 1, 1, 1)))
|
||||
materializeIval.append(LerpColorScaleInterval(tunnel, TRAIN_MATERIALIZE_TIME - 1.5, Point4(1, 1, 1, 1)))
|
||||
|
||||
for tunnel in tunnels:
|
||||
tunnelScaleIval = Sequence()
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, TRAIN_MATERIALIZE_TIME - 1.0, Point3(1.0, 2.0, 2.5)))
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, 0.5, Point3(1.0, 3.0, 1.5)))
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, 0.5, Point3(1.0, 2.5, 2.0)))
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, 0.75, Point3(1.0, 1.5, 1.7)))
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, 0.5, Point3(1.0, 2.0, 2.1)))
|
||||
tunnelScaleIval.append(LerpScaleInterval(tunnel, 0.5, Point3(1.0, 1.6, 1.7)))
|
||||
materializeIval.append(tunnelScaleIval)
|
||||
|
||||
trainIval.append(materializeIval)
|
||||
endingX = TRAIN_STARTING_X + TRAIN_TRAVEL_DISTANCE
|
||||
trainIval.append(LerpPosInterval(train, TRAIN_DURATION, Point3(endingX, 0, 0), other=battle))
|
||||
trainIval.append(LerpColorScaleInterval(train, TRAIN_MATERIALIZE_TIME, Point4(1, 1, 1, 0)))
|
||||
|
||||
dematerializeIval = Parallel()
|
||||
dematerializeIval.append(LerpColorScaleInterval(train, TRAIN_MATERIALIZE_TIME, Point4(1, 1, 1, 0)))
|
||||
for tunnel in tunnels:
|
||||
dematerializeIval.append(LerpColorScaleInterval(tunnel, TRAIN_MATERIALIZE_TIME - 2.0, Point4(1, 1, 1, 0)))
|
||||
dematerializeIval.append(LerpScaleInterval(tunnel, TRAIN_MATERIALIZE_TIME - 1.5, Point3(1.0, 0.01, 0.01)))
|
||||
trainIval.append(dematerializeIval)
|
||||
|
||||
retval.append(trainIval)
|
||||
trainSoundTrack = getSoundTrack('TL_train.ogg', node=toon)
|
||||
retval.append(trainSoundTrack)
|
||||
|
|
|
@ -908,14 +908,15 @@ def doFillWithLead(attack):
|
|||
track = Parallel()
|
||||
for partNum in range(0, parts.getNumPaths()):
|
||||
nextPart = parts.getPath(partNum)
|
||||
track.append(Func(nextPart.setColorScale, Vec4(0, 0, 0, 1)))
|
||||
track.append(LerpColorScaleInterval(nextPart, 0.2, Point4(0, 0, 0, 1)))
|
||||
|
||||
return track
|
||||
|
||||
def resetParts(parts):
|
||||
track = Parallel()
|
||||
track = Sequence()
|
||||
for partNum in range(0, parts.getNumPaths()):
|
||||
nextPart = parts.getPath(partNum)
|
||||
track.append(LerpColorScaleInterval(nextPart, 0.2, Point4(1, 1, 1, 1)))
|
||||
track.append(Func(nextPart.clearColorScale))
|
||||
|
||||
return track
|
||||
|
@ -932,10 +933,11 @@ def doFillWithLead(attack):
|
|||
colorTrack.append(colorParts(torsoParts))
|
||||
colorTrack.append(Wait(partIvalDelay))
|
||||
colorTrack.append(colorParts(legsParts))
|
||||
colorTrack.append(Wait(2.5))
|
||||
colorTrack.append(Wait(0.9))
|
||||
colorTrack.append(resetParts(headParts))
|
||||
colorTrack.append(resetParts(torsoParts))
|
||||
colorTrack.append(resetParts(legsParts))
|
||||
colorTrack.append(Wait(partIvalDelay))
|
||||
colorTrack.append(Func(battle.movie.clearRestoreColor))
|
||||
return Parallel(suitTrack, pencilPropTrack, sharpenerPropTrack, sprayTrack, headTrack, torsoTrack, legsTrack, colorTrack, toonTrack)
|
||||
else:
|
||||
|
@ -986,9 +988,10 @@ def doFountainPen(attack):
|
|||
splashTrack.append(Func(nextPart.setColorScale, Vec4(0, 0, 0, 1)))
|
||||
|
||||
splashTrack.append(Func(MovieUtil.removeProp, splash))
|
||||
splashTrack.append(Wait(2.6))
|
||||
splashTrack.append(Wait(2.1))
|
||||
for partNum in range(0, headParts.getNumPaths()):
|
||||
nextPart = headParts.getPath(partNum)
|
||||
splashTrack.append(LerpColorScaleInterval(nextPart, 0.1, Point4(1, 1, 1, 1)))
|
||||
splashTrack.append(Func(nextPart.clearColorScale))
|
||||
|
||||
splashTrack.append(Func(battle.movie.clearRestoreColor))
|
||||
|
|
|
@ -195,13 +195,12 @@ def __createThrownTrapMultiTrack(trap, propList, propName, propPos = None, propH
|
|||
throwTrack.append(Parallel(motionTrack, hprTrack, scaleTrack, soundTrack))
|
||||
elif trapName == 'tnt':
|
||||
trapPoint, trapHpr = battle.getActorPosHpr(suit)
|
||||
trapPoint.setY(MovieUtil.SUIT_TRAP_TNT_DISTANCE - 3.9)
|
||||
trapPoint.setY(MovieUtil.SUIT_TRAP_TNT_DISTANCE - 5.03)
|
||||
trapPoint.setZ(trapPoint.getZ() + 0.4)
|
||||
throwingTrack = createThrowingTrack(thrownProp, trapPoint, duration=throwDuration, parent=battle)
|
||||
hprTrack = LerpHprInterval(thrownProp, 0.9, hpr=Point3(0, 90, 0))
|
||||
hprTrack = LerpHprInterval(thrownProp, 0.9, hpr=Point3(180, 90, 0))
|
||||
scaleTrack = LerpScaleInterval(thrownProp, 0.9, scale=MovieUtil.PNT3_ONE)
|
||||
soundTrack = getSoundTrack('TL_dynamite.ogg', delay=0.8, duration=0.7, node=suit)
|
||||
throwTrack.append(Wait(0.2))
|
||||
throwTrack.append(Parallel(throwingTrack, hprTrack, scaleTrack, soundTrack))
|
||||
elif trapName == 'marbles':
|
||||
trapPoint, trapHpr = battle.getActorPosHpr(suit)
|
||||
|
|
|
@ -91,23 +91,34 @@ def getCloseInterval(distObj, leftDoor, rightDoor, closeSfx, finalCloseSfx, type
|
|||
|
||||
|
||||
def getRideElevatorInterval(type = ELEVATOR_NORMAL):
|
||||
if type == ELEVATOR_VP or type == ELEVATOR_CFO or type == ELEVATOR_CJ:
|
||||
if type == ELEVATOR_VP or type == ELEVATOR_CJ:
|
||||
fovValue = 65
|
||||
yValue = 30
|
||||
zMin = 7.8
|
||||
zMid = 8
|
||||
zMax = 8.2
|
||||
elif type == ELEVATOR_CFO:
|
||||
fovValue = 59
|
||||
yValue = 30
|
||||
zMin = 7.8
|
||||
zMid = 8
|
||||
zMax = 8.2
|
||||
elif type == ELEVATOR_BB:
|
||||
fovValue = 65
|
||||
yValue = 21
|
||||
zMin = 7
|
||||
zMid = 7.2
|
||||
zMax = 7.4
|
||||
else:
|
||||
fovValue = 55
|
||||
|
||||
if type in (ELEVATOR_VP,
|
||||
ELEVATOR_CFO,
|
||||
ELEVATOR_CJ,
|
||||
ELEVATOR_BB):
|
||||
base.camLens.setFov(65)
|
||||
ival = Sequence(Wait(0.5), LerpPosInterval(camera, 0.5, Point3(0, yValue, zMin), startPos=Point3(0, yValue, zMid), blendType='easeOut'), LerpPosInterval(camera, 0.5, Point3(0, yValue, zMid), startPos=Point3(0, yValue, zMin)), Wait(1.0), LerpPosInterval(camera, 0.5, Point3(0, yValue, zMax), startPos=Point3(0, yValue, zMid), blendType='easeOut'), LerpPosInterval(camera, 1.0, Point3(0, yValue, zMid), startPos=Point3(0, yValue, zMax)))
|
||||
else:
|
||||
base.camLens.setFov(55)
|
||||
ival = Sequence(Wait(0.5), LerpPosInterval(camera, 0.5, Point3(0, 14, 3.8), startPos=Point3(0, 14, 4), blendType='easeOut'), LerpPosInterval(camera, 0.5, Point3(0, 14, 4), startPos=Point3(0, 14, 3.8)), Wait(1.0), LerpPosInterval(camera, 0.5, Point3(0, 14, 4.2), startPos=Point3(0, 14, 4), blendType='easeOut'), LerpPosInterval(camera, 1.0, Point3(0, 14, 4), startPos=Point3(0, 14, 4.2)))
|
||||
|
||||
base.camLens.setFov(fovValue)
|
||||
return ival
|
||||
|
|
|
@ -26,7 +26,6 @@ class BossbotCogHQLoader(CogHQLoader.CogHQLoader):
|
|||
|
||||
self.musicFile = random.choice(['phase_12/audio/bgm/Bossbot_Entry_v1.ogg', 'phase_12/audio/bgm/Bossbot_Entry_v2.ogg', 'phase_12/audio/bgm/Bossbot_Entry_v3.ogg'])
|
||||
self.cogHQExteriorModelPath = 'phase_12/models/bossbotHQ/CogGolfHub'
|
||||
self.factoryExteriorModelPath = 'phase_11/models/lawbotHQ/LB_DA_Lobby'
|
||||
self.cogHQLobbyModelPath = 'phase_12/models/bossbotHQ/CogGolfCourtyard'
|
||||
self.geom = None
|
||||
return
|
||||
|
|
|
@ -12,6 +12,7 @@ from otp.level import LevelSpec, LevelConstants
|
|||
from toontown.toonbase import TTLocalizer
|
||||
if __dev__:
|
||||
from otp.level import EditorGlobals
|
||||
from otp.nametag.NametagConstants import *
|
||||
|
||||
def getStageRoomReadyPostName(doId):
|
||||
return 'stageRoomReady-%s' % doId
|
||||
|
|
|
@ -103,6 +103,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
self.deliveryManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
|
||||
if config.GetBool('want-code-redemption', 1):
|
||||
self.codeRedemptionManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER, 'TTCodeRedemptionMgr')
|
||||
self.argManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TTR_ARG_MANAGER, 'ARGManager')
|
||||
|
||||
self.streetSign = None
|
||||
self.furnitureManager = None
|
||||
|
@ -393,16 +394,16 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
|
||||
def __sendGetAvatarDetails(self, avId):
|
||||
#return
|
||||
|
||||
|
||||
self.ttrFriendsManager.d_getAvatarDetails(avId)
|
||||
|
||||
|
||||
return
|
||||
datagram = PyDatagram()
|
||||
avatar = self.__queryAvatarMap[avId].avatar
|
||||
datagram.addUint16(avatar.getRequestID())
|
||||
datagram.addUint32(avId)
|
||||
self.send(datagram)
|
||||
|
||||
|
||||
def n_handleGetAvatarDetailsResp(self, avId, fields):
|
||||
self.notify.info('Query reponse for avId %d' % avId)
|
||||
try:
|
||||
|
@ -410,14 +411,14 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
except:
|
||||
self.notify.warning('Received unexpected or outdated details for avatar %d.' % avId)
|
||||
return
|
||||
|
||||
|
||||
del self.__queryAvatarMap[avId]
|
||||
gotData = 0
|
||||
|
||||
|
||||
dclassName = pad.args[0]
|
||||
dclass = self.dclassesByName[dclassName]
|
||||
#pad.avatar.updateAllRequiredFields(dclass, fields)
|
||||
|
||||
|
||||
# This is a much saner way to load avatar details, and is also
|
||||
# dynamic. This means we aren't restricted in what we pass.
|
||||
# Due to Python's random ordering of dictionaries, we have to pass
|
||||
|
@ -427,15 +428,15 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
|
||||
for currentField in fields:
|
||||
getattr(pad.avatar, currentField[0])(currentField[1])
|
||||
|
||||
|
||||
gotData = 1
|
||||
|
||||
|
||||
|
||||
|
||||
if isinstance(pad.func, types.StringType):
|
||||
messenger.send(pad.func, list((gotData, pad.avatar) + pad.args))
|
||||
else:
|
||||
apply(pad.func, (gotData, pad.avatar) + pad.args)
|
||||
|
||||
|
||||
pad.delayDelete.destroy()
|
||||
|
||||
def handleGetAvatarDetailsResp(self, di):
|
||||
|
@ -507,7 +508,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
|||
|
||||
def enterCredits(self):
|
||||
self.credits.enter()
|
||||
|
||||
|
||||
def killClientAlphaIsOver(self):
|
||||
# Friend error if we don't disconnect... I don't even?!
|
||||
self.disconnect()
|
||||
|
|
|
@ -44,6 +44,20 @@ class ToontownInternalRepository(AstronInternalRepository):
|
|||
|
||||
def getAccountIdFromSender(self):
|
||||
return (self.getMsgSender()>>32) & 0xFFFFFFFF
|
||||
|
||||
def setAllowClientSend(self, avId, dObj, fieldNameList=[]):
|
||||
dg = PyDatagram()
|
||||
dg.addServerHeader(dObj.GetPuppetConnectionChannel(avId), self.ourChannel, CLIENTAGENT_SET_FIELDS_SENDABLE)
|
||||
fieldIds = []
|
||||
for fieldName in fieldNameList:
|
||||
field = dObj.dclass.getFieldByName(fieldName)
|
||||
if field:
|
||||
fieldIds.append(field.getNumber())
|
||||
dg.addUint32(dObj.getDoId())
|
||||
dg.addUint16(len(fieldIds))
|
||||
for fieldId in fieldIds:
|
||||
dg.addUint16(fieldId)
|
||||
self.send(dg)
|
||||
|
||||
def _isValidPlayerLocation(self, parentId, zoneId):
|
||||
if zoneId < 1000 and zoneId != 1:
|
||||
|
|
|
@ -17,7 +17,7 @@ RequestCard = {}
|
|||
|
||||
class DistributedPondBingoManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPondBingoManagerAI")
|
||||
|
||||
|
||||
def __init__(self, air):
|
||||
DistributedObjectAI.__init__(self, air)
|
||||
self.air = air
|
||||
|
@ -29,7 +29,7 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
|
|||
self.shouldStop = False
|
||||
self.lastUpdate = globalClockDelta.getRealNetworkTime()
|
||||
self.cardId = 0
|
||||
|
||||
|
||||
def setPondDoId(self, pondId):
|
||||
self.pond = self.air.doId2do[pondId]
|
||||
|
||||
|
@ -72,7 +72,7 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
|
|||
|
||||
def enableBingo(self):
|
||||
createGame()
|
||||
|
||||
|
||||
def d_enableBingo(self):
|
||||
self.sendUpdate('enableBingo', [])
|
||||
|
||||
|
@ -88,59 +88,59 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
|
|||
if cardId != self.cardId:
|
||||
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to call bingo with an expired cardId!')
|
||||
return
|
||||
av = self.air.doId2do[avId]
|
||||
av = self.air.doId2do.get(avId)
|
||||
if not av:
|
||||
return
|
||||
av.d_announceBingo()
|
||||
self.rewardAll()
|
||||
|
||||
def setJackpot(self, jackpot):
|
||||
self.jackpot = jackpot
|
||||
|
||||
|
||||
def d_setJackpot(self, jackpot):
|
||||
self.sendUpdate('setJackpot', [jackpot])
|
||||
|
||||
|
||||
def b_setJackpot(self, jackpot):
|
||||
self.setJackpot(jackpot)
|
||||
self.d_setJackpot(jackpot)
|
||||
|
||||
|
||||
def activateBingoForPlayer(self, avId):
|
||||
self.sendUpdateToAvatarId(avId, 'setCardState', [self.cardId, self.typeId, self.tileSeed, self.bingoCard.getGameState()])
|
||||
self.sendUpdateToAvatarId(avId, 'setState', [self.state, self.lastUpdate])
|
||||
self.canCall = True
|
||||
|
||||
|
||||
def sendStateUpdate(self):
|
||||
self.lastUpdate = globalClockDelta.getRealNetworkTime()
|
||||
for spot in self.pond.spots:
|
||||
if self.pond.spots[spot].avId == None or self.pond.spots[spot].avId == 0:
|
||||
for spot in self.pond.spots.itervalues():
|
||||
if not spot.avId:
|
||||
continue
|
||||
avId = self.pond.spots[spot].avId
|
||||
self.sendUpdateToAvatarId(avId, 'setState', [self.state, self.lastUpdate])
|
||||
|
||||
self.sendUpdateToAvatarId(spot.avId, 'setState', [self.state, self.lastUpdate])
|
||||
|
||||
def sendCardStateUpdate(self):
|
||||
for spot in self.pond.spots:
|
||||
if self.pond.spots[spot].avId == None or self.pond.spots[spot].avId == 0:
|
||||
for spot in self.pond.spots.itervalues():
|
||||
if not spot.avId:
|
||||
continue
|
||||
avId = self.pond.spots[spot].avId
|
||||
self.sendUpdateToAvatarId(avId, 'setCardState', [self.cardId, self.typeId, self.tileSeed, self.bingoCard.getGameState()])
|
||||
|
||||
self.sendUpdateToAvatarId(spot.avId, 'setCardState', [self.cardId, self.typeId, self.tileSeed, self.bingoCard.getGameState()])
|
||||
|
||||
def sendGameStateUpdate(self, cellId):
|
||||
for spot in self.pond.spots:
|
||||
if self.pond.spots[spot].avId == None or self.pond.spots[spot].avId == 0:
|
||||
for spot in self.pond.spots.itervalues():
|
||||
if not spot.avId:
|
||||
continue
|
||||
avId = self.pond.spots[spot].avId
|
||||
self.sendUpdateToAvatarId(avId, 'updateGameState', [self.bingoCard.getGameState(), cellId])
|
||||
|
||||
self.sendUpdateToAvatarId(spot.avId, 'updateGameState', [self.bingoCard.getGameState(), cellId])
|
||||
|
||||
def sendCanBingo(self):
|
||||
for spot in self.pond.spots:
|
||||
if self.pond.spots[spot].avId == None or self.pond.spots[spot].avId == 0:
|
||||
for spot in self.pond.spots.itervalues():
|
||||
if not spot.avId:
|
||||
continue
|
||||
avId = self.pond.spots[spot].avId
|
||||
self.sendUpdateToAvatarId(avId, 'enableBingo', [])
|
||||
|
||||
self.sendUpdateToAvatarId(spot.avId, 'enableBingo', [])
|
||||
|
||||
def rewardAll(self):
|
||||
self.state = 'Reward'
|
||||
self.sendStateUpdate()
|
||||
for spot in self.pond.spots:
|
||||
av = self.pond.spots[spot].get(avId)
|
||||
for spot in self.pond.spots.itervalues():
|
||||
if not spot.avId:
|
||||
continue
|
||||
av = self.air.doId2do.get(spot.avId)
|
||||
if not av:
|
||||
continue
|
||||
av.addMoney(self.jackpot)
|
||||
|
@ -150,8 +150,6 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
|
|||
taskMgr.doMethodLater(5, DistributedPondBingoManagerAI.startWait, 'startWait%d' % self.getDoId(), [self])
|
||||
taskMgr.remove('finishGame%d' % self.getDoId())
|
||||
|
||||
|
||||
|
||||
def finishGame(self):
|
||||
self.state = 'GameOver'
|
||||
self.sendStateUpdate()
|
||||
|
@ -159,37 +157,36 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
|
|||
self.stopGame()
|
||||
return
|
||||
taskMgr.doMethodLater(5, DistributedPondBingoManagerAI.startWait, 'startWait%d' % self.getDoId(), [self])
|
||||
|
||||
|
||||
def stopGame(self):
|
||||
self.state = 'CloseEvent'
|
||||
self.sendStateUpdate()
|
||||
taskMgr.doMethodLater(10, DistributedPondBingoManagerAI.turnOff, 'turnOff%d' % self.getDoId(), [self])
|
||||
|
||||
|
||||
def turnOff(self):
|
||||
self.state = 'Off'
|
||||
self.sendStateUpdate()
|
||||
|
||||
|
||||
def startIntermission(self):
|
||||
self.state = 'Intermission'
|
||||
self.sendStateUpdate()
|
||||
taskMgr.doMethodLater(300, DistributedPondBingoManagerAI.startWait, 'startWait%d' % self.getDoId(), [self])
|
||||
|
||||
|
||||
def startWait(self):
|
||||
self.state = 'WaitCountdown'
|
||||
self.sendStateUpdate()
|
||||
taskMgr.doMethodLater(15, DistributedPondBingoManagerAI.createGame, 'createGame%d' % self.getDoId(), [self])
|
||||
|
||||
|
||||
def createGame(self):
|
||||
self.canCall = False
|
||||
self.tileSeed = None
|
||||
self.typeId = None
|
||||
self.cardId += 1
|
||||
for spot in self.pond.spots:
|
||||
avId = self.pond.spots[spot].avId
|
||||
request = RequestCard.get(avId)
|
||||
for spot in self.pond.spots.itervalues():
|
||||
request = RequestCard.get(spot.avId)
|
||||
if request:
|
||||
self.typeId, self.tileSeed = request
|
||||
del RequestCard[avId]
|
||||
del RequestCard[spot.avId]
|
||||
if self.cardId > 65535:
|
||||
self.cardId = 0
|
||||
if not self.tileSeed:
|
||||
|
@ -226,8 +223,8 @@ def startBingo():
|
|||
pond.bingoMgr.createGame()
|
||||
pond.bingoMgr.shouldStop = False
|
||||
return "Started Fish Bingo for the current district."
|
||||
|
||||
|
||||
@magicWord(category=CATEGORY_OVERRIDE, types=[str, int])
|
||||
def requestBingoCard(cardName, seed = None):
|
||||
RequestCard[spellbook.getTarget().doId] = ToontownGlobals.BingoCardNames[cardName], seed
|
||||
return "Sent request for the bingo card " + cardName
|
||||
return "Sent request for the bingo card " + cardName
|
|
@ -96,6 +96,7 @@ class FriendsListManager:
|
|||
FriendsListPanel.showFriendsList()
|
||||
|
||||
def __handleClickedNametag(self, avatar, playerId = None):
|
||||
base.hideFriendMargins()
|
||||
self.notify.debug('__handleClickedNametag. doId = %s' % avatar.doId)
|
||||
if avatar.isPet():
|
||||
self.avatarPanel = PetAvatarPanel.PetAvatarPanel(avatar)
|
||||
|
|
|
@ -54,6 +54,7 @@ def showFriendsList():
|
|||
global globalFriendsList
|
||||
if globalFriendsList == None:
|
||||
globalFriendsList = FriendsListPanel()
|
||||
base.hideFriendMargins()
|
||||
globalFriendsList.enter()
|
||||
return
|
||||
|
||||
|
@ -61,6 +62,7 @@ def showFriendsList():
|
|||
def hideFriendsList():
|
||||
if globalFriendsList != None:
|
||||
globalFriendsList.exit()
|
||||
base.showFriendMargins()
|
||||
return
|
||||
|
||||
|
||||
|
@ -97,6 +99,7 @@ def unloadFriendsList():
|
|||
if globalFriendsList != None:
|
||||
globalFriendsList.unload()
|
||||
globalFriendsList = None
|
||||
base.showFriendMargins()
|
||||
return
|
||||
|
||||
|
||||
|
@ -298,6 +301,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
|||
self.ignore(OTPGlobals.PlayerFriendUpdateEvent)
|
||||
base.localAvatar.obscureFriendsListButton(-1)
|
||||
messenger.send(self.doneEvent)
|
||||
base.showFriendMargins()
|
||||
return None
|
||||
|
||||
def __close(self):
|
||||
|
|
|
@ -24,11 +24,7 @@ class GetToonDataFSM(FSM):
|
|||
self.demand('QueryDB')
|
||||
|
||||
def enterQueryDB(self):
|
||||
# TODO: Propper fix. This is just temporary
|
||||
try:
|
||||
self.mgr.air.dbInterface.queryObject(self.mgr.air.dbId, self.avId, self.__queryResponse)
|
||||
except:
|
||||
pass
|
||||
self.mgr.air.dbInterface.queryObject(self.mgr.air.dbId, self.avId, self.__queryResponse)
|
||||
|
||||
def __queryResponse(self, dclass, fields):
|
||||
if dclass != self.mgr.air.dclassesByName['DistributedToonUD']:
|
||||
|
@ -353,7 +349,7 @@ class TTRFriendsManagerUD(DistributedObjectGlobalUD):
|
|||
if not friendIds:
|
||||
# We can now stop, since we have no friends left to clear.
|
||||
return
|
||||
fsm = GetToonDataFSM(self, requesterId, friendIds[0], functools.partial(self.__clearListGotFriendData, friendIds=friendIds[1:]))
|
||||
fsm = GetToonDataFSM(self, requesterId, friendIds[0][0], functools.partial(self.__clearListGotFriendData, friendIds=friendIds[1:]))
|
||||
fsm.start()
|
||||
self.fsms[requesterId] = fsm
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class LawbotHQAI(CogHoodAI):
|
|||
|
||||
def createDoor(self):
|
||||
# DA Offices
|
||||
daInteriorDoor = DistributedCogHQDoorAI(self.air, 0, DoorTypes.EXT_COGHQ, self.HOOD, doorIndex=0)
|
||||
daInteriorDoor = DistributedCogHQDoorAI(self.air, 0, DoorTypes.EXT_COGHQ, self.HOOD, doorIndex=0, lockValue=FADoorCodes.UNLOCKED)
|
||||
daExteriorDoor = DistributedCogHQDoorAI(self.air, 0, DoorTypes.INT_COGHQ, ToontownGlobals.LawbotOfficeExt, doorIndex=0, lockValue=FADoorCodes.UNLOCKED)
|
||||
daExteriorDoor.setOtherDoor(daInteriorDoor)
|
||||
daExteriorDoor.zoneId = self.HOOD
|
||||
|
@ -65,10 +65,10 @@ class LawbotHQAI(CogHoodAI):
|
|||
|
||||
# Create DA Office Elevators.
|
||||
mins = ToontownGlobals.FactoryLaffMinimums[2]
|
||||
self.officeA = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotOfficeInt, 0, minLaff=mins[0])
|
||||
self.officeB = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotOfficeInt, 1, minLaff=mins[1])
|
||||
self.officeC = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotOfficeInt, 2, minLaff=mins[2])
|
||||
self.officeD = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotOfficeInt, 3, minLaff=mins[3])
|
||||
self.officeA = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotStageIntA, 0, minLaff=mins[0])
|
||||
self.officeB = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotStageIntB, 1, minLaff=mins[1])
|
||||
self.officeC = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotStageIntC, 2, minLaff=mins[2])
|
||||
self.officeD = self.createElevator(DistributedLawOfficeElevatorExtAI, self.air.lawOfficeMgr, ToontownGlobals.LawbotOfficeExt, ToontownGlobals.LawbotStageIntD, 3, minLaff=mins[3])
|
||||
|
||||
# Create boarding groups
|
||||
# CJ Boarding Group
|
||||
|
@ -76,4 +76,4 @@ class LawbotHQAI(CogHoodAI):
|
|||
|
||||
# DA Office Boarding Group's
|
||||
self.offices = [self.officeA.doId, self.officeB.doId, self.officeC.doId, self.officeD.doId]
|
||||
self.createBoardingGroup(self.air, self.offices, ToontownGlobals.LawbotOfficeExt)
|
||||
self.createBoardingGroup(self.air, self.offices, ToontownGlobals.LawbotOfficeExt)
|
|
@ -102,6 +102,7 @@ class PetAvatarPanel(AvatarPanel.AvatarPanel):
|
|||
self.__refreshPetInfo(av)
|
||||
|
||||
self.avatar.updateMoodFromServer(refresh)
|
||||
base.hideFriendMargins()
|
||||
return
|
||||
|
||||
def __checkPetProximity(self, task = None):
|
||||
|
@ -267,6 +268,8 @@ class PetAvatarPanel(AvatarPanel.AvatarPanel):
|
|||
AvatarPanel.currentAvatarPanel = None
|
||||
if self.friendsListShown:
|
||||
self.FriendsListPanel.showFriendsList()
|
||||
else:
|
||||
base.showFriendMargins()
|
||||
return
|
||||
|
||||
def __fillPetInfo(self, avatar):
|
||||
|
|
|
@ -432,14 +432,12 @@ class DistributedRaceAI(DistributedObjectAI, FSM):
|
|||
self.requestDelete()
|
||||
|
||||
def requestKart(self):
|
||||
pass
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
accId = self.air.getAccountIdFromSender()
|
||||
if not avId in self.avatars:
|
||||
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to request kart in race they\'re not in!')
|
||||
return
|
||||
for aK in self.avatarKarts:
|
||||
if aK[0] == avId:
|
||||
self.air.doId2do[aK[1]].request('Controlled', avId, accId)
|
||||
self.air.doId2do[aK[1]].request('Controlled', avId)
|
||||
self.air.doId2do[aK[1]].sendUpdate('setInput', [0])
|
||||
|
||||
|
|
|
@ -50,9 +50,8 @@ class DistributedVehicleAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, FSM.
|
|||
|
||||
def requestControl(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
accId = self.air.getAccountIdFromSender()
|
||||
if self.driverId == 0:
|
||||
self.request('Controlled', avId, accId)
|
||||
self.request('Controlled', avId)
|
||||
|
||||
def requestParked(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
|
@ -76,7 +75,7 @@ class DistributedVehicleAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, FSM.
|
|||
def exitParked(self):
|
||||
return None
|
||||
|
||||
def enterControlled(self, avId, accId):
|
||||
def enterControlled(self, avId):
|
||||
self.driverId = avId
|
||||
fieldList = ['setComponentL',
|
||||
'setComponentX',
|
||||
|
@ -100,13 +99,7 @@ class DistributedVehicleAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, FSM.
|
|||
'clearSmoothing',
|
||||
'suggestResync',
|
||||
'returnResync']
|
||||
#self.air.setAllowClientSend(avId, self, fieldList, accId)
|
||||
#hack until CLIENTAGENT_SET_FIELDS_SENDABLE works
|
||||
#probably should not be kept for any longer than it needs to
|
||||
dg = PyDatagram()
|
||||
dg.addServerHeader(self.doId, self.air.ourChannel, STATESERVER_OBJECT_SET_OWNER)
|
||||
dg.addUint64(accId << 32 | avId)
|
||||
self.air.send(dg)
|
||||
self.air.setAllowClientSend(avId, self, fieldNameList=fieldList)
|
||||
self.d_setState('C', self.driverId)
|
||||
|
||||
def exitControlled(self):
|
||||
|
|
|
@ -164,8 +164,6 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
|||
def load(self):
|
||||
ShtikerPage.ShtikerPage.load(self)
|
||||
frameModel = loader.loadModel('phase_3.5/models/gui/suitpage_frame')
|
||||
frameModel.setScale(0.03375, 0.03, 0.045)
|
||||
frameModel.setPos(0, 20, -0.575)
|
||||
self.guiTop = NodePath('guiTop')
|
||||
self.guiTop.reparentTo(self)
|
||||
self.frameNode = NodePath('frameNode')
|
||||
|
@ -176,6 +174,8 @@ class SuitPage(ShtikerPage.ShtikerPage):
|
|||
self.iconNode.reparentTo(self.guiTop)
|
||||
self.enlargedPanelNode = NodePath('enlargedPanelNode')
|
||||
self.enlargedPanelNode.reparentTo(self.guiTop)
|
||||
frameModel.setScale(0.0235, 0.03, 0.045)
|
||||
frameModel.setPos(0, 20, -0.573)
|
||||
frame = frameModel.find('**/frame')
|
||||
frame.wrtReparentTo(self.frameNode)
|
||||
screws = frameModel.find('**/screws')
|
||||
|
|
|
@ -396,11 +396,19 @@ class DistributedBossbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
self.setupBattleFourObjects()
|
||||
self.battleFourStart = globalClock.getFrameTime()
|
||||
self.waitForNextAttack(5)
|
||||
for toonId in self.involvedToons:
|
||||
toon = simbase.air.doId2do.get(toonId)
|
||||
if toon:
|
||||
toon.b_setHealthDisplay(2)
|
||||
|
||||
def exitBattleFour(self):
|
||||
self.recordCeoInfo()
|
||||
for belt in self.foodBelts:
|
||||
belt.goInactive()
|
||||
for toonId in self.involvedToons:
|
||||
toon = simbase.air.doId2do.get(toonId)
|
||||
if toon:
|
||||
toon.b_setHealthDisplay(0)
|
||||
|
||||
def recordCeoInfo(self):
|
||||
didTheyWin = 0
|
||||
|
|
|
@ -76,6 +76,10 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
'reserveSuits': reserveSuits}
|
||||
|
||||
def removeToon(self, avId):
|
||||
toon = simbase.air.doId2do.get(avId)
|
||||
if toon:
|
||||
toon.b_setHealthDisplay(0)
|
||||
|
||||
if self.cranes != None:
|
||||
for crane in self.cranes:
|
||||
crane.removeToon(avId)
|
||||
|
@ -434,6 +438,12 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
taskMgr.remove(taskName)
|
||||
taskMgr.doMethodLater(2, self.__doInitialGoons, taskName)
|
||||
|
||||
for toonId in self.involvedToons:
|
||||
toon = simbase.air.doId2do.get(toonId)
|
||||
if not toon:
|
||||
continue
|
||||
toon.b_setHealthDisplay(2)
|
||||
|
||||
def __doInitialGoons(self, task):
|
||||
self.makeGoon(side='EmergeA')
|
||||
self.makeGoon(side='EmergeB')
|
||||
|
@ -449,6 +459,11 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
self.stopGoons()
|
||||
self.stopHelmets()
|
||||
self.heldObject = None
|
||||
for toonId in self.involvedToons:
|
||||
toon = simbase.air.doId2do.get(toonId)
|
||||
if not toon:
|
||||
continue
|
||||
toon.b_setHealthDisplay(0)
|
||||
return
|
||||
|
||||
def enterVictory(self):
|
||||
|
|
|
@ -283,6 +283,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM
|
|||
toon = simbase.air.doId2do.get(avId)
|
||||
if toon:
|
||||
toon.b_setNumPies(0)
|
||||
toon.b_setHealthDisplay(0)
|
||||
DistributedBossCogAI.DistributedBossCogAI.removeToon(self, avId)
|
||||
|
||||
def enterOff(self):
|
||||
|
@ -295,12 +296,12 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM
|
|||
self.notify.debug('enterElevatro')
|
||||
DistributedBossCogAI.DistributedBossCogAI.enterElevator(self)
|
||||
self.b_setBossDamage(ToontownGlobals.LawbotBossInitialDamage, 0, 0)
|
||||
self.__makeChairs()
|
||||
|
||||
def enterIntroduction(self):
|
||||
self.notify.debug('enterIntroduction')
|
||||
DistributedBossCogAI.DistributedBossCogAI.enterIntroduction(self)
|
||||
self.b_setBossDamage(ToontownGlobals.LawbotBossInitialDamage, 0, 0)
|
||||
self.__makeChairs()
|
||||
|
||||
def exitIntroduction(self):
|
||||
self.notify.debug('exitIntroduction')
|
||||
|
@ -506,6 +507,7 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM
|
|||
toon = simbase.air.doId2do.get(toonId)
|
||||
if toon:
|
||||
toon.__touchedCage = 0
|
||||
toon.b_setHealthDisplay(2)
|
||||
|
||||
for aGavel in self.gavels:
|
||||
aGavel.turnOn()
|
||||
|
@ -624,6 +626,11 @@ class DistributedLawbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FSM
|
|||
self.__resetLawyers()
|
||||
self.__deleteBattleThreeObjects()
|
||||
|
||||
for toonId in self.involvedToons:
|
||||
toon = self.air.doId2do.get(toonId)
|
||||
if toon:
|
||||
toon.b_setHealthDisplay(0)
|
||||
|
||||
def enterNearVictory(self):
|
||||
self.resetBattles()
|
||||
|
||||
|
|
|
@ -373,6 +373,7 @@ class DistributedLawbotBossSuit(DistributedSuitBase.DistributedSuitBase):
|
|||
del self.activeIntervals[throwName]
|
||||
|
||||
def enterStunned(self):
|
||||
self.loop('lured', 0)
|
||||
stunSequence = MovieUtil.createSuitStunInterval(self, 0, ToontownGlobals.LawbotBossLawyerStunTime)
|
||||
seqName = stunSequence.getName()
|
||||
stunSequence.append(Func(self.fsm.request, 'neutral'))
|
||||
|
|
|
@ -313,6 +313,11 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
self.stopStrafes()
|
||||
taskName = self.uniqueName('CagedToonSaySomething')
|
||||
taskMgr.remove(taskName)
|
||||
for toonId in self.involvedToons + self.looseToons:
|
||||
toon = self.air.doId2do.get(toonId)
|
||||
if not toon:
|
||||
continue
|
||||
toon.b_setHealthDisplay(0)
|
||||
|
||||
def enterNearVictory(self):
|
||||
self.resetBattles()
|
||||
|
@ -348,11 +353,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
|
|||
|
||||
def exitVictory(self):
|
||||
self.takeAwayPies()
|
||||
for toonId in self.involvedToons + self.looseToons:
|
||||
toon = self.air.doId2do.get(toonId)
|
||||
if not toon:
|
||||
continue
|
||||
toon.b_setHealthDisplay(0)
|
||||
|
||||
def enterFrolic(self):
|
||||
DistributedBossCogAI.DistributedBossCogAI.enterFrolic(self)
|
||||
|
|
|
@ -622,16 +622,16 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
|
|||
for p in self.frontdoorPointList:
|
||||
blockNumber = p.getLandmarkBuildingIndex()
|
||||
if blockNumber is None:
|
||||
self.notify.warning('No landmark building for (%s) in zone %d' % (repr(p), self.zoneId))
|
||||
self.notify.debug('No landmark building for (%s) in zone %d' % (repr(p), self.zoneId))
|
||||
elif self.buildingFrontDoors.has_key(blockNumber):
|
||||
self.notify.warning('Multiple front doors for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
self.notify.debug('Multiple front doors for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
else:
|
||||
self.buildingFrontDoors[blockNumber] = p
|
||||
|
||||
for p in self.sidedoorPointList:
|
||||
blockNumber = p.getLandmarkBuildingIndex()
|
||||
if blockNumber is None:
|
||||
self.notify.warning('No landmark building for (%s) in zone %d' % (repr(p), self.zoneId))
|
||||
self.notify.debug('No landmark building for (%s) in zone %d' % (repr(p), self.zoneId))
|
||||
elif self.buildingSideDoors.has_key(blockNumber):
|
||||
self.buildingSideDoors[blockNumber].append(p)
|
||||
else:
|
||||
|
@ -642,9 +642,9 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
|
|||
continue
|
||||
blockNumber = bldg.getBlock()[0]
|
||||
if not self.buildingFrontDoors.has_key(blockNumber):
|
||||
self.notify.warning('No front door for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
self.notify.debug('No front door for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
if not self.buildingSideDoors.has_key(blockNumber):
|
||||
self.notify.warning('No side door for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
self.notify.debug('No side door for building %d in zone %d' % (blockNumber, self.zoneId))
|
||||
|
||||
def countNumSuitsPerTrack(self, count):
|
||||
for suit in self.suitList:
|
||||
|
@ -785,7 +785,7 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
|
|||
newSuit.buildingHeight = buildingHeight
|
||||
gotDestination = self.chooseDestination(newSuit, startTime, toonBlockTakeover=toonBlockTakeover, cogdoTakeover=cogdoTakeover, minPathLen=minPathLen, maxPathLen=maxPathLen)
|
||||
if not gotDestination:
|
||||
self.notify.warning("Couldn't get a destination in %d!" % self.zoneId)
|
||||
self.notify.debug("Couldn't get a destination in %d!" % self.zoneId)
|
||||
newSuit.doNotDeallocateChannel = None
|
||||
newSuit.delete()
|
||||
return
|
||||
|
|
|
@ -56,6 +56,7 @@ class SuitAvatarPanel(AvatarPanel.AvatarPanel):
|
|||
base.localAvatar.obscureFriendsListButton(1)
|
||||
self.frame.show()
|
||||
messenger.send('avPanelDone')
|
||||
base.hideFriendMargins()
|
||||
return
|
||||
|
||||
def cleanup(self):
|
||||
|
@ -73,4 +74,5 @@ class SuitAvatarPanel(AvatarPanel.AvatarPanel):
|
|||
def __handleClose(self):
|
||||
self.cleanup()
|
||||
AvatarPanel.currentAvatarPanel = None
|
||||
base.showFriendMargins()
|
||||
return
|
||||
|
|
|
@ -93,7 +93,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
|
|||
self.freeLocalAvatar()
|
||||
|
||||
def handleReport(self):
|
||||
if base.cr.centralLogger.hasReportedPlayer(self.playerId, self.avId):
|
||||
if base.cr.csm.hasReportedPlayer(self.avId):
|
||||
self.alreadyReported()
|
||||
else:
|
||||
self.confirmReport()
|
||||
|
@ -148,12 +148,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
|
|||
def handleReportCategory(self, value):
|
||||
self.cleanupDialog()
|
||||
if value >= 0:
|
||||
cat = [CentralLogger.ReportFoulLanguage,
|
||||
CentralLogger.ReportPersonalInfo,
|
||||
CentralLogger.ReportRudeBehavior,
|
||||
CentralLogger.ReportBadName,
|
||||
CentralLogger.ReportHacking]
|
||||
self.category = cat[value]
|
||||
self.category = value
|
||||
self.confirmReportCategory(value)
|
||||
else:
|
||||
self.requestWalk()
|
||||
|
@ -172,10 +167,7 @@ class AvatarPanelBase(AvatarPanel.AvatarPanel):
|
|||
removed = 0
|
||||
isPlayer = 0
|
||||
if value > 0:
|
||||
if self.category == CentralLogger.ReportHacking:
|
||||
base.cr.centralLogger.reportPlayer(self.category, self.playerId, self.avId)
|
||||
self.category = CentralLogger.ReportRudeBehavior
|
||||
base.cr.centralLogger.reportPlayer(self.category, self.playerId, self.avId)
|
||||
base.cr.csm.d_reportPlayer(self.avId, self.category)
|
||||
if base.cr.isFriend(self.avId):
|
||||
base.cr.removeFriend(self.avId)
|
||||
removed = 1
|
||||
|
|
|
@ -423,7 +423,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
try: return types[self.animalSound]
|
||||
except: return Toon.Toon.getDialogueArray(self, *args)
|
||||
return Toon.Toon.getDialogueArray(self, *args)
|
||||
|
||||
|
||||
|
||||
def setDefaultShard(self, shard):
|
||||
self.defaultShard = shard
|
||||
|
@ -773,7 +773,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
DistributedSmoothNode.DistributedSmoothNode.wrtReparentTo(self, parent)
|
||||
|
||||
def setTutorialAck(self, tutorialAck):
|
||||
self.tutorialAck = tutorialAck
|
||||
self.tutorialAck = 1
|
||||
if config.GetBool('want-toontorial', 1):
|
||||
self.tutorialAck = tutorialAck
|
||||
|
||||
def setEarnedExperience(self, earnedExp):
|
||||
self.earnedExperience = earnedExp
|
||||
|
@ -1645,7 +1647,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
|
||||
def announceBingo(self):
|
||||
self.setChatAbsolute(TTLocalizer.FishBingoBingo, CFSpeech | CFTimeout)
|
||||
|
||||
|
||||
def b_setFishBingoTutorialDone(self, bDone):
|
||||
self.d_setFishBingoTutorialDone(bDone)
|
||||
self.setFishBingoTutorialDone(bDone)
|
||||
|
@ -1815,7 +1817,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
|
||||
def getKartingPersonalBestAll(self):
|
||||
return self.kartingPersonalBest + self.kartingPersonalBest2
|
||||
|
||||
|
||||
|
||||
if hasattr(base, 'wantPets') and base.wantPets:
|
||||
|
||||
|
@ -2674,15 +2676,15 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
|
||||
def setAnimalSound(self, index):
|
||||
self.animalSound = index
|
||||
|
||||
|
||||
def magicFanfare(self):
|
||||
from toontown.battle import Fanfare
|
||||
fanfare = Sequence(Fanfare.makeFanfare(0, self)[0])
|
||||
fanfare.start()
|
||||
|
||||
|
||||
def magicTeleportRequest(self, requesterId):
|
||||
self.sendUpdate('magicTeleportResponse', [requesterId, base.cr.playGame.getPlaceId()])
|
||||
|
||||
|
||||
def magicTeleportInitiate(self, hoodId, zoneId):
|
||||
loaderId = ZoneUtil.getBranchLoaderName(zoneId)
|
||||
whereId = ZoneUtil.getToonWhereName(zoneId)
|
||||
|
@ -2704,7 +2706,11 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
'avId': -1
|
||||
}]
|
||||
base.cr.playGame.getPlace().fsm.forceTransition('teleportOut', requestStatus)
|
||||
|
||||
|
||||
def ping(self, data):
|
||||
# Server sent a ping, better respond before we get booted!
|
||||
self.sendUpdate("pong", [data[::-1]])
|
||||
|
||||
@magicWord(category=CATEGORY_MODERATION)
|
||||
def globaltp():
|
||||
spellbook.getInvoker().sendUpdate('setTeleportOverride', [1])
|
||||
|
@ -2719,7 +2725,7 @@ def sleep():
|
|||
else:
|
||||
base.localAvatar.enableSleeping()
|
||||
return "Sleeping has been activated for the current session."
|
||||
|
||||
|
||||
@magicWord(category=CATEGORY_GUI)
|
||||
def gardenGame():
|
||||
base.localAvatar.game = GardenDropGame.GardenDropGame()
|
||||
|
|
|
@ -261,6 +261,9 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
from toontown.toon.DistributedNPCToonBaseAI import DistributedNPCToonBaseAI
|
||||
if not isinstance(self, DistributedNPCToonBaseAI):
|
||||
self.sendUpdate('setDefaultShard', [self.air.districtId])
|
||||
# Begin ping-pong.
|
||||
if self.isPlayerControlled():
|
||||
self.ping()
|
||||
|
||||
def setLocation(self, parentId, zoneId):
|
||||
messenger.send('toon-left-%s' % self.zoneId, [self])
|
||||
|
@ -284,6 +287,9 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
if not hood in hoodsVisited:
|
||||
hoodsVisited.append(hood)
|
||||
self.b_setHoodsVisited(hoodsVisited)
|
||||
# TODO: REMOVE THIS AFTER ARG IS OVER.
|
||||
if hood == ToontownGlobals.LawbotHQ:
|
||||
self.air.writeServerEvent("arg-complete", avId=self.getDoId(), message="%s has unlocked LBHQ!" % self.getName())
|
||||
|
||||
if zoneId == ToontownGlobals.GoofySpeedway:
|
||||
tpAccess = self.getTeleportAccess()
|
||||
|
@ -331,6 +337,8 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
taskMgr.remove(taskName)
|
||||
taskName = 'next-bothDelivery-%s' % self.doId
|
||||
taskMgr.remove(taskName)
|
||||
taskMgr.remove(self.uniqueName('PingTimeout'))
|
||||
taskMgr.remove(self.uniqueName('PingCooldown'))
|
||||
self.stopToonUp()
|
||||
del self.dna
|
||||
if self.inventory:
|
||||
|
@ -353,6 +361,8 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
self.experience = None
|
||||
taskName = self.uniqueName('next-catalog')
|
||||
taskMgr.remove(taskName)
|
||||
taskMgr.remove(self.uniqueName('PingTimeout'))
|
||||
taskMgr.remove(self.uniqueName('PingCooldown'))
|
||||
return
|
||||
|
||||
def ban(self, comment):
|
||||
|
@ -4471,6 +4481,30 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
def getWebAccountId(self):
|
||||
return self.webAccountId
|
||||
|
||||
def ping(self):
|
||||
self.notify.debug("Pinging %s (%d)." % (self.getName(), self.getDoId()))
|
||||
self.sendUpdate('ping', ["mooBseoGkcauQcM"])
|
||||
taskMgr.doMethodLater(config.GetInt('toon-ping-timeout-delay', 30), self.__noPong, self.uniqueName('PingTimeout'), extraArgs=[])
|
||||
|
||||
def __noPong(self):
|
||||
# No response from the client. Assume this avatar is a ghost.
|
||||
self.notify.debug("Ping timeout %s (%d)." % (self.getName(), self.getDoId()))
|
||||
self.__failedPing = True
|
||||
self.requestDelete()
|
||||
|
||||
def pong(self, data):
|
||||
if hasattr(self, "__failedPing") and self.__failedPing:
|
||||
# Too late to respond, we already failed to respond on time.
|
||||
self.notify.debug("Pong after timeout %s (%d)." % (self.getName(), self.getDoId()))
|
||||
return
|
||||
if data != "McQuackGoesBoom":
|
||||
self.air.writeServerEvent("suspicious", avId=self.getDoId(), issue="Avatar failed to respond to ping with correct data.")
|
||||
self.requestDelete()
|
||||
return
|
||||
self.notify.debug("Pong received from %s (%d) successfully." % (self.getName(), self.getDoId()))
|
||||
taskMgr.remove(self.uniqueName('PingTimeout'))
|
||||
taskMgr.doMethodLater(config.GetInt('toon-ping-cooldown', 120), self.ping, self.uniqueName('PingCooldown'), extraArgs=[])
|
||||
|
||||
@magicWord(category=CATEGORY_CHARACTERSTATS, types=[int, int, int])
|
||||
def setCE(CEValue, CEHood=0, CEExpire=0):
|
||||
"""Set Cheesy Effect of the target."""
|
||||
|
|
|
@ -1789,7 +1789,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
|
||||
holes = self.getHoleActors()
|
||||
hands = self.getRightHands()
|
||||
holeTrack = Track((0.0, Func(showHoles, holes, hands)), (0.5, SoundInterval(self.getSoundTeleport(), node=self)), (1.708, Func(reparentHoles, holes, self)), (3.4, Func(cleanupHoles, holes)))
|
||||
holeTrack = Track((0.0, Func(showHoles, holes, hands)), (0.5, SoundInterval(self.getSoundTeleport(), node=self)), (1.708, Func(reparentHoles, holes, self)), (2.9, Func(self.dropShadow.hide)), (3.4, Func(cleanupHoles, holes)))
|
||||
if hasattr(self, 'uniqueName'):
|
||||
trackName = self.uniqueName('teleportOut')
|
||||
else:
|
||||
|
@ -1829,6 +1829,14 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.holeClipPath = self.attachNewNode(holeClip)
|
||||
self.getGeomNode().setClipPlane(self.holeClipPath)
|
||||
self.nametag3d.setClipPlane(self.holeClipPath)
|
||||
self.nametagLods = []
|
||||
for hi in range(self.headParts.getNumPaths()):
|
||||
head = self.headParts[hi]
|
||||
nameNode = head.attachNewNode('nameNode')
|
||||
self.nametagLods.append(nameNode)
|
||||
tag = self.nametag3d.copyTo(self)
|
||||
tag.wrtReparentTo(nameNode)
|
||||
self.nametag3d.hide()
|
||||
self.track.start(ts)
|
||||
self.setActiveShadow(0)
|
||||
|
||||
|
@ -1862,6 +1870,9 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.getGeomNode().clearClipPlane()
|
||||
if self.nametag3d and not self.nametag3d.isEmpty():
|
||||
self.nametag3d.clearClipPlane()
|
||||
if self.nametagLods:
|
||||
for tag in self.nametagLods:
|
||||
tag.removeNode()
|
||||
if self.holeClipPath:
|
||||
self.holeClipPath.removeNode()
|
||||
self.holeClipPath = None
|
||||
|
@ -2002,7 +2013,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
hole.clearDepthWrite()
|
||||
|
||||
holeTrack.append(Func(restoreHole, hole))
|
||||
toonTrack = Sequence(Wait(0.3), Func(self.getGeomNode().show), Func(self.nametag3d.show), ActorInterval(self, 'jump', startTime=0.45))
|
||||
toonTrack = Sequence(Wait(0.3), Func(self.getGeomNode().show), Func(self.nametag3d.show), Func(self.dropShadow.show), ActorInterval(self, 'jump', startTime=0.45))
|
||||
if hasattr(self, 'uniqueName'):
|
||||
trackName = self.uniqueName('teleportIn')
|
||||
else:
|
||||
|
@ -2020,6 +2031,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.pose('teleport', self.getNumFrames('teleport') - 1)
|
||||
self.getGeomNode().hide()
|
||||
self.nametag3d.hide()
|
||||
self.dropShadow.hide()
|
||||
self.track = self.getTeleportInTrack()
|
||||
if callback:
|
||||
self.track.setDoneEvent(self.track.getName())
|
||||
|
@ -2037,6 +2049,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
if not self.ghostMode and not self.isDisguised:
|
||||
self.getGeomNode().show()
|
||||
self.nametag3d.show()
|
||||
self.dropShadow.show()
|
||||
Emote.globalEmote.releaseAll(self, 'exitTeleportIn')
|
||||
return
|
||||
|
||||
|
|
|
@ -316,6 +316,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
self.accept('updateGroupStatus', self.__checkGroupStatus)
|
||||
|
||||
self.frame.show()
|
||||
base.hideFriendMargins()
|
||||
messenger.send('avPanelDone')
|
||||
|
||||
def disableAll(self):
|
||||
|
@ -454,9 +455,12 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
|
||||
def __handleClose(self):
|
||||
self.cleanup()
|
||||
base.showFriendMargins()
|
||||
AvatarPanelBase.currentAvatarPanel = None
|
||||
if self.friendsListShown:
|
||||
self.FriendsListPanel.showFriendsList()
|
||||
else:
|
||||
base.showFriendMargins()
|
||||
return
|
||||
|
||||
def getAvId(self):
|
||||
|
|
|
@ -315,41 +315,49 @@ class ToonBase(OTPBase.OTPBase):
|
|||
if clickSound:
|
||||
NametagGlobals.setClickSound(clickSound)
|
||||
NametagGlobals.setToon(self.cam)
|
||||
|
||||
self.marginManager = MarginManager()
|
||||
self.margins = self.aspect2d.attachNewNode(self.marginManager, DirectGuiGlobals.MIDGROUND_SORT_INDEX + 1)
|
||||
mm = self.marginManager
|
||||
|
||||
# TODO: Dynamicaly add more and reposition cells
|
||||
padding = 0.0225
|
||||
|
||||
# Order: Top to bottom
|
||||
self.leftCells = [
|
||||
mm.addGridCell(0.2 + padding, -0.45, base.a2dTopLeft),
|
||||
mm.addGridCell(0.2 + padding, -0.9, base.a2dTopLeft),
|
||||
mm.addGridCell(0.2 + padding, -1.35, base.a2dTopLeft)
|
||||
|
||||
# mm.addGridCell(0, 1, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(0, 2, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(0, 3, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop)
|
||||
mm.addGridCell(0.2 + padding, -0.45, base.a2dTopLeft), # Above boarding groups
|
||||
mm.addGridCell(0.2 + padding, -0.9, base.a2dTopLeft), # 1
|
||||
mm.addGridCell(0.2 + padding, -1.35, base.a2dTopLeft) # Below Boarding Groups
|
||||
]
|
||||
|
||||
# Order: Left to right
|
||||
self.bottomCells = [
|
||||
mm.addGridCell(-0.87, 0.2 + padding, base.a2dBottomCenter),
|
||||
mm.addGridCell(-0.43, 0.2 + padding, base.a2dBottomCenter),
|
||||
mm.addGridCell(0.01, 0.2 + padding, base.a2dBottomCenter),
|
||||
mm.addGridCell(0.45, 0.2 + padding, base.a2dBottomCenter),
|
||||
mm.addGridCell(0.89, 0.2 + padding, base.a2dBottomCenter)
|
||||
|
||||
# mm.addGridCell(0.5, 0, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(1.5, 0, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(2.5, 0, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(3.5, 0, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(4.5, 0, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop)
|
||||
mm.addGridCell(-0.87, 0.2 + padding, base.a2dBottomCenter), # To the right of the laff meter
|
||||
mm.addGridCell(-0.43, 0.2 + padding, base.a2dBottomCenter), # 1
|
||||
mm.addGridCell(0.01, 0.2 + padding, base.a2dBottomCenter), # 2
|
||||
mm.addGridCell(0.45, 0.2 + padding, base.a2dBottomCenter), # 3
|
||||
mm.addGridCell(0.89, 0.2 + padding, base.a2dBottomCenter) # To the left of the shtiker book
|
||||
]
|
||||
|
||||
# Order: Bottom to top
|
||||
self.rightCells = [
|
||||
mm.addGridCell(-0.2 - padding, -0.9, base.a2dTopRight),
|
||||
mm.addGridCell(-0.2 - padding, -1.35, base.a2dTopRight)
|
||||
|
||||
# mm.addGridCell(5, 1.8, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop),
|
||||
# mm.addGridCell(5, 0.9, base.a2dLeft, base.a2dRight, base.a2dBottom, base.a2dTop)
|
||||
mm.addGridCell(-0.2 - padding, -1.35, base.a2dTopRight), # Above the street map
|
||||
mm.addGridCell(-0.2 - padding, -0.9, base.a2dTopRight), # Below the friends list
|
||||
mm.addGridCell(-0.2 - padding, -0.45, base.a2dTopRight) # Behind the friends list
|
||||
]
|
||||
|
||||
def hideFriendMargins(self):
|
||||
middleCell = self.rightCells[1]
|
||||
topCell = self.rightCells[2]
|
||||
|
||||
self.setCellsAvailable([middleCell, topCell], False)
|
||||
|
||||
def showFriendMargins(self):
|
||||
middleCell = self.rightCells[1]
|
||||
topCell = self.rightCells[2]
|
||||
|
||||
self.setCellsAvailable([middleCell, topCell], True)
|
||||
|
||||
def setCellsAvailable(self, cell_list, available):
|
||||
for cell in cell_list:
|
||||
self.marginManager.setCellAvailable(cell, available)
|
||||
|
|
|
@ -1418,13 +1418,12 @@ ColorNoChat = (0.8,
|
|||
0.5,
|
||||
0.1,
|
||||
1)
|
||||
FactoryLaffMinimums = [(0, 31),
|
||||
(0, 66, 71),
|
||||
(0,
|
||||
81,
|
||||
86,
|
||||
96),
|
||||
(0, 101, 106)]
|
||||
FactoryLaffMinimums = [
|
||||
(0, 31), # SBHQ Factory
|
||||
(0, 66, 71), # CBHQ Mint
|
||||
(0, 81, 86, 96), # LBHQ DA
|
||||
(0, 101, 106) # BBHQ Golf
|
||||
]
|
||||
PICNIC_COUNTDOWN_TIME = 60
|
||||
BossbotRTIntroStartPosHpr = (0,
|
||||
-64,
|
||||
|
|
90
toontown/uberdog/ARGManager.py
Normal file
90
toontown/uberdog/ARGManager.py
Normal file
|
@ -0,0 +1,90 @@
|
|||
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
from otp.speedchat import SpeedChatGlobals
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from toontown.hood import ZoneUtil
|
||||
from pandac.PandaModules import Vec3
|
||||
|
||||
# Portable Hole settings
|
||||
POSITION_TOLERANCE = 10
|
||||
Hood2Details = {
|
||||
# hood : [pos, speedchatIndex, destination]
|
||||
ToontownGlobals.DonaldsDock: [(-23, 5, 6), 1522, 2714], # Bring it on!
|
||||
ToontownGlobals.ToontownCentral: [(93, -106, 3), 1603, 3823], # I like this game!
|
||||
ToontownGlobals.TheBrrrgh: [(-111, -41, 9), 1003, 4612], # Follow me.
|
||||
ToontownGlobals.MinniesMelodyland: [(0, -20, -16), 1209, 5602], # I found what you need.
|
||||
ToontownGlobals.DaisyGardens: [(1, 91, 0), 1134, 9501], # Don't wait for me.
|
||||
ToontownGlobals.DonaldsDreamland: [(48, -96, 0), 5500, 17000], # :)
|
||||
ToontownGlobals.OutdoorZone: [(-46, -140, 0), 1556, 11000], # Go for the weakest Cog first.
|
||||
ToontownGlobals.SellbotHQ: [(39, -37, 10), 1555, 12000], # Let's all go for the same Cog.
|
||||
ToontownGlobals.CashbotHQ: [(-78, -134, -63), 1558, 13000], # Save your powerful Gags.
|
||||
}
|
||||
Interior2Messages = {
|
||||
3823: ["Welcome, Doctor Surlee! You are on your way to see KOOKY CINEPLEX", "-4"], # DD to TTC
|
||||
5602: ["Hello, Doctor Surlee! Taking you to the PRECIPITATION FOUNDATION", "6,"], # TTC to TB
|
||||
4612: ["Hi, Doctor Surlee! Sending you to DR. FRET'S DENTISTRY", ","], # TB to MML
|
||||
2714: ["Welcome, Dr. Surlee! You are on route to ARTIE CHOKE'S NECKTIES", "-1"], # MML to DG
|
||||
9501: ["Good afternoon, Doctor Surlee! Setting destination to the LULLABY LIBRARY", "4"], # DG to DDL
|
||||
17000: ["Good evening, Dr. Surlee! You are on route to CHIP 'N DALE'S MINIGOLF", "0"], # DDL to AA
|
||||
11000: ["Greetings, Doctor Surlee. You will soon arrive at SELLBOT HQ.", "Do you think they're going too far?"],
|
||||
12000: ["Greetings, Doctor Surlee. You are now going to CASHBOT HQ.", "Well there's certainly no stopping them now."],
|
||||
13000: ["Greetings, Doctor Surlee. Taking you to ERROR: UNKNOWN LOCATION", "They are indeed quite clever."], # CBHQ (unlocks LBHQ)
|
||||
}
|
||||
|
||||
class ARGManager(DistributedObjectGlobal):
|
||||
"""
|
||||
This is a client-view of the manager that handles everything to do
|
||||
with the portable hole ARG event.
|
||||
"""
|
||||
|
||||
notify = directNotify.newCategory('ARGManager')
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObjectGlobal.__init__(self, cr)
|
||||
self.setupPortableHoleEvent()
|
||||
|
||||
def disable(self):
|
||||
self.cleanupPortableHoleEvent()
|
||||
DistributedObjectGlobal.disable(self)
|
||||
|
||||
def delete(self):
|
||||
self.cleanupPortableHoleEvent()
|
||||
DistributedObjectGlobal.delete(self)
|
||||
|
||||
def setupPortableHoleEvent(self):
|
||||
def phraseSaid(phraseId):
|
||||
position, speedchatIndex, destination = Hood2Details.get(base.cr.playGame.getPlace().getZoneId(), [None, None, None])
|
||||
if not position or not speedchatIndex or not destination:
|
||||
return
|
||||
if speedchatIndex != phraseId:
|
||||
return
|
||||
dummyNode = base.cr.playGame.getPlace().loader.geom.attachNewNode("arg_dummy")
|
||||
dummyNode.setPos(*position)
|
||||
if Vec3(base.localAvatar.getPos(dummyNode)).length() > POSITION_TOLERANCE:
|
||||
return
|
||||
dummyNode.removeNode()
|
||||
msgBefore, msgAfter = Interior2Messages.get(destination, [None, None])
|
||||
if not msgBefore:
|
||||
self.notify.warning("Interior %d has no message definitions!" % destination)
|
||||
return
|
||||
base.localAvatar.setSystemMessage(0, msgBefore)
|
||||
requestStatus = [{
|
||||
'loader': ZoneUtil.getBranchLoaderName(destination),
|
||||
'where': ZoneUtil.getToonWhereName(destination),
|
||||
'how': 'teleportIn',
|
||||
'hoodId': ZoneUtil.getCanonicalHoodId(destination),
|
||||
'zoneId': destination,
|
||||
'shardId': None,
|
||||
'avId': -1,
|
||||
}]
|
||||
base.cr.playGame.getPlace().fsm.forceTransition('teleportOut', requestStatus)
|
||||
# NOTE: This is somewhat hacky. A better solution would be to fire this once the placeFSM
|
||||
# successfully loads the destination. Perhaps this can be fired off upon zone change?
|
||||
taskMgr.doMethodLater(10, base.localAvatar.setSystemMessage, self.uniqueName("arg-after-msg"), extraArgs=[0, msgAfter])
|
||||
if destination == 13000:
|
||||
taskMgr.doMethodLater(15, base.localAvatar.setSystemMessage, self.uniqueName("arg-after-msg"), extraArgs=[0, "Perhaps, however I don't believe they realize what they have unfolded."])
|
||||
taskMgr.doMethodLater(20, base.localAvatar.setSystemMessage, self.uniqueName("arg-after-msg"), extraArgs=[0, "I don't think you have either."])
|
||||
self.accept(SpeedChatGlobals.SCStaticTextMsgEvent, phraseSaid)
|
||||
|
||||
def cleanupPortableHoleEvent(self):
|
||||
self.ignore(SpeedChatGlobals.SCStaticTextMsgEvent)
|
4
toontown/uberdog/ARGManagerAI.py
Normal file
4
toontown/uberdog/ARGManagerAI.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
from direct.distributed.DistributedObjectGlobalAI import DistributedObjectGlobalAI
|
||||
|
||||
class ARGManagerAI(DistributedObjectGlobalAI):
|
||||
pass
|
4
toontown/uberdog/ARGManagerUD.py
Normal file
4
toontown/uberdog/ARGManagerUD.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
from direct.distributed.DistributedObjectGlobalUD import DistributedObjectGlobalUD
|
||||
|
||||
class ARGManagerUD(DistributedObjectGlobalUD):
|
||||
pass
|
|
@ -13,6 +13,7 @@ class ClientServicesManager(DistributedObjectGlobal):
|
|||
notify = directNotify.newCategory('ClientServicesManager')
|
||||
|
||||
systemMessageSfx = None
|
||||
avIdsReportedThisSession = []
|
||||
|
||||
# --- LOGIN LOGIC ---
|
||||
def performLogin(self, doneEvent):
|
||||
|
@ -110,3 +111,14 @@ class ClientServicesManager(DistributedObjectGlobal):
|
|||
self.systemMessageSfx = base.loadSfx('phase_3/audio/sfx/clock03.ogg')
|
||||
if self.systemMessageSfx:
|
||||
base.playSfx(self.systemMessageSfx)
|
||||
|
||||
def hasReportedPlayer(self, avId):
|
||||
return avId in self.avIdsReportedThisSession
|
||||
|
||||
def d_reportPlayer(self, avId, category):
|
||||
# Drop-in replacement for Disney's "CentralLogger" reporting object.
|
||||
if self.hasReportedPlayer(avId):
|
||||
# We've already reported this avId.
|
||||
return
|
||||
self.avIdsReportedThisSession.append(avId)
|
||||
self.sendUpdate('reportPlayer', [avId, category])
|
||||
|
|
|
@ -14,6 +14,11 @@ import hashlib
|
|||
import json
|
||||
from ClientServicesManager import FIXED_KEY
|
||||
|
||||
REPORT_REASONS = [
|
||||
'MODERATION_FOUL_LANGUAGE', 'MODERATION_PERSONAL_INFO',
|
||||
'MODERATION_RUDE_BEHAVIOR', 'MODERATION_BAD_NAME', 'MODERATION_HACKING',
|
||||
]
|
||||
|
||||
# --- ACCOUNT DATABASES ---
|
||||
class LocalAccountDB:
|
||||
def __init__(self, csm):
|
||||
|
@ -964,3 +969,13 @@ class ClientServicesManagerUD(DistributedObjectGlobalUD):
|
|||
self.runAccountFSM(LoadAvatarFSM, avId)
|
||||
else:
|
||||
self.runAccountFSM(UnloadAvatarFSM, currentAvId)
|
||||
|
||||
def reportPlayer(self, avId, category):
|
||||
reporterId = self.air.getAvatarIdFromSender()
|
||||
if len(REPORT_REASONS) <= category:
|
||||
self.air.writeServerEvent("suspicious", avId=reporterId, issue="Invalid report reason index (%d) sent by avatar." % category)
|
||||
return
|
||||
self.air.writeServerEvent("player-reported", reporterId=reporterId, avId=avId, category=REPORT_REASONS[category])
|
||||
# TODO: RPC call to web to say this person was reported.
|
||||
# This will require a database query to fetch the webId associated with the reported player.
|
||||
# Either that, or the web can make an RPC call to the server to get webId from avId.
|
Loading…
Reference in a new issue