mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-10-30 16:27:54 +00:00
yay repo cleanup
This commit is contained in:
parent
3f55a00f0e
commit
ad09d429fb
368 changed files with 1156 additions and 1231 deletions
|
@ -32,7 +32,3 @@ print 'Encrypted string:', encoded
|
|||
# decode the encoded string
|
||||
decoded = DecodeAES(cipher, encoded)
|
||||
print 'Decrypted string:', decoded
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,50 +29,50 @@ def generate_token(accessLevel):
|
|||
|
||||
random.seed()
|
||||
while True:
|
||||
try:
|
||||
res = client.ping(generate_token(700), 12345)
|
||||
if res != 12345:
|
||||
print "Is the server accessable?\n"
|
||||
exit
|
||||
|
||||
# How many times a day is this script going to be called?
|
||||
ChecksPerDay = 60.0*24.0 # Once a minute
|
||||
InvasionsPerDay = 72.0 # How many invasions a day per district
|
||||
BaseInvasionChance = InvasionsPerDay/ChecksPerDay
|
||||
|
||||
safeHarbor = {'Wacky Falls'}
|
||||
superDistricts = {'Nuttyboro'}
|
||||
|
||||
|
||||
while True:
|
||||
shards = client.listShards(generate_token(700))
|
||||
print shards
|
||||
count = 0
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] != None:
|
||||
count = count + 1
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] == None:
|
||||
if shard['name'] in superDistricts:
|
||||
typ = int(float(random.random()) * 4.0)
|
||||
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)
|
||||
count = count + 1
|
||||
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
||||
if count < 3:
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] == None and not shard['name'] in safeHarbor:
|
||||
r = random.random()
|
||||
if r < BaseInvasionChance and not shard['name'] in superDistricts:
|
||||
typ = int(float(random.random()) * 4.0)
|
||||
suit = int(float(random.random()) * 8.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 "tick..(was %d)\n"%(count)
|
||||
time.sleep(60)
|
||||
except Exception, e:
|
||||
print e
|
||||
time.sleep(300)
|
||||
try:
|
||||
res = client.ping(generate_token(700), 12345)
|
||||
if res != 12345:
|
||||
print "Is the server accessable?\n"
|
||||
exit
|
||||
|
||||
# How many times a day is this script going to be called?
|
||||
ChecksPerDay = 60.0*24.0 # Once a minute
|
||||
InvasionsPerDay = 72.0 # How many invasions a day per district
|
||||
BaseInvasionChance = InvasionsPerDay/ChecksPerDay
|
||||
|
||||
safeHarbor = {'Wacky Falls'}
|
||||
superDistricts = {'Nuttyboro'}
|
||||
|
||||
|
||||
while True:
|
||||
shards = client.listShards(generate_token(700))
|
||||
print shards
|
||||
count = 0
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] != None:
|
||||
count = count + 1
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] == None:
|
||||
if shard['name'] in superDistricts:
|
||||
typ = int(float(random.random()) * 4.0)
|
||||
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)
|
||||
count = count + 1
|
||||
print 'Calling invasion for %s with %d,%d'%(shard['name'],typ,suit)
|
||||
if count < 3:
|
||||
for skey in shards:
|
||||
shard = shards[skey]
|
||||
if shard['invasion'] == None and not shard['name'] in safeHarbor:
|
||||
r = random.random()
|
||||
if r < BaseInvasionChance and not shard['name'] in superDistricts:
|
||||
typ = int(float(random.random()) * 4.0)
|
||||
suit = int(float(random.random()) * 8.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 "tick..(was %d)\n"%(count)
|
||||
time.sleep(60)
|
||||
except Exception, e:
|
||||
print e
|
||||
time.sleep(300)
|
||||
|
|
|
@ -14,7 +14,7 @@ class MagicWordManagerAI(DistributedObjectAI):
|
|||
if not 'DistributedToonAI' in str(self.air.doId2do.get(targetId)):
|
||||
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['Target is not a toon object!'])
|
||||
return
|
||||
|
||||
|
||||
if not invoker:
|
||||
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', ['missing invoker'])
|
||||
return
|
||||
|
@ -56,21 +56,20 @@ def help(wordName=None):
|
|||
return 'Did you mean %s' % (spellbook.words.get(key).name)
|
||||
return 'I have no clue what %s is referring to' % (wordName)
|
||||
return word.doc
|
||||
|
||||
|
||||
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[])
|
||||
def words():
|
||||
accessLevel = spellbook.getInvoker().getAdminAccess()
|
||||
wordString = None
|
||||
for key in spellbook.words:
|
||||
word = spellbook.words.get(key)
|
||||
if word.access <= accessLevel:
|
||||
if wordString is None:
|
||||
wordString = key
|
||||
else:
|
||||
wordString += ", ";
|
||||
wordString += key;
|
||||
word = spellbook.words.get(key)
|
||||
if word.access <= accessLevel:
|
||||
if wordString is None:
|
||||
wordString = key
|
||||
else:
|
||||
wordString += ", ";
|
||||
wordString += key;
|
||||
if wordString is None:
|
||||
return "You are chopped liver"
|
||||
else:
|
||||
return wordString
|
||||
|
||||
|
|
|
@ -125,4 +125,4 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
info = TTPythonUtil.describeException()
|
||||
self.notify.info('Client exception: %s' % info)
|
||||
self.sendUpdate('setExceptionInfo', [info])
|
||||
self.cr.flush()
|
||||
self.cr.flush()
|
||||
|
|
|
@ -10,13 +10,13 @@ class TimeManagerAI(DistributedObjectAI):
|
|||
def __init__(self, air):
|
||||
DistributedObjectAI.__init__(self, air)
|
||||
self.avId2DcReason = {}
|
||||
|
||||
|
||||
def requestServerTime(self, context):
|
||||
self.sendUpdateToAvatarId(self.air.getAvatarIdFromSender(), 'serverTime', [context, globalClockDelta.getRealNetworkTime(bits=32), int(time.time())])
|
||||
|
||||
def setDisconnectReason(self, reason):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
|
||||
|
||||
if reason == OTPGlobals.DisconnectNone and avId in self.avId2DcReason:
|
||||
del self.avId2DcReason[avId]
|
||||
else:
|
||||
|
@ -25,6 +25,6 @@ class TimeManagerAI(DistributedObjectAI):
|
|||
def setExceptionInfo(self, exception):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
self.air.writeServerEvent('client-exception', avId, exception)
|
||||
|
||||
|
||||
def getDisconnectReason(self, avId):
|
||||
return self.avId2DcReason.get(avId, 0)
|
||||
return self.avId2DcReason.get(avId, 0)
|
||||
|
|
|
@ -222,11 +222,11 @@ class Avatar(Actor, ShadowCaster):
|
|||
if self.isDisguised:
|
||||
return
|
||||
self.setNametagName(str)
|
||||
|
||||
|
||||
def setNametagName(self, name=None):
|
||||
if not name:
|
||||
name = self.name
|
||||
|
||||
|
||||
self.nametag.setName(name)
|
||||
|
||||
if hasattr(self, 'adminAccess') and self.isAdmin():
|
||||
|
|
|
@ -69,4 +69,4 @@ class DistributedAvatarAI(DistributedNodeAI.DistributedNodeAI):
|
|||
senderId = self.air.getAvatarIdFromSender()
|
||||
self.air.writeServerEvent('Admin chat warning', senderId, 'using setParentStr to send "%s"' % parentToken)
|
||||
self.notify.warning('Admin chat warning: %s using setParentStr to send "%s"' % (senderId, parentToken))
|
||||
DistributedNodeAI.DistributedNodeAI.setParentStr(self, parentToken)
|
||||
DistributedNodeAI.DistributedNodeAI.setParentStr(self, parentToken)
|
||||
|
|
|
@ -14,4 +14,4 @@ class DistributedAvatarUD(DistributedObjectUD):
|
|||
pass
|
||||
|
||||
def confirmAvOnShard(self, todo0, todo1):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -195,7 +195,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
|
|||
|
||||
def displayTalk(self, chat):
|
||||
print 'Talk: %s' % chat
|
||||
|
||||
|
||||
def displayTalkWhisper(self, avId, chat):
|
||||
print 'TalkWhisper from %s: %s' % (avId, chat)
|
||||
|
||||
|
@ -258,7 +258,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
|
|||
|
||||
def teleportQuery(self, requesterId):
|
||||
avatar = base.cr.identifyFriend(requesterId)
|
||||
|
||||
|
||||
if avatar is None:
|
||||
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
|
||||
elif base.localAvatar.isIgnored(requesterId):
|
||||
|
@ -354,4 +354,4 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
|
|||
self.autoRun = value
|
||||
|
||||
def getAutoRun(self):
|
||||
return self.autoRun
|
||||
return self.autoRun
|
||||
|
|
|
@ -99,7 +99,7 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
|
|||
|
||||
def getAdminAccess(self):
|
||||
return self.adminAccess
|
||||
|
||||
|
||||
def isAdmin(self):
|
||||
return self.adminAccess >= MINIMUM_MAGICWORD_ACCESS
|
||||
|
||||
|
@ -248,4 +248,4 @@ def enableGM():
|
|||
|
||||
target.d_setAdminAccess(target.oldAccess)
|
||||
del target.oldAccess
|
||||
return 'GM features are enabled!'
|
||||
return 'GM features are enabled!'
|
||||
|
|
|
@ -1100,7 +1100,7 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
|
|||
|
||||
def clickedWhisper(self, doId):
|
||||
friend = base.cr.identifyFriend(doId)
|
||||
|
||||
|
||||
if friend != None:
|
||||
messenger.send('clickedNametag', [friend])
|
||||
self.chatMgr.whisperTo(friend.getName(), doId)
|
||||
|
|
|
@ -4,4 +4,4 @@ class PlayerBase:
|
|||
return True
|
||||
|
||||
def getLocation(self):
|
||||
return []
|
||||
return []
|
||||
|
|
|
@ -125,4 +125,4 @@ class ShadowCaster:
|
|||
|
||||
def __globalDropShadowGrayLevelChanged(self):
|
||||
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)
|
||||
|
|
|
@ -48,4 +48,4 @@ def chatmode(mode=-1):
|
|||
# Like this will ever happen, but whatever.
|
||||
return "Chat mode 1 is reserved for moderators."
|
||||
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")
|
||||
|
|
|
@ -37,4 +37,4 @@ class ChatAgentUD(DistributedObjectGlobalUD):
|
|||
|
||||
DistributedAvatar = self.air.dclassesByName['DistributedAvatarUD']
|
||||
dg = DistributedAvatar.aiFormatUpdate('setTalk', sender, self.chatMode2channel.get(chatMode, sender), self.air.ourChannel, [message])
|
||||
self.air.send(dg)
|
||||
self.air.send(dg)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import random
|
||||
|
||||
class ChatGarbler:
|
||||
|
||||
|
||||
def __init__(self, messages):
|
||||
self.messages = messages
|
||||
|
||||
|
@ -19,4 +19,4 @@ class ChatGarbler:
|
|||
if i < numWords:
|
||||
newMessage = newMessage + ' '
|
||||
|
||||
return '\x01WLDisplay\x01%s\x02' % newMessage
|
||||
return '\x01WLDisplay\x01%s\x02' % newMessage
|
||||
|
|
|
@ -108,10 +108,10 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
|
|||
|
||||
if text:
|
||||
self.chatEntry.set('')
|
||||
|
||||
|
||||
if not base.cr.chatAgent.verifyMessage(text):
|
||||
return
|
||||
|
||||
|
||||
self.sendChatBySwitch(text)
|
||||
|
||||
if not overflow:
|
||||
|
@ -151,4 +151,4 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
|
|||
|
||||
def applyFilter(self, keyArgs):
|
||||
if base.whiteList:
|
||||
self.chatEntry.set(base.whiteList.processThroughAll(self.chatEntry.get(plain=True)))
|
||||
self.chatEntry.set(base.whiteList.processThroughAll(self.chatEntry.get(plain=True)))
|
||||
|
|
|
@ -276,4 +276,4 @@ class ChatManager(DirectObject.DirectObject):
|
|||
pass
|
||||
|
||||
def exitOtherDialog(self):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -12,4 +12,4 @@ def removeThoughtPrefix(message):
|
|||
def findAvatarName(id):
|
||||
info = base.cr.identifyAvatar(id)
|
||||
|
||||
return info.getName() if info else ''
|
||||
return info.getName() if info else ''
|
||||
|
|
|
@ -376,4 +376,4 @@ SEQUENCES = {
|
|||
'push': ['y', 'ye', 'cee', 'say', 'says', 'sea', 'seas', 'see', 'sees', 'she', 'shes', "she's", 'si'],
|
||||
'ashton': ['hole', 'whole', 'ole', 'ooo le', 'holes', 'zzz', "'s"],
|
||||
'having': ['sec', 'see ex'],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ class WhiteList:
|
|||
|
||||
def setSequenceList(self, sequences):
|
||||
self.sequenceList = sequences
|
||||
|
||||
|
||||
def getSequenceList(self, word):
|
||||
return self.sequenceList[word] if word and word in self.sequenceList else None
|
||||
|
||||
|
@ -27,7 +27,7 @@ class WhiteList:
|
|||
i = bisect_left(self.words, text)
|
||||
|
||||
return i != self.numWords and self.words[i].startswith(text)
|
||||
|
||||
|
||||
def getReplacement(self, text, av=None, garbler=None):
|
||||
return '\x01WLRed\x01%s\x02' % text if not garbler else garbler.garble(av, len(text.split(' ')))
|
||||
|
||||
|
@ -53,7 +53,7 @@ class WhiteList:
|
|||
newWords[-1] = self.getReplacement(lastWord, av, garbler)
|
||||
|
||||
return ' '.join(newWords)
|
||||
|
||||
|
||||
def processSequences(self, text, av=None, garbler=None):
|
||||
if not self.sequenceList:
|
||||
return text
|
||||
|
@ -80,4 +80,4 @@ class WhiteList:
|
|||
if (text.startswith('~') and not garbler):
|
||||
return text
|
||||
|
||||
return self.processSequences(self.processText(re.sub(' +', ' ', text), av, garbler), av, garbler)
|
||||
return self.processSequences(self.processText(re.sub(' +', ' ', text), av, garbler), av, garbler)
|
||||
|
|
|
@ -36861,4 +36861,4 @@ WHITELIST = [
|
|||
'zyyk',
|
||||
'zzz',
|
||||
'zzzzzs',
|
||||
]
|
||||
]
|
||||
|
|
|
@ -3,4 +3,3 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|||
|
||||
class AccountAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountAI")
|
||||
|
||||
|
|
|
@ -3,4 +3,3 @@ from direct.distributed.DistributedObjectUD import DistributedObjectUD
|
|||
|
||||
class AccountUD(DistributedObjectUD):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountUD")
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ from direct.directnotify import DirectNotifyGlobal
|
|||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class DistributedDirectoryAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI")
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI")
|
||||
|
|
|
@ -30,4 +30,4 @@ class DistributedDistrict(DistributedObject):
|
|||
|
||||
def setName(self, name):
|
||||
self.name = name
|
||||
messenger.send('shardInfoUpdated')
|
||||
messenger.send('shardInfoUpdated')
|
||||
|
|
|
@ -9,4 +9,3 @@ class DistributedDistrictUD(DistributedObjectUD):
|
|||
|
||||
def setAvailable(self, todo0):
|
||||
pass
|
||||
|
||||
|
|
|
@ -1217,7 +1217,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
|
||||
def identifyAvatar(self, doId):
|
||||
info = self.doId2do.get(doId)
|
||||
|
||||
|
||||
return info if info else self.identifyFriend(doId)
|
||||
|
||||
def sendDisconnect(self):
|
||||
|
@ -1407,4 +1407,4 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
ITAG_GAME = 'game'
|
||||
|
||||
def addTaggedInterest(self, parentId, zoneId, mainTag, desc, otherTags = [], event = None):
|
||||
return self.addInterest(parentId, zoneId, desc, event)
|
||||
return self.addInterest(parentId, zoneId, desc, event)
|
||||
|
|
|
@ -16,4 +16,4 @@ class PotentialAvatar:
|
|||
self.shared = shared
|
||||
self.online = online
|
||||
self.defaultShard = defaultShard
|
||||
self.lastLogout = lastLogout
|
||||
self.lastLogout = lastLogout
|
||||
|
|
|
@ -5,4 +5,4 @@ class PotentialShard:
|
|||
self.name = None
|
||||
self.population = 0
|
||||
self.active = 1
|
||||
self.available = 1
|
||||
self.available = 1
|
||||
|
|
|
@ -117,4 +117,4 @@ class FriendManagerAI(DistributedObjectAI):
|
|||
self.air.writeServerEvent('suspicious', avId, 'Player tried to cancel non-cancelled request!')
|
||||
return
|
||||
|
||||
del self.requests[context]
|
||||
del self.requests[context]
|
||||
|
|
|
@ -30,4 +30,4 @@ class AmbientSound(BasicEntities.NodePathEntity):
|
|||
self.soundIval.pause()
|
||||
del self.soundIval
|
||||
if hasattr(self, 'sound'):
|
||||
del self.sound
|
||||
del self.sound
|
||||
|
|
|
@ -31,4 +31,4 @@ class CollisionSolidEntity(BasicEntities.NodePathEntity):
|
|||
if self.collNodePath is not None:
|
||||
self.collNodePath.removeNode()
|
||||
self.collNodePath = None
|
||||
return
|
||||
return
|
||||
|
|
|
@ -34,4 +34,4 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI, Entity.Entity
|
|||
return self.levelDoId
|
||||
|
||||
def getEntId(self):
|
||||
return self.entId
|
||||
return self.entId
|
||||
|
|
|
@ -21,4 +21,3 @@ class DistributedInteractiveEntityAI(DistributedEntityAI):
|
|||
|
||||
def setState(self, todo0, todo1):
|
||||
pass
|
||||
|
||||
|
|
|
@ -95,4 +95,4 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
av.takeDamage(penalty)
|
||||
if av.getHp() <= 0:
|
||||
av.inventory.zeroInv()
|
||||
av.d_setInventory(av.inventory.makeNetString())
|
||||
av.d_setInventory(av.inventory.makeNetString())
|
||||
|
|
|
@ -84,4 +84,4 @@ class Entity(DirectObject):
|
|||
return
|
||||
|
||||
def setAttribInit(self, attrib, value):
|
||||
self.__dict__[attrib] = value
|
||||
self.__dict__[attrib] = value
|
||||
|
|
|
@ -30,4 +30,4 @@ class EntrancePoint(BasicEntities.NodePathEntity):
|
|||
def destroyEntrancePoint(self):
|
||||
if self.entranceId >= 0:
|
||||
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)
|
||||
|
||||
def handleVisChange(self):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
MinZoneNum = 0
|
||||
MaxZoneNum = 999
|
||||
UberZoneEntId = 0
|
||||
LevelMgrEntId = 1000
|
||||
LevelMgrEntId = 1000
|
||||
|
|
|
@ -6,7 +6,7 @@ class LevelMgr(LevelMgrBase.LevelMgrBase):
|
|||
def __init__(self, level, entId):
|
||||
LevelMgrBase.LevelMgrBase.__init__(self, level, entId)
|
||||
self.geom = loader.loadModel(self.modelFilename)
|
||||
|
||||
|
||||
if hasattr(self, 'removeNodes'):
|
||||
for node in self.removeNodes:
|
||||
self.geom.find(node).removeNode()
|
||||
|
|
|
@ -30,4 +30,4 @@ class LevelMgrAI(LevelMgrBase.LevelMgrBase):
|
|||
zoneNums.sort()
|
||||
self.level.zoneIds = []
|
||||
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)
|
||||
self.reparentTo(hidden)
|
||||
else:
|
||||
self.reparentTo(parent)
|
||||
self.reparentTo(parent)
|
||||
|
|
|
@ -42,4 +42,4 @@ class PathEntity(BasicEntities.NodePathEntity):
|
|||
duration = distance / velocity
|
||||
track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint))
|
||||
|
||||
return track
|
||||
return track
|
||||
|
|
|
@ -49,4 +49,4 @@ class PropSpinner(Entity):
|
|||
def destroyProps(self):
|
||||
if hasattr(self, 'spinTracks'):
|
||||
self.spinTracks.pause()
|
||||
del self.spinTracks
|
||||
del self.spinTracks
|
||||
|
|
|
@ -41,4 +41,4 @@ class VisibilityExtender(Entity.Entity):
|
|||
|
||||
def destroy(self):
|
||||
self.destroyVisExt()
|
||||
Entity.Entity.destroy(self)
|
||||
Entity.Entity.destroy(self)
|
||||
|
|
|
@ -31,4 +31,4 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
|
|||
for zoneNum in zoneNumList:
|
||||
self.visibleZoneNums[zoneNum] -= 1
|
||||
if self.visibleZoneNums[zoneNum] == 0:
|
||||
del self.visibleZoneNums[zoneNum]
|
||||
del self.visibleZoneNums[zoneNum]
|
||||
|
|
|
@ -157,4 +157,4 @@ class Nametag(ClickablePopup):
|
|||
self.frame = (t.node().getLeft()-self.NAME_PADDING/2.0,
|
||||
t.node().getRight()+self.NAME_PADDING/2.0,
|
||||
t.node().getBottom()-self.NAME_PADDING/2.0,
|
||||
t.node().getTop()+self.NAME_PADDING/2.0)
|
||||
t.node().getTop()+self.NAME_PADDING/2.0)
|
||||
|
|
|
@ -19,7 +19,7 @@ class OTPBase(ShowBase):
|
|||
self.enviroCam = None
|
||||
self.pixelZoomSetup = False
|
||||
self.whiteList = None
|
||||
|
||||
|
||||
if config.GetBool('want-whitelist', True):
|
||||
self.whiteList = WhiteList.WhiteList()
|
||||
self.whiteList.setWords(WhiteListData.WHITELIST)
|
||||
|
@ -283,4 +283,4 @@ def backgroundColor(r=None, g=1, b=1, a=1):
|
|||
if r is None:
|
||||
r, g, b, a = OTPGlobals.DefaultBackgroundColor
|
||||
base.setBackgroundColor(Vec4(r, g, b, a))
|
||||
return 'The background color has been changed.'
|
||||
return 'The background color has been changed.'
|
||||
|
|
|
@ -297,4 +297,4 @@ AvatarFriendInvitationEvent = 'avatarFriendInvitationEvent'
|
|||
AvatarFriendRejectInviteEvent = 'avatarFriendRejectInviteEvent'
|
||||
AvatarFriendRetractInviteEvent = 'avatarFriendRetractInviteEvent'
|
||||
AvatarFriendRejectRemoveEvent = 'avatarFriendRejectRemoveEvent'
|
||||
WhisperIncomingEvent = 'whisperIncomingEvent'
|
||||
WhisperIncomingEvent = 'whisperIncomingEvent'
|
||||
|
|
|
@ -2344,4 +2344,4 @@ AccessToString = {
|
|||
500: '\x01androidGreen\x01Developer\x02',
|
||||
600: '\x01cobalt\x01Admin\x02',
|
||||
700: '\x01azure\x01System Admin\x02'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,4 @@ class CogSuitManagerAI:
|
|||
parts = toon.getCogParts()
|
||||
|
||||
if CogDisguiseGlobals.isSuitComplete(parts, suitDept):
|
||||
toon.loseCogParts(suitDept)
|
||||
toon.loseCogParts(suitDept)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObject import DistributedObject
|
||||
from toontown.toonbase import ToontownGlobals
|
||||
|
||||
|
||||
class DistributedBlackCatMgr(DistributedObject):
|
||||
neverDisable = 1
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBlackCatMgr')
|
||||
|
@ -21,4 +21,4 @@ class DistributedBlackCatMgr(DistributedObject):
|
|||
self.sendUpdate('requestBlackCatTransformation')
|
||||
|
||||
def doBlackCatTransformation(self):
|
||||
base.localAvatar.getDustCloud(0.0, color=base.localAvatar.style.getBlackColor()).start()
|
||||
base.localAvatar.getDustCloud(0.0, color=base.localAvatar.style.getBlackColor()).start()
|
||||
|
|
|
@ -20,4 +20,4 @@ class DistributedBlackCatMgrAI(DistributedObjectAI):
|
|||
newDNA.makeFromNetString(av.getDNAString())
|
||||
newDNA.updateToonProperties(armColor=26, legColor=26, headColor=26)
|
||||
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId)
|
||||
self.sendUpdateToAvatarId(avId, 'doBlackCatTransformation', [])
|
||||
self.sendUpdateToAvatarId(avId, 'doBlackCatTransformation', [])
|
||||
|
|
|
@ -7,7 +7,7 @@ class DistributedEffectMgr(DistributedObject):
|
|||
def __init__(self, cr):
|
||||
DistributedObject.__init__(self, cr)
|
||||
self.nextTime = 0
|
||||
|
||||
|
||||
def delete(self):
|
||||
self.ignoreAll()
|
||||
DistributedObject.delete(self)
|
||||
|
@ -46,4 +46,4 @@ class DistributedEffectMgr(DistributedObject):
|
|||
if type == HolidayGlobals.TRICK_OR_TREAT:
|
||||
base.localAvatar.trickOrTreatTargetMet(amount)
|
||||
elif type == HolidayGlobals.WINTER_CAROLING:
|
||||
base.localAvatar.winterCarolingTargetMet(amount)
|
||||
base.localAvatar.winterCarolingTargetMet(amount)
|
||||
|
|
|
@ -40,4 +40,4 @@ class DistributedEffectMgrAI(DistributedObjectAI):
|
|||
av.b_setCheesyEffect(self.effectId, 0, expireTime)
|
||||
else:
|
||||
av.b_setCheesyEffect(self.effectId, 0, expireTime)
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone', [0])
|
||||
self.sendUpdateToAvatarId(avId, 'effectDone', [0])
|
||||
|
|
|
@ -23,4 +23,4 @@ class DistributedPolarPlaceEffectMgrAI(DistributedObjectAI, FSM):
|
|||
return
|
||||
|
||||
expireTime = int((time.time()/60) + 0.5) + 60
|
||||
av.b_setCheesyEffect(13, 3000, expireTime)
|
||||
av.b_setCheesyEffect(13, 3000, expireTime)
|
||||
|
|
|
@ -37,7 +37,7 @@ class HalloweenHolidayDecorator(HolidayDecorator.HolidayDecorator):
|
|||
base.cr.playGame.getPlace().loader.hood.loader and
|
||||
hasattr(base.cr.playGame.getPlace().loader.hood.loader, 'geom') and
|
||||
base.cr.playGame.getPlace().loader.hood.loader.geom):
|
||||
return True
|
||||
return True
|
||||
else:
|
||||
if hasattr(base.cr.playGame, 'getPlace') and base.cr.playGame.getPlace():
|
||||
self.notify.debug('Failed Hood Check %s' % base.cr.playGame.getPlace())
|
||||
|
|
|
@ -61,4 +61,4 @@ class HolidayDecorator:
|
|||
s = Sequence(Wait(wait), np.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut'), Func(np.detachNode), Func(np.clearTransparency), newNP.colorScaleInterval(tFadeOut, Vec4(1, 1, 1, 1), startColorScale=Vec4(1, 1, 1, 0), blendType='easeInOut'), Func(newNP.clearTransparency), Func(newNP.clearColorScale))
|
||||
p.append(s)
|
||||
|
||||
return p
|
||||
return p
|
||||
|
|
|
@ -133,7 +133,7 @@ def getStartDate(holiday, rightNow=None):
|
|||
startMonth = holiday['startMonth'] if 'startMonth' in holiday else rightNow.month
|
||||
startDay = holiday['startDay'] if 'startDay' in holiday else (rightNow.day if 'weekDay' in holiday else calendar.monthrange(rightNow.year, startMonth)[0])
|
||||
startDate = datetime.datetime(rightNow.year, startMonth, startDay, tzinfo=TIME_ZONE)
|
||||
|
||||
|
||||
return startDate
|
||||
|
||||
def getEndDate(holiday, rightNow=None):
|
||||
|
@ -149,4 +149,4 @@ def getEndDate(holiday, rightNow=None):
|
|||
|
||||
endDate = datetime.datetime(endYear, endMonth, endDay, tzinfo=TIME_ZONE)
|
||||
|
||||
return endDate
|
||||
return endDate
|
||||
|
|
|
@ -22,7 +22,7 @@ class NewsManager(DistributedObject):
|
|||
|
||||
def isHolidayRunning(self, id):
|
||||
return id in self.activeHolidays
|
||||
|
||||
|
||||
def setActiveHolidays(self, ids):
|
||||
for id in ids:
|
||||
self.startHoliday(id, True)
|
||||
|
@ -30,13 +30,13 @@ class NewsManager(DistributedObject):
|
|||
def broadcastHoliday(self, holiday, type):
|
||||
if type in holiday:
|
||||
base.localAvatar.setSystemMessage(0, holiday[type])
|
||||
|
||||
|
||||
def startHoliday(self, id, ongoing=False):
|
||||
if id in self.activeHolidays or id not in HolidayGlobals.Holidays:
|
||||
return
|
||||
|
||||
holiday = HolidayGlobals.getHoliday(id)
|
||||
|
||||
|
||||
self.activeHolidays.append(id)
|
||||
self.broadcastHoliday(holiday, 'ongoingMessage' if ongoing else 'startMessage')
|
||||
self.startSpecialHoliday(id)
|
||||
|
@ -82,7 +82,7 @@ class NewsManager(DistributedObject):
|
|||
base.localAvatar.chatMgr.chatInputSpeedChat.removeHalloweenMenu()
|
||||
elif id == ToontownGlobals.CHRISTMAS:
|
||||
base.localAvatar.chatMgr.chatInputSpeedChat.removeWinterMenu()
|
||||
|
||||
|
||||
def setInvasionStatus(self, msgType, suitType, remaining, flags):
|
||||
if msgType not in ToontownGlobals.SuitInvasions:
|
||||
return
|
||||
|
@ -97,9 +97,9 @@ class NewsManager(DistributedObject):
|
|||
|
||||
track = Sequence()
|
||||
base.localAvatar.inventory.setInvasionCreditMultiplier(1 if msgType in ToontownGlobals.EndingInvasions else ToontownBattleGlobals.getInvasionMultiplier())
|
||||
|
||||
|
||||
for i, message in enumerate(ToontownGlobals.SuitInvasions[msgType]):
|
||||
track.append(Wait(5 if i else 1))
|
||||
track.append(Func(base.localAvatar.setSystemMessage, 0, (TTLocalizer.SuitInvasionPrefix + message) % suitNames))
|
||||
|
||||
track.start()
|
||||
track.start()
|
||||
|
|
|
@ -14,18 +14,18 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
DistributedObjectAI.__init__(self, air)
|
||||
self.activeHolidays = []
|
||||
self.fireworkTask = None
|
||||
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObjectAI.announceGenerate(self)
|
||||
self.__checkHolidays()
|
||||
self.checkTask = taskMgr.doMethodLater(15, self.__checkHolidays, 'holidayCheckTask')
|
||||
self.accept('avatarEntered', self.__handleAvatarEntered)
|
||||
|
||||
|
||||
def delete(self):
|
||||
DistributedObjectAI.delete(self)
|
||||
taskMgr.remove(self.checkTask)
|
||||
self.deleteFireworkTask()
|
||||
|
||||
|
||||
def deleteFireworkTask(self):
|
||||
if self.fireworkTask:
|
||||
taskMgr.remove(self.fireworkTask)
|
||||
|
@ -48,7 +48,7 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
for id in HolidayGlobals.Holidays:
|
||||
holiday = HolidayGlobals.Holidays[id]
|
||||
running = self.isHolidayRunning(id)
|
||||
|
||||
|
||||
if self.isHolidayInRange(holiday, date):
|
||||
if not running:
|
||||
self.startHoliday(id)
|
||||
|
@ -56,7 +56,7 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
self.endHoliday(id)
|
||||
|
||||
return Task.again
|
||||
|
||||
|
||||
def isHolidayInRange(self, holiday, date):
|
||||
if 'weekDay' in holiday:
|
||||
return holiday['weekDay'] == date.weekday()
|
||||
|
@ -73,7 +73,7 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
self.activeHolidays.append(id)
|
||||
self.startSpecialHoliday(id)
|
||||
self.sendUpdate('startHoliday', [id])
|
||||
|
||||
|
||||
def endHoliday(self, id):
|
||||
if id not in self.activeHolidays or id not in HolidayGlobals.Holidays:
|
||||
return
|
||||
|
@ -81,7 +81,7 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
self.activeHolidays.remove(id)
|
||||
self.endSpecialHoliday(id)
|
||||
self.sendUpdate('endHoliday', [id])
|
||||
|
||||
|
||||
def startSpecialHoliday(self, id):
|
||||
if id == ToontownGlobals.FISH_BINGO or id == ToontownGlobals.SILLY_SATURDAY:
|
||||
messenger.send('checkBingoState')
|
||||
|
@ -94,7 +94,7 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
messenger.send('checkBingoState')
|
||||
elif id in [ToontownGlobals.SUMMER_FIREWORKS, ToontownGlobals.NEW_YEAR_FIREWORKS]:
|
||||
self.deleteFireworkTask()
|
||||
|
||||
|
||||
def startFireworks(self, type, task=None):
|
||||
maxShow = len(FireworkShows.shows.get(type, [])) - 1
|
||||
|
||||
|
@ -106,4 +106,4 @@ class NewsManagerAI(DistributedObjectAI):
|
|||
fireworkShow.generateWithRequired(hood.zoneId)
|
||||
fireworkShow.b_startShow(type, random.randint(0, maxShow), globalClockDelta.getRealNetworkTime())
|
||||
|
||||
return Task.again
|
||||
return Task.again
|
||||
|
|
|
@ -544,7 +544,7 @@ def quests(command, arg0=0, arg1=0):
|
|||
if canCarry:
|
||||
if arg0 in Quests.QuestDict.keys():
|
||||
quest = Quests.QuestDict[arg0]
|
||||
|
||||
|
||||
simbase.air.questManager.avatarChoseQuest(invoker.doId, None, arg0, quest[5], quest[4])
|
||||
return 'Added QuestID %s'%(arg0)
|
||||
else:
|
||||
|
|
|
@ -7,4 +7,4 @@ def isValidCategoryName(value):
|
|||
return value in categories
|
||||
|
||||
def getCategory(value):
|
||||
return categories[value]
|
||||
return categories[value]
|
||||
|
|
|
@ -98,7 +98,7 @@ class BattleCalculatorAI:
|
|||
debug = self.notify.getDebug()
|
||||
attack = self.battle.toonAttacks[attackIndex]
|
||||
atkTrack, atkLevel = self.__getActualTrackLevel(attack)
|
||||
|
||||
|
||||
if atkTrack == NPCSOS:
|
||||
return (1, 95)
|
||||
if atkTrack == FIRE:
|
||||
|
@ -506,7 +506,7 @@ class BattleCalculatorAI:
|
|||
suit = self.battle.findSuit(targetId)
|
||||
if suit:
|
||||
slips = toon.getPinkSlips()
|
||||
|
||||
|
||||
if slips < 1:
|
||||
simbase.air.writeServerEvent('suspicious', toonId, 'Toon attempting to fire a cog without any pinkslips')
|
||||
else:
|
||||
|
|
|
@ -38,4 +38,4 @@ class BattleManagerAI:
|
|||
cellId = battle.battleCellId
|
||||
self.notify.debug('BattleManager - destroying battle %d' % cellId)
|
||||
del self.cellId2battle[cellId]
|
||||
battle.requestDelete()
|
||||
battle.requestDelete()
|
||||
|
|
|
@ -146,4 +146,4 @@ def __makeShiftLift():
|
|||
particles.emitter.setRadius(0.01)
|
||||
effect.setHpr(0, 180, 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.getNullSound()
|
||||
|
||||
globalBattleSoundCache = BattleSounds()
|
||||
globalBattleSoundCache = BattleSounds()
|
||||
|
|
|
@ -124,4 +124,4 @@ class DistributedBattleAI(DistributedBattleBaseAI.DistributedBattleBaseAI):
|
|||
DistributedBattleBaseAI.DistributedBattleBaseAI.enterResume(self)
|
||||
if self.finishCallback:
|
||||
self.finishCallback(self.zoneId)
|
||||
self.battleMgr.destroy(self)
|
||||
self.battleMgr.destroy(self)
|
||||
|
|
|
@ -320,7 +320,7 @@ class DistributedBattleBase(DistributedNode.DistributedNode, BattleBase):
|
|||
pass
|
||||
|
||||
def getInteractiveProp(self):
|
||||
if config.GetBool('want-anim-props', True):
|
||||
if config.GetBool('want-anim-props', True):
|
||||
if self.interactiveProp:
|
||||
return self.interactiveProp
|
||||
elif base.cr.playGame.hood and hasattr(base.cr.playGame.hood, 'loader'):
|
||||
|
|
|
@ -1843,4 +1843,4 @@ def skipMovie():
|
|||
return 'You are not currently in a battle!'
|
||||
battle = simbase.air.doId2do.get(battleId)
|
||||
battle._DistributedBattleBaseAI__movieDone()
|
||||
return 'Battle movie skipped.'
|
||||
return 'Battle movie skipped.'
|
||||
|
|
|
@ -311,9 +311,9 @@ class Movie(DirectObject.DirectObject):
|
|||
elif tutTrack >= len(earnedXp):
|
||||
self.playTutorialReward_2()
|
||||
return
|
||||
|
||||
|
||||
xp = earnedXp[tutTrack]
|
||||
|
||||
|
||||
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)
|
||||
sequence = Sequence()
|
||||
|
@ -321,7 +321,7 @@ class Movie(DirectObject.DirectObject):
|
|||
sequence.start()
|
||||
else:
|
||||
self.playTutorialReward_1(None, earnedXp, tutTrack + 1)
|
||||
|
||||
|
||||
def playTutorialReward_2(self, value=None):
|
||||
from toontown.toon import Toon
|
||||
from toontown.toon import ToonDNA
|
||||
|
|
|
@ -342,4 +342,4 @@ ActorInterval(kapow, 'kapow'), Func(kapow.hide)), LerpPosInterval(suit, 3.0, Poi
|
|||
return [toonTrack,
|
||||
soundTrack,
|
||||
buttonTrack,
|
||||
suitResponseTrack]
|
||||
suitResponseTrack]
|
||||
|
|
|
@ -745,4 +745,4 @@ squirtfn_array = (__doFlower,
|
|||
__doSeltzerBottle,
|
||||
__doFireHose,
|
||||
__doStormCloud,
|
||||
__doGeyser)
|
||||
__doGeyser)
|
||||
|
|
|
@ -718,7 +718,7 @@ def getToonTakeDamageTrack(toon, attack, died, dmg, delay, damageAnimNames = Non
|
|||
toonTrack.append(Func(toon.loop, 'neutral'))
|
||||
if died:
|
||||
pbpText = attack['playByPlayText']
|
||||
|
||||
|
||||
toonTrack.append(pbpText.getToonsDiedInterval([TTLocalizer.ToonDefeatedMessage % toon.getName()], 7.0))
|
||||
return Parallel(toonTrack, indicatorTrack)
|
||||
|
||||
|
|
|
@ -4902,5 +4902,3 @@ def bossCogFrontAttack(self):
|
|||
force0.setActive(1)
|
||||
f0.addForce(force0)
|
||||
self.addForceGroup(f0)
|
||||
|
||||
|
||||
|
|
|
@ -29,4 +29,4 @@ class PlayByPlayText(OnscreenText.OnscreenText):
|
|||
track += newList
|
||||
|
||||
track.append(Wait(duration * 0.1))
|
||||
return track
|
||||
return track
|
||||
|
|
|
@ -96,7 +96,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
|||
# to merge groups.
|
||||
# mergeDict - This is a link that points back to the original
|
||||
# invitee before we mapped it to the leader of the other group.
|
||||
|
||||
|
||||
def requestInvite(self, inviteeId):
|
||||
self.notify.debug('requestInvite %s' % inviteeId)
|
||||
inviterId = self.air.getAvatarIdFromSender()
|
||||
|
@ -167,7 +167,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
|||
reason = BoardingPartyBase.BOARDCODE_PROMOTION
|
||||
self.sendUpdateToAvatarId(inviterId, 'postInviteNotQualify', [inviterId, reason, self.elevatorIdList[0]])
|
||||
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:
|
||||
self.notify.debug('old group')
|
||||
# Everything is indexed by the leaders
|
||||
|
@ -184,7 +184,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
|||
if len(self.getGroupMemberList(leaderId)) >= self.maxSize:
|
||||
self.sendUpdate('postSizeReject', [leaderId, inviterId, inviteeId])
|
||||
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
|
||||
# dictionary.. This way, if something goes wrong,
|
||||
# the original groups with their original data
|
||||
|
@ -195,12 +195,12 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
|||
self.mergeDict[inviteeId] = originalInviteeId
|
||||
self.sendUpdateToAvatarId(inviteeId, 'postInvite', [leaderId, inviterId, True])
|
||||
# notify everybody in the inviters group of the
|
||||
# invitation..
|
||||
# invitation..
|
||||
for memberId in groupList[0]:
|
||||
if not memberId == inviterId:
|
||||
self.sendUpdateToAvatarId(memberId, 'postMessageInvited', [inviteeId, inviterId])
|
||||
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]:
|
||||
groupList[1].append(inviteeId)
|
||||
self.groupListDict[leaderId] = groupList
|
||||
|
@ -213,7 +213,7 @@ class DistributedBoardingPartyAI(DistributedObjectAI.DistributedObjectAI, Boardi
|
|||
for memberId in groupList[0]:
|
||||
if not memberId == 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]:
|
||||
self.sendUpdate('postKickReject', [leaderId, inviterId, inviteeId])
|
||||
else:
|
||||
|
|
|
@ -258,10 +258,10 @@ class DistributedBuilding(DistributedObject.DistributedObject):
|
|||
|
||||
def enterSuit(self, ts):
|
||||
prop = self.getInteractiveProp()
|
||||
|
||||
|
||||
if prop and not prop.state == 'Sad':
|
||||
prop.gotoSad(self.doId)
|
||||
|
||||
|
||||
self.setToSuit()
|
||||
|
||||
def exitSuit(self):
|
||||
|
|
|
@ -14,4 +14,4 @@ class DistributedBuildingQueryMgrAI(DistributedObjectAI.DistributedObjectAI):
|
|||
building = self.buildings.get(zoneId)
|
||||
if building is None:
|
||||
return
|
||||
self.sendUpdateToAvatarId(avId, 'response', [context, building.isSuitBlock()])
|
||||
self.sendUpdateToAvatarId(avId, 'response', [context, building.isSuitBlock()])
|
||||
|
|
|
@ -7,4 +7,3 @@ class DistributedCJElevatorAI(DistributedBossElevatorAI.DistributedBossElevatorA
|
|||
DistributedBossElevatorAI.DistributedBossElevatorAI.__init__(self, air, bldg, zone, antiShuffle=antiShuffle, minLaff=minLaff)
|
||||
self.type = ELEVATOR_CJ
|
||||
self.countdownTime = ElevatorData[self.type]['countdown']
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ from direct.directnotify import DirectNotifyGlobal
|
|||
from toontown.battle import BattleBase
|
||||
|
||||
class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
||||
|
||||
|
||||
def __init__(self, air, bldg, avIds):
|
||||
DistributedElevatorAI.DistributedElevatorAI.__init__(self, air, bldg)
|
||||
self.countdownTime = simbase.config.GetFloat('int-elevator-timeout', INTERIOR_ELEVATOR_COUNTDOWN_TIME)
|
||||
|
@ -35,7 +35,7 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
|||
numFullSeats = self.countFullSeats()
|
||||
if not numFullSeats <= len(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):
|
||||
self.fsm.request('allAboard')
|
||||
|
||||
|
@ -133,4 +133,4 @@ class DistributedElevatorIntAI(DistributedElevatorAI.DistributedElevatorAI):
|
|||
|
||||
def enterClosed(self):
|
||||
DistributedElevatorAI.DistributedElevatorAI.enterClosed(self)
|
||||
self.__doorsClosed()
|
||||
self.__doorsClosed()
|
||||
|
|
|
@ -35,7 +35,7 @@ class DistributedKnockKnockDoorAI(DistributedAnimatedPropAI.DistributedAnimatedP
|
|||
DistributedAnimatedPropAI.DistributedAnimatedPropAI.exitPlaying(self)
|
||||
taskMgr.remove(self.doLaterTask)
|
||||
self.doLaterTask = None
|
||||
|
||||
|
||||
def requestToonup(self):
|
||||
av = self.air.doId2do.get(self.air.getAvatarIdFromSender())
|
||||
|
||||
|
@ -43,4 +43,4 @@ class DistributedKnockKnockDoorAI(DistributedAnimatedPropAI.DistributedAnimatedP
|
|||
return
|
||||
|
||||
av.toonUp(ToontownGlobals.KnockKnockHeal)
|
||||
av.b_setNextKnockHeal(int(time.time() + ToontownGlobals.KnockKnockCooldown))
|
||||
av.b_setNextKnockHeal(int(time.time() + ToontownGlobals.KnockKnockCooldown))
|
||||
|
|
|
@ -11,4 +11,4 @@ class DistributedPetshopInteriorAI(DistributedObjectAI.DistributedObjectAI):
|
|||
DistributedObjectAI.DistributedObjectAI.generate(self)
|
||||
|
||||
def getZoneIdAndBlock(self):
|
||||
return [self.zoneId, self.block]
|
||||
return [self.zoneId, self.block]
|
||||
|
|
|
@ -40,7 +40,7 @@ class DistributedToonHallInterior(DistributedToonInterior):
|
|||
self.interior.flattenMedium()
|
||||
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase.DistributedNPCToonBase):
|
||||
npcToon.initToonState()
|
||||
|
||||
|
||||
self.createSillyMeter()
|
||||
|
||||
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.setLoop(False)
|
||||
self.audio3d.setDropOffFactor(0.1)
|
||||
|
||||
|
||||
self.startSillyMeter(config.GetInt('silly-meter-phase', 12))
|
||||
|
||||
|
||||
def startSillyMeter(self, phase):
|
||||
self.stopSillyMeter()
|
||||
|
||||
|
||||
if hasattr(self, 'enterPhase%s' % phase):
|
||||
getattr(self, 'enterPhase%s' % phase)()
|
||||
self.phase = phase
|
||||
|
||||
|
||||
def stopSillyMeter(self):
|
||||
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):
|
||||
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.
|
||||
"""
|
||||
|
||||
|
||||
if phase < -1 or phase > 14:
|
||||
return 'Phase number must be between 0 and 14!'
|
||||
|
||||
|
||||
messenger.send('SillyMeterPhase', [phase])
|
||||
return 'Successfully set the silly meter phase!'
|
||||
return 'Successfully set the silly meter phase!'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from DistributedToonInteriorAI import *
|
||||
|
||||
class DistributedToonHallInteriorAI(DistributedToonInteriorAI):
|
||||
pass
|
||||
pass
|
||||
|
|
|
@ -7,4 +7,4 @@ INT_HOUSE = 6
|
|||
EXT_COGHQ = 7
|
||||
INT_COGHQ = 8
|
||||
EXT_KS = 9
|
||||
INT_KS = 10
|
||||
INT_KS = 10
|
||||
|
|
|
@ -35,7 +35,7 @@ class PetshopBuildingAI:
|
|||
self.interior.generateWithRequired(self.interiorZone)
|
||||
|
||||
self.npcs = NPCToons.createNpcsInZone(self.air, self.interiorZone)
|
||||
|
||||
|
||||
door = DistributedDoorAI.DistributedDoorAI(
|
||||
self.air, blockNumber, DoorTypes.EXT_STANDARD)
|
||||
insideDoor = DistributedDoorAI.DistributedDoorAI(
|
||||
|
@ -50,4 +50,4 @@ class PetshopBuildingAI:
|
|||
self.insideDoor = insideDoor
|
||||
|
||||
def createPet(self, ownerId, seed):
|
||||
return
|
||||
return
|
||||
|
|
|
@ -201,7 +201,7 @@ buildingMinMax = {
|
|||
ToontownGlobals.PajamaPlace: [config.GetInt('pajama-place-building-min', 6),
|
||||
config.GetInt('pajama-place-building-max', 12)],
|
||||
ToontownGlobals.BedtimeBoulevard: [config.GetInt('bedtime-boulevard-building-min', 6),
|
||||
config.GetInt('bedtime-boulevard-building-max', 12)],
|
||||
config.GetInt('bedtime-boulevard-building-max', 12)],
|
||||
ToontownGlobals.SellbotHQ: [0, 0],
|
||||
ToontownGlobals.SellbotFactoryExt: [0, 0],
|
||||
ToontownGlobals.CashbotHQ: [0, 0],
|
||||
|
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
|||
class AccountDate(DistributedObject):
|
||||
neverDisable = 1
|
||||
notify = directNotify.newCategory('AccountDate')
|
||||
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObject.__init__(self, cr)
|
||||
self.accountDays = 0
|
||||
|
@ -20,20 +20,20 @@ class AccountDate(DistributedObject):
|
|||
if base.cr.accountDateMgr is self:
|
||||
del base.cr.accountDateMgr
|
||||
DistributedObject.delete(self)
|
||||
|
||||
|
||||
def getAccountDays(self):
|
||||
return self.accountDays
|
||||
|
||||
|
||||
def requestDate(self, task=None):
|
||||
self.sendUpdate('requestDate')
|
||||
|
||||
|
||||
if task is not None:
|
||||
return task.done
|
||||
|
||||
|
||||
def requestDateResult(self, result):
|
||||
if result is None:
|
||||
notify.warning('Invalid response from server.')
|
||||
self.accountDays = 0
|
||||
else:
|
||||
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):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
|
||||
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObjectAI.announceGenerate(self)
|
||||
|
||||
|
||||
def requestDate(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
av = self.air.doId2do.get(avId)
|
||||
|
||||
if not av:
|
||||
return
|
||||
|
||||
|
||||
def callback(dclass, fields):
|
||||
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
|
||||
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
|
||||
else:
|
||||
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)
|
||||
list.append(base)
|
||||
|
||||
return list
|
||||
return list
|
||||
|
|
|
@ -739,4 +739,4 @@ AccessoryTypes = {101: (AHat,
|
|||
449: (AShoes,
|
||||
'shw2',
|
||||
APriceCool,
|
||||
7)}
|
||||
7)}
|
||||
|
|
|
@ -580,4 +580,4 @@ def getAllClothes(*clothingTypes):
|
|||
for n in range(1, len(base.getColorChoices())):
|
||||
list.append(CatalogClothingItem(clothingType, n))
|
||||
|
||||
return list
|
||||
return list
|
||||
|
|
|
@ -124,4 +124,4 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
|
|||
dg.addBool(self.isSpecial)
|
||||
|
||||
def isGift(self):
|
||||
return not self.getEmblemPrices()
|
||||
return not self.getEmblemPrices()
|
||||
|
|
|
@ -1086,7 +1086,7 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
|
|||
movie.synchronizeTo(self.sound)
|
||||
screen = NodePath(CardMaker('tv-screen').generate())
|
||||
screen.reparentTo(model)
|
||||
|
||||
|
||||
screen.setScale(2.5, 1.7, 1.4)
|
||||
screen.setPos(-1.15, -0.5, 1.1)
|
||||
screen.setTexture(movie)
|
||||
|
@ -1146,12 +1146,12 @@ def nextAvailableCloset(avatar, duplicateItems):
|
|||
def nextAvailableBank(avatar, duplicateItems):
|
||||
if not avatar.getMaxBankMoney() in MoneyToBank:
|
||||
return CatalogFurnitureItem(1300)
|
||||
|
||||
|
||||
currentBank = MoneyToBank[avatar.getMaxBankMoney()]
|
||||
|
||||
|
||||
if currentBank == MaxBankId:
|
||||
return
|
||||
|
||||
|
||||
return CatalogFurnitureItem(currentBank + 10)
|
||||
|
||||
def get50ItemCloset(avatar, duplicateItems):
|
||||
|
@ -1183,10 +1183,10 @@ def getAllClosets():
|
|||
|
||||
def getAllBanks():
|
||||
list = []
|
||||
|
||||
|
||||
for bankId in BankToMoney.keys():
|
||||
list.append(CatalogFurnitureItem(bankId))
|
||||
|
||||
|
||||
return list
|
||||
|
||||
def get50ItemTrunk(avatar, duplicateItems):
|
||||
|
|
|
@ -1479,7 +1479,7 @@ class CatalogGenerator:
|
|||
|
||||
def __init__(self):
|
||||
self.__itemLists = {}
|
||||
|
||||
|
||||
if config.GetBool('save-catalog-schedule', False):
|
||||
self.outputSchedule('catalog-schedule.txt')
|
||||
|
||||
|
@ -1511,13 +1511,13 @@ class CatalogGenerator:
|
|||
|
||||
if nextAvailableCloset not in schedule:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
|
||||
|
||||
|
||||
if nextAvailableBank not in schedule:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0)
|
||||
|
||||
|
||||
if nextAvailableTank not in schedule:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0)
|
||||
|
||||
|
||||
weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0)
|
||||
if True:
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
|||
def makeNewItem(self, houseId):
|
||||
self.houseId = houseId
|
||||
CatalogItem.CatalogItem.makeNewItem(self)
|
||||
|
||||
|
||||
def notOfferedTo(self, avatar):
|
||||
return 1
|
||||
|
||||
|
||||
def requestPurchase(self, phone, callback):
|
||||
from toontown.toontowngui import TTDialog
|
||||
avatar = base.localAvatar
|
||||
|
@ -43,16 +43,16 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
|||
|
||||
def getDeliveryTime(self):
|
||||
return 0
|
||||
|
||||
|
||||
def getEmblemPrices(self):
|
||||
return HouseGlobals.HouseEmblemPrices[self.houseId]
|
||||
|
||||
|
||||
def getPicture(self, avatar):
|
||||
model = loader.loadModel(HouseGlobals.houseModels[self.houseId])
|
||||
model.setBin('unsorted', 0, 1)
|
||||
self.hasPicture = True
|
||||
return self.makeFrameModel(model)
|
||||
|
||||
|
||||
def decodeDatagram(self, di, versionNumber, store):
|
||||
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
||||
self.houseId = di.getUint8()
|
||||
|
@ -60,13 +60,12 @@ class CatalogHouseItem(CatalogItem.CatalogItem):
|
|||
def encodeDatagram(self, dg, store):
|
||||
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
||||
dg.addUint8(self.houseId)
|
||||
|
||||
|
||||
def recordPurchase(self, av, optional):
|
||||
house = simbase.air.doId2do.get(av.getHouseId())
|
||||
if house:
|
||||
house.b_setHouseType(self.houseId)
|
||||
return ToontownGlobals.P_ItemAvailable
|
||||
|
||||
|
||||
def getAllHouses():
|
||||
return [CatalogHouseItem(i) for i in xrange(6)]
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import time
|
|||
|
||||
class CatalogManagerAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("CatalogManagerAI")
|
||||
|
||||
|
||||
def __init__(self, air):
|
||||
DistributedObjectAI.__init__(self, air)
|
||||
self.catalogGenerator = CatalogGenerator()
|
||||
|
@ -15,8 +15,8 @@ class CatalogManagerAI(DistributedObjectAI):
|
|||
avId = self.air.getAvatarIdFromSender()
|
||||
av = self.air.doId2do.get(avId)
|
||||
if av:
|
||||
self.deliverCatalogFor(av)
|
||||
|
||||
self.deliverCatalogFor(av)
|
||||
|
||||
def deliverCatalogFor(self, av):
|
||||
monthlyCatalog = self.catalogGenerator.generateMonthlyCatalog(av, time.time() / 60)
|
||||
newWeek = (av.catalogScheduleCurrentWeek + 1) % ToontownGlobals.CatalogNumWeeks
|
||||
|
@ -25,4 +25,3 @@ class CatalogManagerAI(DistributedObjectAI):
|
|||
av.b_setCatalog(monthlyCatalog, weeklyCatalog, backCatalog)
|
||||
av.b_setCatalogSchedule(newWeek, int((time.time() + 604800)/60))
|
||||
av.b_setCatalogNotify(ToontownGlobals.NewItems, av.mailboxNotify)
|
||||
|
||||
|
|
|
@ -614,7 +614,7 @@ class CatalogScreen(DirectFrame):
|
|||
if item in allBankItems and item.furnitureType == CatalogFurnitureItem.MaxBankId:
|
||||
isMaxBankOffered = True
|
||||
break
|
||||
|
||||
|
||||
for item in itemList:
|
||||
if isinstance(item, CatalogInvalidItem.CatalogInvalidItem):
|
||||
self.notify.warning('skipping catalog invalid item %s' % item)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue