Exemplo n.º 1
0
    def player_hotkey_event(self, data, fstamp, pid, event_type):
        hotkey = data.read_bits(4)
        action = data.read_bits(2)

        if self.HOTKEY_OVERLAY:
            overlay = self._parse_selection_update(data)
        else:
            overlay = (1, 0)

        if action == 0:
            return SetToHotkeyEvent(fstamp, pid, event_type, hotkey, overlay)
        elif action == 1:
            return AddToHotkeyEvent(fstamp, pid, event_type, hotkey, overlay)
        elif action == 2:
            return GetFromHotkeyEvent(fstamp, pid, event_type, hotkey, overlay)
        else:
            raise ParseError("Hotkey Action '{0}' unknown".format(hotkey))
Exemplo n.º 2
0
    def parse_ability_event(self, buffer, frames, type, code, pid):
        """Moves the right click move to the top level"""
        flag = buffer.read_byte()
        atype = buffer.read_byte()

        if atype & 0x20:  # command card
            return self.command_card(buffer, frames, type, code, pid, flag,
                                     atype)
        elif atype & 0x40:  # location/move ??
            return self.location_move(buffer, frames, type, code, pid, flag,
                                      atype)
        elif atype & 0x80:  # right-click on target?
            return self.right_click_target(buffer, frames, type, code, pid,
                                           flag, atype)
        elif atype < 0x10:  #new to patch 1.3.3, location now??
            return self.right_click_move(buffer, frames, type, code, pid, flag,
                                         atype)

        raise ParseError()
Exemplo n.º 3
0
    def parse_ability_event(self, buffer, frames, type, code, pid):
        flag = buffer.read_byte()
        atype = buffer.read_byte()

        if atype & 0x20:  # command card
            return self.command_card(buffer, frames, type, code, pid, flag,
                                     atype)
        elif atype & 0x40:  # location/move
            if flag == 0x08:
                return self.right_click_move(buffer, frames, type, code, pid,
                                             flag, atype)
            elif flag in (0x04, 0x05, 0x07):
                return self.location_move(buffer, frames, type, code, pid,
                                          flag, atype)
        elif atype & 0x80:  # right-click on target?
            return self.right_click_target(buffer, frames, type, code, pid,
                                           flag, atype)

            raise ParseError()
Exemplo n.º 4
0
 def parse_game_save_event(self, buffer, frames, type, code, pid):
     raise ParseError("Unparsable game save event found.")