Option Strict Off
Option Explicit On
Friend Class monsterdrop
	Public word0 As Integer
	
	'0x8000 = sometimes drop, sometimes dont
	'0x7FFF = number of item to drop
	' rest do nothing as far as i know
	
	'droppings:
	'0 to 10 = dragon
	'11 to 14 = worm
	'15 to 17 = screamer
	'18 to 20 = rat/hellhound
	'21 to 25 = rockpile
	'26 to 32 = knight
	'^^^-- these items will always be cursed
	'33 to 34 = antman
	'35 to 36 = stone golem
	'37 to 39 = skeleton
	
	Public Function itemnum() As Short
		itemnum = (word0 And &H7FFF)
	End Function
	
	Public Function sometimes() As Byte
		Dim l1 As Integer
		
		l1 = (word0 And &H8000)
		l1 = l1 / &H8000
		If l1 = -1 Then
			l1 = 1
		End If
		sometimes = l1
	End Function
	
    Public Sub set_itemnum(ByRef num As Short)
        If num > 32767 Then
            num = 32767
        End If
        If num < 0 Then
            num = 0
        End If
        word0 = CUShort((word0 And &H8000) + num)
    End Sub
	
    Public Sub set_sometimes(ByRef num As Short)
        If num = 1 Then
            word0 = CUShort((word0 And &H7FFF) + 32768)
        Else
            word0 = word0 And &H7FFF
        End If

    End Sub
End Class