def showChanceRewards(self): tasks = [] for reward in self.rewardList: self.notify.debug('showChanceRewards: reward = ' + str(reward)) index = self.rewardList.index(reward) if reward != -1: self.notify.debug('adding tasks!') hcc = Task(self.hideChanceMarker) hcc.chanceMarkers = self.chanceMarkers hcc.index = index sct = Task(self.showChanceCard) sct.chanceCard = self.chanceCard sct.cardSound = self.cardSound stt = Task(self.showChanceCardText) rewardEntry = RaceGameGlobals.ChanceRewards[reward] stt.rewardIdx = reward if rewardEntry[0][0] < 0 or rewardEntry[0][1] > 0: stt.sound = self.negBuzzer else: stt.sound = self.posBuzzer stt.picker = self.avIdList[index] rct = Task(self.resetChanceCard) task = Task.sequence(hcc, sct, Task.pause(1.0), stt, Task.pause(3.0), rct, Task.pause(0.25)) tasks.append(task) return tasks
def showChanceRewards(self): # modify avatar positions for each chance card tasks = [] for reward in self.rewardList: self.notify.debug("showChanceRewards: reward = " + str(reward)) index = self.rewardList.index(reward) # if an actual reward is present in the list if (reward != -1): self.notify.debug("adding tasks!") # hide the chance marker hcc = Task(self.hideChanceMarker) hcc.chanceMarkers = self.chanceMarkers hcc.index = index # create the tasks to display the card sct = Task(self.showChanceCard) sct.chanceCard = self.chanceCard sct.cardSound = self.cardSound stt = Task(self.showChanceCardText) rewardEntry = RaceGameGlobals.ChanceRewards[reward] stt.rewardIdx = reward # decide if its a good or bad reward based on movement # might be better to flag each one individually in the defns if ((rewardEntry[0][0] < 0) or (rewardEntry[0][1] > 0)): stt.sound = self.negBuzzer else: stt.sound = self.posBuzzer stt.picker = self.avIdList[index] rct = Task(self.resetChanceCard) task = Task.sequence( hcc, sct, Task.pause(1.0), stt, Task.pause(3.0), rct, Task.pause(0.25), ) tasks.append(task) return tasks