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

Sub Panic
 On Local Error Goto ErrorTrap43
 Temp9=False
 For TempA=1 To MaxDirections
    If RoomRecord.Direct(TempA) Then
       Call Restrict2(TempA)
       If TempB=False Then
          Temp9=Temp9+1
       Endif
    Endif
 Next
 If Temp9=False Then
    Strng="There is nowhere to run! Try Appeal.."
    Call IO.O
    Exit Sub
 Endif
 TempC=Int(Rnd*Temp9+1)
 Temp9=False
 For TempA=1 To MaxDirections
    If RoomRecord.Direct(TempA) Then
       Call Restrict2(TempA)
       If TempB=False Then
          Temp9=Temp9+1
          If Temp9=TempC Then
             Select Case Rnd
             Case Is>.75
                Strng="You run away like a frothing maniac!"
             Case Is>.5
                Strng="You run away like a screaming madman!"
             Case Else
                Strng="You run away like a blithering idiot!"
             End Select
             Call IO.O
             If Sysop Or UserRecord.ClassType>=AsstDM Then
                Eat$ = Nul
             Else
                Call Fumble
             Endif
             Next.Room=RoomRecord.Direct(TempA)
             Action.Recurse=0
             Call Enter.Room
             Exit For
          Endif
       Endif
    Endif
 Next
ErrorResume43:
 Exit Sub
ErrorTrap43:
 Resume ErrorResume43
End Sub
