Beispiel #1
0
 def load(self, bytes, frames, event_type, event_code, pid):
     event = AbilityEvent(frames, event_type, event_code, pid)
     
     first, atype = (bytes.get_big_8(), bytes.get_big_8())
     event.ability = bytes.get_big_8() << 16 | bytes.get_big_8() << 8 | (bytes.get_big_8() & 0x3F)
             
     if atype == 0x20 or atype == 0x22:
         event.name = 'unitability'
         #print "Time %s - Player %s orders (%s) %s " % (self.timestr, self.player, hex(atype), event.abilitystr)
         if event.ability & 0xFF > 0x07:
             if first == 0x29 or first == 0x19:
                 bytes.skip(4)
             else:
                 bytes.skip(9)
                 if event.ability & 0x20 != 0:
                     bytes.skip(9)
                     
     elif atype == 0x48 or atype == 0x4A:
         #identifies target point
         event.name = 'targetlocation'
         #print "Time %s - Player %s issues location target" % (self.timestr, self.player)
         bytes.skip(7)
     
     elif atype == 0x88 or atype == 0x8A:
         #identifies the target unit
         event.name = 'targetunit'
         #print "Time %s - Player %s orders (%s) %s " % (self.timestr, self.player, hex(atype), abilitystr)
         bytes.skip(15)
     
     else:
         raise TypeError("Ability type %s is unknown at location %s" % (hex(atype), event.location))
         
     return event
Beispiel #2
0
    def load(self, bytes, frames, event_type, event_code, pid):
        event = AbilityEvent(frames, event_type, event_code, pid)

        first, atype = (bytes.get_big_8(), bytes.get_big_8())
        event.ability = bytes.get_big_8() << 16 | bytes.get_big_8() << 8 | (
            bytes.get_big_8() & 0x3F)

        if atype == 0x20 or atype == 0x22:
            event.name = 'unitability'
            #print "Time %s - Player %s orders (%s) %s " % (self.timestr, self.player, hex(atype), event.abilitystr)
            if event.ability & 0xFF > 0x07:
                if first == 0x29 or first == 0x19:
                    bytes.skip(4)
                else:
                    bytes.skip(9)
                    if event.ability & 0x20 != 0:
                        bytes.skip(9)

        elif atype == 0x48 or atype == 0x4A:
            #identifies target point
            event.name = 'targetlocation'
            #print "Time %s - Player %s issues location target" % (self.timestr, self.player)
            bytes.skip(7)

        elif atype == 0x88 or atype == 0x8A:
            #identifies the target unit
            event.name = 'targetunit'
            #print "Time %s - Player %s orders (%s) %s " % (self.timestr, self.player, hex(atype), abilitystr)
            bytes.skip(15)

        else:
            raise TypeError("Ability type %s is unknown at location %s" %
                            (hex(atype), event.location))

        return event
Beispiel #3
0
 def load(self, bytes, frames, event_type, event_code, pid):
     event = AbilityEvent(frames, event_type, event_code, pid)
     bytes.skip(4)
     event.ability = bytes.get_big_8() << 16 | bytes.get_big_8() << 8 | bytes.get_big_8()
     req_target = bytes.get_big_8()
     
     bytes.skip(24)
     
     #In certain cases we need an extra byte
     if req_target == 0x30 or req_target == 0x05:
         bytes.skip(1)
         
     return event
Beispiel #4
0
    def load(self, bytes, frames, event_type, event_code, pid):
        event = AbilityEvent(frames, event_type, event_code, pid)
        bytes.skip(4)
        event.ability = bytes.get_big_8() << 16 | bytes.get_big_8(
        ) << 8 | bytes.get_big_8()
        req_target = bytes.get_big_8()

        bytes.skip(24)

        #In certain cases we need an extra byte
        if req_target == 0x30 or req_target == 0x05:
            bytes.skip(1)

        return event