コード例 #1
0
 def enterChatty(self):
     chatter = CCharChatter.getChatter(self.getName(), self.getCCChatter())
     if not chatter:
         self.chatterExists = False
         self.fsm.request('Lonely')
     else:
         self.chatterExists = True
         self.chatty.enter()
         self.acceptOnce(self.chattyDoneEvent, self.__decideNextState)
コード例 #2
0
 def enter(self):
     if hasattr(self.character, 'name'):
         name = self.character.getName()
     else:
         name = 'character'
     self.notify.debug('Chatty ' + self.character.getName() + '...')
     self.chatter = CCharChatter.getChatter(self.character.getName(),
                                            self.character.getCCChatter())
     if self.chatter != None:
         taskMgr.remove(self.__chatTaskName)
         taskMgr.add(self.blather, self.__chatTaskName)
     StateData.StateData.enter(self)
 def setChat(self, category, msg, avId):
     if avId in self.cr.doId2do:
         avatar = self.cr.doId2do[avId]
         chatter = CCharChatter.getChatter(self.getName(),
                                           self.getCCChatter())
         if category >= len(chatter):
             self.notify.debug("Chatter's changed")
             return
         elif len(chatter[category]) <= msg:
             self.notify.debug("Chatter's changed")
             return
         str = chatter[category][msg]
         if '%' in str:
             str = copy.deepcopy(str)
             avName = avatar.getName()
             str = str.replace('%', avName)
         track = Sequence()
         if category != CCharChatter.GOODBYE:
             curHpr = self.getHpr()
             self.headsUp(avatar)
             destHpr = self.getHpr()
             self.setHpr(curHpr)
             track.append(self.makeTurnToHeadingTrack(destHpr[0]))
         if self.getName() == Donald or self.getName(
         ) == WesternPluto or self.getName() == Pluto:
             chatFlags = CFThought | CFTimeout
             if hasattr(base.cr, 'newsManager') and base.cr.newsManager:
                 holidayIds = base.cr.newsManager.getHolidayIdList()
                 if ToontownGlobals.APRIL_FOOLS_COSTUMES in holidayIds:
                     if self.getName() == Pluto:
                         chatFlags = CFTimeout | CFSpeech
         elif self.getName() == DonaldDock:
             chatFlags = CFTimeout | CFSpeech
             self.nametag3d.hide()
         else:
             chatFlags = CFTimeout | CFSpeech
         self.chatterDialogue = self.getChatterDialogue(category, msg)
         track.append(
             Func(self.setChatAbsolute, str, chatFlags,
                  self.chatterDialogue))
         self.chatTrack.finish()
         self.chatTrack = track
         self.chatTrack.start()
コード例 #4
0
 def setCorrectChatter(self):
     self.chatter = CCharChatter.getChatter(self.character.getName(),
                                            self.character.getCCChatter())
コード例 #5
0
 def getLatestChatter(self):
     self.chatter = CCharChatter.getChatter(self.character.getName(),
                                            self.character.getCCChatter())