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

Sub Fuel.Object
 On Local Error Goto ErrTrap13
 Call Parse
 If Parser Then
    Call Numeric
 Endif
 Call Check.User.Items
 If Temp7!<=SFalse Then
    Strng="You can't fuel that!"
    Call IO.O
    Exit Sub
 Endif
 Var2$=Rtrim$(TreasureRecord.Prefix1)
 Var3$=Lcase$(Rtrim$(TreasureRecord.ShortName))
 If TreasureRecord.LightType=False Then
    Strng="You can't fuel that!"
    Call IO.O
    Exit Sub
 Endif
 If TreasureRecord.LightCharges=False Then
    Strng="It has no light charges!"
    Call IO.O
    Exit Sub
 Endif
 If MessWorkRecord6.Charges<False Then
    Strng="It's already fueled!"
    Call IO.O
    Exit Sub
 Endif
 Var1=TreasureRecord.LightCharges
 Var2!=Temp5!
 If Parser=False Then
    Strng="Fuel with what?"
    Call IO.O
    Exit Sub
 Endif
 Parsed.Command1=Parsed.Command2
 Call Numeric
 Call Check.User.Items
 If Temp7!<=SFalse Then
    Strng="You can't fuel with that!"
    Call IO.O
    Exit Sub
 Endif
 If TreasureRecord.FuelType=False Then
    Strng="You can't fuel with that!"
    Call IO.O
    Exit Sub
 Endif
 If TreasureRecord.FuelCharges<=False Then
    Strng="It has no fuel charges!"
    Call IO.O
    Exit Sub
 Endif
 If MessWorkRecord6.Charges=False Then
    Strng="It has no fuel charges!"
    Call IO.O
    Exit Sub
 Endif
 MessWorkRecord6.Charges=MessWorkRecord6.Charges-1
 Call Write.Record(MessWorkFile6,Temp5!)
 Call Read.Record(MessWorkFile6,Var2!)
 MessWorkRecord6.Charges=-Var1
 Call Write.Record(MessWorkFile6,Var2!)

 Strng="You fuel the "+Var2$+Var3$
 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

 Strng="It now has "+Form$(Cdbl(Var1))+" charge"
 If Var1>1 Then
    Strng=Strng+"s"
 Endif
 Strng=Strng+"!"
 Call IO.O
ErrResume13:
 Exit Sub
ErrTrap13:
 Resume ErrResume13
End Sub
