(This is the "Dungeon Designs" column from the March 1995 issue of the Eamon Adventurer's Guild newsletter.  Copyright 1995 Eamon Adventurer's Guild, 7625 Hawkhaven Dr., Clemmons, NC 27012-9408.  You may reproduce this freely as long as this credit remains attached to the article.)


(Editor's Note: the following is somewhat exotic and rather advanced and stretches the way that an Eamon is meant to work.  If you are up to them, these are some interesting tips. - TomZ)

In the June '94 EAG, Phil Moore asked, "Can two monsters in the same adventure carry the same weapon?"  The answer was no, they couldn't.  Actually, they can.  Well, sort of... Two monsters can't be carrying the same weapon, but they can be made to appear to fight with it if you simply add two lines of code to the MAIN PGM (v7).

First, when you create your monster, leave the Weapon field at zero.  Also leave the Room field of the weapon at zero. Now let's say that you want Monster 25 and Monster 29 to both use Artifact 60.  Add this line:

7506 IF OF = 25 OR OF = 29 THEN W = 60

Also change the end of Line 7525 to:

     ...IF R < 41 OR W = 60 THEN PRINT "
            FUMBLE RECOVERED.": GOTO 56

That's all it takes.  Line 7506 assigns weapon Artifact 60 (for attacking purposes only) to Monster 25 or 29 whenever they attack somebody.  The changed Line 7525 keeps the weapon from being dropped or broken in combat.

Another good question is, "Can a group monster have varied weapons?"  This is also possible.  Let's say for example that we want Monster 24 to use either Natural Weapons (claws), Artifact 59, or Artifact 60.  The following line will do it:

7506 IF OF = 24 THEN RL = INT (RND (1) * 11):
      W = (RL > 4) * 59 + (RL > 7)

Whenever Applesoft has a logical statement like "(RL > 4)", it will return either a 1 (meaning True) or a zero (False). The above Line 7506 first rolls a random number from 0 to 10.  Then a check is made to see if the roll was greater than 4.  If so, then the weapon artifact value becomes 59; if not, it stays at zero (natural weapons).  Finally a check is made to see if the roll was greater than 7.  If so, then the weapon becomes Artifact 60.

You'll also need to update Line 7525 as in the first example so that artifacts 59 and 60 can't be dropped or broken in a fumble.

Phil also asked about how Control-M can be added to REM statements and was told that you need an Applesoft editor. You can also do them with a disk sector editor if you know what you're doing.  Let me know if you want instructions on the sector editor method.
________________________________________________

A Tour of the MAIN PGM 7.1    (Part III)

12000-12060 HEAL routine
12010 set S to HEAL; go execute spellcast;
      if monster is named then search for match
      to name
12040 check for screen pause; if object of HEAL
      is injured then print HEALTH IMPROVES
      message
12050 reduce hit damage by 3 to 12; if damage
      is reduced below zero then set to zero
12060 use code in DO BATTLE routine to compute
      and print hit damage; exit to PICK FOE
      routine

13000-13080 POWER routine
13010 set S to POWER; go execute spellcast;
      generate random number RL; if RL < 11
      (10% chance) and player has hit damage
      then restore to perfect health; exit
      through screen pause check to PICK FOE
13050 if Rl < 91 (80% chance) then print SONIC
      BOOM message; perform screen pause check;
      exit to PICK FOE routine
13070 restore all monsters in room to perfect
      health (10% chance)
13080 check monster status; exit to PICK FOE

14000-14040 SPEED routine
14010 set S to SPEED; execute spellcast
14020 if SPEED spell is already active then
      print NOTHING HAPPENED message; exit
      through screen pause check to PICK FOE
14040 double player Agility; set spell counter
      to 10-32; print QUICKEN message; exit
      through screen pause check to PICK FOE

15000-15100 SMILE routine
15005 if no light then abort to YOU SEE
15010 print blank line; check for monster in
      room; if none then exit to PICK FOE
15030 increment line counter; print monster
      name; if multiple-monster then add "S"
      for plural
15040 print response appropriate for monster
      alignment; if not multiple-monster then
      add "S" to response
15050 print "AT YOU."
15100 check for more monsters in room; update
      line count; exit to PICK FOE routine

16000-16900 SAY routine
16010 check for object S$
16900 if S$ present then "say" it.

17000-17100 READY routine
17010 check for object S$; check to see if named
      object is being carried; if not carried
      then exit through error message at 91
17030 if named object not weapon then print NOT
      a WEAPON and exit through line count to
      YOU SEE routine
17100 set player's Dice and Sides to that of
      named weapon; set W2 to weapon type;
      print READIED message

18000-18100 SAVE routine
18010 ask if player is sure they want to save
      game
18020 get player response; if not "Y" or "N"
      then try again for proper response
18030 print response; if "N" then exit to YOU
      SEE routine
18040 close open files; clean up string space by
      executing FRE command; BSAVE variable
      pointers
18060 BSAVE nonstring variables
18070 BSAVE string variables
18080 print GAME SAVED message
18090 ask if player wishes to resume play; if
      not "N" then exit to RESUME routine to
      reopen files
18100 END program execution

19000-19050 LIGHT routine
19010 check for object S$; check to see if
      player is carrying named object; if not
      then exit through error message at 91
19040 set light flag LT to natural light of
      room; if named object is not lightable
      then print IT WON'T LIGHT
19050 set LT to "light"; set light source LS
      to number of lighted object; print
      LIGHTED message; exit to PICK FOE through
      line count routine

20000-20340 OPEN routine
20010 check for object S$; check to see if
      object is available; if not then exit to
      DOOR check at 20060
20020 if object is hidden then make visible
20030 update line count; proceed to OPENABLE
      routine if object is container,
      drinkable, or readable
20050 proceed to DOOR routine if object is door
20060 if no true artifact is named but object is
      DOOR or GATE then print TRY GOING message
20070 if we get here it is not openable; print
      IT WON'T OPEN

20100-20130 OPENABLE routine
20110 if readable or drinkable and open flag is
      set then print ALREADY OPEN message
20120 if container then mark unhidden (feature
      not used); if a key exists but is not held
      by player then print LOCKED message; exit
      to YOU SEE throuh line counting routine
20130 mark as open; print OPENED; if drinkable
      or readable then exit to PICK FOE through
      line count

20200-20230 CONTAINER routine
20220 update line counter; check artifact array
      for artifacts in container; if any found
      then put found artifacts in room; set LK
      flag to 1
20230 print FOUND NOTHING or SOMETHING INSIDE
      depending on state of LK flag; exit to
      PICK FOE through line counter routine

20300-20340 DOOR routine
20310 if a key exists but is not held by player
      then print LOCKED message; exit to YOU
      SEE through line counting routine
20330 unhide door; unlock door; put door in
      room; print OPENED message; find room
      connection of door
20340 exit to PICK FOE through line counter

21000-21150 PUT routine
21010 if object is named then run object through
      PARSE routine to see if it parses into
      full command (PUT XX IN YY)
21040 if not recognized as full command then ask
      for name of object and container
21100 check for object; if not present then exit
      to PICK FOE through line counting routine
21110 check for container; if not present or
      same as object then exit to PICK FOE
      through line counting routine
21120 if container is not a "container" object
      then proceed to error message
21130 if container not open then exit to MUST
      FIRST OPEN IT error message
21140 change object's location to inside
      container; print OKAY; exit to PICK FOE
      through line counting routine
21150 print YOU CAN'T DO THAT; exit to PICK FOE
      through line counting routine


