MAGE CAGE
from Micro Adventurer, November 1983

[NOTE: It seems unusual that the program does not erase the   ]
[old position of each character as it moves around the screen,]
[but the code explicitly replaces the old position with a non-]
[space UDG, so I've left it as it is, even though I don't     ]
[think that it looks very good.                           JimG]

A 16K Spectrum graphic adventure by Quicksilva programmer Mike Moscoff. THE
AETHANES, NASTIES from the Nth Dimension, threaten to destroy Earth. You must
enter the Valley of Shadows, and find and destroy the Fusor, a weird object
that holds open the gateway between the Dimensions. The valley comprises 25
arenas, or rooms.

    Avoid or kill the evil Dragoons: there are four types - Magenta, Green,
Blue and Yellow. The Yellow Dragoons have the worst bite, and need four
strikes with the sword to kill them. Watch out for the Traps, which can
block, exhaust or kill you. Look for any useful objects (eg. the sword). To
pick them up, just touch them. To move, use the cursor keys (5-8). To use the
sword (to strike left or right), press Caps Shift and 5 or 8. Note: you must
first find the sword! To get help, press 'H' (for info about the traps).

    This program has been horribly compressed. Most numbers have been
replaced by single-letter variables: O=0, L=1, B=2, etc ... see list of
variables. Many character variables hold numeric data: "ABCD" translates to:
print trap number 1(A) using pattern 2(B) starting at position Y=3(C),
X=4(D).  FN n converts characters to numbers. FN c$ converts numbers to
characters.

    Problems: don't mistake Hs (10) for Ms (100). Lines 4400-4625 (and
others) use weird characters: @ (Symbol Shift & 2) to represent 0, / (Symbol
Shift & V) to represent 28, [ (Extended Mode, Symbol Shift & Y) to represent
27, ] (Extended Mode, Symbol Shift & U) to represent 29. Typing in lines
4400-4470 is easier if you enter the letters in groups of three: ... EYE ...
HAL. POKE 23693,7 sets INK 7, PAPER 0. POKE 23693,56 sets INK 0, PAPER 7.
POKE 23658,8 sets Capitals lock. USR 3280 scrolls up 1 line.


Program routines
  10 Initial setup & intro
  20 Setup new game
  30 Setup new room
  40 You move
  50 Alien move (or delay)
  80 Score & end checks
 100 Alien move sub-routine
 300 Your move s-r
 400 Sword fight s-r
 500 Trap action s-r
 600 Objects s-r
 670 Print obj inventory
 680 Print object
 690 Convert attr colour to object number
 700 Replace lost object
 900 Print messages s-r
1000 Lose game (or new life)
1100 Win game
1200 Scores & end
3000 Select new room
4000 Setup new room
4020 Setup traps - barriers
4030 Setup traps - mazes
4050 Setup objects
4080 Setup 'final' room
4100 Setup alien
4300 Setup you
4400 Trap patterns s-r
4600 Room data
7000 Define vars - temp
7500 Define vars - perm
7600 Define Special chars
9000 Introduction
9100 Controls display
9200 Traps info ('help')
9900 Cls & header s-r
9920 Delay s-r
9930 Wait s-r
9940 Object name s-r
9950 Trap name s-r
9960 Trap info s-r

Numeric vars
DC	remaining lives
DI	die flag
OK	win flag
PO	power (strength)
RO	room number
ROO	old room no
SC	score
ST	top score
T	alien way flag
TN	alien number
TR	trap number
TX,TY	alien x,y position
TXO,TYO	alien old pos
UX,UY	your x,y position
UXO,UYO	your old pos
B	2
C	3
D	4
E	5
F	6
G	7
H	10
I	20
J	30
K	40
L	1
M	100
O	0
V	.003
W	.01
temporary:
A, N, P, Q, X, Y

User defined chars
line	char:
 105	"D"
 106	"E"
 300	"H","B"
 301	"G","C"
 310	"B"
 315	"C"
 320	"A"
 325	"A"
1020	"D"
4080	"N"
7500	"A","D"

Alphabetic vars
K$	blank line (32 chars)
N$	message pass var
O$	objects array
Q$	trap & object colours
R$	room path array
S$,T$	alien chars (new,old)
U$,W$	your chars (new,old)
Z$	INKEY$ response
temporary:
A$, B$, N$, Z$
