本文整理汇总了Python中toontown.chat.ResistanceChat类的典型用法代码示例。如果您正苦于以下问题:Python ResistanceChat类的具体用法?Python ResistanceChat怎么用?Python ResistanceChat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ResistanceChat类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __epilogueChatNext
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)
示例2: giveReward
def giveReward(self):
for avId in self.participants:
av = self.air.doId2do.get(avId)
if av is None:
continue
for _ in xrange(self.uniteCount):
if self.uniteType == 'any':
menuIndex = random.choice(ALLOWED_UNITES)
else:
menuIndex = self.uniteType
itemIndex = random.choice(ResistanceChat.getItems(menuIndex))
textId = ResistanceChat.encodeId(menuIndex, itemIndex)
av.addResistanceMessage(textId)
示例3: __init__
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
示例4: enterEpilogue
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)
示例5: __resistanceMessagesChanged
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))
示例6: __init__
def __init__(self, air):
DistributedCashbotBossAI.__init__(self, air)
self.rewardId = ResistanceChat.getRandomBrutalId()
self.bossMaxDamage = ToontownGlobals.BrutalCashbotBossMaxDamage
示例7: decodeTTSCResistanceMsg
def decodeTTSCResistanceMsg(textId):
return ResistanceChat.getChatText(textId)
示例8: __init__
def __init__(self, textId, charges):
SCTerminal.__init__(self)
self.setCharges(charges)
self.textId = textId
self.text = ResistanceChat.getItemText(self.textId)