Option Strict Off
Option Explicit On
Friend Class weapon
	Public Weight As Byte
	Public Byte1 As Byte
	Public Damage As Byte
	Public Distance As Byte
	Public Word4 As Integer
	
	
	'weight = weight
	'byte1: if 0x0a, fired by 0x1X, if 0x0b, fired by 0x2X
	'if byte1 is 0 or 2, when thrown, use fighter-2 skill
	'if byte is 1 or 3-15, when thrown, use ninja 4
	'if byte is 16-112, when thrown, use ninja 5
	
	'byte3: added throwing distance (str-independant), ACTUAL DAMAGE
	'byte4: added damage when projectile hit,
	'       throwing distance when (shot)
	'word4:
	'0x1F00: number associated with graphic information.
	'0x00ff: damage added when "shoot"
	' what in gods name does 0x2000 mean?
	
    Public Function Graphic() As Short
        'UPGRADE_WARNING: Couldn't resolve default property of object Graphic. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        Graphic = CShort(Word4 And &H1F00) / &H100
    End Function
    Public Function shootdamage() As Short
        'UPGRADE_WARNING: Couldn't resolve default property of object shootdamage. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        shootdamage = CShort(Word4 And &HFF) / &H1
    End Function
	
    Public Function firedby1() As Short
        If (CShort(Byte1 And &HF0) / &H10) = 1 Then
            'UPGRADE_WARNING: Couldn't resolve default property of object firedby1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            firedby1 = 1
        Else
            'UPGRADE_WARNING: Couldn't resolve default property of object firedby1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            firedby1 = 0
        End If
    End Function
    Public Function firedby2() As Short
        If (CShort(Byte1 And &HF0) / &H10) = 2 Then
            'UPGRADE_WARNING: Couldn't resolve default property of object firedby2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            firedby2 = 1
        Else
            'UPGRADE_WARNING: Couldn't resolve default property of object firedby2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            firedby2 = 0
        End If
    End Function
    Public Function deltaenergy() As Short
        'UPGRADE_WARNING: Couldn't resolve default property of object deltaenergy. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        deltaenergy = CShort(Byte1 And &HF) / &H1
    End Function
	
    Public Sub setgraphic(ByRef num As Short)
        If num > 31 Then
            num = 31
        ElseIf num < 0 Then
            num = 0
        End If
        Word4 = CShort(Word4 And &HFF) + (num * &H100)
    End Sub
    Public Sub setshootdamage(ByRef num As Short)
        If num > 255 Then
            num = 255
        ElseIf num < 0 Then
            num = 0
        End If
        Word4 = CShort(Word4 And &HFF00) + num
    End Sub
	
    Public Sub setfiredby1(ByRef num As Short)
        Byte1 = (Byte1 And &HF)
        If num = 1 Then
            Byte1 = Byte1 + &H10
        End If
    End Sub
    Public Sub setfiredby2(ByRef num As Short)
        Byte1 = (Byte1 And &HF)
        If num = 1 Then
            Byte1 = Byte1 + &H20
        End If
    End Sub
    Public Sub setdeltaenergy(ByRef num As Short)
        If num > 15 Then
            num = 15
        ElseIf num < 0 Then
            num = 0
        End If
        Byte1 = CShort(Byte1 And &HF0) + num
    End Sub
End Class