Option Strict Off
Option Explicit On
Friend Class Tdoor
    Public byte0 As Byte
    Public strength As Byte

    '0x00FF = strength of door, for bashing
    '0x0100 = not passable by super natural beings
    '0x0200 = passable by projectiles (sometimes)
    '0x0400 = mirrored randomly (ra door)
    ' rest do nothing as far as i know

    Public Function pass_nonmaterial() As Byte
        pass_nonmaterial = CShort(byte0 And &H1) / &H1
    End Function
    Public Function pass_projectile() As Byte
        pass_projectile = CShort(byte0 And &H2) / &H2
    End Function
    Public Function mirrored() As Byte
        mirrored = CShort(byte0 And &H4) / &H4
    End Function
    Public Sub set_passnonmaterial(ByRef num As Short)
        If num = 1 Then
            byte0 = CShort(byte0 And &HFE) + &H1
        Else
            byte0 = byte0 And &HFE
        End If
    End Sub
    Public Sub set_passprojectile(ByRef num As Short)
        If num = 1 Then
            byte0 = CShort(byte0 And &HFD) + &H2
        Else
            byte0 = byte0 And &HFD
        End If
    End Sub
    Public Sub set_mirrored(ByRef num As Short)
        If num = 1 Then
            byte0 = CShort(byte0 And &HFB) + &H4
        Else
            byte0 = byte0 And &HFB
        End If
    End Sub
End Class