mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
parent
1e4bad8c6b
commit
35b646c4e6
279 changed files with 1050 additions and 967 deletions
|
@ -32,3 +32,7 @@ print 'Encrypted string:', encoded
|
||||||
# decode the encoded string
|
# decode the encoded string
|
||||||
decoded = DecodeAES(cipher, encoded)
|
decoded = DecodeAES(cipher, encoded)
|
||||||
print 'Decrypted string:', decoded
|
print 'Decrypted string:', decoded
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,50 +29,50 @@ def generate_token(accessLevel):
|
||||||
|
|
||||||
random.seed()
|
random.seed()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
res = client.ping(generate_token(700), 12345)
|
res = client.ping(generate_token(700), 12345)
|
||||||
if res != 12345:
|
if res != 12345:
|
||||||
print "Is the server accessable?\n"
|
print "Is the server accessable?\n"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
# How many times a day is this script going to be called?
|
# How many times a day is this script going to be called?
|
||||||
ChecksPerDay = 60.0*24.0 # Once a minute
|
ChecksPerDay = 60.0*24.0 # Once a minute
|
||||||
InvasionsPerDay = 72.0 # How many invasions a day per district
|
InvasionsPerDay = 72.0 # How many invasions a day per district
|
||||||
BaseInvasionChance = InvasionsPerDay/ChecksPerDay
|
BaseInvasionChance = InvasionsPerDay/ChecksPerDay
|
||||||
|
|
||||||
safeHarbor = {'Wacky Falls'}
|
safeHarbor = {'Wacky Falls'}
|
||||||
superDistricts = {'Nuttyboro'}
|
superDistricts = {'Nuttyboro'}
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
shards = client.listShards(generate_token(700))
|
shards = client.listShards(generate_token(700))
|
||||||
print shards
|
print shards
|
||||||
count = 0
|
count = 0
|
||||||
for skey in shards:
|
for skey in shards:
|
||||||
shard = shards[skey]
|
shard = shards[skey]
|
||||||
if shard['invasion'] != None:
|
if shard['invasion'] != None:
|
||||||
count = count + 1
|
count = count + 1
|
||||||
for skey in shards:
|
for skey in shards:
|
||||||
shard = shards[skey]
|
shard = shards[skey]
|
||||||
if shard['invasion'] == None:
|
if shard['invasion'] == None:
|
||||||
if shard['name'] in superDistricts:
|
if shard['name'] in superDistricts:
|
||||||
typ = int(float(random.random()) * 4.0)
|
typ = int(float(random.random()) * 4.0)
|
||||||
suit = int(float(random.random()) * 4.0) + 4 # Bias the cogs to be big
|
suit = int(float(random.random()) * 4.0) + 4 # Bias the cogs to be big
|
||||||
client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0)
|
client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
||||||
if count < 3:
|
if count < 3:
|
||||||
for skey in shards:
|
for skey in shards:
|
||||||
shard = shards[skey]
|
shard = shards[skey]
|
||||||
if shard['invasion'] == None and not shard['name'] in safeHarbor:
|
if shard['invasion'] == None and not shard['name'] in safeHarbor:
|
||||||
r = random.random()
|
r = random.random()
|
||||||
if r < BaseInvasionChance and not shard['name'] in superDistricts:
|
if r < BaseInvasionChance and not shard['name'] in superDistricts:
|
||||||
typ = int(float(random.random()) * 4.0)
|
typ = int(float(random.random()) * 4.0)
|
||||||
suit = int(float(random.random()) * 8.0)
|
suit = int(float(random.random()) * 8.0)
|
||||||
client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0)
|
client.startInvasion(generate_token(700), int(skey), typ, suit, 0, 0)
|
||||||
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
||||||
print "tick..(was %d)\n"%(count)
|
print "tick..(was %d)\n"%(count)
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
time.sleep(300)
|
time.sleep(300)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class MagicWordManagerAI(DistributedObjectAI):
|
||||||
if not 'DistributedToonAI' in str(self.air.doId2do.get(targetId)):
|
if not 'DistributedToonAI' in str(self.air.doId2do.get(targetId)):
|
||||||
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['Target is not a toon object!'])
|
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['Target is not a toon object!'])
|
||||||
return
|
return
|
||||||
|
|
||||||
if not invoker:
|
if not invoker:
|
||||||
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['missing invoker'])
|
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['missing invoker'])
|
||||||
return
|
return
|
||||||
|
@ -56,20 +56,21 @@ def help(wordName=None):
|
||||||
return 'Did you mean %s' % (spellbook.words.get(key).name)
|
return 'Did you mean %s' % (spellbook.words.get(key).name)
|
||||||
return 'I have no clue what %s is referring to' % (wordName)
|
return 'I have no clue what %s is referring to' % (wordName)
|
||||||
return word.doc
|
return word.doc
|
||||||
|
|
||||||
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[])
|
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[])
|
||||||
def words():
|
def words():
|
||||||
accessLevel = spellbook.getInvoker().getAdminAccess()
|
accessLevel = spellbook.getInvoker().getAdminAccess()
|
||||||
wordString = None
|
wordString = None
|
||||||
for key in spellbook.words:
|
for key in spellbook.words:
|
||||||
word = spellbook.words.get(key)
|
word = spellbook.words.get(key)
|
||||||
if word.access <= accessLevel:
|
if word.access <= accessLevel:
|
||||||
if wordString is None:
|
if wordString is None:
|
||||||
wordString = key
|
wordString = key
|
||||||
else:
|
else:
|
||||||
wordString += ", ";
|
wordString += ", ";
|
||||||
wordString += key;
|
wordString += key;
|
||||||
if wordString is None:
|
if wordString is None:
|
||||||
return "You are chopped liver"
|
return "You are chopped liver"
|
||||||
else:
|
else:
|
||||||
return wordString
|
return wordString
|
||||||
|
|
||||||
|
|
|
@ -125,4 +125,4 @@ class TimeManager(DistributedObject.DistributedObject):
|
||||||
info = PythonUtil.describeException()
|
info = PythonUtil.describeException()
|
||||||
self.notify.info('Client exception: %s' % info)
|
self.notify.info('Client exception: %s' % info)
|
||||||
self.sendUpdate('setExceptionInfo', [info])
|
self.sendUpdate('setExceptionInfo', [info])
|
||||||
self.cr.flush()
|
self.cr.flush()
|
|
@ -10,13 +10,13 @@ class TimeManagerAI(DistributedObjectAI):
|
||||||
def __init__(self, air):
|
def __init__(self, air):
|
||||||
DistributedObjectAI.__init__(self, air)
|
DistributedObjectAI.__init__(self, air)
|
||||||
self.avId2DcReason = {}
|
self.avId2DcReason = {}
|
||||||
|
|
||||||
def requestServerTime(self, context):
|
def requestServerTime(self, context):
|
||||||
self.sendUpdateToAvatarId(self.air.getAvatarIdFromSender(), 'serverTime', [context, globalClockDelta.getRealNetworkTime(bits=32), int(time.time())])
|
self.sendUpdateToAvatarId(self.air.getAvatarIdFromSender(), 'serverTime', [context, globalClockDelta.getRealNetworkTime(bits=32), int(time.time())])
|
||||||
|
|
||||||
def setDisconnectReason(self, reason):
|
def setDisconnectReason(self, reason):
|
||||||
avId = self.air.getAvatarIdFromSender()
|
avId = self.air.getAvatarIdFromSender()
|
||||||
|
|
||||||
if reason == OTPGlobals.DisconnectNone and avId in self.avId2DcReason:
|
if reason == OTPGlobals.DisconnectNone and avId in self.avId2DcReason:
|
||||||
del self.avId2DcReason[avId]
|
del self.avId2DcReason[avId]
|
||||||
else:
|
else:
|
||||||
|
@ -25,6 +25,6 @@ class TimeManagerAI(DistributedObjectAI):
|
||||||
def setExceptionInfo(self, exception):
|
def setExceptionInfo(self, exception):
|
||||||
avId = self.air.getAvatarIdFromSender()
|
avId = self.air.getAvatarIdFromSender()
|
||||||
self.air.writeServerEvent('client-exception', avId, exception)
|
self.air.writeServerEvent('client-exception', avId, exception)
|
||||||
|
|
||||||
def getDisconnectReason(self, avId):
|
def getDisconnectReason(self, avId):
|
||||||
return self.avId2DcReason.get(avId, 0)
|
return self.avId2DcReason.get(avId, 0)
|
|
@ -12,4 +12,4 @@ class AvatarHandle:
|
||||||
|
|
||||||
def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags):
|
def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags):
|
||||||
newText, scrubbed = localAvatar.scrubTalk(chat, mods)
|
newText, scrubbed = localAvatar.scrubTalk(chat, mods)
|
||||||
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed)
|
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed)
|
|
@ -15,3 +15,4 @@ class DistributedAvatarUD(DistributedObjectUD):
|
||||||
|
|
||||||
def confirmAvOnShard(self, todo0, todo1):
|
def confirmAvOnShard(self, todo0, todo1):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
|
||||||
|
|
||||||
def teleportQuery(self, requesterId):
|
def teleportQuery(self, requesterId):
|
||||||
avatar = base.cr.identifyFriend(requesterId)
|
avatar = base.cr.identifyFriend(requesterId)
|
||||||
|
|
||||||
if avatar is None:
|
if avatar is None:
|
||||||
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
|
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
|
||||||
elif base.localAvatar.isIgnored(requesterId):
|
elif base.localAvatar.isIgnored(requesterId):
|
||||||
|
@ -319,7 +319,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
|
||||||
else:
|
else:
|
||||||
if self.failedTeleportMessageOk(requesterId):
|
if self.failedTeleportMessageOk(requesterId):
|
||||||
self.setSystemMessage(requesterId, OTPLocalizer.WhisperFailedVisit % avatar.getName())
|
self.setSystemMessage(requesterId, OTPLocalizer.WhisperFailedVisit % avatar.getName())
|
||||||
|
|
||||||
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
|
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
|
||||||
|
|
||||||
def failedTeleportMessageOk(self, fromId):
|
def failedTeleportMessageOk(self, fromId):
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
|
||||||
|
|
||||||
def clickedWhisper(self, doId):
|
def clickedWhisper(self, doId):
|
||||||
friend = base.cr.identifyFriend(doId)
|
friend = base.cr.identifyFriend(doId)
|
||||||
|
|
||||||
if friend != None:
|
if friend != None:
|
||||||
messenger.send('clickedNametag', [friend])
|
messenger.send('clickedNametag', [friend])
|
||||||
self.chatMgr.whisperTo(friend.getName(), doId)
|
self.chatMgr.whisperTo(friend.getName(), doId)
|
||||||
|
|
|
@ -125,4 +125,4 @@ class ShadowCaster:
|
||||||
|
|
||||||
def __globalDropShadowGrayLevelChanged(self):
|
def __globalDropShadowGrayLevelChanged(self):
|
||||||
if self.dropShadow != None:
|
if self.dropShadow != None:
|
||||||
self.dropShadow.setColor(0.0, 0.0, 0.0, globalDropShadowGrayLevel, 1)
|
self.dropShadow.setColor(0.0, 0.0, 0.0, globalDropShadowGrayLevel, 1)
|
|
@ -52,3 +52,4 @@ def chatmode(mode=-1):
|
||||||
return "Chat mode 1 is reserved for moderators."
|
return "Chat mode 1 is reserved for moderators."
|
||||||
base.cr.chatAgent.chatMode = mode
|
base.cr.chatAgent.chatMode = mode
|
||||||
return "You are now talking in the %s chat mode." % mode2name.get(mode, "N/A")
|
return "You are now talking in the %s chat mode." % mode2name.get(mode, "N/A")
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,4 @@ class ChatAgentAI:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def setWhiteList(self, todo0):
|
def setWhiteList(self, todo0):
|
||||||
pass
|
pass
|
|
@ -134,3 +134,6 @@ class ChatAgentUD(DistributedObjectGlobalUD):
|
||||||
offset += len(word) + 1
|
offset += len(word) + 1
|
||||||
|
|
||||||
return modifications
|
return modifications
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -296,4 +296,4 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def exitOtherDialog(self):
|
def exitOtherDialog(self):
|
||||||
pass
|
pass
|
|
@ -275,7 +275,7 @@ pose:eh
|
||||||
pound:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself
|
pound:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself
|
||||||
pounds:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself
|
pounds:ed,ing,me,myself,her,herself,him,himself,of,off,ourselves,they,themselves,us,you,yourself
|
||||||
pour:on,no
|
pour:on,no
|
||||||
pro:st i tut,stick tut
|
pro:st i tut,stick tut
|
||||||
purr:cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
purr:cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
||||||
push:y,ye,cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
push:y,ye,cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
||||||
put:cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
put:cee,say,says,sea,seas,see,sees,she,shes,she's,si
|
||||||
|
|
|
@ -147,7 +147,7 @@ class TalkAssistant(DirectObject.DirectObject):
|
||||||
|
|
||||||
def findAvatarName(self, id):
|
def findAvatarName(self, id):
|
||||||
info = base.cr.identifyAvatar(id)
|
info = base.cr.identifyAvatar(id)
|
||||||
|
|
||||||
return info.getName() if info else ''
|
return info.getName() if info else ''
|
||||||
|
|
||||||
def whiteListFilterMessage(self, text):
|
def whiteListFilterMessage(self, text):
|
||||||
|
@ -457,4 +457,4 @@ class TalkAssistant(DirectObject.DirectObject):
|
||||||
self.historyComplete.append(newMessage)
|
self.historyComplete.append(newMessage)
|
||||||
self.addToHistoryDoId(newMessage, localAvatar.doId)
|
self.addToHistoryDoId(newMessage, localAvatar.doId)
|
||||||
messenger.send('NewOpenMessage', [newMessage])
|
messenger.send('NewOpenMessage', [newMessage])
|
||||||
return error
|
return error
|
|
@ -37,4 +37,4 @@ class WhiteList:
|
||||||
while j < self.numWords and self.words[j].startswith(text):
|
while j < self.numWords and self.words[j].startswith(text):
|
||||||
j += 1
|
j += 1
|
||||||
|
|
||||||
return self.words[i:j]
|
return self.words[i:j]
|
||||||
|
|
|
@ -3,3 +3,4 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||||
|
|
||||||
class AccountAI(DistributedObjectAI):
|
class AccountAI(DistributedObjectAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("AccountAI")
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@ from direct.distributed.DistributedObjectUD import DistributedObjectUD
|
||||||
|
|
||||||
class AccountUD(DistributedObjectUD):
|
class AccountUD(DistributedObjectUD):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountUD")
|
notify = DirectNotifyGlobal.directNotify.newCategory("AccountUD")
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,4 @@ from direct.directnotify import DirectNotifyGlobal
|
||||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||||
|
|
||||||
class DistributedDirectoryAI(DistributedObjectAI):
|
class DistributedDirectoryAI(DistributedObjectAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI")
|
|
@ -9,3 +9,4 @@ class DistributedDistrictUD(DistributedObjectUD):
|
||||||
|
|
||||||
def setAvailable(self, todo0):
|
def setAvailable(self, todo0):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -110,4 +110,4 @@ class FriendManagerAI(DistributedObjectAI):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def inviteeCancelFriendQuery(self, todo0):
|
def inviteeCancelFriendQuery(self, todo0):
|
||||||
pass
|
pass
|
|
@ -30,4 +30,4 @@ class AmbientSound(BasicEntities.NodePathEntity):
|
||||||
self.soundIval.pause()
|
self.soundIval.pause()
|
||||||
del self.soundIval
|
del self.soundIval
|
||||||
if hasattr(self, 'sound'):
|
if hasattr(self, 'sound'):
|
||||||
del self.sound
|
del self.sound
|
|
@ -31,4 +31,4 @@ class CollisionSolidEntity(BasicEntities.NodePathEntity):
|
||||||
if self.collNodePath is not None:
|
if self.collNodePath is not None:
|
||||||
self.collNodePath.removeNode()
|
self.collNodePath.removeNode()
|
||||||
self.collNodePath = None
|
self.collNodePath = None
|
||||||
return
|
return
|
|
@ -34,4 +34,4 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI, Entity.Entity
|
||||||
return self.levelDoId
|
return self.levelDoId
|
||||||
|
|
||||||
def getEntId(self):
|
def getEntId(self):
|
||||||
return self.entId
|
return self.entId
|
|
@ -21,3 +21,4 @@ class DistributedInteractiveEntityAI(DistributedEntityAI):
|
||||||
|
|
||||||
def setState(self, todo0, todo1):
|
def setState(self, todo0, todo1):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -95,4 +95,4 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
||||||
av.takeDamage(penalty)
|
av.takeDamage(penalty)
|
||||||
if av.getHp() <= 0:
|
if av.getHp() <= 0:
|
||||||
av.inventory.zeroInv()
|
av.inventory.zeroInv()
|
||||||
av.d_setInventory(av.inventory.makeNetString())
|
av.d_setInventory(av.inventory.makeNetString())
|
|
@ -84,4 +84,4 @@ class Entity(DirectObject):
|
||||||
return
|
return
|
||||||
|
|
||||||
def setAttribInit(self, attrib, value):
|
def setAttribInit(self, attrib, value):
|
||||||
self.__dict__[attrib] = value
|
self.__dict__[attrib] = value
|
|
@ -30,4 +30,4 @@ class EntrancePoint(BasicEntities.NodePathEntity):
|
||||||
def destroyEntrancePoint(self):
|
def destroyEntrancePoint(self):
|
||||||
if self.entranceId >= 0:
|
if self.entranceId >= 0:
|
||||||
if self.entranceId in self.level.entranceId2entity:
|
if self.entranceId in self.level.entranceId2entity:
|
||||||
del self.level.entranceId2entity[self.entranceId]
|
del self.level.entranceId2entity[self.entranceId]
|
|
@ -216,4 +216,4 @@ class Level:
|
||||||
self.createdEntIds.remove(entId)
|
self.createdEntIds.remove(entId)
|
||||||
|
|
||||||
def handleVisChange(self):
|
def handleVisChange(self):
|
||||||
pass
|
pass
|
|
@ -1,4 +1,4 @@
|
||||||
MinZoneNum = 0
|
MinZoneNum = 0
|
||||||
MaxZoneNum = 999
|
MaxZoneNum = 999
|
||||||
UberZoneEntId = 0
|
UberZoneEntId = 0
|
||||||
LevelMgrEntId = 1000
|
LevelMgrEntId = 1000
|
|
@ -30,4 +30,4 @@ class LevelMgrAI(LevelMgrBase.LevelMgrBase):
|
||||||
zoneNums.sort()
|
zoneNums.sort()
|
||||||
self.level.zoneIds = []
|
self.level.zoneIds = []
|
||||||
for zoneNum in zoneNums:
|
for zoneNum in zoneNums:
|
||||||
self.level.zoneIds.append(self.level.zoneNum2zoneId[zoneNum])
|
self.level.zoneIds.append(self.level.zoneNum2zoneId[zoneNum])
|
|
@ -25,4 +25,4 @@ class LocatorEntity(Entity.Entity, NodePath):
|
||||||
LocatorEntity.notify.warning("could not find '%s'" % self.searchPath)
|
LocatorEntity.notify.warning("could not find '%s'" % self.searchPath)
|
||||||
self.reparentTo(hidden)
|
self.reparentTo(hidden)
|
||||||
else:
|
else:
|
||||||
self.reparentTo(parent)
|
self.reparentTo(parent)
|
|
@ -42,4 +42,4 @@ class PathEntity(BasicEntities.NodePathEntity):
|
||||||
duration = distance / velocity
|
duration = distance / velocity
|
||||||
track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint))
|
track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint))
|
||||||
|
|
||||||
return track
|
return track
|
|
@ -49,4 +49,4 @@ class PropSpinner(Entity):
|
||||||
def destroyProps(self):
|
def destroyProps(self):
|
||||||
if hasattr(self, 'spinTracks'):
|
if hasattr(self, 'spinTracks'):
|
||||||
self.spinTracks.pause()
|
self.spinTracks.pause()
|
||||||
del self.spinTracks
|
del self.spinTracks
|
|
@ -41,4 +41,4 @@ class VisibilityExtender(Entity.Entity):
|
||||||
|
|
||||||
def destroy(self):
|
def destroy(self):
|
||||||
self.destroyVisExt()
|
self.destroyVisExt()
|
||||||
Entity.Entity.destroy(self)
|
Entity.Entity.destroy(self)
|
|
@ -31,4 +31,4 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
|
||||||
for zoneNum in zoneNumList:
|
for zoneNum in zoneNumList:
|
||||||
self.visibleZoneNums[zoneNum] -= 1
|
self.visibleZoneNums[zoneNum] -= 1
|
||||||
if self.visibleZoneNums[zoneNum] == 0:
|
if self.visibleZoneNums[zoneNum] == 0:
|
||||||
del self.visibleZoneNums[zoneNum]
|
del self.visibleZoneNums[zoneNum]
|
|
@ -1,8 +1,9 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
|
||||||
class CMover:
|
class CMover:
|
||||||
|
|
||||||
def __init__(self, objNodePath, fwdSpeed=1, rotSpeed=1):
|
def __init__(self, objNodePath, fwdSpeed=1, rotSpeed=1):
|
||||||
self.objNodePath = objNodePath
|
self.objNodePath = objNodePath
|
||||||
self.fwdSpeed = fwdSpeed
|
self.fwdSpeed = fwdSpeed
|
||||||
self.rotSpeed = rotSpeed
|
self.rotSpeed = rotSpeed
|
||||||
|
|
|
@ -276,4 +276,4 @@ def backgroundColor(r=None, g=1, b=1, a=1):
|
||||||
if r is None:
|
if r is None:
|
||||||
r, g, b, a = OTPGlobals.DefaultBackgroundColor
|
r, g, b, a = OTPGlobals.DefaultBackgroundColor
|
||||||
base.setBackgroundColor(Vec4(r, g, b, a))
|
base.setBackgroundColor(Vec4(r, g, b, a))
|
||||||
return 'The background color has been changed.'
|
return 'The background color has been changed.'
|
|
@ -306,4 +306,4 @@ ChatFeedback_Whitelist = 64
|
||||||
ChatFeedback_OpenChat = 128
|
ChatFeedback_OpenChat = 128
|
||||||
AvatarPendingCreate = -1
|
AvatarPendingCreate = -1
|
||||||
AvatarSlotUnavailable = -2
|
AvatarSlotUnavailable = -2
|
||||||
AvatarSlotAvailable = -3
|
AvatarSlotAvailable = -3
|
|
@ -37,7 +37,7 @@ class HalloweenHolidayDecorator(HolidayDecorator.HolidayDecorator):
|
||||||
base.cr.playGame.getPlace().loader.hood.loader and
|
base.cr.playGame.getPlace().loader.hood.loader and
|
||||||
hasattr(base.cr.playGame.getPlace().loader.hood.loader, 'geom') and
|
hasattr(base.cr.playGame.getPlace().loader.hood.loader, 'geom') and
|
||||||
base.cr.playGame.getPlace().loader.hood.loader.geom):
|
base.cr.playGame.getPlace().loader.hood.loader.geom):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
if hasattr(base.cr.playGame, 'getPlace') and base.cr.playGame.getPlace():
|
if hasattr(base.cr.playGame, 'getPlace') and base.cr.playGame.getPlace():
|
||||||
self.notify.debug('Failed Hood Check %s' % base.cr.playGame.getPlace())
|
self.notify.debug('Failed Hood Check %s' % base.cr.playGame.getPlace())
|
||||||
|
|
|
@ -515,11 +515,11 @@ class NewsManager(DistributedObject.DistributedObject):
|
||||||
base.localAvatar.setSystemMessage(0, TTLocalizer.LaughingManHolidayStart)
|
base.localAvatar.setSystemMessage(0, TTLocalizer.LaughingManHolidayStart)
|
||||||
for currToon in base.cr.toons.values():
|
for currToon in base.cr.toons.values():
|
||||||
currToon.generateLaughingMan()
|
currToon.generateLaughingMan()
|
||||||
|
|
||||||
def setLaughingManHolidayEnd(self):
|
def setLaughingManHolidayEnd(self):
|
||||||
for currToon in base.cr.toons.values():
|
for currToon in base.cr.toons.values():
|
||||||
currToon.swapToonHead(laughingMan=currToon.getWantLaughingMan())
|
currToon.swapToonHead(laughingMan=currToon.getWantLaughingMan())
|
||||||
|
|
||||||
def setTopToonsMarathonStart(self):
|
def setTopToonsMarathonStart(self):
|
||||||
base.localAvatar.setSystemMessage(0, TTLocalizer.TopToonsMarathonStart)
|
base.localAvatar.setSystemMessage(0, TTLocalizer.TopToonsMarathonStart)
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ def getHoliday(id):
|
||||||
return int(id)
|
return int(id)
|
||||||
elif hasattr(ToontownGlobals, id):
|
elif hasattr(ToontownGlobals, id):
|
||||||
return getattr(ToontownGlobals, id)
|
return getattr(ToontownGlobals, id)
|
||||||
|
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@magicWord(category=CATEGORY_PROGRAMMER, types=[str])
|
@magicWord(category=CATEGORY_PROGRAMMER, types=[str])
|
||||||
|
|
|
@ -98,7 +98,7 @@ class BattleCalculatorAI:
|
||||||
debug = self.notify.getDebug()
|
debug = self.notify.getDebug()
|
||||||
attack = self.battle.toonAttacks[attackIndex]
|
attack = self.battle.toonAttacks[attackIndex]
|
||||||
atkTrack, atkLevel = self.__getActualTrackLevel(attack)
|
atkTrack, atkLevel = self.__getActualTrackLevel(attack)
|
||||||
|
|
||||||
hasAccuracyBuff = False
|
hasAccuracyBuff = False
|
||||||
toon = simbase.air.doId2do.get(attack[TOON_ID_COL])
|
toon = simbase.air.doId2do.get(attack[TOON_ID_COL])
|
||||||
if toon:
|
if toon:
|
||||||
|
@ -106,7 +106,7 @@ class BattleCalculatorAI:
|
||||||
if not ZoneUtil.isDynamicZone(toon.zoneId):
|
if not ZoneUtil.isDynamicZone(toon.zoneId):
|
||||||
if ZoneUtil.getWhereName(toon.zoneId, True) in ('street', 'factoryExterior', 'cogHQExterior'):
|
if ZoneUtil.getWhereName(toon.zoneId, True) in ('street', 'factoryExterior', 'cogHQExterior'):
|
||||||
hasAccuracyBuff = True
|
hasAccuracyBuff = True
|
||||||
|
|
||||||
if atkTrack == NPCSOS:
|
if atkTrack == NPCSOS:
|
||||||
return (1, 95)
|
return (1, 95)
|
||||||
if atkTrack == FIRE:
|
if atkTrack == FIRE:
|
||||||
|
@ -519,7 +519,7 @@ class BattleCalculatorAI:
|
||||||
suit = self.battle.findSuit(targetId)
|
suit = self.battle.findSuit(targetId)
|
||||||
if suit:
|
if suit:
|
||||||
slips = toon.getPinkSlips()
|
slips = toon.getPinkSlips()
|
||||||
|
|
||||||
if slips < 1:
|
if slips < 1:
|
||||||
simbase.air.writeServerEvent('suspicious', toonId, 'Toon attempting to fire a cog without any pinkslips')
|
simbase.air.writeServerEvent('suspicious', toonId, 'Toon attempting to fire a cog without any pinkslips')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -38,4 +38,4 @@ class BattleManagerAI:
|
||||||
cellId = battle.battleCellId
|
cellId = battle.battleCellId
|
||||||
self.notify.debug('BattleManager - destroying battle %d' % cellId)
|
self.notify.debug('BattleManager - destroying battle %d' % cellId)
|
||||||
del self.cellId2battle[cellId]
|
del self.cellId2battle[cellId]
|
||||||
battle.requestDelete()
|
battle.requestDelete()
|
|
@ -146,4 +146,4 @@ def __makeShiftLift():
|
||||||
particles.emitter.setRadius(0.01)
|
particles.emitter.setRadius(0.01)
|
||||||
effect.setHpr(0, 180, 0)
|
effect.setHpr(0, 180, 0)
|
||||||
effect.setPos(0, 0, 0)
|
effect.setPos(0, 0, 0)
|
||||||
return effect
|
return effect
|
|
@ -43,4 +43,4 @@ class BattleSounds:
|
||||||
return self.mgr.getSound(filename.getFullpath())
|
return self.mgr.getSound(filename.getFullpath())
|
||||||
return self.mgr.getNullSound()
|
return self.mgr.getNullSound()
|
||||||
|
|
||||||
globalBattleSoundCache = BattleSounds()
|
globalBattleSoundCache = BattleSounds()
|
|
@ -124,4 +124,4 @@ class DistributedBattleAI(DistributedBattleBaseAI.DistributedBattleBaseAI):
|
||||||
DistributedBattleBaseAI.DistributedBattleBaseAI.enterResume(self)
|
DistributedBattleBaseAI.DistributedBattleBaseAI.enterResume(self)
|
||||||
if self.finishCallback:
|
if self.finishCallback:
|
||||||
self.finishCallback(self.zoneId)
|
self.finishCallback(self.zoneId)
|
||||||
self.battleMgr.destroy(self)
|
self.battleMgr.destroy(self)
|
|
@ -311,9 +311,9 @@ class Movie(DirectObject.DirectObject):
|
||||||
elif tutTrack >= len(earnedXp):
|
elif tutTrack >= len(earnedXp):
|
||||||
self.playTutorialReward_2()
|
self.playTutorialReward_2()
|
||||||
return
|
return
|
||||||
|
|
||||||
xp = earnedXp[tutTrack]
|
xp = earnedXp[tutTrack]
|
||||||
|
|
||||||
if xp > 0:
|
if xp > 0:
|
||||||
self.tutRewardDialog = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward1 % (xp, TTLocalizer.BattleGlobalTracks[tutTrack].capitalize()), command=self.playTutorialReward_1, extraArgs=[earnedXp, tutTrack + 1], style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8)
|
self.tutRewardDialog = TTDialog.TTDialog(text=TTLocalizer.MovieTutorialReward1 % (xp, TTLocalizer.BattleGlobalTracks[tutTrack].capitalize()), command=self.playTutorialReward_1, extraArgs=[earnedXp, tutTrack + 1], style=TTDialog.Acknowledge, fadeScreen=None, pos=(0.65, 0, 0.5), scale=0.8)
|
||||||
sequence = Sequence()
|
sequence = Sequence()
|
||||||
|
@ -321,7 +321,7 @@ class Movie(DirectObject.DirectObject):
|
||||||
sequence.start()
|
sequence.start()
|
||||||
else:
|
else:
|
||||||
self.playTutorialReward_1(None, earnedXp, tutTrack + 1)
|
self.playTutorialReward_1(None, earnedXp, tutTrack + 1)
|
||||||
|
|
||||||
def playTutorialReward_2(self, value=None):
|
def playTutorialReward_2(self, value=None):
|
||||||
from toontown.toon import Toon
|
from toontown.toon import Toon
|
||||||
from toontown.toon import ToonDNA
|
from toontown.toon import ToonDNA
|
||||||
|
|
|
@ -342,4 +342,4 @@ ActorInterval(kapow, 'kapow'), Func(kapow.hide)), LerpPosInterval(suit, 3.0, Poi
|
||||||
return [toonTrack,
|
return [toonTrack,
|
||||||
soundTrack,
|
soundTrack,
|
||||||
buttonTrack,
|
buttonTrack,
|
||||||
suitResponseTrack]
|
suitResponseTrack]
|
|
@ -745,4 +745,4 @@ squirtfn_array = (__doFlower,
|
||||||
__doSeltzerBottle,
|
__doSeltzerBottle,
|
||||||
__doFireHose,
|
__doFireHose,
|
||||||
__doStormCloud,
|
__doStormCloud,
|
||||||
__doGeyser)
|
__doGeyser)
|
|
@ -4902,3 +4902,5 @@ def bossCogFrontAttack(self):
|
||||||
force0.setActive(1)
|
force0.setActive(1)
|
||||||
f0.addForce(force0)
|
f0.addForce(force0)
|
||||||
self.addForceGroup(f0)
|
self.addForceGroup(f0)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
||||||
# to merge groups.
|
# to merge groups.
|
||||||
# mergeDict - This is a link that points back to the original
|
# mergeDict - This is a link that points back to the original
|
||||||
# invitee before we mapped it to the leader of the other group.
|
# invitee before we mapped it to the leader of the other group.
|
||||||
|
|
||||||
def requestInvite(self, inviteeId):
|
def requestInvite(self, inviteeId):
|
||||||
self.notify.debug('requestInvite %s' % inviteeId)
|
self.notify.debug('requestInvite %s' % inviteeId)
|
||||||
inviterId = self.air.getAvatarIdFromSender()
|
inviterId = self.air.getAvatarIdFromSender()
|
||||||
|
@ -167,7 +167,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
||||||
reason = BoardingPartyBase.BOARDCODE_PROMOTION
|
reason = BoardingPartyBase.BOARDCODE_PROMOTION
|
||||||
self.sendUpdateToAvatarId(inviterId, 'postInviteNotQualify', [inviterId, reason, self.elevatorIdList[0]])
|
self.sendUpdateToAvatarId(inviterId, 'postInviteNotQualify', [inviterId, reason, self.elevatorIdList[0]])
|
||||||
return
|
return
|
||||||
# Is the inviter already in the avIdDict? It follows they either must be in a group or have a pending invite...
|
# Is the inviter already in the avIdDict? It follows they either must be in a group or have a pending invite...
|
||||||
if inviterId in self.avIdDict:
|
if inviterId in self.avIdDict:
|
||||||
self.notify.debug('old group')
|
self.notify.debug('old group')
|
||||||
# Everything is indexed by the leaders
|
# Everything is indexed by the leaders
|
||||||
|
@ -184,7 +184,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
||||||
if len(self.getGroupMemberList(leaderId)) >= self.maxSize:
|
if len(self.getGroupMemberList(leaderId)) >= self.maxSize:
|
||||||
self.sendUpdate('postSizeReject', [leaderId, inviterId, inviteeId])
|
self.sendUpdate('postSizeReject', [leaderId, inviterId, inviteeId])
|
||||||
elif merger:
|
elif merger:
|
||||||
# We cannot muck with the avIdDict because they are pointing to their original groups.
|
# We cannot muck with the avIdDict because they are pointing to their original groups.
|
||||||
# We shall stash away the info into a different
|
# We shall stash away the info into a different
|
||||||
# dictionary.. This way, if something goes wrong,
|
# dictionary.. This way, if something goes wrong,
|
||||||
# the original groups with their original data
|
# the original groups with their original data
|
||||||
|
@ -195,12 +195,12 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
||||||
self.mergeDict[inviteeId] = originalInviteeId
|
self.mergeDict[inviteeId] = originalInviteeId
|
||||||
self.sendUpdateToAvatarId(inviteeId, 'postInvite', [leaderId, inviterId, True])
|
self.sendUpdateToAvatarId(inviteeId, 'postInvite', [leaderId, inviterId, True])
|
||||||
# notify everybody in the inviters group of the
|
# notify everybody in the inviters group of the
|
||||||
# invitation..
|
# invitation..
|
||||||
for memberId in groupList[0]:
|
for memberId in groupList[0]:
|
||||||
if not memberId == inviterId:
|
if not memberId == inviterId:
|
||||||
self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId])
|
self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId])
|
||||||
elif inviterId not in groupList[1] and inviterId not in groupList[2]:
|
elif inviterId not in groupList[1] and inviterId not in groupList[2]:
|
||||||
# If the invitee isn't already in the group, add them..
|
# If the invitee isn't already in the group, add them..
|
||||||
if inviteeId not in groupList[1]:
|
if inviteeId not in groupList[1]:
|
||||||
groupList[1].append(inviteeId)
|
groupList[1].append(inviteeId)
|
||||||
self.groupListDict[leaderId] = groupList
|
self.groupListDict[leaderId] = groupList
|
||||||
|
@ -213,7 +213,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
||||||
for memberId in groupList[0]:
|
for memberId in groupList[0]:
|
||||||
if not memberId == inviterId:
|
if not memberId == inviterId:
|
||||||
self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId])
|
self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId])
|
||||||
# The inviter was kicked.. so, we cannot let them back in since they are not the leader...
|
# The inviter was kicked.. so, we cannot let them back in since they are not the leader...
|
||||||
elif inviterId in groupList[2]:
|
elif inviterId in groupList[2]:
|
||||||
self.sendUpdate('postKickReject', [leaderId, inviterId, inviteeId])
|
self.sendUpdate('postKickReject', [leaderId, inviterId, inviteeId])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -144,9 +144,9 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
|
||||||
print 'Building %s (%s): cogdoTakeOver' % (self.doId, self.zoneId)
|
print 'Building %s (%s): cogdoTakeOver' % (self.doId, self.zoneId)
|
||||||
if not self.isToonBlock():
|
if not self.isToonBlock():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
self.updateSavedBy(None)
|
self.updateSavedBy(None)
|
||||||
|
|
||||||
self.track = track
|
self.track = track
|
||||||
self.realTrack = track
|
self.realTrack = track
|
||||||
self.difficulty = difficulty
|
self.difficulty = difficulty
|
||||||
|
@ -321,21 +321,21 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
|
||||||
toon = None
|
toon = None
|
||||||
if t:
|
if t:
|
||||||
toon = self.getToon(t)
|
toon = self.getToon(t)
|
||||||
|
|
||||||
if toon != None:
|
if toon != None:
|
||||||
activeToons.append(toon)
|
activeToons.append(toon)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for t in victorList:
|
for t in victorList:
|
||||||
toon = None
|
toon = None
|
||||||
if t:
|
if t:
|
||||||
toon = self.getToon(t)
|
toon = self.getToon(t)
|
||||||
self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track, self.numFloors, self.zoneId, victorList))
|
self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track, self.numFloors, self.zoneId, victorList))
|
||||||
|
|
||||||
if toon != None:
|
if toon != None:
|
||||||
self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons, 1)
|
self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons, 1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
victorList.extend([None, None, None, None])
|
victorList.extend([None, None, None, None])
|
||||||
for i in range(0, 4):
|
for i in range(0, 4):
|
||||||
victor = victorList[i]
|
victor = victorList[i]
|
||||||
|
@ -345,7 +345,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
|
||||||
event = self.air.getAvatarExitEvent(victor)
|
event = self.air.getAvatarExitEvent(victor)
|
||||||
self.accept(event, self.setVictorExited, extraArgs = [
|
self.accept(event, self.setVictorExited, extraArgs = [
|
||||||
victor])
|
victor])
|
||||||
|
|
||||||
self.b_setVictorList(victorList[:4])
|
self.b_setVictorList(victorList[:4])
|
||||||
self.updateSavedBy(savedBy)
|
self.updateSavedBy(savedBy)
|
||||||
self.victorResponses = [
|
self.victorResponses = [
|
||||||
|
|
|
@ -7,3 +7,4 @@ class DistributedCJElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorA
|
||||||
DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle, minLaff=minLaff)
|
DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle, minLaff=minLaff)
|
||||||
self.type = ELEVATOR_CJ
|
self.type = ELEVATOR_CJ
|
||||||
self.countdownTime = ElevatorData[self.type]['countdown']
|
self.countdownTime = ElevatorData[self.type]['countdown']
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.battle import BattleBase
|
from toontown.battle import BattleBase
|
||||||
|
|
||||||
class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
||||||
|
|
||||||
def __init__(self, air, bldg, avIds):
|
def __init__(self, air, bldg, avIds):
|
||||||
DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg)
|
DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg)
|
||||||
self.countdownTime = simbase.config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME)
|
self.countdownTime = simbase.config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME)
|
||||||
|
@ -35,7 +35,7 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
||||||
numFullSeats = self.countFullSeats()
|
numFullSeats = self.countFullSeats()
|
||||||
if not numFullSeats <= len(self.avIds):
|
if not numFullSeats <= len(self.avIds):
|
||||||
self.notify.warning('we are about to crash. self.seats=%s self.avIds=%s' % (self.seats, self.avIds))
|
self.notify.warning('we are about to crash. self.seats=%s self.avIds=%s' % (self.seats, self.avIds))
|
||||||
|
|
||||||
if numFullSeats == len(self.avIds):
|
if numFullSeats == len(self.avIds):
|
||||||
self.fsm.request('allAboard')
|
self.fsm.request('allAboard')
|
||||||
|
|
||||||
|
@ -133,4 +133,4 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
||||||
|
|
||||||
def enterClosed(self):
|
def enterClosed(self):
|
||||||
DistributedElevatorAI.DistributedElevatorAI.enterClosed(self)
|
DistributedElevatorAI.DistributedElevatorAI.enterClosed(self)
|
||||||
self.__doorsClosed()
|
self.__doorsClosed()
|
|
@ -40,7 +40,7 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
self.interior.flattenMedium()
|
self.interior.flattenMedium()
|
||||||
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase.DistributedNPCToonBase):
|
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase.DistributedNPCToonBase):
|
||||||
npcToon.initToonState()
|
npcToon.initToonState()
|
||||||
|
|
||||||
self.createSillyMeter()
|
self.createSillyMeter()
|
||||||
|
|
||||||
def createSillyMeter(self):
|
def createSillyMeter(self):
|
||||||
|
@ -83,19 +83,19 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
||||||
self.arrowSfx = self.audio3d.loadSfx('phase_4/audio/sfx/tt_s_prp_sillyMeterArrow.ogg')
|
self.arrowSfx = self.audio3d.loadSfx('phase_4/audio/sfx/tt_s_prp_sillyMeterArrow.ogg')
|
||||||
self.arrowSfx.setLoop(False)
|
self.arrowSfx.setLoop(False)
|
||||||
self.audio3d.setDropOffFactor(0.1)
|
self.audio3d.setDropOffFactor(0.1)
|
||||||
|
|
||||||
self.startSillyMeter(config.GetInt('silly-meter-phase', 12))
|
self.startSillyMeter(config.GetInt('silly-meter-phase', 12))
|
||||||
|
|
||||||
def startSillyMeter(self, phase):
|
def startSillyMeter(self, phase):
|
||||||
self.stopSillyMeter()
|
self.stopSillyMeter()
|
||||||
|
|
||||||
if hasattr(self, 'enterPhase%s' % phase):
|
if hasattr(self, 'enterPhase%s' % phase):
|
||||||
getattr(self, 'enterPhase%s' % phase)()
|
getattr(self, 'enterPhase%s' % phase)()
|
||||||
self.phase = phase
|
self.phase = phase
|
||||||
|
|
||||||
def stopSillyMeter(self):
|
def stopSillyMeter(self):
|
||||||
if hasattr(self, 'phase') and hasattr(self, 'exitPhase%s' % self.phase):
|
if hasattr(self, 'phase') and hasattr(self, 'exitPhase%s' % self.phase):
|
||||||
getattr(self, 'exitPhase%s' % self.phase)()
|
getattr(self, 'exitPhase%s' % self.phase)()
|
||||||
|
|
||||||
def enterPhase0(self):
|
def enterPhase0(self):
|
||||||
self.animSeq = Parallel(ActorInterval(self.sillyMeter, 'arrowTube', partName='arrow', duration=604800, constrainedLoop=1, startFrame=1, endFrame=30), Sequence(Func(self.phase1Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase1Sfx, self.sillyMeter)))
|
self.animSeq = Parallel(ActorInterval(self.sillyMeter, 'arrowTube', partName='arrow', duration=604800, constrainedLoop=1, startFrame=1, endFrame=30), Sequence(Func(self.phase1Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase1Sfx, self.sillyMeter)))
|
||||||
|
@ -421,9 +421,9 @@ def sillyPhase(phase):
|
||||||
"""
|
"""
|
||||||
Set the silly meter phase.
|
Set the silly meter phase.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if phase < -1 or phase > 14:
|
if phase < -1 or phase > 14:
|
||||||
return 'Phase number must be between 0 and 14!'
|
return 'Phase number must be between 0 and 14!'
|
||||||
|
|
||||||
messenger.send('SillyMeterPhase', [phase])
|
messenger.send('SillyMeterPhase', [phase])
|
||||||
return 'Successfully set the silly meter phase!'
|
return 'Successfully set the silly meter phase!'
|
|
@ -7,4 +7,4 @@ INT_HOUSE = 6
|
||||||
EXT_COGHQ = 7
|
EXT_COGHQ = 7
|
||||||
INT_COGHQ = 8
|
INT_COGHQ = 8
|
||||||
EXT_KS = 9
|
EXT_KS = 9
|
||||||
INT_KS = 10
|
INT_KS = 10
|
|
@ -35,7 +35,7 @@ class PetshopBuildingAI:
|
||||||
self.interior.generateWithRequired(self.interiorZone)
|
self.interior.generateWithRequired(self.interiorZone)
|
||||||
|
|
||||||
self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)
|
self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)
|
||||||
|
|
||||||
door = DistributedDoorAI.DistributedDoorAI(
|
door = DistributedDoorAI.DistributedDoorAI(
|
||||||
self.air, blockNumber, DoorTypes.EXT_STANDARD)
|
self.air, blockNumber, DoorTypes.EXT_STANDARD)
|
||||||
insideDoor = DistributedDoorAI.DistributedDoorAI(
|
insideDoor = DistributedDoorAI.DistributedDoorAI(
|
||||||
|
@ -50,4 +50,4 @@ class PetshopBuildingAI:
|
||||||
self.insideDoor = insideDoor
|
self.insideDoor = insideDoor
|
||||||
|
|
||||||
def createPet(self, ownerId, seed):
|
def createPet(self, ownerId, seed):
|
||||||
return
|
return
|
|
@ -201,7 +201,7 @@ buildingMinMax = {
|
||||||
ToontownGlobals.PajamaPlace: [config.GetInt('pajama-place-building-min', 6),
|
ToontownGlobals.PajamaPlace: [config.GetInt('pajama-place-building-min', 6),
|
||||||
config.GetInt('pajama-place-building-max', 12)],
|
config.GetInt('pajama-place-building-max', 12)],
|
||||||
ToontownGlobals.RockAByeRoad: [config.GetInt('rock-a-bye-road-building-min', 6),
|
ToontownGlobals.RockAByeRoad: [config.GetInt('rock-a-bye-road-building-min', 6),
|
||||||
config.GetInt('rock-a-bye-road-building-max', 12)],
|
config.GetInt('rock-a-bye-road-building-max', 12)],
|
||||||
ToontownGlobals.SellbotHQ: [0, 0],
|
ToontownGlobals.SellbotHQ: [0, 0],
|
||||||
ToontownGlobals.SellbotFactoryExt: [0, 0],
|
ToontownGlobals.SellbotFactoryExt: [0, 0],
|
||||||
ToontownGlobals.CashbotHQ: [0, 0],
|
ToontownGlobals.CashbotHQ: [0, 0],
|
||||||
|
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
||||||
class AccountDate(DistributedObject):
|
class AccountDate(DistributedObject):
|
||||||
neverDisable = 1
|
neverDisable = 1
|
||||||
notify = directNotify.newCategory('AccountDate')
|
notify = directNotify.newCategory('AccountDate')
|
||||||
|
|
||||||
def __init__(self, cr):
|
def __init__(self, cr):
|
||||||
DistributedObject.__init__(self, cr)
|
DistributedObject.__init__(self, cr)
|
||||||
self.accountDays = 0
|
self.accountDays = 0
|
||||||
|
@ -20,20 +20,20 @@ class AccountDate(DistributedObject):
|
||||||
if base.cr.accountDateMgr is self:
|
if base.cr.accountDateMgr is self:
|
||||||
del base.cr.accountDateMgr
|
del base.cr.accountDateMgr
|
||||||
DistributedObject.delete(self)
|
DistributedObject.delete(self)
|
||||||
|
|
||||||
def getAccountDays(self):
|
def getAccountDays(self):
|
||||||
return self.accountDays
|
return self.accountDays
|
||||||
|
|
||||||
def requestDate(self, task=None):
|
def requestDate(self, task=None):
|
||||||
self.sendUpdate('requestDate')
|
self.sendUpdate('requestDate')
|
||||||
|
|
||||||
if task is not None:
|
if task is not None:
|
||||||
return task.done
|
return task.done
|
||||||
|
|
||||||
def requestDateResult(self, result):
|
def requestDateResult(self, result):
|
||||||
if result is None:
|
if result is None:
|
||||||
notify.warning('Invalid response from server.')
|
notify.warning('Invalid response from server.')
|
||||||
self.accountDays = 0
|
self.accountDays = 0
|
||||||
else:
|
else:
|
||||||
date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y")
|
date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y")
|
||||||
self.accountDays = (datetime.now() - date).days
|
self.accountDays = (datetime.now() - date).days
|
|
@ -3,21 +3,21 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||||
|
|
||||||
class AccountDateAI(DistributedObjectAI):
|
class AccountDateAI(DistributedObjectAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
|
||||||
|
|
||||||
def announceGenerate(self):
|
def announceGenerate(self):
|
||||||
DistributedObjectAI.announceGenerate(self)
|
DistributedObjectAI.announceGenerate(self)
|
||||||
|
|
||||||
def requestDate(self):
|
def requestDate(self):
|
||||||
avId = self.air.getAvatarIdFromSender()
|
avId = self.air.getAvatarIdFromSender()
|
||||||
av = self.air.doId2do.get(avId)
|
av = self.air.doId2do.get(avId)
|
||||||
|
|
||||||
if not av:
|
if not av:
|
||||||
return
|
return
|
||||||
|
|
||||||
def callback(dclass, fields):
|
def callback(dclass, fields):
|
||||||
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
|
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
|
||||||
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
|
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
|
||||||
else:
|
else:
|
||||||
self.sendUpdateToAvatarId(avId, 'requestDateResult', [None])
|
self.sendUpdateToAvatarId(avId, 'requestDateResult', [None])
|
||||||
|
|
||||||
self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback)
|
self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback)
|
|
@ -408,4 +408,4 @@ def getAllAccessories(*accessoryTypes):
|
||||||
base = CatalogAccessoryItem(accessoryType)
|
base = CatalogAccessoryItem(accessoryType)
|
||||||
list.append(base)
|
list.append(base)
|
||||||
|
|
||||||
return list
|
return list
|
|
@ -739,4 +739,4 @@ AccessoryTypes = {101: (AHat,
|
||||||
449: (AShoes,
|
449: (AShoes,
|
||||||
'shw2',
|
'shw2',
|
||||||
APriceCool,
|
APriceCool,
|
||||||
7)}
|
7)}
|
|
@ -580,4 +580,4 @@ def getAllClothes(*clothingTypes):
|
||||||
for n in range(1, len(base.getColorChoices())):
|
for n in range(1, len(base.getColorChoices())):
|
||||||
list.append(CatalogClothingItem(clothingType, n))
|
list.append(CatalogClothingItem(clothingType, n))
|
||||||
|
|
||||||
return list
|
return list
|
|
@ -124,4 +124,4 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
|
||||||
dg.addBool(self.isSpecial)
|
dg.addBool(self.isSpecial)
|
||||||
|
|
||||||
def isGift(self):
|
def isGift(self):
|
||||||
return not self.getEmblemPrices()
|
return not self.getEmblemPrices()
|
|
@ -1131,12 +1131,12 @@ def nextAvailableCloset(avatar, duplicateItems):
|
||||||
def nextAvailableBank(avatar, duplicateItems):
|
def nextAvailableBank(avatar, duplicateItems):
|
||||||
if not avatar.getMaxBankMoney() in MoneyToBank:
|
if not avatar.getMaxBankMoney() in MoneyToBank:
|
||||||
return CatalogFurnitureItem(1300)
|
return CatalogFurnitureItem(1300)
|
||||||
|
|
||||||
currentBank = MoneyToBank[avatar.getMaxBankMoney()]
|
currentBank = MoneyToBank[avatar.getMaxBankMoney()]
|
||||||
|
|
||||||
if currentBank == MaxBankId:
|
if currentBank == MaxBankId:
|
||||||
return
|
return
|
||||||
|
|
||||||
return CatalogFurnitureItem(currentBank + 10)
|
return CatalogFurnitureItem(currentBank + 10)
|
||||||
|
|
||||||
def get50ItemCloset(avatar, duplicateItems):
|
def get50ItemCloset(avatar, duplicateItems):
|
||||||
|
@ -1168,10 +1168,10 @@ def getAllClosets():
|
||||||
|
|
||||||
def getAllBanks():
|
def getAllBanks():
|
||||||
list = []
|
list = []
|
||||||
|
|
||||||
for bankId in BankToMoney.keys():
|
for bankId in BankToMoney.keys():
|
||||||
list.append(CatalogFurnitureItem(bankId))
|
list.append(CatalogFurnitureItem(bankId))
|
||||||
|
|
||||||
return list
|
return list
|
||||||
|
|
||||||
def get50ItemTrunk(avatar, duplicateItems):
|
def get50ItemTrunk(avatar, duplicateItems):
|
||||||
|
|
|
@ -1540,10 +1540,10 @@ class CatalogGenerator:
|
||||||
|
|
||||||
if nextAvailableCloset not in schedule:
|
if nextAvailableCloset not in schedule:
|
||||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
|
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
|
||||||
|
|
||||||
if nextAvailableBank not in schedule:
|
if nextAvailableBank not in schedule:
|
||||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0)
|
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0)
|
||||||
|
|
||||||
weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0)
|
weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0)
|
||||||
if time.time() < 1096617600.0:
|
if time.time() < 1096617600.0:
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
||||||
def makeNewItem(self, houseId):
|
def makeNewItem(self, houseId):
|
||||||
self.houseId = houseId
|
self.houseId = houseId
|
||||||
CatalogItem.CatalogItem.makeNewItem(self)
|
CatalogItem.CatalogItem.makeNewItem(self)
|
||||||
|
|
||||||
def notOfferedTo(self, avatar):
|
def notOfferedTo(self, avatar):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def requestPurchase(self, phone, callback):
|
def requestPurchase(self, phone, callback):
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
avatar = base.localAvatar
|
avatar = base.localAvatar
|
||||||
|
@ -43,16 +43,16 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
||||||
|
|
||||||
def getDeliveryTime(self):
|
def getDeliveryTime(self):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def getEmblemPrices(self):
|
def getEmblemPrices(self):
|
||||||
return HouseGlobals.HouseEmblemPrices[self.houseId]
|
return HouseGlobals.HouseEmblemPrices[self.houseId]
|
||||||
|
|
||||||
def getPicture(self, avatar):
|
def getPicture(self, avatar):
|
||||||
model = loader.loadModel(HouseGlobals.houseModels[self.houseId])
|
model = loader.loadModel(HouseGlobals.houseModels[self.houseId])
|
||||||
model.setBin('unsorted', 0, 1)
|
model.setBin('unsorted', 0, 1)
|
||||||
self.hasPicture = True
|
self.hasPicture = True
|
||||||
return self.makeFrameModel(model)
|
return self.makeFrameModel(model)
|
||||||
|
|
||||||
def decodeDatagram(self, di, versionNumber, store):
|
def decodeDatagram(self, di, versionNumber, store):
|
||||||
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
||||||
self.houseId = di.getUint8()
|
self.houseId = di.getUint8()
|
||||||
|
@ -60,12 +60,13 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
||||||
def encodeDatagram(self, dg, store):
|
def encodeDatagram(self, dg, store):
|
||||||
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
||||||
dg.addUint8(self.houseId)
|
dg.addUint8(self.houseId)
|
||||||
|
|
||||||
def recordPurchase(self, av, optional):
|
def recordPurchase(self, av, optional):
|
||||||
house = simbase.air.doId2do.get(av.getHouseId())
|
house = simbase.air.doId2do.get(av.getHouseId())
|
||||||
if house:
|
if house:
|
||||||
house.b_setHouseType(self.houseId)
|
house.b_setHouseType(self.houseId)
|
||||||
return ToontownGlobals.P_ItemAvailable
|
return ToontownGlobals.P_ItemAvailable
|
||||||
|
|
||||||
def getAllHouses():
|
def getAllHouses():
|
||||||
return [CatalogHouseItem(i) for i in xrange(6)]
|
return [CatalogHouseItem(i) for i in xrange(6)]
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import time
|
||||||
|
|
||||||
class CatalogManagerAI(DistributedObjectAI):
|
class CatalogManagerAI(DistributedObjectAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("CatalogManagerAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("CatalogManagerAI")
|
||||||
|
|
||||||
def __init__(self, air):
|
def __init__(self, air):
|
||||||
DistributedObjectAI.__init__(self, air)
|
DistributedObjectAI.__init__(self, air)
|
||||||
self.catalogGenerator = CatalogGenerator()
|
self.catalogGenerator = CatalogGenerator()
|
||||||
|
@ -15,8 +15,8 @@ class CatalogManagerAI(DistributedObjectAI):
|
||||||
avId = self.air.getAvatarIdFromSender()
|
avId = self.air.getAvatarIdFromSender()
|
||||||
av = self.air.doId2do.get(avId)
|
av = self.air.doId2do.get(avId)
|
||||||
if av:
|
if av:
|
||||||
self.deliverCatalogFor(av)
|
self.deliverCatalogFor(av)
|
||||||
|
|
||||||
def deliverCatalogFor(self, av):
|
def deliverCatalogFor(self, av):
|
||||||
monthlyCatalog = self.catalogGenerator.generateMonthlyCatalog(av, time.time() / 60)
|
monthlyCatalog = self.catalogGenerator.generateMonthlyCatalog(av, time.time() / 60)
|
||||||
newWeek = (av.catalogScheduleCurrentWeek + 1) % ToontownGlobals.CatalogNumWeeks
|
newWeek = (av.catalogScheduleCurrentWeek + 1) % ToontownGlobals.CatalogNumWeeks
|
||||||
|
@ -25,3 +25,4 @@ class CatalogManagerAI(DistributedObjectAI):
|
||||||
av.b_setCatalog(monthlyCatalog, weeklyCatalog, backCatalog)
|
av.b_setCatalog(monthlyCatalog, weeklyCatalog, backCatalog)
|
||||||
av.b_setCatalogSchedule(newWeek, int((time.time() + 604800)/60))
|
av.b_setCatalogSchedule(newWeek, int((time.time() + 604800)/60))
|
||||||
av.b_setCatalogNotify(ToontownGlobals.NewItems, av.mailboxNotify)
|
av.b_setCatalogNotify(ToontownGlobals.NewItems, av.mailboxNotify)
|
||||||
|
|
||||||
|
|
|
@ -614,7 +614,7 @@ class CatalogScreen(DirectFrame):
|
||||||
if item in allBankItems and item.furnitureType == CatalogFurnitureItem.MaxBankId:
|
if item in allBankItems and item.furnitureType == CatalogFurnitureItem.MaxBankId:
|
||||||
isMaxBankOffered = True
|
isMaxBankOffered = True
|
||||||
break
|
break
|
||||||
|
|
||||||
for item in itemList:
|
for item in itemList:
|
||||||
if isinstance(item, CatalogInvalidItem.CatalogInvalidItem):
|
if isinstance(item, CatalogInvalidItem.CatalogInvalidItem):
|
||||||
self.notify.warning('skipping catalog invalid item %s' % item)
|
self.notify.warning('skipping catalog invalid item %s' % item)
|
||||||
|
@ -972,13 +972,13 @@ class CatalogScreen(DirectFrame):
|
||||||
|
|
||||||
if not self.clarabelleChatBalloon:
|
if not self.clarabelleChatBalloon:
|
||||||
self.clarabelleChatBalloon = loader.loadModel('phase_3/models/props/chatbox')
|
self.clarabelleChatBalloon = loader.loadModel('phase_3/models/props/chatbox')
|
||||||
|
|
||||||
self.clarabelleChat = CatalogChatBalloon.CatalogChatBalloon(self.clarabelleChatBalloon)
|
self.clarabelleChat = CatalogChatBalloon.CatalogChatBalloon(self.clarabelleChatBalloon)
|
||||||
chatNode = self.clarabelleChat.generate(str, ToontownGlobals.getInterfaceFont())[0]
|
chatNode = self.clarabelleChat.generate(str, ToontownGlobals.getInterfaceFont())[0]
|
||||||
self.clarabelleChatNP = self.attachNewNode(chatNode.node(), 1000)
|
self.clarabelleChatNP = self.attachNewNode(chatNode.node(), 1000)
|
||||||
self.clarabelleChatNP.setScale(0.08)
|
self.clarabelleChatNP.setScale(0.08)
|
||||||
self.clarabelleChatNP.setPos(0.7, 0, 0.6)
|
self.clarabelleChatNP.setPos(0.7, 0, 0.6)
|
||||||
|
|
||||||
if timeout:
|
if timeout:
|
||||||
taskMgr.doMethodLater(timeout, self.clearClarabelleChat, 'clearClarabelleChat')
|
taskMgr.doMethodLater(timeout, self.clearClarabelleChat, 'clearClarabelleChat')
|
||||||
|
|
||||||
|
|
|
@ -32,3 +32,4 @@ class CatalogSurfaceItem(CatalogAtticItem.CatalogAtticItem):
|
||||||
|
|
||||||
def getDeliveryTime(self):
|
def getDeliveryTime(self):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
|
@ -512,5 +512,5 @@ class MailboxScreen(DirectObject.DirectObject):
|
||||||
|
|
||||||
def getSenderName(self, avId):
|
def getSenderName(self, avId):
|
||||||
sender = base.cr.identifyFriend(avId)
|
sender = base.cr.identifyFriend(avId)
|
||||||
|
|
||||||
return sender.getName() if sender else TTLocalizer.MailboxGiftTagAnonymous
|
return sender.getName() if sender else TTLocalizer.MailboxGiftTagAnonymous
|
|
@ -31,4 +31,4 @@ class TTTalkAssistant(TalkAssistant):
|
||||||
toNpcId,
|
toNpcId,
|
||||||
toonProgress,
|
toonProgress,
|
||||||
msgIndex])
|
msgIndex])
|
||||||
return error
|
return error
|
|
@ -71,4 +71,4 @@ class CogdoCraneGame(DirectObject):
|
||||||
del self.toonId2Player[player.toon.doId]
|
del self.toonId2Player[player.toon.doId]
|
||||||
|
|
||||||
def handleToonLeft(self, toonId):
|
def handleToonLeft(self, toonId):
|
||||||
self._removePlayer(self.toonId2Player[toonId])
|
self._removePlayer(self.toonId2Player[toonId])
|
|
@ -59,7 +59,7 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI):
|
||||||
damage = int(20 * self.getDifficulty())
|
damage = int(20 * self.getDifficulty())
|
||||||
self.__damage(av, damage)
|
self.__damage(av, damage)
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
self.notify.warning('Client requested unknown action \'%s\'' %action)
|
||||||
|
|
||||||
def requestPickUp(self, pickupNum, pickupType):
|
def requestPickUp(self, pickupNum, pickupType):
|
||||||
avId = self.air.getAvatarIdFromSender()
|
avId = self.air.getAvatarIdFromSender()
|
||||||
|
@ -74,7 +74,7 @@ class DistCogdoFlyingGameAI(DistCogdoGameAI):
|
||||||
if pickupType == Globals.Level.GatherableTypes.Memo:
|
if pickupType == Globals.Level.GatherableTypes.Memo:
|
||||||
self.totalMemos += 1
|
self.totalMemos += 1
|
||||||
else:
|
else:
|
||||||
self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType)
|
self.notify.warning('Client requested unknown pickup \'%s\'' % pickupType)
|
||||||
|
|
||||||
def handleStart(self):
|
def handleStart(self):
|
||||||
for toon in self.toons:
|
for toon in self.toons:
|
||||||
|
|
|
@ -229,7 +229,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
|
||||||
def isBossFloor(self, floorNum):
|
def isBossFloor(self, floorNum):
|
||||||
if not self.layout.hasBossBattle():
|
if not self.layout.hasBossBattle():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return (self.layout.getBossBattleFloor() + 0) == floorNum
|
return (self.layout.getBossBattleFloor() + 0) == floorNum
|
||||||
|
|
||||||
def __cleanup(self):
|
def __cleanup(self):
|
||||||
|
@ -799,7 +799,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
|
||||||
|
|
||||||
if self.FOType == "l":
|
if self.FOType == "l":
|
||||||
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot
|
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot
|
||||||
|
|
||||||
else:
|
else:
|
||||||
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName
|
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,4 @@ class ActiveCell(BasicEntities.DistributedNodePathEntity):
|
||||||
|
|
||||||
def setState(self, state, objId):
|
def setState(self, state, objId):
|
||||||
self.state = state
|
self.state = state
|
||||||
self.occupantId = objId
|
self.occupantId = objId
|
|
@ -28,4 +28,4 @@ class BarrelBase:
|
||||||
self._gagTrack = self.getRng().choice(tracks)
|
self._gagTrack = self.getRng().choice(tracks)
|
||||||
else:
|
else:
|
||||||
self._gagTrack = self.gagTrack
|
self._gagTrack = self.gagTrack
|
||||||
return self._gagTrack
|
return self._gagTrack
|
|
@ -86,4 +86,4 @@ class BattleBlocker(BasicEntities.DistributedNodePathEntity):
|
||||||
track = Sequence()
|
track = Sequence()
|
||||||
if callback:
|
if callback:
|
||||||
track.append(Func(callback))
|
track.append(Func(callback))
|
||||||
track.start()
|
track.start()
|
|
@ -63,4 +63,4 @@ class BattleBlockerAI(DistributedEntityAI.DistributedEntityAI):
|
||||||
messenger.send(self.getOutputEventName(), [1])
|
messenger.send(self.getOutputEventName(), [1])
|
||||||
|
|
||||||
def d_setBattleFinished(self):
|
def d_setBattleFinished(self):
|
||||||
self.sendUpdate('setBattleFinished', [])
|
self.sendUpdate('setBattleFinished', [])
|
|
@ -132,4 +132,4 @@ class BossbotCogHQLoader(CogHQLoader.CogHQLoader):
|
||||||
self.exitPlace()
|
self.exitPlace()
|
||||||
self.placeClass = None
|
self.placeClass = None
|
||||||
del self.countryClubId
|
del self.countryClubId
|
||||||
return
|
return
|
|
@ -98,4 +98,4 @@ class ConveyorBelt(BasicEntities.NodePathEntity):
|
||||||
del self.tailClipPath
|
del self.tailClipPath
|
||||||
self.clearClipPlane()
|
self.clearClipPlane()
|
||||||
for tread in self.treads:
|
for tread in self.treads:
|
||||||
tread.parentingNode.clearClipPlane()
|
tread.parentingNode.clearClipPlane()
|
|
@ -13,4 +13,4 @@ class CountryClubRoomBase:
|
||||||
self.roomId = roomId
|
self.roomId = roomId
|
||||||
|
|
||||||
def getCogTrack(self):
|
def getCogTrack(self):
|
||||||
return self.cogTrack
|
return self.cogTrack
|
|
@ -27,4 +27,4 @@ class DistributedBarrelBaseAI(DistributedEntityAI.DistributedEntityAI, BarrelBas
|
||||||
self.sendUpdate('setReject')
|
self.sendUpdate('setReject')
|
||||||
|
|
||||||
def d_setGrab(self, avId):
|
def d_setGrab(self, avId):
|
||||||
self.sendUpdate('setGrab', [avId])
|
self.sendUpdate('setGrab', [avId])
|
|
@ -372,4 +372,4 @@ class DistributedCogKart(DistributedElevatorExt.DistributedElevatorExt):
|
||||||
elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntB:
|
elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntB:
|
||||||
return TTLocalizer.ElevatorBossBotCourse1
|
return TTLocalizer.ElevatorBossBotCourse1
|
||||||
elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntC:
|
elif self.countryClubId == ToontownGlobals.BossbotCountryClubIntC:
|
||||||
return TTLocalizer.ElevatorBossBotCourse2
|
return TTLocalizer.ElevatorBossBotCourse2
|
|
@ -5,33 +5,33 @@ from direct.directnotify import DirectNotifyGlobal
|
||||||
|
|
||||||
class DistributedCrusherEntityAI(DistributedEntityAI.DistributedEntityAI):
|
class DistributedCrusherEntityAI(DistributedEntityAI.DistributedEntityAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedCrusherEntityAI')
|
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedCrusherEntityAI')
|
||||||
|
|
||||||
def __init__(self, level, entId):
|
def __init__(self, level, entId):
|
||||||
self.isCrusher = 0
|
self.isCrusher = 0
|
||||||
self.crushCell = None
|
self.crushCell = None
|
||||||
DistributedEntityAI.DistributedEntityAI.__init__(self, level, entId)
|
DistributedEntityAI.DistributedEntityAI.__init__(self, level, entId)
|
||||||
self.crushMsg = self.getUniqueName('crusherDoCrush')
|
self.crushMsg = self.getUniqueName('crusherDoCrush')
|
||||||
|
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
DistributedEntityAI.DistributedEntityAI.generate(self)
|
DistributedEntityAI.DistributedEntityAI.generate(self)
|
||||||
self.setActiveCrushCell()
|
self.setActiveCrushCell()
|
||||||
|
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
self.ignoreAll()
|
self.ignoreAll()
|
||||||
DistributedEntityAI.DistributedEntityAI.delete(self)
|
DistributedEntityAI.DistributedEntityAI.delete(self)
|
||||||
|
|
||||||
|
|
||||||
def destroy(self):
|
def destroy(self):
|
||||||
self.notify.info('destroy entity %s' % self.entId)
|
self.notify.info('destroy entity %s' % self.entId)
|
||||||
if self.crushCell != None:
|
if self.crushCell != None:
|
||||||
self.crushCell.unregisterCrusher(self.entId)
|
self.crushCell.unregisterCrusher(self.entId)
|
||||||
self.crushCell = None
|
self.crushCell = None
|
||||||
|
|
||||||
DistributedEntityAI.DistributedEntityAI.destroy(self)
|
DistributedEntityAI.DistributedEntityAI.destroy(self)
|
||||||
|
|
||||||
|
|
||||||
def setActiveCrushCell(self):
|
def setActiveCrushCell(self):
|
||||||
self.notify.debug('setActiveCrushCell, entId: %d' % self.entId)
|
self.notify.debug('setActiveCrushCell, entId: %d' % self.entId)
|
||||||
if self.crushCellId != None:
|
if self.crushCellId != None:
|
||||||
|
@ -41,17 +41,17 @@ class DistributedCrusherEntityAI(DistributedEntityAI.DistributedEntityAI):
|
||||||
else:
|
else:
|
||||||
self.isCrusher = 1
|
self.isCrusher = 1
|
||||||
self.crushCell.registerCrusher(self.entId)
|
self.crushCell.registerCrusher(self.entId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def sendCrushMsg(self, axis = 0):
|
def sendCrushMsg(self, axis = 0):
|
||||||
if self.isCrusher:
|
if self.isCrusher:
|
||||||
messenger.send(self.crushMsg, [
|
messenger.send(self.crushMsg, [
|
||||||
self.entId,
|
self.entId,
|
||||||
axis])
|
axis])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getPosition(self):
|
def getPosition(self):
|
||||||
if hasattr(self, 'pos'):
|
if hasattr(self, 'pos'):
|
||||||
return self.pos
|
return self.pos
|
||||||
|
|
|
@ -442,4 +442,4 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase,
|
||||||
self.doorLeft.unstash()
|
self.doorLeft.unstash()
|
||||||
self.doorRight.unstash()
|
self.doorRight.unstash()
|
||||||
self.doorLeft.setPos(Vec3(0.0))
|
self.doorLeft.setPos(Vec3(0.0))
|
||||||
self.doorRight.setPos(Vec3(0.0))
|
self.doorRight.setPos(Vec3(0.0))
|
|
@ -206,4 +206,4 @@ class DistributedDoorEntityAI(DistributedDoorEntityBase.DistributedDoorEntityBas
|
||||||
def requestOpen(self):
|
def requestOpen(self):
|
||||||
if self.isUnlocked():
|
if self.isUnlocked():
|
||||||
if self.fsm.getCurrentState() is not self.states[2]:
|
if self.fsm.getCurrentState() is not self.states[2]:
|
||||||
self.fsm.request(self.states[1])
|
self.fsm.request(self.states[1])
|
|
@ -124,4 +124,4 @@ class DistributedLawOfficeFloorAI(DistributedLevelAI.DistributedLevelAI, LawOffi
|
||||||
suitIds = []
|
suitIds = []
|
||||||
for suit in self.reserveSuits:
|
for suit in self.reserveSuits:
|
||||||
suitIds.append(suit[0].doId)
|
suitIds.append(suit[0].doId)
|
||||||
return suitIds
|
return suitIds
|
|
@ -199,4 +199,4 @@ class DistributedLift(BasicEntities.DistributedNodePathEntity):
|
||||||
self.notify.debug('enterWaiting')
|
self.notify.debug('enterWaiting')
|
||||||
|
|
||||||
def exitWaiting(self):
|
def exitWaiting(self):
|
||||||
pass
|
pass
|
|
@ -6,6 +6,6 @@ class DistributedMegaCorp(DistributedFactory.DistributedFactory):
|
||||||
|
|
||||||
def __init__(self, cr):
|
def __init__(self, cr):
|
||||||
DistributedFactory.DistributedFactory.__init__(self, cr)
|
DistributedFactory.DistributedFactory.__init__(self, cr)
|
||||||
|
|
||||||
def getFloorOuchLevel(self):
|
def getFloorOuchLevel(self):
|
||||||
return 8
|
return 8
|
||||||
|
|
|
@ -128,4 +128,4 @@ class DistributedMintRoomAI(DistributedLevelAI.DistributedLevelAI, MintRoomBase.
|
||||||
mint.allToonsGone()
|
mint.allToonsGone()
|
||||||
else:
|
else:
|
||||||
self.notify.warning('no mint %s in allToonsGone' % self.mintDoId)
|
self.notify.warning('no mint %s in allToonsGone' % self.mintDoId)
|
||||||
return
|
return
|
|
@ -6,3 +6,4 @@ class DistributedSellbotHQDoorAI(DistributedCogHQDoorAI):
|
||||||
|
|
||||||
def informPlayer(self, todo0):
|
def informPlayer(self, todo0):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -344,4 +344,4 @@ class DistributedStomper(DistributedCrusherEntity.DistributedCrusherEntity):
|
||||||
yRange = 5
|
yRange = 5
|
||||||
if tPos[2] < zRange and tPos[2] > -zRange and tPos[0] < xRange and tPos[0] > -xRange and tPos[1] < yRange / 10.0 and tPos[1] > -yRange:
|
if tPos[2] < zRange and tPos[2] > -zRange and tPos[0] < xRange and tPos[0] > -xRange and tPos[1] < yRange / 10.0 and tPos[1] > -yRange:
|
||||||
self.level.b_setOuch(self.damage, 'Squish')
|
self.level.b_setOuch(self.damage, 'Squish')
|
||||||
base.localAvatar.setZ(self.getZ(render) + 0.025)
|
base.localAvatar.setZ(self.getZ(render) + 0.025)
|
|
@ -35,7 +35,7 @@ class DistributedStomperAI(DistributedCrusherEntityAI.DistributedCrusherEntityAI
|
||||||
for id in self.crushCell.occupantIds:
|
for id in self.crushCell.occupantIds:
|
||||||
if id in self.crushCell.crushables:
|
if id in self.crushCell.crushables:
|
||||||
crushedList.append(id)
|
crushedList.append(id)
|
||||||
|
|
||||||
self.sendCrushMsg()
|
self.sendCrushMsg()
|
||||||
self.sendUpdate('setMovie', [StomperGlobals.STOMPER_STOMP, ClockDelta.globalClockDelta.getRealNetworkTime(), crushedList])
|
self.sendUpdate('setMovie', [StomperGlobals.STOMPER_STOMP, ClockDelta.globalClockDelta.getRealNetworkTime(), crushedList])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -121,4 +121,4 @@ class DistributedSwitch(DistributedSwitchBase.DistributedSwitchBase, BasicEntiti
|
||||||
if self.track:
|
if self.track:
|
||||||
self.track.finish()
|
self.track.finish()
|
||||||
self.track = None
|
self.track = None
|
||||||
return
|
return
|
|
@ -107,4 +107,4 @@ class DistributedSwitchAI(DistributedSwitchBase.DistributedSwitchBase, Distribut
|
||||||
if self.doLaterTask:
|
if self.doLaterTask:
|
||||||
self.doLaterTask.remove()
|
self.doLaterTask.remove()
|
||||||
self.doLaterTask = None
|
self.doLaterTask = None
|
||||||
return
|
return
|
|
@ -14,4 +14,4 @@ class FactoryBase:
|
||||||
return self.cogTrack
|
return self.cogTrack
|
||||||
|
|
||||||
def getFactoryType(self):
|
def getFactoryType(self):
|
||||||
return self.factoryType
|
return self.factoryType
|
|
@ -33,4 +33,4 @@ class FactoryLevelMgr(LevelMgr.LevelMgr):
|
||||||
LevelMgr.LevelMgr.destroy(self)
|
LevelMgr.LevelMgr.destroy(self)
|
||||||
|
|
||||||
def setFarPlaneDistance(self, farPlaneDistance):
|
def setFarPlaneDistance(self, farPlaneDistance):
|
||||||
base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance)
|
base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance)
|
|
@ -21,7 +21,7 @@ class FactoryManagerAI(DirectObject.DirectObject):
|
||||||
factoryId = FactoryManagerAI.factoryId
|
factoryId = FactoryManagerAI.factoryId
|
||||||
if entranceId == 2:
|
if entranceId == 2:
|
||||||
factory = DistributedMegaCorpAI.DistributedMegaCorpAI(self.air, factoryId, factoryZone, entranceId, players)
|
factory = DistributedMegaCorpAI.DistributedMegaCorpAI(self.air, factoryId, factoryZone, entranceId, players)
|
||||||
else:
|
else:
|
||||||
factory = DistributedFactoryAI.DistributedFactoryAI(self.air, factoryId, factoryZone, entranceId, players)
|
factory = DistributedFactoryAI.DistributedFactoryAI(self.air, factoryId, factoryZone, entranceId, players)
|
||||||
factory.generateWithRequired(factoryZone)
|
factory.generateWithRequired(factoryZone)
|
||||||
return factoryZone
|
return factoryZone
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue