 Rem File: Cmd192.bas
 Rem Sub: Burn.Object
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 192 -- Burn.Object."
    Color 7,0
    End
 Endif
 Call Burn.Object
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Burn.Object
 On Local Error Goto Error.Trap20
 Call Parse
 If Parser Then
    Call Numeric
 Endif

 ' check room for treasure
 Temp4=True
 Call Check.Room.Items3
 If Temp7!=SFalse Then
    Call Num

    ' check user for treasure
    Temp4=False
    Call Check.Inventory.Treasure
    If Temp7!=SFalse Then
       Call Num

       ' check room for container
       Temp4=1
       Call Search.Room.Containers
       If TempA!=SFalse Then
          Call Num

          ' check user for container
          Temp4=2
          Call Search.User.Containers
          If TempA!=SFalse Then
             Strng="You can't burn that!"
             Call IO.O
             Exit Sub
          Endif
       Endif
    Endif
 Endif

 ' check treasure can be burned
 If Temp4<=0 Then
    If (TreasureRecord.Edible And 8)=0 Then
       Strng="You can't burn that!"
       Call IO.O
       Exit Sub
    Endif
 Endif

 ' check container can be burned
 If Temp4>0 Then
    If ContainerRecord.Material>=0 Then
       Strng="You can't burn that!"
       Call IO.O
       Exit Sub
    Endif
 Endif

 ' display item
 If Temp4<=0 Then
    Out2=Rtrim$(TreasureRecord.Prefix1) ' { prefix ansi code
    Out3=Lcase$(Rtrim$(TreasureRecord.ShortName))
 Else
    Out2=Rtrim$(ContainerRecord.Prefix1) ' { prefix ansi code
    Out3=Lcase$(Rtrim$(ContainerRecord.ContainerShort))
 Endif
 Strng="You burn the "+Out2+Out3
 Call Convert.ANSI(True,VarQ,VarR) ' convert and display ansi string
 Carriage.Return=True ' turn off cr/lf
 Graphics.On=True
 Call IO.O ' display second part of string
 Graphics.On=False
 Strng="! It went up in flames!"
 Call IO.O

 ' delete item
 Select Case Temp4
 Case -1 ' room inventory
    Call Delete.List.Node(Temp5!)
    Call Clear.List.Node
    Call Write.Record(RoomInvFile,Temp5!)
 Case 0 ' user invemtory
    Call Discard.Item(Temp5!)
 Case 1 ' room container
    Call Delete.Room.Container(TempA!)
    Call Clear.Container
    Call Write.Record(ContainerFile,TempA!)
 Case 2 ' user container
    Weight=Weight-ContainerRecord.Weight
    If Weight<DFalse Then
       Weight=DFalse
    Endif
    Call Delete.User.Container(TempA!)
    Call Clear.Container
    Call Write.Record(ContainerFile,TempA!)
 End Select
Error.Resume20:
 Exit Sub
Error.Trap20:
 Resume Error.Resume20
End Sub
