Exemple #1
0
    def __init__(self, owner, channel_manager):
        self.owner = owner
        self.channel_manager = channel_manager

        self.mod_commands = CommandSet()
        self.commands = CommandSet(exact_match_commands={
            '!requestjoin': self.request_join,
            '!requestleave': self.request_leave
        })
Exemple #2
0
 def set_commands(self):
     self.commands = CommandSet(
         exact_match_commands={
             '!left': lambda display_name: self.move(display_name, 'left'),
             '!right':
             lambda display_name: self.move(display_name, 'right')
         })
Exemple #3
0
 def set_commands(self):
     commands = {}
     for party_member in self.quest.party[1:]:
         # Due to party_member changing every iteration, we have to copy the value of party_member
         # to something else, or the same reference will be used for every iteration
         commands['!{}'.format(party_member.lower())] = (
             lambda display_name, target=party_member: self.pick(display_name, target))
     self.commands = CommandSet(exact_match_commands=commands)
Exemple #4
0
    def initialize(self):
        log('Initializing channel manager...')
        self.channel_manager = ChannelManager(self)

        log('Initializing player manager...')
        self.player_manager = PlayerManager(self)

        # Commands for direct whispers to the bot
        self.whisper_commands = CommandSet()
Exemple #5
0
    def __init__(self, quest_manager):
        self.quest_manager = quest_manager

        self.party = quest_manager.party
        self.commands = CommandSet()

        # Quest segment ordering
        self.starting_segment = None
        self.current_segment = None
Exemple #6
0
 def set_commands(self):
     self.commands = CommandSet(
         exact_match_commands={
             '!north':
             lambda display_name: self.guard(display_name, 'north'),
             '!south':
             lambda display_name: self.guard(display_name, 'south'),
             '!east': lambda display_name: self.guard(display_name, 'east'),
             '!west': lambda display_name: self.guard(display_name, 'west')
         })
Exemple #7
0
    def initialize(self):
        log('Initializing channel manager...')
        self.channel_manager = QuestChannelManager(self)

        log('Initializing player manager...')
        self.player_manager = QuestPlayerManager(self)

        # Commands for direct whispers to the bot
        self.whisper_commands = CommandSet(
            exact_match_commands={
                '!xelabot': self.faq_whisper,
                '!help': self.faq_whisper,
                '!gold': self.stats_whisper,
                '!exp': self.stats_whisper,
                '!stats': self.stats_whisper,
                '!items': self.stats_whisper,
                '!prestige': self.try_prestige
            })
Exemple #8
0
 def set_commands(self):
     self.commands = CommandSet(exact_match_commands={
         '!left': self.enter,
         '!right': self.enter
     })
Exemple #9
0
 def set_commands(self):
     self.commands = CommandSet(exact_match_commands={
         self.quest.duel_word: self.attack
     })
Exemple #10
0
 def set_commands(self):
     """
     Sets the commands available to players when they reach this quest segment. By default, nothing. Override this!
     """
     self.commands = CommandSet()
Exemple #11
0
 def set_commands(self):
     self.commands = CommandSet(exact_match_commands={
         self.quest.escape_word: self.escape
     })
Exemple #12
0
 def set_commands(self):
     self.commands = CommandSet(exact_match_commands={
         '!attack': self.attack,
         '!flee': self.flee
     })