def updateEmoteList(self):
        idList = EmoteGlobals.emotes.keys()
        idList.sort()
        for emoteId in idList:
            if EmoteGlobals.getEmotePrereqs(emoteId):
                for prereq in EmoteGlobals.getEmotePrereqs(emoteId):
                    if not prereq.avIsReady(localAvatar):
                        emoteId in self.structure and self.removeEmote(emoteId)
                    elif prereq.avIsReady(localAvatar):
                        emoteId not in self.structure and self.addEmote(
                            emoteId)

        self.createSpeedChatObject(self.structure)
 def updateEmoteList(self):
     idList = EmoteGlobals.emotes.keys()
     idList.sort()
     for emoteId in idList:
         if EmoteGlobals.getEmotePrereqs(emoteId):
             for prereq in EmoteGlobals.getEmotePrereqs(emoteId):
                 if not prereq.avIsReady(localAvatar) and emoteId in self.structure:
                     self.removeEmote(emoteId)
                     continue
                 if prereq.avIsReady(localAvatar) and emoteId not in self.structure:
                     self.addEmote(emoteId)
                     continue
             
     
     self.createSpeedChatObject(self.structure)
    def setEmote(self, emoteId):
        if emoteId not in EmoteGlobals.emotes:

            # Log potential hacking
            self.air.logPotentialHacker(
                message='Avatar attempted to use invalid emote',
                accountId=self.air.getAccountIdFromSender(),
                emoteId=emoteId)

            return

        prereqs = EmoteGlobals.getEmotePrereqs(emoteId)
        if prereqs:

            fault = False
            for prereq in prereqs:
                if not prereq.avIsReadyAI(self):
                    fault = True
                    break

            if fault:

                # Log potential hacking
                self.air.logPotentialHacker(
                    message=
                    'Avatar attempted to use emote that does not meet requirements',
                    accountId=self.air.getAccountIdFromSender(),
                    emoteId=emoteId)

                return

        self.sendUpdate('playEmote', [emoteId])
Example #4
0
 def removeEmote(self, emoteId):
     emote = EmoteGlobals.emotes.get(emoteId)
     emote_group = EmoteGlobals.getEmoteGroup(emoteId)
     if emote is None:
         return
     if emoteId in self.structure:
         self.structure.remove(emoteId)
     self.createSpeedChatObject(self.structure)
     return
Example #5
0
 def addEmote(self, emoteId):
     emote = EmoteGlobals.emotes.get(emoteId)
     emote_group = EmoteGlobals.getEmoteGroup(emoteId)
     if emote is None:
         return
     if emoteId not in self.structure:
         self.structure.append(emoteId)
     self.createSpeedChatObject(self.structure)
     return
    def removeEmote(self, emoteId):
        emote = EmoteGlobals.emotes.get(emoteId)
        emote_group = EmoteGlobals.getEmoteGroup(emoteId)
        if emote is None:
            return None

        if emoteId in self.structure:
            self.structure.remove(emoteId)

        self.createSpeedChatObject(self.structure)
    def addEmote(self, emoteId):
        emote = EmoteGlobals.emotes.get(emoteId)
        emote_group = EmoteGlobals.getEmoteGroup(emoteId)
        if emote is None:
            return None

        if emoteId not in self.structure:
            self.structure.append(emoteId)

        self.createSpeedChatObject(self.structure)
    def handleEmoteMsg(self, emoteId):
        sendText = True
        for prereq in EmoteGlobals.getEmotePrereqs(emoteId):
            if not prereq.avIsReady(localAvatar):
                return

        if emoteId in OTPLocalizer.Emotes:
            sendText = localAvatar.requestEmote(emoteId)
        if sendText:
            if emoteId == EmoteGlobals.EMOTE_VALENTINES:
                emoteId = random.choice([
                    EmoteGlobals.EMOTE_VALENTINES_A,
                    EmoteGlobals.EMOTE_VALENTINES_B,
                    EmoteGlobals.EMOTE_VALENTINES_D,
                    EmoteGlobals.EMOTE_VALENTINES_E
                ])
                self.sendChatByMode(SPEEDCHAT_NORMAL, emoteId)
            else:
                self.sendChatByMode(SPEEDCHAT_EMOTE, emoteId)
        self.hide()
 def handleEmoteMsg(self, emoteId):
     sendText = True
     for prereq in EmoteGlobals.getEmotePrereqs(emoteId):
         if not prereq.avIsReady(localAvatar):
             return None
             continue
     
     if emoteId in OTPLocalizer.Emotes:
         sendText = localAvatar.requestEmote(emoteId)
     
     if sendText:
         if emoteId == EmoteGlobals.EMOTE_VALENTINES:
             emoteId = random.choice([
                 EmoteGlobals.EMOTE_VALENTINES_A,
                 EmoteGlobals.EMOTE_VALENTINES_B,
                 EmoteGlobals.EMOTE_VALENTINES_D,
                 EmoteGlobals.EMOTE_VALENTINES_E])
             self.sendChatByMode(1, emoteId)
         else:
             self.sendChatByMode(2, emoteId)
     
     self.hide()
Example #10
0
     'interactInto': ['into_speak_idle'],
     'interact': ['speak_idle'],
     'interactOutof': ['outof_speak_idle'],
     'props': ['models/handheld/cutlass_steel_high']
 },
 'ned_is_crazy': {
     'idles': ['crazy_ned_day_idle'],
     'interact': ['crazy_ned_day_idle'],
     'noticeIdle': ['crazy_ned_day_idle'],
     'walk': ['crazy_ned_day_walk', 1.3],
     'run': ['crazy_ned_day_walk', 1.8],
     'notice1': ['crazy_ned_day_interact'],
     'crazy_ned_night_idle': ['crazy_ned_night_idle'],
     'crazy_ned_night_jump_in_box': ['crazy_ned_night_jump_in_box'],
     'crazy_ned_night_jump_out_box': ['crazy_ned_night_jump_out_box'],
     'extraAnims': EmoteGlobals.getAllEmoteAnimations()
 },
 'zz_bayonet_run': {
     'idles': ['bayonet_run'],
     'props': ['models/handheld/musket_bayonet']
 },
 'zz_boxing': {
     'idles': ['boxing_idle']
 },
 'zz_cutlass_taunt': {
     'idles': ['cutlass_taunt'],
     'props': ['models/handheld/cutlass_steel_high']
 },
 'zz_js_idle': {
     'idles': ['js_idle']
 },
Example #11
0
         'crazy_ned_day_idle'],
     'walk': [
         'crazy_ned_day_walk',
         1.3],
     'run': [
         'crazy_ned_day_walk',
         1.8],
     'notice1': [
         'crazy_ned_day_interact'],
     'crazy_ned_night_idle': [
         'crazy_ned_night_idle'],
     'crazy_ned_night_jump_in_box': [
         'crazy_ned_night_jump_in_box'],
     'crazy_ned_night_jump_out_box': [
         'crazy_ned_night_jump_out_box'],
     'extraAnims': EmoteGlobals.getAllEmoteAnimations() },
 'zz_bayonet_run': {
     'idles': [
         'bayonet_run'],
     'props': [
         'models/handheld/musket_bayonet'] },
 'zz_boxing': {
     'idles': [
         'boxing_idle'] },
 'zz_cutlass_taunt': {
     'idles': [
         'cutlass_taunt'],
     'props': [
         'models/handheld/cutlass_steel_high'] },
 'zz_js_idle': {
     'idles': [
     "interactInto": ["into_speak_idle"],
     "interact": ["speak_idle"],
     "interactOutof": ["outof_speak_idle"],
     "props": ["models/handheld/cutlass_steel_high"],
 },
 "ned_is_crazy": {
     "idles": ["crazy_ned_day_idle"],
     "interact": ["crazy_ned_day_idle"],
     "noticeIdle": ["crazy_ned_day_idle"],
     "walk": ["crazy_ned_day_walk", 1.3],
     "run": ["crazy_ned_day_walk", 1.8],
     "notice1": ["crazy_ned_day_interact"],
     "crazy_ned_night_idle": ["crazy_ned_night_idle"],
     "crazy_ned_night_jump_in_box": ["crazy_ned_night_jump_in_box"],
     "crazy_ned_night_jump_out_box": ["crazy_ned_night_jump_out_box"],
     "extraAnims": EmoteGlobals.getAllEmoteAnimations(),
 },
 "zz_bayonet_run": {"idles": ["bayonet_run"], "props": ["models/handheld/musket_bayonet"]},
 "zz_boxing": {"idles": ["boxing_idle"]},
 "zz_cutlass_taunt": {"idles": ["cutlass_taunt"], "props": ["models/handheld/cutlass_steel_high"]},
 "zz_js_idle": {"idles": ["js_idle"]},
 "zz_js_idleToBow": {"idles": ["js_idleToBow"]},
 "zz_js_js_handsOnHips": {"idles": ["js_handsOnHips"]},
 "zz_dagger_combo": {"idles": ["dagger_combo"], "props": ["models/handheld/cutlass_steel_high"]},
 "zz_dagger_idle": {"idles": ["sword_idle"], "props": ["models/handheld/dagger_high"]},
 "zz_gun_aim_idle": {"idles": ["gun_aim_idle"], "props": ["models/handheld/triple_barrel_pistol_high"]},
 "zz_gun_pointedup_idle": {"idles": ["gun_pointedup_idle"], "props": ["models/handheld/triple_barrel_pistol_high"]},
 "zz_jack_idle": {"idles": ["jack_sword_idle"], "props": ["models/handheld/cutlass_steel_high"]},
 "zz_sword_idle": {"idles": ["sword_idle"], "props": ["models/handheld/cutlass_steel_high"]},
 "zz_sword_run": {"idles": ["run_with_weapon"], "props": ["models/handheld/cutlass_steel_high"]},
 "zz_voodoo_doll_poke": {"idles": ["voodoo_doll_poke"], "props": ["models/handheld/voodoo_doll_high"]},
    def __init__(self):
        self.whisperId = None
        self.toPlayer = 0
        structure = []
        structure.append([SCEmoteMenu, OTPLocalizer.SCMenuEmotions])
        self.emoteMenuIdx = len(structure) - 1
        structure.append([SCCustomMenu, OTPLocalizer.SCMenuCustom])
        structure += scStructure
        if base.config.GetInt('want-emotes', 1):
            emote_structure = None
            emote_dance_structure = None
            emote_general_structure = None
            emote_music_structure = None
            emote_expressions_structure = None
            avatar_gender = base.emoteGender
            idList = EmoteGlobals.emotes.keys()
            idList.sort()
            for id in idList:
                emote = EmoteGlobals.emotes.get(id)
                emote_group = EmoteGlobals.getEmoteGroup(id)
                emote_gender = EmoteGlobals.getEmoteGender(id)
                if id in [
                        EmoteGlobals.EMOTE_VALENTINES,
                        EmoteGlobals.EMOTE_NOISEMAKER,
                        EmoteGlobals.EMOTE_HALLOWEEN,
                        EmoteGlobals.EMOTE_COIN_TAILS
                ]:
                    continue

                if not emote_structure:
                    emote_structure = [OTPLocalizer.Emotes_Root]

                if not emote_dance_structure:
                    emote_dance_structure = [OTPLocalizer.Emotes_Dances]
                    structure.append(emote_dance_structure)

                if not emote_general_structure:
                    emote_general_structure = [OTPLocalizer.Emotes_General]
                    structure.append(emote_general_structure)

                if not emote_music_structure:
                    emote_music_structure = [OTPLocalizer.Emotes_Music]
                    structure.append(emote_music_structure)

                if not emote_expressions_structure:
                    emote_expressions_structure = [
                        OTPLocalizer.Emotes_Expressions
                    ]
                    structure.append(emote_expressions_structure)

                if emote_gender == avatar_gender or emote_gender is None:
                    if emote_group == OTPLocalizer.Emotes_Dances:
                        emote_dance_structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_General:
                        structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_Music:
                        emote_music_structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_Expressions:
                        emote_expressions_structure.append(id)

                emote_group == OTPLocalizer.Emotes_Dances

            if emote_structure:
                structure.insert(0, emote_structure)

        self.createSpeedChatObject(structure)

        def listenForSCEvent(eventBaseName, handler, self=self):
            eventName = self.speedChat.getEventName(eventBaseName)
            self.accept(eventName, handler)

        listenForSCEvent(SpeedChatGlobals.SCTerminalLinkedEmoteEvent,
                         self.handleLinkedEmote)
        self.fsm = ClassicFSM.ClassicFSM('SpeedChat', [
            State.State('off', self.enterOff, self.exitOff, ['active']),
            State.State('active', self.enterActive, self.exitActive, ['off'])
        ], 'off', 'off')
        self.fsm.enterInitialState()
        self.mode = 'AllChat'
        self.whisperId = None
    def __init__(self):
        self.whisperId = None
        self.toPlayer = 0
        structure = []
        structure.append([
            SCEmoteMenu,
            OTPLocalizer.SCMenuEmotions])
        self.emoteMenuIdx = len(structure) - 1
        structure.append([
            SCCustomMenu,
            OTPLocalizer.SCMenuCustom])
        structure += scStructure
        if base.config.GetInt('want-emotes', 1):
            emote_structure = None
            emote_dance_structure = None
            emote_general_structure = None
            emote_music_structure = None
            emote_expressions_structure = None
            avatar_gender = base.emoteGender
            idList = EmoteGlobals.emotes.keys()
            idList.sort()
            for id in idList:
                emote = EmoteGlobals.emotes.get(id)
                emote_group = EmoteGlobals.getEmoteGroup(id)
                emote_gender = EmoteGlobals.getEmoteGender(id)
                if id in [
                    EmoteGlobals.EMOTE_VALENTINES,
                    EmoteGlobals.EMOTE_NOISEMAKER,
                    EmoteGlobals.EMOTE_HALLOWEEN,
                    EmoteGlobals.EMOTE_COIN_TAILS]:
                    continue
                
                if not emote_structure:
                    emote_structure = [
                        OTPLocalizer.Emotes_Root]
                
                if not emote_dance_structure:
                    emote_dance_structure = [
                        OTPLocalizer.Emotes_Dances]
                    structure.append(emote_dance_structure)
                
                if not emote_general_structure:
                    emote_general_structure = [
                        OTPLocalizer.Emotes_General]
                    structure.append(emote_general_structure)
                
                if not emote_music_structure:
                    emote_music_structure = [
                        OTPLocalizer.Emotes_Music]
                    structure.append(emote_music_structure)
                
                if not emote_expressions_structure:
                    emote_expressions_structure = [
                        OTPLocalizer.Emotes_Expressions]
                    structure.append(emote_expressions_structure)
                
                if emote_gender == avatar_gender or emote_gender is None:
                    if emote_group == OTPLocalizer.Emotes_Dances:
                        emote_dance_structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_General:
                        structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_Music:
                        emote_music_structure.append(id)
                    elif emote_group == OTPLocalizer.Emotes_Expressions:
                        emote_expressions_structure.append(id)
                    
                emote_group == OTPLocalizer.Emotes_Dances
            
            if emote_structure:
                structure.insert(0, emote_structure)
            
        
        self.createSpeedChatObject(structure)
        
        def listenForSCEvent(eventBaseName, handler, self = self):
            eventName = self.speedChat.getEventName(eventBaseName)
            self.accept(eventName, handler)

        listenForSCEvent(SpeedChatGlobals.SCTerminalLinkedEmoteEvent, self.handleLinkedEmote)
        self.fsm = ClassicFSM.ClassicFSM('SpeedChat', [
            State.State('off', self.enterOff, self.exitOff, [
                'active']),
            State.State('active', self.enterActive, self.exitActive, [
                'off'])], 'off', 'off')
        self.fsm.enterInitialState()
        self.mode = 'AllChat'
        self.whisperId = None