home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / DNDOOR46.ZIP / DNDDOOR.INC < prev    next >
Text File  |  2001-07-11  |  39KB  |  764 lines

  1.  Rem * Filename: dnddoor.inc  Version: v4.6 r1.0
  2.  Rem * Variables here are included common to all subprograms.
  3.  
  4.  DefInt A-Z   ' define all default variables as integers
  5.  Rem $Dynamic ' allocate common variables and arrays at runtime
  6.  
  7.  '  define register type for interrupt function
  8.  Type RegType
  9.   AX As Integer ' A register
  10.   BX As Integer ' B register
  11.   CX As Integer ' C register
  12.   DX As Integer ' D register
  13.   BP As Integer ' base pointer
  14.   SI As Integer ' source index
  15.   DI As Integer ' destination index
  16.   Flags As Integer ' cpu flags
  17.   DS AS Integer ' data segment
  18.   ES AS Integer ' extra segment
  19.  End Type
  20.  
  21.  '  define structure for containers
  22. Type ContainerType
  23.  Closed As Integer ' closed flag 1=closed, 0=n/a, -1=open
  24.  ContainerName As String*30 ' container name from treasure.dat file
  25.  Locked As Integer ' locked flag 1=locked, 0=n/a, -1=unlocked
  26.  Keyed As Integer ' container key number 1-32767
  27.  ShortName As String*30 ' mnemonic of container name from treasure.dat file
  28.  Charges(1 To 5) As Integer ' treasure charges of container contents
  29.  Inventory(1 To 5) As Integer ' index to treasure.dat of container contents
  30.  Invisible(1 To 5) As Integer ' invisible flag -1/0 of container contents
  31.  TreasureName(1 To 5) As String*30 ' treasure name of container contents
  32.  Permanent As Integer ' flag for permanent container (added 05/25/01)
  33. End Type
  34.  
  35.  '  action structure
  36. Type ActionType
  37.  Attribute1 As Integer ' room attribute one, 0=lit/-1=unlit
  38.  Attribute2 As Integer  ' room attribute two, 0=land/1=air/2=underwater
  39.  EncounterRate As Integer ' rate of action prompts to encounter monster
  40.  Fumble As Integer ' fumble weapons/shield result
  41.  HealthRate As Integer ' rate of action prompts to increase user health
  42.  HitPoints As Integer ' negative/positive hits for vit/fat result
  43.  Inventory As Integer  ' weapons=1/shields=2/armor=3/magic items=4 breakage
  44.  Level As Integer ' negative/positive value=lower/highest user level to enter
  45.  MonsterTalk As Integer ' talk to monster number trigger
  46.  MonsterTrigger As Integer ' number of room monster trigger
  47.  Restrictions As Integer ' level direction is restricted to, 12 bit flags
  48.  RustRate As Integer ' rate of action prompts weapons/shields rust
  49.  SpellTrigger As Integer ' number of room spell trigger
  50.  StealRate As Integer ' rate of action prompts monsters steal
  51.  Teleport As Single ' teleport trap room number result
  52. End Type
  53.  
  54.  '  define room structure. this main data file contains room descriptions,
  55.  '  directions, one container, action number, object and treasure indexes.
  56. Type RoomType
  57.  Action As Integer ' index to action file
  58.  Direct(1 To 12) As Single  ' direction link values to next room number
  59.  Flags(1 To 20) As Integer ' hidden=1/trap=2/magically hidden=3
  60.  LongDesc(1 To 5) As String*80 ' five line long description of room
  61.  MonsterClass As Integer ' number of room monster class in monclass.dat file
  62.  Object(1 To 20) As Integer ' number of object from objects.dat file
  63.  ObjCharges(1 To 20) As Integer ' object charges
  64.  ShortDesc As String*80 ' one line short description of room for brief mode
  65.  Treasure(1 To 20) As Integer ' number of treasure from treasure.dat file
  66.  TreCharges(1 To 20) As Integer ' treasure charges
  67.  Container As ContainerType ' single container per room
  68. End Type
  69.  
  70.  '  define user structure. this main data file contains user statistics,
  71.  '  values, flags, object and treasure indexes.
  72. Type UserType
  73.  CodeName As String*30 ' encrypted user codename
  74.  PassWord As String*20 ' encrypted user password
  75.  ClassName As String*20 ' encrypted user classname
  76.  ClassType As Integer ' classname number 1-10
  77.  Container(1 To 3) As ContainerType ' user's maximum of 3 containers
  78.  Inv(1 To 20) As Integer ' user's inventory index to treasure.dat file
  79.  Charges(1 To 20) As Integer ' treasure's charges/plus
  80.  Object(1 To 20) As Integer ' user's object index to objects.dat file
  81.  ObjCharges(1 To 20) As Integer ' object's charges/plus
  82.  Stats(1 To 7) As Integer ' player statistics str/int/wis/dex/con/pie/cha
  83.  Weapons(1 To 4) As Integer ' weapons proficiency percent blu/pol/sha/thr
  84.  Room As Single ' room number
  85.  Level As Integer ' player's level
  86.  Experience As Double ' player's experience
  87.  Gold As Double ' collected gold
  88.  NumCalls As Integer ' number of calls during one day
  89.  Fatigue As Integer ' fatigue points during fighting
  90.  FatigueMax As Integer ' maximum possible fatigue points
  91.  Vitality As Integer ' vitality points during fighting
  92.  VitalityMax As Integer ' maximum possible vitality points
  93.  Magic As Integer ' magic points during fighting/using spells
  94.  MagicMax As Integer ' maximum possible magic points
  95.  Poison As Integer ' user is poisoned true/false, vitality decreasing
  96.  Borrow As Double ' gold borrowed from bank
  97.  Invisible As Integer ' user is invisible true/false
  98.  Race As Integer ' player's race 1-8, hum/elf/gno/dwa/hal/hal-elf/hal-orc/ogr
  99.  Proficiency As Integer ' weapon user is proficient in 1-4
  100.  Bank As Double ' amount gold stored in bank
  101.  Sort As Integer ' sort inventory (-1/0/1)
  102.  MonstersKilled As Single ' total of all monsters killed during play
  103.  Brief As Integer ' brief mode true/false
  104.  DateOn As String*10 ' last date user logged on, form: MM-DD-YYYY
  105.  Beauty As Integer ' lady class beauty points
  106.  Glamour As Integer ' lady class glamour points
  107.  Psionic As Integer ' psionic points during fighting/casting psi spells
  108.  PsionicMax As Integer ' maximum possible psionic points
  109.  Align1 As Integer ' alignment type 1, good/neutral/evil
  110.  Align2 As Integer ' alignment type 2, lawful/neutral/chaotic
  111.  Flags As Integer ' 1=rerolled/2-128=stat wish/256=wish/512=realigned/chars
  112.  MaxCalls As Integer ' maximum calls user is allowed per day
  113.  FromHour As Integer ' time restriction logon from hour,
  114.  FromMin As Integer ' time restriction logon from minute,
  115.  ToHour As Integer ' time restriction logon to hour,
  116.  ToMin As Integer ' time restriction logon to minute.
  117.  Echo As Integer ' echo mode 0=on,-1=off
  118.  LastMessage As Integer ' last message read
  119.  Linefeeds As Integer ' linefeed mode 0=on,-1=off
  120.  Linelength As Integer ' linelength for display
  121.  Pagelength As Integer ' pagelength for display
  122.  Wordwrap As Integer ' word wrap 0=on,-1=off
  123. End Type
  124.  
  125.  '  define spell structure. this data file contains spell statistics,
  126.  '  values, and flags. this struture is used by treasure and spells.
  127. Type SpellType
  128.  SpellName As String*30 ' full name of spell
  129.  Chant As String*80 ' chant to be used for spell
  130.  Level As Integer ' level of spell/level user must be at least to cast spell
  131.  SpellType As Integer ' spell type 1-28
  132.  Teleport As Single ' spell teleports when cast
  133.  Psionic As Integer ' spell is psionic, true/false
  134.  PsionicMode As Integer ' spell is psionic, 1=attack/2=defense
  135.  ClassType As Integer ' user class allowed to cast spell, flags 1-8
  136.  Desc As String*80 ' description displayed when spell is cast
  137.  Ingred(1 To 5) As Integer ' index to treasure.dat of required ingredients
  138.  SpellFlag As Integer ' ingredients type required flag, 1=use/2=read/4=cast
  139. End Type
  140.  
  141.  '  define monster class structure. this data file contains lists of monsters.
  142. Type MonclassType
  143.  Monsters(1 To 10) As Integer ' indexed list of ten monsters from monster.dat
  144. End Type
  145.  
  146.  '  define object structure. this data file contains object statistics,
  147.  '  values, and flags. this struture is used by users and rooms.
  148. Type ObjectType
  149.  ObjectName As String*30 ' full name of object
  150.  ShortName As String*30 ' mnemonic of object name
  151.  RoomLink As Single ' link to room number for entering object
  152.  Invisible As Integer  ' is invisible
  153.  JailTrap As Integer ' jails user if attacked
  154.  DoorLock As Integer ' locked (0=n/a,1=unlocked/2=locked)
  155.  Destination As Integer ' n/a (used to be room object was created)
  156.  Permanent As Integer ' cannot be picked up. default.
  157.  Hidden As Integer ' hidden (cannot not be seen or searched for)
  158.  Closed As Integer  ' closed (-1=closed/0=open)
  159.  Keyed As Integer ' key number 1-32767
  160.  Relocks As Integer ' relocks after entering
  161.  LongDesc As String*80 ' description displayed when object looked at
  162.  FromHour As Integer ' lights room from hour,
  163.  FromMin As Integer ' lights room from minute,
  164.  ToHour As Integer ' lights room to hour,
  165.  ToMin As Integer ' lights room to minute.
  166.  LightRoom As Integer ' lights room (-1=true/0=false)
  167.  LightTime As Integer ' light time (-1=from-to/0=anytime)
  168.  ShortDesc As String*80 ' description displayed when object entered
  169.  Trap As Integer ' trapped portal (1=poison/2=teleport/3=hits for fat/vit)
  170.  Teleport As Single ' (room number, trap=2), (hits -fat/hits +vit, trap=3)
  171. End Type
  172.  
  173.  '  define monster structure. this data file contains monster statistics,
  174.  '  values, and flags.
  175. Type MonsterType
  176.  MonsterName As String*30 ' full name of monster
  177.  PluralName As String*30 ' mnemonic plural of monster name
  178.  Treasure(1 To 5) As Integer ' five indexes to treasure.dat
  179.  Experience As Double ' experience gained by killing monster
  180.  Gold As Double ' money gained by killing monster
  181.  NumberAppearing As Integer ' maximum monsters encontered at one time
  182.  Level As Integer ' monster level/level of user required to kill monster
  183.  Hits As Integer ' hit points monster has for user to kill
  184.  Poison As Integer ' monster can poison=-1/monster is poisoned>0
  185.  LevelDrain As Integer ' can drain user levels (-1/0)
  186.  Spell As Integer ' can cast spells (equal to spell record number)
  187.  Block As Integer ' can block user from exiting room
  188.  Prevent As Integer ' can prevent user from taking treasure
  189.  Follow As Integer ' can follow user
  190.  Magic As Integer ' casts magic spell (equals index to spell record number)
  191.  Jail As Integer ' can jail attacker (-1/0)
  192.  Teleport As Single ' can teleport (equals room number)
  193.  FollowPercent As Integer ' percentage to follow
  194.  BlockPercent As Integer ' percentage to block
  195.  PreventPercent As Integer ' percentage to prevent
  196.  SpellPercent As Integer ' percentage to cast spell
  197.  PoisonPercent As Integer ' percentage to poison
  198.  DrainPercent As Integer ' percentage to drain levels
  199.  Rate As Integer ' encounter rate (action prompts)
  200.  RatePercent As Integer ' percentage encountered at rate
  201.  Permanent As Integer ' monster is permanent to room
  202.  Talk(1 To 5) As Integer ' five indexes to montalk.dat
  203.  Psionic As Integer ' monster casts psionic spells
  204.  PsionicSpell As Integer ' psionic spell casted
  205. End Type
  206.  
  207.  '  define treasure structure. this data file contains treasure statistics,
  208.  '  values, and flags. this struture is used by users and rooms.
  209. Type TreasureType
  210.  TreasureName As String*30 ' full treasure name
  211.  ShortName As String*30 ' mnemonic treasure name
  212.  Weight As Integer ' weight in gold of treasure
  213.  Gold As Integer ' value in gold of treasure
  214.  Spell As Integer ' treasure is magical (index of spell record)
  215.  Plus As Integer ' treasure plus (0=normal treasure/greater>0=weapon plus)
  216.  Coin As Integer ' coins (-1/0)
  217.  Keyed As Integer ' key number (1-32767)
  218.  Scroll As Integer ' scroll (-1/0)
  219.  Charges As Integer ' charges for weapon/armor/shield/spell
  220.  Potion As Integer ' potion (-1/0)
  221.  Armor As Integer ' treasure is armor
  222.  Shield As Integer ' treasure is shield
  223.  Weapon As Integer ' treasure is weapon
  224.  Container As Integer ' container (-1/0)
  225.  Type As Integer ' treasure type (-1=shield/0=normal/1=armor/0,<plus>=weapon)
  226.  Locked As Integer ' container (1=locked,0=n/a,-1=unlocked)
  227.  Closed As Integer ' container (1=closed,0=n/a,-1=open)
  228.  Loadable As Integer ' can be loaded with ammunition (-1/0)
  229.  Ammunition As Integer ' is ammunition (-1/0)
  230.  AmmoLoads As Integer ' if ammunition, then index to treasure.dat it loads
  231.  Invisible As Integer ' invisible (-1/0)
  232.  Permanent As Integer ' treasure remains in room (not default)
  233.  Proficiency As Integer ' weapon proficiency related (1-4)
  234.  RingType As Integer ' is a ring (1=antipoison/2=antileveldrain/3=antispell)
  235.  RingSpell As Integer ' ring antispell (-1=generic/greater>0=spell number)
  236.  Edible As Integer ' edible (-1/0)
  237.  Rustable As Integer ' rusts (-1/0)
  238.  RustPercent As Integer ' percentage rusts during room rust rate
  239.  Stealable As Integer ' stealable (-1/0)
  240.  StealPercent As Integer ' percentage monster steals during room steal rate
  241.  Launchable As Integer ' can be launched with launch ammunition (-1/0)
  242.  LaunchLoads As Integer ' is launch ammunition (-1/0)
  243.  LaunchAmmo As Integer ' if launch ammo, then index to treasure.dat it loads
  244.  Movable As Integer ' launchable device can be moved (-1/0)
  245.  Vehicle As Integer ' vehicle (-1/0)
  246.  VehicleHits As Integer ' vehicle hit points for combat
  247.  VehicleType As Integer ' vehicle type (0=land,1=air,2=underwater,3=any)
  248.  LightType As Integer ' is a light (-1/0)
  249.  LightCharges As Integer ' light charges
  250.  FuelType As Integer ' is light fuel (-1/0)
  251.  FuelCharges As Integer ' fuel charges
  252. End Type
  253.  
  254.  '  define monster talk structure. this data file contains lists of strings
  255.  '  monsters can respond with when talked to.
  256. Type MonsterTalkType
  257.  TalkMessage As String*80 ' an 80 character string response
  258. End Type
  259.  
  260.  '  help file record structure. used for help command during play,
  261.  '  uses files help.dat, edithelp.dat, dmhelp.dat, and logon.dat.
  262. Type HelpType
  263.  Text As String*70 ' text to display
  264.  CName As String*15 ' command name of command to display
  265. End Type
  266.  
  267.  '  structure for messages text file. indexed by the table record structure.
  268. Type MessageType
  269.  Message As String*80 ' length of a message line
  270. End Type
  271.  
  272.  '  table for messages. stores subject, from/to, date entered, private message
  273.  '  and if the message is deleted. fields for start and length define the
  274.  '  position of the message in the messages text file.
  275. Type TableType
  276.  ClassType As Integer ' class type of the player who entered the message
  277.  Clock As String*21 ' stores the time the message was entered from FNclock$
  278.  Date As String*10 ' system date message was stored
  279.  Flags As Integer ' user record flags for special characters entered message
  280.  From As String*30 ' field storing user who entered the message
  281.  Killed As Integer ' true if the message is deleted
  282.  Length As Integer ' length of lines in messages text file
  283.  Private As Integer ' true if the message is private
  284.  Received As Integer ' flag indicating message was read
  285.  Reply As Integer ' flag for message reply
  286.  Start As Single ' beginning of the line of the message in the text file
  287.  Subject As String*20 ' stores the subject of the message
  288.  Thread As Integer ' number of message replied to
  289.  Time As String*10 ' stores system time message was entered
  290.  Timer As Single ' stores system time in seconds message was entered
  291.  TimesRead As Integer ' stores number of times message was read
  292.  To As String*30 ' stores name of the user the message is to, or empty for all
  293. End Type
  294.  
  295.  '  define variables, fixed length/variable strings, and
  296.  '  dynamic arrays common to all subprograms.
  297. Common Shared _
  298.  ActionRecord As ActionType,_ ' action structure
  299.  Action.Prompt As String,_ ' stores action prompt Next: or Command>
  300.  Alignment.Name1() As String*7,_ ' stores three type 1 alignment names
  301.  Alignment.Name2() As String*7,_ ' stores three type 2 alignment names
  302.  Allow.Break As Integer,_ ' allows control-k checking during file output
  303.  Array() As String,_ ' string array for mail
  304.  Array.List() As String*16,_ ' string array for command help
  305.  Array.Number As Integer,_ ' contains number of array element searched for
  306.  Baud.Override As Integer,_ ' command line baud override
  307.  BBS.Name As String,_ ' name of calling bbs name from rbbs .def file
  308.  Break As Integer,_ ' returns -1 is control-k pressed
  309.  Buffer As String,_ ' stores modem i/o
  310.  Carriage.Return As Integer,_ ' supresses linefeed during output
  311.  Charges.Number As Integer,_ ' contains charges of item searched for
  312.  Chained.Rooms As Integer,_ ' used in launch routine
  313.  Chat As Integer,_ ' chat mode flag
  314.  Choice As Integer,_ ' monster number selected
  315.  Class.Name() As String*15,_ ' stores ten class names
  316.  Color.Code As Integer,_ ' current ansi color
  317.  Color.Graphics As Integer,_ ' ansi color activated remote
  318.  Command.Name As String,_ ' storage of user command
  319.  Continue As Integer,_ ' flag for continuous output
  320.  ContainerRec As ContainerType,_ ' container structure
  321.  Direction As Integer,_ ' direction 1-11
  322.  Direction() As String*9,_ ' stores eleven direction names
  323.  Door.Name As String,_ ' name of calling bbs user from rbbs .def file
  324.  Door.Time As Single,_ ' time left from rbbs .def file
  325.  DOS.Major As Integer,_ ' dos major version
  326.  DOS.Minor As Integer,_ ' dos minor version
  327.  Dungeon.Master As Integer,_ ' user is dungeon master (-1/0)
  328.  Dungeon.Master.Assistant As Integer,_ ' user is asst. DM (-1/0)
  329.  Entry.Command As Integer,_ ' last command number used for room entry
  330.  FileName As String,_ ' file name storage
  331.  Func.Buffer As String,_ ' buffer of interactive pressed function key
  332.  Governor As Integer,_ ' user is governor (-1/0)
  333.  Graphics.Off As Integer,_ ' set ansi graphics off (to white) (-1/0)
  334.  Guild.Master As Integer,_ ' user is guild master (-1/0)
  335.  HelpRecord As HelpType,_ ' help record structure
  336.  Hidden.Player As Integer,_ ' player is hidden (-1/0)
  337.  Hidden As Integer,_ ' mask input for security i/o with Mask$
  338.  High.Class.Name() As String*15,_ ' ten high class names
  339.  Inpt As String,_ ' user i/o input
  340.  Index.Number As Integer,_ ' contains index number of an item searched for
  341.  Intoxicated As Integer,_ ' user is intoxicated (equal to action prompts)
  342.  Invisible As Integer,_ ' user is invisible (-1/0)
  343.  Last.Command As String,_ ' last command entered
  344.  Last.Command.Number As Integer,_ ' number of last command entered
  345.  Last.Monster As String,_ ' name of last monster attacked
  346.  Learned.Spells As String,_ ' string of 1's and 0's of spells learned
  347.  Line.Length As Integer,_ ' maximum length of input allowed
  348.  Line.Limit As Integer,_ ' used with word wrap
  349.  Local.Mode As Integer,_ ' user is logged in at console
  350.  Locks.Smashed As Integer,_ ' used in launch routine
  351.  Logged.In As Integer,_ ' flag indicating user is logged in
  352.  Magic.Spell As Integer,_ ' magic spell number of spells.dat being cast
  353.  Max.Row As Integer,_ ' maximum rows used for screen scrolling/output
  354.  Message1 As String,_ ' stores message when user killed for death routine
  355.  Message.Length As Integer,_ ' stores length of message in mail
  356.  Message.Reply As Integer,_ ' flag for message reply
  357.  Message.Thread As Integer,_ ' message number replied to
  358.  Message.To As String,_ ' stores message to in mail
  359.  MessageRecord As MessageType,_ ' message record structure for mail
  360.  Modem.Baud As Integer,_ ' connect speed, 00 truncated
  361.  Monclass As Integer,_ ' current room monster class
  362.  Monclass.Max As Integer,_ ' maximum monster classes in monclass array
  363.  MonclassRecord As MonclassType,_ ' monster class record structure
  364.  Monster.Class() As Integer,_ ' array of monster classes
  365.  Monster.Cycle As Integer,_ ' incrementing counter for monster attacks
  366.  Monster.Number As Integer,_ ' stores currently accessed monster number
  367.  Monster.Percent() As Integer,_ ' array of monster percents
  368.  Monster.Rate() As Integer,_ ' array of monster encounter rates
  369.  Monster.Rate1 As Integer,_ ' counts file monster rates
  370.  Monster.Rate2 As Integer,_ ' counts room monster rates
  371.  MonsterArray() As MonsterType,_ ' array of 20 monster record structures
  372.  MonsterIndex() As Integer,_ ' array of 20 indexes to monster.dat file
  373.  MonsterRecord As MonsterType,_ ' defines monster structure
  374.  Monsters.Killed As Integer,_ ' total monsters killed in session
  375.  MonsterTalkRecord As MonsterTalkType,_ ' monster class structure
  376.  Multiplier As Integer,_ ' multiplier used in combat
  377.  New.Room As Integer,_ ' added new room flag
  378.  Next.Room As Single,_ ' next room storage
  379.  No As Integer,_ ' entered N during input (-1/0)
  380.  No.Echo As Integer,_ ' do not echo user input
  381.  No.Input As Integer,_ ' null was entered (-1/0)
  382.  No.Input.Out As String,_ ' string to return if null entered during input
  383.  Node As String,_ ' node in string form
  384.  Node1 As Integer,_ ' node number (0-9,A-Z)
  385.  Node2 As Integer,_ ' node number (0-99)
  386.  Normal.User As Integer,_ ' user has special attributes (-1/0)
  387.  Number.Appearing As Integer,_ ' maximum monsters of one type encountered
  388.  Number.Monsters As Integer,_ ' current number of active monsters in room
  389.  ObjectRecord As ObjectType,_ ' object structure
  390.  Outpt As String,_ ' user i/o output
  391.  Outpts As String,_ ' temporary user i/o output variable
  392.  Parse.Count As Integer,_ ' parsed count to decrement
  393.  Parse.Number As Integer,_ ' stores command numbers (pound sign) quantity
  394.  Parsed.Command1 As String,_ ' first or second command parsed from input
  395.  Parsed.Command2 As String,_ ' first or second command parsed from input
  396.  Parser As Integer,_ ' position of command second word parsed 
  397.  Pass.Door As Integer,_ ' passdoor spell cast
  398.  Player.CodeName As String,_ ' storage for user codename
  399.  Player.PassWord As String,_ ' storage for user password
  400.  Port As Integer,_ ' modem port being used (0-7)
  401.  Port.Override As Integer,_ ' command line override
  402.  Prefix1 As String,_ ' the/or/an
  403.  Previous.Command As Integer,_ ' -1=use,0=n/a,equals last command number
  404.  Previous.Command1 As String,_ ' storage of previous command 
  405.  Previous.Command2 As String,_ ' storage of previous parsed command
  406.  Previous.Command3 As String,_ ' storage of previous second parsed command
  407.  Private.Message As Integer,_ ' flag for mail
  408.  Psi.Attack.Mode As Integer,_ ' last offense psi spell cast
  409.  Psi.Defense.Mode As Integer,_ ' last defense psi spell cast
  410.  Quit As Integer,_ ' true if Q entered
  411.  Race() As String*8,_ ' stores eight race names
  412.  Room As Single,_ ' current room number
  413.  Room.Health.Rate As Integer,_ ' number of action prompts for health update
  414.  Room.Monster.Rate As Integer,_ ' number of action promptsfor monster update
  415.  Room.Rate As Integer,_ ' counter of action prompts for room rate
  416.  Room.Rust.Rate As Integer,_ ' counter of room rust rate
  417.  Room.Steal.Rate As Integer,_ ' counter of room steal rate
  418.  RoomRecord As RoomType,_ ' room structure
  419.  Rust.Rate As Integer,_ ' rust rate in action prompts
  420.  Share.Installed As Integer,_ stores share setting
  421.  Sorting As Integer,_ ' inventory sorting (-1/0/1)
  422.  SpellRecord As SpellType,_ ' spell structure
  423.  Spell.Number As Integer,_ ' spell number being used
  424.  Spell.Cast.Type As Integer,_ ' type of spell being cast
  425.  Stat() As String*12,_ ' storage of eight statistics names
  426.  Steal.Rate As Integer,_ ' steal rate in action prompts
  427.  Stored.Parsed.Command1 As String,_ ' first parsed command from user input
  428.  Stored.Parsed.Command2 As String,_ ' second parsed command from user input
  429.  Subject As String,_ ' store mail subject
  430.  Sysop As Integer,_ ' contains -1 if player is sysop
  431.  TableRecord As TableType,_ ' message table for mail
  432.  Teleported As Integer,_ ' user entered room by teleporting (-1/0)
  433.  TempRecord As MessageType,_ ' temporary structure
  434.  Temp, Temp!, Temp$,_ ' global temporary variables
  435.  Temp.Array1() As Integer,_ ' global temporary variables
  436.  Temp.ArrayX() As Integer,_ ' global temporary variables
  437.  Temp.ArrayZ() As Double,_ ' global temporary variables
  438.  Temp0, Temp1, Temp2, Temp3, Temp4,_ ' global temporary variables
  439.  Temp5, Temp6, Temp7, Temp8, Temp9,_ ' global temporary variables
  440.  Time.Calc As Single,_ ' time storage variable
  441.  Time.Left As Single,_ ' amount of time user is allowed on in seconds
  442.  Time.On As String,_ ' time user logged on in Date$ format
  443.  Timeon As Single,_ ' time user logged on in Timer format
  444.  Timelogged.On As Double,_ ' time user logged on on double format
  445.  Town.Mayor As Integer,_ ' user is town mayor (-1/0)
  446.  Training.Stats() As Integer,_ ' storage for training statistics
  447.  TreasureRecord As TreasureType,_ ' treasure structure
  448.  Two.Minutes.Left As Integer,_ ' flag indicating two minutes warning shown
  449.  Type.Number As Integer,_ ' flag for type of object in room or inventory
  450.  Upper.Case As Integer,_ ' flag to force first character uppercase in io.i
  451.  User.Echo As Integer,_ ' stores online user echo preference
  452.  User.LineFeeds As Integer,_ ' stores online user linefeed preference
  453.  User.LineLength As Integer,_ ' stores online user linelength preference
  454.  User.PageLength As Integer,_ ' stores online user pagelength preference
  455.  User.Wordwrap As Integer,_ ' stores online user wordwrap preference
  456.  User.Command As String,_ ' stores original user input
  457.  User.Index As Integer,_ ' index of user number to users.dat file
  458.  User.Number As Integer,_ ' alternate user index variable
  459.  UserRecord As UserType,_ ' user structure
  460.  Vehicle1 As Integer,_ ' index to room treasure array (1-10)
  461.  Vehicle2 As Integer,_ ' charges in vehicle
  462.  Vehicle3 As Integer,_ ' index to treasure.dat file
  463.  Vehicle4 As Integer,_ ' vehicle type (0-3)
  464.  Weapon.Type.Name() As String*9,_ ' storage of four weapon names
  465.  Weapon1 As Integer,_ ' plus of armor worn
  466.  Weapon2 As Integer,_ ' plus of weapon held
  467.  Weapon3 As Integer,_ ' plus in shield held
  468.  Weapon4 As Integer,_ ' index to user inventory array of armor worn
  469.  Weapon5 As Integer,_ ' index to user inventory array of shield held
  470.  Weapon6 As Integer,_ ' index to user inventory array of weapon held
  471.  Weapon7 As Integer,_ ' index to user inventory array of ring worn
  472.  Weapon8 As Integer,_ ' ring type (1=antipoison/2=antileveldrain/3=antispell)
  473.  Weapon9 As Integer,_ ' ring antispell (-1=generic/greater>0=spell number)
  474.  Weapon10 As Integer,_ ' proficiency number of weapon held
  475.  Weight As Integer,_ ' total amount in gold of user's inventory
  476.  Win.Major As Integer,_ ' windows major version
  477.  Win.Minor As Integer,_ ' windows minor version
  478.  Word.Wrap As Integer,_ ' used for word wrap during input
  479.  Yes As Integer ' user entered Y during input (-1/0)
  480.  
  481.  Common Shared Inregs As RegType, Outregs As RegType ' register structures
  482.  
  483.  '  constants used in place of variables inline programs
  484.  Const Author$="Erik Jon Oredson" ' name of author
  485.  Const Dead$="-dead-" ' used internal to user file
  486.  Const Deleted$="<deleted>" ' used internal to data files
  487.  Const Enter$="<enter>" ' generic response substring
  488.  Const False=0 ' false
  489.  Const Mask$="#" ' define mask character
  490.  Const More$="More(y/n/c/q)?" ' generic response substring
  491.  Const MaxInt=32767 ' maximum integer
  492.  Const MaxStat=250 ' maximum player statistic
  493.  Const MinInt=-32768 ' minimum integer
  494.  Const None$="<null>" ' used internally
  495.  Const Nul="" ' empty string
  496.  Const Program$="DNDDOOR" ' program name
  497.  Const Range$="<range error>" ' generic response substring
  498.  Const Release$="1.0a" ' program minor version
  499.  Const True=Not False ' true
  500.  Const UnTrue=False+1 ' untrue
  501.  Const Version$="4.6a" ' program major version
  502.  
  503.  '  constant variables corresponding to last command entered
  504.  Const Picklock.Command=26 ' compare to picklock
  505.  Const Hide.Command=49 ' compare to hide
  506.  Const Identify.Command=52 ' compare to identify
  507.  
  508.  '  constant variables for driving vehicles
  509.  Const RideVehicle=48 ' ride vehicle command number
  510.  Const DriveVehicle=73 ' drive vehicle command number
  511.  
  512.  '  constant variables of weapon proficiency types
  513.  Const Blunt=1 ' blunt weapon number
  514.  Const Pole=2 ' pole weapon number
  515.  Const Sharp=3 ' sharp weapon number
  516.  Const Thrusting=4 ' thrusting weapon number
  517.  
  518.  '  bit constants of room record flags array attributes of room inventory
  519.  Const Hidden.Object=1 ' object was hidden with hide command
  520.  Const Magic.Trap=2 ' object was made into a trap with spell
  521.  Const Magically.Hidden=4 ' object was magically hidden with spell
  522.  
  523.  '  constant variable used to indicate spell method being used
  524.  Const Use.Spell.Type=1 ' spell cast is by the use command
  525.  Const Scroll.Spell.Type=2 ' spell cast by using a scroll
  526.  Const Cast.Spell.Type=4 ' spell cast with the cast command
  527.  
  528.  '  bit constants of player class, character, and command flags,
  529.  '  bits 2 through 128 correspond to the seven statistics players may wish for.
  530.  Const Rerolled=1 ' bit flag of user record flags field for rerolled player
  531.  Const Wished=256 ' bit flag of user record flags field of player wished
  532.  Const Alignmented=512 ' bit flag of user record flags field of player align
  533.  Const Locked.User=1024 ' bit for locked mailbox
  534.  Const Special.Char1=2048 ' bit flag of user record flags field town mayor
  535.  Const Special.Char2=4096 ' bit flag of user record flags field governor
  536.  Const Special.Char3=8192 ' bit flag of user record flags field guild master
  537.  Const Special.Char4=16384 ' bit flag of user record flags field sysop
  538.  
  539.  ' constants of class type numbers
  540.  Const Fighter=1 ' fighter class
  541.  Const MagicUser=2 ' MU class
  542.  Const Thief=3 ' thief class
  543.  Const Cleric=4 ' cleric class
  544.  Const Paladin=5 ' paladin class
  545.  Const Ranger=6 ' ranger class
  546.  Const Druid=7 ' druid class
  547.  Const Lady=8 ' lady class
  548.  Const AsstDM=9 ' asst. DM class
  549.  Const DM=10 ' DM class
  550.  
  551.  ' constants of attack command numbers
  552.  Const Charm=31 ' attack command number constant
  553.  Const Beguile=32 ' attack command number constant
  554.  Const Shield=34 ' attack command number constant
  555.  Const Guard=35 ' attack command number constant
  556.  Const Lunge=39 ' attack command number constant
  557.  Const Dodge=40 ' attack command number constant
  558.  Const Killed=55 ' attack command number constant
  559.  Const Backstab=59 ' attack command number constant
  560.  Const Circled=60 ' attack command number constant
  561.  Const Feint=61 ' attack command number constant
  562.  Const Parry=62 ' attack command number constant
  563.  Const Thrust=63 ' attack command number constant
  564.  Const Charge=64 ' attack command number constant
  565.  Const Turn=65 ' attack command number constant
  566.  Const Counter=66 ' attack command number constant
  567.  Const Bemuse=67 ' attack command number constant
  568.  Const Befuddle=68 ' attack command number constant
  569.  Const Pummel=69 ' attack command number constant
  570.  Const Resist=70 ' attack command number constant
  571.  Const PsiMode=71 ' attack command number constant
  572.  Const Beat=82 ' attack command number constant
  573.  Const Punch=83 ' attack command number constant
  574.  Const Bewitch=84 ' attack command number constant
  575.  Const Bewilder=85 ' attack command number constant
  576.  
  577.  ' constants of spell type numbers
  578.  Const Enchant=1 ' spell number constant
  579.  Const Offense=2 ' spell number constant
  580.  Const Bless=3 ' spell number constant
  581.  Const Wish=4 ' spell number constant
  582.  Const Poison=5 ' spell number constant
  583.  Const Vigor=6 ' spell number constant
  584.  Const Heal=7 ' spell number constant
  585.  Const CurePoison=8 ' spell number constant
  586.  Const LevelDrain=9 ' spell number constant
  587.  Const Teleport=10 ' spell number constant
  588.  Const Befuddled=11 ' spell number constant
  589.  Const TurnUndead=12 ' spell number constant
  590.  Const PassDoor=13 ' spell number constant
  591.  Const Conjure=14 ' spell number constant
  592.  Const Psionic=15 ' spell number constant
  593.  Const DetectLock=16 ' spell number constant
  594.  Const DetectEvil=17 ' spell number constant
  595.  Const DetectTrap=18 ' spell number constant
  596.  Const Intoxicate=19 ' spell number constant
  597.  Const SetTrap=20 ' spell number constant
  598.  Const Hiding=21 ' spell number constant
  599.  Const Search=22 ' spell number constant
  600.  Const Invisibility=23 ' spell number constant
  601.  Const Identify=24 ' spell number constant
  602.  Const Enlighten=25 ' spell number constant
  603.  Const Illuminate=26 ' spell number constant
  604.  Const Psyche=27 ' spell number constant
  605.  Const Telepathy=28 ' spell number constant (not used)
  606.  
  607.  ' constants for psionic spells
  608.  Const PsiAttack=1 ' psionic attack mode
  609.  Const PsiDefense=2 ' psionic attack mode
  610.  
  611.  ' constants for room attribute 1
  612.  Const LitRoom=0 ' flag constant for dark room
  613.  Const UnlitRoom=-1 ' bit flag constant for lit room
  614.  
  615.  ' constants for room attribute 2 and vehicle type
  616.  Const Land=0 ' flag value for ground type room
  617.  Const Air=1 ' flag value for above ground room
  618.  Const Water=2 ' flag value constant for underwater room
  619.  
  620.  ' constants of room entry command
  621.  Const Fly=74 ' entry command number
  622.  Const Swim=79 ' entry command number
  623.  
  624.  ' constants for vehicle type
  625.  Const AllTerrain=4 ' vehicle terrain type
  626.  
  627.  ' constants of file numbers
  628.  Const UserFile=1 ' file number
  629.  Const NonPlayerFile=2 ' file number
  630.  Const RoomFile=3 ' file number
  631.  Const ObjectFile=4 ' file number
  632.  Const MonsterFile=5 ' file number
  633.  Const TreasureFile=6 ' file number
  634.  Const MonTalkFile=7 ' file number
  635.  Const MonClassFile=8 ' file number
  636.  Const SpellFile=9 ' file number
  637.  Const TableFile=10 ' file number
  638.  Const MessageFile=11 ' file number
  639.  Const ActionFile=12 ' file number
  640.  Const TempFile=13 ' file number
  641.  Const TempFile2=14 ' file number
  642.  Const HelpFile=15 ' file number
  643.  
  644.  ' subroutine allows bios access. linked from VBDOS.LIB.
  645.  Declare Sub Interrupt(N As Integer,I As RegType,O As RegType)
  646.  
  647.  ' function creates a formatted string containing the date and time.
  648.  Def FNclock$=Format$(Now,"ddd dd mmm yy\, hh:mma/p")
  649.  
  650.  ' function creates a formatted string containing a double precision variable.
  651.  Def FNform$(X#)=Format$(X#, "#,##0;;"+Chr$(34)+"zero"+Chr$(34))
  652.  
  653. REM Notes on terminology:
  654.  
  655. '  The term 'mnemonic' refers to shortened words for common use, example,
  656. '    'A two-handed sword' would have a mnemonic 'sword' for the game to
  657. '    identify the long treasure name.
  658.  
  659. '  The term 'index' refers to a variable which points to an element of an
  660. '    array. For example, Temp7 could be an index to UserRecord.Inv array,
  661. '    if Temp7=10, then Temp7 is the index of UserRecord.Inv(Temp7).
  662.  
  663. '  The term 'structure' refers to a collection of fixed length strings,
  664. '    integers, and precision variable described in a common variable. For
  665. '    example, the UserType described in the include file would be used as a
  666. '    structure by assigning the type to the record, for example,
  667. '    Dim UserRecord As UserType. Then variables in the structure are
  668. '    accessed with the dot symbol, for example, UserRecord.Gold.
  669.  
  670. '  The term 'record' refers to a single structure which can be read or
  671. '    written to a random file using the get and put statements. For example,
  672. '    the user record could be placed into the user file with the statement
  673. '    Put UserFile,10,UserRecord, or Put 3,10,UserRecord.
  674.  
  675. '  The term 'parse' or 'parse temp' refers to the numeric specific to an
  676. '    item following the pound sign. For example, the parse temp for
  677. '    'an axe#2' is equal to 2. Since searching for an item during the game
  678. '    checks the room first then the user inventory, the parse temp must be
  679. '    decremented after the room inventory is checked. For example, 'an axe#2'
  680. '    would count one axe on the floor, decrement by one, then find the
  681. '    first axe in the user inventory, which is the second axe to find.
  682.  
  683. '  The term 'player', 'user', 'character', are used interchangeably. For
  684. '    example, 'player character' may refer to the statistics or points
  685. '    of the user and his/her record structure. Or, for example, 'user' may
  686. '    refer to the player and his or her codename, etc.
  687.  
  688. '  Usage of the variable 'Graphics.Off' usually with the comment 'reset color
  689. '    is used in this manner: When the player has remote ansi installed, and
  690. '    the game sends ansi codes, color graphics are sent to the player by
  691. '    cycling high intensity ansi codes for the 6 base colors. The variable
  692. '    Color.Graphics is set to true to send ansi codes. Thus, setting
  693. '    Graphics.Off to True sets remote ansi to high intensity white, and
  694. '    setting Graphics.Off to False resets the cycling high intensity ansi.
  695.  
  696. '  Usage of the output routine with no assignment to the output string,
  697. '    sends a blank carriage return/linefeed to the modem. For example,
  698. '    'Outpt=Nul' followed by 'Call IO.O' sends a blank line. Calling
  699. '    the output routine twice sends a blank line after the first message,
  700. '    for example, 'Outpt="Output line."', 'Call IO.O', 'Call IO.O', sends
  701. '    the first line, then a blank line.
  702.  
  703. '  Usage of the term 'string', or 'message' refer to an assignment or use of
  704. '    text imbedded in quotes, or assigned to a variable. For example:
  705. '    "This text line." could be called a message or string. And the line
  706. '    Outpt="This text line." could have a comment ' make message.
  707.  
  708. '  The term 'cr/lf' refers to carriage return/line feed which are the
  709. '    ascii characters 13 and 10, respectively. Note however that linefeeds
  710. '    are not normally used by terminal programs and are usually ignored.
  711.  
  712. '  The variable passing conventions for calling modules have two forms.
  713. '    A call to an example routine, 'Call Routine1(4)' where the routine
  714. '    has a variable with the value of 4 passed to it, 'Sub Routine1(Var)'
  715. '    allows the routine to accept a passed parameter. This is named
  716. '    calling by value. A call to the same routine with a variable,
  717. '    'Call Routine1(Temp)' passes the value contained in Temp. When the
  718. '    routine accepts the value in its own variable Var, then assigns a new
  719. '    value to Var, the return from the routine will change the value in
  720. '    Temp. This is named calling by reference. Passed variables should
  721. '    match in type.
  722.  
  723. REM Notes on memory usage:
  724.  
  725. '  Memory usage by arrays include three separate methods. Assigning a
  726. '  variable length string array, such as,
  727. '    Redim Array1(1 To 10) As String
  728. '  uses the near segment of the basic memory pool by using string descriptors
  729. '  which can be very costly as the array bounds increase. Secondly, assigning
  730. '  a fixed length array, such as,
  731. '    Redim Array2(1 To 10) As Sring*7
  732. '  uses the far segment which is an additional 64k memory storage area
  733. '  in basic. The last example using fixed length arrays whose length are a
  734. '  power of 2, such as,
  735. '    Redim Array3(1 To 1024) As String*128
  736. '  allows the array to excede the 64k upper bounds by using the basic heap
  737. '  segment memory pool, the remaining available memory after the program has
  738. '  initialized. To do this the /ah compiler switch must be used.
  739.  
  740. REM Instructions for compiling Dnd Door with VB 1.0 PRO:
  741.  
  742. ' VB 1.0 Basic compiler BC.EXE and linker LINK.EXE are required.
  743.  
  744. ' Libraries required: VBDOS.LIB, VBDCL10E.LIB.
  745.  
  746. ' Compile:
  747. '   BC DNDDOOR/AH/O/X;
  748. '   BC DNDS1/AH/O/X;
  749. '   BC DNDS2/AH/O/X;
  750. '   BC DNDS3/AH/O/X;
  751. '   BC DNDS4/AH/O/X;
  752. '   BC DNDS5/AH/O/X;
  753. '   BC DNDS6/AH/O/X;
  754. '   BC DNDS7/AH/O/X;
  755.  
  756. ' Linking:
  757. '   LINK DNDDOOR+(DNDS1)+(DNDS2)+(DNDS3)+(DNDS4)+(DNDS5)+(DNDS6)+(DNDS7),DNDDOOR.EXE,NUL,VBDOS.LIB;
  758.  
  759. REM If you change Dnddoor.Inc then all subprograms must be compiled.
  760.  
  761. REM Use Nmake.exe to recompile using the Makefile contents.
  762.  
  763. REM -end include file-
  764.