mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-10-31 00:37:54 +00:00
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
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
|