1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-14 06:31:16 +00:00

zmachine experiments

This commit is contained in:
Steven Hugg 2020-07-06 18:53:20 -05:00
parent 0f284531db
commit 741df9f5b8
34 changed files with 59739 additions and 28 deletions

View File

@ -51,6 +51,7 @@ The IDE uses custom forks for many of these, found at https://github.com/sehugg?
* https://github.com/floooh/chips
* https://github.com/DrGoldfire/Z80.js
* http://www.twitchasylum.com/jsvecx/
* https://github.com/curiousdannii/ifvms.js/
### Compilers
@ -60,6 +61,7 @@ The IDE uses custom forks for many of these, found at https://github.com/sehugg?
* https://github.com/batari-Basic/batari-Basic
* https://www.veripool.org/wiki/verilator
* http://mcpp.sourceforge.net/
* http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform6.html
### Assemblers/Linkers

View File

@ -568,4 +568,49 @@ div.asset_toolbar {
font-family: "Andale Mono", "Menlo", "Lucida Console", monospace;
font-size: 10pt;
line-height: 1.2;
}
}
.transcript {
background-color: #fff;
width: 100%;
padding: 1.25em;
user-select: text;
font-family: Verdana, Geneva, sans-serif;
}
.transcript-line {
line-height: 1.5;
min-height: 1em;
white-space: pre-wrap;
}
.transcript-style-1 {
font-style: italic;
}
.transcript-style-2 {
white-space: pre-wrap; /* css-3 */
font-family: "Andale Mono", "Menlo", "Lucida Console", monospace;
line-height: 1;
min-height: 0;
}
.transcript-style-4 {
font-weight: bold;
}
.transcript-style-8 { /* input */
font-weight: bold;
font-variant: small-caps;
color: #6666ff;
background-color: #eeeeff;
padding: 0.25em;
padding-left: 0.5em;
padding-right: 0.5em;
}
.transcript-reverse {
background-color: #666;
color: #ddd;
}
.transcript-input {
margin:1%;
font-weight: bold;
font-variant: small-caps;
color: #6666ff;
background-color: #eeeeff;
}

View File

@ -218,6 +218,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<li><a class="dropdown-item" href="?platform=atari8-5200.mame">Atari 5200 (MAME)</a></li>
<li><a class="dropdown-item" href="?platform=vector-ataricolor">Atari Color Vector (6502)</a></li>
<li><a class="dropdown-item" href="?platform=markdown">Markdown</a></li>
<li><a class="dropdown-item" href="?platform=zmachine">Z-Machine (Inform 6)</a></li>
</ul>
</li>
</ul>
@ -311,6 +312,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<!-- emulator video -->
<div id="emuscreen">
</div>
<!-- for Javatari only -->
<div id="javatari-div" style="float:center;margin:10px;display:none">
<div id="javatari-screen" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
<div id="javatari-console-panel" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
@ -538,6 +540,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<script src="codemirror/mode/gas/gas.js"></script>
<script src="src/codemirror/6502.js"></script>
<script src="src/codemirror/bataribasic.js"></script>
<script src="src/codemirror/inform6.js"></script>
<link rel="stylesheet" href="css/codemirror.css">
<script src="codemirror/addon/edit/matchbrackets.js"></script>
<script src="codemirror/addon/search/search.js"></script>

3
lib/zvm/ifvms.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4003
presets/zmachine/advent.inf Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,873 @@
! ----------------------------------------------------------------------------
! Adventureland 961111 One of the standard Inform 6 example games
!
! Designed by Scott Adams: c. 1979
! Ported to Inform: 16.10.94
! Slightly corrected: 11.5.96
! Modernised to Inform 6 and library 6/1 or later: 11.11.96
! ----------------------------------------------------------------------------
Constant Story "ADVENTURELAND";
Constant Headline
"^An Interactive Classic by Scott Adams (circa 1979/80)^";
Release 1;
Serial "961111";
Constant MAX_CARRIED = 6;
Constant MAX_SCORE = 100;
Replace BurnSub;
Include "Parser";
Include "VerbLib";
Global genie_gifts;
Global dark_warning;
Class Treasure
with depositpoints 7,
after
[; Take: if (location==Inside_Stump) "Taken!";
Drop: if (location==Inside_Stump) "Safely deposited.";
];
Class Sign
with name "sign",
short_name
[; print "sign reads- ", (object) self; rtrue;
],
has static;
Class ScottRoom
with initial
[; give self ~visited;
],
describe
[ i c d; print (string) self.description;
print "^^Obvious exits: ";
for (i=n_to: i<=d_to: i++)
if (self.i ~= 0) c++;
if (c==0) print "none!";
else
{ for (i=n_to: i<=d_to: i++)
if (self.i ~= 0)
{ if (d++>0) print ", ";
if (i==n_to) print "North";
if (i==s_to) print "South";
if (i==e_to) print "East";
if (i==w_to) print "West";
if (i==u_to) print "Up";
if (i==d_to) print "Down";
}
print ".";
}
new_line;
c=0; d=0;
objectloop (i in self)
if (i ~= player) { c++; give i concealed; }
if (c==0) rtrue;
print "^You can also see: ";
objectloop (i in self)
if (i ~= player)
{ if (d++>0) print " - "; PrintShortName(i);
}
new_line; rtrue;
];
[ GamePreRoutine i c d;
if (action~=##Inv) rfalse;
c=0; d=0;
objectloop (i in player) c++;
if (c==0) "You're carrying nothing.";
print "You're carrying:^";
objectloop (i in player)
{ if (d++>0) print " - "; PrintShortName(i);
}
new_line; rtrue;
];
[ GamePostRoutine i;
if (action==##Look)
objectloop (i in location)
if (i ~= player && i has concealed)
give i ~concealed;
rfalse;
];
! ----------------------------------------------------------------------------
! Into Adventureland...
! ----------------------------------------------------------------------------
ScottRoom Lake_Shore "Lakeside"
with description "You're on the shore of a lake.",
n_to Forest, s_to Lake_Shore, w_to Dismal_Swamp,
d_to Quicksand,
before
[; Swim: "Below you and before the lake is quicksand.";
],
has light;
Object -> water "water"
with name "water", article "some",
before
[; Drink: "Boy, that really hit the spot.";
Take: if (bottle notin player)
"You have nothing in which to carry the water.";
<<Fill bottle>>;
Insert: if (second == bottle) <<Fill bottle>>;
"You have nothing in which to carry the water.";
Receive: if (noun == bottle) <<Fill bottle>>;
remove noun; CDefArt(noun); " washes away into the lake.";
],
has scenery;
Treasure -> "*GOLDEN FISH*"
with name "gold" "golden" "fish",
each_turn
[; if (self notin player) rfalse;
if (net notin player && random(100) <= 75)
{ move self to Lake_Shore;
"^The fish escape back to the lake.";
}
if ((water_in_the_bottle notin bottle
|| bottle notin player) && random(100)<=50)
{ remove self; move dead_fish to player;
"^Too dry. Fish die.";
}
];
Object -> axe "rusty axe (magic word- BUNYON -on it)"
with name "rusty" "axe",
description "The magic word BUNYON is written on the haft.";
Sign -> "NO SWIMMING ALLOWED";
Object dead_fish "dead fish"
with name "dead" "fish"
has edible;
ScottRoom Quicksand "Bog"
with description "You're in a quick-sand bog.",
before
[; Swim: if (child(player)==nothing)
{ PlayerTo(Lake_Shore); rtrue; }
"Something's too heavy.";
],
has light;
Treasure -> ox "*SMALL STATUE OF A BLUE OX*"
with name "ox" "blue" "small" "statue";
ScottRoom Forest "Forest"
with description "You're in a forest.",
n_to Forest, s_to Forest, e_to Sunny_Meadow, w_to Forest,
u_to trees
has light;
Object -> trees "trees"
with name "tree" "trees",
before
[; Climb: <<Enter self>>;
],
door_to Up_Oak, door_dir u_to
has open door static;
ScottRoom Up_Oak "Branch"
with description "You're in a branch on the top of an old oak tree.^
To the east you see a meadow beyond a lake.",
d_to Forest,
has light;
ScottRoom Sunny_Meadow "Meadow"
with description "You're in a sunny meadow.",
n_to Lake_Shore, s_to Dismal_Swamp, e_to Lake_Shore,
w_to Forest,
has light;
Object -> dragon "sleeping Dragon"
with name "dragon" "sleeping" "sleepy",
before
[; WakeOther: deadflag=1; "The dragon wakes!";
],
life
[; Order, Answer, Ask: "Shh! You don't want to wake the dragon.";
Give: "The dragon is too drowsy to notice.";
ThrowAt: if (noun==axe)
{ move axe to location; "The dragon isn't bothered."; }
],
each_turn
[; if (mud in location && random(100)<=50)
{ deadflag=1;
"Dragon smells something - awakens - attacks you!";
}
],
has animate;
Sign -> "IN SOME CASES MUD IS GOOD, IN OTHERS...";
Treasure eggs "*DRAGON EGGS* (very rare)"
with name "dragon" "eggs" "very" "rare", depositpoints 12;
Object gore "smoking hole - pieces of dragon and gore"
with name "gore" "hole" "dragon" "smoking"
has static;
ScottRoom Hidden_Grove "Grove"
with description "You're in a hidden grove.",
n_to Forest, e_to Dismal_Swamp, w_to Forest,
has light;
Treasure -> "*JEWELLED FRUIT*"
with name "jewelled" "jewel" "fruit",
after
[; Eat: "Boy that really hit the spot!"; ],
has edible;
Sign -> "PAUL'S PLACE";
ScottRoom Dismal_Swamp "Dismal Swamp"
with description "You're in a dismal swamp.",
n_to Sunny_Meadow, s_to Dismal_Swamp, e_to Dismal_Swamp,
w_to Hidden_Grove, in_to 0, u_to cypress_tree
has light;
Object -> cypress_tree "cypress tree"
with name "cypress" "tree",
before
[; Climb: <<Enter self>>;
Cut: if (axe notin player) rfalse;
remove self; move tree_remains to Dismal_Swamp;
Dismal_Swamp.in_to = tree_remains;
Dismal_Swamp.u_to = 0;
print "TIMBER..";
if (keys in Tree_Top)
{ remove keys;
". Something fell from the treetop and vanished!";
}
".";
],
door_to Tree_Top, door_dir u_to
has open door static;
Object -> mud "evil smelling mud"
with name "evil" "smelling" "mud", article "some",
after
[ f; Take:
if (infected_bites in player) { remove infected_bites; f=1; }
if (chigger_bites in player) { remove chigger_bites; f=1; }
if (f==1) "Boy that really hit the spot!";
],
each_turn
[; if (self notin player) rtrue;
if (random(100)<=5 &&
(bottle notin player || water_in_the_bottle notin bottle))
{ move self to Dismal_Swamp;
"The mud dried up and fell off.";
}
];
Object -> gas "swamp gas"
with name "swamp" "gas", article "some",
before
[; Take:
if (distended_bladder in player) "Bladder full already.";
if (wine_bladder notin player) "You have nothing suitable.";
<<Insert self wine_bladder>>;
Insert:
if (second == distended_bladder) "The bladder's full.";
if (second ~= wine_bladder)
"That won't hold gas.";
move distended_bladder to player; remove wine_bladder;
itobj = distended_bladder;
"The bladder distends with swamp gas.";
],
has static;
Object -> slime "floating patch of oily slime"
with name "patch" "oil" "slime" "oily",
before
[; Take: brass_lantern.time_left=125; give brass_lantern general;
remove self; move brass_lantern to player;
"Magic oil attracts magic lamp. Lamp is now full.";
],
has static;
Object -> chiggers "chiggers"
with name "chiggers", article "a swarm of",
daemon
[; if (chigger_bites in player && mud notin player && random(100)<=10)
{ remove chigger_bites; move infected_bites to player;
"^Your chigger bites are now infected.";
}
if (infected_bites in player && random(100)<=8)
{ deadflag=1;
"^The bites have rotted your whole body.";
}
if (infected_bites notin player
&& chigger_bites notin player
&& slime in location && mud notin player
&& random(100)<=5)
{ move chigger_bites to player;
"^You're bitten by chiggers.";
}
if (infected_bites notin player
&& chigger_bites notin player
&& chiggers in player
&& random(100)<=30)
{ move chigger_bites to player;
"^You're bitten by chiggers.";
}
];
Object chigger_bites "chigger bites"
with name "chigger" "bites", article "some",
before [; "The bites are annoying. Perhaps medicine would help?"; ];
Object infected_bites "infected chigger bites"
with name "chigger" "bites" "infected", article "some",
before [; "The bites are frightening. Get medicine!"; ];
Object tree_remains "hollow stump and remains of a felled tree"
with name "tree" "stump" "hollow" "remains",
door_to Inside_Stump, door_dir in_to
has open door static;
ScottRoom Tree_Top "Tree Top"
with description "You're in the top of a tall cypress tree.",
d_to Dismal_Swamp,
has light;
Object -> "spider web with writing on it"
with name "spider" "web" "writing",
description "~CHOP IT DOWN!~",
before
[; Take: deadflag=1; "You're bitten by a spider.";
];
Object -> keys "ring of skeleton keys"
with name "keys" "ring" "skeleton" "keyring";
ScottRoom Inside_Stump "Inside Stump"
with description "You're in a large hollow damp stump in the swamp.",
n_to Dismal_Swamp, s_to Dismal_Swamp, e_to Dismal_Swamp,
w_to Dismal_Swamp, u_to Dismal_Swamp, d_to Root_Chamber,
has light;
Sign -> "LEAVE TREASURE HERE - (say 'SCORE')";
Object -> bottle "the bottle"
with name "bottle" "jar" "flask",
short_name
[; if (water_in_the_bottle in self) { print "bottle of water"; rtrue; }
if (bees in self) { print "bottle of bees"; rtrue; }
print "empty bottle"; rtrue;
],
before
[ x; LetGo:
if (noun in bottle)
"You're holding that already (in the bottle).";
Receive:
if (noun==water or bees) <<Fill self>>;
"That won't go in the bottle.";
Fill:
if (child(bottle)~=0)
"The bottle is full already.";
if (water in location)
{ move water_in_the_bottle to bottle;
"The bottle is now full of water.";
}
if (bees in location)
{ move bees to bottle;
"The bottle is now full of bees.";
}
"There is nothing here with which to fill the bottle.";
Empty: if (child(bottle)==0) "The bottle is already empty!";
x=child(bottle);
remove x;
if (x==bees)
{ move x to location; "You release the bees.";
}
"Your bottle is now empty and the ground is now wet.";
],
has container open;
Object -> brass_lantern "old fashioned lamp"
with name "lamp" "fashioned" "lamp", article "an",
power 125,
time_left 0,
daemon
[ t; if (self hasnt on) { StopDaemon(self); rtrue; }
t=--(self.power);
if (t==0) give self ~on ~light;
if (self in player or location)
{ if (t==0) "Your lamp has run out of power.";
if (t==30) "Your lamp is getting dim.";
}
],
before
[; Examine: print "It is a shiny brass lamp";
if (self hasnt on)
". It is not currently lit.";
if (self.power < 30)
", glowing dimly.";
", glowing brightly.";
Burn: <<SwitchOn self>>;
Rub: if (self has on) "No! It's too hot.";
if (self hasnt general) "Nothing happens.";
switch(++genie_gifts)
{ 1: move ring to location;
"A glowing genie appears -
drops something - then vanishes.";
2: move bracelet to location;
"A glowing genie appears -
drops something - then vanishes.";
3: if (ring in Inside_Stump)
score=score-ring.depositpoints;
remove ring; move player to Misty_Room;
"A genie appears - says ~boy you're selfish~ - takes
something - then vanishes!";
4: if (bracelet in Inside_Stump)
score=score-bracelet.depositpoints;
remove bracelet; move player to Misty_Room;
"A genie appears - says ~boy you're selfish~ - takes
something - then vanishes!";
default: "Nothing happens.";
}
SwitchOn: if (self.power <= 0) "It's run out.";
Receive, Open:
"You can't put things in the lamp.";
],
after
[; SwitchOn: give self light; StartDaemon(self);
"Flameless lamp now on.";
SwitchOff: give self ~light;
],
has switchable;
Treasure ring "*DIAMOND RING*"
with name "diamond" "ring";
Treasure bracelet "*DIAMOND BRACELET*"
with name "diamond" "bracelet";
Object water_in_the_bottle "bottled water" bottle
with name "bottled" "water" "h2o", article "some",
before
[; Drink: remove water_in_the_bottle; <<Drink water>>;
],
description "It looks like ordinary water to me.";
ScottRoom Root_Chamber "Root Chamber"
with description "You're in a root chamber under the stump.",
u_to Inside_Stump, d_to dark_hole,
has light;
Object -> dark_hole "dark hole"
with description "Leading below.",
door_dir d_to,
door_to Semidark_Hole
has open door static;
Treasure -> "*POT OF RUBIES*"
with name "pot" "of" "rubies";
ScottRoom Semidark_Hole "Hole"
with description "You're in a semi-dark hole by the root chamber.",
u_to Root_Chamber, d_to root_door
has light;
Object -> root_door "the door"
with name "door",
short_name
[; if (self has locked) { print "locked door"; rtrue; }
if (self has open)
{ print "open door with a hallway beyond"; rtrue; }
print "closed door"; rtrue;
],
before
[; ThrowAt:
if (second==axe)
{ give self ~locked ~lockable ~openable open;
"Lock shatters!";
}
],
door_to Long_Hall, door_dir d_to, with_key keys
has static door openable lockable locked;
ScottRoom Long_Hall "Hall"
with description "You're in a long down-sloping hall.",
u_to Semidark_Hole, d_to Large_Cavern;
ScottRoom Large_Cavern "Cavern"
with description "You're in a large cavern.",
n_to Hive, s_to Royal_Anteroom, w_to Memory_RAM,
u_to Long_Hall, d_to Maze1;
ScottRoom Hive "Octagonal Hive"
with description "You're in a large 8-sided room.",
s_to Large_Cavern;
Treasure -> "*ROYAL HONEY*"
with name "royal" "honey", article "some",
before
[; Take:
if (bees in location && mud notin player)
{ deadflag=1; "Bees sting you."; }
Drop:
if (bear in location)
{ remove self; give bear general;
"The bear eats the honey and falls asleep.";
}
],
has edible;
Object -> bees "large African bees"
with name "large" "african" "bees", article "a swarm of",
before
[; Take:
if (mud notin player)
{ deadflag=1; "Bees sting you."; }
if (bottle in player) <<Fill bottle>>;
"You have nothing to carry the bees in.";
Drop:
if (self in bottle
&& dragon in location)
{ move self to location;
move eggs to location; remove dragon;
"The bees attack the dragon which gets up and flies away...";
}
if (self in bottle
&& bear in location)
{ move self to location;
give bear ~general; deadflag=1;
"Bees madden the bear. Bear then attacks you!";
}
],
each_turn
[; #IFNDEF DEBUG;
! A completely unfair rule! And in the original the bees are lost.
if (self in bottle && random(100)<=8)
{ move self to Hive; "^The bees in the bottle all suffocated."; }
#ENDIF;
if (self in bottle) rfalse;
if (self in location && mud notin player && mud notin location &&
random(100)<=8)
{ deadflag=1; "Bees sting you."; }
];
ScottRoom Royal_Anteroom "Anteroom"
with description "You're in a royal anteroom.",
n_to Large_Cavern, u_to Royal_Chamber;
Object -> wine_bladder "empty wine bladder"
with name "empty" "wine" "bladder",
before
[; Fill: if (gas notin location)
"The bladder could only just hold a vapour nowadays.";
<<Insert gas self>>;
];
Object distended_bladder "distended gas bladder"
with name "distended" "gas" "bladder",
before
[; Open: move wine_bladder to parent(self); remove self;
"Gas dissipates!";
];
ScottRoom Maze1 "Maze"
with description "You're in a maze of pits.",
n_to Maze2, s_to Maze4, e_to Maze4, d_to Maze2;
ScottRoom Maze2 "Maze"
with description "You're in a maze of pits.",
w_to Maze3, u_to Maze1;
Object -> flint_and_steel "flint and steel"
with name "flint" "steel";
ScottRoom Maze3 "Maze"
with description "You're in a maze of pits.",
n_to Maze6, s_to Maze1, e_to Maze2, w_to Maze5,
u_to Maze5, d_to Maze6;
Object -> "scratchings"
with name "scratchings", article "strange",
short_name "strange scratchings on rock reveals- ALADDIN WAS HERE",
has static;
ScottRoom Maze4 "Maze"
with description "You're in a maze of pits.",
n_to Maze1, e_to Maze2, w_to Maze1, u_to Maze2;
ScottRoom Maze5 "Maze"
with description "You're in a maze of pits.",
s_to Maze6, u_to Maze3, d_to Maze6;
ScottRoom Maze6 "Maze"
with description "You're in a maze of pits.",
n_to Maze6, s_to Maze1, e_to Maze1, w_to Maze4,
u_to Maze3, d_to Chasm_Bottom;
Treasure -> rug "*THICK PERSIAN RUG*"
with name "thick" "persian" "rug" "carpet";
Object -> "arrow pointing down"
with name "arrow"
has static;
ScottRoom Chasm_Bottom "Chasm"
with description "You're in a bottom of a chasm. Above 2 ledges.
One has a bricked up window.",
u_to Maze6;
Treasure -> net "*GOLDEN NET*"
with name "gold" "golden" "net";
Sign -> "MAGIC WORD IS AWAY. X LA -(rest of sign is missing)";
Object -> lava "the lava"
with name "stream" "of" "lava",
short_name
[; print "stream of lava";
if (self has general) print " with a brick dam";
rtrue;
],
description
[; if (self hasnt general)
"There's something there all right! Maybe you should go there?";
"Just more dammed lava.";
],
before
[; Enter, Push, Pull, Take: "NO! It's too hot.";
],
has static;
Treasure firestone "*FIRESTONE* (cold now)"
with name "firestone", depositpoints 11;
ScottRoom Narrow_Ledge_1 "Ledge"
with description "You're on a narrow ledge by a chasm.
Across the chasm is a throne room.",
before
[; Jump: if (firebricks in player)
{ deadflag=1; "Oh no! Something was too heavy!"; }
print "You leap across the chasm...^";
PlayerTo(Narrow_Ledge_2); rtrue;
],
w_to Royal_Chamber;
ScottRoom Royal_Chamber "Royal Chamber"
with description "You're in the Royal Chamber.",
d_to Royal_Anteroom, e_to 0;
Object -> bricked_window "bricked-up window"
with name "window" "bricked" "brick" "bricks"
has static;
Object holed_window "bricked up window with a hole in it - beyond is a ledge"
with name "window" "bricked" "hole" "ledge",
door_dir e_to, door_to Narrow_Ledge_1
has static door open;
Object firebricks "loose fire bricks"
with name "loose" "fire" "bricks", article "some",
after
[; Take: "Taken. (Heavy!)";
Drop: if (location~=Chasm_Bottom) rfalse;
remove self; give lava general;
move firestone to location;
"The bricks dam the lava, revealing a *FIRESTONE*!";
];
ScottRoom Narrow_Ledge_2 "Ledge"
with description
"You're on a narrow ledge by the throne room-across chasm-ledge.",
before
[; Sing:
if (bear in location && bear hasnt general)
{ move dead_bear to Chasm_Bottom;
remove bear;
"The bear got startled and fell off the ledge!";
}
Jump: print "You leap across the chasm...^";
PlayerTo(Narrow_Ledge_1); rtrue;
],
e_to
[; if (bear in location && bear hasnt general)
"The bear won't let you!";
return Throne_Room;
];
Treasure -> mirror "*MAGIC MIRROR*"
with name "magic" "mirror",
side_up 0,
before
[; Take:
if (bear in location && bear hasnt general)
"The bear won't let you!";
],
after
[; Drop:
if (rug in location)
{ print "Mirror lands softly on the rug - lights up and says:^";
self.side_up++;
if (self.side_up % 2 == 1)
"*DRAGON STINGS* and fades. I don't get it - hope you do.";
"Don't waste *HONEY*. Get mad instead. Dam lava!";
}
remove self; move broken_glass to location;
"The mirror hits the floor and shatters into a million pieces!";
];
Object -> bear "the bear"
with name "thin" "black" "bear",
short_name
[; if (self has general) { print "sleeping bear"; rtrue; }
print "thin black bear"; rtrue;
],
before
[; WakeOther: give self ~general; "The bear rouses!^";
],
life
[; Ask, Order, Answer: <<Sing>>;
Attack, ThrowAt:
if (self has general) <WakeOther self>;
remove mirror; move broken_glass to location;
"Oh no...Bear dodges...CRASH!";
],
has animate;
Object broken_glass "broken glass"
with name "broken" "glass" "jagged" "fragments", article "some";
Object dead_bear "dead bear"
with name "dead" "bear" "black" "thin"
has static;
ScottRoom Throne_Room "Throne Room"
with description "You're in a throne room.",
w_to Narrow_Ledge_2;
Treasure -> "*GOLD CROWN*"
with name "gold" "golden" "crown";
ScottRoom Real_Trouble "Trouble!"
with description
"I think you're in real trouble. Here's a guy with a pitchfork!^^
You lost *ALL* treasures.",
initial
[; deadflag=3;
],
has light;
ScottRoom Memory_RAM "Ugly Place"
with description
"You're in the memory RAM of an IBM-PC. You took a wrong turn!",
e_to Large_Cavern,
has light;
Sign -> "To the Architects - TSURRIS";
ScottRoom Misty_Room "Misty Room"
with description "You're in a large misty room with strange letters
over the exits.",
s_to Real_Trouble, e_to Forest, w_to Real_Trouble,
u_to Up_Oak, d_to Real_Trouble,
has light;
Sign -> "LIMBO. FIND RIGHT EXIT AND LIVE AGAIN!";
! ----------------------------------------------------------------------------
! A soupcon of code
! ----------------------------------------------------------------------------
[ Initialise;
location=Forest; score = 0;
StartDaemon(chiggers);
"^^^^^A voice booms out ...^
Treasures have an * in their name. Say 'SCORE'^
If you need a hint on something, try 'HELP'.^";
];
[ TimePasses i;
if (location ~= Inside_Stump) rfalse;
score=0;
objectloop (i in Inside_Stump && i ofclass Treasure)
score = score + i.depositpoints;
if (score ~= 100) rfalse;
deadflag=2;
"Congratulations! By finding and depositing all 13 *TREASURES*, you
have solved Scott Adams's ~Adventureland~ and it remains only to say
that...";
];
[ AfterLife;
if (deadflag==3) { deadflag=1; rfalse; }
remove chigger_bites; remove infected_bites;
deadflag=0; PlayerTo(Misty_Room);
];
[ PrintRank; "."; ];
[ DarkToDark;
if (dark_warning==0)
{ dark_warning=1; "It is now pitch dark.
If you proceed you will likely fall into a pit.";
}
if (random(4) == 1)
{ deadflag=1;
"You fell into a pit and broke every bone in your body!";
}
rfalse;
];
[ BunyonSub;
if (axe notin player) "Nothing happens.";
if (ox in player or location)
{ move ox to Hidden_Grove;
move axe to Hidden_Grove;
"Something you're holding vibrated and...";
}
if (player notin Quicksand)
{ move axe to Hidden_Grove;
print "Something you're holding vibrated and...";
<<Inv>>;
}
"Nothing happens.";
];
[ TsurrisSub;
if (location ~= Memory_RAM) "Nothing happens.";
"A voice booms out...^
May all your teeth but one fall out, and may that one give you toothache.^
(You can't help feeling you have stumbled on a private quarrel which is
nothing to do with your game.)";
];
[ BurnSub;
if (flint_and_steel notin player)
"You have nothing to strike a light with.";
if (noun==gas) "Gas needs to be contained before it will burn.";
if (noun==distended_bladder)
{ if (noun in player)
{ remove noun; deadflag=1; "Gas bladder blew up in your hands!";
}
remove noun;
print "Gas bladder blew up!^";
if (dragon in location)
{ remove dragon; move gore to location;
"The dragon has been blown to bits!";
}
if (bricked_window in location)
{ remove bricked_window;
move holed_window to location; move firebricks to location;
Royal_Chamber.e_to = holed_window;
"The bricked window has been blown to bits!";
}
rtrue;
}
"That won't ignite.";
];
[ HelpSub;
print "A voice booms out...^";
print "Try: LOOK,JUMP,SWIM,CLIMB,THROW,FIND,GO,TAKE,INVENTORY,SCORE.^";
if (chigger_bites in player || infected_bites in player)
"Medicine is good for bites.";
if (location == Quicksand) "You may need magic words here.";
if (location == Sunny_Meadow)
"Only 3 things will wake the dragon. One of them is dangerous!";
if (location == Hive)
"Read the sign in the meadow!";
if (location == Maze1 or Maze2 or Maze3
|| location == Maze4 or Maze5 or Maze6)
"You may need magic words here.";
if (location == Royal_Chamber) "Blow it up. Try the swamp.";
];
[ AwaySub;
if (rug notin player || location~=Maze3) "Nothing happens.";
print "Something you're holding vibrates, and...^";
PlayerTo(Sunny_Meadow);
];
[ FindSub;
"A voice booms out...^Find it yourself.";
];
! ----------------------------------------------------------------------------
! Grammar: the usual grammar and some extensions
! ----------------------------------------------------------------------------
Include "Grammar";
Extend "cut"
* "up" noun -> Cut
* "down" noun -> Cut;
Verb "bunyon" * -> Bunyon;
Verb "away" * -> Away;
Verb "tsurris" * -> Tsurris;
Verb "help" * -> Help;
Verb "find" * special -> Find;
! ----------------------------------------------------------------------------

469
presets/zmachine/alice.inf Normal file
View File

@ -0,0 +1,469 @@
! Through the Looking-Glass
! An Inform tutorial by Gareth Rees
! All rights given away
! Version 3
!
! 5/1/2003 - Updated to Inform 6.21 Library 6/10
!
Constant Story "THROUGH THE LOOKING GLASS";
Constant Headline "^An Interactive Tutorial^by Gareth Rees^";
Include "parser";
Include "verblib";
Include "grammar";
[ Initialise;
location = Drawing_Room;
StartDaemon(white_kitten);
StartDaemon(black_kitten);
print "^^^^^It's a cold winter day outside, but in the
looking-glass house it's summer. All you need to do is
pretend there's a way of getting through into it
somehow...^^";
];
[ UntangleSub; "What curious ideas you have!"; ];
[ ReflectSub;
if (second ~= mirror) "What a strange idea!";
if (noun == hearth or mirror || (player notin mantelpiece &&
player notin armchair))
"You can't see that in the looking-glass.";
print "The looking-glass ";
if (noun == player) print "Alice";
else PrintShortName(noun);
if (player in mantelpiece) " looks very misty and blurred.";
print " looks just like the real ";
if (noun == player) print "Alice";
else PrintShortName(noun);
" only all reversed, left for right.";
];
Extend "look"
* "at" noun "in" noun -> Reflect;
Extend "examine"
* noun "in" noun -> Reflect;
Verb "roll" "untangle" "wind"
* noun -> Untangle
* "up" noun -> Untangle
* noun "up" -> Untangle;
Object Drawing_Room "Drawing room"
has light
with name "snow",
description "The gentle sound of snow against the window pane
suggests that it's cold outside, and you're glad to be
here in the warmth. The drawing-room is reflected in the
large looking-glass on the wall above the mantelpiece,
and a very comfortable room it is too, with a warm
hearth, a soft rug and an arm-chair that you can curl up
and sleep in.",
before [;
if (player in mantelpiece && (action == ##Exit ||
(action == ##Go && noun == d_obj or out_obj)))
"That's not the way to get down from a mantelpiece!";
if (player in mantelpiece &&
action ~= ##Examine or ##Enter or ##Go &&
action ~= ##ThrownAt or ##ThrowAt or ##Reflect)
if ((noun > 0 && noun notin mantelpiece &&
noun ~= mantelpiece or mirror && noun notin player) ||
(second > 0 && second notin mantelpiece &&
second ~= mantelpiece or mirror && second notin player))
"Not from up here you can't!";
];
Object red_queen "red queen"
has female
with name "red" "queen",
describe [;
if (white_kitten.state == 1 || black_kitten.state == 1)
rtrue;
],
description "She's a fierce little chess piece.",
after [;
Take:
if (white_kitten.state == 1)
white_kitten.state = 3;
if (black_kitten.state == 1)
black_kitten.state = 3;
PutOn,Transfer,Insert:
if (second == chess_board)
"Alone on the chess board, the red queen is monarch of
all she surveys.";
];
Object chess_board "chess board" Drawing_Room
has supporter
with name "chess" "board" "checker" "chequer" "chessboard",
initial "An abandoned chess board lies on the floor.",
description "It's left here from the game you were playing
just now, but the pieces are all missing - the kittens
will insist on playing with them.";
Object hearth "hearth" Drawing_Room
has scenery
with name "hearth" "fire" "place" "fireplace";
Object rug "rug" Drawing_Room
has concealed static supporter enterable
! general if you've found the red queen under it
with name "hearthrug" "hearth-rug" "rug" "indian" "arabian" "beautiful"
"soft",
description "It's a beautiful rug, made in some far off
country, perhaps India or Araby, wherever those might
be.",
before [;
Take: "The rug is much too large and heavy for you to carry.";
Push,Pull: "But a hearth-rug is meant to be next to the
hearth!";
LookUnder:
if (player in mantelpiece || player in armchair)
"You're unable to reach the rug from here.";
if (player in self)
"You try to lift up a corner of the rug, but fail. After
a while, you realise that this is because you are
standing on it. How curious the world is!";
if (self hasnt general) {
give self general;
move red_queen to player;
"You lift up a corner of the rug and, peering
underneath, discover the red queen from the chess
set.";
}
];
Object armchair "arm-chair" Drawing_Room
has static concealed supporter enterable
! general if its by the mantelpiece
with name "arm" "chair" "armchair" "arm-chair",
description [;
print "It's a huge arm-chair, the perfect place for a kitten
or a little girl to curl up in and doze. It has been
pushed over to the ";
if (self has general) "fireplace.";
"window.";
],
before [ i;
Push,Pull:
if (player notin Drawing_Room)
print_ret "You'll have to get off ", (the) parent(player),
" first.";
if (white_kitten in player || black_kitten in player)
"Not with a kitten in your arms!";
if (white_kitten.state == 3) i = white_kitten;
else if (black_kitten.state == 3) i = black_kitten;
if (i ~= 0)
print_ret "You are about to start moving the chair when you
notice that ", (the) i, " is right in the way. It's a
good thing you spotted it, or you would have squashed
flat the poor little thing.";
if (self has general) {
give self ~general;
"You push the arm-chair away from the hearth.";
}
give self general;
"You push the arm-chair over to the hearth.";
Climb,Enter:
move player to armchair;
"You jump into the warm and comfortable arm-chair.";
];
Object mantelpiece "mantelpiece" Drawing_Room
has concealed supporter enterable
with name "mantel" "mantelpiece",
description "It's higher off the ground than your head, but
it looks wide enough and sturdy enough to support you.",
before [;
Enter,Climb:
if (player notin armchair)
"The mantelpiece is much too high to climb up onto.";
if (armchair hasnt general)
"You can't reach the mantelpiece from here.";
if (children(player) > 0)
"Your hands are too full.";
move player to mantelpiece;
"You scramble up onto the mantelpiece.";
PutOn,LetGo:
if (player notin self && (player notin armchair ||
armchair hasnt general))
"The mantelpiece is so high that you can't reach.";
];
Object mirror "looking-glass" Drawing_Room
has static concealed
with name "mirror" "looking" "glass" "looking-glass",
description [;
if (player in mantelpiece)
"Strangely, the glass is beginning to melt away,
just like a bright silvery mist.";
if (player in armchair)
"In the looking-glass you can see the drawing-room of
the looking-glass house. What you can see is very
much the same as this drawing-room, only all
reversed, left for right. But you are sure that out
of the corners of the glass, where you can't see, the
looking-glass world is quite different from yours.";
"In the looking-glass you can see the ceiling of the
drawing-room of the looking-glass house. It looks much
the same as the ceiling of your drawing-room.";
],
before [;
if (action ~= ##Examine or ##ThrownAt or ##Reflect &&
player notin mantelpiece)
"You can't reach the looking-glass from where you're
standing.";
Touch,Pull,Push:
"Your hand goes right through the silvery mist!";
ThrownAt: "You don't want seven years' bad luck, do you?";
Enter:
! Really, move Alice to the looking-glass house.
deadflag = 2;
"Your hand goes right through the silvery mist, and in
another moment the rest of you follows, and you are
through the glass...";
];
Object worsted "ball of worsted" Drawing_Room
! general if its in a tangle
with name "ball" "of" "worsted" "fine" "blue" "wool",
describe [;
if (white_kitten.state ~= 2 &&
black_kitten.state ~= 2)
"^A discarded ball of worsted lies on the floor here.";
rtrue;
],
description [;
if (self has general)
"It's in a terrible tangle. All that time you spent
rolling it up, and now look at it!";
"It's a ball of fine blue wool, all rolled up in preparation
for some embroidery.";
],
before [;
Untangle:
give self ~general;
"You're as quick as can be at rolling up balls of wool,
though you say so yourself! Soon it's neat and tidy again.";
],
after [;
Take:
if (white_kitten.state == 2)
white_kitten.state = 3;
if (black_kitten.state == 2)
black_kitten.state = 3;
];
Object chess_pieces "chess pieces" Drawing_Room
has scenery
with parse_name [ w colour n;
w = NextWord();
if (w == 'white' or 'red') {
n ++;
colour = w;
w = NextWord();
}
if (w == 'pawn' or 'rook' or 'castle' ||
w == 'knight' or 'horse' or 'bishop' ||
w == 'king' || (w == 'queen' &&
(colour == 'white' || rug hasnt general))) return n + 1;
return 0;
],
before [;
"Alas, that chess piece seems to be missing. Those
naughty kittens!";
];
Object window "window" Drawing_Room
has scenery
with name "window" "pane",
description "Outside the window it's snowing gently, and you're
glad to be in here in the warmth.",
before [;
Open: "You wouldn't want to catch a chill, would you? Better
leave the window shut.";
Search: <<Examine self>>;
];
Property other_kitten;
Property state; ! 1=red queen, 2=ball of wool, 3=arm-chair, 0=held
Class Kitten_Class
has animate
! general if it's been described this turn
with parse_name [ w ok n;
do {
ok = 0;
w = NextWord();
if (w == 'kittens' or 'cats') {
ok = 1; n++; parser_action=##PluralFound;
}
if (w == 'kitten' or 'kitty' or 'cat' ||
w == ((self.&name)-->0)) {
ok = 1; n++;
}
} until (ok == 0);
return n;
],
state 3,
describe [ i;
switch (self.state) {
1: print_ret "^A ", (name) self, " is playing with the red
queen.";
2: print_ret "^A ", (name) self, " is playing with a ball of
worsted.";
3: if (self has general) rtrue;
if ((self.other_kitten).state == 3) {
i = self.other_kitten;
give i general;
"^Two kittens, one white and one black, are playing
together by the arm-chair.";
}
print_ret "^A ", (name) self, " is playing by the
arm-chair.";
default: rtrue;
}
],
description [;
print_ret "What a beautiful kitten ", (the) self, " is. Why,
it's quite definitely your favourite of the pair, and
much prettier than that naughty ", (name)
self.other_kitten, ".";
],
life [;
Ask,Answer,Order:
print_ret (The) self, " twitches its whiskers and looks at
you with such a clever expression that you are certain it
understands every word you are saying.";
Kiss:
print_ret "You give ", (the) self, " a little kiss on its
nose, and it looks sweetly and demurely at you.";
Attack: "You would never do such a beastly thing to such
a defenceless little animal!";
Show:
print_ret (The) self, " bats a paw at ", (the) noun, ".";
Give,ThrowAt:
if (noun ~= red_queen or worsted) {
if (action == ##ThrowAt) {
move noun to Drawing_Room;
print "You toss ", (the) noun, " onto the floor, but ",
(the) self;
}
else print (The) self;
print_ret " just examines ", (the) noun, " with a
quizzical expression.";
}
print "You toss ", (the) noun, " onto the floor and ", (the) self;
if (self in player)
print " squirms out of your grasp and";
move noun to Drawing_Room;
move self to Drawing_Room;
print " scampers after it";
if (noun == worsted) {
give worsted general;
self.state = 2;
print ", quickly turning the neat ball into a tangle";
}
else self.state = 1;
".";
],
before [;
Take:
if (self.other_kitten in player)
"You can't hold two kittens at once!";
self.state = 0;
move self to player;
print_ret "You pick up ", (the) self, ". What a beautiful
creature it is!";
],
after [;
Drop:
self.state = 3;
move self to Drawing_Room;
print_ret (The) self, " squirms out of your arms and scampers
away.";
Transfer,PutOn,Insert:
self.state = 3;
print (The) self, " jumps off ", (the) parent(self);
move self to Drawing_Room;
", landing lightly on the floor before scampering away.";
],
daemon [ i;
give self ~general;
self.number = 1 - self.number;
if (self.number == 1 || random(3) == 2) rtrue;
new_line;
print (The) self;
switch (self.state) {
0: switch(random(5)) {
1: " mews plaintively.";
2: " purrs quietly to itself.";
3: " purrs contentedly to itself.";
4: " rubs its ears against you.";
5: move self to Drawing_Room;
self.state = 3;
" squirms out of your arms and scampers away.";
}
1: switch (random(5)) {
1: " bats at the red queen with its paw.";
2: " stops playing and sits up, pretending to be
innocent of any kittenish tendancies.";
3: " knocks the red queen across the floor and chases
after it.";
4: " stops to wash itself.";
5: " bites the red queen and shakes it to make sure that
it's dead.";
}
2: give worsted general;
switch (random(5)) {
1: " bats at the ball of worsted with its paw.";
2: " pushes the ball of worsted across the floor and
chases after it.";
3: " leaps onto the ball of worsted and grapples bravely
with it.";
4: " jumps into the ball of worsted and gets tangled up
in a mess of threads.";
5: " stops playing and scratches its ears.";
}
3: if ((self.other_kitten).state == 3 && random(2) == 1) {
i = random(5);
switch (i) {
1: print " chases after ";
2: print " jumps on top of ";
3: print " washes ";
4: print " scampers around the arm-chair and ";
5: print " bats at ";
}
print (the) self.other_kitten;
switch (i) {
1,3: ".";
2: " and they roll around on the floor.";
4: " chases after it.";
5: " with its paw.";
}
}
switch (random(5)) {
1: " scampers after a speck of dust.";
2: " rolls around on the floor.";
3: " sits up and washes its tail.";
4: " scratches its head on the arm-chair.";
5: " chases its tail.";
}
}
];
Object white_kitten "white kitten" Drawing_Room
class Kitten_Class
with name "white",
number 0,
other_kitten black_kitten;
Object black_kitten "black kitten" Drawing_Room
class Kitten_Class
with name "black",
number 1,
other_kitten white_kitten;
End;

View File

@ -0,0 +1,458 @@
! -----------------------------------------------------------------------------
Constant Story "Alone on The Ice";
Constant Headline
"^Inform for New Writers^
~Alone on The Ice~ - a sample game/tutorial
by Ethan Dicks - Last Compiled: 23-Feb-1998^";
Release 1;
Serial "980223";
! The game is meant to be experimented with, so we always define:
Constant DEBUG;
! --------------------------------------------------------------------------
! Put your "replaces" here to re-write parts of the Inform libraries
Include "Parser";
! --------------------------------------------------------------------------
! Out on the open ice, every object that might be dropped out there needs to
! have a property to store its "coordinate". Forgetting this could cause
! serious bugs.
Property ICELOC 0; ! coordinate of Object in ice field.
! --------------------------------------------------------------------------
Include "VerbLib";
! --------------------------------------------------------------------------
!
! It all starts here --+
! |
! v
[ Initialise;
location = HUT1;
thedark.description = "There is nothing here but whiteness. If you move
from this spot, you are likely to be hopelessly lost";
"You awake from a dreamless sleep to silence. You look around the room
for Tom, your campmate; he isn't here. Of all the places to go for a
walk by yourself, the middle of the Antarctic plateau isn't one of them.
Despite your training to stay put and wait for him to come back, you
decide to go after him. It's just the two of you here, and no planes
due for weeks.";
];
! --------------------------------------------------------------------------
!
! Things - the elements of our interactive world
!
! --------------------------------------------------------------------------
Object HUT1 "A small scientific observation hut"
with description "This cramped insulated box has been your home for
several months now. There is little in here but
some equipment for monitoring the weather and two
cots.",
n_to DOOR1,
has light;
!----
Object -> DOOR1 "freezer door" ! An ordinary two-sided door (as implemented
! in the Inform Designer's Manual, chpt. 12).
with description "There is a door in the wall of the hut, nearly as wide
as the wall. It is large, white and heavy. It does
not appear to have a doornob, as such, but more of a
plunger like you'd find on the inside of a meat locker.",
name "white" "freezer" "door",
when_closed [; rfalse; ],
when_open "The door has been carelessly left open and the cold,
antarctic wind is blowing into the hut, unabated.",
door_to [; if (location==CAMP14) return HUT1; return CAMP14; ],
door_dir [; if (location==CAMP14) return n_to; return s_to; ],
found_in HUT1 CAMP14,
has static door openable;
!----
Object -> NOTE "goodbye note"
with initial "There is a piece of paper taped to the door here.",
inven "A note from your campmate.",
name "note" "paper" "piece",
ICELOC 0,
before [; Examine: "The paper appears torn hastily from a notebook, the
writing nearly illegible. It reads:^^Went to get
some smokes. Be back soon.^^^^ --Tom";
],
has ~static; ! make sure it's portable
!----
Object -> BOOK "survival guide"
with name "book" "survival" "guide",
initial "A survival guide lies discarded in the corner.",
ICELOC 0,
before [; Examine: "It's a standard issue guide to survival in Antarctica.
You got it on your first day here. On the back cover
is a list of important safety tips:
^ Black flags mark hazards - do not approach.
^ Orange flags mean safe travel.
^ Stick to the flagged routes.
^ Travel in pairs (I guess Tom forgot that one).
^ In a white-out, sit down and wait it out.^";
],
has ~static; ! make sure it's portable
!----
Object CAMP14 "Weather Observation Post 14"
with description "Behind the sign that reads, ~The United States Welcomes
you to Observation Post 14,~ lies your camp: an orange
eight-foot by eight-foot box that you call home. There
is a line of orange trail-marker flags heading off in
the distance to the north. The rest is whiteness",
s_to DOOR1,
n_to
[;
! Drop the player at the starting poing
PlayerTo(ICE,1); ! Put the player in the "ice room" Object
IGOTO(52); ! Set the starting location (middle of the south edge)
rtrue; ! Tell the parser that it worked.
],
has light;
!----
Object CAMP9 "Weather Observation Post 9"
with description "This is another field camp, the sign here tells you,
~The United States Welcomes you to Observation Post 9~.
The flagged route goes south from here.",
n_to DOOR2,
s_to
[;
! Drop the player at the starting poing
PlayerTo(ICE,1); ! Put the player in the "ice room" Object
IGOTO(12); ! Set the starting location (middle of the north edge)
rtrue; ! Tell the parser that it worked.
],
has light;
!----
Object HUT2 "A small scientific observation hut"
with description "This looks like a duplicate of your own observation hut,
down to the scuff marks on the floor.",
s_to ICE2,
n_to DOOR2,
has light;
!----
Object -> DOOR2 "freezer door" ! An ordinary two-sided door (as implemented
! in the Inform Designer's Manual, chpt. 12).
with description "There is a familiar looking door in the wall of the hut,
with a familiar looking opening plunger.",
name "white" "freezer" "door",
when_closed [; rfalse; ],
when_open "The door has been carelessly left open and the cold,
antarctic wind is blowing into the hut, unabated.",
door_to [; if (location==CAMP9) return HUT2; return CAMP9; ],
door_dir [; if (location==CAMP9) return n_to; return s_to; ],
found_in HUT2 CAMP9,
has static door openable;
!----
Object -> TOM "your campmate, Tom"
with name "Tom",
description "Tom, the only other person for a hundred miles, is here,
smoking the foulest smelling cigarettes you have ever
smelled - Penguin Slims",
has proper animate;
! In order to create the illusion of an enormous expanse of rooms without
! having to create one object per location, we simulate a large area with
! two real rooms and an array. One room (ICE) contains the Player object
! at all times. The other (ICE2), is a temporary holding area for the
! objects that are located in various places throughout the virtual space.
! We use the "ICELOC" property to remember where in the greater area an
! object was the last time the Player saw it.
!
Object ICE "Out on the open ice"
with name "ICE",
description
[; IWHERE(); ],
before
[; Go:
! Check to see if we are at an exit space, otherwise, just move
! around the virtual area.
return IEXIT();
],
! Since we don't move from object to object, all roads lead back here. The
! only way out is through specially marked spaces.
n_to ICE, s_to ICE, e_to ICE, w_to ICE,
ne_to ICE, nw_to ICE, se_to ICE, u_to ICE, sw_to ICE,
d_to ICE,
has light static container;
! We need a place to stash things that get left out on the ice
Object ICE2 "Ice Box" with name "ICE2", description "Ice Box", has light;
! ----------------------------------------
! Let's leave a trail for Player to follow
!
Class Flag
with description "trail flag",
name "marker" "flag" "bamboo" "pole",
initial
[;
"There is ", (a) self, " trail-marker flag here, fluttering
at the end of a bamboo pole";
],
After
[; Take: print "You pull the flag from the snow"; ],
has ~static; ! Let's let the player pick up and move the flags around.
! Now, create several instances of the flags and stick them in the holding room
Class Orange_Flag class Flag with name "orange", article "an";
Class Black_Flag class Flag with name "black", article "a";
Orange_Flag O1 "orange flag" ICE2 with plural "orange flags", ICELOC 12;
Orange_Flag O2 "orange flag" ICE2 with plural "orange flags", ICELOC 20;
Orange_Flag O3 "orange flag" ICE2 with plural "orange flags", ICELOC 28;
Orange_Flag O4 "orange flag" ICE2 with plural "orange flags", ICELOC 36;
Orange_Flag O5 "orange flag" ICE2 with plural "orange flags", ICELOC 44;
Orange_Flag O6 "orange flag" ICE2 with plural "orange flags", ICELOC 52;
Black_Flag BL1 "black flag" ICE2 with plural "black flags", ICELOC 53;
Black_Flag BL2 "black flag" ICE2 with plural "black flags", ICELOC 45;
Black_Flag BL3 "black flag" ICE2 with plural "black flags", ICELOC 37;
Black_Flag BL4 "black flag" ICE2 with plural "black flags", ICELOC 29;
! ----------------------------------------
Global IPLAYER=52; ! Current location of Player on the ice
!----------
! Virtual room array
! This array is a grid representation of the ice field. Different numbers
! represent the kind of terrain found in a particular "location". To make
! life easier for the programmer, positive numbers are inaccessible, zero
! is flat and level, and negative numbers are used for features such as exits
! and moveable ice blocks (not implemented in this tutorial).
!
! It's best to list this out in table form:
! 1 is impassable barrier (crevasse)
! -1 is movable block of ice (Not Implemented Yet)
! -2 is the passage to the north exit
! -3 is the passage to the south exit
Array IVEC --> 0 1 1 1 (-2) 1 1 1 1
1 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 0 0 0 1 0 1
<