home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
DND29C4.ZIP
/
SOURCE.ZIP
/
EDIT.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-01-04
|
112KB
|
4,583 lines
Rem edit.bas v2.9c
Rem $Include: 'dndbbs.inc'
On Error Goto 10002
Call Read.Config
Graphics.Off=False
Strng="Edit utility V"+Left$(Version$,4)
Call IO.O
No.Input.Out="N"
Strng="Short menus(y/n)?"
Call IO.I
TempC=False
If Yes Then
TempC=True
Endif
No.Input.Out="N"
Strng="Use hotkeys(y/n)?"
Call IO.I
TempD=False
If Yes Then
TempD=1
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]ction"
Call IO.O
Strng="[E]mail"
Call IO.O
Strng="[M]onster"
Call IO.O
Strng="[N]onplayer"
Call IO.O
Strng="[O]bject"
Call IO.O
Strng="[R]oom"
Call IO.O
Strng="[S]pell"
Call IO.O
Strng="[T]reasure"
Call IO.O
Strng="[U]ser"
Call IO.O
Graphics.Off=False
Endif
Strng="Edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Edit.Action
Case "E"
Call Edit.Mail
Case "M"
Call Edit.Monster
Case "N"
Call Edit.Nonplayer
Case "O"
Call Edit.Object
Case "R"
Call Edit.Room
Case "S"
Call Edit.Spell
Case "T"
Call Edit.Treasure
Case "U"
Call Edit.User
Case "Q"
Exit Do
End Select
Loop
10001
Call Terminate
10002
Resume 10001
End
Sub Terminate
On Local Error Goto 10012
If Data.Error Then
Call Screen.ANSI(3,0,0)
Call Screen.ANSI(2,24,1)
Locate 24,1,1
Call Screen.ANSI(1,37,7)
Call Scrn(Strng)
End
Endif
If Chained Then
Strng=Nul
Call IO.O
Endif
If Max.Row=22 Then
Strng=Nul
Call IO.O
Locate 23,1,1
Endif
If Chained Then
Chain DND.Path$+"dndbbs.exe"
Endif
Call Screen.ANSI(1,37,7)
10011
End
10012
Resume 10011
End Sub
Sub Edit.Object
On Local Error Goto 10022
If Lof(6)=False Then
Call Add.Object
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd"
Call IO.O
Strng="[C]hange"
Call IO.O
Strng="[L]ist"
Call IO.O
Strng="[S]earch"
Call IO.O
Graphics.Off=False
Endif
Strng="Object edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Object
Case "C"
Call Find.Object
If Temp Then
Temp4=Temp
Call Change.Object
Endif
Case "L"
Call List.Object
Case "S"
Call Search.Object
Case "Q"
Exit Do
End Select
Loop
10021
Exit Sub
10022
Resume 10021
End Sub
Sub List.Object
On Local Error Goto 10032
Temp3=Lof(6)/Len(ObjectRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp5=Temp To Temp2
Get 6,Temp5,ObjectRecord
Call Display.Object(False)
Graphics.Off=False
Call More.Prompt
If No Then
Exit Sub
Endif
Next
10031
Exit Sub
10032
Resume 10031
End Sub
Sub Add.Object
On Local Error Goto 10042
Temp4=Lof(6)/Len(ObjectRecord)+1
ObjectRecord.ObjectName=Nul
ObjectRecord.ShortName=Nul
ObjectRecord.LongDesc=Nul
ObjectRecord.ShortDesc=Nul
ObjectRecord.RoomLink=False
ObjectRecord.Invisible=False
ObjectRecord.JailTrap=False
ObjectRecord.DoorLock=False
ObjectRecord.Relocks=False
ObjectRecord.Hidden=False
ObjectRecord.Closed=False
ObjectRecord.Keyed=False
ObjectRecord.Permanent=True
Put 6,Temp4,ObjectRecord
Call Change.Object
10041
Exit Sub
10042
Resume 10041
End Sub
Sub Change.Object
On Local Error Goto 10052
Get 6,Temp4,ObjectRecord
Do
Temp5=Temp4
Call Display.Object(True)
Graphics.Off=False
Strng="Object change option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Object name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
ObjectRecord.ObjectName=Out2
Case "B"
Strng="Object identifier(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Ucase$(Out2)
ObjectRecord.ShortName=Out2
Case "C"
Strng="Room number link(press "+Enter$+" for new room)?"
No.Input.Out="<new room>"
Call IO.I
TempX=Temp4
Temp4=Int(Val(Out2))
If Temp4=False Then
Graphics.Off=True
Strng="Create a new room(y/n)?"
No.Input.Out="Y"
Call IO.I
If Yes Then
Call Add.Room
Endif
Endif
ObjectRecord.RoomLink=Temp4
Temp4=TempX
Case "D"
Strng="Trapped portal(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.Teleport=False
ObjectRecord.Trap=False
If Yes Then
Do
Graphics.Off=True
If TempC=False Then
Strng="[P]oison needles"
Call IO.O
Strng="[T]eleport to room number"
Call IO.O
Strng="[H]its for fatigue or vitality"
Call IO.O
Graphics.Off=False
Endif
Strng="Object trap option(q to quit)?"
No.Input.Out="Q"
Line.Length=TempD
Call IO.I
Select Case Ucase$(Out2)
Case "P"
ObjectRecord.Trap=1
Case "T"
ObjectRecord.Trap=2
Strng="Room number?"
No.Input.Out="1"
Call IO.I
ObjectRecord.Teleport=Int(Val(Out2))
Case "H"
Temp8=False
Do
Graphics.Off=True
If TempC=False Then
Strng="[F]atigue"
Call IO.O
Strng="[V]itality"
Call IO.O
Strng="[N]one"
Call IO.O
Graphics.Off=False
Endif
Strng="Object trap hits option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "F"
Temp8=1
Case "V"
Temp8=True
Case "N"
Temp8=False
Case "Q"
Exit Do
End Select
Loop
If Temp8 Then
ObjectRecord.Trap=3
Strng="Number of hits(1-32767)?"
No.Input.Out="10"
Call IO.I
ObjectRecord.Teleport=Int(Val(Out2))*Temp8
Endif
Case "Q"
Exit Do
End Select
Loop
Endif
Case "E"
Strng="Long description(128 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
ObjectRecord.LongDesc=Out2
Case "F"
Strng="Entry description(40 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
ObjectRecord.ShortDesc=Out2
Case "G"
Strng="Hidden object(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.Hidden=False
If Yes Then
ObjectRecord.Hidden=True
Endif
Case "H"
Strng="Invisible object(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.Invisible=False
If Yes Then
ObjectRecord.Invisible=True
Endif
Case "I"
Strng="Jail attacker trap(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.JailTrap=False
If Yes Then
ObjectRecord.JailTrap=True
Endif
Case "J"
Strng="Locked portal(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.DoorLock=False
ObjectRecord.Closed=False
If Yes Then
ObjectRecord.DoorLock=2
ObjectRecord.Closed=True
Endif
Case "K"
Strng="Relocking portal(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.Relocks=False
If Yes Then
ObjectRecord.Relocks=True
Endif
Case "L"
Strng="Key number(1-32767)?"
No.Input.Out="12345"
Call IO.I
ObjectRecord.Keyed=Int(Val(Out2))
Case "M"
Strng="Permanent Object(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
ObjectRecord.Permanent=True
If No Then
ObjectRecord.Permanent=False
Endif
Case "Q"
Exit Do
End Select
Loop
Put 6,Temp4,ObjectRecord
Strng="Object '"+Rtrim$(ObjectRecord.ObjectName)+"' changed."
Call IO.O
Strng="Add object to room(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
If Yes Then
Strng="Room number(press "+Enter$+" for current room)?"
No.Input.Out="<current room>"
Call IO.I
Temp=Int(Val(Out2))
If Temp=False Then
Temp=Room
Endif
If Temp<1 Or Temp>Lof(5)/Len(RoomRecord) Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Get 5,Temp,RoomRecord
For Temp5=1 To 10
If RoomRecord.Object(Temp5)=False Then
RoomRecord.Object(Temp5)=Temp4
RoomRecord.ObjCharges(Temp5)=False
RoomRecord.Flags(Temp5)=False
Put 5,Temp,RoomRecord
Strng="Object added to room number"+Str$(Temp)+"."
Call IO.O
Exit Sub
Endif
Next
Strng="There are no empty objects in room"+Str$(Temp)+"."
Call IO.O
Endif
10051
Exit Sub
10052
Resume 10051
End Sub
Sub Display.Object(TempX)
On Local Error Goto 10062
If TempX Then
If TempC Then
Exit Sub
Endif
Endif
Graphics.Off=True
Strng="Object number"+Str$(Temp5)+":"
Call IO.O
If TempX Then
Strng="[A]"
Endif
Strng=Strng+"Object name: "+Rtrim$(ObjectRecord.ObjectName)
Call IO.O
If TempX Then
Strng="[B]"
Endif
Strng=Strng+"Object identifier: "+Rtrim$(ObjectRecord.ShortName)
Call IO.O
If TempX Then
Strng="[C]"
Endif
Strng=Strng+"Room number link:"+Str$(ObjectRecord.RoomLink)
Call IO.O
If TempX Then
Strng="[D]"
Endif
Strng=Strng+"Trapped portal: "
If ObjectRecord.Trap=False Then
Strng=Strng+"No"
Endif
If ObjectRecord.Trap=1 Then
Strng=Strng+"poison needles"
Endif
If ObjectRecord.Trap=2 Then
Strng=Strng+"teleport to"+Str$(ObjectRecord.Teleport)
Endif
If ObjectRecord.Trap=3 Then
Strng=Strng+"hits for"+Str$(Abs(ObjectRecord.Teleport))
If ObjectRecord.Teleport<False Then
Strng=Strng+" vitality"
Else
Strng=Strng+" fatigue"
Endif
Endif
Call IO.O
If TempX Then
Strng="[E]"
Endif
Strng=Strng+"Long description: "+Rtrim$(ObjectRecord.LongDesc)
Call IO.O
If TempX Then
Strng="[F]"
Endif
Strng=Strng+"Entry description: "+Rtrim$(ObjectRecord.ShortDesc)
Call IO.O
If TempX Then
Strng="[G]"
Endif
Strng=Strng+"Hidden object: "
If ObjectRecord.Hidden Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[H]"
Endif
Strng=Strng+"Invisible object: "
If ObjectRecord.Invisible Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[I]"
Endif
Strng=Strng+"Jail attacker trap: "
If ObjectRecord.JailTrap Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[J]"
Endif
Strng=Strng+"Locked portal: "
If ObjectRecord.DoorLock=2 Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[K]"
Endif
Strng=Strng+"Relocking portal: "
If ObjectRecord.Relocks Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[L]"
Endif
Strng=Strng+"Key number:"+Str$(ObjectRecord.Keyed)
Call IO.O
If TempX Then
Strng="[M]"
Endif
Strng=Strng+"Permanent object: "
If ObjectRecord.Permanent Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
10061
Exit Sub
10062
Resume 10061
End Sub
Sub Edit.Action
On Local Error Goto 10072
If Lof(5)=False Then
Call Add.Room
Endif
Temp2=1
Get 5,Temp2,RoomRecord
Do
Graphics.Off=True
If TempC=False Then
Strng="Triggers:"
Call IO.O
Graphics.Off=True
Strng="[E]ncounter monster"
Call IO.O
Strng="[S]pells"
Call IO.O
Strng="[M]onster talk"
Call IO.O
Strng="[L]evel entry"
Call IO.O
Graphics.Off=False
Strng="Results:"
Call IO.O
Graphics.Off=True
Strng="[H]ealth"
Call IO.O
Strng="[R]ate"
Call IO.O
Strng="[I]nventory"
Call IO.O
Strng="[F]umble"
Call IO.O
Strng="[T]eleport"
Call IO.O
Graphics.Off=False
Strng="Other:"
Call IO.O
Graphics.Off=True
Strng="[C]lear room"
Call IO.O
Strng="[W]eapon rusting"
Call IO.O
Strng="[O]bject stealing"
Call IO.O
Strng="[N]ew room number"
Call IO.O
Strng="[D]isplay room actions"
Call IO.O
Graphics.Off=False
Endif
Strng="Action edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "E"
Call Find.Monster
If Temp Then
RoomRecord.MonsterTrigger=Temp
Strng="Monster trigger added to room."
Call IO.O
Endif
Case "S"
Call Find.Spell
If Temp Then
RoomRecord.SpellTrigger=Temp
Strng="Spell trigger added to room."
Call IO.O
Endif
Case "M"
Call Find.Monster
If Temp Then
RoomRecord.MonsterTalk=Temp
Strng="Monster talk trigger added to room."
Call IO.O
Endif
Case "L"
Do
Graphics.Off=True
If TempC=False Then
Strng="[H]ighest level (at least) for entry to room"
Call IO.O
Strng="[L]owest level (at most) for entry to room"
Call IO.O
Strng="[E]nter room restrictions"
Call IO.O
Graphics.Off=False
Endif
Strng="Action level entry option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "H"
Strng="Highest level user must be (at least) to enter room?"
No.Input.Out="1"
Call IO.I
RoomRecord.Level=Int(Val(Out2))
Case "L"
Strng="Lowest level user must be (at most) to enter room?"
No.Input.Out="1"
Call IO.I
RoomRecord.Level=-Int(Val(Out2))
Case "E"
Do
Graphics.Off=True
If TempC=False Then
Strng="[N]orth"
Call IO.O
Strng="[E]ast"
Call IO.O
Strng="[S]outh"
Call IO.O
Strng="[W]est"
Call IO.O
Strng="[O]ut"
Call IO.O
Strng="[U]p"
Call IO.O
Strng="[D]own"
Call IO.O
Strng="[NE]northeast"
Call IO.O
Strng="[SE]southeast"
Call IO.O
Strng="[SW]southwest"
Call IO.O
Strng="[NW]northwest"
Call IO.O
Strng="[G]o to portal"
Call IO.O
Graphics.Off=False
Endif
Strng="Action room restriction option(q to quit)?"
No.Input.Out="Q"
Call IO.I
Temp=False
Select Case Ucase$(Out2)
Case "N"
Temp=1
Case "E"
Temp=2
Case "S"
Temp=3
Case "W"
Temp=4
Case "O"
Temp=5
Case "U"
Temp=6
Case "D"
Temp=7
Case "NE"
Temp=8
Case "SE"
Temp=9
Case "SW"
Temp=10
Case "NW"
Temp=11
Case "G"
Temp=12
Case "Q"
Exit Do
End Select
If Temp Then
RoomRecord.Restrictions=RoomRecord.Restrictions Or 2^Temp
Strng="Direction restricted."
Call IO.O
Endif
Loop
Case "Q"
Exit Do
End Select
Loop
Case "H"
Do
Graphics.Off=True
If TempC=False Then
Strng="[F]atigue"
Call IO.O
Strng="[V]itality"
Call IO.O
Graphics.Off=False
Endif
Strng="Action health rate option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "F"
Strng="Number of hits of fatigue(1-32767)?"
No.Input.Out="10"
Call IO.I
RoomRecord.HitPoints=Int(Val(Out2))
Strng="Room now hits for fatigue."
Call IO.O
Case "V"
Strng="Number of hits of vitality(1-32767)?"
No.Input.Out="10"
Call IO.I
RoomRecord.HitPoints=-Int(Val(Out2))
Strng="Room now hits for vitality."
Call IO.O
Case "Q"
Exit Do
End Select
Loop
Case "R"
Do
Graphics.Off=True
If TempC=False Then
Strng="[E]ncounter"
Call IO.O
Strng="[H]ealth"
Call IO.O
Graphics.Off=False
Endif
Strng="Action room rate option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "E"
Strng="Encounter rate(1-32767)?"
No.Input.Out="6"
Call IO.I
RoomRecord.EncounterRate=Int(Val(Out2))
Strng="New encounter rate now in effect."
Call IO.O
Case "H"
Strng="Health rate(1-32767)?"
No.Input.Out="6"
Call IO.I
RoomRecord.HealthRate=Int(Val(Out2))
Strng="Health rate now in effect."
Call IO.O
Case "Q"
Exit Do
End Select
Loop
Case "I"
Do
Graphics.Off=True
If TempC=False Then
Strng="[W]eapons"
Call IO.O
Strng="[S]hields"
Call IO.O
Strng="[A]rmor"
Call IO.O
Strng="[M]agic items"
Call IO.O
Graphics.Off=False
Endif
Strng="Action inventory option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "W"
RoomRecord.Inventory=1
Strng="Room now breaks weapons."
Call IO.O
Case "S"
RoomRecord.Inventory=2
Strng="Room now smashes shields."
Call IO.O
Case "A"
RoomRecord.Inventory=3
Strng="Room now wrecks armor."
Call IO.O
Case "M"
RoomRecord.Inventory=4
Strng="Room now drains magic items."
Call IO.O
Case "Q"
Exit Do
End Select
Loop
Case "F"
RoomRecord.Fumble=True
Strng="Room now fumbles."
Call IO.O
Case "T"
Temp3=Lof(5)/Len(RoomRecord)
Strng="Room number"+"(1-"+Mid$(Str$(Temp3),2)+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
Strng=Range$
If Temp>False And Temp<=Temp3 Then
RoomRecord.Teleport=Temp
Strng="Room now teleports."
Endif
Call IO.O
Case "W"
Strng="Rate for weapons to rust(# of action prompts)?"
No.Input.Out="6"
Call IO.I
Temp=Int(Val(Out2))
RoomRecord.RustRate=Temp
Strng="Room now has weapon rusting rate."
Call IO.O
Case "O"
Strng="Rate for monsters to steal treasure(# of action prompts)?"
No.Input.Out="6"
Call IO.I
Temp=Int(Val(Out2))
RoomRecord.StealRate=Temp
Strng="Room now has monster stealing rate."
Call IO.O
Case "C"
RoomRecord.SpellTrigger=False
RoomRecord.MonsterTrigger=False
RoomRecord.HealthRate=False
RoomRecord.EncounterRate=False
RoomRecord.HitPoints=False
RoomRecord.Inventory=False
RoomRecord.MonsterTalk=False
RoomRecord.Fumble=False
RoomRecord.Teleport=False
RoomRecord.Level=False
RoomRecord.Restrictions=False
RoomRecord.RustRate=False
RoomRecord.StealRate=False
Strng="Room cleared of actions."
Call IO.O
Case "N"
Temp3=Lof(5)/Len(RoomRecord)
Strng="Room number(1-"+Mid$(Str$(Temp3),2)+")?"
No.Input.Out="1"
Call IO.I
Put 5,Temp2,RoomRecord
Temp2=Int(Val(Out2))
If Temp2<1 Or Temp2>Temp3 Then
Strng=Range$
Call IO.O
Temp2=1
Endif
Get 5,Temp2,RoomRecord
Case "D"
Temp=False
Graphics.Off=True
If RoomRecord.MonsterTrigger Then
Get 7,RoomRecord.MonsterTrigger,MonsterRecord
Strng2=MonsterRecord.MonsterName
Strng2=Rtrim$(Strng2)
Strng="Monster trigger in effect for monster:"+_
Str$(RoomRecord.MonsterTrigger)+", "+Strng2+"."
Call IO.O
Temp=True
Endif
If RoomRecord.SpellTrigger Then
Get 4,RoomRecord.SpellTrigger,SpellRecord
Strng2=SpellRecord.SpellName
Strng2=Rtrim$(Strng2)
Strng="Spell trigger in effect for spell:"+_
Str$(RoomRecord.SpellTrigger)+", "+Strng2+"."
Call IO.O
Temp=True
Endif
If RoomRecord.MonsterTalk Then
Get 7,RoomRecord.MonsterTalk,MonsterRecord
Strng2=MonsterRecord.MonsterName
Strng2=Rtrim$(Strng2)
Strng="Monster talk trigger in effect for monster:"+_
Str$(RoomRecord.MonsterTalk)+", "+Strng2+"."
Call IO.O
Temp=True
Endif
If RoomRecord.Level>False Then
Strng="Highest level user must be (at least) to enter room:"+_
Str$(RoomRecord.Level)+"."
Call IO.O
Temp=True
Endif
If RoomRecord.Level<False Then
Strng="Lowest level user must be (at most) to enter room:"+_
Str$(Abs(RoomRecord.Level))+"."
Call IO.O
Temp=True
Endif
If RoomRecord.Restrictions>False Then
Strng="Restricted room directions:"
Call IO.O
Strng=Nul
If RoomRecord.Restrictions And 2^1 Then
Strng=Strng+"North, "
Endif
If RoomRecord.Restrictions And 2^2 Then
Strng=Strng+"East, "
Endif
If RoomRecord.Restrictions And 2^3 Then
Strng=Strng+"South, "
Endif
If RoomRecord.Restrictions And 2^4 Then
Strng=Strng+"West, "
Endif
If RoomRecord.Restrictions And 2^5 Then
Strng=Strng+"Out, "
Endif
If RoomRecord.Restrictions And 2^6 Then
Strng=Strng+"Up, "
Endif
If RoomRecord.Restrictions And 2^7 Then
Strng=Strng+"Down, "
Endif
If RoomRecord.Restrictions And 2^8 Then
Strng=Strng+"Northeast, "
Endif
If RoomRecord.Restrictions And 2^9 Then
Strng=Strng+"Southeast, "
Endif
If RoomRecord.Restrictions And 2^10 Then
Strng=Strng+"Southwest, "
Endif
If RoomRecord.Restrictions And 2^11 Then
Strng=Strng+"Northwest, "
Endif
If RoomRecord.Restrictions And 2^12 Then
Strng=Strng+"Go to portal, "
Endif
If Len(Strng) Then
Strng=Left$(Strng,Len(Strng)-2)
Call IO.O
Temp=True
Endif
Endif
If RoomRecord.HitPoints>False Then
Strng="Room hits for"+Str$(RoomRecord.HitPoints)+" fatigue."
Call IO.O
Temp=True
Endif
If RoomRecord.HitPoints<False Then
Strng="Room hits for"+Str$(Abs(RoomRecord.HitPoints))+" vitality."
Call IO.O
Temp=True
Endif
If RoomRecord.EncounterRate Then
Strng="Encounter rate:"+Str$(RoomRecord.EncounterRate)+"."
Call IO.O
Temp=True
Endif
If RoomRecord.HealthRate Then
Strng="Health rate:"+Str$(RoomRecord.HealthRate)+"."
Call IO.O
Temp=True
Endif
Select Case RoomRecord.Inventory
Case 1
Strng="Room breaks weapons."
Call IO.O
Temp=True
Case 2
Strng="Room smashes shields."
Call IO.O
Temp=True
Case 3
Strng="Room wrecks armor."
Call IO.O
Temp=True
Case 4
Strng="Room drains magic items."
Call IO.O
Temp=True
End Select
If RoomRecord.Fumble Then
Strng="Room fumbles."
Call IO.O
Temp=True
Endif
If RoomRecord.Teleport Then
Strng="Room teleports to room"+Str$(RoomRecord.Teleport)+"."
Call IO.O
Tmp=True
Endif
If RoomRecord.RustRate Then
Strng="Room has weapon rusting rate of"+_
Str$(RoomRecord.RustRate)+" action prompts."
Call IO.O
Temp=True
Endif
If RoomRecord.StealRate Then
Strng="Room has monster stealing rate of"+_
Str$(RoomRecord.StealRate)+" action prompts."
Call IO.O
Temp=True
Endif
If Temp=False Then
Strng="Room has no triggers or results."
Call IO.O
Endif
Graphics.Off=False
Call More.Prompt
Case "Q"
Put 5,Temp2,RoomRecord
Exit Do
End Select
Loop
10071
Exit Sub
10072
Resume 10071
End Sub
Sub Edit.Monster
On Local Error Goto 10082
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd"
Call IO.O
Strng="[C]hange"
Call IO.O
Strng="[L]ist"
Call IO.O
Strng="[S]earch"
Call IO.O
Strng="[M]onsterclass"
Call IO.O
Strng="[T]alk responses"
Call IO.O
Graphics.Off=False
Endif
Strng="Monster edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Monster
Case "C"
Call Find.Monster
If Temp Then
Temp4=Temp
Call Change.Monster
Endif
Case "L"
Call List.Monster
Case "S"
Call Search.Monsters
Case "M"
Call Edit.Monclass
Case "T"
Call Edit.MonsterTalk
Case "Q"
Exit Sub
End Select
Loop
10081
Exit Sub
10082
Resume 10081
End Sub
Sub Add.Monster
On Local Error Goto 10092
Temp4=Lof(7)/Len(MonsterRecord)+1
MonsterRecord.MonsterName=Nul
MonsterRecord.PluralName=Nul
For Temp6=1 To 5
MonsterRecord.Treasure(Temp6)=False
Next
MonsterRecord.Experience=False
MonsterRecord.NumberAppearing=False
MonsterRecord.Level=False
MonsterRecord.Hits=False
MonsterRecord.Poison=False
MonsterRecord.LevelDrain=False
MonsterRecord.Spell=False
MonsterRecord.Block=False
MonsterRecord.Prevent=False
MonsterRecord.Follow=False
MonsterRecord.Magic=False
MonsterRecord.Jail=False
MonsterRecord.Teleport=False
MonsterRecord.FollowPercent=False
MonsterRecord.BlockPercent=False
MonsterRecord.PreventPercent=False
MonsterRecord.SpellPercent=False
MonsterRecord.PoisonPercent=False
MonsterRecord.DrainPercent=False
MonsterRecord.Rate=False
MonsterRecord.RatePercent=False
MonsterRecord.Permanent=False
For Temp6=1 To 5
MonsterRecord.Talk(Temp6)=False
Next
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
MonsterRecord.Equation=False
MonsterRecord.MonsterEquate=Nul
Put 7,Temp4,MonsterRecord
Call Change.Monster
10091
Exit Sub
10092
Resume 10091
End Sub
Sub List.Monster
On Local Error Goto 10102
Temp3=Lof(7)/Len(MonsterRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp5=Temp To Temp2
Get 7,Temp5,MonsterRecord
Call Display.Monster(False)
Graphics.Off=False
Call More.Prompt
If No Then
Exit For
Endif
Next
10101
Exit Sub
10102
Resume 10101
End Sub
Sub Display.Monster(TempX)
On Local Error Goto 10112
If TempX Then
If TempC Then
Exit Sub
Endif
Endif
Graphics.Off=True
Strng="Monster number"+Str$(Temp5)+":"
Call IO.O
If TempX Then
Strng="[A]"
Endif
Strng=Strng+"Monster name: "+Rtrim$(MonsterRecord.MonsterName)
Call IO.O
If TempX Then
Strng="[B]"
Endif
Strng=Strng+"Plural of monster name: "+MonsterRecord.PluralName
Call IO.O
If TempX Then
Strng="[C]"
Endif
Strng=Strng+"Monster level:"+Str$(MonsterRecord.Level)
Call IO.O
If TempX Then
Strng="[D]"
Endif
Strng=Strng+"Magical monster: "
If MonsterRecord.Magic Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[E]"
Endif
Strng=Strng+"Hit points:"+Str$(MonsterRecord.Hits)
Call IO.O
If TempX Then
Strng="[F]"
Endif
Strng=Strng+"Experience points:"+Str$(MonsterRecord.Experience)
Call IO.O
If TempX Then
Strng="[G]"
Endif
Strng=Strng+"Number appearing:"+Str$(MonsterRecord.NumberAppearing)
Call IO.O
If TempX Then
Strng="[H]"
Endif
Strng=Strng+"Poisonous monster: "
If MonsterRecord.Poison Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.PoisonPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[I]"
Endif
Strng=Strng+"Level draining monster: "
If MonsterRecord.LevelDrain Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.DrainPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[J]"
Endif
Strng=Strng+"Monster blocks exits: "
If MonsterRecord.Block Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.BlockPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[K]"
Endif
Strng=Strng+"Monster prevents treasure take: "
If MonsterRecord.Prevent Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.PreventPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[L]"
Endif
Strng=Strng+"Monster follows user: "
If MonsterRecord.Follow Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.FollowPercent),2)+" percent) "+_
"("+Mid$(Str$(MonsterRecord.Teleport),2)+"% teleport)"
Call IO.O
If TempX Then
Strng="[M]"
Endif
Strng=Strng+"Monster casts spells: "
If MonsterRecord.Spell=False Then
Strng=Strng+"No"
Else
Get 4,MonsterRecord.Spell,SpellRecord
Strng=Strng+"Yes, "+Rtrim$(SpellRecord.SpellName)
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.SpellPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[N]"
Endif
Strng=Strng+"Monster jails attacker: "
If MonsterRecord.Jail Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[O]"
Endif
Strng=Strng+"Encounter rate:"+Str$(MonsterRecord.Rate)+_
" ("+Mid$(Str$(MonsterRecord.RatePercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[P]"
Endif
Strng=Strng+"Permanent monster: "
If MonsterRecord.Permanent Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[R]"
Endif
Strng=Strng+"Monster uses psionics: "
If MonsterRecord.Psionic=False Then
Strng=Strng+"No"
Else
Get 4,MonsterRecord.PsionicSpell
Strng=Strng+"Yes, "+SpellRecord.SpellName
Endif
Call IO.O
If TempX Then
Strng="[S]"
Endif
Strng=Strng+"Carries treasure:"
Call IO.O
For Temp6=1 To 5
Temp8=MonsterRecord.Treasure(Temp6)
If Temp8>False Then
Get 8,Temp8,TreasureRecord
Strng=TreasureRecord.TreasureName
Call IO.O
Endif
Next
If TempX Then
Strng="[T]"
Endif
Strng=Strng+"Monster has attack equation: "
If MonsterRecord.Equation Then
Strng=Strng+"Yes: "
Out2=MonsterRecord.MonsterEquate
Out2=Rtrim$(Out2)
Strng=Strng+Out2
Else
Strng=Strng+"No"
Endif
Call IO.O
10111
Exit Sub
10112
Resume 10111
End Sub
Sub Change.Monster
On Local Error Goto 10122
Get 7,Temp4,MonsterRecord
Do
Temp5=Temp4
Call Display.Monster(True)
Graphics.Off=False
Strng="Monster change option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Monster name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
MonsterRecord.MonsterName=Out2
Case "B"
Strng="Plural of name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
MonsterRecord.PluralName=Out2
Case "C"
Strng="Monster level(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Level=Int(Val(Out2))
Case "D"
Strng="Magical monster(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Magic=False
If Yes Then
MonsterRecord.Magic=True
Endif
Case "E"
Strng="Hit points(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Hits=Int(Val(Out2))
Case "F"
Strng="Experience points(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Experience=Int(Val(Out2))
Case "G"
Strng="Number appearing(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.NumberAppearing=Int(Val(Out2))
Case "H"
Strng="Poisonous monster(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Poison=False
MonsterRecord.PoisonPercent=False
If Yes Then
MonsterRecord.Poison=True
Strng="Percent chance monster will poison(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.PoisonPercent=Int(Val(Out2))
Endif
Case "I"
Strng="Level draining monster(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.LevelDrain=False
MonsterRecord.DrainPercent=False
If Yes Then
MonsterRecord.LevelDrain=True
Strng="Percent chance monster will level drain(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.DrainPercent=Int(Val(Out2))
Endif
Case "J"
Strng="Monster blocks exits(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Block=False
MonsterRecord.BlockPercent=False
If Yes Then
MonsterRecord.Block=True
Strng="Percent chance monster will block exits(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.BlockPercent=Int(Val(Out2))
Endif
Case "K"
Strng="Monster prevents user from taking treasure(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Prevent=False
MonsterRecord.PreventPercent=False
If Yes Then
MonsterRecord.Prevent=True
Strng="Percent chance monster prevents user taking treasure(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.PreventPercent=Int(Val(Out2))
Endif
Case "L"
Strng="Monster follows user(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Follow=False
MonsterRecord.FollowPercent=False
MonsterRecord.Teleport=False
If Yes Then
MonsterRecord.Follow=True
Strng="Percent chance monster will follow user(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.FollowPercent=Int(Val(Out2))
Strng="Percent chance monster will teleport with user(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.Teleport=Int(Val(Out2))
Endif
Case "M"
Strng="Monster casts spells(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Spell=False
MonsterRecord.SpellPercent=False
If Yes Then
Call Find.Spell
If Temp Then
MonsterRecord.Spell=Temp
Strng="Percent chance monster casts spell(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.SpellPercent=Int(Val(Out2))
Endif
Endif
Case "N"
Strng="Monster jails attacker(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Jail=False
If Yes Then
MonsterRecord.Jail=True
Endif
Case "O"
Strng="Monster encounter rate(# of action prompts)?"
No.Input.Out="6"
Call IO.I
MonsterRecord.Rate=Int(Val(Out2))
Strng="Monster encounter percent(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.RatePercent=Int(Val(Out2))
Case "P"
Strng="Monster is a permanent monster(y/n)?"
Line.Length=TempD
No.Input.Out="N"
Call IO.I
MonsterRecord.Permanent=False
If Yes Then
MonsterRecord.Permanent=True
Endif
Case "R"
Strng="Monster uses psionics(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
If Yes Then
Strng="Psionic spell?"
Call Find.Spell
If Temp Then
If SpellRecord.Psionic=False Then
Strng="That spell is not a psionic spell!"
Call IO.O
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
Else
MonsterRecord.Psionic=True
MonsterRecord.PsionicSpell=Temp
Endif
Endif
Endif
Case "S"
Strng="Enter five treasure names:"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
Graphics.Off=True
For Temp2=1 To 5
Call Find.Treasure
MonsterRecord.Treasure(Temp2)=Temp5
Next
Case "T"
Line.Length=TempD
No.Input.Out="Y"
Strng="Monster has attack equation(y/n)?"
Call IO.I
MonsterRecord.Equation=False
MonsterRecord.MonsterEquate=Nul
If Yes Then
Strng="Enter monster attack equation:"
Call IO.I
MonsterRecord.Equation=True
MonsterRecord.MonsterEquate=Ucase$(Out2)
Endif
Case "Q"
Exit Do
End Select
Loop
Put 7,Temp4,MonsterRecord
Strng="Monster '"+Rtrim$(MonsterRecord.MonsterName)+"' changed."
Call IO.O
10121
Exit Sub
10122
Resume 10121
End Sub
Sub Edit.Monclass
On Local Error Goto 10132
If Lof(10)=False Then
Call Add.Monclass
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd class"
Call IO.O
Strng="[C]hange class"
Call IO.O
Strng="[L]ist class"
Call IO.O
Graphics.Off=False
Endif
Strng="Monster class edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Monclass
Case "C"
Call Find.Monclass
If Temp3 Then
Call Change.Monclass
Endif
Case "L"
Call List.Monclass
Case "Q"
Exit Do
End Select
Loop
10131
Exit Sub
10132
Resume 10131
End Sub
Sub Add.Monclass
On Local Error Goto 10142
Temp3=Lof(10)/Len(MonclassRecord)+1
For Temp6=1 To 10
MonclassRecord.Monsters(Temp6)=False
Next
Put 10,Temp3,MonclassRecord
Call Change.Monclass
10141
Exit Sub
10142
Resume 10141
End Sub
Sub Find.Monclass
On Local Error Goto 10152
Temp3=Lof(10)/Len(MonclassRecord)
Strng="Monster class(0-"+Mid$(Str$(Temp3),2)+")?"
No.Input.Out="1"
Call IO.I
Temp3=Int(Val(Out2))
If Temp3<1 Or Temp3>Temp3 Then
Strng=Range$
Call IO.O
Temp3=False
Endif
10151
Exit Sub
10152
Resume 10151
End Sub
Sub Change.Monclass
On Local Error Goto 10162
Strng="Enter ten monster names:"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
Graphics.Off=True
For Temp2=1 To 10
Call Find.Monster
MonclassRecord.Monsters(Temp2)=Temp
Next
Put 10,Temp3,MonclassRecord
Strng="Monclass number"+Str$(Temp3)+" created."
Call IO.O
10161
Exit Sub
10162
Resume 10161
End Sub
Sub List.Monclass
On Local Error Goto 10172
Temp3=Lof(10)/Len(MonclassRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp6=Temp To Temp2
Get 10,Temp6,MonclassRecord
Graphics.Off=True
Strng="Monster class number"+Str$(Temp6)+":"
Call IO.O
For Temp3=1 To 10
Temp5=MonclassRecord.Monsters(Temp3)
If Temp5 Then
Get 7,Temp5,MonsterRecord
Strng="Monster number"+Str$(Temp3)+":"+MonsterRecord.MonsterName
Call IO.O
Endif
Next
Call More.Prompt
If No Then
Exit For
Endif
Next
10171
Exit Sub
10172
Resume 10171
End Sub
Sub Edit.MonsterTalk
On Local Error Goto 10182
If Lof(11)=False Then
MonsterTalkRecord.TalkMessage=Nul
Put 11,1,MonsterTalkRecord
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd response"
Call IO.O
Strng="[C]hange response"
Call IO.O
Strng="[L]ist response"
Call IO.O
Strng="[M]onster response"
Call IO.O
Graphics.Off=False
Endif
Strng="Monster talk edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Enter response(80 characters):"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
Strng="?"
Call IO.I
Temp=Lof(11)/Len(MonsterTalkRecord)+1
MonsterTalkRecord.TalkMessage=Out2
Put 11,Temp,MonsterTalkRecord
Case "C"
Temp3=Lof(11)/Len(MonsterTalkRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="Response number to change(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Val(Out2)
Strng=Range$
If Temp>False And Temp<=Temp3 Then
Temp$=Mid$(Str$(Temp),2)
Strng="Enter response number"+Temp$+":"
Call IO.O
Strng="?"
Call IO.I
MonsterTalkRecord.TalkMessage=Out2
Put 11,Temp,MonsterTalkRecord
Strng="Response number "+Temp$+" changed."
Endif
Call IO.O
Case "L"
Temp5=False
For Temp=1 To Lof(11)/Len(MonsterTalkRecord)
Get 11,Temp,MonsterTalkRecord
Graphics.Off=True
Strng="Response number"+Str$(Temp)+":"
Call IO.O
Strng=Rtrim$(MonsterTalkRecord.TalkMessage)
Call IO.O
Temp5=Temp5+2
If Temp5>=22 Then
Temp5=False
Call More.Prompt
If No Then
Exit For
Endif
Endif
Next
If Temp5>False Then
Call More.Prompt
Endif
Case "M"
Call Find.Monster
If Temp Then
Get 7,Temp,MonsterRecord
Strng="Enter five response numbers:"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
For Temp5=1 To 5
Temp$=Mid$(Str$(Temp5),2)
Strng="Enter response number "+Temp$+":"
Call IO.O
Strng="?"
Call IO.I
Temp2=Int(Val(Out2))
Strng=Range$
If Temp2>False And Temp2<=Lof(11)/Len(MonsterTalkRecord) Then
MonsterRecord.Talk(Temp5)=Temp2
Strng="Response number "+Temp$+" added."
Endif
Call IO.O
Next
Put 7,Temp,MonsterRecord
Endif
Case "Q"
Exit Do
End Select
Loop
10181
Exit Sub
10182
Resume 10181
End Sub
Sub Edit.Spell
On Local Error Goto 10192
If Lof(4)=False Then
Call Add.Spell
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd"
Call IO.O
Strng="[C]hange"
Call IO.O
Strng="[L]ist"
Call IO.O
Strng="[S]earch"
Call IO.O
Graphics.Off=False
Endif
Strng="Spell edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Spell
Case "C"
Call Find.Spell
If Temp Then
Temp4=Temp
Call Change.Spell
Endif
Case "L"
Call List.Spell
Case "S"
Call Search.Spells
Case "Q"
Exit Sub
End Select
Loop
10191
Exit Sub
10192
Resume 10191
End Sub
Sub Add.Spell
On Local Error Goto 10202
Temp4=Lof(4)/Len(SpellRecord)+1
SpellRecord.SpellName=Nul
SpellRecord.Chant=Nul
SpellRecord.Desc=Nul
SpellRecord.Level=False
SpellRecord.SpellType=False
SpellRecord.Teleport=False
SpellRecord.ClassType=False
SpellRecord.Psionic=False
SpellRecord.PsionicMode=False
For Temp6=1 To 5
SpellRecord.Ingred(Temp6)=False
Next
SpellRecord.SpellFlag=False
SpellRecord.Equation=False
SpellRecord.SpellEquate=Nul
Put 4,Temp4,SpellRecord
Call Change.Spell
10201
Exit Sub
10202
Resume 10201
End Sub
Sub List.Spell
On Local Error Goto 10212
Temp3=Lof(4)/Len(SpellRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp5=Temp To Temp2
Get 4,Temp5,SpellRecord
Call Display.Spell(False)
Graphics.Off=False
Call More.Prompt
If No Then
Exit For
Endif
Next
10211
Exit Sub
10212
Resume 10211
End Sub
Sub Display.Spell(TempX)
On Local Error Goto 10222
If TempX Then
If TempC Then
Exit Sub
Endif
Endif
Graphics.Off=True
Strng="Spell number"+Str$(Temp5)+":"
Call IO.O
If TempX Then
Strng="[A]"
Endif
Strng=Strng+"Spell name: "+Rtrim$(SpellRecord.SpellName)
Call IO.O
If TempX Then
Strng="[B]"
Endif
Strng=Strng+"Spell chant: "+Rtrim$(SpellRecord.Chant)
Call IO.O
If TempX Then
Strng="[C]"
Endif
Strng=Strng+"Spell cast description: "
Call IO.O
Strng=Rtrim$(SpellRecord.Desc)
Call IO.O
If TempX Then
Strng="[D]"
Endif
Strng=Strng+"Spell level:"+Str$(SpellRecord.Level)
Call IO.O
If TempX Then
Strng="[E]"
Endif
Strng=Strng+"Spell type: "
Select Case SpellRecord.SpellType
Case 1
Out2="Enchant"
Case 2
Out2="Offense"
Case 3
Out2="Bless"
Case 4
Out2="Wish"
Case 5
Out2="Poison"
Case 6
Out2="Vigor"
Case 7
Out2="Heal"
Case 8
Out2="Curepoison"
Case 9
Out2="Level Drain"
Case 10
Out2="Teleport to Room"+Str$(SpellRecord.Teleport)
Case 11
Out2="Befuddle"
Case 12
Out2="Turn Undead"
Case 13
Out2="Pass Door"
Case 14
Out2="Conjure"
Case 15
Out2="Psionic"
Case 16
Out2="Detect Lock"
Case 17
Out2="Detect Evil"
Case 18
Out2="Detect Trap"
Case 19
Out2="Intoxicate"
Case 20
Out2="Set Trap"
Case 21
Out2="Hide"
Case 22
Out2="Search"
Case 23
Out2="Invisibility"
Case 24
Out2="Identify"
Case 25
Out2="Enlighten"
Case 26
Out2="Illuminate"
Case 27
Out2="Psyche"
Case 28
Out2="Telepathy"
Case Else
Out2="<none>"
End Select
Strng=Strng+Out2
Call IO.O
If TempX Then
Strng="[F]"
Endif
Strng=Strng+"Spell is psionic spell: "
If SpellRecord.Psionic=False Then
Strng=Strng+"No"
Else
Strng=Strng+"Yes, "
Select Case SpellRecord.PsionicMode
Case 1
Strng=Strng+"Attack"
Case 2
Strng=Strng+"Defense"
Case Else
Strng=Strng+"<none>"
End Select
Endif
Call IO.O
If TempX Then
Strng="[G]"
Endif
Strng=Strng+"Character classes which can cast this spell:"
Call IO.O
TempA=False
For Temp9=1 To 8
If SpellRecord.ClassType And 2^Temp9 Then
Strng2=Class.Name(Temp9)
Strng2=Rtrim$(Strng2)
Mid$(Strng2,1,1)=Ucase$(Mid$(Strng2,1,1))
Strng=Strng+Strng2+", "
TempA=True
Endif
Next
If TempA Then
Strng=Left$(Strng,Len(Strng)-2)+"."
Else
Strng="<none>"
Endif
Call IO.O
If TempX Then
Strng="[H]"
Endif
Strng=Strng+"Spell ingredients:"
Call IO.O
TempA=False
For Temp9=1 To 5
TempB=SpellRecord.Ingred(Temp9)
If TempB>=1 And TempB<=Lof(8)/Len(TreasureRecord) Then
Get 8,TempB,TreasureRecord
Strng2=TreasureRecord.TreasureName
Strng2=Rtrim$(Strng2)
Strng2=Lcase$(Strng2)
Mid$(Strng2,1,1)=Ucase$(Mid$(Strng2,1,1))
Strng=Strng+Strng2+", "
TempA=True
Endif
Next
If TempA Then
Strng=Left$(Strng,Len(Strng)-2)+"."
Else
Strng="<none>"
Endif
Call IO.O
If TempX Then
Strng="[I]"
Endif
Strng=Strng+"Spell casting type which requires ingredients:"
Call IO.O
TempA=False
If SpellRecord.SpellFlag And Use.Spell.Type Then
Strng="use command, "
TempA=True
Endif
If SpellRecord.SpellFlag And Scroll.Spell.Type Then
Strng=Strng+"read scroll, "
TempA=True
Endif
If SpellRecord.SpellFlag And Cast.Spell.Type Then
Strng=Strng+"cast spell, "
TempA=True
Endif
If TempA Then
Strng=Left$(Strng,Len(Strng)-2)+"."
Else
Strng="<none>"
Endif
Call IO.O
If TempX Then
Strng="[J]"
Endif
Strng=Strng+"Spell has offense equation: "
If SpellRecord.Equation Then
Strng=Strng+"Yes"
Call IO.O
Strng=SpellRecord.SpellEquate
Strng=Rtrim$(Strng)
Strng="Equation: "+Strng
Call IO.O
Else
Strng=Strng+"No"
Call IO.O
Endif
10221
Exit Sub
10222
Resume 10221
End Sub
Sub Change.Spell
On Local Error Goto 10232
Get 4,Temp4,SpellRecord
Do
Temp5=Temp4
Call Display.Spell(True)
Graphics.Off=False
Strng="Spell change option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Spell name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
SpellRecord.SpellName=Out2
Case "B"
Strng="Spell chant(80 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Ucase$(Out2)
SpellRecord.Chant=Out2
Case "C"
Strng="Spell cast description(80 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
SpellRecord.Desc=Out2
Case "D"
Strng="Spell level(1-32767)?"
No.Input.Out="1"
Call IO.I
SpellRecord.Level=Int(Val(Out2))
Case "E"
Call Spell.Types
Strng="Spell type option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Out2=Ucase$(Out2)
Temp5=Instr("ABCDEFGHIJKLMNOPRSTUVWXYZ123Q",Out2)
If Temp5 Then
If Temp5<=28 Then
SpellRecord.SpellType=Temp5
If Temp5=10 Then
Strng="Room it teleports to(1-"+_
Mid$(Str$(Lof(5)/Len(RoomRecord)),2)+")?"
No.Input.Out="1"
Call IO.I
SpellRecord.Teleport=Int(Val(Out2))
Endif
Endif
Endif
Case "F"
Strng="Spell is psionic spell(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
SpellRecord.Psionic=False
SpellRecord.PsionicMode=False
If Yes Then
Do
SpellRecord.Psionic=True
Graphics.Off=True
If TempC=False Then
Strng="[A]ttack mode"
Call IO.O
Strng="[D]efense mode"
Call IO.O
Graphics.Off=False
Endif
Strng="Spell psionic option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
SpellRecord.PsionicMode=False
Select Case Ucase$(Out2)
Case "A"
SpellRecord.PsionicMode=1
Case "D"
SpellRecord.PsionicMode=2
Case "Q"
Exit Do
End Select
Loop
Endif
Case "G"
Do
Graphics.Off=True
If TempC=False Then
For Temp5=1 To 8
Strng="["+Chr$(64+Temp5)+"]"+Rtrim$(Class.Name(Temp5))
Call IO.O
Next
Strng="[N]one"
Call IO.O
Strng="[X]All"
Call IO.O
Graphics.Off=False
Endif
Strng="Spell class option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Out2=Ucase$(Out2)
Select Case Out2
Case "A" To "H"
Temp5=Instr("ABCDEFGH",Out2)
SpellRecord.ClassType=SpellRecord.ClassType Or 2^Temp5
Case "N"
SpellRecord.ClassType=False
Case "X"
For Temp5=1 To 8
SpellRecord.ClassType=SpellRecord.ClassType Or 2^Temp5
Next
Case "Q"
Exit Do
End Select
Loop
Case "H"
Strng="Enter five treasure items for spell ingredients:"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
Graphics.Off=True
For Temp9=1 To 5
Call Find.Treasure
SpellRecord.Ingred(Temp9)=Temp5
Next
Graphics.Off=False
Case "I"
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]use command"
Call IO.O
Strng="[B]read scroll"
Call IO.O
Strng="[C]cast spell"
Call IO.O
Strng="[N]one"
Call IO.O
Strng="[X]All"
Call IO.O
Graphics.Off=False
Endif
Strng="Spell ingredient option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Use.Spell.Type
Case "B"
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Scroll.Spell.Type
Case "C"
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Cast.Spell.Type
Case "N"
SpellRecord.SpellFlag=False
Case "X"
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Use.Spell.Type
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Scroll.Spell.Type
SpellRecord.SpellFlag=SpellRecord.SpellFlag Or Cast.Spell.Type
Case "Q"
Exit Do
End Select
Loop
Case "J"
Line.Length=TempD
No.Input.Out="Y"
Strng="Spell has offense equation(y/n)?"
Call IO.I
SpellRecord.Equation=False
SpellRecord.SpellEquate=Nul
If Yes Then
Strng="Enter spell equation:"
Call IO.I
SpellRecord.Equation=True
SpellRecord.SpellEquate=Ucase$(Out2)
Endif
Case "Q"
Exit Do
End Select
Loop
Put 4,Temp4,SpellRecord
Strng="Spell '"+Rtrim$(SpellRecord.SpellName)+"' changed."
Call IO.O
10231
Exit Sub
10232
Resume 10231
End Sub
Sub Spell.Types
On Local Error Goto 10242
If TempC Then
Exit Sub
Endif
Graphics.Off=True
Strng="[A]enchant [O]psionic"
Call IO.O
Strng="[B]offense [P]detect lock"
Call IO.O
Strng="[C]bless [R]detect evil"
Call IO.O
Strng="[D]wish [S]detect trap"
Call IO.O
Strng="[E]poison [T]intoxicate"
Call IO.O
Strng="[F]vigor [U]set trap"
Call IO.O
Strng="[G]heal [V]hide"
Call IO.O
Strng="[H]curepoison [W]search"
Call IO.O
Strng="[I]level drain [X]invisibility"
Call IO.O
Strng="[J]teleport [Y]identify"
Call IO.O
Strng="[K]befuddle [Z]enlighten"
Call IO.O
Strng="[L]turn undead [1]illuminate"
Call IO.O
Strng="[M]pass door [2]psyche"
Call IO.O
Strng="[N]conjure [3]telepathy"
Call IO.O
Graphics.Off=False
10241
Exit Sub
10242
Resume 10241
End Sub
Sub Edit.Treasure
On Local Error Goto 10252
If Lof(8)=False Then
Call Add.Treasure
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd"
Call IO.O
Strng="[C]hange"
Call IO.O
Strng="[L]ist"
Call IO.O
Strng="[S]earch"
Call IO.O
Graphics.Off=False
Endif
Strng="Treasure edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Treasure
Case "C"
Call Find.Treasure
If Temp5 Then
Temp4=Temp5
Call Change.Treasure
Endif
Case "L"
Call List.Treasure
Case "S"
Call Search.Treasure
Case "Q"
Exit Sub
End Select
Loop
10251
Exit Sub
10252
Resume 10251
End Sub
Sub Add.Treasure
On Local Error Goto 10262
Temp4=Lof(8)/Len(TreasureRecord)+1
TreasureRecord.Keyed=False
TreasureRecord.Weight=False
TreasureRecord.Gold=False
TreasureRecord.Plus=False
TreasureRecord.Charges=False
TreasureRecord.Type=False
TreasureRecord.Loadable=False
TreasureRecord.Ammunition=False
TreasureRecord.AmmoLoads=False
TreasureRecord.Recep=False
TreasureRecord.Potion=False
TreasureRecord.Locked=False
TreasureRecord.Closed=False
TreasureRecord.Invisible=False
TreasureRecord.Proficiency=False
TreasureRecord.TreasureName=Nul
TreasureRecord.ShortName=Nul
TreasureRecord.RecepFileName=Nul
TreasureRecord.RecepMax=False
TreasureRecord.Spell=False
TreasureRecord.Scroll=False
TreasureRecord.RingType=False
TreasureRecord.RingSpell=False
TreasureRecord.Edible=False
TreasureRecord.Rustable=False
TreasureRecord.RustPercent=False
TreasureRecord.Stealable=False
TreasureRecord.StealPercent=False
TreasureRecord.Launchable=False
TreasureRecord.LaunchLoads=False
TreasureRecord.LaunchAmmo=False
TreasureRecord.Movable=False
Put 8,Temp4,TreasureRecord
Call Change.Treasure
10261
Exit Sub
10262
Resume 10261
End Sub
Sub List.Treasure
On Local Error Goto 10272
Temp3=Lof(8)/Len(TreasureRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp5=Temp To Temp2
Get 8,Temp5,TreasureRecord
Call Display.Treasure(False)
Graphics.Off=False
Call More.Prompt
If No Then
Exit For
Endif
Next
10271
Exit Sub
10272
Resume 10271
End Sub
Sub Change.Treasure
On Local Error Goto 10282
Get 8,Temp4,TreasureRecord
Do
Temp5=Temp4
Call Display.Treasure(True)
Graphics.Off=False
Strng="Treasure change option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Treasure name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
TreasureRecord.TreasureName=Out2
Case "B"
Strng="Treasure identifier(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Ucase$(Out2)
TreasureRecord.ShortName=Out2
Case "C"
Strng="Weight(1-32767)?"
No.Input.Out="1"
Call IO.I
TreasureRecord.Weight=Int(Val(Out2))
Case "D"
Do
Graphics.Off=True
If TempC=False Then
Strng="[W]eapon"
Call IO.O
Strng="[S]hield"
Call IO.O
Strng="[A]rmor"
Call IO.O
Strng="[T]reasure"
Call IO.O
Graphics.Off=False
Endif
Strng="Treasure type option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "W"
TreasureRecord.Type=False
If TreasureRecord.Plus=False Then
TreasureRecord.Plus=1
Endif
Case "S"
TreasureRecord.Type=True
Case "A"
TreasureRecord.Type=1
Case "T"
TreasureRecord.Plus=False
TreasureRecord.Charges=False
TreasureRecord.Type=False
Case "Q"
Exit Do
End Select
Loop
Case "E"
Strng="Charges(1-32767)?"
No.Input.Out="1"
Call IO.I
TreasureRecord.Charges=Int(Val(Out2))
Case "F"
Strng="Treasure is coins(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Coin=False
If Yes Then
TreasureRecord.Coin=True
Endif
Case "G"
Strng="Treasure is scroll(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Scroll=False
If Yes Then
TreasureRecord.Scroll=True
Endif
Case "H"
Strng="Ammunition(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Ammunition=False
If Yes Then
TreasureRecord.Ammunition=True
Endif
Case "I"
Strng="Receptacle is locked(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Locked=False
TreasureRecord.Closed=False
If Yes Then
TreasureRecord.Locked=1
TreasureRecord.Closed=1
Endif
Case "J"
Strng="Treasure is edible(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Edible=False
If Yes Then
TreasureRecord.Edible=True
Endif
Case "K"
Strng="Treasure can rust(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Rustable=False
TreasureRecord.RustPercent=False
If Yes Then
Strng="Percent chance weapon will rust during room rust rate(1-100)?"
No.Input.Out="50"
Call IO.I
Temp=Int(Val(Out2))
If Temp>=1 And Temp<=100 Then
TreasureRecord.Rustable=True
TreasureRecord.RustPercent=Temp
Else
TreasureRecord.Rustable=False
TreasureRecord.RustPercent=False
Endif
Endif
Case "L"
Strng="Treasure key number(1-32767)?"
No.Input.Out="1"
Call IO.I
TreasureRecord.Keyed=Int(Val(Out2))
Case "O"
Strng="Treasure launchs from devices(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.LaunchAmmo=False
If Yes Then
TreasureRecord.LaunchAmmo=True
Endif
Case "R"
Strng="Treasure is magical(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Spell=False
If Yes Then
Call Find.Spell
If Temp Then
TreasureRecord.Spell=Temp
Endif
Endif
Case "S"
Strng="Treasure is ring(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.RingType=False
TreasureRecord.RingSpell=False
If Yes Then
Do
Graphics.Off=True
If TempC=False Then
Strng="[P]oison"
Call IO.O
Strng="[L]evel Drain"
Call IO.O
Strng="[S]pell"
Call IO.O
Strng="[G]eneric spell"
Call IO.O
Graphics.Off=False
Endif
Strng="Treasure ring option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "P"
TreasureRecord.RingSpell=False
TreasureRecord.RingType=1
Case "L"
TreasureRecord.RingSpell=False
TreasureRecord.RingType=2
Case "S"
Call Find.Spell
If Temp Then
TreasureRecord.RingSpell=Temp
TreasureRecord.RingType=3
Endif
Case "G"
TreasureRecord.RingSpell=True
TreasureRecord.RingType=3
Case "Q"
Exit Do
End Select
Loop
Endif
Case "T"
Strng="Value(1-32767)?"
No.Input.Out="1"
Call IO.I
TreasureRecord.Gold=Int(Val(Out2))
Case "U"
Strng="Hit plus(1-32767)?"
No.Input.Out="1"
Call IO.I
TreasureRecord.Plus=Int(Val(Out2))
Case "V"
Do
Graphics.Off=True
If TempC=False Then
Strng="[B]lunt"
Call IO.O
Strng="[P]ole"
Call IO.O
Strng="[S]harp"
Call IO.O
Strng="[T]hrusting"
Call IO.O
Strng="[N]one"
Call IO.O
Graphics.Off=False
Endif
Strng="Treasure weapon class option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "B"
TreasureRecord.Proficiency=1
Case "P"
TreasureRecord.Proficiency=2
Case "S"
TreasureRecord.Proficiency=3
Case "T"
TreasureRecord.Proficiency=4
Case "N"
TreasureRecord.Proficiency=False
Case "Q"
Exit Do
End Select
Loop
Case "W"
Strng="Treasure is potion(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Potion=False
If Yes Then
TreasureRecord.Potion=True
Endif
Case "X"
Strng="Treasure is invisible(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Invisible=False
If Yes Then
TreasureRecord.Invisible=True
Endif
Case "Y"
Strng="Treasure is a receptacle(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Recep=False
If Yes Then
TreasureRecord.Recep=True
Endif
Case "Z"
Strng="Maximum objects in receptacle(1-32767)?"
No.Input.Out="10"
Call IO.I
TreasureRecord.RecepMax=Int(Val(Out2))
Case "1"
Strng="Receptacle filename(8 letter DOS)?"
No.Input.Out="CONTAIN"
Call IO.I
Out2=Ucase$(Out2)
TreasureRecord.RecepFileName=Out2
Case "2"
Strng="Treasure can be stolen(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Stealable=False
TreasureRecord.StealPercent=False
If Yes Then
Strng="Percent chance treasure stolen during room steal rate(1-100)?"
No.Input.Out="50"
Call IO.I
Temp=Int(Val(Out2))
If Temp>=1 And Temp<=100 Then
TreasureRecord.Stealable=True
TreasureRecord.StealPercent=Temp
Else
TreasureRecord.Stealable=False
TreasureRecord.StealPercent=False
Endif
Endif
Case "3"
Strng="Launchable device can be moved(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Movable=False
If Yes Then
TreasureRecord.Movable=True
Endif
Case "M", "N"
Strng="Treasure is a loadable device(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Loadable=False
TreasureRecord.AmmoLoads=False
If Yes Then
Put 8,Temp4,TreasureRecord
Strng="Treasure which loads this device?"
Call IO.O
Call Find.Treasure
If Temp5=False Then
Get 8,Temp4,TreasureRecord
TreasureRecord.Loadable=False
TreasureRecord.AmmoLoads=False
Else
Get 8,Temp5,TreasureRecord
If TreasureRecord.Ammunition=False Then
Get 8,Temp4,TreasureRecord
Strng="That treasure is not ammunition."
Call IO.O
TreasureRecord.Loadable=False
TreasureRecord.AmmoLoads=False
Else
Get 8,Temp4,TreasureRecord
TreasureRecord.Loadable=True
TreasureRecord.AmmoLoads=Temp5
Endif
Endif
Put 8,Temp4,TreasureRecord
Temp5=Temp4
Endif
Case "P", "4"
Strng="Treasure is a launchable device(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
TreasureRecord.Launchable=False
TreasureRecord.LaunchLoads=False
If Yes Then
Put 8,Temp4,TreasureRecord
Strng="Treasure which launchs from this device?"
Call IO.O
Call Find.Treasure
If Temp5=False Then
Get 8,Temp4,TreasureRecord
TreasureRecord.Launchable=False
TreasureRecord.LaunchLoads=False
Else
Get 8,Temp5,TreasureRecord
If TreasureRecord.LaunchAmmo=False Then
Get 8,Temp4,TreasureRecord
Strng="That treasure does not launch from devices."
Call IO.O
TreasureRecord.Launchable=False
TreasureRecord.LaunchLoads=False
Else
Get 8,Temp4,TreasureRecord
TreasureRecord.Launchable=True
TreasureRecord.LaunchLoads=Temp5
Endif
Endif
Put 8,Temp4,TreasureRecord
Temp5=Temp4
Endif
Case "Q"
Exit Do
End Select
Loop
Put 8,Temp4,TreasureRecord
Strng="Treasure '"+Rtrim$(TreasureRecord.TreasureName)+"' changed."
Call IO.O
10281
Exit Sub
10282
Resume 10281
End Sub
Sub Display.Treasure(TempX)
On Local Error Goto 10292
If TempX Then
If TempC Then
Exit Sub
Endif
ENdif
Graphics.Off=True
Strng="Treasure number"+Str$(Temp5)+":"
Call IO.O
Graphics.Off=True
If TempX Then
Strng="[A]"
Endif
Strng=Strng+"Treasure name: "+Rtrim$(TreasureRecord.TreasureName)
Call IO.O
If TempX Then
Strng="[B]"
Endif
Strng=Strng+"Treasure identifier: "+Rtrim$(TreasureRecord.ShortName)
Call IO.O
If TempX Then
Strng="[C]"
Endif
Strng=Strng+"Weight:"+Str$(TreasureRecord.Weight)
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[T]"
Endif
Strng=Strng+"Gold coin value:"+Str$(TreasureRecord.Gold)
Call IO.O
If TempX Then
Strng="[D]"
Endif
Strng=Strng+"Treasure type: "
If TreasureRecord.Type=False Then
If TreasureRecord.Plus=False Then
Strng=Strng+"Treasure"
Else
Strng=Strng+"Weapon"
Endif
Endif
If TreasureRecord.Type<False Then
Strng=Strng+"Shield"
Endif
If TreasureRecord.Type>False Then
Strng=Strng+"Armor"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[U]"
Endif
Strng=Strng+"Hit plus:"+Str$(Abs(TreasureRecord.Plus))
Call IO.O
If TempX Then
Strng="[E]"
Endif
Strng=Strng+"Charges:"+Str$(TreasureRecord.Charges)
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[V]"
Endif
Strng=Strng+"Weapon class: "
Select Case TreasureRecord.Proficiency
Case 1
Strng=Strng+"Blunt"
Case 2
Strng=Strng+"Pole"
Case 3
Strng=Strng+"Sharp"
Case 4
Strng=Strng+"Thrusting"
Case Else
Strng=Strng+"None"
End Select
Call IO.O
If TempX Then
Strng="[F]"
Endif
Strng=Strng+"Treasure is coins: "
If TreasureRecord.Coin Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[W]"
Endif
Strng=Strng+"Treasure is a potion: "
If TreasureRecord.Potion Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[G]"
Endif
Strng=Strng+"Treasure is a scroll: "
If TreasureRecord.Scroll Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[X]"
Endif
Strng=Strng+"Treasure is invisible: "
If TreasureRecord.Invisible Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[H]"
Endif
Strng=Strng+"Treasure is ammunition: "
If TreasureRecord.Ammunition Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[Y]"
Endif
Strng=Strng+"Treasure is a receptacle: "
If TreasureRecord.Recep Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[I]"
Endif
Strng=Strng+"Receptacle is locked: "
If TreasureRecord.Locked=1 And TreasureRecord.Closed=1 Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[Z]"
Endif
Strng=Strng+"Maximum objects in receptacle:"
Strng=Strng+Str$(TreasureRecord.RecepMax)
Call IO.O
If TempX Then
Strng="[J]"
Endif
Strng=Strng+"Treasure is edible: "
If TreasureRecord.Edible Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[1]"
Endif
Strng=Strng+"Receptacle filename: "
Strng2=Rtrim$(TreasureRecord.RecepFileName)
If Strng2=Nul Then
Strng=Strng+"None"
Else
Strng=Strng+Strng2
Endif
Call IO.O
If TempX Then
Strng="[K]"
Endif
Strng=Strng+"Weapon rusts: "
If TreasureRecord.Rustable Then
Var=TreasureRecord.RustPercent
If Var<False Or Var>100 Then
TreasureRecord.Rustable=False
Var=False
Endif
If Var Then
Strng=Strng+"Yes ("+Mid$(Str$(Var),2)+" percent)"
Else
Strng=Strng+"No"
Endif
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[2]"
Endif
Strng=Strng+"Weapon is stealable: "
If TreasureRecord.Stealable Then
Var=TreasureRecord.StealPercent
If Var<False Or Var>100 Then
TreasureRecord.Stealable=False
Var=False
Endif
If Var Then
Strng=Strng+"Yes ("+Mid$(Str$(Var),2)+" percent)"
Else
Strng=Strng+"No"
Endif
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[L]"
Endif
Strng=Strng+"Treasure key number:"+Str$(TreasureRecord.Keyed)
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[3]"
Endif
Strng=Strng+"Launchable device can be moved: "
If TreasureRecord.Movable Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng=Strng+"[M]"
Endif
Strng=Strng+"Treasure is loadable: "
If TreasureRecord.Loadable Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+Space$(37-Len(Strng))
If TempX Then
Strng=Strng+"[4]"
Endif
Strng=Strng+"Treasure is launchable: "
If TreasureRecord.Launchable Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[N]"
Endif
Strng=Strng+"Treasure that loads device: "
If TreasureRecord.Loadable Then
Get 8,TreasureRecord.AmmoLoads,TreasureRecord
Strng=Strng+Rtrim$(TreasureRecord.TreasureName)
Get 8,Temp5,TreasureRecord
Else
Strng=Strng+"None"
Endif
Call IO.O
If TempX Then
Strng="[O]"
Endif
Strng=Strng+"Treasure loads launchable devices: "
If TreasureRecord.LaunchAmmo Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[P]"
Endif
Strng=Strng+"Treasure which launchs from this device: "
If TreasureRecord.Launchable Then
Get 8,TreasureRecord.LaunchLoads,TreasureRecord
Strng=Strng+Rtrim$(TreasureRecord.TreasureName)
Get 8,Temp5,TreasureRecord
Else
Strng=Strng+"None"
Endif
Call IO.O
If TempX Then
Strng="[R]"
Endif
Strng=Strng+"Treasure is magical: "
If TreasureRecord.Spell=False Then
Strng=Strng+"No"
Else
Get 4,TreasureRecord.Spell,SpellRecord
Strng=Strng+"Yes, "+Rtrim$(SpellRecord.SpellName)+" spell"
Endif
Call IO.O
If TempX Then
Strng="[S]"
Endif
Strng=Strng+"Treasure is a ring: "
Select Case TreasureRecord.RingType
Case 1
Strng=Strng+"protection from poison"
Case 2
Strng=Strng+"protection from level drain"
Case 3
Strng=Strng+"protection from spell: "
If TreasureRecord.RingSpell=True Then
Strng=Strng+"generic spell"
Else
Get 4,TreasureRecord.RingSpell,SpellRecord
Strng=Strng+Rtrim$(Lcase$(SpellRecord.SpellName))+" spell"
Endif
Case Else
Strng=Strng+"No"
End Select
Call IO.O
10291
Exit Sub
10292
Resume 10291
End Sub
Sub Edit.Nonplayer
On Local Error Goto 10302
If Lof(9)=False Then
Call Add.Nonplayer
Endif
Do
Graphics.Off=True
If TempC=False Then
Strng="[A]dd"
Call IO.O
Strng="[C]hange"
Call IO.O
Strng="[L]ist"
Call IO.O
Strng="[S]earch"
Call IO.O
Graphics.Off=False
Endif
Strng="Nonplayer edit option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Call Add.Nonplayer
Case "C"
Call Find.Nonplayer
If Temp Then
Temp4=Temp
Call Change.Nonplayer
Endif
Case "L"
Call List.Nonplayer
Case "S"
Call Search.Nonplayers
Case "Q"
Exit Sub
End Select
Loop
10301
Exit Sub
10302
Resume 10301
End Sub
Sub Add.Nonplayer
On Local Error Goto 10312
Temp4=Lof(9)/Len(MonsterRecord)+1
MonsterRecord.MonsterName=Nul
MonsterRecord.PluralName=Nul
For Temp6=1 To 5
MonsterRecord.Treasure(Temp6)=False
Next
MonsterRecord.Experience=False
MonsterRecord.NumberAppearing=1
MonsterRecord.Level=False
MonsterRecord.Hits=False
MonsterRecord.Poison=False
MonsterRecord.LevelDrain=False
MonsterRecord.Spell=False
MonsterRecord.Block=False
MonsterRecord.Prevent=False
MonsterRecord.Follow=False
MonsterRecord.Magic=True
MonsterRecord.Jail=False
MonsterRecord.Teleport=False
MonsterRecord.FollowPercent=False
MonsterRecord.BlockPercent=False
MonsterRecord.PreventPercent=False
MonsterRecord.SpellPercent=False
MonsterRecord.PoisonPercent=False
MonsterRecord.DrainPercent=False
MonsterRecord.Rate=False
MonsterRecord.RatePercent=False
MonsterRecord.Permanent=-2
For Temp6=1 To 5
MonsterRecord.Talk(Temp6)=False
Next
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
MonsterRecord.Equation=False
MonsterRecord.MonsterEquate=Nul
Put 9,Temp4,MonsterRecord
Call Change.Nonplayer
10311
Exit Sub
10312
Resume 10311
End Sub
Sub List.Nonplayer
On Local Error Goto 10322
Temp3=Lof(9)/Len(MonsterRecord)
Temp$=Mid$(Str$(Temp3),2)
Strng="From(1-"+Temp$+")?"
No.Input.Out="1"
Call IO.I
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Temp3 Then
Strng=Range$
Call IO.O
Exit Sub
Endif
Strng="To("+Mid$(Str$(Temp),2)+"-"+Temp$+")?"
No.Input.Out=Temp$
Call IO.I
Temp2=Int(Val(Out2))
If Temp2<Temp Then
Strng=Range$
Call IO.O
Exit Sub
Endif
If Temp2>Temp3 Then
Temp2=Temp3
Endif
For Temp5=Temp To Temp2
Get 9,Temp5,MonsterRecord
Call Display.Nonplayer(False)
Graphics.Off=False
Call More.Prompt
If No Then
Exit For
Endif
Next
10321
Exit Sub
10322
Resume 10321
End Sub
Sub Display.Nonplayer(TempX)
On Local Error Goto 10332
If TempX Then
If TempC Then
Exit Sub
Endif
ENdif
Graphics.Off=True
Strng="Nonplayer number"+Str$(Temp5)+":"
Call IO.O
If TempX Then
Strng="[A]"
Endif
Strng=Strng+"Nonplayer name: "+Rtrim$(MonsterRecord.MonsterName)
Call IO.O
If TempX Then
Strng="[B]"
Endif
Strng=Strng+"Nonplayer rooms: "+MonsterRecord.PluralName
Call IO.O
If TempX Then
Strng="[C]"
Endif
Strng=Strng+"Nonplayer level:"+Str$(MonsterRecord.Level)
Call IO.O
If TempX Then
Strng="[D]"
Endif
Strng=Strng+"Hit points:"+Str$(MonsterRecord.Hits)
Call IO.O
If TempX Then
Strng="[E]"
Endif
Strng=Strng+"Experience points:"+Str$(MonsterRecord.Experience)
Call IO.O
If TempX Then
Strng="[F]"
Endif
Strng=Strng+"Poisonous nonplayer: "
If MonsterRecord.Poison Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.PoisonPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[G]"
Endif
Strng=Strng+"Level draining nonplayer: "
If MonsterRecord.LevelDrain Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.DrainPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[H]"
Endif
Strng=Strng+"Nonplayer blocks exits: "
If MonsterRecord.Block Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.BlockPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[I]"
Endif
Strng=Strng+"Nonplayer prevents treasure take: "
If MonsterRecord.Prevent Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.PreventPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[J]"
Endif
Strng=Strng+"Nonplayer follows user: "
If MonsterRecord.Follow Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.FollowPercent),2)+" percent) "+_
"("+Mid$(Str$(MonsterRecord.Teleport),2)+"% teleport)"
Call IO.O
If TempX Then
Strng="[K]"
Endif
Strng=Strng+"Nonplayer casts spells: "
If MonsterRecord.Spell=False Then
Strng=Strng+"No"
Else
Get 4,MonsterRecord.Spell,SpellRecord
Strng=Strng+"Yes, "+Rtrim$(SpellRecord.SpellName)
Endif
Strng=Strng+"("+Mid$(Str$(MonsterRecord.SpellPercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[L]"
Endif
Strng=Strng+"Nonplayer jails attacker: "
If MonsterRecord.Jail Then
Strng=Strng+"Yes"
Else
Strng=Strng+"No"
Endif
Call IO.O
If TempX Then
Strng="[M]"
Endif
Strng=Strng+"Encounter rate:"+Str$(MonsterRecord.Rate)+_
" ("+Mid$(Str$(MonsterRecord.RatePercent),2)+" percent)"
Call IO.O
If TempX Then
Strng="[N]"
Endif
Strng=Strng+"Nonplayer uses psionics: "
If MonsterRecord.Psionic=False Then
Strng=Strng+"No"
Else
Get 4,MonsterRecord.PsionicSpell
Strng=Strng+"Yes, "+SpellRecord.SpellName
Endif
Call IO.O
If TempX Then
Strng="[O]"
Endif
Strng=Strng+"Carries treasure:"
Call IO.O
For Temp6=1 To 5
Temp8=MonsterRecord.Treasure(Temp6)
If Temp8>False Then
Get 8,Temp8,TreasureRecord
Strng=TreasureRecord.TreasureName
Call IO.O
Endif
Next
If TempX Then
Strng="[P]"
Endif
Strng=Strng+"Nonplayer has attack equation: "
If MonsterRecord.Equation Then
Strng=Strng+"Yes: "
Out2=MonsterRecord.MonsterEquate
Out2=Rtrim$(Out2)
Strng=Strng+Out2
Else
Strng=Strng+"No"
Endif
Call IO.O
10331
Exit Sub
10332
Resume 10331
End Sub
Sub Change.Nonplayer
On Local Error Goto 10342
Get 9,Temp4,MonsterRecord
Do
Temp5=Temp4
Call Display.Nonplayer(True)
Graphics.Off=False
Strng="Nonplayer change option(q to quit)?"
Line.Length=TempD
No.Input.Out="Q"
Call IO.I
Select Case Ucase$(Out2)
Case "A"
Strng="Nonplayer name(30 characters):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
MonsterRecord.MonsterName=Out2
Case "B"
Strng="Rooms(separated by commas):"
Call IO.O
Strng="?"
No.Input.Out=None$
Call IO.I
Out2=Lcase$(Out2)
MonsterRecord.PluralName=Out2
Case "C"
Strng="Nonplayer level(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Level=Int(Val(Out2))
Case "D"
Strng="Hit points(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Hits=Int(Val(Out2))
Case "E"
Strng="Experience points(1-32767)?"
No.Input.Out="1"
Call IO.I
MonsterRecord.Experience=Int(Val(Out2))
Case "F"
Strng="Poisonous nonplayer(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Poison=False
MonsterRecord.PoisonPercent=False
If Yes Then
MonsterRecord.Poison=True
Strng="Percent chance nonplayer will poison(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.PoisonPercent=Int(Val(Out2))
Endif
Case "G"
Strng="Level draining nonplayer(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.LevelDrain=False
MonsterRecord.DrainPercent=False
If Yes Then
MonsterRecord.LevelDrain=True
Strng="Percent chance nonplayer will level drain(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.DrainPercent=Int(Val(Out2))
Endif
Case "H"
Strng="Nonplayer blocks exits(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Block=False
MonsterRecord.BlockPercent=False
If Yes Then
MonsterRecord.Block=True
Strng="Percent chance nonplayer will block exits(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.BlockPercent=Int(Val(Out2))
Endif
Case "I"
Strng="Nonplayer prevents taking treasure(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Prevent=False
MonsterRecord.PreventPercent=False
If Yes Then
MonsterRecord.Prevent=True
Strng="Percent chance nonplayer prevents taking treasure(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.PreventPercent=Int(Val(Out2))
Endif
Case "J"
Strng="Nonplayer follows user(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Follow=False
MonsterRecord.FollowPercent=False
MonsterRecord.Teleport=False
If Yes Then
MonsterRecord.Follow=True
Strng="Percent chance nonplayer will follow user(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.FollowPercent=Int(Val(Out2))
Strng="Percent chance nonplayer will teleport with user(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.Teleport=Int(Val(Out2))
Endif
Case "K"
Strng="Nonplayer casts spells(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Spell=False
MonsterRecord.SpellPercent=False
If Yes Then
Call Find.Spell
If Temp Then
MonsterRecord.Spell=Temp
Strng="Percent chance nonplayer casts spell(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.SpellPercent=Int(Val(Out2))
Endif
Endif
Case "L"
Strng="Nonplayer jails attacker(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Jail=False
If Yes Then
MonsterRecord.Jail=True
Endif
Case "M"
Strng="Nonplayer encounter rate(# of action prompts)?"
No.Input.Out="6"
Call IO.I
MonsterRecord.Rate=Int(Val(Out2))
Strng="Nonplayer encounter percent(1-100)?"
No.Input.Out="50"
Call IO.I
MonsterRecord.RatePercent=Int(Val(Out2))
Case "N"
Strng="Nonplayer uses psionics(y/n)?"
Line.Length=TempD
No.Input.Out="Y"
Call IO.I
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
If Yes Then
Strng="Psionic spell?"
Call Find.Spell
If Temp Then
If SpellRecord.Psionic=False Then
Strng="That spell is not a psionic spell!"
Call IO.O
MonsterRecord.Psionic=False
MonsterRecord.PsionicSpell=False
Else
MonsterRecord.Psionic=True
MonsterRecord.PsionicSpell=Temp
Endif
Endif
Endif
Case "O"
Strng="Enter five treasure names:"
Call IO.O
Strng="Press "+Enter$+" for none."
Call IO.O
Graphics.Off=True
For Temp2=1 To 5
Call Find.Treasure
MonsterRecord.Treasure(Temp2)=Temp5
Next
Case "P"
Line.Length=TempD
No.Input.Out="Y"
Strng="Nonplayer has attack equation(y/n)?"
Call IO.I
MonsterRecord.Equation=False
MonsterRecord.MonsterEquate=Nul
If Yes Then
Strng="Enter nonplayer attack equation:"
Call IO.I
MonsterRecord.Equation=True
MonsterRecord.MonsterEquate=Ucase$(Out2)
Endif
Case "Q"
Exit Do
End Select
Loop
Put 9,Temp4,MonsterRecord
Strng="Nonplayer '"+Rtrim$(MonsterRecord.MonsterName)+"' changed."
Call IO.O
10341
Exit Sub
10342
Resume 10341
End Sub
Sub Find.Monster
On Local Error Goto 10352
Temp=False
Strng="Monster name, or number?"
No.Input.Out="1"
Call IO.I
If Out2=Nul Then
Exit Sub
Endif
Temp7=False
Out2=Lcase$(Out2)
If Instr(Out2,"#") Then
Temp7=Val(Mid$(Out2,Instr(Out2,"#")+1))
Out2=Left$(Out2,Instr(Out2,"#")-1)
Endif
TempQ=False
For Temp=1 To Lof(7)/Len(MonsterRecord)
Get 7,Temp,MonsterRecord
If Left$(MonsterRecord.MonsterName,Len(Out2))=Out2 Then
TempQ=TempQ+1
If Temp7=False Or TempQ=Temp7 Then
Exit Sub
Endif
Endif
Next
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Lof(7)/Len(MonsterRecord) Then
Temp=False
Strng="Monster name not found."
Call IO.O
Temp=False
Endif
10351
Exit Sub
10352
Resume 10351
End Sub
Sub Find.Treasure
On Local Error Goto 10362
Temp5=False
Strng="Treasure name, or number?"
No.Input.Out="1"
Call IO.I
If Out2=Nul Then
Exit Sub
Endif
Temp7=False
Out2=Lcase$(Out2)
If Instr(Out2,"#") Then
Temp7=Val(Mid$(Out2,Instr(Out2,"#")+1))
Out2=Left$(Out2,Instr(Out2,"#")-1)
Endif
TempQ=False
For Temp5=1 To Lof(8)/Len(TreasureRecord)
Get 8,Temp5,TreasureRecord
If Left$(TreasureRecord.TreasureName,Len(Out2))=Out2 Then
TempQ=TempQ+1
If Temp7=False Or TempQ=Temp7 Then
Exit Sub
Endif
Endif
Next
Temp5=Int(Val(Out2))
If Temp5<1 Or Temp5>Lof(8)/Len(TreasureRecord) Then
Temp5=False
Strng="Treasure name not found."
Call IO.O
Endif
10361
Exit Sub
10362
Resume 10361
End Sub
Sub Find.Spell
On Local Error Goto 10372
Temp=False
Strng="Spell name, or number?"
No.Input.Out="1"
Call IO.I
If Out2=Nul Then
Exit Sub
Endif
Temp7=False
Out2=Lcase$(Out2)
If Instr(Out2,"#") Then
Temp7=Val(Mid$(Out2,Instr(Out2,"#")+1))
Out2=Left$(Out2,Instr(Out2,"#")-1)
Endif
TempQ=False
For Temp=1 To Lof(4)/Len(SpellRecord)
Get 4,Temp,SpellRecord
If Left$(SpellRecord.SpellName,Len(Out2))=Out2 Then
TempQ=TempQ+1
If Temp7=False Or TempQ=Temp7 Then
Exit Sub
Endif
Endif
Next
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Lof(4)/Len(SpellRecord) Then
Temp=False
Strng="Spell name not found."
Call IO.O
Endif
10371
Exit Sub
10372
Resume 10371
End Sub
Sub Find.Object
On Local Error Goto 10382
Temp=False
Strng="Object name, or number?"
No.Input.Out="1"
Call IO.I
If Out2=Nul Then
Exit Sub
Endif
Out2=Lcase$(Out2)
Temp7=False
If Instr(Out2,"#") Then
Temp7=Val(Mid$(Out2,Instr(Out2,"#")+1))
Out2=Left$(Out2,Instr(Out2,"#")-1)
Endif
TempQ=False
For Temp=1 To Lof(6)/Len(ObjectRecord)
Get 6,Temp,ObjectRecord
If Left$(ObjectRecord.ObjectName,Len(Out2))=Out2 Then
TempQ=TempQ+1
If Temp7=False Or TempQ=Temp7 Then
Exit Sub
Endif
Endif
Next
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Lof(6)/Len(ObjectRecord) Then
Temp=False
Strng="Object name not found."
Call IO.O
Endif
10381
Exit Sub
10382
Resume 10381
End Sub
Sub Find.Nonplayer
On Local Error Goto 10392
Temp=False
Strng="Nonplayer name, or number?"
No.Input.Out="1"
Call IO.I
If Out2=Nul Then
Exit Sub
Endif
Temp7=False
Out2=Lcase$(Out2)
If Instr(Out2,"#") Then
Temp7=Val(Mid$(Out2,Instr(Out2,"#")+1))
Out2=Left$(Out2,Instr(Out2,"#")-1)
Endif
TempQ=False
For Temp=1 To Lof(9)/Len(MonsterRecord)
Get 9,Temp,MonsterRecord
If Left$(MonsterRecord.MonsterName,Len(Out2))=Out2 Then
TempQ=TempQ+1
If Temp7=False Or TempQ=Temp7 Then
Exit Sub
Endif
Endif
Next
Temp=Int(Val(Out2))
If Temp<1 Or Temp>Lof(9)/Len(MonsterRecord) Then
Temp=False
Strng="Nonplayer name not found."
Call IO.O
Temp=False
Endif
10391
Exit Sub
10392
Resume 10391
End Sub
Sub Read.Config
On Local Error Goto 10412
Call Get.Command
Call Get.Config
Call Get.Environ
Call Free.Files
Call Open.Files
If Local.Mode Then
Color.Graphics=True
If Config2(84) And Config2(85) Then
Local.Avatar=True
Endif
Endif
If Port.Override Then
Port=Port.Override-1
Else
Port=Config2(46)-1
Endif
Temp.FileName=Config3(53)+Config3(75)
If Node Then
Temp.FileName=Temp.FileName+Chr$(Node)
Endif
Temp.FileName=Temp.FileName+Config3(15)
Close #13
Temp=False
Open Temp.FileName For Input Shared As #13
If Not Eof(13) Then
Input #13,Temp
Color.Code=Temp
Avatar.Code=Temp
Endif
10411
Exit Sub
10412
Resume 10411
End Sub
Sub Get.Command
On Local Error Goto 10422
If Chained=False Then
If Command$=Nul Then
Local.Mode=True
Else
Node=False
Local.Mode=False
If Left$(Command$,2)="-1" Then
Local.Mode=True
Endif
Endif
If Right$(Command$,2)<>"-1" Then
Node=Asc(Right$(Command$,1))
Endif
Endif
10421
Exit Sub
10422
Resume 10421
End Sub
Sub Get.Config
On Local Error Goto 10432
DND.Path$=Environ$("DNDBBS")
If DND.Path$<>Nul Then
If Right$(DND.Path$,1)<>"\" Then
DND.Path$=DND.Path$+"\"
Endif
Endif
Data.Error=False
FileName=DND.Path$+"DNDBBS"
If Node Then
FileName=FileName+Chr$(Node)
Endif
FileName=FileName+".CFG"
Close
Open FileName For Input Shared As #13
For Temp=1 To 10
For Temp5=1 To 4
Input #13,Training.Room(Temp,Temp5)
Next
Next
For Temp5=1 To 10
Line Input #13,Room.Array(Temp5)
Next
For Temp5=1 To 30
Input #13,Config1(Temp5)
Next
For Temp5=1 To 85
Input #13,Config2(Temp5)
Next
For Temp5=1 To 77
Line Input #13,Config3(Temp5)
Next
For Temp5=1 To 10
Line Input #13,High.Class.Name(Temp5)
Next
For Temp2=1 To 8
Line Input #13,Race(Temp2)
Next
For Temp2=1 To 10
Line Input #13,Class.Name(Temp2)
Next
For Temp2=1 To 7
Line Input #13,Stat(Temp2)
Next
For Temp2=1 To 11
Line Input #13,Direction(Temp2)
Next
For Temp2=1 To 10
Line Input #13,Numeral(Temp2)
Next
For Temp2=1 To 4
Line Input #13,Weapon.Type.Name(Temp2)
Next
For Temp2=1 To 3
Line Input #13,Alignment.Name1(Temp2)
Next
For Temp2=1 To 3
Line Input #13,Alignment.Name2(Temp2)
Next
10431
If Data.Error Then
Strng=FileName+" not found. Run DNDCNFG."
Call Terminate
Endif
Exit Sub
10432
Data.Error=True
Resume 10431
End Sub
Sub Get.Environ
On Local Error Goto 10442
Out2=Environ$("DNDDAT")
If Out2<>Nul Then
Config3(11)=Out2
If Right$(Config3(11),1)<>"\" Then
Config3(11)=Config3(11)+"\"
Endif
Endif
Out2=Environ$("DNDDOC")
If Out2<>Nul Then
Config3(52)=Out2
If Right$(Config3(52),1)<>"\" Then
Config3(52)=Config3(52)+"\"
Endif
Endif
Out2=Environ$("DNDTEMP")
If Out2<>Nul Then
Config3(53)=Out2
If Right$(Config3(53),1)<>"\" Then
Config3(53)=Config3(53)+"\"
Endif
Endif
Out2=Environ$("DNDDOOR")
If Out2<>Nul Then
Config3(38)=Out2
If Right$(Config3(38),1)<>"\" Then
Config3(38)=Config3(38)+"\"
Endif
Endif
10441
Exit Sub
10442
Resume 10441
End Sub
Sub Free.Files
On Local Error Goto 10454
Temp.FileName=Config3(53)+Config3(75)+Config3(15)
10451
Close
Temp=False
Do
Temp=Temp+1
Open Temp.FileName For Random Shared As Temp
Loop
10452
Close
Kill Temp.FileName
10453
If Temp<16 Then
Strng="Increase FILES= statement in CONFIG.SYS then reboot."
Call Terminate
Endif
Exit Sub
10454
If Erl=10451 Then
Resume 10452
Endif
Resume 10453
End Sub
Sub Open.Files
On Local Error Goto 10462
Close
Day.File.FileName=Config3(11)+Config3(72)
FileName=Config3(11)+Config3(21)+Config3(15)
Open FileName For Random Shared As #3 Len=Len(UserRecord)
FileName=Config3(11)+Config3(20)+Config3(15)
Open FileName For Random Shared As #4 Len=Len(SpellRecord)
FileName=Config3(11)+Config3(16)+Config3(15)
Open FileName For Random Shared As #5 Len=Len(RoomRecord)
FileName=Config3(11)+Config3(17)+Config3(15)
Open FileName For Random Shared As #6 Len=Len(ObjectRecord)
FileName=Config3(11)+Config3(18)+Config3(15)
Open FileName For Random Shared As #7 Len=Len(MonsterRecord)
FileName=Config3(11)+Config3(19)+Config3(15)
Open FileName For Random Shared As #8 Len=Len(TreasureRecord)
FileName=Config3(11)+Config3(22)+Config3(15)
Open FileName For Random Shared As #9 Len=Len(MonsterRecord)
FileName=Config3(11)+Config3(12)+Config3(15)
Open FileName For Random Shared As #10 Len=Len(MonclassRecord)
FileName=Config3(11)+Config3(13)+Config3(15)
Open FileName For Random Shared As #11 Len=Len(MonsterTalkRecord)
FileName=Config3(54)+Config3(59)+Config3(15)
Open FileName For Random Shared As #12 Len=Len(MessageBaseRecord)
10461
Exit Sub
10462
Resume 10461
End Sub
Sub IO.O
On Local Error Goto 10472
If Color.Graphics Then
Gosub Out.ANSI
Endif
If Carriage.Return=False Then
Strng=Rtrim$(Strng)
Endif
Break=False
For Count=1 To Len(Strng)
Call Keyboard
VarX$=Mid$(Strng,Count,1)
Call Scrn(VarX$)
Call Put.Modem(VarX$)
If Break Then
Exit For
Endif
Next
If Carriage.Return=False Then
Call Line.Return
Endif
Strng=Nul
Carriage.Return=False
Exit Sub
Out.ANSI:
If Graphics.Off=False Then
Color.Code=Color.Code+1
Avatar.Code=Avatar.Code+1
If Color.Code<31 Then
Color.Code=31
Endif
If Avatar.Code<10 Then
Avatar.Code=10
Endif
If Color.Code>35 Then
Color.Code=31
Endif
If Avatar.Code>14 Then
Avatar.Code=10
Endif
Call Screen.ANSI(4,Color.Code,Avatar.Code)
Call Modem.ANSI(4,Color.Code,Avatar.Code)
Endif
If Graphics.Off Then
Call Screen.ANSI(4,37,15)
Call Modem.ANSI(4,37,15)
Endif
Return
10471
Exit Sub
10472
Resume 10471
End Sub
Sub IO.I
On Local Error Goto 10482
Static Var$
Carriage.Return=True
Line.Limit=Len(Strng)
Strng=Strng+Var$
Call IO.O
Out2=Var$
Var$=Nul
Do
Char$=Nul
Do While Char$=Nul
Call Keyboard
Call Get.Modem
If Len(Buffer$) Then
Char$=Left$(Buffer$,1)
Buffer$=Mid$(Buffer$,2)
Endif
Loop
Char=Asc(Char$)
Select Case Char
Case 8
If Len(Out2) Then
Out2=Left$(Out2,Len(Out2)-1)
Call Back.Space
Endif
Case 13
If Out2=Nul Then
If Len(No.Input.Out) Then
Out2=No.Input.Out
OutY$=Lcase$(No.Input.Out)
Call Scrn(OutY$)
Call Put.Modem(OutY$)
Endif
Endif
Call Scrn(Chr$(13))
Call Put.Modem(Chr$(13))
Exit Do
Case 32 To 127
VarX$=Char$
If No.Echo=False Then
If Hide Then
VarX$=Mask$
Endif
Call Put.Modem(VarX$)
If Word.Wrap=False Then
Call Scrn(VarX$)
Endif
Endif
Out2=Out2+Char$
Select Case Word.Wrap
Case True
Select Case Len(Out2)+Line.Limit
Case 0 To 78
Call Scrn(VarX$)
Case Else
TempX=False
Word=False
For TempY=Len(Out2) To 1 Step -1
If Mid$(Out2,TempY,1)=" " Then
For Var=1 To TempX
Call Back.Space
Next
Var$=Mid$(Out2,TempY+1)
Out2=Left$(Out2,TempY)
Call Scrn(Chr$(13))
Word=True
Exit For
Endif
TempX=TempX+1
Next
If Word=False Then
Call Scrn(Chr$(13))
Endif
Call Put.Modem(Chr$(13))
Exit Do
End Select
Case False
If Line.Length>False Then
If Len(Out2)>=Line.Length Then
Call Scrn(Chr$(13))
Call Put.Modem(Chr$(13))
Exit Do
Endif
Endif
End Select
End Select
Loop
Call Scrn(Chr$(10))
Call Put.Modem(Chr$(10))
No.Input.Out=Nul
Strng=Nul
No.Echo=False
No.Input=False
Line.Length=False
If Out2=Nul Then
No.Input=True
Exit Sub
Endif
Var1$=Left$(Out2,1)
Yes=Ucase$(Var1$)="Y"
No=Ucase$(Var1$)="N"
10481
Exit Sub
10482
Resume 10481
End Sub
Sub Put.Modem(Var$)
On Local Error Goto 10492
If Local.Mode Then
Exit Sub
Endif
For Count=1 To Len(Var$)
Call Check.Carrier
If Allow.Break Then
Call Driver(11)
If (Outregs.AX And &H0001)=1 Then
Break=True
Exit For
Endif
Endif
Call Get.Modem
Inregs.AX=Asc(Mid$(Var$,Count,1))
Call Driver(7)
Next
10491
Exit Sub
10492
Resume 10491
End Sub
Sub Get.Modem
On Local Error Goto 10502
If Local.Mode Then
Exit Sub
Endif
Call Check.Carrier
Call Driver(6)
Char=Outregs.AX And 255
If Char<>255 Then
Buffer$=Buffer$+Chr$(Char)
Endif
10501
Exit Sub
10502
Resume 10501
End Sub
Sub Check.Carrier
On Local Error Goto 10512
Call Driver(5)
If (Outregs.AX And &H80)=False Then
Strng="Lost carrier!"
Call Terminate
Endif
10511
Exit Sub
10512
Resume 10511
End Sub
Sub Keyboard
On Local Error Goto 10522
VarX$=Inkey$
Select Case Len(VarX$)
Case 0
Exit Sub
Case 1
Var=Asc(VarX$)
Select Case Var
Case 8, 13, 32 To 127
Buffer$=Buffer$+VarX$
Case 11
If Allow.Break Then
Break=True
Endif
End Select
End Select
10521
Exit Sub
10522
Resume 10521
End Sub
Sub Line.Return
On Local Error Goto 10532
Var$=Chr$(13)
Call Scrn(Var$)
Call Put.Modem(Var$)
Var$=Chr$(10)
Call Scrn(Var$)
Call Put.Modem(Var$)
10531
Exit Sub
10532
Resume 10531
End Sub
Sub Back.Space
On Local Error Goto 10542
Strng3=Chr$(27)+"[D"+" "+Chr$(27)+"[D"
Call Scrn(Strng3)
Strng3=Chr$(8)+" "+Chr$(8)
Call Put.Modem(Strng3)
10541
Exit Sub
10542
Resume 10541
End Sub
Sub Driver(Var)
On Local Error Goto 10552
Select Case Var
Case 5
Inregs.AX=&H0300
Case 6
Inregs.AX=&H2000
Case 7
Inregs.AX=Inregs.AX Or &H0B00
Case 11
Inregs.AX=&H1001
End Select
Inregs.DX=Port
Call Interrupt(&H14,Inregs,Outregs)
10551
Exit Sub
10552
Resume 10551
End Sub
Sub Scrn(Var$)
On Local Error Goto 10562
Var$=Var$+"$"
InregsX.AX=&H0900
InregsX.DS=Sseg(Var$)
InregsX.DX=Sadd(Var$)
Call InterruptX(&H21,InregsX,OutregsX)
10561
Exit Sub
10562
Resume 10561
End Sub
Sub Screen.ANSI(Var1,Var2,Var3)
On Local Error Goto 10572
If Local.Avatar Then
Call Avatar(Var1,Var2,Var3)
For VarX=1 To Len(TempD$)
Inregs.AX=&H0600
Inregs.DX=Asc(Mid$(TempD$,VarX,1))
Call Interrupt(&H21,Inregs,Outregs)
Next
Exit Sub
Endif
Call ANSI(Var1,Var2,Var3)
Call Scrn(TempD$)
10571
Exit Sub
10572
Resume 10571
End Sub
Sub Modem.ANSI(Var1,Var2,Var3)
On Local Error Goto 10582
If Color.Graphics Then
If Extended.ANSI Then
Call Avatar(Var1,Var2,Var3)
Else
Call ANSI(Var1,Var2,Var3)
Endif
Call Put.Modem(TempD$)
Endif
10581
Exit Sub
10582
Resume 10581
End Sub
Sub ANSI(VarX,VarY,VarZ)
On Local Error Goto 10592
TempD$=Nul
Select Case VarX
Case 1
TempD$=Chr$(27)+"[0;"+Mid$(Str$(VarY),2)+"m"
Case 2
TempD$=Chr$(27)+"["+Mid$(Str$(VarY),2)+";"+Mid$(Str$(VarZ),2)+"H"
Case 3
TempD$=Chr$(27)+"[2J"
Case 4
TempD$=Chr$(27)+"[1;"+Mid$(Str$(VarY),2)+"m"
End Select
10591
Exit Sub
10592
Resume 10591
End Sub
Sub Avatar(VarX,VarY,VarZ)
On Local Error Goto 10602
TempD$=Nul
Select Case VarX
Case 1, 4
TempD$=Chr$(22)+Chr$(1)+Chr$(VarZ)
Case 2
TempD$=Chr$(22)+Chr$(8)+Chr$(VarY)+Chr$(VarZ)
Case 3
TempD$=Chr$(12)
End Select
10601
Exit Sub
10602
Resume 10601
End Sub