Poodletooth-iLand/toontown/minigame/PhotoGameBase.py

36 lines
1.2 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
import PhotoGameGlobals
import random
class PhotoGameBase:
def __init__(self):
pass
def load(self):
self.data = PhotoGameGlobals.AREA_DATA[self.getSafezoneId()]
def generateAssignmentTemplates(self, numAssignments):
self.data = PhotoGameGlobals.AREA_DATA[self.getSafezoneId()]
random.seed(self.doId)
assignmentTemplates = []
numPathes = len(self.data['PATHS'])
if numPathes == 0:
return assignmentTemplates
while len(assignmentTemplates) < numAssignments:
subjectIndex = random.choice(range(numPathes))
pose = (None, None)
while pose[0] == None:
animSetIndex = self.data['PATHANIMREL'][subjectIndex]
pose = random.choice(self.data['ANIMATIONS'][animSetIndex] + self.data['MOVEMODES'][animSetIndex])
newTemplate = (subjectIndex, pose[0])
if newTemplate not in assignmentTemplates:
assignmentTemplates.append((subjectIndex, pose[0]))
self.notify.debug('assignment templates')
self.notify.debug(str(assignmentTemplates))
for template in assignmentTemplates:
self.notify.debug(str(template))
return assignmentTemplates