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

Sub Smoke.Object
 On Local Error Goto Error.Trap20
 Call Parse
 If Parser Then
    Call Numeric
 Endif
 Call Check.User.Items
 If Temp7!<=SFalse Then
    Strng="You can't smoke that!"
    Call IO.O
    Exit Sub
 Endif
 If (TreasureRecord.Edible And 4)=0 Then
    Strng="That's not smokable!"
    Call IO.O
    Exit Sub
 Endif
 If MessWorkRecord6.Charges>=False Then
    Strng="You can't! It's not lit!"
    Call IO.O
    Exit Sub
 Endif
 Out2=Rtrim$(TreasureRecord.Prefix1)
 Out3=Lcase$(Rtrim$(TreasureRecord.ShortName))
 Strng="You smoke the "+Out2+Out3
 Call Convert.ANSI(True,VarQ,VarR)
 Carriage.Return=True
 Graphics.On=True
 Call IO.O
 Graphics.On=False
 Graphics.Off=True
 Strng="!"
 Call IO.O
 MessWorkRecord6.Charges=MessWorkRecord6.Charges+1
 Call Write.Record(MessWorkFile6,Temp5!)
 If MessWorkRecord6.Charges>=False Then
    Call Discard.Item(Temp5!)
    Out2=Rtrim$(TreasureRecord.Prefix1)
    Out3=Lcase$(Rtrim$(TreasureRecord.ShortName))
    Strng="The "+Out2+Out3
    Call Convert.ANSI(True,VarQ,VarR)
    Carriage.Return=True
    Graphics.On=True
    Call IO.O
    Graphics.On=False
    Graphics.Off=True
    Strng=" went out!"
    Call IO.O
    Exit Sub
 Endif
 Temp2!=TreasureRecord.Spell
 If Temp2!>SFalse And Temp2!<=Lof(SpellFile)/SpellRecLen Then
    Call Read.Record(SpellFile,Temp2!)
    Magic.Spell=SpellRecord.SpellType
    Multiplier=SpellRecord.Level
    Monster.Temp=SFalse
    Parser=False
    Temp7!=SFalse
    Temp3=True
    Call Magic2
    Exit Sub
 Endif
 Strng="Nothing happens!"
 Call IO.O
Error.Resume20:
 Exit Sub
Error.Trap20:
 Resume Error.Resume20
End Sub
