VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "weapon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public Weight As Byte
Public Byte1 As Byte
Public Damage As Byte
Public Distance As Byte
Public Word4 As Long


'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()
    Graphic = (Word4 And &H1F00) / &H100
End Function
Public Function shootdamage()
    shootdamage = (Word4 And &HFF) / &H1
End Function

Public Function firedby1()
    If ((Byte1 And &HF0) / &H10) = 1 Then
        firedby1 = 1
    Else
        firedby1 = 0
    End If
End Function
Public Function firedby2()
    If ((Byte1 And &HF0) / &H10) = 2 Then
        firedby2 = 1
    Else
        firedby2 = 0
    End If
End Function
Public Function deltaenergy()
    deltaenergy = (Byte1 And &HF) / &H1
End Function

Public Function setgraphic(num As Integer)
    If num > 31 Then
        num = 31
    ElseIf num < 0 Then
        num = 0
    End If
    Word4 = (Word4 And &HFF) + (num * &H100)
End Function
Public Function setshootdamage(num As Integer)
    If num > 255 Then
        num = 255
    ElseIf num < 0 Then
        num = 0
    End If
    Word4 = (Word4 And &HFF00) + num
End Function

Public Function setfiredby1(num As Integer)
    Byte1 = (Byte1 And &HF)
    If num = 1 Then
        Byte1 = Byte1 + &H10
    End If
End Function
Public Function setfiredby2(num As Integer)
    Byte1 = (Byte1 And &HF)
    If num = 1 Then
        Byte1 = Byte1 + &H20
    End If
End Function
Public Function setdeltaenergy(num As Integer)
    If num > 15 Then
        num = 15
    ElseIf num < 0 Then
        num = 0
    End If
    Byte1 = (Byte1 And &HF0) + num
End Function

