! *********************************************************
! * *
! * WIZARD'S CASTLE GAME FROM JULY/AUGUST 1980 *
! * ISSUE OF RECREATIONAL COMPUTING MAGAZINE *
! * WRITTEN FOR EXIDY SORCEROR BY JOSEPH R. POWER *
! * MODIFIED FOR HEATH MICROSOFT BASIC BY J. F. STETSON *
! * REWRITTEN FOR GRAHAM NELSON'S INFORM BY ADAM *
! * BILTCLIFFE WITH HELP FROM THE FOLKS ON IFMUD *
! * *
! * You may distribute this in any way provided its *
! * origin remains accurately represented. *
! * *
! *********************************************************
Global mode;
Constant classic 1;
Constant normal 2;
Constant stats 3;
Constant map 4;
Global deadflag;
Global mapok; ! Ok for statusline to display the map
Array caps_array -> 1300; ! For printing to while capitalising stuff
! May need enlarging if any blocks of really
! big text are added (at the moment, the largest
! is the mode select screen)
Array map_articles --> "AN " "an " "the " "" "" "a " "a "
"" "" "a " "a " "a " "a " "a "
"an " "a " "a " "an " "a " "a " "a "
"a " "a " "a " "a " "a " "the " "the "
"the " "the " "the " "the " "the " "the ";
print (srom) "^Are you foolish enough to want to play again? ";
if (YesNo()) {
print (srom) "^Some ",
(srom) race_names-->(player.race-1),
(srom) "s never learn!^^Please be patient while the castle is restocked.^";
} else quitflag=1;
} until (quitflag==1);
print (srom) "^Maybe dumb ",
(srom) race_names-->(player.race-1),
(srom) " is not so dumb after all!^^";
];
[ GetMode;
mode=0;
do {
@erase_window -1;
print (sund) "^Wizard's Castle",
(srom) " game from July/August 1980 issue of ",
(sund) "Recreational Computing",
(srom) " magazine^^Written for Exidy Sorceror by ",
(sbold) "Joseph R. Power",
(srom) "^^Modified for Heath Microsoft BASIC by ",
(sbold) "J. F. Stetson",
(srom) "^^Rewritten for ",
(sbold) "Graham Nelson",
(srom) "'s Inform by ",
(sbold) "Adam Biltcliffe",
(srom) " with help from the folks on ",
(sund) "ifMUD",
(srom) ".^^";
! Some people may claim I went overboard with the use of bold and
! underline. Well, sue me =P
print (srom) "Do you want to play in Classic mode, Normal mode,
Statistician mode or Cartographer mode?^^Classic mode
is as close as possible to the original text, including typos and
miscellaneous ugliness. If you're not on a nostalgia trip, normal
mode contains less typos and presents a few things (such as the
final game summary) in a slightly neater way. Statistician mode
is similar to normal mode but uses the status line to display your
attributes and equipment instead of printing them out at the start
of each turn. Cartographer mode ('m'ap mode) uses the status line to
display a map of the current dungeon level.^^The other notable difference is in the coordinate
systems. In the original game, the 'x' axis was the vertical axis,
and the 'y' axis the horizontal. All the new versions use the
normally-accepted axes. This change manifests itself only in the
displaying of coordinates and in teleporting, so the only thing to
bear in mind is that whichever mode you are playing in, you simply
need to enter the coordinates when teleporting in the same order as
they are printed.^^Enter C, N, S or M to select mode: ";
GetInput(1);
switch(input->2) {
'C': mode=classic;
'N': mode=normal;
'S': mode=stats;
'M': mode=map;
}
} until (mode);
if (mode==classic) {
race_articles-->1="a ";
weapon_names-->0="no weapon";
armor_names-->0="no armor";
}
];
[ TitleScreen;
@erase_window -1;
if (mode==stats) print (srom) "^^^^^^"; ! Otherwise the statusline overwrites it
if (mode==map) print (srom) "^^^^^^^^";
stars();
print (sbold) "^ * * * THE WIZARD'S CASTLE * * * ^";
stars();
print (srom) "^Many cycles ago, in the kingdom of N'Dic, the gnomic^wizard Zot forged his great ",
(sund) "Orb of Power",
(srom) ". He soon^vanished, leaving behind his vast
subterranean castle^filled with esurient monsters, fabulous
treasures and^the incredible ",
(sund) "Orb of Zot",
(srom) ". From that time hence, many^a bold
youth has ventured into the Wizard's castle. As^of now, ",
(sbold) "none",
(srom) " has ever emerged victoriously! Beware!!^";
];
[ EmptyLevel i;
for (i=0:i<512:i++) {
level->i=101;
}
level->3=102;
];
[ PlaceStairs lindex i;
for (lindex=1:lindex<8:lindex++) {
for (i=1:i<3:i++) {
RndEmptyRoomLev(lindex);
level->Cellnum(found_room.x, found_room.y, lindex)=104; ! Down
level->Cellnum(found_room.x, found_room.y, lindex+1)=103; ! Up
}
}
];
[ PlaceThings lindex i j;
for (lindex=1:lindex<=8:lindex++) {
! place monsters
for (i=13:i<=24:i++) {
RndEmptyRoomLev(lindex);
level->Cellnum(found_room.x, found_room.y, lindex)=i+100;
}
! place features
for (i=105:i<=112:i++) {
for (j=0:j<3:j++) {
RndEmptyRoomLev(lindex);
level->Cellnum(found_room.x, found_room.y, lindex)=i;
}
}
! place vendors
for (j=0:j<3:j++) {
RndEmptyRoomLev(lindex);
level->Cellnum(found_room.x, found_room.y, lindex)=125;
}
}
];
[ InitPlayer i ptoadd stat ok rmonster;
player.freepts=8;
player.race=0;
player.gold=0;
player.flares=0;
player.st=0;
player.dx=0; ! These need to be zeroed now if in stats mode
player.iq=0;
player.treasures=0;
player.weaponclass=0;
player.armorclass=0;
player.lamp=0;
print (srom) "^All right, bold one.^";
do {
print (srom) "You may be an elf, dwarf, man or hobbit.^^Your choice? ";
GetInput(1);
switch(input->2) {
'E': player.race=2; player.st=6; player.dx=10;
'D': player.race=4; player.st=10; player.dx=6;
'M': player.race=3; player.st=8; player.dx=8;
'H': player.race=1; player.st=4; player.dx=12; player.freepts=4;
default: print (sbold) "^** That was incorrect.
Please type E, D, M or H.^";
}
} until (player.race);
player.iq=8;
player.sex=-1; ! 0 is male, 1 is female;
new_line;
do {
print (srom) "Which sex ";
if (mode==classic) print (srom) "t"; else print (srom) "d";
print (srom) "o you prefer? ";
GetInput(1);
switch(input->2) {
'M': player.sex=0;
'F': player.sex=1;
default: print (sbold) "** Cute, ",
(sbold) race_names-->(player.race-1),
(sbold) ", real cute. Try M or F.^";
}
} until (player.sex~=-1);
if (mode==stats) {
print (srom) "^Ok, ",
(srom) race_names-->(player.race-1),
(srom) ", you have ",
(nrom) player.freepts,
(srom) " points to allocate to your stats as you wish.^^";
} else {
print (srom) "^Ok, ",
(srom) race_names-->(player.race-1),
(srom) ", you have the following attributes:^Strength = ",
(nrom) player.st,
(srom) " Intelligence = ",
(nrom) player.iq,
(srom) " Dexterity = ",
(nrom) player.dx,
(srom) "^and ",
(nrom) player.freepts,
(srom) " other points to allocate as you wish.^^";
}
for (i=0:i<3:i++) {
if (player.freepts) {
ok=0;
do {
switch (i) {
0: stat=st;
1: stat=iq;
2: stat=dx;
}
print (srom) "How many points do you wish to add to your ",
(statname) stat,
(srom) "? ";
ptoadd=GetNumber();
! At present entering -1 here is treated as 0;
if (ptoadd<=player.freepts) {
(player.stat)=(player.stat)+ptoadd;
(player.freepts)=(player.freepts)-ptoadd;
ok=1;
} else {
print (sbold) "^** ";
}
} until (ok==1);
}
}
player.gold=60;
print (srom) "^Ok, ",
(srom) race_names-->(player.race-1),
(srom) ", you have 60 gold pieces (GP's).^";
player.armorclass=-1;
do {
print (srom) "These are the types of armor you can buy:^
Plate<30> Chainmail<20> Leather<10> Nothing<0>^^
Your choice? ";
GetInput(1);
switch(input->2) {
'P': player.armorclass=3;
'C': player.armorclass=2;
'L': player.armorclass=1;
'N': player.armorclass=0;
default: rmonster=random(12)+12;
print (sbold) "^** Are you ",
(sbold) race_articles-->(player.race-1),
(sbold) race_names-->(player.race-1), (sbold) " or ",
(sbold) map_articles-->(rmonster),
(sbold) map_names-->(rmonster), (sbold) "?^^";
}
} until (player.armorclass>=0);
player.gold=player.gold-(player.armorclass*10);
player.armorhealth=(player.armorclass*7);
print (srom) "^Ok, bold ",
(srom) race_names-->(player.race-1),
(srom) ", you have ",
(nrom) player.gold,
(srom) " GP's left.^";
player.weaponclass=-1;
do {
print (srom) "These are the types of weapons you can buy:^
Sword<30> Mace<20> Dagger<10> Nothing<0>^^
Your choice? ";
GetInput(1);
switch(input->2) {
'S': player.weaponclass=3;
'M': player.weaponclass=2;
'D': player.weaponclass=1;
'N': player.weaponclass=0;
default: print (sbold) "^** Is your IQ really ", (nbold) player.iq,
(sbold) "?^^";
}
} until (player.weaponclass>=0);
player.gold=player.gold-(player.weaponclass*10);
player.lamp=0;
player.flares=0;
if (player.gold>=20) {
print (srom) "^Do you want to buy a lamp for 20 GP's? ";
if (YesNo()) {
player.lamp=1;
player.gold=player.gold-20;
}
}
if (player.gold) {
ok=0;
print (srom) "^Ok, ",
(srom) race_names-->(player.race-1),
(srom) ", you have ",
(nrom) player.gold,
(srom) " gold pieces left.^";
do {
print (srom) "^Flares cost 1 GP each. How many do you want? ";
player.flares=GetNumber();
if (player.flares<=player.gold) {
ok=1;
player.gold=player.gold-player.flares;
} else {
print (sbold) "^** You can only afford ",
(nbold) player.gold,
(sbold) ".^";
}
} until (ok==1);
}
player.x=4; player.y=1; player.z=1;
player.turns=1; player.vendorenemy=0; player.blind=0;
player.stickybook=0; player.justteleported=0; player.lastmeal=0;
print (srom) "^Ok, ",
(srom) race_names-->(player.race-1),
(srom) ", you are now ",
(sbold) "entering the castle!^";
mapok=1;
];
[ Play i;
deadflag=0;
NewRoom();
while (deadflag==0) {
player.turns=player.turns+1;
UpdateCurses();
if (random(5)==1) FlavourText();
TreasureEffects();
print (srom) "^Enter your command : ";
GetInput(2);
switch(input->2) {
'N', 'S', 'E', 'W': Move();
'U': Stairs();
'D': if (input->3=='R') Drink(); else Stairs();
'M': PrintMap();
'F': Flare();
'L': UseLamp();
'O': Open();
'G': Gaze();
'T': Teleport();
'Q': print (srom) "^Do you really want to quit now? ";
if (YesNo()) deadflag=3; else {
print (sbold) "^** Then don't say that you do!^";
}
'H': PrintHelp();
default: print (sbold) "^** Silly ",
(sbold) race_names-->(player.race-1),
(sbold) ", that wasn't a valid command!^";
}
}
switch (deadflag) {
1:
stars();
print (srom) "^A noble effort, oh formerly living ",
(srom) race_names-->(player.race-1),
(srom) "!^^You died due to lack of ";
if (player.st<1) print (srom) "strength";
if (player.iq<1) print (srom) "intelligence";
if (player.dx<1) print (srom) "dexterity";
print (srom) ".^^At the time you died, you had:^";
2, 3:
if (deadflag==2) {
print (srom) "^You left the castle with";
if (~~orb.found) print (srom) "out";
print (srom) " the ",
(sund) "Orb of Zot",
(srom) ".^";
}
if (orb.found&&deadflag==2) {
print (sbold) "^An incredibly glorious victory!!^";
print (srom) "^In addition, you got out with the following:^";
} else {
if (mode==classic||deadflag==2) {
print (srom) "^When you left the castle, you had:^";
} else {
print (srom) "^At the point you quit, you had:^";
}
}
print (srom) "Your miserable life!^";
}
for (i=0:i<8:i++) {
if (treasures_collected->i) {
print (srom) map_articles-->(i+26),
(srom) map_names-->(i+26),
(srom) "^";
}
}
if (mode==classic) {
print (srom) weapon_names-->(player.weaponclass),
(srom) " and ",
(srom) armor_names-->(player.armorclass);
if (player.lamp==1) print (srom) " and a lamp^"; else new_line;
} else {
if (player.weaponclass)
print (srom) "a ",
(srom) weapon_names-->(player.weaponclass);
if (player.armorclass) {
if (player.weaponclass) {
if (player.lamp) print (srom) ", "; else print (srom) " and ";
}
print (srom) armor_names-->(player.armorclass), (srom) " armor";
}
if (player.lamp) {
if (player.weaponclass+player.armorclass) print (srom) " and ";
print (srom) "a lamp";
}
if (player.weaponclass+player.armorclass+player.lamp) new_line;
}
if (mode~=classic&&deadflag==1&&(~~player.treasures)&&(~~
(player.weaponclass+player.armorclass+player.lamp)))
print (srom) "no treasure or weapons^";
print (srom) "You also had ",
(nrom) player.flares,
(srom) " flares";
if (mode~=classic&&runestaff.found) print (srom) ", "; else print (srom) " and ";
print (nrom) player.gold,
(srom) " gold pieces";
if (runestaff.found) {
print (srom) " and the ", (sund) "Runestaff";
}
print (srom) "^^And it took you ",
(nrom) player.turns,
(srom) " turns!^";
];
[ UpdateCurses i ccur;
if (runestaff.found+orb.found) return;
if (lethargy.active>treasures_collected->0) player.turns++;
if (leech.active>treasures_collected->2) player.gold=player.gold-random(5);
if (player.gold<0) player.gold=0;
if (forgetting.active>treasures_collected->4) {
RndRoom();
(level->Cellnum(found_room.x, found_room.y, found_room.z))=(Contents
(level->Cellnum(found_room.x, found_room.y, found_room.z))+100);
}
for (i=0:i<3:i++) {
switch(i) {
0: ccur=lethargy;
1: ccur=leech;
2: ccur=forgetting;
}
if (player.x==ccur.x&&player.y==ccur.y&&player.z==ccur.z) {
ccur.active=1; ! ha ha ha
}
}
];
[ FlavourText t;
t=random(7);
if (player.blind&&(t==1)) t=2;
switch(t) {
1: print (srom) "^You see a bat fly by.^";
2: print (srom) "^You stepped on a frog!^";
3: print (srom) "^You sneezed!^";
4: print (srom) "^You feel like you're being watched!^";
5: print (srom) "^You hear faint rustling noises.^";
6: print (srom) "^You hear ";
t=random(4);
switch(t) {
1: print (srom) "thunder.^";
2: print (srom) "footsteps.^";
3: print (srom) "a scream!^";
4: print (srom) "a wumpus!^";
}
7: t=random(12)+12;
print (srom) "^You smell ",
(srom) map_articles-->t,
(srom) map_names-->t,
(srom) " frying!^";
}
];
[ TreasureEffects;
if (player.blind&&treasures_collected->3) {
player.blind=0;
print (srom) "^The opal eye cures your blindness!^";
}
if (player.stickybook&&treasures_collected->5) {
player.stickybook=0;
print (srom) "^The blue flame dissolves the book!^";
}
];
[ NewRoom;
PrintStatus();
print (srom) "^Here you find ",
(srom) map_articles-->Contents(level->Cellnum(player.x, player.y,
player.z)),
(srom) map_names-->Contents(level->Cellnum(player.x, player.y,
player.z)),
(srom) ".^";
! Mark room visited
level->Cellnum(player.x, player.y, player.z)=
Contents(level->Cellnum(player.x, player.y, player.z));
switch(level->Cellnum(player.x,player.y, player.z)) {
1 to 6, 11, 12: return; ! empty,entrance,stairs,pool,chest,orb,book
7: player.gold=player.gold+random(10); EmptyPlayerLocation();
print (srom) "^You now have ",
(nrom) player.gold,
(srom) ".^"; return;
8: player.flares=player.flares+random(5); EmptyPlayerLocation();
print (srom) "^You now have ",
(nrom) player.flares,
(srom) ".^"; return;
9: if (player.x==orb.x&&player.y==orb.y&&player.z==orb.z) {
if (player.justteleported) {
print (sbold) "^Great Unmitigated Zot!^^You just found ***",
(sund) "the Orb of Zot",
(sbold) "***!^",
(srom) "^The ",
(sund) "Runestaff",
(srom) " has disappeared.^";
orb.x=0; orb.found=1; runestaff.found=0;
EmptyPlayerLocation();
} else {
Move();
}
} else {
player.x=random(8);
player.y=random(8);
player.z=random(8);
NewRoom();
}
return;
10: player.z=Wrap(player.z+1);
NewRoom();
return;
26 to 33:
treasures_collected->((level->Cellnum(player.x,player.y, player.z))
-26) =1;
EmptyPlayerLocation();
player.treasures=player.treasures+1;
print (srom) "^It's now yours!^"; return;
}
Creature();
];
[ PBlind;
if (player.blind) {
print (sbold) "^** You can't see anything, you dumb ",
(sbold) race_names-->(player.race-1),
(sbold) "!^";
rtrue;
}
rfalse;
];
[ PrintHelp;
@erase_window -1;
if (mode==stats) print (srom) "^^^^^^";
if (mode==map) print (srom) "^^^^^^^^";
print (sbold) "*** Wizard's Castle Command and Information Summary ***^";
print (srom) "^The following commands are available :^^";
if (mode==classic) {
print (srom) "h/elp n/orth s/outh e/ast w/est u/p^
d/own dr/ink m/ap f/lare l/amp o/pen^
g/aze t/eleport q/uit^";
} else {
print (srom) "Help North South East West Up^
Down DRink Map Flare Lamp Open^
Gaze Teleport Quit^";
}
print (srom) "^The contents of rooms are as follows :^^
. = Empty room B = Book C = Chest^
D = Stairs down E = Entrance/Exit F = Flares^
G = Gold pieces M = Monster O = Crystal orb^
P = Magic pool S = Sinkhole T = Treasure^
U = Stairs up V = Vendor W = Warp/Orb^^
The benefits of having treasures are :^^
Ruby red - avoid lethargy Pale pearl - avoid leech^
Green gem - avoid forgetting Opal eye - cures blindness^
Blue flame - dissolves books Norn stone - no benefit^
Palantir - no benefit Silmaril - no benefit^^
Press return when ready to resume, ",
(srom) race_names-->(player.race-1),
(srom) ". ";
GetInput(1);
];
[ Teleport;
if (runestaff.found) {
print (srom) "^X-coordinate? ";
if (mode==classic) player.y=GetCoord(); else player.x=GetCoord();
print (srom) "^Y-coordinate? ";
if (mode==classic) player.x=GetCoord(); else player.y=GetCoord();
print (srom) "^Z-coordinate? ";
player.z=GetCoord();
player.justteleported=1;
NewRoom();
player.justteleported=0;
} else {
print (sbold) "^** You can't teleport without the ",
(sund) "Runestaff",
(sbold) "!^";
}
];
[ PrintMap xs ys t;
if (PBlind()) return;
if (mode==map) {
print (sbold) "^** You can already see the map!^";
return;
}
font off; new_line;
! No printing rules here
for (ys=1:ys<=8:ys++) {
for (xs=1:xs<=8:xs++) {
t=level->Cellnum(xs, ys, player.z);
if (t>99) t=0;
if (player.x==xs&&player.y==ys) {
print "<", (char) map_symbols->t, "> ";
} else {
print " ", (char) map_symbols->t, " ";
}
}
print "^^";
}
font on;
print (srom) "You are at ", (crom) player, (srom) ".^";
];
[ Gaze r;
if (PBlind()) return;
if (level->Cellnum(player.x, player.y, player.z)~=11) {
print (sbold) "^** It's hard to gaze without an orb!^";
return;
}
r=random(13)+12;
print (srom) "^You see ";
switch(random(6)) {
1: print (srom) "a soap opera rerun!^";
2: print (srom) "yourself in a bloody heap!^";
player.st=player.st-random(2);
if (player.st<1) deadflag=1;
3: print (srom) map_articles-->r,
(srom) map_names-->r,
(srom) " gazing back at you!^";
4: print (srom) "yourself drinking from a pool and becoming ",
(srom) map_articles-->r,
(srom) map_names-->r,
(srom) "!^";
5: RndRoom();
r=Contents(level->Cellnum(found_room.x, found_room.y, found_room.z));
print (srom) map_articles-->r,
(srom) map_names-->r,
(srom) " at ",
(crom) found_room,
(srom) ".^";
6: print (sbold) "***",
(sund) "the Orb of Zot",
(sbold) "***",
(srom) " at ";
if ((mode==classic&&random(8)<4)||(mode~=classic&&random(2)==1)) {
print (crom) orb;
} else {
RndRoom();
print (crom) found_room;
}
print (srom) "!^";
}
];
[ Stairs t;
t=level->Cellnum(player.x, player.y, player.z);
if (input->2=='U'&&t==3) {
player.z=player.z-1;
NewRoom();
return;
}
if (input->2=='D'&&t==4) {
player.z=player.z+1;
NewRoom();
return;
}
print (sbold) "^** There are no stairs going ";
if (input->2=='U') print (sbold) "up"; else print (sbold) "down";
print (sbold) " from here!^";
];
[ Flare fx fy t;
if (PBlind()) return;
if (~~player.flares) {
print (sbold) "^** Hey, bright one, you're out of flares!^";
return;
}
player.flares=player.flares-1;
! No printing rules
if (mode~=map) { font off; new_line; }
for (fy=-1:fy<=1:fy++) {
for (fx=-1:fx<=1:fx++) {
t=Contents(level->Cellnum(Wrap(player.x+fx),Wrap(player.y+fy),
player.z));
level->Cellnum(Wrap(player.x+fx),Wrap(player.y+fy),player.z)=t;
if (mode~=map) print " ", (char) map_symbols->t, " ";
}
if (mode~=map) print "^^";
}
if (mode~=map) {
font on;
print (srom) "You are at ", (crom) player, ".^";
}
if (mode~=classic) {
print (srom) "^You have ";
if (player.flares) print (nrom) player.flares; else print (srom) "no";
print (srom) " flares left.^";
}
];
[ UseLamp lx ly t;
if (PBlind()) return;
if (~~player.lamp) {
print (sbold) "^** You don't have a lamp, ",
(sbold) race_names-->(player.race-1),
(sbold) "!^";
return;
}
print (srom) "^Where do you want to shine the lamp (N,S,E,W)? ";
GetInput(1);
lx=0; ly=0;
switch (input->2) {
'N': ly=-1;
'S': ly=1;
'E': lx=1;
'W': lx=-1;
default:
print (sbold) "^** That's not a direction, ",
(sbold) race_names-->(player.race-1),
(sbold) "!^";
}
if (~~(lx+ly)) return;
lx=Wrap(lx+player.x);
ly=Wrap(ly+player.y);
found_room.x=lx; found_room.y=ly; found_room.z=player.z;
print (srom) "^The lamp shines into ", (crom) found_room;
t=Contents(level->Cellnum(lx,ly,player.z));
level->Cellnum(lx,ly,player.z)=t;
print (srom) ".^^There you will find ",
(srom) map_articles-->t,
(srom) map_names-->t,
(srom) ".^";
];
[ Drink t;
if (level->Cellnum(player.x, player.y, player.z)~=5) {
print (sbold) "^** If you want a drink, find a pool!^";
return;
}
print (srom) "^You take a drink and ";
switch (random(8)) {
1: print (srom) "feel stronger.^";
player.st=Limit(player.st+random(3));
2: print (srom) "feel smarter.^";
player.iq=Limit(player.iq+random(3));
3: print (srom) "feel nimbler.^";
player.dx=Limit(player.dx+random(3));
4: print (srom) "feel weaker.^";
player.st=player.st-random(3);
if (player.st<1) deadflag=1;
5: print (srom) "feel dumber.^";
player.iq=player.iq-random(3);
if (player.iq<1) deadflag=1;
6: print (srom) "feel clumsier.^";
player.dx=player.dx-random(3);
if (player.dx<1) deadflag=1;
7: do t=random(4); until (t~=player.race);
player.race=t;
print (srom) "become ",
(srom) race_articles-->(player.race-1),
(srom) race_names-->(player.race-1),
(srom) ".^";
8: player.sex=1-player.sex;
print (srom) "turn into a ";
if (player.sex) print (srom) "fe";
print (srom) "male ",
(srom) race_names-->(player.race-1),
(srom) ".^";
}
];
[ Open;
switch(level->Cellnum(player.x, player.y, player.z)) {
6: OpenChest();
12: OpenBook();
default:
print (sbold) "^** The only thing opened was your big mouth!^";
}
];
[ OpenChest t;
print (srom) "^You open the chest and ";
if (mode==classic) new_line;
switch(random(4)) {
1:
print (sbold) "KABOOM!",
(srom) " it explodes!!^";
DamagePlayer(random(6));
if (player.st<=0) deadflag=1;
2, 3:
t=random(999)+1; ! Easy way out of plural problems
print (srom) "find ",
(nrom) t,
(srom) " gold pieces!^";
player.gold=player.gold+t;
if (player.gold>30000) player.gold=30000;
4:
print (srom) "... gas! You stagger from the room!^";
player.turns=player.turns+20;
input->2=random('N','S','E','W');
Move();
}
EmptyPlayerLocation();
];
[ OpenBook;
print (srom) "^You open the book and ";
if (mode==classic) new_line;
switch(random(6)) {
1:
print (sbold) "FLASH!",
(srom) " Oh no! You are now a blind ",
(srom) race_names-->(player.race-1),
(srom) "!^";
player.blind=1;
2: print (srom) "it's another volume of Zot's poetry! - Yech!!^";
3: print (srom) "it's an old copy of Play",
(srom) race_names-->(random(4)-1),
(srom) "!^";
4: print (srom) "it's a manual of strength!^";
player.st=18;
5: print (srom) "it's a manual of dexterity!^";
player.dx=18;
6: print (srom) "the book sticks to your hands -^Now you are unable to
draw your weapon!^";
player.stickybook=1;
}
EmptyPlayerLocation();
];
! Everything is printed with a rule, so that classic mode can capitalise
! everything and not use colours
[ srom msg i l t;
if (mode~= classic) { print (string) msg; return; }
! Now begins the evil process of capitalising strings
t=msg.print_to_array(caps_array);
for (i=2:i<=t+1:i++) {
l=caps_array->i;
if (l>96&&l<123) print (char) l-32; else print (char) l;
}
];