def __epilogueChatNext(self, pageNumber, elapsed): if pageNumber == 1: toon = self.resistanceToon playRate = 0.75 track = Sequence(ActorInterval(toon, 'victory', playRate=playRate, startFrame=0, endFrame=9), ActorInterval(toon, 'victory', playRate=playRate, startFrame=9, endFrame=0), Func(self.resistanceToon.loop, 'neutral')) intervalName = 'EpilogueMovieToonAnim' self.storeInterval(track, intervalName) track.start() elif pageNumber == 3: self.d_applyReward() ResistanceChat.doEffect(self.rewardId, self.resistanceToon, self.involvedToons)
def __init__(self, air): DistributedBossCogAI.DistributedBossCogAI.__init__(self, air, 'm') FSM.FSM.__init__(self, 'DistributedCashbotBossAI') self.cranes = None self.safes = None self.goons = None self.treasures = {} self.grabbingTreasures = {} self.recycledTreasures = [] self.healAmount = 0 self.rewardId = ResistanceChat.getRandomId() self.rewardedToons = [] self.scene = NodePath('scene') self.reparentTo(self.scene) cn = CollisionNode('walls') cs = CollisionSphere(0, 0, 0, 13) cn.addSolid(cs) cs = CollisionInvSphere(0, 0, 0, 42) cn.addSolid(cs) self.attachNewNode(cn) self.heldObject = None self.waitingForHelmet = 0 self.avatarHelmets = {} self.bossMaxDamage = ToontownGlobals.CashbotBossMaxDamage return
def enterEpilogue(self): self.cleanupIntervals() self.clearChat() self.resistanceToon.clearChat() self.stash() self.stopAnimate() self.controlToons() self.__showResistanceToon(False) self.resistanceToon.setPosHpr(*ToontownGlobals.CashbotBossBattleThreePosHpr) self.resistanceToon.loop('neutral') self.__arrangeToonsAroundResistanceToon() base.camera.reparentTo(render) base.camera.setPos(self.resistanceToon, -9, 12, 6) base.camera.lookAt(self.resistanceToon, 0, 0, 3) intervalName = 'EpilogueMovie' text = ResistanceChat.getChatText(self.rewardId) menuIndex, itemIndex = ResistanceChat.decodeId(self.rewardId) value = ResistanceChat.getItemValue(self.rewardId) if menuIndex == ResistanceChat.RESISTANCE_TOONUP: if value == -1: instructions = TTLocalizer.ResistanceToonToonupAllInstructions else: instructions = TTLocalizer.ResistanceToonToonupInstructions % value elif menuIndex == ResistanceChat.RESISTANCE_MONEY: if value == -1: instructions = TTLocalizer.ResistanceToonMoneyAllInstructions else: instructions = TTLocalizer.ResistanceToonMoneyInstructions % value elif menuIndex == ResistanceChat.RESISTANCE_RESTOCK: if value == -1: instructions = TTLocalizer.ResistanceToonRestockAllInstructions else: trackName = TTLocalizer.BattleGlobalTracks[value] instructions = TTLocalizer.ResistanceToonRestockInstructions % trackName elif menuIndex == ResistanceChat.RESISTANCE_MERITS: if value == -1: instructions = TTLocalizer.ResistanceToonMeritsAllInstructions else: instructions = TTLocalizer.ResistanceToonMeritsInstructions % TTLocalizer.RewardPanelMeritBarLabels[value] elif menuIndex == ResistanceChat.RESISTANCE_TICKETS: instructions = TTLocalizer.ResistanceToonTicketsInstructions % value speech = TTLocalizer.ResistanceToonCongratulations % (text, instructions) speech = self.__talkAboutPromotion(speech) self.resistanceToon.setLocalPageChat(speech, 0) self.accept('nextChatPage', self.__epilogueChatNext) self.accept('doneChatPage', self.__epilogueChatDone) base.playMusic(self.epilogueMusic, looping=1, volume=0.9)
def __resistanceMessagesChanged(self): self.clearMenu() try: lt = base.localAvatar except: return phrases = lt.resistanceMessages for menuIndex in ResistanceChat.resistanceMenu: menu = SCMenu() for itemIndex in ResistanceChat.getItems(menuIndex): textId = ResistanceChat.encodeId(menuIndex, itemIndex) charges = lt.getResistanceMessageCharges(textId) if charges > 0: menu.append(TTSCResistanceTerminal(textId, charges)) textId = ResistanceChat.encodeId(menuIndex, 0) menuName = ResistanceChat.getMenuName(textId) self.append(SCMenuHolder(menuName, menu))
def decodeTTSCResistanceMsg(textId): return ResistanceChat.getChatText(textId)
def __init__(self, textId, charges): SCTerminal.__init__(self) self.setCharges(charges) self.textId = textId self.text = ResistanceChat.getItemText(self.textId)