]Eamon Adventurer's Guild Online

   

Detailed Tour of Eamon Main Pgm 7.1

Originally written by Tom Zuchowski in the Sep 94 - Dec 94 - Mar 95 - Jun 95 issues of the Eamon Adventurer's Guild.
Online version created by Matthew Clark - Eamon Adventurer's Guild Online - http://www.eamonag.org
 
MAIN PGM Listing   Description
1 REM EAMON ADVENTURE #NNN    
2 REM (NAME OF ADVENTURE)    
3 REM    
4 REM BY (YOUR NAME HERE)    
5 REM    
6 REM VERSION 7.1.    
7 REM MP56 1/15/95  

 

8 REM ..EAMON ADVENTURER'S GUILD.
              7625 HAWKHAVEN DR.
              CLEMMONS, NC 27012..
   
10 PRINT CHR$ (4)"MAXFILES 3"    
20 GOTO 33000    
    45-50 string print subroutine
45 F1 = PEEK (111) : F2 = PEEK (112) :  PRINT D$"READ"ED$", R"R :  INPUT A$ :  PRINT D$   45 note the top of free memory and read in A$ from disk
50 LL = ( LEN (A$) + CP - 1) / CP : L = L + LL :  GOSUB 58 :  PRINT A$ : L = L + LL * (L = 0) :  IF ( PEEK (109) + PEEK (110) * 256 + LEN (A$)) < (F1 + F2 * 256) THEN POKE 111, F1 :  POKE 112, F2   50 perform screen pause calculation for A$ length; print A$; then recover the memory that A$ occupied
    51-59 screen pause routine
51 PRINT   51 print blank line, increment line counter by one
52 L = L + 1 :  GOTO 58   52 increment line counter by one
54 L = L + 1   54 print blank line, increment line counter by 3
56 L = L + 2 :  PRINT   56 print blank line, increment line counter by 2
58 IF L < 23 THEN RETURN   58 check for full screen; if full then
59 PRINT " (PRESS ANY KEY TO CONTINUE) "; :  GET Q$ :  PRINT : VTAB PEEK (37) :  FOR L = 1 TO 39 :  PRINT " "; :  NEXT : PRINT : VTAB PEEK (37) : L = 0 :  RETURN   59 pause screen and zero line counter
91 PRINT : PRINT "YOU AREN'T CARRYING IT." :  GOTO 99   91-96 command error messages
92 PRINT : PRINT "YOU MUST FIRST OPEN IT." :  GOTO 99    
94 PRINT : PRINT "YOU CAN'T "C$(C)" "S$ :  GOTO 98    
96 PRINT : PRINT "NOBODY HERE BY THAT NAME!" :  GOTO 99    
98 GOSUB 54 :  GOTO 310   98 normal return point for most commands
99 GOSUB 54   99 return point for Inventory, failed commands
100 REM ..YOU SEE.   100-200 YOU SEE routine
110 GOSUB 56 :  IF LS THEN A%(LS, 5) = A%(LS, 5) - 1 :  IF A%(LS, 5) = 0 THEN PRINT : PRINT "YOUR "A$(LS)" HAS GONE OUT!" : LS = 0 : LT = NL :  GOTO 99   110-117 check status of Artifact light source
115 IF LS THEN IF A%(LS, 5) < 10 THEN PRINT : PRINT "YOUR "A$(LS)" IS ALMOST OUT!" :  GOSUB 54 :  GOTO 120    
117 IF LS THEN IF A%(LS, 5) < 20 THEN PRINT : PRINT "YOUR "A$(LS)" GROWS DIM!" :  GOSUB 54    
120 IF SP THEN SP = SP - 1 :  IF NOT SP THEN M%(0, 2) = M%(0, 2) / 2 :  PRINT "YOUR SPEED SPELL HAS JUST EXPIRED!" :  GOSUB 56   120 check status of SPEED spell
122 FOR A = 0 TO 3 :  IF S2%(A) < SA%(A) THEN S2%(A) = S2%(A) * 1.1 :  IF S2%(A) > SA%(A) THEN S2%(A) = SA%(A)   122-123 recovery of expended spell ability S2 is present level, SA is full ability; if S2 is less than SA, then increase by 10%
123 NEXT    
125 IF NOT LT THEN PRINT : PRINT "IT'S TOO DARK TO SEE." :  GOSUB 52 :  GOTO 210   125 check room light; skip YOU SEE if dark
130 PRINT "YOU ARE " :  PRINT " "RN$ :  GOSUB 54   130 print room name
135 IF NOT V%(RO) THEN R = RO :  GOSUB 45 : V%(RO) = 1   135 print room desc. if "seen" flag is zero
140 B% = NM : D% = RO :  FOR M = 1 TO NM : C% = M :  & A, D%, M%(C%, 5), C%, B% :  IF NOT C% THEN M = 999 :  NEXT : GOTO 160   140 check for monsters in room
145 M = C% : M2 = 0 :  IF NOT M%(M, 0) THEN GOSUB 51 : M%(M, 0) = 1 : R = M + 600 :  GOSUB 45 : M2 = 1 :  PRINT " - ";   145 print monster desc. if "seen" flag is zero
150 IF M%(M, 3) = 1 THEN PRINT M$(M)" IS HERE." :  GOSUB 52 :  GOTO 156   150 print single-monster name
154 PRINT M%(M, 3)" "M$(M)"S ARE HERE." :  GOSUB 52   154 print multiple-monster name
156 IF M2 THEN GOSUB 51   156 print blank line if desc. was printed
159 NEXT    
160 GOSUB 51 : B% = NZ : D% = RO :  FOR A = 1 TO NZ : C% = A :  & A, D%, A%(C%, 4), C%, B% :  IF NOT C% THEN A = 999 :  NEXT : GOTO 190   160 check for artifacts in room
165 A = C% : M2 = 0 :  IF NOT A%(A, 0) THEN A%(A, 0) = 1 : R = A + 200 :  GOSUB 45 : M2 = 1 :  PRINT " - ";   165 print artifact desc. if "seen" flag is zero
170 PRINT "YOU SEE "A$(A)"." :  GOSUB 52 :  IF M2 THEN GOSUB 51   170 print artifact name
175 C% = C% + 1 :  NEXT    
190 FOR A = NZ + 1 TO NA :  IF A%(A, 4) = RO THEN PRINT "YOUR "A$(A)" IS HERE." :  GOSUB 52   190 print personal-weapon name if in room
200 NEXT   200-290 Command parser
205 REM ..CMD.    
210 PRINT : GOSUB 56 :  INPUT " YOUR COMMAND?";A$ : L = 0   210 ask for "YOUR COMMAND?"
220 IF LEFT$ (A$, 1) = " " THEN A$ = MID$ (A$, 2) :  GOTO 220   220 strip any leading spaces
230 IF A$ = "" THEN A$ = CZ$ :  VTAB PEEK (37) :  HTAB 16 :  PRINT A$   230 use last command if <RETURN> was input
235 PRINT : IF A$ = "" THEN 275    
240 CZ$ = A$ :  FOR A = 2 TO LEN (A$) :  IF MID$ (A$, A, 1) < > " " THEN NEXT   240 find end of first word of command
250 V$ = LEFT$ (A$, A - 1) : S$ = MID$ (A$, A + 1)   250 assign command verb (V$) and object (S$)
260 IF LEFT$ (S$, 1) = " " THEN S$ = MID$ (S$, 2) :  GOTO 260   260 strip leading spaces off object
270 SL = LEN (V$) :  FOR A = 1 TO ND :  IF LEFT$ (C$(A), SL) = V$ THEN C = A : A = 999 :  NEXT : GOTO 290   270 check for verb match to direction command (N,S,E,W,U,D)
272 NEXT  : F = 0 :  FOR A = ND + 1 TO NC :  IF LEFT$ (C$(A), SL) = V$ THEN C = A : F = F + 1 :  IF C$(A) = V$ THEN F = 1 : A = 999   272 if not direction command, check for match to rest of command list
273 NEXT    
275 IF F < > 1 THEN PRINT : PRINT "I ONLY UNDERSTAND THESE COMMANDS-- " :  PRINT : FOR C = 1 TO CC :  HTAB 2 :  POKE 1403, 10 :  PRINT C$(C); :  HTAB 15 :  POKE 1403, 30 :  PRINT C$(C + CC); :  HTAB 28 :  POKE 1403, 50 :  PRINT C$(C + 2 * CC) :  NEXT : GOTO 210   275 if no match to any command, print command list and go back to 210
290 ON C GOTO 3000, 3000, 3000, 3000, 3000, 3000, 4000, 5000, 6500, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 16000, 23000, 17000, 18000, 19000, 20000, 21000, 22000, 24000, 25000, 26000, 27000, 28000  

290 if match was found, jump to command routine

 

300 REM ..PICK FOE.   300-495 PICK FOE routine
305 GOSUB 51   305 print blank line
310 IF NOT T(1) THEN 500   310 foes present? if not, exit routine
320 B% = NM : D% = RO :  FOR M = 1 TO NM : C% = M :  & A, D%, M%(C%, 5), C%, B% :  IF NOT C% THEN M = 999 :  NEXT : GOTO 500   320 find monsters present in room
330 M = C% :  IF M%(M, 11) = 2 THEN NEXT : GOTO 500   330 if monster is neutral, look for another
333 IF M%(M, 3) = 1 THEN IF M%(M, 13) / M%(M, 1) * RND (1) * 100 > M%(M, 4) THEN PRINT : PRINT M$(M)" FLEES!" :  GOSUB 54 : M%(M, 5) = 0 : M2 = M :  GOSUB 3600 : M = M2 :  NEXT : GOTO 500   333 if single-monster, check courage level, determine if monster flees room
334 IF M%(M, 3) = 1 THEN 340   334 if monster did not flee, proceed to combat
335 IF (M%(M, 12) - M%(M, 3)) / M%(M, 12) * RND (1) * 100 > M%(M, 4) THEN MR% = RND (1) * M%(M, 3) + 1 :  PRINT : PRINT MR%" "M$(M);   335 check multiple-monster courage level, determine if monster(s) flee room
336 IF MR% THEN PRINT MID$ (" FLEES!S FLEE!", 1 + (MR% > 1) * 7, 7) :  GOSUB 54 : M%(M, 3) = M%(M, 3) - MR% : M%(M, 5) = M%(M, 5) * (M%(M, 3) > 0) : M2 = M :  GOSUB 3600 : M = M2 : MR% = 0 :  IF NOT M%(M, 5) THEN NEXT : GOTO 500   336 multiple-monster member(s) flee room
340 MC = 1 :  IF M%(M, 3) > 8 THEN MC = M%(M, 3) - 8   340 if multiple-monster has more than 8 members, limit combat rounds to 8 (on theory that a max of 8 monsters could get in a hit in one round) (BAD LINE???)
350 OF = M : DF = 0 :  FOR MC = MC TO M%(M, 3) :  IF M%(M, 11) = 3 THEN 400   350 assign monster as attacker (OF); determine if attacker is friend; if so, go to 400
360 IF T(3) = M%(0, 1) THEN 480   360 determine if attacker is only enemy in room
370 B% = NM : D% = RO :  FOR M2 = 1 TO NM : C% = M2 :  & A, D%, M%(C%, 5), C%, B% :  IF NOT C% THEN M2 = 999 :  GOTO 380   370-380 find friendly defender (DF) for attack; go to 480
375 M2 = C% :  IF M%(M2, 11) = 3 AND RND (1) < .25 THEN DF = M2 : M2 = 999    
380 NEXT : GOTO 480    
400 C% = 1 : B% = NM : D% = RO   400-430 find enemy defender for attack
410 & A, D%, M%(C%, 5), C%, B% :  IF M%(C%, 11) < > 1 THEN C% = C% + 1 :  GOTO 410    
415 DF = C% :  IF DF = NM THEN 480    
420 FOR M2 = DF + 1 TO NM : C% = M2 :  & A, D%, M%(C%, 5), C%, B% :  IF NOT C% THEN M2 = 999 :  GOTO 430    
425 M2 = C% :  IF M%(M2, 11) = 1 AND RND (1) < .25 THEN DF = M2 : M2 = 999    
430 NEXT    
480 GOSUB 7500   480 proceed to DO BATTLE routine
490 IF NOT T(1) THEN M = 999 : MC = 999    
495 NEXT : NEXT    
500 REM ..SPECIAL EVERY-ROUND STUFF.   500-900 for every-round special programming
900 GOTO 100    
3000 REM ..MOVE.   3000-3390 MOVE routine
3010 IF T(1) THEN PRINT : PRINT "YOU CAN'T TURN YOUR BACK HERE!" :  GOTO 99   3010 abort move if enemy present
3020 D = C   3020 assign direction (D)
3030 R2 = RD%(D) :  IF R2 > 500 THEN 3400   3030 get exit data; if door then proceed to GATE/DOOR routine
3040 IF R2 > 0 AND R2 < = NR THEN 3500   3040 if valid room connection then proceed to GO routine
3050 REM /// SPECIAL MOVES    
3060 IF R2 = - 99 THEN PRINT : PRINT "YOU RETURN TO THE MAIN HALL." :  GOTO 32000   3060 check for exit to Main Hall 3390 abort move if invalid exit
3180 REM /// INSERT HERE SPECIAL ROOM MOVE CHECKING    
3390 PRINT : PRINT "YOU CAN'T GO THAT WAY!" : V%(RO) = 0 :  GOTO 99    
3400 REM ..GATE/DOOR   3400-3430 GATE/DOOR routine
3410 A = R2 - 500 :  IF A%(A, 6) = 0 AND NOT A%(A, 8) THEN R2 = A%(A, 5) :  GOTO 3040   3410 find room on other side of door; if door is not locked nor hidden then get room connection and return to MOVE routine
3420 IF A%(A, 8) THEN R2 = 0 :  GOTO 3390   3420 if door still hidden then abort move
3430 PRINT : PRINT "THE "A$(A)" BLOCKS THE WAY!" :  GOTO 99   3430 if door locked then abort move
3500 REM ..GO.   3500-3590 GO routine
3530 R3 = RO : RO = R2 :  GOSUB 3600   3530 move to next room, check monster status
3540 PRINT D$;"READ"ER$", R"RO : NX = 0 :  INPUT RN$ :  FOR X = 1 TO ND :  INPUT RD%(X)   3540 get new room desc. and exits
3550 IF RD%(X) > 0 AND RD%(X) < = NR THEN NX = NX + 1   3550 find number of exits from room
3560 NEXT : INPUT NL :  PRINT D$ : LT = NL OR LS   3560 get room natural light status and determine if room is dark
3590 GOTO 100   3590 exit to YOU SEE routine
3600 REM ..ENEMY?.   3600-3670 ENEMY? subroutine
3610 T(1) = 0 : T(3) = M%(0, 1) : F(1) = 0 : F(3) = M%(0, 13)   3610 initialize group monster strengths and hits
3620 FOR M = 1 TO NM   3620 check each monster...
3630 IF M%(M, 5) = R3 THEN IF (M%(M, 11) = 3 OR (M%(M, 11) = 1) AND 200 * RND (1) < M%(M, 4)) THEN M%(M, 5) = RO :  GOTO 3670   3630 determine if monsters from last room follow and bring them in new room
3640 IF M%(M, 5) < > RO THEN NEXT : RETURN   3640 if monster did not follow then next monster
3650 IF M%(M, 11) > 100 THEN FR = M%(M, 11) - 100 + (CH - 10) * 2 : M%(M, 11) = 1 :  IF FR > 100 * RND (1) THEN M%(M, 11) = 2 :  IF FR > 200 * RND (1) THEN M%(M, 11) = 3   3650 determine monster friendliness
3670 A = M%(M, 11) : F(A) = F(A) + M%(M, 13) * M%(M, 3) : T(A) = T(A) + M%(M, 1) * M%(M, 3) :  NEXT : RETURN   3670 add monster strength and hits into group totals and exit to calling routine
4000 REM ..GET.   4000-4240 GET routine
4010 GOSUB 4900 :  IF S$ = "ALL" THEN 4200   4010 check for object of command S$; if "ALL" then go to ALL routine
4020 HA = RO :  GOSUB 4805 :  IF NOT F THEN 94   4020 check to see if S$ is in room; if not, go to error message at 94
4030 PRINT : IF A%(A, 3) > 900 THEN PRINT "DON'T BE ABSURD." :  GOTO 98   4030 if object weight is greater than 900 then abort with DON'T BE ABSURD message
4040 IF WT + A%(A, 3) > 10 * M%(0, 1) THEN PRINT "IT IS TOO HEAVY." :  GOTO 98   4040 if object weight plus inventory would exceed ten times player's strength then abort with TOO HEAVY message
4050 IF A%(A, 2) = 10 THEN PRINT A$(A)" IS TIED DOWN!" :  GOTO 98   4050 if object is "prisoner" artifact than abort with TIED DOWN message
4140 PRINT "GOT IT." :  GOSUB 54 : A%(A, 4) = - 1 : WT = WT + A%(A, 3) :  IF M%(0, 8) = - 1 THEN IF A%(A, 2) = 2 OR A%(A, 2) = 3 THEN 17100   4140 get object; increase weight carried by player (WT); if player has no ready weapon and object is a weapon, proceed to READY routine
4150 GOTO 300   4150 exit to PICK FOE routine
    4200-4240 GET ALL routine
4200 GOSUB 51 : B% = NA : D% = RO :  FOR A = 1 TO NA : C% = A :  & A, D%, A%(C%, 4), C%, B% :  IF NOT C% THEN A = 999 :  NEXT : GOTO 300   4200 find all artifacts in room
4210 A = C% :  PRINT A$(A); :  IF A%(A, 2) = 10 THEN PRINT " IS TIED DOWN!" :  GOTO 4240   4210 print name of artifact; if prisoner, skip
4215 IF A%(A, 3) > 900 THEN PRINT " :  DON'T BE ABSURD." :  GOTO 4240   4215 if weight is over 900 then skip
4220 IF WT + A%(A, 3) > 10 * M%(0, 1) THEN PRINT " IS TOO HEAVY." :  GOTO 4240   4220 if weight would add too much to player's carried WT then skip
4230 PRINT " TAKEN." : A%(A, 4) = - 1 : WT = WT + A%(A, 3)   4230 get artifact and print TAKEN 4240 increment line counter and check for screen pause
4240 GOSUB 52 :  NEXT : GOTO 98    
4600 REM ..SYNONYMS.   4600-4780 SYNONYMS subroutine
4610 SL = LEN (S$)   4610 find length of object name
4620 REM PUT YOUR OWN SYNONYMS HERE. SEE MANUAL FOR DETAILS   4620-4674 space for synonym data
4675 RETURN   4675 exit to calling routine
4680 IF LEFT$ (SY$, SL) = S$ OR RIGHT$ (SY$, SL) = S$ THEN S$ = A$(SY) :  POP   4680 compare synonym name to object name; if match, assign object name to artifact defined by synonym data
4690 RETURN    
4700 REM ..MONS SEARCH.   4700-4780 MONSTER SEARCH subroutine
4705 WH = RO : HA = - 1   4705 assign search locations to room and player inventory
4710 F = 0 : C% = 0 : D% = 0 :  & S, S$, M$, C% :  IF NOT C% THEN IF LEN (S$) > 1 THEN IF RIGHT$ (S$, 1) = "S" THEN S$ = LEFT$ (S$, LEN (S$) - 1) :  GOTO 4710   4710 check for match between object name and monster names
4715 IF NOT C% THEN RETURN   4715 if no name match then return with F = 0
4720 D% = C% : X = C% :  IF M%(X, 5) < > HA AND M%(X, 5) < > WH THEN 4770   4720 if name match found then check to see if monster is in room or in player inventory
4750 F = F + 1 :  IF F = 1 THEN M = X   4750 increment F; if first match found then assign monster number (M) to match
4760 IF S$ = M$(X) THEN M = X :  RETURN   4760 if name is an exact match then assign (M) and exit to calling routine
4770 & R :  IF C% < > D% THEN 4720   4770 check for additional matches
4780 RETURN   4780 exit to calling routine
4800 REM ..ARTIF SEARCH.   4800-4870 ARTIFACT SEARCH subroutine
4801 HA = - 1 : WH = HA : EM = HA :  GOTO 4810   4801 assign all search locations to player inventory only; proceed to search (DROP)
4804 HA = - 1   4804 assign search locations to player inventory, room, and artifacts "embedded" in room (EXAMINE)
4805 WH = RO : EM = RO + 200   4805 assign search locations to room, artifacts "embedded" in room, and third location defined by calling routine (GET, REMOVE)
4810 GOSUB 4600 : F = 0 : C% = 0 : D% = 0 :  & S, S$, A$, C% :  IF NOT C% THEN RETURN   4810 check for synonyms; perform search for match to object name; abort if no match
4820 FOR X = 1 TO NA   4820-4830 determine if any artifact that is in one of defined locations matches name; if perfect match, assign artifact number (A) to match and exit subroutine
4830 D% = C% : A2 = A%(C%, 4) :  IF A2 = WH OR A2 = HA OR A2 = EM THEN F = F + 1 : A = C% :  IF S$ = A$(C%) THEN X = 999 :  NEXT : RETURN    
4850 & R :  IF C% < > D% THEN NEXT : RETURN   4850 search for additional matches; if found, ask WHICH DO YOU WANT? and exit to YOU SEE
4860 X = 999 :  NEXT : IF F > 1 THEN PRINT : PRINT "WHICH "S$" DO YOU WANT?" : F = 0 :  POP : GOTO 99    
4870 RETURN   4870 exit to calling routine
4900 REM ..GET S$.   4900-4920 GET S$ subroutine
4905 IF NOT LT THEN POP : GOTO 100   4905 if room is dark then abort to YOU SEE
4910 IF S$ = "" THEN PRINT : PRINT C$(C)" WHO OR WHAT"; :  INPUT S$ :  GOTO 4900   4910 if no object defined by S$ then as for one
4920 RETURN   4920 exit to calling routine
5000 REM ..DROP.   5000-5150 DROP routine
5010 GOSUB 4900 :  IF S$ = "ALL" THEN 5100   5010 check for object of command S$; if "ALL" then go to DROP ALL routine
5030 GOSUB 4801 :  IF NOT F THEN 91   5030 check to see if player is carrying object; if not, go to print error at 91
5040 WT = WT - A%(A, 3) : A%(A, 4) = RO :  PRINT : PRINT A$(A)" DROPPED." :  GOSUB 54   5040 deduct object's weight from weight carried (WT); print "DROPPED" message and check for screen pause
5042 IF A = LS THEN LS = 0 : LT = NL :  PRINT : PRINT "THE "A$(A)" GOES OUT." :  GOSUB 54   5042 if dropped object was current carried light source, extinguish light and switch to room's natural light
5050 IF WT > 10 * M%(0, 1) THEN PRINT "YOU SUDDENLY FIND YOU CANNOT CARRY ALL OF THE ITEMS YOU ARE CARRYING, AND THEY ALL FALL TO THE GROUND." : L = L + 3 :  GOTO 5100   5050 if dropping object increases weight carried beyond player's carrying capacity (eg:  dropped object was something like a cart or wheelbarrow) then proceed to DROP ALL and dump entire inventory on ground
5060 IF A = M%(0, 8) THEN M%(0, 8) = - 1   5060 if dropped object was ready weapon then change Ready Weapon status to unarmed
5070 GOTO 300   5070 exit to PICK FOE routine
    5100-5150 DROP ALL routine
5100 GOSUB 51 : B% = NA : D% = - 1 :  FOR A = 1 TO NA : C% = A :  & A, D%, A%(C%, 4), C%, B% :  IF NOT C% THEN A = 999 :  GOTO 5150   5100 search artifacts for those carried by player
5110 A = C% :  PRINT A$(A)" DROPPED." : A%(A, 4) = RO :  GOSUB 52   5110 drop each to ground as it is found; print DROPPED and check for screen pause
5150 NEXT  : WT = 0 : M%(0, 8) = - 1 :  GOTO 300  

5150 set weight carried to zero, mark player as unarmed

6000 REM ..EXAMINE.   6000-6060 EXAMINE command
6010 GOSUB 4900 :  GOSUB 4804 :  IF NOT F THEN 6040   6010 check for object of command S$; find out if named object is an artifact present in the room or being carried; if not found then proceed to search for monster
6020 IF A%(A, 4) = EM THEN A%(A, 4) = RO   6020 if object is an "embedded" artifact then change location to room to make visible
6032 IF A > NZ THEN PRINT : PRINT "THIS IS YOUR "A$(A)"." :  GOTO 98   6032 if object is one of player's personal weapon then name it
6033 IF A%(A, 2) = 8 THEN A%(A, 8) = 0   6033 if object is hidden door then make door visible
6034 IF A%(A, 2) = 6 THEN PRINT " - THERE ARE "A%(A, 6)" SWALLOWS LEFT." :  GOSUB 56   6034 if object is drinkable then print number of swallows left; check for screen pause
6035 R = A + 200 :  GOSUB 45 : A%(A, 0) = 1 :  GOTO 300   6035 print artifact description; set "seen" flag to "seen"; exit to PICK FOE routine
6040 GOSUB 4700 :  IF NOT F THEN PRINT : PRINT "YOU SEE NOTHING SPECIAL." :  GOTO 98   6040 search monsters for match to object; if no match then named object is not an artifact nor a monster, so print YOU SEE NOTHING SPECIAL and exit
6050 R = M + 600 :  GOSUB 45 : DF = M :  IF M%(M, 3) > 1 AND M%(M, 13) = 0 THEN PRINT "THEY ARE "; :  GOSUB 7652 :  GOTO 300   6050 print monster description; if group monster and uninjured then print THEY ARE IN PERFECT HEALTH; exit to PICK FOE routine
6060 DF = M : D2 = 0 :  GOSUB 7637 :  GOTO 300   6060 print monster's health status; exit to PICK FOE routine
6500 REM ..LOOK.   6500-6510 LOOK routine
6510 V%(RO) = 0 :  GOTO 300   6510 set room "seen" flag to zero (this will cause room desc. to be printed at next pass through YOU SEE routine); exit to PICK FOE routine
7000 REM ..ATTACK.   7000-7370 ATTACK routine
7010 IF M%(0, 8) = - 1 THEN PRINT : PRINT "YOU HAVE NO WEAPON READY!" :  GOTO 100   7010 check for Ready Weapon, abort if none
7020 TA = 0 :  GOSUB 4900 :  GOSUB 4700 :  IF F THEN 7300   7020 check if object of attack is named; search for match to monster; if match proceed to line 7300
7030 HA = RO :  GOSUB 4805 :  IF NOT F THEN 94   7030 check if object of attack is artifact in room; if no match then abort to print error message at 94
    7040-7080 perform attack on artifact
7040 IF A%(A, 2) < > 8 AND A%(A, 2) < > 4 THEN PRINT : PRINT "WHY WOULD YOU DO THAT?" :  GOTO 99   7040 if object is not door or container then abort attack; exit routine
7050 D = M%(0, 9) : S = M%(0, 10) :  IF TA = 1 THEN D = 2 : S = 5   7050 set "dice" and "sides" to weapon stats; if attacking through BLAST spell then set "dice" to 2 and "sides" to 5
7060 SX = 7 : K = 6 :  IF A%(A, 2) = 4 THEN SX = SX - 1 : K = K - 1   7060 set up database variables for door; if object is container then set variables for container
7070 D2 = 0 :  FOR X = 1 TO D : D2 = D2 + RND (1) * S - 1 :  NEXT  : A%(A, SX) = A%(A, SX) - D2 :  IF A%(A, SX) < 1 THEN A%(A, SX) = 0 : A%(A, K) = 0 : A%(A, 7) = 1 :  PRINT : PRINT "THE "A$(A)" SHATTERS!" :  GOTO 98   7070 perform attack on object; if object strength is reduced to zero then print SHATTERS message and open it
7075 IF A%(A, 2) = 8 THEN A%(A, 8) = 0   7075 if object is hidden door then unhide it
7080 PRINT : PRINT "WHAM!! YOU "; MID$ ("HITBLAST", TA * 3 + 1, 3 + TA * 2);" THE "A$(A);"!" :  GOTO 98   7080 print WHAM!!! message
    7300-7370 perform attack on monster
7300 OF = 0 : DF = M :  GOSUB 7500 :  IF NOT HI THEN 7360   7300 define attacker (OF) and defender (DF); proceed to DO BATTLE routine
7310 IF HI THEN IF UP THEN WA%(W2) = WA%(W2) + 2   7310 if successful hit then check to see if weapon ability should be increased; increase weapon ability
7360 IF M%(DF, 11) = 1 OR DF = 0 THEN 300   7360 if defender was enemy or self then exit to PICK FOE routine
7370 IF M%(DF, 11) > 1 THEN M%(DF, 11) = 1 + (M%(DF, 11) = 3) * 150 : R3 = RO :  GOSUB 3600 :  GOTO 300   7370 if defender was friend or neutral then calculate whether alignment changes and update group totals; exit to PICK FOE
7400 REM ..MONS P/U WEAP.   7400-7450 MONSTER PICKS UP WEAPON subroutine
7410 M2 = ABS (M%(OF, 8) + 1) :  IF A%(M2, 4) = RO THEN 7440   7410 find artifact number of weapon that monster had dropped; if available then go to 7440
7420 M2 = 0 :  FOR A = 1 TO NA :  IF A%(A, 4) = RO THEN IF A%(A, 2) = 2 OR A%(A, 2) = 3 THEN A2 = A%(A, 7) * A%(A, 8) :  IF A2 > M2 THEN M2 = A   7420 search room for available weapons; identify best weapon found
7430 NEXT    
7440 IF M2 THEN PRINT M$(OF)" PICKS UP "A$(M2)"." :  PRINT  : A%(M2, 4) = - OF - 1 : M%(OF, 8) = M2   7440 if weapon found then pick up and assign as monster's ready weapon
7450 GOTO 56   7450 exit to calling routine by way of screen pause check
7500 REM ..DO BATTLE.   7500-7900 DO BATTLE routine
7505 HI = 0 : W = M%(OF, 8) :  IF W < 0 THEN 7400   7505 reset "Hit" flag; set W to Artifact number of attacker's weapon; if no weapon then go to PICKS UP WEAPON routine
7507 WM = 50 + 2 * (M%(OF, 2) - M%(DF, 2) - M%(OF, 7) + M%(DF, 7)) :  IF W > 0 THEN WM = WM + A%(W, 5) / 2 :  IF OF = 0 THEN WM = WM + WA%(W2) / 4 + EA   7507 compute percent odds of scoring hit (WM)
7510 A = A%(W, 6) * (W > 0) :  PRINT M$(OF)" "BV$(A, RND (1) * 3)" AT "M$(DF)   7510 select correct attack verb. Print attack
7511 GOSUB 52 : RL = 100 * RND (1) :  IF (RL < 5 OR RL < WM) AND RL < 97 THEN HI = 1 :  GOTO 7600   7511 check line count; generate random number RL in 1-100 range; if RL is less than 5 or the computed odds WM and also less than 97 (3% chance of fumble) then set Hit flag and proceed to damage computation
7515 A2 = 0 :  IF M%(DF, 8) > 0 THEN A2 = A%(M%(DF, 8), 6)   7515 if defender is carrying a real weapon then set A2 to weapon type, or set to 0 if natural weapon
7520 IF RL < 97 OR NOT W THEN PRINT " --"RB$(A2, RND (1) * 2)"!" :  GOTO 56   7520 if RL < 97 or the attacker is using natural weapons, then print a "Miss" verb and exit through screen pause routine (97% chance)
7525 PRINT " ..A FUMBLE!" :  GOSUB 52 : R = 100 * RND (1) :  IF R < 41 THEN PRINT " FUMBLE RECOVERED." :  GOTO 56   7525 print "A FUMBLE" (3% chance) and generate random number R; if R < 41 (40% chance) then print FUMBLE RECOVERED and exit through screen pause routine
7530 IF R < 81 THEN PRINT " WEAPON DROPPED!" : WT = WT - ((OF = 0) * A%(W, 3)) : A%(W, 4) = RO : M%(OF, 8) = - OF - 1 :  GOTO 56   7530 if R < 81 (40% chance) then drop attacker's weapon; adjust Weight Carried; put weapon in Room; set attacker's weapon to None; exit through screen pause routine
7532 IF A%(W, 2) = 3 THEN PRINT "SPARKS FLY FROM "A$(W)"!" :  GOTO 56   7532 if attacker's weapon is magical then print SPARKS FLY message and exit through screen pause routine
7535 IF R > 95 THEN 7545   7535 if R > 95 then proceed to WEAPON HITS USER (5% chance)
7537 IF R < 91 THEN PRINT " WEAPON DAMAGED!" : A%(W, 8) = A%(W, 8) - 1 :  IF A%(W, 8) THEN 56   7537 if R < 91 (90% chance) then print WEAPON DAMAGED and lower weapon sides by 1; if sides is greater than zero then exit through screen pause routine
7540 PRINT " WEAPON BROKEN!" : WT = WT - ((OF = 0) * A%(W, 3)) : A%(W, 4) = 0 :  : M%(OF, 8) = - 1 :  IF RND (1) > .5 THEN 54   7540 if sides equals zero then print WEAPON BROKEN; lower Weight Carried by weapon weight; set weapon location to zero; set weapon carried to None; generate random number; if more than .5 then exit through screen pause routine (50% chance)
7545 PRINT " WEAPON HITS USER!" :  GOSUB 54 : DF = OF :  ON (R = 100) + 1 GOTO 7605, 7610   7545 print WEAPON HITS USER; check screen pause; set DF to attacker for damage computation; proceed to damage computation unless R = 100 then proceed to WELL STRUCK computation
7600 IF NOT OF THEN UP = (100 * RND (1) > WM + WA%(W2)) :  IF RND (1) * 100 < WA%(W2) THEN IF ABS (EA) > 10 * RND (1) AND AE < AC * AC THEN AE = AE + 2 : EA = AE - AC * AC   7600 if player is attacker then compute possible increase in weapon and armor expertise
7605 D = M%(OF, 9) : S = M%(OF, 10) :  IF W THEN D = A%(W, 7) : S = A%(W, 8)   7605 set Dice and Sides to monster's stats; if carrying weapon then use weapon stats
7607 A = 1 :  PRINT MID$ (" ** ++", (DF > 0) * 3 + 1, 3); :  IF RL > 5 THEN PRINT "A HIT!" :  GOTO 7633   7607 set Defender's armor factor to 1; Print "** A HIT" if defender is player or "++ A HIT" if monster; if RL > 5 then proceed to damage computation (95% chance)
7610 PRINT "WELL STRUCK!" :  GOSUB 52 : R2 = 100 * RND (1) :  IF R2 < 51 THEN A = 0 :  GOTO 7633   7610 print WELL STRUCK! (5% chance); check screen pause; generate random number R2; if R2 < 51 then set Defender's armor factor to zero (50% chance); proceed to damage computation
7615 RL = 1.5 :  IF R2 > 85 THEN RL = 2   7615 set RL to 1.5 (35% chance); if R2 > 85 then set RL to 2 (10% chance)
7620 IF R2 > 95 THEN RL = 3   7620 if R2 > 95 then set RL to 3 (4% chance)
7625 IF R2 = 100 THEN RL = M%(DF, 1)   7625 if R2 = 100 then set RL to Defender's Hardiness (a sure Death Blow; 1% chance)
7630 S = RL * S   7630 multiply Sides by RL to increase damage
7633 GOSUB 52 : D2 = 0 :  FOR D3 = 1 TO D : D2 = D2 + S * RND (1) :  NEXT  : D2 = INT (D2 - A * M%(DF, 7)) :  IF D2 < 1 THEN IF NOT M%(DF, 7) THEN PRINT " BLOW TURNED!" :  GOTO 56   7633 check for screen pause; compute hit damage D2; reduce D2 by defender's armor multiplied by armor factor set in 7607-7610; if D2 is not positive number then no damage; if defender not wearing armor then print BLOW TURNED and exit through screen pause routine
7635 IF D2 < 1 THEN PRINT " BLOW GLANCES OFF ARMOR!" :  GOTO 56   7635 if D2 is not positive then print BLOW BOUNCES OFF ARMOR; exit through screen pause routine
7636 GOSUB 51   7636 print blank line
7637 GOSUB 52 :  IF M%(DF, 3) > 1 THEN PRINT "ONE ";   7637 check for screen pause; if defender is multiple-monster then print ONE
7638 PRINT M$(DF)" IS ";   7638 print monster's name and IS
7640 A = M%(DF, 11) : F(A) = F(A) + D2 : M%(DF, 13) = M%(DF, 13) + D2 :  IF M%(DF, 13) > = M%(DF, 1) THEN 7700   7640 compute hit damage to defender and defender's room-group total; if hits equal or exceed defender hardiness then proceed to MONSTER DIES routine
7650 ON M%(DF, 13) * 5 / M%(DF, 1) + 2 - (M%(DF, 13) = 0) GOTO 7652, 7655, 7660, 7665, 7670, 7675   7650 proceed to appropriate damage report
7652 PRINT "IN PERFECT HEALTH." :  GOTO 56   7652-7675 damage reports; exit through screen pause routine
7655 PRINT "OK." :  GOTO 56    
7660 PRINT "HURT." :  GOTO 56    
7665 PRINT "BADLY HURT." :  GOTO 56    
7670 PRINT "GRAVELY INJURED." :  GOTO 56    
7675 PRINT "DYING." :  GOTO 56    
7700 REM .MONSTER DIES   7700 MONSTER DIES routine
7710 PRINT "DEAD!" : F(A) = F(A) + M%(DF, 1) - M%(DF, 13) :  IF M%(DF, 3) > 1 THEN M%(DF, 3) = M%(DF, 3) - 1 : M%(DF, 13) = 0 :  GOTO 56   7710 print DEAD!; remove dead monster from room group total; if multiple-monster then reduce monster count by one and set hits to zero for next member of multiple-monster and exit through screen pause routine
7720 M%(DF, 5) = 0 : M%(DF, 3) = M%(DF, 12) :  FOR A2 = 1 TO NA :  IF A%(A2, 4) = - DF - 1 THEN A%(A2, 4) = RO   7720 remove dead monster from room; if multiple-monster then reset total to original value; place all artifacts carried by dead monster in room
7730 NEXT  : M%(DF, 8) = - 1   7730 set dead monster's weapon to None
7735 REM A%(DF+X-1, 4)=RO : REMREPLACE 'X' WITH ART. # OF FIRST DEAD MONS. IF YOU ARE USING DEAD MONS.   7735 inactive line that is used for optional dead bodies; if activated, places dead monster's body artifact in room
7740 IF DF = 0 THEN DI = 1 :  POP : GOTO 32000   7740 if Defender is player then set DIe flag; remove DO BATTLE subroutine from stack with POP; proceed to DONE routine
7750 IF F(1) = > T(1) THEN T(1) = 0   7750 if room group hits equals or exceeds room group hardiness then all foes have been killed; reset group hardiness to zero to indicate there are no hostiles in room
7900 GOTO 56   7900 exit through screen pause routine
8000 REM ..FLEE.   8000 FLEE routine
8010 IF NOT T(1) THEN PRINT : PRINT "THERE'S NOTHING TO FLEE FROM!" :  PRINT : GOTO 100   8010 if no hostiles in room then print NOTHING TO FLEE FROM and exit to YOU SEE routine
8020 IF NX = 0 THEN PRINT : PRINT "THERE'S NO PLACE TO GO!" :  GOTO 100   8020 if no exits then print NO PLACE TO GO and exit to YOU SEE routine
8030 IF S$ = "" THEN 8500   8030 if no direction specified to flee to then proceed to flee in random direction
8040 SL = LEN (S$) :  FOR X = 1 TO ND :  IF S$ = LEFT$ (C$(X), SL) THEN D = X : X = 99   8040 find direction specified
8050 NEXT : GOTO 3030   8050 proceed to MOVE routine
8500 R2 = RD%(ND * RND (1) + 1) :  IF R2 < 1 OR R2 > NR THEN 8500   8500 find random direction to flee
8510 GOTO 3500   8510 proceed to GO routine
9000 REM ..GIVE.   9000-9900 GIVE routine
9010 IF S$ THEN Q$ = " TO " : Q = 4 :  GOSUB 9800   9010 run object through PARSE routine to see if it parses into full command (GIVE XX TO YY)
9040 IF A$ = "" THEN INPUT "GIVE WHAT?";A$   9040 if not full command then ask GIVE WHAT?
9050 IF VAL (A$) = 0 THEN S$ = A$ :  GOSUB 4801 :  IF NOT F THEN 91   9050 if artifact given has no numeric value, then it's not gold; check to see if is carried by player; if not, then exit through error message at 91
9060 IF B$ = "" THEN INPUT "TO WHOM?";B$   9060 if not full command, then ask TO WHOM?
9070 S$ = B$ :  GOSUB 4700 :  IF NOT F THEN 96   9070 check to see if named monster is in room; if not, exit through error message at 96
9080 PRINT : PRINT "OKAY." :  IF VAL (A$) > 0 THEN 9500   9080 print OKAY; if gold is being given then proceed to GOLD routine
9090 IF A = M%(0, 8) THEN M%(0, 8) = - 1   9090 if artifact is player's weapon then mark player as unarmed
9095 IF A%(A, 2) = 6 THEN IF M%(M, 13) AND A%(A, 6) AND A%(A, 7) THEN 9300   9095 if artifact is drinkable and monster is wounded and artifact has swallows left and is open then proceed to MONSTER HEAL routine
9100 WT = WT - A%(A, 3) : A%(A, 4) = - M - 1   9100 reduce weight carried by weight of artifact given; mark it as carried by monster it was given to
9110 IF M%(M, 8) < 0 THEN IF A%(A, 2) = 2 OR A%(A, 2) = 3 THEN M%(M, 8) = A   9110 if monster was unarmed and artifact is weapon then mark artifact as monster's ready weapon
9115 IF M%(M, 11) < 3 THEN M%(M, 11) = 100 + M%(M, 11) * (30 + A%(A, 1) / 100)   9115 if monster not Friendly then redefine monster's original potential Friendliness in terms of artifact's value
9120 R3 = RO :  GOSUB 3600 :  GOTO 5050   9120 reassess monster's Friendliness; jump into DROP routine to check for effects on player of losing artifact
    9300-9320 GIVE POTION/HEAL MONSTER routine
9300 PRINT : PRINT M$(M)" DRINKS THE "A$(A) :  PRINT " THEN RETURNS IT TO YOU." : L = L + 3 :  GOSUB 51 :  IF M%(M, 11) < 3 THEN M%(M, 11) = 140 + 60 * M%(M, 13) / M%(M, 1) : A%(A, 6) = A%(A, 6) - 1   9300 print that monster drinks and returns artifact to player; check for screen pause; if not Friendly then redefine monster's potential friendliness; reduce "swallows left" by one
9320 M%(M, 13) = M%(M, 13) - A%(A, 5) : M%(M, 13) = M%(M, 13) * (M%(M, 13) > 0) : DF = M : D2 = 0 :  GOSUB 7637 :  GOTO 9120   9320 heal/poison monster; print health report; return to GIVE routine
    9500-9550 GIVE GOLD routine
9500 SL = VAL (A$) :  IF SL > GO THEN 91   9500 find amount of gold to be given; if more than player carries then exit through error message at 91
9540 GO = GO - SL :  IF M%(M, 11) < 3 THEN M%(M, 11) = 101 + M%(M, 11) * SL / 100   9540 reduce player's gold; redefine monster's potential Friendliness in terms of amount of gold given
9550 GOTO 9120   9550 return to GIVE routine
9800 REM ..PARSE.   9800-9820 PARSE routine
9810 A$ = "" : B$ = "" :  FOR X = 1 TO LEN (S$) :  IF MID$ (S$, X, Q) = Q$ AND X > 2 THEN B$ = MID$ (S$, X + Q) : A$ = LEFT$ (S$, X - 1) : X = 999   9810 try to break command object into artifact and monster names (eg :  GIVE XX TO YY will break into artifact XX and monster YY)
9820 NEXT : RETURN   9820 return to calling routine
10000 REM ..INVEN.   10000-10150 INVENTORY routine
10010 IF S$ = "" THEN M = 0 : X = - 999 :  GOTO 10060   10010 if no object named then inventory self
10020 IF NOT LT THEN 100   10020 if no light then abort to YOU SEE routine
10030 GOSUB 4700 :  IF NOT F THEN 96   10030 search for match to monster name; if no match then abort to error message
10040 IF M%(M, 11) < > 3 THEN FOR M = M TO M :  GOTO 15030   10040 If named monster is not Friend then exit through SMILE routine to give response
10050 X = - M - 1 :  GOTO 10100   10050 set X to location of named monster's stuff and jump to do inventory
10060 M2 = 0 : B% = NA : D% = - 999 :  FOR A = 1 TO NA : C% = A :  & A, D%, A%(C%, 4), C%, B% :  IF NOT C% THEN A = 999 :  GOTO 10090   10060 search for worn artifacts; if none found then bypass "worn" code
10070 IF NOT M2 THEN M2 = 1 :  PRINT : PRINT M$(M)" IS WEARING : " :  GOSUB 54   10070 print "IS WEARING" line and check for screen pause
10080 A = C% :  PRINT " "A$(A)   10080 print worn artifact name
10090 NEXT  : X = - 1   10090 check for more; set X to location of player's stuff
10100 PRINT : PRINT M$(M)" IS CARRYING : " :  GOSUB 54   10100 print "IS CARRYING" line and check for screen pause
10110 LK = 0 : B% = NA : D% = X :  FOR A = 1 TO NA : C% = A :  & A, D%, A%(C%, 4), C%, B% :  IF NOT C% THEN A = 999 :  GOTO 10130   10110 search for carried artifacts; if none found then skip to "(NOTHING)" line
10120 LK = 1 : A = C% :  PRINT " "A$(A); :  IF A = M%(M, 8) THEN PRINT " (READY WEAPON)";   10120 print artifact name; if ready weapon then print "(READY WEAPON)"
10130 GOSUB 51 :  NEXT : IF NOT LK THEN PRINT " (NOTHING)" :  GOSUB 51   10130 check for screen pause; check for more; if no artifacts were found then print "(NOTHING)"; check for screen pause
10140 IF NOT M THEN PRINT " ";GO;" GOLD PIECES." :  GOSUB 54 : DF = M : D2 = 0 :  GOSUB 7638   10140 if player being inventoried then print gold; check for screen pause; print player's health condition
10150 GOTO 300   10150 exit to PICK FOE routine
11000 REM ..BLAST.   11000-11050 BLAST routine
11010 S = 0 :  GOSUB 11500 :  GOSUB 4900 :  GOSUB 4700 :  IF NOT F THEN TA = 1 :  GOTO 7030   11010 set S to BLAST; go execute spellcast; check if spell object is named; search for match to monster name; if no match then proceed to ATTACK routine to try for artifact match
11050 PRINT : PRINT "DIRECT HIT!" :  PRINT  : L = L + 3 : S = 5 : D = 2 : DF = M : A = 0 :  GOSUB 7635 :  PRINT : GOTO 300   11050 print DIRECT HIT message; increment line counter; set "sides" to 5 and "dice" to 2; use code in DO BATTLE routine to compute and print hit damage; exit to PICK FOE routine
    11500-11540 SPELLCAST subroutine
11500 SU = 0 :  IF SA%(S) THEN RL = 100 * RND (1) : SU = (((RL < S2%(S)) OR (RL < 5)) AND (RL < 95))   11500 if player has ability for cast spell, use random number RL to determine result
11505 IF RL = 100 THEN PRINT : PRINT "SPELL BACKLASH!! YOUR ABILITY TO CAST THIS SPELL TEMPORARILY DIMINISHES!" : S2%(S) = S2%(S) / 10 :  POP : GOTO 98   11505 if RL = 100 (1% chance) then print SPELL BACKLASH! message; diminish current spell ability by 90%; exit through screen pause check to PICK FOE routine
11510 IF NOT SU THEN PRINT : PRINT "NOTHING HAPPENED." :  POP : GOTO 98   11510 if spellcast unsuccessful, then print NOTHING HAPPENED message and exit through screen pause to PICK FOE routine
11520 RL = 100 * RND (1) :  IF RL > S2%(S) THEN S2%(S) = S2%(S) + 2 : SA%(S) = SA%(S) + 2   11520 use random number to determine if permanent spell ability is increased by 2
11530 S2%(S) = S2%(S) * .8   11530 diminish current spell ability by 20%
11540 RETURN   11540 exit to calling spell routine
12000 REM ..HEAL.   12000-12060 HEAL routine
12010 S = 1 :  GOSUB 11500 : M = 0 :  IF S$ < > "" THEN GOSUB 4700   12010 set S to HEAL; go execute spellcast; if monster is named then search for match to name
12040 GOSUB 56 :  IF M%(M, 13) THEN PRINT M$(M)"'S HEALTH IMPROVES!"   12040 check for screen pause; if object of HEAL is injured then print HEALTH IMPROVES message
12050 M%(M, 13) = M%(M, 13) - 3 - 10 * RND (1) :  IF M%(M, 13) < 0 THEN M%(M, 13) = 0   12050 reduce hit damage by 3 to 12; if damage is reduced below zero then set to zero
12060 DF = M : D2 = 0 :  GOSUB 7637 :  GOTO 300   12060 use code in DO BATTLE routine to compute and print hit damage; exit to PICK FOE routine
13000 REM ..POWER.   13000-13080 POWER routine
13010 S = 3 :  GOSUB 11500 : RL = RND (1) * 100 :  IF RL < 11 AND M%(0, 13) THEN PRINT : PRINT "YOUR WOUNDS HEAL!" : M%(0, 13) = 0 :  GOTO 98   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 THEN PRINT : PRINT "YOU HEAR A VERY LOUD SONIC BOOM" :  PRINT " THAT ECHOES THROUGH THE TUNNELS." :  PRINT : GOSUB 52 :  GOTO 98   13050 if Rl < 91 (80% chance) then print SONIC BOOM message; perform screen pause check; exit to PICK FOE routine
13070 FOR M = 1 TO NM :  IF M%(M, 5) = RO THEN PRINT M$(M)" HEALS!" :  GOSUB 51 : M%(M, 13) = 0   13070 restore all monsters in room to perfect health (10% chance)
13080 NEXT  : R3 = RO :  GOSUB 3600 :  GOTO 300   13080 check monster status; exit to PICK FOE
14000 REM ..SPEED.   14000-14040 SPEED routine
14010 S = 2 :  GOSUB 11500   14010 set S to SPEED; execute spellcast
14020 IF SP THEN PRINT : PRINT "NOTHING HAPPENED" :  GOTO 98   14020 if SPEED spell is already active then print NOTHING HAPPENED message; exit through screen pause check to PICK FOE
14040 M%(0, 2) = M%(0, 2) * 2 : SP = SP + 25 * RND (1) + 10 :  PRINT : PRINT "YOUR MOVEMENTS QUICKEN!" :  GOTO 98   14040 double player Agility; set spell counter to 10-32; print QUICKEN message; exit through screen pause check to PICK FOE
15000 REM ..SMILE.   15000-15100 SMILE routine
15005 IF NOT LT THEN 100   15005 if no light then abort to YOU SEE
15010 PRINT : FOR M = 1 TO NM :  IF M%(M, 5) < > RO THEN NEXT : GOTO 300   15010 print blank line; check for monster in room; if none then exit to PICK FOE
15030 GOSUB 52 :  PRINT M$(M); :  IF M%(M, 3) > 1 THEN PRINT "S";   15030 increment line counter; print monster name; if multiple-monster then add "S" for plural
15040 PRINT " "SM$(M%(M, 11)); :  IF M%(M, 3) = 1 THEN PRINT "S";   15040 print response appropriate for monster alignment; if not multiple-monster then add "S" to response
15050 PRINT " AT YOU."   15050 print "AT YOU."
15100 NEXT : GOSUB 51 :  GOTO 300   15100 check for more monsters in room; update line count; exit to PICK FOE routine
16000 REM ..SAY.   16000-16900 SAY routine
16010 GOSUB 4900   16010 check for object S$
16900 PRINT : PRINT "OKAY, " CHR$ (34)S$ CHR$ (34) :  PRINT : GOTO 98   16900 if S$ present then "say" it.
17000 REM ..READY.   17000-17100 READY routine
17010 GOSUB 4900 :  GOSUB 4801 :  IF NOT F THEN 91   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 A%(A, 2) < 2 OR A%(A, 2) > 3 THEN PRINT : PRINT "THAT ISN'T A WEAPON!" :  GOTO 99   17030 if named object not weapon then print NOT a WEAPON and exit through line count to YOU SEE routine
17100 M%(0, 8) = A : M%(0, 9) = A%(A, 7) : M%(0, 10) = A%(A, 8) : W2 = A%(A, 6) :  PRINT : PRINT A$(A)" READIED." :  GOTO 98   17100 set player's Dice and Sides to that of named weapon; set W2 to weapon type; print READIED message
18000 REM ..SAVE.   18000-18100 SAVE routine
18010 PRINT : PRINT "DO YOU WANT TO SAVE THIS GAME? " :  PRINT "(Y/N)  : ";   18010 ask if player is sure they want to save game
18020 GET A$ :  IF A$ < > "Y" AND A$ < > "N" THEN 18020   18020 get player response; if not "Y" or "N" then try again for proper response
18030 PRINT A$ :  IF A$ = "N" THEN 100   18030 print response; if "N" then exit to YOU SEE routine
18040 PRINT D$"CLOSE" : X = FRE (0) :  PRINT D$"BSAVE GAME.PTRS, A$69, L8"   18040 close open files; clean up string space by executing FRE command; BSAVE variable pointers
18060 PRINT D$"BSAVE GAME.SVAR, A" PEEK (105) + PEEK (106) * 256", L" PEEK (109) + PEEK (110) * 256 - PEEK (105) - PEEK (106) * 256 + 1   18060 BSAVE nonstring variables
18070 PRINT D$"BSAVE GAME.STR, A" PEEK (111) + PEEK (112) * 256", L" PEEK (115) + PEEK (116) * 256 - PEEK (111) - PEEK (112) * 256 + 1   18070 BSAVE string variables
18080 PRINT : PRINT "THE GAME IS NOW SAVED. YOU CAN BOOT THIS DISKETTE, OR RUN THE PROGRAM 'MAIN PGM' TO RESTART THE GAME."   18080 print GAME SAVED message
18090 PRINT : PRINT : INPUT "RESUME PLAY? ";A$ :  IF LEFT$ (A$, 1) < > "N" THEN 29060   18090 ask if player wishes to resume play; if not "N" then exit to RESUME routine to reopen files
18100 END   18100 END program execution
19000 REM ..LIGHT.   19000-19050 LIGHT routine
19010 GOSUB 4910 :  GOSUB 4801 :  IF NOT F THEN 91   19010 check for object S$; check to see if player is carrying named object; if not then exit through error message at 91
19040 PRINT  : LT = NL :  IF A%(A, 2) < > 5 OR A%(A, 5) < 1 THEN PRINT "IT WON'T LIGHT!" :  GOTO 98   19040 set light flag LT to natural light of room; if named object is not lightable then print IT WON'T LIGHT
19050 LT = 1 : LS = A :  PRINT "YOU'VE MANAGED TO LIGHT THE "A$(A)"." :  GOTO 98   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 REM ..OPEN.   20000-20340 OPEN routine
20010 GOSUB 4900 :  GOSUB 4804 :  IF NOT F THEN 20060   20010 check for object S$; check to see if object is available; if not then exit to DOOR check at 20060
20020 IF A%(A, 4) = RO + 200 THEN A%(A, 4) = RO   20020 if object is hidden then make visible
20030 GOSUB 51 : X = A%(A, 2) :  IF X = 4 OR X = 6 OR X = 7 THEN 20100   20030 update line count; proceed to OPENABLE routine if object is container, drinkable, or readable
20050 IF X = 8 THEN 20300   20050 proceed to DOOR routine if object is door
20060 IF S$ = "DOOR" OR S$ = "GATE" THEN PRINT "TRY GOING IN THAT DIRECTION." :  GOTO 99   20060 if no true artifact is named but object is DOOR or GATE then print TRY GOING message
20070 PRINT "IT WON'T OPEN." :  GOTO 99   20070 if we get here it is not openable; print IT WON'T OPEN
20100 REM .OPENABLE   20100-20130 OPENABLE routine
20110 IF A%(A, 7) THEN IF X = 6 OR X = 7 THEN PRINT : PRINT "IT IS ALREADY OPEN." :  GOTO 98   20110 if readable or drinkable and open flag is set then print ALREADY OPEN message
20120 IF X = 4 THEN A%(A, 8) = 0 :  IF A%(A, 5) AND A%(A%(A, 5), 4) < > - 1 THEN PRINT "IT'S LOCKED!" :  GOTO 99   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 through line counting routine
20130 A%(A, 7) = 1 :  PRINT : PRINT "OPENED." :  IF X = 6 OR X = 7 THEN GOTO 98   20130 mark as open; print OPENED; if drinkable or readable then exit to PICK FOE through line count
20200 REM .CONT.   20200-20230 CONTAINER routine
20220 GOSUB 54 : LK = 0 :  FOR X = 1 TO NA :  IF A%(X, 4) = A + 500 THEN A%(X, 4) = RO : LK = 1   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 NEXT : PRINT "YOU FIND " MID$ ("NOSOME", LK * 2 + 1, 2 + 2 * LK)"THING INSIDE." :  GOTO 98   20230 print FOUND NOTHING or SOMETHING INSIDE depending on state of LK flag; exit to PICK FOE through line counter routine
20300 REM .DOOR   20300-20340 DOOR routine
20310 IF A%(A, 6) > 0 THEN IF A%(A%(A, 6), 4) < > - 1 THEN PRINT "IT'S LOCKED!" :  GOTO 99   20310 if a key exists but is not held by player then print LOCKED message; exit to YOU SEE through line counting routine
20330 A%(A, 8) = 0 : A%(A, 6) = 0 : A%(A, 4) = RO :  PRINT "YOU'VE OPENED THE "A$(A)"." :  FOR X = 1 TO ND :  IF RD%(X) = A + 500 THEN RD%(X) = A%(A, 5)   20330 unhide door; unlock door; put door in room; print OPENED message; find room connection of door
20340 NEXT : GOTO 98   20340 exit to PICK FOE through line counter
21000 REM ..PUT.   21000-21150 PUT routine
21010 IF S$ THEN Q$ = " IN " : Q = 4 :  GOSUB 9800 :  IF A$ = "" THEN Q$ = " ON " : Q = 4 :  GOSUB 9800   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 A$ = "" THEN PRINT : INPUT "PUT WHAT?";A$ :  INPUT "PUT IN/ON WHAT?";B$   21040 if not recognized as full command then ask for name of object and container
21100 S$ = A$ : M = 0 :  GOSUB 4804 :  IF NOT F THEN 21150   21100 check for object; if not present then exit to PICK FOE through line counting routine
21110 Z = A : S$ = B$ :  GOSUB 4804 :  IF A = Z OR NOT F THEN 21150   21110 check for container; if not present or same as object then exit to PICK FOE through line counting routine
21120 IF A%(A, 2) < > 4 THEN 21150   21120 if container is not a "container" object then proceed to error message
21130 IF NOT A%(A, 7) THEN 92   21130 if container not open then exit to MUST FIRST OPEN IT error message
21140 A%(Z, 4) = A + 500 :  PRINT : PRINT "OKAY." :  GOTO 98   21140 change object's location to inside container; print OKAY; exit to PICK FOE through line counting routine
21150 PRINT : PRINT "YOU CAN'T DO THAT." :  GOTO 98   21150 print YOU CAN'T DO THAT; exit to PICK FOE through line counting routine
22000 REM ..DRINK.   22000-22190 DRINK routine
22010 GOSUB 4900 :  GOSUB 4804 :  IF NOT F THEN 94   22010 check for object S$; check if object is available; if not found then exit through error message at 94 (YOU CAN'T...)
22020 IF A%(A, 2) < > 6 THEN 94   22020 if object not drinkable then exit through error message at 94 (YOU CAN'T...)
22030 IF NOT A%(A, 7) THEN 92   22030 if not open then exit through error message at 92 (YOU MUST FIRST OPEN IT)
22110 IF A%(A, 6) < 1 THEN PRINT : PRINT "THERE'S NONE LEFT." :  GOTO 98   22110 if #uses less than one then print NONE LEFT; exit to PICK FOE through line counting routine
22130 A%(A, 6) = A%(A, 6) - 1 : M%(0, 13) = M%(0, 13) - A%(A, 5) :  PRINT : PRINT "YOU FEEL " MID$ ("BETTERWORSE", (A%(A, 5) < 0) * 6 + 1, 6)"!" :  IF M%(0, 13) < 0 THEN M%(0, 13) = 0   22130 decrement #uses; reduce/increase hits by Heal Amt; print FEEL BETTER or WORSE message; if hits reduced below zero then set to zero
22140 GOSUB 54 : DF = 0 : D2 = 0 :  GOSUB 7638   22140 update line counter; proceed to DO BATTLE subroutine to print state of health
22190 GOTO 300   22190 exit to PICK FOE routine
23000 REM ..READ.   23000-23210 READ routine
23010 GOSUB 4900 :  GOSUB 4804 :  IF NOT F THEN 94   23010 check for object S$; check to see if object is available; if not then exit through error message at 94 (YOU CAN'T...)
23020 IF A%(A, 2) < > 7 THEN 94   23020 if not drinkable then exit through error message at 94 (YOU CAN'T...)
23030 IF NOT A%(A, 7) THEN 92   23030 if not open then exit through error at 92
23040 PRINT : PRINT "IT SAYS : " : L = L + 2   23040 print IT SAYS : ; update line count
23210 PRINT : FOR X = 1 TO A%(A, 6) : R = A%(A, 5) + 399 + X :  GOSUB 45 :  NEXT : GOTO 300   23210 print Effects defined by artifact data; exit to PICK FOE routine
24000 REM ..FREE.   24000-24150 FREE routine
24010 GOSUB 4900 :  GOSUB 4804 :  IF NOT F THEN 94   24010 check for object S$; check to see if object is available; if not then exit through error message at 94 (YOU CAN'T...)
24020 IF A%(A, 2) < > 10 THEN 94   24020 if not Bound Monster then exit through error message at 94 (YOU CAN'T...)
24030 M = A%(A, 5) : K = A%(A, 6) : G = A%(A, 7)   24030 set some temporary variables
24120 IF M%(G, 5) = RO THEN PRINT : PRINT M$(G)" WON'T LET YOU DO THAT!" :  GOTO 98   24120 if guard is present then print WON'T LET YOU DO THAT message; exit to PICK FOE through line counting routine
24130 IF A%(K, 4) < > - 1 AND K < > 0 THEN PRINT : PRINT "YOU DON'T HAVE THE KEY!" :  GOTO 100   24130 if key exists and not available then print DON'T HAVE KEY message; exit to YOU SEE
24150 PRINT : PRINT "YOU HAVE FREED "M$(M)"." : M%(M, 5) = RO : A%(A, 4) = 0 : R3 = RO :  GOSUB 3600 :  GOTO 98   24150 print FREED message; put freed monster in room, remove bound monster; update monster alignments and group totals; exit to PICK FOE through line counting routine
25000 REM ..REQUEST.   25000-25090 REQUEST routine
25010 IF S$ THEN Q$ = " FROM " : Q = 6 :  GOSUB 9800   25010 if object is named then run object through PARSE routine to see if it parses into full command (REQUEST XX FROM YY)
25040 IF A$ = "" THEN GOSUB 4900 : A$ = S$ :  INPUT "FROM WHOM?";B$   25040 if not full command then get object requested S$ and monster name B$
25050 S$ = B$ :  GOSUB 4700 :  IF NOT F THEN 96   25050 check for monster named; if not present then exit through error message at 96
25060 IF M%(M, 11) < 2 THEN FOR M = M TO M :  GOTO 15030   25060 if monster is enemy then exit through SMILE routine
25070 S$ = A$ : HA = ( - M - 1) : WH = HA : EM = HA :  GOSUB 4810 :  IF NOT F THEN PRINT : PRINT M$(M)" DOESN'T HAVE IT." :  GOTO 98   25070 check to see if monster has it; if not print DOESN'T HAVE IT message; exit to PICK FOE through line counting routine
25080 PRINT : PRINT "OKAY." :  GOSUB 54 : A%(A, 4) = - 1 : WT = WT + A%(A, 3) :  IF A = M%(M, 8) THEN M%(M, 8) = - M - 1   25080 print OKAY; update line count; transfer object from monster to player; increase weight carried WT by object's weight; if object was monster's ready weapon then mark him as unarmed
25090 GOTO 5050   25090 exit through DROP routine to check for effects of object acquisition
26000 REM ..WEAR.   26000-26100 WEAR routine
26010 GOSUB 4900 : HA = - 1 : WH = RO : EM = - 999 :  GOSUB 4810 :  IF NOT F THEN 94   26010 check for object S$; check to see if object is available; if not then exit through error message at 94 (YOU CAN'T...)
26015 IF A%(A, 4) = EM THEN 26100   26015 if object already worn then proceed to error message at 26100
26020 IF A%(A, 2) < > 11 THEN 94   26020 if not wearable then exit through error message at 94 (YOU CAN'T...)
26030 IF NOT A%(A, 5) THEN 26080   26030 if armor then proceed to 26080
26040 IF A%(A, 5) = 1 AND SH THEN 26100   26040 if armor and already carrying shield then proceed to error message at 26100
26050 IF A%(A, 5) = 1 THEN SH = A : M%(0, 7) = M%(0, 7) + 1 :  GOTO 26080   26050 if armor then update player data to show that shield is carried if armor class is odd number (eg :  PLATE AND SHIELD)
26060 IF AR THEN 26100   26060 if already armored then proceed to error message at 26100
26070 AR = A : M%(0, 7) = M%(0, 7) + AC / 2   26070 set player's armor data to this artifact
26080 A%(A, 4) = - 999 :  PRINT : PRINT A$(A)" WORN." :  GOTO 98   26080 mark object as worn; print WORN; exit to PICK FOE through line count
26100 PRINT : PRINT "YOU'RE ALREADY WEARING ONE!" :  GOTO 98   26100 print ALREADY WEARING message; exit to PICK FOE through line counting routine
27000 REM ..REMOVE.   27000-27040 REMOVE routine
27010 GOSUB 4900 : HA = - 999 : EM = HA : WH = HA :  GOSUB 4810 :  IF NOT F THEN PRINT : PRINT "YOU AREN'T WEARING IT." :  GOTO 99   27010 check for object S$; check to see if object is available; if not then print AREN'T WEARING IT message; exit to YOU SEE through line counting routine
27020 IF A = SH THEN M%(0, 7) = M%(0, 7) - 1 : SH = 0   27020 if object is player's shield then remove shield from player data
27030 IF A = AR THEN M%(0, 7) = M%(0, 7) - A%(A, 5) / 2 : AR = 0   27030 if object if player's armor then remove armor from player
27040 A%(A, 4) = - 1 :  PRINT : PRINT A$(A)" REMOVED." :  GOTO 98   27040 mark object as carried by player; print REMOVED message; exit to PICK FOE through line counting routine
28000 REM ..USE.   28000-28900 USE routine
28010 REM ///INSERT YOUR OWN SPECIAL STUFF HERE    
28900 PRINT : PRINT "TRY ANOTHER COMMAND." :  GOTO 98   28900 print TRY ANOTHER COMMAND message; exit to PICK FOE through line counting routine
29000 REM ..RESUME GAME.   29000-29070 RESUME GAME routine
29005 POKE 216, 0   29005 turn off ONERR
29010 PRINT : PRINT "DO YOU WANT TO RESUME THE SAVED GAME?" :  PRINT " Y OR N : ";   29010 ask RESUME GAME?
29020 GET A$ :  IF A$ < > "Y" AND A$ < > "N" THEN 29020   29020 get answer
29030 PRINT A$ :  IF A$ = "N" THEN PRINT D$"DELETE GAME.PTRS" :  PRINT D$"DELETE GAME.SVAR" :  PRINT D$"DELETE GAME.STR" :  RUN   29030 if "N" then delete saved game and restart program
29040 PRINT CHR$ (4)"BLOAD GAME.PTRS" :  PRINT CHR$ (4)"BLOAD GAME.SVAR" :  PRINT CHR$ (4)"BLOAD GAME.STR"   29040 BLOAD saved game variables and pointers
29050 PRINT CHR$ (26)"1" :  PRINT CHR$ (21) :  HOME : IF CP = 80 THEN PRINT D$;"PR#3" :  PRINT CHR$ (12) :  HOME   29050 set screen to 40-col.; if saved game was 80-col. then set screen to 80-col.
29060 PRINT D$"OPEN"ED$", L242" :  PRINT D$"OPEN"ER$", L"LR   29060 OPEN data files used during play
29070 F = 0 : A$ = "" : CZ$ = "" :  GOTO 100   29070 preset command variables to no command; exit to YOU SEE routine
31000 REM ..INIT.   31000-31950 INIT routine
31005 ER$ = "EAMON.ROOMS" : ED$ = "EAMON.DESC"   31005 set string variables to file names
31010 POKE 216, 0 :  PRINT D$"OPEN"ED$ :  PRINT D$"READ"ED$ :  INPUT NR, NZ, NE, NM, LR, LM, LA :  PRINT D$"CLOSE"   31010 turn off ONERR; open EAMON.DESC; input database parameters; close file
31015 NA = NZ + 6 :  DIM A$(NA), A%(NA, 8), M$(NM), M%(NM, 13), V%(NR), SA%(3), S2%(3), SM$(3), BV$(5, 2), RB$(5, 1), WA%(5)   31015 set # of Artifacts NA to number in database plus six for player's stuff; dimension all arrays
31020 PRINT D$"OPEN EAMON.ARTIFACTS, L"LA :  FOR A = 1 TO NZ :  PRINT D$"READ EAMON.ARTIFACTS, R"A :  INPUT A$(A) :  FOR A2 = 1 TO 8 :  INPUT A%(A, A2) :  NEXT   31020 input artifact data
31030 NEXT : PRINT D$"OPEN EAMON.MONSTERS, L"LM :  FOR A = 1 TO NM :  PRINT D$;"READ EAMON.MONSTERS, R"A :  INPUT M$(A) :  FOR A2 = 1 TO 11 :  INPUT M%(A, A2)   31030 input monster data
31035 NEXT  : M%(A, 12) = M%(A, 3) : M = M%(A, 6) * M%(A, 3) : M%(A, 6) = 31000 :  IF M < M%(A, 6) THEN M%(A, 6) = M   31035 set up multiple monster numbers and group weight
31038 NEXT    
31039 REM GOTO 33500 : REMFAST.START   31039 temporarily go to FAST.START code to save FAST.START info
31040 PRINT D$"OPEN FRESH MEAT" :  PRINT D$"READ FRESH MEAT" :  INPUT RE :  INPUT M$(0), M%(0, 1), M%(0, 2), CH :  FOR A = 0 TO 3 :  INPUT SA%(A) : S2%(A) = SA%(A) :  NEXT : FOR A = 1 TO 5 :  INPUT WA%(A) :  NEXT : INPUT AE, SE$, GO, BA, AC   31040 input player data from FRESH.MEAT file
31050 NA = NZ :  FOR A = NZ + 1 TO NZ + 4 :  INPUT A$(A), A%(A, 6), A%(A, 5), A%(A, 7), A%(A, 8)   31050 input player weapons into artifact array
31052 IF A$(A) < > "NONE" THEN NA = NA + 1 : A%(A, 2) = 2 + (A%(A, 7) * A%(A, 8) > 25) : A%(A, 3) = 2 : A%(A, 4) = - 1 : WT = WT + 2   31052 check for player weapons (name not "NONE"); increase # of artifacts variable NA for each one found; set weapon artifact type to "magic" if dice times sides exceeds 25; set weapon weight to 2; add weight to WT carried
31054 NEXT : PRINT D$"CLOSE"   31054 close open files
31055 REM ?D$"DELETE FRESH MEAT"   31055 delete FRESH.MEAT (disabled by REM)
31060 PRINT D$"OPEN"ED$", L242" :  PRINT D$"OPEN"ER$", L";LR : M%(0, 8) = NZ + 1 : M%(0, 9) = A%(NZ + 1, 7) : M%(0, 10) = A%(NZ + 1, 8)   31060 open EAMON.DESC and EAMON.ROOMS; set player Ready Weapon; set player dice and sides to that of Ready Weapon
31080 FOR W2 = NZ + 1 TO NA   31080 check player weapons for duplicate names
31090 FOR A = 1 TO NZ :  IF A$(A) = A$(W2) THEN A$(A) = A$(A) + "#" : A = 999 :  NEXT : GOTO 31090   31090 if artifact name matches name of player's weapons then add "#" to front of artifact name; if rename is required then make second pass to ensure that no fresh name matches were generated
31100 NEXT : NEXT  : B% = AC / 2 :  IF B% THEN NA = NA + 1 : AR = NA : A$(NA) = MID$ ("LEATHER CHAIN MAIL PLATE ARMOR", B% * 11 - 10, 7 + 3 * (B% > 1) + B%( > 2)) : A%(NA, 2) = 11 : A%(NA, 3) = B% * 7 : A%(NA, 4) = - 999 : WT = WT + B% * 7 : A%(NA, 5) = B% * 2   31100 check player's armor class AC and generate armor artifact to match; make wearable; set armor weight based on class of armor; mark as "worn"; add to weight carried; set armor class of artifact
31110 SH = ( INT (AC / 2) < > AC / 2) :  IF SH THEN NA = NA + 1 : SH = NA : A$(NA) = "SHIELD" : A%(NA, 2) = 11 : A%(NA, 3) = 10 : A%(NA, 4) = - 999 : WT = WT + 10 : A%(NA, 5) = 1   31110 check player's armor class for shield and generate shield artifact if present; make it wearable; set weight to 10; mark as "worn"; add to weight carried; set armor class of artifact
31111 M%(0, 7) = B% + (SH > 0) : M%(0, 11) = 3   31111 set player's armor to that of armor worn; mark player as "friendly"
31120 EA = 0 :  IF AE < AC * AC THEN EA = AE - AC * AC   31120 calculate effect of Armor Expertise and Armor Class
31130 READ NC :  DIM C$(NC + 3) :  FOR C = 1 TO NC :  READ C$(C) :  NEXT  : CC = INT (NC / 3) + 1 : R2 = 1   31130 read number of commands NC from data; dim command list array; read commands from data; calculate line breaks for listing commands; set next room R2 to 1
31140 W2 = 0 : RO = 1 : ND = 6 : FF$ = CHR$ (12)   31140 set room to 1; set number of exit directions to 6; assign FF$ to the linefeed character (used by II+ 80-col. video cards to clear screen for HOME command)
31410 FOR A = 1 TO 3 :  READ SM$(A) :  NEXT   31410 read SMILE responses into array
31420 FOR A = 0 TO 5 :  FOR A2 = 0 TO 2 :  READ BV$(A, A2) :  NEXT : NEXT : FOR A = 0 TO 5 :  FOR A2 = 0 TO 1 :  READ RB$(A, A2) :  NEXT : NEXT   31420 read attack verbs into array; read attack result verbs into array
31430 L = 50 : CP = PEEK (768) :  IF CP < > 80 THEN CP = 40   31430 set line counter to 50 to force HIT ANY KEY TO CONTINUE pause when game is ready to begin; set line length variable CP (used by line counter routine) to number held in memory location 768; if not 80 then set CP to 40 (note :  the intro program pokes 80 into location 768 if 80-col. display was chosen)
31440 W2 = A%(M%(0, 8), 6)   31440 determine weapon type of Ready Weapon
31900 GOTO 3500   31900 proceed to GO routine to set up Room 1 and begin game
31910 DATA 32   31910 DATA :  number of commands
31920 DATA NORTH, SOUTH, EAST, WEST, UP, DOWN, GET, DROP, LOOK, EXAMINE, ATTACK, FLEE, GIVE, INVENTORY, BLAST, HEAL, POWER, SPEED, SMILE, SAY, READ, READY, SAVE, LIGHT, OPEN, PUT, DRINK, FREE, REQUEST, WEAR, REMOVE, USE   31920 DATA :  commands
31930 REM (INSERT ADDITIONAL COMMANDS HERE)   31930 space for additional commands
31940 DATA GROWL, LOOK, SMILE   31940 SMILE responses
31945 DATA LUNGES, TEARS, CLAWS, SWINGS, CHOPS, SWINGS, SHOOTS, SHOOTS, SHOOTS, SWINGS, SWINGS, SWINGS, STABS, LUNGES, JABS, SWINGS, CHOPS, STABS   31945 attack verbs
31950 DATA MISSED, MISSED, PARRIED, MISSED, MISSED, MISSED, PARRIED, MISSED, PARRIED, MISSED, PARRIED, MISSED   31950 attack result verbs
32000 REM ..DONE   32000-32900 DONE routine
32010 PRINT : POKE - 16368, 0 :  GOSUB 59 :  PRINT   32010 clear keyboard strobe so no keypress is pending; execute screen pause
32020 PRINT D$"CLOSE" :  IF SP THEN M%(0, 2) = M%(0, 2) / 2   32020 close open files; reset SPEED spell
32030 IF DI THEN 32500   32030 if dead then exit game
32040 DIM WP%(NA), WP$(NA) :  FOR W = 1 TO 4 : WP$(W) = "NONE" :  NEXT  : W2 = 0 :  FOR A = 1 TO NA :  IF A%(A, 4) = - 1 THEN IF A%(A, 2) = 2 OR A%(A, 2) = 3 THEN W2 = W2 + 1 : WP$(W2) = A$(A) : WP%(W2) = A : A%(A, 4) = 0   32040 compile list of weapons carried
32050 NEXT : IF W2 < 5 THEN 32300   32050 if fewer than 5 weapons carried then proceed to sell stuff
32060 PRINT FF$ :  HOME : PRINT "AS YOU ENTER THE MAIN HALL, LORD WILLIAM CRANKHANDLE APPROACHES AND SAYS, 'YOU HAVE TOO MANY WEAPONS -- 4 IS THE LEGAL LIMIT." :  PRINT : PRINT "YOUR WEAPONS ARE : "   32060 print "TOO MANY WEAPONS" message
32070 FOR W = 1 TO W2 :  PRINT SPC( 4);W;"--";WP$(W) :  NEXT : PRINT : PRINT "ENTER THE NUMBER OF THE WEAPON TO SELL (1-";W2;") "   32070 list weapons carried; get number of weapon to sell
32080 VTAB PEEK (37) + 1 :  INPUT A$ : W5 = VAL (A$) :  IF W5 < 1 OR W5 > W2 THEN 32080   32080 put cursor on "sell" input line; get player input; if invalid weapon number than repeat this line
32090 A%(WP%(W5), 4) = - 1 : WP$(W5) = WP$(W2) : WP%(W5) = WP%(W2) : W2 = W2 - 1 :  IF W2 > 4 THEN 32060   32090 remove "sold" weapon from list; if still more than 4 weapons then relist weapons
32300 DIM WD%(4, 4) :  FOR W = 1 TO 4 :  IF WP%(W) THEN A = WP%(W) : WD%(W, 1) = A%(A, 6) : WD%(W, 2) = A%(A, 5) : WD%(W, 3) = A%(A, 7) : WD%(W, 4) = A%(A, 8) : A%(A, 4) = 0   32300 assemble retained-weapon data in preparation for return to Main Hall
32310 NEXT : PRINT FF$ :  HOME : PRINT " YOU SELL YOUR GOODS TO THE LOCAL BUYER OF TREASURE (UNDER THE SIGN OF 3 BALLS). HE PAYS YOU ";   32310 print SELL GOODS message
32315 A%(SH, 4) = 0 : A%(AR, 4) = 0   32315 remove shield and armor from artifact data
32320 TP = 0 :  FOR A = 1 TO NA :  IF A%(A, 4) = - 1 THEN TP = TP + A%(A, 1) * ((A%(A, 2) < > 0) * CH / 10 + (A%(A, 2) = 0))   32320 compute value of artifacts carried
32350 NEXT  : TP = INT (TP) :  PRINT TP;" GOLD PIECES." :  PRINT   32350 print computed value
32360 GO = GO + TP :  IF GO < 0 THEN GO = 0   32360 add value to gold carried; if value is less than zero then set to zero
32370 PRINT : GOSUB 59 :  PRINT   32370 execute screen pause
32500 ONERR GOTO 32510   32500 set up ONERR vector to recover if Master disk is not inserted as prompted
32505 PRINT CHR$ (26)"1" :  REM TURN OFF VIDEX 80-COL   32505 turn off II+ (Videx) 80-col. mode
32506 PRINT CHR$ (21) :  REM TURN OFF //E 80-COL   32506 turn off IIe 80-col. mode
32510 HOME : VTAB 5 :  PRINT "(INSERT EAMON MASTER DISKETTE, THEN" :  PRINT " HIT THE 'C' KEY) "; :  POKE - 16368, 0   32510 print INSERT EAMON MASTER message; clear keyboard strobe
32520 GET A$ :  IF A$ < > "C" THEN 32520   32520 get keypress; if not "C" then again
32530 PRINT A$   32530 print keypress to screen
32540 IF DI THEN PRINT D$"OPEN THE ADVENTURER" :  PRINT D$"DELETE THE ADVENTURER" :  GOTO 32900   32540 if player is dead then delete THE ADVENTURER from Master disk to tell the Main Hall that no one is returning from an adventure
32550 PRINT D$"OPEN CHARACTERS, L150" :  PRINT D$"WRITE CHARACTERS, R";RE :  PRINT M$(0) :  PRINT M%(0, 1) :  PRINT M%(0, 2) :  PRINT CH :  FOR A = 0 TO 3 :  PRINT SA%(A) :  NEXT   32550 open CHARACTERS and write player data
32555 AC = M%(0, 7) * 2 :  IF SH THEN AC = AC - 1   32555 write more player data to file
32560 FOR A = 1 TO 5 :  PRINT WA%(A) :  NEXT : PRINT AE :  PRINT SE$ :  PRINT GO :  PRINT BA :  PRINT AC :  FOR A = 1 TO 4 :  PRINT WP$(A) :  FOR M = 1 TO 4 :  PRINT WD%(A, M) :  NEXT : NEXT   32560 write player weapons to file
32570 PRINT D$"OPEN THE ADVENTURER" :  PRINT D$"WRITE THE ADVENTURER" :  PRINT M$(0) :  PRINT RE :  PRINT D$"CLOSE"   32570 write player name and record number in THE ADVENTURER
32900 PRINT D$"RUN MAIN HALL"   32900 run MAIN HALL to exit program
33000 REM ..FAST START.   33000-33540 FAST.START routine
33005 HM = PEEK (115) + PEEK (116) * 256 : A = HM - 290 : A2 = INT (A / 256) :  POKE 1014, A + 1 - A2 * 256 :  POKE 1015, A2 :  HIMEM :  A : D$ = CHR$ (4) :  PRINT D$"BLOAD EAMON 7.1 SEARCH ROUTINE, A"A + 1   33005 lower the top of free memory to make a protected place for the search routine code; BLOAD the search routine
33010 ONERR GOTO 33020   33010 set ONERR vector to recover if no saved game is found
33015 PRINT D$"VERIFY GAME.PTRS" :  GOTO 29000   33015 check for presence of saved game
33020 ONERR GOTO 31000   33020 set ONERR vector to recover if no FAST.START file is found
33025 PRINT D$"VERIFY FS.PARMS" :  PRINT D$"OPEN FS.PARMS" :  PRINT D$"READ FS.PARMS" :  INPUT A :  INPUT B :  PRINT D$"CLOSE"   33025 check for presence of FAST.START PARMS; input memory freespace parms
33030 IF PEEK (105) + PEEK (106) * 256 = A AND PEEK (115) + PEEK (116) * 256 = B THEN PRINT CHR$ (4)"BLOAD FS.PTRS" :  PRINT CHR$ (4)"BLOAD FS.SVAR" :  PRINT CHR$ (4)"BLOAD FS.STR" :  POKE 216, 0 :  GOTO 31040   33030 if current memory free space matches parms then BLOAD FAST.START info; reset ONERR flag; proceed to INIT routine at 31040 to set up and start game
33035 PRINT CHR$ (4)"DELETE FS.PARMS" :  GOTO 31000   33035 (this line will be run only if present memory setup does not match FAST.START parms) delete FAST.START parms info; proceed to start of INIT routine to load artifact and monster info
33500 X = FRE (0) : A = PEEK (105) + PEEK (106) * 256 : M = PEEK (115) + PEEK (116) * 256 :  PRINT D$"OPEN FS.PARMS" :  PRINT D$"WRITE FS.PARMS" :  PRINT A :  PRINT M :  PRINT D$"CLOSE"   33500 generate current memory free space info and save as FAST.START parms info; close all files
33510 PRINT D$"BSAVE FS.PTRS, A$69, L8"   33510 BSAVE FAST.START variable pointers
33520 PRINT D$"BSAVE FS.SVAR, A"A", L" PEEK (109) + PEEK (110) * 256 - A + 1   33520 BSAVE FAST.START variables
33530 PRINT D$"BSAVE FS.STR, A" PEEK (111) + PEEK (112) * 256", L"M - PEEK (111) - PEEK (112) * 256 + 1   33530 BSAVE FAST.START strings
33540 GOTO 31040   33540 proceed to INIT routine at 31040 to set up and begin game

Eamon Adventurer's Guild Online - http://www.eamonag.org - This page was last updated on 01/01/2017.