oldschool-toontown/toontown/minigame/PhotoGameBase.py

36 lines
1.2 KiB
Python
Raw Permalink Normal View History

from . import PhotoGameGlobals
2019-11-02 17:27:54 -05:00
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(list(range(numPathes)))
2019-11-02 17:27:54 -05:00
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