home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / DNDOOR46.ZIP / DNDS1.BAS < prev    next >
BASIC Source File  |  2001-07-11  |  107KB  |  2,494 lines

  1.  Rem * Filename: dnds1.bas Version: v4.6 r1.0
  2.  Rem * This subprogram contains most display and find routines.
  3.  
  4.  Rem $Include: 'dnddoor.inc'
  5.  
  6.  Rem * This routines displays information of the action file.
  7.  Rem * input variables:
  8.  Rem *   Number - the room file record.
  9.  
  10. Sub Display.Action(Number)
  11.  On Local Error Resume Next ' local error resume
  12.  If Number<=0 Then ' check number
  13.     Exit Sub ' exit subroutine
  14.  Endif ' end check number
  15.  Graphics.Off=False ' reset color
  16.  Outpt="Action number"+Str$(Number)+":" ' action number message
  17.  Call IO.O ' send output message
  18.  Graphics.Off=True ' reset color
  19.  If ActionRecord.MonsterTrigger Then ' check action trigger
  20.     ' get monster trigger record
  21.     Call Read.Record(MonsterFile,ActionRecord.MonsterTrigger)
  22.     Outpt=MonsterRecord.MonsterName ' store monster name
  23.     Outpt=Rtrim$(Outpt) ' trim name
  24.     Inpt=Str$(ActionRecord.MonsterTrigger)+", "+Outpt+"." ' make message
  25.  Else ' check trigger
  26.     Inpt=" <none>" ' make default message
  27.  Endif ' end check trigger
  28.  Outpt="[A]Monster trigger in effect for monster:"+Inpt ' make message
  29.  Call IO.O ' send output message
  30.  If ActionRecord.SpellTrigger Then ' check action trigger
  31.     Call Read.Record(SpellFile,ActionRecord.SpellTrigger) ' get spell record
  32.     Outpt=SpellRecord.SpellName ' store spell name
  33.     Outpt=Rtrim$(Outpt) ' trim name
  34.     Inpt=Str$(ActionRecord.SpellTrigger)+", "+Outpt+"." ' make message
  35.  Else ' check trigger
  36.     Inpt=" <none>" ' make default message
  37.  Endif ' end check trigger
  38.  Outpt="[B]Spell trigger in effect for spell:"+Inpt
  39.  Call IO.O ' send output message
  40.  If ActionRecord.MonsterTalk Then ' check action trigger
  41.     Call Read.Record(MonsterFile,ActionRecord.MonsterTalk) ' get monster record
  42.     Outpt=MonsterRecord.MonsterName ' store monster name
  43.     Outpt=Rtrim$(Outpt) ' trim name
  44.     Inpt=Str$(ActionRecord.MonsterTalk)+", "+Outpt+"." ' make message
  45.  Else ' check trigger
  46.     Inpt=" <none>" ' make default message
  47.  Endif ' end check trigger
  48.  Outpt="[C]Monster talk trigger in effect for monster:"+Inpt ' make message
  49.  Call IO.O ' send output message
  50.  If ActionRecord.Level>False Then ' check action trigger
  51.     Inpt=Str$(ActionRecord.Level) ' make message
  52.  Else ' check trigger
  53.     Inpt=" <none>" ' make default message
  54.  Endif ' end check trigger
  55.  Outpt="[D]High level room entry:"+Inpt ' message
  56.  If ActionRecord.Level<False Then ' check action trigger
  57.     Inpt=Str$(Abs(ActionRecord.Level)) ' make message
  58.  Else ' check trigger
  59.     Inpt=" <none>" ' make default message
  60.  Endif ' end check trigger
  61.  Outpt=Outpt+", Low level room entry:"+Inpt ' message
  62.  Call IO.O ' send output message
  63.  Outpt="Restricted room directions:" ' make message
  64.  Call IO.O ' send output message
  65.  If ActionRecord.Restrictions>False Then ' check action trigger
  66.     Outpt=Nul ' reset message
  67.     For Direction.Number=1 To 12 ' loop through directions
  68.        ' check restriction trigger
  69.        If ActionRecord.Restrictions And 2^Direction.Number Then
  70.           Outpts=Direction(Direction.Number) ' make direction name
  71.           Outpt=Outpt+Outpts+", " ' append direction
  72.        Endif ' end check trigger
  73.     Next ' end loop
  74.     If ActionRecord.Restrictions And 2^13 Then ' check restriction trigger
  75.        Outpt=Outpt+"enter portal, " ' append message
  76.     Endif ' end check trigger
  77.     If Len(Outpt) Then ' check string length
  78.        Outpt=Left$(Outpt,Len(Outpt)-2) ' truncate comma
  79.     Endif ' end check string length
  80.  Else ' check trigger
  81.     Outpt="<none>" ' default message
  82.  Endif ' end check trigger
  83.  Call IO.O ' send output message
  84.  Outpt="[E]Action hits for:"
  85.  Select Case ActionRecord.HitPoints ' check action trigger
  86.  Case Is>False
  87.     Inpt=Str$(ActionRecord.HitPoints)+" fatigue" ' make message
  88.  Case Is<False
  89.     Inpt=Str$(Abs(ActionRecord.HitPoints))+" vitality" ' make message
  90.  Case Else ' check trigger
  91.     Inpt=" <none>" ' default message
  92.  End Select ' end check trigger
  93.  Outpt=Outpt+Inpt
  94.  Call IO.O ' send output message
  95.  If ActionRecord.EncounterRate Then ' check action trigger
  96.     Inpt=Str$(ActionRecord.EncounterRate) ' make message
  97.  Else ' check trigger
  98.     Inpt=" <none>" ' default message
  99.  Endif ' end check trigger
  100.  Outpt="[F]Encounter rate:"+Inpt
  101.  If ActionRecord.HealthRate Then ' check action trigger
  102.     Inpt=Str$(ActionRecord.HealthRate) ' make message
  103.  Else ' check trigger
  104.     Inpt=" <none>" ' default message
  105.  Endif ' end check trigger
  106.  Outpt=Outpt+", Health rate:"+Inpt
  107.  Call IO.O ' send output message
  108.  Outpt="[G]Inventory: "
  109.  Select Case ActionRecord.Inventory ' make selection of inventory actions
  110.  Case 1 ' weapon action
  111.     Inpt="breaks weapons" ' make message
  112.  Case 2 ' shield action
  113.     Inpt="smashes shields" ' make message
  114.  Case 3 ' armor action
  115.     Inpt="wrecks armor" ' make message
  116.  Case 4 ' magic item action
  117.     Inpt="drains magic items" ' make message
  118.  Case Else ' check trigger
  119.     Inpt="<none>"
  120.  End Select ' end selection of inventory actions
  121.  Outpt=Outpt+Inpt
  122.  Call IO.O
  123.  If ActionRecord.Fumble Then ' check action trigger
  124.     Outpt="[H]Action fumbles." ' make message
  125.  Else ' check trigger
  126.     Outpt="[H]Action does not fumble." ' make message
  127.  Endif ' end check trigger
  128.  Call IO.O ' send output message
  129.  If ActionRecord.Teleport Then ' check action trigger
  130.     Outpt="[I]Action teleports to room"+Str$(ActionRecord.Teleport)+"."
  131.  Else ' check trigger
  132.     Outpt="[I]Action does not teleport." ' make message
  133.  Endif ' end check trigger
  134.  Call IO.O ' send output message
  135.  If ActionRecord.RustRate Then ' check action trigger
  136.     Inpt=Str$(ActionRecord.RustRate) ' make message
  137.  Else ' check trigger
  138.     Inpt=" <none>" ' default message
  139.  Endif ' end check trigger
  140.  Outpt="[J]Action has weapon rusting rate of"+Inpt+" rounds." ' message
  141.  Call IO.O ' send output message
  142.  If ActionRecord.StealRate Then ' check action trigger
  143.     Inpt=Str$(ActionRecord.StealRate) ' make message
  144.  Else ' check trigger
  145.     Inpt=" <none>" ' default message
  146.  Endif ' end check trigger
  147.  Outpt="[K]Action has monster stealing rate of"+Inpt+" rounds." ' message
  148.  Call IO.O ' send output message
  149.  Outpt="[L]Action attributes: " ' make edit display message
  150.  If ActionRecord.Attribute1=LitRoom Then ' check attribute
  151.     Outpt=Outpt+"Lit" ' append attribute message
  152.  Else ' check attribute
  153.     If ActionRecord.Attribute1=UnLitRoom Then ' check attribute
  154.        Outpt=Outpt+"Unlit" ' append attribute message
  155.     Endif ' end check attribute
  156.  Endif ' end check attribute
  157.  Outpt=Outpt+", " ' append comma
  158.  Select Case ActionRecord.Attribute2 ' select attribute
  159.  Case Land ' check attribute
  160.     Outpt=Outpt+"Land" ' append attribute message
  161.  Case Air ' check attribute
  162.     Outpt=Outpt+"Air" ' append attribute message
  163.  Case Water ' check attribute
  164.     Outpt=Outpt+"Water" ' append attribute message
  165.  End Select ' end select attribute
  166.  Call IO.O ' send attribute message
  167.  Outpt="[X]Clear action" ' make alternate display message
  168.  Call IO.O ' send alternate display message
  169. End Sub
  170.  
  171.  Rem * This routines displays information on the monster file.
  172.  Rem * input variables:
  173.  Rem *   Number - the monster file record.
  174.  
  175. Sub Display.Monster(Number)
  176.  On Local Error Resume Next ' local error resume
  177.  If Number<=0 Then ' check number
  178.     Exit Sub ' exit subroutine
  179.  Endif ' end check number
  180.  Graphics.Off=False ' reset color
  181.  Outpt="Monster number"+Str$(Number)+":" ' monster number message
  182.  Call IO.O ' send output message
  183.  Graphics.Off=True ' reset color
  184.  Outpt="[A]Monster name: "+Rtrim$(MonsterRecord.MonsterName) ' message
  185.  Call IO.O ' send output message
  186.  Outpt="[B]Plural of monster name: "+MonsterRecord.PluralName ' message
  187.  Call IO.O ' send output message
  188.  Outpt="[C]Monster level:"+Str$(MonsterRecord.Level) ' message
  189.  Call IO.O ' send output message
  190.  Outpt="[D]Magical monster: " ' message
  191.  If MonsterRecord.Magic Then ' verify monster
  192.     Outpt=Outpt+"Yes" ' add to message
  193.  Else ' verify
  194.     Outpt=Outpt+"No" ' add to message
  195.  Endif ' end verify
  196.  Call IO.O ' send output message
  197.  Outpt="[E]Hit points:"+Str$(MonsterRecord.Hits) ' message
  198.  Call IO.O ' send output message
  199.  Outpt="[F]Experience points:"+Str$(MonsterRecord.Experience) ' message
  200.  Call IO.O ' send output message
  201.  Outpt="[G]Gold points:"+Str$(MonsterRecord.Gold) ' message
  202.  Call IO.O ' send output message
  203.  Outpt="[H]Number appearing:"+Str$(MonsterRecord.NumberAppearing) ' message
  204.  Call IO.O ' send output message
  205.  Outpt="[I]Poisonous monster: " ' message
  206.  If MonsterRecord.Poison Then ' verify monster
  207.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.PoisonPercent),2)+ _
  208.     " percent)" ' message
  209.  Else ' verify
  210.     Outpt=Outpt+"No" ' add to message
  211.  Endif ' end verify
  212.  Call IO.O ' send output message
  213.  Outpt="[J]Level draining monster: " ' message
  214.  If MonsterRecord.LevelDrain Then ' verify monster
  215.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.DrainPercent),2)+ _
  216.     " percent)" ' message
  217.  Else ' verify
  218.     Outpt=Outpt+"No" ' add to message
  219.  Endif ' end verify
  220.  Call IO.O ' send output message
  221.  Outpt="[K]Monster blocks exits: " ' message
  222.  If MonsterRecord.Block Then ' verify monster
  223.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.BlockPercent),2)+ _
  224.     " percent)" ' message
  225.  Else ' verify
  226.     Outpt=Outpt+"No" ' add to message
  227.  Endif ' end verify
  228.  Call IO.O ' send output message
  229.  Outpt="[L]Monster prevents treasure take: " ' message
  230.  If MonsterRecord.Prevent Then ' verify monster
  231.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.PreventPercent),2)+ _
  232.     " percent)" ' message
  233.  Else ' verify
  234.     Outpt=Outpt+"No" ' add to message
  235.  Endif ' end verify
  236.  Call IO.O ' send output message
  237.  Outpt="[M]Monster follows player: " ' message
  238.  If MonsterRecord.Follow Then ' verify monster
  239.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.FollowPercent),2)+ _
  240.     " percent)("+Mid$(Str$(MonsterRecord.Teleport),2)+"% teleport)"
  241.  Else ' verify
  242.     Outpt=Outpt+"No" ' add to message
  243.  Endif ' end verify
  244.  Call IO.O ' send output message
  245.  Outpt="[N]Monster casts spells: " ' message
  246.  Spell.Number=MonsterRecord.Spell ' store spell number
  247.  If Spell.Number=False Then ' verify monster
  248.     Outpt=Outpt+"No" ' add to message
  249.  Else ' verify
  250.     ' file bounds
  251.     If Spell.Number>False And _
  252.     Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  253.        Call Read.Record(SpellFile,Spell.Number) ' get spell record
  254.        Outpt=Outpt+"Yes, "+Rtrim$(SpellRecord.SpellName)+ _
  255.        "("+Mid$(Str$(MonsterRecord.SpellPercent),2)+" percent)" ' message
  256.     Endif ' end check file bounds
  257.  Endif ' end verify
  258.  Call IO.O ' send output message
  259.  Outpt="[O]Monster jails attacker: " ' message
  260.  If MonsterRecord.Jail Then ' verify monster
  261.     Outpt=Outpt+"Yes" ' add to message
  262.  Else ' verify
  263.     Outpt=Outpt+"No" ' add to message
  264.  Endif ' end verify
  265.  Call IO.O ' send output message
  266.  Outpt="[P]Encounter rate:"+Str$(MonsterRecord.Rate)+ _
  267.  "("+Mid$(Str$(MonsterRecord.RatePercent),2)+" percent)" ' message
  268.  Call IO.O ' send output message
  269.  Outpt="[R]Permanent monster: " ' message
  270.  If MonsterRecord.Permanent Then ' verify monster
  271.     Outpt=Outpt+"Yes" ' add to message
  272.  Else ' verify
  273.     Outpt=Outpt+"No" ' add to message
  274.  Endif ' end verify
  275.  Call IO.O ' send output message
  276.  Outpt="[S]Monster uses psionics: " ' message
  277.  If MonsterRecord.Psionic=False Then ' verify monster
  278.     Outpt=Outpt+"No" ' add to message
  279.  Else ' verify
  280.     Spell.Number=MonsterRecord.PsionicSpell ' store psionic spell number
  281.     ' file bounds
  282.     If Spell.Number>False And _
  283.     Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  284.        Call Read.Record(SpellFile,Spell.Number) ' get spell record
  285.        Outpt=Outpt+"Yes, "+SpellRecord.SpellName ' message
  286.     Endif ' end check file bounds
  287.  Endif ' end verify
  288.  Call IO.O ' send output message
  289.  Outpt="[T]Inventory:" ' message
  290.  Var3=0 ' reset counter
  291.  For Array.Number=1 To 5 ' loop through monster treasure
  292.     ' get monster treasure number
  293.     Treasure.Number=MonsterRecord.Treasure(Array.Number)
  294.     ' check file bounds
  295.     If Treasure.Number>False And _
  296.     Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then
  297.        Var3=Var3+1 ' increment counter
  298.     Endif ' end check file bounds
  299.  Next ' end loop through monster treasure
  300.  Outpt=Outpt+Str$(Var3)+" items." ' append counter
  301.  Call IO.O ' send output message
  302. End Sub ' end routine
  303.  
  304.  Rem * This routines displays information on the monster class file.
  305.  Rem * input variables:
  306.  Rem *   Number - the monster class file record.
  307.  
  308. Sub Display.Monster.Class(Number)
  309.  On Local Error Resume Next ' local error resume
  310.  If Number<=0 Then ' check number
  311.     Exit Sub ' exit subroutine
  312.  Endif ' end check number
  313.  Graphics.Off=False ' reset color
  314.  Outpt="Monster class number"+Str$(Number)+":"
  315.  Call IO.O ' send output message
  316.  Graphics.Off=True ' reset color
  317.  For Array.Number=1 To 10 ' loop through the monster classes
  318.     ' get monster number in class
  319.     Monster.Index=MonclassRecord.Monsters(Array.Number)
  320.     ' file bounds
  321.     If Monster.Index>False And _
  322.     Monster.Index<=Lof(MonsterFile)/Len(MonsterRecord) Then
  323.        Call Read.Record(MonsterFile,Monster.Index) ' get monster record
  324.        Outpt="Monster number"+Str$(Array.Number)+":"+ _
  325.        Rtrim$(MonsterRecord.MonsterName) ' make display message
  326.        Call IO.O ' send output message
  327.     Endif ' end check file bounds
  328.  Next ' end loop through monster class
  329. End Sub ' end routine to display monster class
  330.  
  331.  Rem * This routines displays information on the nonplayer file.
  332.  Rem * input variables:
  333.  Rem *   Number - the nonplayer file record.
  334.  
  335. Sub Display.Nonplayer(Number)
  336.  On Local Error Resume Next ' local error resume
  337.  If Number<=0 Then ' check number
  338.     Exit Sub ' exit subroutine
  339.  Endif ' end check number
  340.  Graphics.Off=False ' reset color
  341.  Outpt="Nonplayer number"+Str$(Number)+":" ' nonplayer number message
  342.  Call IO.O ' send output message
  343.  Graphics.Off=True ' reset color
  344.  Outpt="[A]Nonplayer name: "+Rtrim$(MonsterRecord.MonsterName) ' message
  345.  Call IO.O ' send output message
  346.  Outpt="[B]Nonplayer rooms: "+MonsterRecord.PluralName ' message
  347.  Call IO.O ' send output message
  348.  Outpt="[C]Nonplayer level:"+Str$(MonsterRecord.Level) ' message
  349.  Call IO.O ' send output message
  350.  Outpt="[D]Hit points:"+Str$(MonsterRecord.Hits) ' message
  351.  Call IO.O ' send output message
  352.  Outpt="[E]Experience points:"+Str$(MonsterRecord.Experience) ' message
  353.  Call IO.O ' send output message
  354.  Outpt="[F]Gold points:"+Str$(MonsterRecord.Gold) ' message
  355.  Call IO.O ' send output message
  356.  Outpt="[G]Poisonous nonplayer: " ' message
  357.  If MonsterRecord.Poison Then ' verify nonplayer
  358.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.PoisonPercent),2)+ _
  359.     " percent)" ' message
  360.  Else ' verify
  361.     Outpt=Outpt+"No" ' add to message
  362.  Endif ' end verify
  363.  Call IO.O ' send output message
  364.  Outpt="[H]Level draining nonplayer: " ' message
  365.  If MonsterRecord.LevelDrain Then ' verify nonplayer
  366.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.DrainPercent),2)+ _
  367.     " percent)" ' message
  368.  Else ' verify
  369.     Outpt=Outpt+"No" ' add to message
  370.  Endif ' end verify
  371.  Call IO.O ' send output message
  372.  Outpt="[I]Nonplayer blocks exits: " ' message
  373.  If MonsterRecord.Block Then ' verify nonplayer
  374.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.BlockPercent),2)+ _
  375.     " percent)" ' message
  376.  Else ' verify
  377.     Outpt=Outpt+"No" ' add to message
  378.  Endif ' end verify
  379.  Call IO.O ' send output message
  380.  Outpt="[J]Nonplayer prevents treasure take: " ' message
  381.  If MonsterRecord.Prevent Then ' verify nonplayer
  382.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.PreventPercent),2)+ _
  383.     " percent)" ' message
  384.  Else ' verify
  385.     Outpt=Outpt+"No" ' add to message
  386.  Endif ' end verify
  387.  Call IO.O ' send output message
  388.  Outpt="[K]Nonplayer follows player: " ' message
  389.  If MonsterRecord.Follow Then ' verify nonplayer
  390.     Outpt=Outpt+"Yes("+Mid$(Str$(MonsterRecord.FollowPercent),2)+ _
  391.     " percent)("+Mid$(Str$(MonsterRecord.Teleport),2)+"% teleport)" ' message
  392.  Else ' verify
  393.     Outpt=Outpt+"No" ' add to message
  394.  Endif ' end verify
  395.  Call IO.O ' send output message
  396.  Outpt="[L]Nonplayer casts spells: " ' message
  397.  Spell.Number=MonsterRecord.Spell ' store spell number
  398.  If Spell.Number=False Then ' verify nonplayer
  399.     Outpt=Outpt+"No" ' add to message
  400.  Else ' verify
  401.     ' file bounds
  402.     If Spell.Number>False And _
  403.     Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  404.        Call Read.Record(SpellFile,Spell.Number) ' get spell record
  405.        Outpt=Outpt+"Yes, "+Rtrim$(SpellRecord.SpellName)+"("+ _
  406.        Mid$(Str$(MonsterRecord.SpellPercent),2)+" percent)" ' message
  407.     Endif ' end check file bounds
  408.  Endif ' end verify
  409.  Call IO.O ' send output message
  410.  Outpt="[M]Nonplayer jails attacker: " ' message
  411.  If MonsterRecord.Jail Then ' verify nonplayer
  412.     Outpt=Outpt+"Yes" ' add to message
  413.  Else ' verify
  414.     Outpt=Outpt+"No" ' add to message
  415.  Endif ' end verify
  416.  Call IO.O ' send output message
  417.  Outpt="[N]Encounter rate:"+Str$(MonsterRecord.Rate)+ _
  418.  "("+Mid$(Str$(MonsterRecord.RatePercent),2)+" percent)" ' message
  419.  Call IO.O ' send output message
  420.  Outpt="[O]Nonplayer uses psionics: " ' message
  421.  If MonsterRecord.Psionic=False Then ' verify nonplayer
  422.     Outpt=Outpt+"No" ' add to message
  423.  Else ' verify
  424.     Spell.Number=MonsterRecord.PsionicSpell ' store psionic spell number
  425.     ' file bounds
  426.     If Spell.Number>False And _
  427.     Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  428.        Call Read.Record(SpellFile,Spell.Number) ' get spell record
  429.        Outpt=Outpt+"Yes, "+SpellRecord.SpellName ' message
  430.     Endif ' end check file bounds
  431.  Endif ' end verify
  432.  Call IO.O ' send output message
  433.  Outpt="[P]Carries treasure:" ' message
  434.  Call IO.O ' send output message
  435.  For Array.Number=1 To 5 ' loop through nonplayer treasure
  436.     ' get nonplayer treasure number
  437.     Treasure.Number=MonsterRecord.Treasure(Array.Number)
  438.     If Treasure.Number>False And _
  439.     Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then ' file bounds
  440.        Call Read.Record(TreasureFile,Treasure.Number) ' get treasure record
  441.        Outpt=TreasureRecord.TreasureName ' store treasure name
  442.        Call IO.O ' send output message
  443.     Endif ' end check file bounds
  444.  Next ' end loop through nonplayer treasure
  445. End Sub ' end routine
  446.  
  447.  Rem * This routines displays information on the object file.
  448.  Rem * input variables:
  449.  Rem *   Number - the object file record.
  450.  
  451. Sub Display.Object(Number)
  452.  On Local Error Resume Next ' local error resume
  453.  If Number<=0 Then ' check number
  454.     Exit Sub ' exit subroutine
  455.  Endif ' end check number
  456.  Graphics.Off=False ' reset color
  457.  Outpt="Object number"+Str$(Number)+":" ' object number message
  458.  Call IO.O ' send output message
  459.  Graphics.Off=True ' reset color
  460.  Outpt="[A]Object name: "+Rtrim$(ObjectRecord.ObjectName) ' message
  461.  Call IO.O ' send output message
  462.  Outpt="[B]Object identifier: "+Lcase$(Rtrim$(ObjectRecord.ShortName))
  463.  Call IO.O ' send output message
  464.  Outpt="[C]Room number link:"+Str$(ObjectRecord.RoomLink) ' message
  465.  Call IO.O ' send output message
  466.  Outpt="[D]Trapped portal: " ' message
  467.  Select Case ObjectRecord.Trap ' selection of object trap type
  468.  Case False ' verify object
  469.     Outpt=Outpt+"No" ' add to message
  470.  Case 1 ' verify object
  471.     Outpt=Outpt+"poison needles" ' message
  472.  Case 2 ' berify object
  473.     Outpt=Outpt+"teleport to"+Str$(ObjectRecord.Teleport) ' message
  474.  Case 3 ' verify object
  475.     Outpt=Outpt+"hits for"+Str$(Abs(ObjectRecord.Teleport))+" " ' message
  476.     Select Case Object.Teleport ' selection of object trap hit type
  477.     Case Is<False ' verify object
  478.        Outpt=Outpt+"vitality" ' message
  479.     Case Else ' verify object
  480.        Outpt=Outpt+"fatigue" ' message
  481.     End Select ' end selection of object hit type
  482.  End Select ' end selection of object type
  483.  Call IO.O ' send output message
  484.  Outpt="[E]Long description:" ' message
  485.  Call IO.O ' send output message
  486.  Outpt=Rtrim$(ObjectRecord.LongDesc) ' message
  487.  If Outpt=Nul Then ' check message
  488.     Outpt="<none>" ' reset
  489.  Endif ' end check message
  490.  Call IO.O ' send output message
  491.  Outpt="[F]Entry description:" ' message
  492.  Call IO.O ' send output message
  493.  Outpt=Rtrim$(ObjectRecord.ShortDesc) ' message
  494.  If Outpt=Nul Then ' check message
  495.     Outpt="<none>" ' reset
  496.  Endif ' end check message
  497.  Call IO.O ' send output message
  498.  Outpt="[G]Hidden object: " ' message
  499.  If ObjectRecord.Hidden Then ' verify object
  500.     Outpt=Outpt+"Yes" ' add to message
  501.  Else ' verify
  502.     Outpt=Outpt+"No" ' add to message
  503.  Endif ' end verify
  504.  Call IO.O ' send output message
  505.  Outpt="[H]Invisible object: " ' message
  506.  If ObjectRecord.Invisible Then ' verify object
  507.     Outpt=Outpt+"Yes" ' add to message
  508.  Else ' verify
  509.     Outpt=Outpt+"No" ' add to message
  510.  Endif ' end verify
  511.  Call IO.O ' send output message
  512.  Outpt="[I]Jail attacker trap: " ' message
  513.  If ObjectRecord.JailTrap Then ' verify object
  514.     Outpt=Outpt+"Yes" ' add to message
  515.  Else ' verify
  516.     Outpt=Outpt+"No" ' add to message
  517.  Endif ' end verify
  518.  Call IO.O ' send output message
  519.  Outpt="[J]Locked portal: " ' message
  520.  If ObjectRecord.DoorLock=2 Then ' verify object
  521.     Outpt=Outpt+"Yes" ' add to message
  522.  Else ' verify
  523.     Outpt=Outpt+"No" ' add to message
  524.  Endif ' end verify
  525.  Call IO.O ' send output message
  526.  Outpt="[K]Relocking portal: " ' message
  527.  If ObjectRecord.Relocks Then ' verify object
  528.     Outpt=Outpt+"Yes" ' add to message
  529.  Else ' verify
  530.     Outpt=Outpt+"No" ' add to message
  531.  Endif ' end verify
  532.  Call IO.O ' send output message
  533.  Outpt="[L]Key number:"+Str$(ObjectRecord.Keyed) ' message
  534.  Call IO.O ' send output message
  535.  Outpt="[M]Permanent object: " ' message
  536.  If ObjectRecord.Permanent Then ' verify object
  537.     Outpt=Outpt+"Yes" ' add to message
  538.  Else ' verify
  539.     Outpt=Outpt+"No" ' add to message
  540.  Endif ' end verify
  541.  Call IO.O ' send output message
  542.  Outpt="[N]Object is a light: " ' message
  543.  If ObjectRecord.LightRoom=False Then ' verify object
  544.     Outpt=Outpt+"No" ' add to message
  545.  Else ' verify
  546.     Outpt=Outpt+"Yes, Light Time: " ' message
  547.     If ObjectRecord.LightTime=False Then ' verify object
  548.        Outpt=Outpt+"<any>" ' message
  549.     Else ' verify
  550.        Outpt=Outpt+"From:"+Right$(Str$(ObjectRecord.FromHour+100),2)+":"+ _
  551.        Right$(Str$(ObjectRecord.FromMin+100),2)+" to "+ _
  552.        Right$(Str$(ObjectRecord.ToHour+100),2)+":"+ _
  553.        Right$(Str$(ObjectRecord.ToMin+100),2) ' message
  554.     Endif ' end verify
  555.  Endif ' end verify
  556.  Call IO.O ' send output message
  557. End Sub ' end routine
  558.  
  559.  Rem * This routines displays information on the room file.
  560.  Rem * input variables:
  561.  Rem *   Number! - the room file record.
  562.  
  563. Sub Display.Room.Desc(Number!)
  564.  On Local Error Resume Next ' local error resume
  565.  If Number!<=0! Then ' check number
  566.     Exit Sub ' exit subroutine
  567.  Endif ' end check number
  568.  Graphics.Off=False ' reset color
  569.  Outpt="Room number"+Str$(Number!)+": Action"+Str$(RoomRecord.Action)+ _
  570.  ": Monster class:"+Str$(RoomRecord.MonsterClass)+"." ' make room message
  571.  Call IO.O ' send output message
  572.  Outpt="Short description:" ' message
  573.  Call IO.O ' send output message
  574.  Graphics.Off=True ' reset color
  575.  Outpt=Rtrim$(RoomRecord.ShortDesc) ' message
  576.  If Instr(Outpt,Chr$(0)) Then ' find any null characters from old structures
  577.     Outpt=Left$(Outpt,Instr(Outpt,Chr$(0))-1) ' truncate off nulls
  578.  Endif ' end find old nulls
  579.  Call IO.O ' send output message
  580.  Graphics.Off=False ' reset color
  581.  Outpt="Long description:" ' message
  582.  Call IO.O ' send output message
  583.  Graphics.Off=True ' reset color
  584.  For Array.Number=1 To 4 ' loop through all four long room description lines
  585.     Outpt=RoomRecord.LongDesc(Array.Number) ' get next room description line
  586.     Outpt=Rtrim$(Outpt) ' trim room description line
  587.     If Instr(Outpt,Chr$(0)) Then ' find any nul characters from old files
  588.        Outpt=Left$(Outpt,Instr(Outpt,Chr$(0))-1) ' truncate off nulls
  589.     Endif ' end find old nulls
  590.     If Outpt=Nul Then ' check if long description ends
  591.        Exit For ' exit long description display loop
  592.     Endif ' end check description end
  593.     Call IO.O ' send output message
  594.  Next ' end long room description loop
  595. End Sub ' end routine
  596.  
  597.  Rem * This routines displays information on the spell file.
  598.  Rem * input variables:
  599.  Rem *   Number - the spell file record.
  600.  
  601. Sub Display.Spell(Number)
  602.  On Local Error Resume Next ' local error resume
  603.  If Number<=0 Then ' check number
  604.     Exit Sub ' exit subroutine
  605.  Endif ' end check number
  606.  Graphics.Off=False ' reset color
  607.  Outpt="Spell number"+Str$(Number)+":" ' spell number message
  608.  Call IO.O ' send output message
  609.  Graphics.Off=True ' reset color
  610.  Outpt="[A]Spell name: "+Rtrim$(SpellRecord.SpellName) ' message
  611.  Call IO.O ' send output message
  612.  Outpt="[B]Spell chant:" ' message
  613.  Call IO.O ' send output message
  614.  Outpt=Lcase$(Rtrim$(SpellRecord.Chant)) ' message
  615.  Call IO.O ' send output message
  616.  Outpt="[C]Spell cast description:" ' message
  617.  Call IO.O ' send output message
  618.  Outpt=Rtrim$(SpellRecord.Desc)
  619.  Call IO.O ' send output message
  620.  Outpt="[D]Spell level:"+Str$(SpellRecord.Level) ' message
  621.  Call IO.O ' send output message
  622.  Outpt="[E]" ' set to option
  623.  Select Case SpellRecord.SpellType ' selection of spell type
  624.  Case Enchant
  625.     Inpt="Enchant" ' message
  626.  Case Offense
  627.     Inpt="Offense" ' message
  628.  Case Bless
  629.     Inpt="Bless" ' message
  630.  Case Wish
  631.     Inpt="Wish" ' message
  632.  Case Poison
  633.     Inpt="Poison" ' message
  634.  Case Vigor
  635.     Inpt="Vigor" ' message
  636.  Case Heal
  637.     Inpt="Heal" ' message
  638.  Case CurePoison
  639.     Inpt="Curepoison" ' message
  640.  Case LevelDrain
  641.     Inpt="Level Drain" ' message
  642.  Case Teleport
  643.     Inpt="Teleport to Room"+Str$(SpellRecord.Teleport)
  644.  Case Befuddled
  645.     Inpt="Befuddle" ' message
  646.  Case TurnUndead
  647.     Inpt="Turn Undead" ' message
  648.  Case PassDoor
  649.     Inpt="Pass Door" ' message
  650.  Case Conjure
  651.     Inpt="Conjure" ' message
  652.  Case Psionic
  653.     Inpt="Psionic" ' message
  654.  Case DetectLock
  655.     Inpt="Detect Lock" ' message
  656.  Case DetectEvil
  657.     Inpt="Detect Evil" ' message
  658.  Case DetectTrap
  659.     Inpt="Detect Trap" ' message
  660.  Case Intoxicate
  661.     Inpt="Intoxicate" ' message
  662.  Case SetTrap
  663.     Inpt="Set Trap" ' message
  664.  Case Hiding
  665.     Inpt="Hide" ' message
  666.  Case Search
  667.     Inpt="Search" ' message
  668.  Case Invisibility
  669.     Inpt="Invisibility" ' message
  670.  Case Identify
  671.     Inpt="Identify" ' message
  672.  Case Enlighten
  673.     Inpt="Enlighten" ' message
  674.  Case Illuminate
  675.     Inpt="Illuminate" ' message
  676.  Case Psyche
  677.     Inpt="Psyche" ' message
  678.  Case Telepathy
  679.     Inpt="Telepathy" ' message
  680.  Case Else ' other
  681.     Inpt="<none>" ' message
  682.  End Select ' end selection of spell type
  683.  Outpt=Outpt+"Spell type: "+Inpt ' message
  684.  Call IO.O ' send output message
  685.  Outpt="[F]Spell is psionic: " ' message
  686.  If SpellRecord.Psionic=False Then ' verify spell
  687.     Outpt=Outpt+"No" ' add to message
  688.  Else ' verify
  689.     Outpt=Outpt+"Yes, " ' message
  690.     Select Case SpellRecord.PsionicMode ' selection of spell psionic type
  691.     Case PsiAttack
  692.        Outpt=Outpt+"Attack" ' message
  693.     Case PsiDefense
  694.        Outpt=Outpt+"Defense" ' message
  695.     Case Else ' other
  696.        Outpt=Outpt+"<none>" ' message
  697.     End Select ' end selection of spell type
  698.  Endif ' end verify
  699.  Call IO.O ' send output message
  700.  Outpt="[G]Characters which can cast spell:" ' message
  701.  Call IO.O ' send output message
  702.  Spell.Cast=False ' set spell cast found flag
  703.  For Class.Number=1 To 8 ' loop through spell cast flags
  704.     If SpellRecord.ClassType And 2^Class.Number Then ' compare spell cast flag
  705.        Class.Type$=Class.Name(Class.Number) ' store class name
  706.        Class.Type$=Rtrim$(Class.Type$) ' trim name
  707.        ' uppercase first word
  708.        Mid$(Class.Type$,1,1)=Ucase$(Mid$(Class.Type$,1,1))
  709.        Outpt=Outpt+Class.Type$+", " ' append to output string
  710.        Spell.Cast=True ' set spell cast found flag
  711.     Endif ' end compare spell cast flags
  712.  Next ' end loop through spell cast flags
  713.  If Spell.Cast Then ' check spell cast found flag
  714.     Outpt=Left$(Outpt,Len(Outpt)-2)+"." ' message
  715.  Else ' check spell flag
  716.     Outpt="<none>" ' message
  717.  Endif ' end check spell cast found flag
  718.  Call IO.O ' send output message
  719.  Outpt="[H]Spell ingredients:" ' message
  720.  Call IO.O ' send output message
  721.  Spell.Ingredient=False ' set spell ingredient found flag
  722.  For Array.Number=1 To 5 ' loop through spell ingerdients
  723.     ' get spell ingredient number
  724.     Treasure.Number=SpellRecord.Ingred(Array.Number)
  725.     If Treasure.Number>False And _
  726.     Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then ' file bounds
  727.        Call Read.Record(TreasureFile,Treasure.Number) ' get treasure record
  728.        Ingredient.Name$=TreasureRecord.TreasureName ' store treasure name
  729.        Ingredient.Name$=Rtrim$(Ingredient.Name$) ' trim name
  730.        Ingredient.Name$=Lcase$(Ingredient.Name$) ' lowercase name
  731.        ' uppercase first word
  732.        Mid$(Ingredient.Name$,1,1)=Ucase$(Mid$(Ingredient.Name$,1,1))
  733.        Outpt=Outpt+Ingredient.Name$+", " ' message
  734.        Spell.Ingredient=True ' set spell ingredient found flag
  735.     Endif ' end check file bounds
  736.  Next ' end loop through spell ingredients
  737.  If Spell.Ingredient Then ' check spell ingredient found flag
  738.     Outpt=Left$(Outpt,Len(Outpt)-2)+"." ' message
  739.  Else ' check spell ingredient
  740.     Outpt="<none>" ' message
  741.  Endif ' end check spell ingredient found flag
  742.  Call IO.O ' send output message
  743.  Outpt="[I]Spell casting type which requires ingredients:" ' message
  744.  Call IO.O ' send output message
  745.  Spell.Requirement=False ' set ingredient requirement flag
  746.  If SpellRecord.SpellFlag And Use.Spell.Type Then ' verify spell
  747.     Outpt="use command, " ' message
  748.     Spell.Requirement=True ' set ingredient flag
  749.  Endif ' end verify
  750.  If SpellRecord.SpellFlag And Scroll.Spell.Type Then ' verify spell
  751.     Outpt=Outpt+"read scroll, " ' message
  752.     Spell.Requirement=True ' set ingredient flag
  753.  Endif ' end verify
  754.  If SpellRecord.SpellFlag And Cast.Spell.Type Then ' verify spell
  755.     Outpt=Outpt+"cast spell, " ' message
  756.     Spell.Requirement=True ' set ingredient flag
  757.  Endif ' end verify
  758.  If Spell.Requirement Then ' check ingredient flag
  759.     Outpt=Left$(Outpt,Len(Outpt)-2)+"." ' message
  760.  Else ' check flag
  761.     Outpt="<none>" ' message
  762.  Endif ' end check ingredient flag
  763.  Call IO.O ' send output message
  764. End Sub ' end routine
  765.  
  766.  Rem * This routines displays information on the treasure file.
  767.  Rem * input variables:
  768.  Rem *   Number - the treasure file record.
  769.  
  770. Sub Display.Treasure(Number)
  771.  On Local Error Resume Next ' local error resume
  772.  If Number<=0 Then ' check number
  773.     Exit Sub ' exit subroutine
  774.  Endif ' end check number
  775.  Graphics.Off=False ' reset color
  776.  Outpt="Treasure number"+Str$(Number)+":" ' treasure number message
  777.  Call IO.O ' send output message
  778.  Graphics.Off=True ' reset color
  779.  Outpt="[A]Treasure name: "+TreasureRecord.TreasureName ' message
  780.  Outpt=Left$(Outpt,40) ' truncate string
  781.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  782.     Outpt=Outpt+"[U]Treasure is coins: " ' message
  783.  If TreasureRecord.Coin Then ' verify treasure
  784.     Outpt=Outpt+"Yes" ' add to message
  785.  Else ' verify
  786.     Outpt=Outpt+"No" ' add to message
  787.  Endif ' end verify
  788.  Call IO.O ' send output message
  789.  Outpt="[B]Treasure identifier: "+Lcase$(TreasureRecord.ShortName) ' message
  790.  Outpt=Left$(Outpt,40) ' truncate string
  791.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  792.     Outpt=Outpt+"[V]Treasure is a potion: " ' message
  793.  If TreasureRecord.Potion Then ' verify treasure
  794.     Outpt=Outpt+"Yes" ' add to message
  795.  Else ' verify
  796.     Outpt=Outpt+"No" ' add to message
  797.  Endif ' end verify
  798.  Call IO.O ' send output message
  799.  Outpt="[C]Weight:"+Str$(TreasureRecord.Weight) ' message
  800.  Outpt=Left$(Outpt,40) ' truncate string
  801.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  802.     Outpt=Outpt+"[W]Treasure is a scroll: " ' message
  803.  If TreasureRecord.Scroll Then ' verify treasure
  804.     Outpt=Outpt+"Yes" ' add to message
  805.  Else ' verify
  806.     Outpt=Outpt+"No" ' add to message
  807.  Endif ' end verify
  808.  Call IO.O ' send output message
  809.  Outpt="[D]Gold coin value:"+Str$(TreasureRecord.Gold) ' message
  810.  Outpt=Left$(Outpt,40) ' truncate string
  811.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  812.     Outpt=Outpt+"[X]Treasure is invisible: " ' message
  813.  If TreasureRecord.Invisible Then ' verify treasure
  814.     Outpt=Outpt+"Yes" ' add to message
  815.  Else ' verify
  816.     Outpt=Outpt+"No" ' add to message
  817.  Endif ' end verify
  818.  Call IO.O ' send output message
  819.  Outpt="[E]Treasure type: " ' message
  820.  If TreasureRecord.Loadable Then ' check treasure type
  821.     Outpt=Outpt+"Loadable" ' append message
  822.  Else ' check next type
  823.     If TreasureRecord.Launchable Then ' check treasure type
  824.        Outpt=Outpt+"Launchable" ' append message
  825.     Else ' check next type
  826.        Select Case TreasureRecord.Type ' selection of treasure type
  827.        Case False ' verify treasure type
  828.           If TreasureRecord.Plus=False Then ' verify weapon type
  829.              Outpt=Outpt+"Treasure" ' message
  830.           Else ' verify type
  831.              Outpt=Outpt+"Weapon" ' message
  832.           Endif ' end verify treasure type
  833.        Case Is<False ' verify shield type
  834.           Outpt=Outpt+"Shield" ' message
  835.        Case Is>False ' verify armor type
  836.           Outpt=Outpt+"Armor" ' message
  837.        End Select ' end selection of treasure type
  838.     Endif ' end check treasure type
  839.  Endif ' end check treasure type
  840.  Outpt=Left$(Outpt,40) ' truncate string
  841.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  842.  Outpt=Outpt+"[Y]Treasure is a container: " ' message
  843.  If TreasureRecord.Container Then ' verify treasure
  844.     Outpt=Outpt+"Yes" ' add to message
  845.  Else ' verify
  846.     Outpt=Outpt+"No" ' add to message
  847.  Endif ' end verify
  848.  Call IO.O ' send output message
  849.  Outpt="[F]Hit plus:"+Str$(Abs(TreasureRecord.Plus)) ' message
  850.  Outpt=Left$(Outpt,40) ' truncate string
  851.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  852.  Outpt=Outpt+"[Z]Container is locked: " ' message
  853.  If TreasureRecord.Locked=1 And TreasureRecord.Closed=1 Then ' verify treasure
  854.     Outpt=Outpt+"Yes" ' add to message
  855.  Else ' verify
  856.     Outpt=Outpt+"No" ' add to message
  857.  Endif ' end verify
  858.  Call IO.O ' send output message
  859.  Outpt="[G]Charges:"+Str$(TreasureRecord.Charges) ' message
  860.  Outpt=Left$(Outpt,40) ' truncate string
  861.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  862.     Outpt=Outpt+"[1]Treasure key number:"+Str$(TreasureRecord.Keyed) ' message
  863.  Call IO.O ' send output message
  864.  Outpt="[H]Weapon class: " ' message
  865.  ' selection of treasure proficiency type
  866.  Select Case TreasureRecord.Proficiency
  867.  Case Blunt
  868.     Outpt=Outpt+"Blunt" ' message
  869.  Case Pole
  870.     Outpt=Outpt+"Pole" ' message
  871.  Case Sharp
  872.     Outpt=Outpt+"Sharp" ' message
  873.  Case Thrusting
  874.     Outpt=Outpt+"Thrusting" ' message
  875.  Case Else ' other
  876.     Outpt=Outpt+"None" ' message
  877.  End Select ' end selection of weapon proficiency type
  878.  Outpt=Left$(Outpt,40) ' truncate string
  879.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  880.     Outpt=Outpt+"[2]Treasure is fuel: " ' message
  881.  If TreasureRecord.FuelType=False Then ' verify treasure
  882.     Outpt=Outpt+"No" ' add to message
  883.  Else ' verify
  884.     Outpt=Outpt+"Yes:"+Str$(TreasureRecord.FuelCharges)+" charges" ' message
  885.  Endif ' end verify
  886.  Call IO.O ' send output message
  887.  Outpt="[I]Treasure is permanent: " ' message
  888.  If TreasureRecord.Permanent Then ' verify treasure
  889.     Outpt=Outpt+"Yes" ' add to message
  890.  Else ' verify
  891.     Outpt=Outpt+"No" ' add to message
  892.  Endif ' end verify
  893.  Outpt=Left$(Outpt,40) ' truncate string
  894.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  895.     Outpt=Outpt+"[3]Weapon rusts: " ' message
  896.  If TreasureRecord.Rustable Then ' verify treasure
  897.     Outpt=Outpt+"Yes:"+Str$(TreasureRecord.RustPercent)+"%"
  898.  Else ' verify
  899.     Outpt=Outpt+"No" ' add to message
  900.  Endif ' end verify
  901.  Call IO.O ' send output message
  902.  Outpt="[J]Treasure is edible: " ' message
  903.  If TreasureRecord.Edible Then ' verify treasure
  904.     Outpt=Outpt+"Yes" ' add to message
  905.  Else ' verify
  906.     Outpt=Outpt+"No" ' add to message
  907.  Endif ' end verify
  908.  Outpt=Left$(Outpt,40) ' truncate string
  909.  Outpt=Outpt+Space$(40-Len(Outpt)) ' pad with blanks
  910.     Outpt=Outpt+"[4]Weapon is stealable: " ' message
  911.  If TreasureRecord.Stealable Then ' verify treasure
  912.     Outpt=Outpt+"Yes:"+Str$(TreasureRecord.StealPercent)+"%"
  913.  Else ' verify
  914.     Outpt=Outpt+"No" ' add to message
  915.  Endif ' end verify
  916.  Call IO.O ' send output message
  917.  Outpt="[K]Treasure is magical: " ' message
  918.  Spell.Number=TreasureRecord.Spell ' store spell number
  919.  If Spell.Number=False Then ' verify treasure
  920.     Outpt=Outpt+"No" ' add to message
  921.  Else ' verify
  922.     ' file bounds
  923.     If Spell.Number>False And _
  924.     Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  925.        Call Read.Record(SpellFile,Spell.Number) ' get spell record
  926.        Outpt=Outpt+"Yes, "+Rtrim$(SpellRecord.SpellName)+" spell" ' message
  927.     Endif ' end check file bounds
  928.  Endif ' end verify
  929.  Call IO.O ' send output message
  930.  Outpt="[L]Treasure is a ring: " ' message
  931.  Select Case TreasureRecord.RingType
  932.  Case 1
  933.     Outpt=Outpt+"protection from poison" ' message
  934.  Case 2
  935.     Outpt=Outpt+"protection from level drain" ' message
  936.  Case 3
  937.     Outpt=Outpt+"protection from spell: " ' message
  938.     Spell.Number=TreasureRecord.RingSpell ' store ring spell number
  939.     If Spell.Number=True Then ' verify treasure
  940.        Outpt=Outpt+"generic spell" ' message
  941.     Else ' verify
  942.        ' file bounds
  943.        If Spell.Number>False And _
  944.        Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  945.           Call Read.Record(SpellFile,Spell.Number) ' get spell record
  946.           Outpt=Outpt+Rtrim$(Lcase$(SpellRecord.SpellName))+" spell" ' message
  947.        Endif ' end check file bounds
  948.     Endif ' end verify
  949.  Case Else ' verify
  950.     Outpt=Outpt+"No" ' add to message
  951.  End Select
  952.  Call IO.O ' send output message
  953.  Outpt="[M]Treasure is a light: " ' message
  954.  If TreasureRecord.LightType=False Then ' verify treasure
  955.     Outpt=Outpt+"No" ' add to message
  956.  Else ' verify
  957.     Outpt=Outpt+"Yes, Charges:"+Str$(TreasureRecord.LightCharges) ' message
  958.  Endif ' end verify
  959.  Call IO.O ' send output message
  960.  Outpt="[N]Treasure is a vehicle: " ' message
  961.  If TreasureRecord.Vehicle=False Then ' verify treasure
  962.     Outpt=Outpt+"No" ' add to message
  963.  Else ' verify
  964.     Outpt=Outpt+"Yes, hits:"+Str$(TreasureRecord.VehicleHits) ' message
  965.  Endif ' end verify
  966.  Call IO.O ' send output message
  967.  Outpt="[O]Treasure loads from devices: " ' message
  968.  If TreasureRecord.Ammunition Then ' verify treasure
  969.     Outpt=Outpt+"Yes" ' add to message
  970.  Else ' verify
  971.     Outpt=Outpt+"No" ' add to message
  972.  Endif ' end verify
  973.  Call IO.O ' send output message
  974.  Outpt="[P]Treasure is loadable: " ' message
  975.  If TreasureRecord.Loadable Then ' verify treasure
  976.     Outpt=Outpt+"Yes: Loads(" ' add to message
  977.     ' store ammunition treasure number
  978.     Treasure.Number=TreasureRecord.AmmoLoads
  979.     If Treasure.Number>False And _
  980.     Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then ' file bounds
  981.        Call Share.Record(TreasureFile,Number) ' store current treasure record
  982.        Call Read.Record(TreasureFile,Treasure.Number) ' get treasure record
  983.        Outpt=Outpt+Rtrim$(TreasureRecord.TreasureName)+")" ' message
  984.        Call Read.Record(TreasureFile,Number) ' restore treasure record
  985.     Else ' check file bounds
  986.        Outpt=Outpt+"<none>)" ' append message
  987.     Endif ' end check file bounds
  988.  Else ' verify
  989.     Outpt=Outpt+"No" ' add to message
  990.  Endif ' end verify
  991.  Call IO.O ' send output message
  992.  Outpt="[R]Treasure launchs from devices: " ' message
  993.  If TreasureRecord.LaunchAmmo Then ' verify treasure
  994.     Outpt=Outpt+"Yes" ' add to message
  995.  Else ' verify
  996.     Outpt=Outpt+"No" ' add to message
  997.  Endif ' end verify
  998.  Call IO.O ' send output message
  999.  Outpt="[S]Treasure is launchable: " ' message
  1000.  If TreasureRecord.Launchable Then ' verify treasure
  1001.     Outpt=Outpt+"Yes: Launchs(" ' add to message
  1002.     ' store ammunition treasure number
  1003.     Treasure.Number=TreasureRecord.LaunchLoads
  1004.     If Treasure.Number>False And _
  1005.     Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then ' file bounds
  1006.        Call Share.Record(TreasureFile,Number) ' store current treasure record
  1007.        Call Read.Record(TreasureFile,Treasure.Number) ' get treasure record
  1008.        Outpt=Outpt+Rtrim$(TreasureRecord.TreasureName)+")" ' message
  1009.        Call Read.Record(TreasureFile,Number) ' restore treasure record
  1010.     Else ' check file bounds
  1011.        Outpt=Outpt+"<none>)" ' append message
  1012.     Endif ' end check file bounds
  1013.  Else ' verify
  1014.     Outpt=Outpt+"No" ' add to message
  1015.  Endif ' end verify
  1016.  Call IO.O ' send output message
  1017.  Outpt="[T]Launchable device can be moved: " ' message
  1018.  If TreasureRecord.Movable Then ' verify treasure
  1019.     Outpt=Outpt+"Yes" ' add to message
  1020.  Else ' verify
  1021.     Outpt=Outpt+"No" ' add to message
  1022.  Endif ' end verify
  1023.  Call IO.O ' send output message
  1024. End Sub ' end routine
  1025.  
  1026.  Rem * This routines displays information on the user file.
  1027.  Rem * input variables:
  1028.  Rem *   Number - the user file record.
  1029.  
  1030. Sub Display.User(Number)
  1031.  On Local Error Resume Next ' local error resume
  1032.  If Number<=0 Then ' check number
  1033.     Exit Sub ' exit subroutine
  1034.  Endif ' end check number
  1035.  Graphics.Off=False ' reset color
  1036.  Outpt="User number"+Str$(Number)+"." ' user number message
  1037.  Call IO.O ' send output message
  1038.  Graphics.Off=True ' reset color
  1039.  Inpt=UserRecord.CodeName ' store player codename
  1040.  Call Decrypt(Inpt) ' decrypt codename
  1041.  Inpt=Rtrim$(Inpt) ' trim codename
  1042.  Inpt=Lcase$(Inpt) ' lowercase codename
  1043.  Mid$(Inpt,1,1)=Ucase$(Mid$(Inpt,1,1)) ' uppercase first word
  1044.  Outpt="[A]Codename: "+Inpt+" " ' message
  1045.  Inpt=String$(10,Mask$) ' mask passwword
  1046.  If Local.Mode Then ' check console
  1047.     Inpt=UserRecord.PassWord ' store password
  1048.     Call Decrypt(Inpt) ' decrypt password
  1049.     Inpt=Rtrim$(Inpt) ' trim password
  1050.     Inpt=Lcase$(Inpt) ' lowercase password
  1051.  Endif ' end check
  1052.  Outpt=Outpt+"[B]Password: "+Inpt ' message
  1053.  Call IO.O ' send output message
  1054.  Outpt="[C]Level:"+Str$(UserRecord.Level) ' message
  1055.  Call IO.O ' send output message
  1056.  Outpt="[D]" ' set to option
  1057.  Class.Number=UserRecord.ClassType ' store player class type
  1058.  Select Case Class.Number ' selection of class type
  1059.  Case 1 To 10 ' check class type
  1060.     Class.Type$=Class.Name(Class.Number) ' store class name
  1061.  Case Else ' check
  1062.     Class.Type$=Class.Name(1) ' default class name
  1063.  End Select ' end selection of class type
  1064.  Outpt=Outpt+"Class: "+Rtrim$(Class.Type$) ' message
  1065.  Call IO.O ' send output message
  1066.  Outpt="[E]" ' set to option
  1067.  Weapon.Number=UserRecord.Proficiency ' store player proficiency number
  1068.  Select Case Weapon.Number ' selection of proficiency
  1069.  Case 1 To 4 ' check type
  1070.     Weapon.Type$=Weapon.Type.Name(Weapon.Number) ' store proficiency name
  1071.  Case Else ' check
  1072.     Weapon.Type$=Weapon.Type.Name(1) ' default name
  1073.  End Select ' end seelction of proficiency
  1074.  Outpt=Outpt+"Weapon proficiency: "+Rtrim$(Weapon.Type$) ' message
  1075.  Call IO.O ' send output message
  1076.  Outpt="[F]Blunt%:"+Str$(UserRecord.Weapons(1))+" " ' message
  1077.  Outpt=Outpt+"[G]Pole%:"+Str$(UserRecord.Weapons(2)) ' message
  1078.  Call IO.O ' send output message
  1079.  Outpt="[H]Sharp%:"+Str$(UserRecord.Weapons(3))+" " ' message
  1080.  Outpt=Outpt+"[I]Thrusting%:"+Str$(UserRecord.Weapons(4)) ' message
  1081.  Call IO.O ' send output message
  1082.  Outpt="[J]Classname: " ' message
  1083.  Inpt=UserRecord.ClassName
  1084.  Call Decrypt(Inpt)
  1085.  Inpt=Rtrim$(Inpt)
  1086.  Outpt=Outpt+Inpt
  1087.  Call IO.O ' send output message
  1088.  Outpt="[K]Strength:"+Str$(UserRecord.Stats(1)) ' message
  1089.  Call IO.O ' send output message
  1090.  Outpt="[L]Intelligence:"+Str$(UserRecord.Stats(2)) ' message
  1091.  Call IO.O ' send output message
  1092.  Outpt="[M]Wisdom:"+Str$(UserRecord.Stats(3)) ' message
  1093.  Call IO.O ' send output message
  1094.  Outpt="[N]Dexterity:"+Str$(UserRecord.Stats(4)) ' message
  1095.  Call IO.O ' send output message
  1096.  Outpt="[O]Constitution:"+Str$(UserRecord.Stats(5)) ' message
  1097.  Call IO.O ' send output message
  1098.  Outpt="[P]Piety:"+Str$(UserRecord.Stats(6)) ' message
  1099.  Call IO.O ' send output message
  1100.  Outpt="[R]Charisma:"+Str$(UserRecord.Stats(7)) ' message
  1101.  Call IO.O ' send output message
  1102.  Outpt="[S]Experience:"+Str$(UserRecord.Experience) ' message
  1103.  Call IO.O ' send output message
  1104.  Outpt="[T]Gold:"+Str$(UserRecord.Gold) ' message
  1105.  Call IO.O ' send output message
  1106.  Outpt="[U]Room number:"+Str$(UserRecord.Room) ' message
  1107.  Call IO.O ' send output message
  1108.  Outpt="[V]Call restrictions." ' message
  1109.  Call IO.O ' send output message
  1110.  Outpt="[W]Inventory." ' message
  1111.  Call IO.O ' send output message
  1112.  Outpt="[X]Special characters: " ' message
  1113.  Special.Flag=False
  1114.  If UserRecord.Flags And Special.Char1 Then ' verify user
  1115.     Outpt=Outpt+"Town Mayor, " ' message
  1116.     Special.Flag=True
  1117.  Endif ' end verify
  1118.  If UserRecord.Flags And Special.Char2 Then ' verify user
  1119.     Outpt=Outpt+"Governor, " ' message
  1120.     Special.Flag=True
  1121.  Endif ' end verify
  1122.  If UserRecord.Flags And Special.Char3 Then ' verify user
  1123.     Outpt=Outpt+"Guild Master, " ' message
  1124.     Special.Flag=True
  1125.  Endif ' end verify
  1126.  If UserRecord.Flags And Special.Char4 Then ' verify user
  1127.     Outpt=Outpt+"Sysop, " ' message
  1128.     Special.Flag=True
  1129.  Endif ' end verify
  1130.  If Special.Flag Then ' verify user
  1131.     Outpt=Left$(Outpt,Len(Outpt)-2)+"." ' message
  1132.  Else ' verify
  1133.     Outpt=Outpt+"None." ' message
  1134.  Endif ' end verify
  1135.  Call IO.O ' send output message
  1136.  Outpt="[!]Delete user" ' message
  1137.  Call IO.O ' send output message
  1138.  Graphics.Off=False ' reset color
  1139. End Sub ' end routine
  1140.  
  1141.  Rem * routine used by the editor to find monster file number
  1142.  Rem * of a monster name.
  1143.  Rem * output variables:
  1144.  Rem *   Number - record number of monster.
  1145.  Rem * processing variables:
  1146.  Rem *   Inpt - monster name or number to search for.
  1147.  Rem *   Parsed.Value - monster number increment.
  1148.  
  1149. Sub Find.Monster(Number)
  1150.  On Local Error Resume Next ' local error resume
  1151.  Outpt="Monster name, or number" ' input prompt
  1152.  Outpt=Outpt+"(1-"+Mid$(Str$(Lof(MonsterFile)/Len(MonsterRecord)),2)+")? "
  1153.  Call IO.I ' get input
  1154.  If Inpt=Nul Then ' compare input length
  1155.     Number=False ' reset number found
  1156.     Exit Sub ' exit routine
  1157.  Endif ' end compare length
  1158.  Call Parse.Num(Inpt,Parsed.Value) ' parse number
  1159.  Number.Count=False ' reset monster found counter
  1160.  For Number=1 To Lof(MonsterFile)/Len(MonsterRecord) ' loop through monsters
  1161.     Call Read.Record(MonsterFile,Number) ' get monster record
  1162.     ' compare monster record name to input monster name,
  1163.     ' truncated to input length
  1164.     If Left$(MonsterRecord.MonsterName,Len(Inpt))=Inpt Then ' compare
  1165.        Number.Count=Number.Count+1 ' increment monster found counter
  1166.        ' compare parsed number of monster to search for
  1167.        If Parsed.Value=False Or Number.Count=Parsed.Value Then ' compare
  1168.           Exit Sub ' exit routine
  1169.        Endif ' end compare counters
  1170.     Endif ' end compare monster names
  1171.  Next ' end loop through monster file
  1172.  Number=Int(Val(Inpt)) ' convert input to integer
  1173.  If Number<=False Or _
  1174.  Number>Lof(MonsterFile)/Len(MonsterRecord) Then ' file bounds
  1175.     Outpt=Range$ ' make error message
  1176.     Call IO.O ' send error message
  1177.     Number=False ' reset monster found
  1178.  Else ' end check file bounds
  1179.     Call Read.Record(MonsterFile,Number) ' get monster record number
  1180.  Endif ' end check file bounds
  1181. End Sub ' end routine
  1182.  
  1183.  Rem * routine used by the editor to find nonplayer file number
  1184.  Rem * of a nonplayer name.
  1185.  Rem * output variables:
  1186.  Rem *   Number - record number of nonplayer.
  1187.  Rem * processing variables:
  1188.  Rem *   Inpt - nonplayer name or number to search for.
  1189.  Rem *   Parsed.Value - nonplayer number increment.
  1190.  
  1191. Sub Find.Nonplayer(Number)
  1192.  On Local Error Resume Next ' local error resume
  1193.  Outpt="Nonplayer name, or number" ' input prompt
  1194.  Outpt=Outpt+"(1-"+Mid$(Str$(Lof(NonPlayerFile)/Len(MonsterRecord)),2)+")? "
  1195.  Call IO.I ' get input
  1196.  If Inpt=Nul Then ' compare input length
  1197.     Number=False ' reset number found
  1198.     Exit Sub ' exit routine
  1199.  Endif ' end compare length
  1200.  Call Parse.Num(Inpt,Parsed.Value) ' parse number
  1201.  Number.Count=False ' reset nonplayer counter
  1202.  For Number=1 To Lof(NonPlayerFile)/Len(MonsterRecord) ' loop through nonplayers
  1203.     Call Read.Record(NonPlayerFile,Number) ' get nonplayer record
  1204.     ' compare nonplayer record name to input nonplayer name,
  1205.     ' truncated to input length
  1206.     If Left$(MonsterRecord.MonsterName,Len(Inpt))=Inpt Then ' compare
  1207.        Number.Count=Number.Count+1 ' increment nonplayer found counter
  1208.        ' compare parsed number of object to search for
  1209.        If Parsed.Value=False Or Number.Count=Parsed.Value Then ' compare
  1210.           Exit Sub ' exit routine
  1211.        Endif ' end compare counters
  1212.     Endif ' end compare nonplayer names
  1213.  Next ' end loop through nonplayer file
  1214.  Number=Int(Val(Inpt)) ' convert input to integer
  1215.  If Number<=False Or _
  1216.  Number>Lof(NonPlayerFile)/Len(MonsterRecord) Then ' file bounds
  1217.     Outpt=Range$ ' make error message
  1218.     Call IO.O ' send error message
  1219.     Number=False ' reset nonplayer found
  1220.  Else ' end check file bounds
  1221.     Call Read.Record(NonPlayerFile,Number) ' get nonplayer record number
  1222.  Endif ' end check file bounds
  1223. End Sub ' end routine
  1224.  
  1225.  Rem * routine used by the editor to find the object file number
  1226.  Rem * of an object name.
  1227.  Rem * output variables:
  1228.  Rem *   Number - record number of object.
  1229.  Rem * processing variables:
  1230.  Rem *   Inpt - object name or number to search for.
  1231.  Rem *   Parsed.Value - object number increment.
  1232.  
  1233. Sub Find.Objects(Number)
  1234.  On Local Error Resume Next ' local error resume
  1235.  Outpt="Object name, or number" ' make input prompt
  1236.  Outpt=Outpt+"(1-"+Mid$(Str$(Lof(ObjectFile)/Len(ObjectRecord)),2)+")? "
  1237.  Call IO.I ' get input
  1238.  If Inpt=Nul Then ' compare input length
  1239.     Number=False ' reset number found
  1240.     Exit Sub ' exit routine
  1241.  Endif ' end compare length
  1242.  Call Parse.Num(Inpt,Parsed.Value) ' get parsed number
  1243.  Number.Count=False ' reset spell found counter
  1244.  For Number=1 To Lof(ObjectFile)/Len(ObjectRecord) ' loop through object file
  1245.     Call Read.Record(ObjectFile,Number) ' get object record
  1246.     ' compare object record name to input object name,
  1247.     ' truncated to input length
  1248.     If Left$(ObjectRecord.ObjectName,Len(Inpt))=Inpt Then ' compare
  1249.        Number.Count=Number.Count+1 ' increment object counter
  1250.        ' compare parsed number of object to search for
  1251.        If Parsed.Value=False Or Number.Count=Parsed.Value Then ' compare
  1252.           Exit Sub ' exit routine
  1253.        Endif ' end compare counters
  1254.     Endif ' end compare object names
  1255.  Next ' end loop through object file
  1256.  Number=Int(Val(Inpt)) ' convert input to integer
  1257.  If Number<=False Or _
  1258.  Number>Lof(ObjectFile)/Len(ObjectRecord) Then ' file bounds
  1259.     Outpt=Range$ ' make error message
  1260.     Call IO.O ' send error message
  1261.     Number=False ' reset object number to zero
  1262.  Else ' end check file bounds
  1263.     Call Read.Record(ObjectFile,Number) ' get object record number
  1264.  Endif ' end check file bounds
  1265. End Sub ' end routine
  1266.  
  1267.  Rem * routine used by the editor to find the spell file number
  1268.  Rem * of a spell name.
  1269.  Rem * output variables:
  1270.  Rem *   Number - record number of spell.
  1271.  Rem * processing variables:
  1272.  Rem *   Inpt - spell name or number to search for.
  1273.  Rem *   Parsed.Value - spell number increment.
  1274.  
  1275. Sub Find.Spell(Number)
  1276.  On Local Error Resume Next ' local error resume
  1277.  Outpt="Spell name, or number" ' input prompt
  1278.  Outpt=Outpt+"(1-"+Mid$(Str$(Lof(SpellFile)/Len(SpellRecord)),2)+")? "
  1279.  Call IO.I ' get input
  1280.  If Inpt=Nul Then ' check length of input
  1281.     Number=False ' reset number found
  1282.     Exit Sub ' exit routine
  1283.  Endif ' end check length
  1284.  Call Parse.Num(Inpt,Parsed.Value) ' parse out number
  1285.  Number.Count=False ' reset spell found counter
  1286.  For Number=1 To Lof(SpellFile)/Len(SpellRecord) ' loop through spell file
  1287.     Call Read.Record(SpellFile,Number) ' get spell record
  1288.     ' compare spell record name to input spell name, truncated to input length
  1289.     If Left$(SpellRecord.SpellName,Len(Inpt))=Inpt Then ' compare
  1290.        Number.Count=Number.Count+1 ' increment spell found
  1291.        ' compare parsed number of spell to search for
  1292.        If Parsed.Value=False Or Number.Count=Parsed.Value Then ' compare
  1293.           Exit Sub ' exit routine
  1294.        Endif ' end compare counters
  1295.     Endif ' end compare spell names
  1296.  Next ' end loop through spell file
  1297.  Number=Int(Val(Inpt)) ' convert input to integer
  1298.  If Number<=False Or _
  1299.  Number>Lof(SpellFile)/Len(SpellRecord) Then ' compare file bounds
  1300.     Outpt=Range$ ' make error message
  1301.     Call IO.O ' send error message
  1302.     Number=False ' reset return spell number to zero
  1303.  Else ' end compare spell number
  1304.     Call Read.Record(SpellFile,Number) ' get spell record number
  1305.  Endif ' end check file bounds
  1306. End Sub ' end routine
  1307.  
  1308.  Rem * routine used by the editor to find the treasure file number
  1309.  Rem * of a treasure name.
  1310.  Rem * output variables:
  1311.  Rem *   Number - record number of spell.
  1312.  Rem * processing variables:
  1313.  Rem *   Inpt - spell name or number to search for.
  1314.  Rem *   Parsed.Value - spell number increment.
  1315.  
  1316. Sub Find.Treasure(Number)
  1317.  On Local Error Resume Next ' local error resume
  1318.  Outpt="Treasure name, or number" ' input prompt
  1319.  Outpt=Outpt+"(1-"+Mid$(Str$(Lof(TreasureFile)/Len(TreasureRecord)),2)+")? "
  1320.  Call IO.I ' get input
  1321.  If Inpt=Nul Then ' compare input length
  1322.     Number=False ' reset number found
  1323.     Exit Sub ' exit routine
  1324.  Endif ' end compare length
  1325.  Call Parse.Num(Inpt,Parsed.Value) ' parse number
  1326.  Number.Count=False ' reset treasure found counter
  1327.  For Number=1 To Lof(TreasureFile)/Len(TreasureRecord) ' loop through treasure
  1328.     Call Read.Record(TreasureFile,Number) ' get treasure record
  1329.     ' compare treasure record name to input treasure name,
  1330.     ' truncated to input length
  1331.     If Left$(TreasureRecord.TreasureName,Len(Inpt))=Inpt Then ' compare
  1332.        Number.Count=Number.Count+1 ' increment treasure found counter
  1333.        ' compare parsed number of treasure to search for
  1334.        If Parsed.Value=False Or Number.Count=Parsed.Value Then ' compare
  1335.           Exit Sub ' exit routine
  1336.        Endif ' end compare counters
  1337.     Endif ' end compare treasure names
  1338.  Next ' end loop through treasure file
  1339.  Number=Int(Val(Inpt)) ' convert input to integer
  1340.  If Number<=False Or _
  1341.  Number>Lof(TreasureFile)/Len(TreasureRecord) Then ' file bounds
  1342.     Outpt=Range$ ' make error message
  1343.     Call IO.O ' send error message
  1344.     Number=False ' reset treasure found
  1345.  Else ' end check file bounds
  1346.     Call Read.Record(TreasureFile,Number) ' get treasure record number
  1347.  Endif ' end check file bounds
  1348. End Sub ' end routine
  1349.  
  1350.  Rem * routine for player to hold an item of inventory.
  1351.  
  1352. Sub Hold.Object
  1353.  On Local Error Resume Next ' local error resume
  1354.  Call Check.Inventory.Treasure ' check player inventory treasure mneomnic
  1355.  If Index.Number=False Then ' found treasure file index
  1356.     Outpt="You aren't carrying that!" ' make message
  1357.     Call IO.O ' send message
  1358.     Exit Sub ' exit routine
  1359.  Endif ' end compare player inventory
  1360.  If TreasureRecord.Type>False Then ' compare treasure type
  1361.     Outpt="You can't hold that!" ' make message
  1362.     Call IO.O ' send message
  1363.     Exit Sub ' exit routine
  1364.  Endif ' end compare treasure type
  1365.  If TreasureRecord.Loadable Then ' verify treasure type
  1366.     Outpt="You can't hold that!" ' make output message
  1367.     Call IO.O ' send message
  1368.     Exit Sub ' exit routine
  1369.  Endif ' end verify treasure type
  1370.  If TreasureRecord.Launchable Then ' verify treasure type
  1371.     Outpt="You can't hold that!" ' make output message
  1372.     Call IO.O ' send message
  1373.     Exit Sub ' exit routine
  1374.  Endif ' end verify treasure type
  1375.  ' compute treasure charges remaining
  1376.  If UserRecord.Charges(Array.Number)=False Then
  1377.     Outpt="You can't, it has zero charges!" ' make message
  1378.     Call IO.O ' send message
  1379.     Exit Sub ' exit routine
  1380.  Endif ' end compare treasure charges
  1381.  Item.Plus=Abs(TreasureRecord.Plus)
  1382.  Select Case TreasureRecord.Type ' select treasure type
  1383.  Case Is<False ' compare treasure type to shield
  1384.     Weapon3=Item.Plus ' set variable of holding shield plus
  1385.     ' set variable of holding shield of inventory array index
  1386.     Weapon5=Array.Number
  1387.  Case False ' compare treasure type to weapon
  1388.     If Item.Plus=False Then ' verify weapon type
  1389.        Outpt="You can't hold that!" ' make output message
  1390.        Call IO.O ' send message
  1391.        Exit Sub ' exit routine
  1392.     Endif ' end verify weapon type
  1393.     Index.Number=TreasureRecord.Proficiency ' store treasure proficiency
  1394.     If UserRecord.ClassType=Cleric Then ' compare player classtype to cleric
  1395.        Select Case Index.Number ' select treasure proficiency type
  1396.        Case 3 To 4 ' compare to sharp or thrusting
  1397.           Outpt="Clerics may only use blunt or pole type weapons!" ' message
  1398.           Call IO.O ' send message
  1399.           Exit Sub ' exit routine
  1400.        End Select ' end compare weapon proficiency type
  1401.     Endif ' end compare to cleric
  1402.     Weapon2=Item.Plus ' set variable of holding weapon plus
  1403.     ' set variable of holding weapon of inventory array index
  1404.     Weapon6=Array.Number
  1405.     Weapon10=Index.Number ' set variable of holding weapon proficiency type
  1406.  End Select ' end select treasure type
  1407.  Outpt="You hold "+Outpts+"(+"+Mid$(Str$(Item.Plus),2)+")!" ' format message
  1408.  Call IO.O ' send message
  1409. End Sub ' end routine to hold an item
  1410.  
  1411.  Rem * routine for player to wear an item of inventory.
  1412.  
  1413. Sub Wear.Object
  1414.  On Local Error Resume Next ' local error resume
  1415.  Call Check.Inventory.Treasure ' check player inventory treasure mnemonic
  1416.  If Index.Number=False Then ' found treasure index
  1417.     Outpt="You aren't carrying that!" ' make message
  1418.     Call IO.O ' send message
  1419.     Exit Sub ' exit routine
  1420.  Endif ' end compare index
  1421.  If TreasureRecord.Type<=False Then ' commpare treasure type
  1422.     If TreasureRecord.RingType=False Then ' compare ring type
  1423.        Outpt="You can't wear that!" ' make message
  1424.        Call IO.O ' send message
  1425.        Exit Sub ' exit routine
  1426.     Endif ' end compare ring
  1427.  Endif ' end compare treasure type
  1428.  If UserRecord.Charges(Array.Number)=False Then ' compare player charges array
  1429.     Outpt="You can't, it has zero charges!" ' make message
  1430.     Call IO.O ' send message
  1431.     Exit Sub ' exit routine
  1432.  Endif ' end compare charges
  1433.  Item.Plus=Abs(TreasureRecord.Plus) ' store treasure item plus hits
  1434.  Select Case TreasureRecord.Type ' selecct treasure type
  1435.  Case Is>False ' treasure type is armor
  1436.     Weapon1=Item.Plus ' set variable of wearing item to plus
  1437.     ' set variable of wearing item to inventory array index
  1438.     Weapon4=Array.Number
  1439.     Plus$="(+"+Mid$(Str$(Item.Plus),2)+")" ' make plus message
  1440.  Case Else ' treasure type is ring
  1441.     Weapon7=Array.Number ' set wearing ring item to inventory array index
  1442.     Weapon8=TreasureRecord.RingType ' set wearing ring type variable
  1443.     Weapon9=TreasureRecord.RingSpell ' set wearing ring spell type variable
  1444.     Plus$=Nul ' clear plus message
  1445.  End Select ' end select treasure type
  1446.  Outpt="You wear "+Outpts+Plus$+"!" ' format message
  1447.  Call IO.O ' send message
  1448. End Sub ' end routine to wear an item
  1449.  
  1450.  Rem * routine to return an item from being held or worn.
  1451.  
  1452. Sub Return.Object
  1453.  On Local Error Resume Next ' local error resume
  1454.  Call Check.Inventory.Treasure ' check player inventory mnemonic
  1455.  If Index.Number=False Then ' treasure index of item
  1456.     Outpt="You aren't carrying that!" ' make message
  1457.     Call IO.O ' send message
  1458.     Exit Sub ' exit routine
  1459.  Endif ' end compare treasure inventory
  1460.  Outpt="You return "+Outpts+"!" ' format message
  1461.  Select Case Array.Number ' select treasure inventory array variable
  1462.  Case Weapon4 ' compare treasure inventory array to armor variable
  1463.     Weapon1=False ' reset shield holding variable
  1464.     Weapon4=False ' reset shield holding variable
  1465.     Call IO.O ' send message
  1466.  Case Weapon5 ' compare treasure inventory array to shield variable
  1467.     Weapon3=False ' reset shield holding variable
  1468.     Weapon5=False ' reset shield holding variable
  1469.     Call IO.O ' send message
  1470.  Case Weapon6 ' compare treasure inventory array to weapon variable
  1471.     Weapon2=False ' reset shield holding variable
  1472.     Weapon6=False ' reset shield holding variable
  1473.     Weapon10=False ' reset shield holding variable
  1474.     Call IO.O ' send message
  1475.  Case Weapon7 ' compare treasure inventory array to ring variable
  1476.     Weapon7=False ' reset shield holding variable
  1477.     Weapon8=False ' reset shield holding variable
  1478.     Weapon9=False ' reset shield holding variable
  1479.     Call IO.O ' send message
  1480.  Case Else ' no matching variables being held or worn
  1481.     Outpt="Your aren't wearing that!" ' make message
  1482.     Call IO.O ' send message
  1483.  End Select ' end select treasure array variable
  1484. End Sub ' end routine to return item
  1485.  
  1486.  Rem * routine to reset an item with original charges if broken.
  1487.  
  1488. Sub Fix.Object
  1489.  On Local Error Resume Next ' local error resume
  1490.  Call Examine.Treasure ' check treasure mnemonic
  1491.  If Index.Number=False Then ' treasure index
  1492.     Outpt="You can't fix that!" ' make message
  1493.     Call IO.O ' send message
  1494.     Exit Sub ' exit routine
  1495.  Endif ' end check treasure
  1496.  If TreasureRecord.Spell Then ' treasure has spell
  1497.     Outpt="You can't fix that!" ' make message
  1498.     Call IO.O ' send message
  1499.     Exit Sub ' exit routine
  1500.  Endif ' end compare spell
  1501.  If TreasureRecord.Plus=False Then ' treasure is not weapon, armor, shield
  1502.     Outpt="You can't fix that!" ' make message
  1503.     Call IO.O ' send message
  1504.     Exit Sub ' exit routine
  1505.  Endif ' end compare spell
  1506.  If UserRecord.Charges(Array.Number) Then ' check remaining treasure charges
  1507.     Outpt="That's not broken!" ' make message
  1508.     Call IO.O ' send message
  1509.     Exit Sub ' exit routine
  1510.  Endif ' end compare charges
  1511.  If UserRecord.Stats(3)<7 Then ' compute random chance
  1512.     Outpt="You didn't fix it!" ' make message
  1513.     Call IO.O ' send message
  1514.     Exit Sub ' exit routine
  1515.  Endif ' end random chance
  1516.  If Abs(TreasureRecord.Plus)>10 Then ' compare treasure plus
  1517.     Outpt="You didn't fix it!" ' make message
  1518.     Call IO.O ' send message
  1519.     Exit Sub ' exit routine
  1520.  Endif ' end compare plus
  1521.  If Rnd<.5 Then ' random chance
  1522.     Outpt="You didn't fix it!" ' make message
  1523.     Call IO.O ' send message
  1524.     Exit Sub ' exit routine
  1525.  Endif ' end chance
  1526.  Item.Charges=TreasureRecord.Charges ' store treasure maximum charges
  1527.  If Item.Charges>250 Then ' only repair item to maximum of 250 charges
  1528.     Item.Charges=250 ' set storage variable to 250 charges
  1529.  Endif ' end compare charges
  1530.  Select Case Type.Number ' select room or inventory
  1531.  Case 1 ' treasure fixed in room
  1532.     ' reset room treasure charges
  1533.     RoomRecord.TreCharges(Array.Number)=Item.Charges
  1534.     Call Share.Room.Record(Room) ' write room record
  1535.  Case 0 ' treasure fixed in inventory
  1536.     ' reset inventory treasure charges
  1537.     UserRecord.Charges(Array.Number)=Item.Charges
  1538.  End Select ' end treasure fixed charges
  1539.  Outpt="You fix it!" ' make message
  1540.  Call IO.O ' send message
  1541. End Sub ' end fix routine
  1542.  
  1543.  Rem * routine to drink an item.
  1544.  
  1545. Sub Drink.Potion
  1546.  On Local Error Resume Next ' local error resume
  1547.  Call Check.Inventory.Treasure ' check treasure mnemonic
  1548.  If Index.Number=False Then ' inventory treasure index
  1549.     Outpt="You can't drink that!" ' make message
  1550.     Call IO.O ' send message
  1551.     Exit Sub ' exit routine
  1552.  Endif ' end treasure index
  1553.  If TreasureRecord.Potion=False Then ' compare treasure to potion
  1554.     Outpt="That's not a potion!" ' make message
  1555.     Call IO.O ' send message
  1556.     Exit Sub ' exit routine
  1557.  Endif ' end compare potion
  1558.  ' check inventory charges remaining
  1559.  If UserRecord.Charges(Array.Number)=False Then
  1560.     Outpt="You can't, it's empty!" ' make message
  1561.     Call IO.O ' send message
  1562.     Exit Sub ' exit routine
  1563.  Endif ' end compare charges
  1564.  Spell.Number=TreasureRecord.Spell ' get treasure spell number
  1565.  ' check spell file
  1566.  If Spell.Number>False And Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  1567.     Call Read.Record(SpellFile,Spell.Number) ' get spell record
  1568.     ' reduce charges
  1569.     UserRecord.Charges(Array.Number)=UserRecord.Charges(Array.Number)-1
  1570.     Magic.Spell=SpellRecord.SpellType ' store spell type
  1571.     Multiplier=SpellRecord.Level ' store spell level
  1572.     Monster.Number=False ' monster not being attacked
  1573.     Parser=False ' no extra parameters
  1574.     Index.Number=False ' not cast on an object
  1575.     Outpt="You drink "+Outpts+"!" ' format message
  1576.     Call IO.O ' send message
  1577.     Call Magic(True) ' cast the spell
  1578.     Exit Sub ' exit routine
  1579.  Endif ' end check spell file
  1580.  Outpt="You can't drink that!" ' make message
  1581.  Call IO.O ' send message
  1582. End Sub ' end drink potion
  1583.  
  1584.  Rem * routine to eat an item.
  1585.  
  1586. Sub Eat.Object
  1587.  On Local Error Resume Next ' local error resume
  1588.  Call Check.Inventory.Treasure ' check treasure mnemonic
  1589.  If Index.Number=False Then ' inventory treasure index
  1590.     Outpt="You can't eat that!" ' make message
  1591.     Call IO.O ' send message
  1592.     Exit Sub ' exit routine
  1593.  Endif ' end treasure index
  1594.  If TreasureRecord.Edible=False Then ' compare treasure to food
  1595.     Outpt="That's not edible!" ' make message
  1596.     Call IO.O ' send message
  1597.     Exit Sub ' exit routine
  1598.  Endif ' end compare food
  1599.  ' check inventory charges remaining
  1600.  If UserRecord.Charges(Array.Number)=False Then
  1601.     Outpt="You can't, it's been eaten!" ' make message
  1602.     Call IO.O ' send message
  1603.     Exit Sub ' exit routine
  1604.  Endif ' end compare charges
  1605.  Spell.Number=TreasureRecord.Spell ' get treasure spell number
  1606.  ' check spell file
  1607.  If Spell.Number>False And Spell.Number<=Lof(SpellFile)/Len(SpellRecord) Then
  1608.     Call Read.Record(SpellFile,Spell.Number) ' get spell record
  1609.     ' reduce charges
  1610.     UserRecord.Charges(Array.Number)=UserRecord.Charges(Array.Number)-1
  1611.     Magic.Spell=SpellRecord.SpellType ' store spell type
  1612.     Multiplier=SpellRecord.Level ' store spell level
  1613.     Monster.Number=False ' monster not being attacked
  1614.     Parser=False ' no extra parameters
  1615.     Index.Number=False ' not cast on a target
  1616.     Outpt="You eat "+Outpts+"!" ' format message
  1617.     Call IO.O ' send message
  1618.     Call Magic(True) ' cast the spell
  1619.     Exit Sub ' exit routine
  1620.  Endif ' end check spell file
  1621.  Outpt="You can't eat that!" ' make message
  1622.  Call IO.O ' send message
  1623. End Sub ' end eat routine
  1624.  
  1625.  Rem * routine to load device with charges from an item, loads device on
  1626.  Rem * ground or player inventory, removes item from from room or inventory.
  1627.  
  1628. Sub Load.Object
  1629.  On Local Error Resume Next ' local error resume
  1630.  Call Examine.Treasure ' check treasure mnemonic
  1631.  If Index.Number=False Then ' found treasure index
  1632.     Outpt="You can't load that!" ' make message
  1633.     Call IO.O ' send message
  1634.     Exit Sub ' exit routine
  1635.  Endif ' end treasure index
  1636.  Load.Type=False ' set load type flag
  1637.  If TreasureRecord.Loadable=True Then ' treasure can be loaded
  1638.     ' store treasure index which loads device
  1639.     Device.Type=TreasureRecord.AmmoLoads
  1640.     Load.Type=True ' set load type flag
  1641.  Endif ' end compare loaded treasure
  1642.  If TreasureRecord.Launchable=True Then ' treasure can be launched
  1643.     ' store treasure index which launchs item
  1644.     Device.Type=TreasureRecord.LaunchLoads
  1645.     Load.Type=1 ' set load type flag
  1646.  Endif ' end compare launched treasure
  1647.  If Load.Type=False Then ' compare load type flag
  1648.     Outpt="You can't load that!" ' make message
  1649.     Call IO.O ' send message
  1650.     Exit Sub ' exit routine
  1651.  Endif ' end compare load type
  1652.  ' check index bounds
  1653.  If Device.Type<False Or Device.Type>Lof(TreasureFile)/Len(TreasureRecord) Then
  1654.     Outpt="There's no ammunition!" ' make message
  1655.     Call IO.O ' send message
  1656.     Exit Sub ' exit routine
  1657.  Endif ' end check index bounds
  1658.  Charges.Number=False ' set treasure ammunition flag
  1659.  Call Read.Record(TreasureFile,Device.Type) ' get treasure index of ammunition
  1660.  If Load.Type=True Then ' check load type
  1661.     If TreasureRecord.Ammunition Then ' treasure index ammunition found
  1662.        Charges.Number=True ' set treasure ammunition flag
  1663.     Endif ' end compare ammunition index
  1664.  Endif ' end load type
  1665.  If Load.Type=1 Then ' check load type
  1666.     If TreasureRecord.LaunchAmmo Then ' treasure index ammunition found
  1667.        Charges.Number=True ' set treasure ammunition flag
  1668.     Endif ' end compare ammunition index
  1669.  Endif ' end load type
  1670.  If Charges.Number=False Then ' check ammunition flag
  1671.     Outpt="There's no ammunition!" ' make message
  1672.     Call IO.O ' send message
  1673.     Exit Sub ' exit routine
  1674.  Endif ' end check ammunition
  1675.  Ammo.Used=False ' set ammunition used flag
  1676.  For Inventory.Number=1 To 20 ' loop through all player inventory
  1677.     ' compare inventory index to ammo index
  1678.     If Device.Type=UserRecord.Inv(Inventory.Number) Then
  1679.        ' remove ammo from inventory
  1680.        Call Discard.Inventory(Inventory.Number,True)
  1681.        Ammo.Used=True ' set ammunition used flag
  1682.        Exit For ' exit loop to find ammo index
  1683.     Endif ' end compare inventory index
  1684.  Next ' end loop to find ammo index
  1685.  If Ammo.Used=False Then ' check ammunition used flag
  1686.     For Inventory.Number=1 To 20 ' loop through all room inventory
  1687.        ' compare room inventory to
  1688.        If Device.Type=RoomRecord.Treasure(Inventory.Number) Then
  1689.           ' ammo index, remove room ammo
  1690.           Call Discard.Room.Treasure(Inventory.Number)
  1691.           Ammo.Used=True ' set ammunition used flag
  1692.           Exit For ' exit loop to find ammo index
  1693.        Endif ' end compare inventory index
  1694.     Next ' end loop to find ammo index
  1695.  Endif ' end ammunition used flag
  1696.  If Ammo.Used=False Then ' check ammunition used flag
  1697.     Outpt="There's no ammunition!" ' make message
  1698.     Call IO.O ' send message
  1699.     Exit Sub ' exit routine
  1700.  Endif ' end check ammunition used flag
  1701.  Device.Loaded=False ' set ammunition loaded flag
  1702.  Select Case Type.Number ' select room or inventory
  1703.  Case 0 ' treasure loaded in player inventory
  1704.     ' store increment charges
  1705.     Device.Charges=UserRecord.Charges(Array.Number)+1
  1706.     If Device.Charges>10 Then ' compare to maximum charges
  1707.        Device.Loaded=True ' set ammunition loaded flag
  1708.     Else ' compare less than maximum
  1709.        UserRecord.Charges(Array.Number)=Device.Charges ' increment charges
  1710.     Endif ' end compare maximum charges
  1711.  Case 1 ' treasure loaded in room inventory
  1712.     ' store increment charges
  1713.     Device.Charges=RoomRecord.TreCharges(Array.Number)+1
  1714.     If Device.Charges>10 Then ' compare to maximum charges
  1715.        Device.Loaded=True ' set ammunition loaded flag
  1716.     Else ' compare less than maximum
  1717.        RoomRecord.TreCharges(Array.Number)=Device.Charges ' increment charges
  1718.     Endif ' end compare maximum charges
  1719.     Call Share.Room.Record(Room) ' write room record
  1720.  End Select ' end compare inventory to load
  1721.  If Device.Loaded Then ' compare ammunition loaded flag
  1722.     Outpt="The device can't load that much!" ' make message
  1723.  Else ' ammunition loaded
  1724.     Outpt="You load the device!" ' make message
  1725.  Endif ' end compare ammunition loaded flag
  1726.  Call IO.O ' send message
  1727. End Sub ' end routine to load ammunition to an item
  1728.  
  1729.  Rem * routine to fire a device at a monster in room, device explodes in
  1730.  Rem * player by chance, device discharges harmlessly.
  1731.  
  1732. Sub Fire.Object
  1733.  On Local Error Resume Next ' local error resume
  1734.  Call Find.Inventory ' check player inventory for mnemonic of device to fire
  1735.  If Index.Number=False Then ' found treasure index to player inventory
  1736.     Outpt="You can't fire that!" ' make message
  1737.     Call IO.O ' send message
  1738.     Exit Sub ' exit routine
  1739.  Endif ' end check treasure index
  1740.  If TreasureRecord.Loadable=False Then ' check device can be loaded
  1741.     Outpt="You can't fire that!" ' make message
  1742.     Call IO.O ' send message
  1743.     Exit Sub ' exit routine
  1744.  Endif ' end compare device
  1745.  If TreasureRecord.AmmoLoads=False Then ' check item which loads device
  1746.     Outpt="It's not loaded with ammunition!" ' make message
  1747.     Call IO.O ' send message
  1748.     Exit Sub ' exit routine
  1749.  Endif ' end compare device
  1750.  Call Read.Record(TreasureFile,TreasureRecord.AmmoLoads) ' get record ammo used
  1751.  If TreasureRecord.Ammunition=False Then ' item which loads device is nto ammo
  1752.     Outpt="It's not loaded with ammunition!" ' make message
  1753.     Call IO.O ' send message
  1754.     Exit Sub ' exit routine
  1755.  Endif ' end compare device
  1756.  ' read treasure record index of device to fire
  1757.  Call Read.Record(TreasureFile,Index.Number)
  1758.  If Parser=False Then ' check second parameter of monster to fire at
  1759.     Outpt="Fire at what?" ' make message
  1760.     Call IO.O ' send message
  1761.     Exit Sub ' exit routine
  1762.  Endif ' end compare monster
  1763.  ' compare remaining charges in device
  1764.  If UserRecord.Charges(Array.Number)=False Then
  1765.     Outpt="It's not loaded!" ' make message
  1766.     Call IO.O ' send message
  1767.     Exit Sub ' exit routine
  1768.  Endif ' end compare device
  1769.  ' decrement charges
  1770.  UserRecord.Charges(Array.Number)=UserRecord.Charges(Array.Number)-1
  1771.  Parsed.Command1=Parsed.Command2 ' get second parameter of monster
  1772.  Call Numeric ' parse out temp variable
  1773.  If Rnd<.2 Then ' compute random chance
  1774.     Outpt="Bang! The ammunition explodes in your face!" ' device backfires
  1775.     Call IO.O ' send message
  1776.     Outpt="The device hits you for" ' string preceding points hit on player
  1777.     Hits#=Cdbl(Int(Rnd*Abs(TreasureRecord.Plus)+1)) ' calculate random hits
  1778.     Call Hit.Player(Hits#) ' routine to get hits on player
  1779.     Exit Sub ' exit routine
  1780.  Endif ' end random chance
  1781.  If Rnd<.2 Then ' random chance
  1782.     Outpt="The device fires harmlessly!" ' make message
  1783.     Call IO.O ' send message
  1784.     Exit Sub ' exit routine
  1785.  Endif ' end random chance
  1786.  Treasure.Name$=TreasureRecord.ShortName ' store treasure name being fired
  1787.  Treasure.Name$=Rtrim$(Treasure.Name$) ' strip trailing blanks
  1788.  Treasure.Name$=Lcase$(Treasure.Name$) ' format to lower case
  1789.  Call Check.Monster ' find monster being fired at in parsed string
  1790.  If Monster.Number Then ' monster found from second parameter
  1791.     Outpts=MonsterArray(Monster.Number).MonsterName ' store monster name
  1792.     Outpts=Rtrim$(Outpts) ' strip trailing blanks
  1793.     Outpts=Lcase$(Outpts) ' format to lower case
  1794.     Outpt="You fire the "+Treasure.Name$+" at the "+Outpts+"!" ' format message
  1795.     Call IO.O ' send message
  1796.     Multiplier=Abs(TreasureRecord.Plus) ' calculate hits on monster multiplier
  1797.     Call Hit.Monster ' routine to attack monster in Monster.Number
  1798.     Exit Sub ' exit routine
  1799.  Endif ' end compare monster to fire at
  1800.  Outpt="The device fires into empty air!" ' make message
  1801.  Call IO.O ' send message
  1802. End Sub ' end routine to fire a device at a monster
  1803.  
  1804.  Rem * dm/sysop routine to get an item from treasure or object files and
  1805.  Rem * add to room, interactive function during remote logon also.
  1806.  
  1807. Sub Drop.Object
  1808.  On Local Error Resume Next ' local error resume
  1809.  Parsed.Command1=Stored.Parsed.Command2 ' get entire second half of command
  1810.  Call Numeric ' parse temp variable
  1811.  Inpt=Parsed.Command1 ' put full name of item in variable
  1812.  Inpt=Lcase$(Inpt) ' convert to lower case
  1813.  Call Drop(True) ' routine to put item name in room
  1814. End Sub ' end dm/sysop drop routine
  1815.  
  1816.  Rem * routine to bless an object by increasing the magical charges.
  1817.  
  1818. Sub Bless.Object
  1819.  On Local Error Resume Next ' local error resume
  1820.  If Normal.User Then ' check player is normal player
  1821.     If UserRecord.ClassType<>Cleric Then ' compare player class type to cleric
  1822.        Outpt="Only clerics can bless!" ' make message
  1823.        Call IO.O ' send message
  1824.        Exit Sub ' exit routine
  1825.     Endif ' end compare class type
  1826.  Endif ' end compare player type
  1827.  Call Examine.Treasure ' check treasure mnemonic
  1828.  If Index.Number Then ' found treasure index
  1829.     Charges.Number=TreasureRecord.Spell ' store treasure spell type
  1830.     If Charges.Number=False Then ' compare treasure spell type
  1831.        Outpt="You can't bless that!" ' make message
  1832.        Call IO.O ' send message
  1833.        Exit Sub ' exit routine
  1834.     Endif ' end compare treasure type
  1835.     ' check file bounds
  1836.     If Charges.Number>False And _
  1837.     Charges.Number<Lof(SpellFile)/Len(SpellRecord) Then
  1838.        ' read spell record from treasure index
  1839.        Call Read.Record(SpellFile,Charges.Number)
  1840.        If SpellRecord.SpellType=4 Then ' compare spell to wish
  1841.           Outpt="You can't bless that!" ' make message
  1842.           Call IO.O ' send message
  1843.           Exit Sub ' exit routine
  1844.        Endif ' and compare spell
  1845.        Object.Blessed=False ' set object blessed flag
  1846.        Max.Charges=TreasureRecord.Charges ' store maximum charges
  1847.        Select Case Type.Number ' select room or inventory
  1848.        Case 0 ' bless item in player inventory
  1849.           ' get incremented charges
  1850.           Type.Charges=UserRecord.Charges(Array.Number)+1
  1851.           If Type.Charges>Max.Charges Then ' compare maximum charges
  1852.              Object.Blessed=True ' set bless flag
  1853.           Else ' compare charges
  1854.              ' set incremented charges
  1855.              UserRecord.Charges(Array.Number)=Type.Charges
  1856.           Endif ' end compare maximum charges
  1857.        Case 1 ' bless item in room inventory
  1858.           ' get incremented charges
  1859.           Type.Charges=RoomRecord.TreCharges(Array.Number)+1
  1860.           If Type.Charges>Max.Charges Then ' compare maximum charges
  1861.              Object.Blessed=True ' set bless flag
  1862.           Else ' compare charges
  1863.              ' set incremented charges
  1864.              RoomRecord.TreCharges(Array.Number)=Type.Charges
  1865.              Call Share.Room.Record(Room) ' write room record
  1866.           Endif ' end compare maximum charges
  1867.        End Select ' end inventory type
  1868.        If Object.Blessed Then ' compare bless flag
  1869.           Outpt="Nothing happens!" ' make message
  1870.        Else ' compare bless flag
  1871.           Outpt="You bless it!" ' make message
  1872.        Endif ' end compare flag
  1873.        Call IO.O ' send message
  1874.        Exit Sub ' exit routine
  1875.     Endif
  1876.  Endif
  1877.  Outpt="You can't bless that!" ' make message
  1878.  Call IO.O ' send message
  1879. End Sub ' end routine to bless an object
  1880.  
  1881.  Rem * routine to curse a monster by decreasing hits.
  1882.  
  1883. Sub Curse.Object
  1884.  On Local Error Resume Next ' local error resume
  1885.  If Normal.User Then ' check player type
  1886.     If UserRecord.ClassType<>Cleric Then ' check player class type to cleric
  1887.        Outpt="Only clerics can curse!" ' make message
  1888.        Call IO.O ' send message
  1889.        Exit Sub ' exit routine
  1890.     Endif ' end compare class type
  1891.  Endif ' end compare player type
  1892.  Call Check.Monster ' search for monster parameter
  1893.  If Monster.Number Then ' index found to monster array
  1894.     Outpts=MonsterArray(Monster.Number).MonsterName ' store full monster name
  1895.     Outpts=Rtrim$(Outpts) ' strip trailing blanks
  1896.     Outpts=Lcase$(Outpts) ' convert to lower case
  1897.     Outpt="You curse the "+Outpts+"!" ' format message
  1898.     Call IO.O ' send message
  1899.     Multiplier=Int(UserRecord.Stats(6)/2) ' compute hits on monster multiplier
  1900.     Call Hit.Monster ' routine to attack a monster
  1901.     Exit Sub ' exit routine
  1902.  Endif ' end get monster index
  1903.  Outpt="You can't curse that!" ' make message
  1904.  Call IO.O ' send message
  1905. End Sub ' end routine to curse a monster
  1906.  
  1907.  Rem * routine to bless player (bless without parameter).
  1908.  
  1909. Sub Bless.Self
  1910.  On Local Error Resume Next ' local error resume
  1911.  If Normal.User Then ' check player type
  1912.     If UserRecord.ClassType<>Cleric Then ' check player class type
  1913.        Outpt="Only clerics can bless!" ' message for clerics only
  1914.        Call IO.O ' send message
  1915.        Exit Sub ' exit routine
  1916.     Endif ' end compare class type
  1917.  Endif ' end compare player type
  1918.  Type.Charges=UserRecord.Stats(6)+1 ' store incremented piety
  1919.  If Type.Charges>MaxStat Then ' compare to maximum piety
  1920.     Outpt="Nothing happens!" ' make message
  1921.     Call IO.O ' send message
  1922.     Exit Sub ' exit routine
  1923.  Endif ' end compare piety
  1924.  UserRecord.Stats(6)=Type.Charges ' update new piety
  1925.  Outpt="You feel a glow about you!" ' make message
  1926.  Call IO.O ' send message
  1927.  Outpt="Your piety is now"+Str$(Type.Charges)+"!" ' format message
  1928.  Call IO.O ' send message
  1929. End Sub ' end routine to bless self
  1930.  
  1931. Rem * routine to curse player (curse without parameter).
  1932.  
  1933. Sub Curse.Self
  1934.  On Local Error Resume Next ' local error resume
  1935.  If Normal.User Then ' check player type
  1936.     If UserRecord.ClassType<>Cleric Then ' check player class type
  1937.        Outpt="Only clerics can curse!" ' make message
  1938.        Call IO.O ' send message
  1939.        Exit Sub ' exit routine
  1940.     Endif ' end compare class type
  1941.  Endif ' end compare player type
  1942.  Type.Charges=UserRecord.Stats(6)-1 ' store decremented piety
  1943.  If Type.Charges<=False Then ' compare to minimum piety
  1944.     Outpt="Nothing happens!" ' make message
  1945.     Call IO.O ' send message
  1946.     Exit Sub ' exit routine
  1947.  Endif ' end compare piety
  1948.  UserRecord.Stats(6)=Type.Charges ' set new piety
  1949.  Outpt="You feel a darkening about you!" ' make message
  1950.  Call IO.O ' send message
  1951.  Outpt="Your piety is now"+Str$(Type.Charges)+"!" ' format message
  1952.  Call IO.O ' send message
  1953. End Sub ' end routine to curse self
  1954.  
  1955.  Rem * routine to move a lanuch type object to a nearby room and move player
  1956.  Rem * to room also, verify room traps.
  1957.  
  1958. Sub Move.Object
  1959.  On Local Error Resume Next ' local error resume
  1960.  Call Parse ' parse out parameters
  1961.  If Parser Then ' check for first parameter
  1962.     Call Numeric '  parse temp variable from first parameter
  1963.  Endif ' end check parameter
  1964.  Call Examine.Treasure ' check treasure mnemonic in inventory or room
  1965.  If Index.Number=False Then ' locate treasure index
  1966.     Outpt="You can't move that!" ' make message
  1967.     Call IO.O ' send message
  1968.     Exit Sub ' exit routine
  1969.  Endif ' end compare treasure
  1970.  If TreasureRecord.Movable=False Then ' compare treasure can be moved
  1971.     Outpt="You can't move that!" ' make message
  1972.     Call IO.O ' send message
  1973.     Exit Sub ' exit routine
  1974.  Endif ' end compare treasure
  1975.  If TreasureRecord.Launchable=False Then ' compare treasure can be launched
  1976.     Outpt="You can't move that!" ' make message
  1977.     Call IO.O ' send message
  1978.     Exit Sub ' exit routine
  1979.  Endif ' end compare treasure
  1980.  If Parser=False Then ' compare parameter parsed
  1981.     Outpt="Move which direction?" ' no direction specified
  1982.     Call IO.O ' send message
  1983.     Exit Sub ' exit routine
  1984.  Endif ' end check parse
  1985.  Treasure.Name$=Outpts ' store full treasure name to be moved
  1986.  Item.Number=Array.Number ' store treasure index to array
  1987.  Item.Charges=Charges.Number ' store treasure charges
  1988.  Item.Index=Index.Number ' store treasure index to file
  1989.  User.Command=Parsed.Command2 ' get second parameter
  1990.  Call Get.Direction(Direction.Number) ' compare moving parameter to direction
  1991.  If Direction.Number Then ' direction found flag set
  1992.     Next.Room=RoomRecord.Direct(Direction.Number) ' get room number direction
  1993.     If Next.Room=False Then ' compare room number
  1994.        Outpt="You can't move it there!" ' make message
  1995.        Call IO.O ' send message
  1996.        Exit Sub ' exit routine
  1997.     Endif ' end compare room number
  1998.  Else ' no direction flag set, check for moving through an object
  1999.     Parsed.Command1=User.Command ' get second parameter
  2000.     Call Check.Room.Objects ' check with mnemonic name of object in room
  2001.     If Index.Number=False Then ' check object index
  2002.        Outpt="You can't move it there!" ' make message
  2003.        Call IO.O ' send message
  2004.        Exit Sub ' exit routine
  2005.     Endif ' end compare room object
  2006.     If ObjectRecord.RoomLink=False Then ' verify room object links to room
  2007.        Outpt="You can't move it there!" ' make message
  2008.        Call IO.O ' send message
  2009.        Exit Sub ' exit routine
  2010.     Endif ' end compare object is a portal
  2011.     If ObjectRecord.JailTrap Then ' verify room is trapped
  2012.        Outpt="Trapped portal!" ' make message
  2013.        Call IO.O ' send message
  2014.        Exit Sub ' exit routine
  2015.     Endif ' end compare room trap
  2016.     If ObjectRecord.Closed Then ' compare room closed
  2017.        If Pass.Door=False Then ' check is passdoor spell cast
  2018.           Outpt="You can't, it's closed!" ' make message
  2019.           Call IO.O ' send message
  2020.           Exit Sub ' exit routine
  2021.        Endif ' end cmpare passdoor
  2022.     Endif ' end compare object closed
  2023.     If ObjectRecord.Relocks Then ' object portal closes after entry
  2024.        ObjectRecord.DoorLock=2 ' set object portal lock
  2025.        ObjectRecord.Closed=True ' set object portal closed
  2026.        Call SHare.Record(ObjectFile,Index.Number) ' write object record
  2027.     Endif ' end compare relocking object portal
  2028.     Pass.Door=False ' reset passdoor spell
  2029.     Next.Room=ObjectRecord.RoomLink ' get room number to enter portal
  2030.  Endif ' end compare move to a direction or to a portal
  2031.  Swap Room,Next.Room ' interchange current room with next room to move item
  2032.  Call Read.Room.Record(Room) ' read next room to move item to room file
  2033.  ' routine to add room item
  2034.  Call Add.Room.Treasure(Item.Index,Item.Charges,False,Item.Added)
  2035.  Swap Room,Next.Room ' interchange current room with next room
  2036.  Call Read.Room.Record(Room) ' read current room record
  2037.  If Item.Added Then ' add item to room flag
  2038.     Select Case Type.Number ' select room or inventory
  2039.     Case 0 ' treasure moved from player inventory
  2040.        Call Discard.Inventory(Item.Number,True) ' remove item from inventory
  2041.     Case 1 ' treasure moved from room
  2042.        Call Discard.Room.Treasure(Item.Number) ' remove item from room
  2043.     End Select ' end compare treasure moved
  2044.     Outpt="You move "+Treasure.Name$+"!" ' format message
  2045.     Call IO.O ' send message
  2046.     Call Enter.Room ' move player to next room
  2047.     Exit Sub ' exit routine
  2048.  Endif ' end locate empty room inventory
  2049.  Outpt="You can't move it there!" ' make message
  2050.  Call IO.O ' send message
  2051. End Sub ' end routine to move an item
  2052.  
  2053.  Rem * routine to launch an item in a specific direction to smash through
  2054.  Rem * a random amount of object portal locks connected through successive
  2055.  Rem * rooms, or to launch a weapon at a monster.
  2056.  
  2057. Sub Launch.Object
  2058.  On Local Error Resume Next ' local error resume
  2059.  Call Parse ' get first parameter
  2060.  If Parser Then ' found parameter
  2061.     Call Numeric ' parse number after # sign
  2062.  Endif ' end compare parse
  2063.  Call Examine.Treasure ' check treasure mnemonic to room or player inventory
  2064.  If Index.Number=False Then ' treasure index not found
  2065.     Outpt="You can't launch that!" ' make message
  2066.     Call IO.O ' send message
  2067.     Exit Sub ' exit routine
  2068.  Endif ' end compare index
  2069.  If TreasureRecord.Launchable=False Then ' check if treasure can be launched
  2070.     Outpt="That's not a launchable device!" ' make message
  2071.     Call IO.O ' send message
  2072.     Exit Sub ' exit routine
  2073.  Endif ' end compare item to launch
  2074.  If Parser=False Then ' compare second parameter
  2075.     Outpt="Launch where?" ' make message
  2076.     Call IO.O ' send message
  2077.     Exit Sub ' exit routine
  2078.  Endif ' end compare second parameter
  2079.  Item.Launched=False ' item was launched flag
  2080.  Item.Type=Type.Number ' store inventory type
  2081.  Item.Index=Array.Number ' store launched item index to array
  2082.  Item.Charges=Charges.Number ' store launched item charges
  2083.  If Charges.Number=False Then ' compare remaining charges in device
  2084.     Outpt="You can't, it's not loaded!" ' make message
  2085.     Call IO.O ' send message
  2086.     Exit Sub ' exit routine
  2087.  Endif ' end compare device
  2088.  If Item.Charges>10 Then ' compare device charges
  2089.     Item.Charges=10 ' reset maximum charges
  2090.  Endif ' end compare device
  2091.  Launch.Number=False ' variable of number of loads launched
  2092.  Treasure.Name$=TreasureRecord.ShortName ' store name of device
  2093.  Treasure.Name$=Rtrim$(Treasure.Name$) ' strip trailing blanks
  2094.  Treasure.Name$=Lcase$(Treasure.Name$) ' convert to lower case
  2095.  User.Command=Parsed.Command2 ' get second parameter
  2096.  Parsed.Command1=User.Command ' store parameter
  2097.  Call Get.Direction(Direction.Number) ' determine direction to launch at
  2098.  If Direction.Number Then ' returned variable contains direction number
  2099.     Next.Room=RoomRecord.Direct(Direction.Number) ' get next room direction
  2100.     If Next.Room=False Then ' compare room number
  2101.        Outpt="You can't launch at that!" ' make message
  2102.        Call IO.O ' send message
  2103.        Exit Sub ' exit routine
  2104.     Endif ' end compare room number
  2105.     Item.Launched=True ' set item is launched flag
  2106.     Outpts=Direction(Direction.Number) ' store direction name
  2107.     Outpts=Rtrim$(Outpts) ' strip trailing blanks
  2108.     Outpts=Lcase$(Outpts) ' convert to lower case
  2109.     Outpt="You launch the "+Treasure.Name$+" "+Outpts+"!" ' format message
  2110.     Call IO.O ' send message
  2111.     ' loop through all charges in device to launch
  2112.     For Launchs=1 To Item.Charges
  2113.        Graphics.Off=False ' color normal
  2114.        Outpt="For launch"+Str$(Launchs)+";" ' format message of launch number
  2115.        Call IO.O ' send message
  2116.        Launch.Number=Launch.Number+1 ' increment number of launches
  2117.        Graphics.Off=True ' color white
  2118.        Outpt="The device launchs: " ' message
  2119.        Carriage.Return=True ' suppress cr/lf
  2120.        Call IO.O ' send message
  2121.        Outpt=Outpts+", " ' first direction device launches
  2122.        Carriage.Return=True ' suppress cr/lf
  2123.        Call IO.O ' send direction message
  2124.        Locks.Smashed=False ' counter of number of locks smashed
  2125.        Chained.Rooms=False ' number of rooms chained to
  2126.        Call Chain.Rooms(Next.Room,Room) ' routine to send launched item
  2127.        Outpt="and stopped!" ' trailing message
  2128.        Call IO.O ' send message
  2129.     Next ' end loop through all device launch charges
  2130.     If Locks.Smashed=False Then ' compare number of locks smashed
  2131.        Outpt="You didn't smash anything!" ' make message
  2132.     Else ' compare lock number
  2133.        Outpt="You smashed open" ' format message
  2134.        Outpt=Outpt+Str$(Locks.Smashed) ' with number of locks smashed
  2135.        If Locks.Smashed=1 Then ' compare number
  2136.           Outpt=Outpt+" lock.." ' append message
  2137.        Else ' compare number
  2138.           Outpt=Outpt+" locks!" ' append message
  2139.        Endif ' end compare
  2140.     Endif ' end compare number
  2141.     Call IO.O ' send message
  2142.     Graphics.Off=False ' color normal
  2143.     Call Read.Room.Record(Room) ' read current room record
  2144.  Else ' verify monster to launch at
  2145.     Call Check.Monster ' find monster mnemonic to launch device at
  2146.     If Monster.Number Then ' found monster variable indexed to array
  2147.        Multiplier=Abs(TreasureRecord.Plus) ' compute attack multiplier
  2148.        ' store full monster name
  2149.        Outpts=MonsterArray(Monster.Number).MonsterName
  2150.        Outpts=Rtrim$(Outpts) ' strip trailing blanks
  2151.        Outpts=Lcase$(Outpts) ' convert to lower case
  2152.        Outpt="You launch "+Treasure.Name$+" at the "+Outpts+"!" ' make message
  2153.        Call IO.O ' send message
  2154.        Item.Launched=True ' set item is launched flag
  2155.        Graphics.Off=True ' color white
  2156.        ' loop through all charges in device to launch
  2157.        For Launchs=1 To Item.Charges
  2158.           ' format message of launch number
  2159.           Outpt="For launch"+Str$(Launchs)+";"
  2160.           Call IO.O ' send message
  2161.           Launch.Number=Launch.Number+1 ' increment number of launches
  2162.           Call Attack.Monster ' routine to hit monster
  2163.           Call Check.Monster ' reverify monster being attacked
  2164.           If Monster.Number=False Then ' monster is not found
  2165.              Exit For ' exit device launch loop
  2166.           Endif ' end compare monster
  2167.        Next ' end loop through all device launch charges
  2168.        Graphics.Off=False ' color normal
  2169.     Endif ' end find monster
  2170.  Endif ' end compare launch direction or monster
  2171.  If Item.Launched=False Then ' device was launched flag
  2172.     Outpt="You can't launch at that!" ' make message
  2173.     Call IO.O ' send message
  2174.     Exit Sub ' exit routine
  2175.  Endif ' end compare if launched
  2176.  If Item.Type=False Then ' device launched from player inventory
  2177.     ' compute loads launched decrement
  2178.     Total.Charges=UserRecord.Charges(Item.Index)-Launch.Number
  2179.     If Total.Charges<False Then ' compare lower limit
  2180.        Total.Charges=False ' set lower limit
  2181.     Endif ' end compare limit
  2182.     UserRecord.Charges(Item.Index)=Total.Charges ' store inventory charges
  2183.  Else ' device lanuched from room
  2184.     ' compute loads launched decrement
  2185.     Total.Charges=RoomRecord.TreCharges(Item.Index)-Launch.Number
  2186.     If Total.Charges<False Then ' compare lower limit
  2187.        Total.Charges=False ' set lower limit
  2188.     Endif ' end compare limit
  2189.     RoomRecord.TreCharges(Item.Index)=Total.Charges ' store room charges
  2190.     Call Share.Room.Record(Room) ' write room record
  2191.  Endif ' end compare launched from
  2192. End Sub ' end routine to launch an item from a device
  2193.  
  2194.  Rem * routine to recursively enter rooms by nearby room links, smashing a
  2195.  Rem * random number of portals.
  2196.  
  2197. Sub Chain.Rooms(Chain.Room!,Previous.Room!)
  2198.  ' Chain.Room! is a passed parameter of the next room to access.
  2199.  ' Previous.Room! stores the called room number to be restored upon exit.
  2200.  On Local Error Resume Next ' local error resume
  2201.  Call Read.Room.Record(Chain.Room!) ' get next chained to room
  2202.  For Array.Number=1 To 20 ' loop through all objects in room
  2203.     Object.Number=RoomRecord.Object(Array.Number) ' get object index to file
  2204.     ' check object file bounds
  2205.     If Object.Number>False And _
  2206.     Object.Number<=Lof(ObjectFile)/Len(ObjectRecord) Then
  2207.        Call Read.Record(ObjectFile,Object.Number) ' get the object record
  2208.        If ObjectRecord.DoorLock=2 Then ' check if object is locked
  2209.           If Rnd>.66 Then ' compute random chance
  2210.              Locks.Smashed=Locks.Smashed+1 ' increment locks smashed counter
  2211.              ObjectRecord.DoorLock=1 ' set object unlocked
  2212.              ObjectRecord.Closed=False ' set object to open
  2213.              Call SHare.Record(ObjectFile,Object.Number) ' write object record
  2214.           Endif ' end random chance
  2215.        Endif ' end compare object lock
  2216.     Endif ' end end object bounds
  2217.  Next ' end loop through all objects
  2218.  For Direction.Number=1 to 12 ' loop through all directions in chained to room
  2219.     Next.Room=RoomRecord.Direct(Direction.Number) ' get the room number of the
  2220.     If Next.Room Then ' direction and compare to
  2221.        If Next.Room<>Previous.Room! Then ' the current room in routine
  2222.           If Rnd>.66 Then ' compute random chance
  2223.              If Chained.Rooms<5 Then ' compare to maximum of 5 recursive calls
  2224.                 Carriage.Return=True ' suppress cr/lf
  2225.                 Outpt=Direction(Direction.Number) ' get direction name
  2226.                 Outpt=Rtrim$(Outpt)+", " ' format message
  2227.                 Call IO.O ' send message
  2228.                 ' increment number of recursively chained rooms
  2229.                 Chained.Rooms=Chained.Rooms+1
  2230.                 Call Chain.Rooms(Next.Room,Chain.Room!) ' routine calls self tp
  2231.                 Call Read.Room.Record(Chain.Room!) 'next room get previous room
  2232.                 Exit Sub ' exit routine (recursively exiting previous calls)
  2233.              Endif ' end compare maximum
  2234.           Endif ' end random chance
  2235.        Endif ' end compare to current room
  2236.     Endif ' end compare next direction
  2237.  Next ' end loop through all directions in called room (exit recursively)
  2238. End Sub ' end routine to recursively loop through all objects in neraby rooms
  2239.  
  2240.  Rem * routine for player to steal an item from a monster.
  2241.  
  2242. Sub Steal.Object
  2243.  On Local Error Resume Next ' local error resume
  2244.  If Normal.User Then ' check player type
  2245.     If UserRecord.ClassType<>Thief Then ' check player class type
  2246.        Outpt="Only thieves can steal!" ' make message
  2247.        Call IO.O ' send message
  2248.        Exit Sub ' exit routine
  2249.     Endif ' end compare class type
  2250.  Endif ' end compare player type
  2251.  Call ParseX ' parse the second parameter
  2252.  If Parser Then ' parse the
  2253.     Call Numeric ' number after the # sign
  2254.  Endif ' end parse
  2255.  If Parser=False Then ' no second parameter
  2256.     Outpt="Steal from whom?" ' make message
  2257.     Call IO.O ' send message
  2258.     Exit Sub ' exit routine
  2259.  Endif ' end compare parse
  2260.  Call Check.Monster ' verify monster mnemonic
  2261.  If Monster.Number Then ' monster index
  2262.     Parsed.Command1=Lcase$(Parsed.Command2) ' get first parameter
  2263.     Call Numeric ' parse number
  2264.     For Array.Number=1 To 5 ' loop through all monster treasure
  2265.        ' get monster treasure index
  2266.        Treasure.Number=MonsterArray(Monster.Number).Treasure(Array.Number)
  2267.        ' check file bounds
  2268.        If Treasure.Number>False And _
  2269.        Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then
  2270.           Call Read.Record(TreasureFile,Treasure.Number) 'read treasure record
  2271.           Inpt=TreasureRecord.ShortName ' store short treasure mnemonic
  2272.           Inpt=Rtrim$(Inpt) ' strip trailing blanks
  2273.           Inpt=Lcase$(Inpt) ' convert to lower case
  2274.           Inpt=Left$(Inpt,Len(Parsed.Command1)) ' shorten to parsed length
  2275.           If Inpt=Parsed.Command1 Then ' compare treasure to parsed treasure
  2276.              ' compare monster to magical, or permanent
  2277.              If MonsterArray(Monster.Number).Magic<=True Or _
  2278.              MonsterArray(Monster.Number).Permanent<=True Then
  2279.                 Outpt="You can't steal from that monster!" ' make message
  2280.                 Call IO.O ' send message
  2281.                 Exit Sub ' exit routine
  2282.              Endif ' end compare monster
  2283.              ' compute random chance
  2284.              If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
  2285.                 Outpt="Didn't work!" ' make message
  2286.                 Call IO.O ' send message
  2287.                 Exit Sub ' exit routine
  2288.              Endif ' end random chance
  2289.              Inpt=TreasureRecord.TreasureName ' get full name of treasure
  2290.              Inpt=Rtrim$(Inpt) ' strip trailing blanks
  2291.              Inpt=Lcase$(Inpt) ' convert to lower case
  2292.              ' get monster name
  2293.              Outpts=MonsterArray(Monster.Number).MonsterName
  2294.              Outpts=Rtrim$(Outpts) ' strip trailing blanks
  2295.              Outpts=Lcase$(Outpts) ' convert to lower case
  2296.              Item.Charges=TreasureRecord.Charges ' store charges
  2297.              ' add to player inventory
  2298.              Call Add.Inventory(Treasure.Number,Item.Charges,Item.Added)
  2299.              If Item.Added Then ' flag set to add inventory
  2300.                 Outpt="You steal "+Inpt+" from the "+Outpts+"!" ' make message
  2301.                 Call IO.O ' send message
  2302.                 ' clear element in monster inventory array
  2303.                 MonsterArray(Monster.Number).Treasure(Array.Number)=False
  2304.                 Exit Sub ' exit routine
  2305.              Endif ' end compare flag
  2306.           Endif ' end compare treasure
  2307.        Endif ' end compare treasure
  2308.     Next ' end loop through all monster inventory
  2309.  Endif ' end find monster number
  2310.  Outpt="You can't steal that!" ' make message
  2311.  Call IO.O ' send message
  2312. End Sub ' end routine to steal
  2313.  
  2314.  Rem * routine to throw an item of player inventory at monster, weapon falls
  2315.  Rem * into the room.
  2316.  
  2317. Sub Throw.Object
  2318.  On Local Error Resume Next ' local error resume
  2319.  If Normal.User Then ' verify player type
  2320.     If UserRecord.ClassType<>Thief Then ' verify player class type
  2321.        Outpt="Only thieves can throw!" ' make message
  2322.        Call IO.O ' send message
  2323.        Exit Sub ' exit routine
  2324.     Endif ' end compare class type
  2325.  Endif ' end compare player type
  2326.  Call ParseX ' get second parameter
  2327.  If Parser Then ' parse parameter
  2328.     Call Numeric ' store number
  2329.  Endif ' end compare parse
  2330.  If Parser=False Then ' missing second parameter
  2331.     Outpt="Throw at whom?" ' make message
  2332.     Call IO.O ' send message
  2333.     Exit Sub ' exit routine
  2334.  Endif ' end compare parameter
  2335.  Call Check.Monster ' find monster in room
  2336.  If Monster.Number Then ' found monster index
  2337.     Last.Monster=Parsed.Command1 ' reset last monster attacked
  2338.     Parsed.Command1=Ucase$(Parsed.Command2) ' get first parameter
  2339.     Call Numeric ' parse number sign
  2340.     Call Check.Inventory.Treasure ' search player inventory for treasure
  2341.     If Index.Number>False Then ' found treasure index in player inventory
  2342.        ' weapon being held must match the weapon thrown
  2343.        If Weapon6=Array.Number Then
  2344.           Multiplier=Weapon2 ' set attack multiplier
  2345.           Inpt=MonsterArray(Monster.Number).MonsterName ' get monster name
  2346.           Inpt=Rtrim$(Inpt) ' strip trailing blanks
  2347.           Inpt=Lcase$(Inpt) ' convert to lower case
  2348.           Outpt="You throw "+Outpts+" at the "+Inpt+"!" ' format message
  2349.           Call IO.O ' send message
  2350.           If Int(Rnd*5+2)>UserRecord.Stats(4)/2 Then ' compute random chance
  2351.              Outpt="You missed!" ' make message
  2352.              Call IO.O ' send message
  2353.           Else ' random chance
  2354.              Parsed.Command1=Last.Monster ' reset parameter to last monster
  2355.              Last.Command.Number=55 ' reset the command number to attack
  2356.              Call Attack.Monster ' routine to hit monster
  2357.           Endif ' end random chance
  2358.           Call Discard.Inventory(Weapon6,False) ' remove item from inventory
  2359.           Exit Sub ' exit routine
  2360.        Endif ' end compare weapon being held
  2361.        Outpt="You aren't holding the weapon!" ' make message
  2362.        Call IO.O ' send message
  2363.        Exit Sub ' exit routine
  2364.     Endif ' end search for weapon to throw
  2365.  Endif ' end search for monster
  2366.  Outpt="You can't throw that!" ' make message
  2367.  Call IO.O ' send message
  2368. End Sub ' end routine to throw an object
  2369.  
  2370.  Rem * routine to fuel an item from the charges of another item.
  2371.  
  2372. Sub Fuel.Object
  2373.  On Local Error Resume Next ' local error resume
  2374.  Call Find.Inventory ' parse first parameter, search player inventory
  2375.  Treasure.Name$=TreasureRecord.ShortName ' store treasure short mnemonic name
  2376.  Treasure.Name$=Rtrim$(Treasure.Name$) ' strip trailing blanks
  2377.  Treasure.Name$=Lcase$(Treasure.Name$) ' convert to lower case
  2378.  If Index.Number=False Then ' compare treasure index
  2379.     Outpt="You can't fuel that!" ' make message
  2380.     Call IO.O ' send message
  2381.     Exit Sub ' exit routine
  2382.  Endif ' end compare index
  2383.  If TreasureRecord.LightType=False Then ' check treasure can be fueled
  2384.     Outpt="You can't fuel that!" ' make message
  2385.     Call IO.O ' send message
  2386.     Exit Sub ' exit routine
  2387.  Endif ' end compare treasure
  2388.  If TreasureRecord.LightCharges=False Then ' check treasure can be fueled
  2389.     Outpt="It has no light charges!" ' make message
  2390.     Call IO.O ' send message
  2391.     Exit Sub ' exit routine
  2392.  Endif ' end compare treasure
  2393.  If UserRecord.Charges(Array.Number) Then ' check treasure already fueled
  2394.     Outpt="It's already fueled!" ' make message
  2395.     Call IO.O ' send message
  2396.     Exit Sub ' exit routine
  2397.  Endif ' end compare treasure
  2398.  Fuel.Charges=TreasureRecord.LightCharges ' store treasure light charges
  2399.  Item.Number=Array.Number ' store treasure array index
  2400.  If Parser=False Then ' compare second parameter
  2401.     Outpt="Fuel with what?" ' make message
  2402.     Call IO.O ' send message
  2403.     Exit Sub ' exit routine
  2404.  Endif ' end compare parse
  2405.  Parsed.Command1=Parsed.Command2 ' get second parameter
  2406.  Call Numeric ' parse number
  2407.  Call Find.Inventory ' search player inventory
  2408.  If Index.Number=False Then ' compare treasure index
  2409.     Outpt="You can't fuel with that!" ' make message
  2410.     Call IO.O ' send message
  2411.     Exit Sub ' exit routine
  2412.  Endif ' end compare index
  2413.  If TreasureRecord.FuelType=False Then ' check treasure is a fuel
  2414.     Outpt="You can't fuel with that!" ' make message
  2415.     Call IO.O ' send message
  2416.     Exit Sub ' exit routine
  2417.  Endif ' end compare treasure
  2418.  If TreasureRecord.FuelCharges<=False Then ' check treasure fuel amount
  2419.     Outpt="It has no fuel charges!" ' make message
  2420.     Call IO.O ' send message
  2421.     Exit Sub ' exit routine
  2422.  Endif ' end compare treasure
  2423.  If UserRecord.Charges(Array.Number)=False Then ' check fuel charges
  2424.     Outpt="It has no fuel charges!" ' make message
  2425.     Call IO.O ' send message
  2426.     Exit Sub ' exit routine
  2427.  Endif ' end compare treasure
  2428.  ' decrement fuel
  2429.  UserRecord.Charges(Array.Number)=UserRecord.Charges(Array.Number)-1
  2430.  UserRecord.Charges(Item.Number)=Fuel.Charges ' add fuel charges to treasure
  2431.  Outpt="You fuel the "+Treasure.Name$+"!" ' format message
  2432.  Call IO.O ' send message
  2433. End Sub ' end routine to fuel an item
  2434.  
  2435.  Rem * routine to light an item.
  2436.  
  2437. Sub Light.Object
  2438.  On Local Error Resume Next ' local error resume
  2439.  Call Check.Inventory.Treasure ' search for player inventory treasure
  2440.  If Index.Number=False Then ' compare treasure index
  2441.     Outpt="You can't light that!" ' make message
  2442.     Call IO.O ' send message
  2443.     Exit Sub ' exit routine
  2444.  Endif ' end compare treasure index
  2445.  If TreasureRecord.LightType=False Then ' check treasure is a light
  2446.     Outpt="That's not a light!" ' make message
  2447.     Call IO.O ' send message
  2448.     Exit Sub ' exit routine
  2449.  Endif ' end compare treasure
  2450.  If UserRecord.Charges(Array.Number)=False Then ' check treasure is fueled
  2451.     Outpt="You can't, it's not fueled!" ' make message
  2452.     Call IO.O ' send message
  2453.     Exit Sub ' exit routine
  2454.  Endif ' end compare treasure
  2455.  ' check treasure is already lit
  2456.  If UserRecord.Charges(Array.Number)<False Then
  2457.     Outpt="It's already lit!" ' make message
  2458.     Call IO.O ' send message
  2459.     Exit Sub ' exit routine
  2460.  Endif ' end compare treasure
  2461.  ' set inventory charges
  2462.  UserRecord.Charges(Array.Number)=-UserRecord.Charges(Array.Number)
  2463.  Outpts=TreasureRecord.ShortName ' to negative to indicate treasure is a light
  2464.  Outpts=Rtrim$(Outpts) ' store treasure name, strip trailing blanks
  2465.  Outpts=Lcase$(Outpts) ' convert to lower case
  2466.  Outpt="You light the "+Outpts+"!" ' format message
  2467.  Call IO.O ' send message
  2468. End Sub ' end routine to light an item
  2469.  
  2470. Rem * dm/sysop routine to discard an item of inventory to nowhere, can be
  2471. Rem * used interactively during remote with function key.
  2472.  
  2473. Sub Discard.Object
  2474.  On Local Error Resume Next ' local error resume
  2475.  Call Check.Inventory.Treasure ' find treasure in player inventory
  2476.  If Index.Number Then ' treasure index to player array
  2477.     ' routine to remove from inventory
  2478.     Call Discard.Inventory(Array.Number,True)
  2479.     Outpt="You discard "+Outpts+"!" ' format message
  2480.     Call IO.O ' send message
  2481.     Exit Sub ' exit routine
  2482.  Endif ' end search treasure inventory
  2483.  Call Num ' decrement parse counter
  2484.  Call Check.Inventory.Objects ' find object in player inventory
  2485.  If Index.Number Then ' object index to player array
  2486.     Call Discard.Inventory.Object(Array.Number)
  2487.     Outpt="You discard "+Outpts+"!" ' format message
  2488.     Call IO.O ' send message
  2489.     Exit Sub ' exit routine
  2490.  Endif ' end search object inventory
  2491.  Outpt="You can't discard that!" ' make message
  2492.  Call IO.O ' send message
  2493. End Sub ' end routine to discard an item
  2494.