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

Sub Align
 On Local Error Goto Error.Trap30
 If Normal.User Then
    If UserRecord.Flags And Alignmented Then
       Strng="You've already changed alignment once!"
       Call IO.O
       Exit Sub
    Endif
 Endif
 Strng="Change alignment(y/n)? "
 No.Input.Out="Y"
 Call IO.I
 If Yes Then
    UserRecord.Flags=UserRecord.Flags Or Alignmented
    Call Modify.Alignment
    Strng="Alignment is now "
    Strng=Strng+Rtrim$(Alignment.Name1(UserRecord.Align1+2))+" "
    Strng=Strng+Rtrim$(Alignment.Name2(UserRecord.Align2+2))
    Call IO.O
 Endif
Error.Resume30:
 Exit Sub
Error.Trap30:
 Resume Error.Resume30
End Sub

Sub Modify.Alignment
 On Local Error Goto ErrorTrp11
 Do While Security.Guard
    Graphics.Off=False
    Strng="Player Alignment:"
    Call IO.O
    Strng="Press "+Enter$+" for default."
    Call IO.O
    Graphics.Off=True
    For Temp5=1 To MaxAlignment
       Strng=Mid$(Str$(Temp5),2)+"> "+Rtrim$(Alignment.Name1(Temp5))
       Call IO.O
    Next
    Strng="?"
    No.Input.Out="2"
    Call IO.I
    Temp2=Int(Val(Out2)+.5)
    If Temp2>=1 And Temp2<=3 Then
       Exit Do
    Endif
 Loop
 UserRecord.Align1=Temp2-2
 Do While Security.Guard
    Graphics.Off=False
    Strng="Player Alignment:"
    Call IO.O
    Strng="Press "+Enter$+" for default."
    Call IO.O
    Graphics.Off=True
    For Temp5=1 To MaxAlignment
       Strng=Mid$(Str$(Temp5),2)+"> "+Rtrim$(Alignment.Name2(Temp5))
       Call IO.O
    Next
    Strng="?"
    No.Input.Out="2"
    Call IO.I
    Temp2=Int(Val(Out2)+.5)
    If Temp2>=1 And Temp2<=3 Then
       Exit Do
    Endif
 Loop
 UserRecord.Align2=Temp2-2
ErrorRsm11:
 Exit Sub
ErrorTrp11:
 Resume ErrorRsm11
End Sub
