# $Id: head.sac,v 1.1 2002/12/24 10:23:00 mike Exp $ # # coc.sa - Scott Adams source file for _The Causes of Chaos_ # # This is a (so far partial) re-implementation of my 1985 adventure # _The Causes of Chaos_, originally written in BASIC for the Commodore # 64. I want to build at least a little chunk of it as a Scott Adams # data file, just prove the SA compiler I'm writing. # # The syntax should be more or less left-explanatory, but see # http://www.miketaylor.org.uk/tech/advent/sac/ # for more on the Scott Adams compiler. # ---------------------------------------------------------------------------- # Global configuration %ident 18399 %version 1 %wordlen 3 %maxload 6 %start nlake %treasury - # special room-name means "carried" # %lighttime is irrelevant: there are no dark areas in this game # Standard synonyms %valias enter go %valias go run %valias walk enter %valias take get %valias leave drop # ---------------------------------------------------------------------------- # Infrastructure actions (I don't think any game would ever omit these) %action inventory %result inventory %action take inventory %result inventory %action score %result score %action save game %result save_game %occur !flag 1 %result set_flag 1 msg Welcome to `The Causes of Chaos` msg Written by Mike Taylor in 1984/5, reimplemented 2001/2 msg Version $Id: head.sac,v 1.1 2002/12/24 10:23:00 mike Exp $ msg ... This is VERY embryonic, not really worth playing yet. nl msg Your task is to reunite the six crown jewels of Ix: msg silver chain, goblet, ruby, medallion, crown and sceptre. msg See http://www.miketaylor.org.uk/tech/advent/coc/ for more info. # ---------------------------------------------------------------------------- # Use of flags # flag 1: Set forever once welcome message has been printed. # flag 2: Potion has been drunk. # flag 3: Set on "tie rope" until "to what?" is answered. # # Use of saved locations # location 1: ### not yet # # Use of counters: # counter 1: ### not yet # ---------------------------------------------------------------------------- # Rooms, Items and associated Actions # Was room 1 in original %room nlake to the North of a very wide lake. The ground is very soft here %exit n outcrop %exit e nriver %exit w waterfall %action help at nlake %result msg A mysterious voice says: msg `It is not advisable to swim the lake` # Was room 2 in original %room nriver to the North of a fast-flowing river which feeds a lake %exit w nlake # Was room 3 in original %room waterfall by a huge waterfall which plunges majestically over a cliff %exit n cliff %exit e nlake %action help at waterfall %result msg A mysterious voice says: msg `What's at the bottom?` # Was room 4 in original %room bottom at the bottom of a huge waterfall which roars deafeningly %exit n beach %exit u waterfall # Was room 5 in original %room cliff standing at the top of a cliff, with a 2000 feet drop straight down %exit s waterfall %exit e outcrop %action help at cliff %result msg A mysterious voice says: msg `The cliff is very important.` # Was room 6 in original %room lake in the middle of a vast lake full of piranha! %exit n nlake %exit s slake %exit e lake # Was room 7 in original %room slake on the South shore of a lake %exit n nlake # Was room 8 in original %room outcrop standing by a rocky outcrop, near to an ornately carved door %exit s nlake %exit w cliff # Was room 9 in original %room ledge on a narrow ledge high up a cliff to the South of a slippery path %exit n slippery %exit u cliff %action help at ledge %result msg A mysterious voice says: msg `Be very careful on the path!` # Was room 10 in original %room slippery on a slippery North/South path %exit n mountain_plateau %exit s ledge # Was room 11 in original %room mountain_plateau on a very cold rocky plateau half way up a very tall cliff %exit s slippery # Was room 12 in original %room maze1 just inside the entrance to an oppressively dark maze %exit n pit # Was room 13 in original %room maze2 lost in an underground maze. # Was room 14 in original %room maze3 lost in an underground maze. # Was room 15 in original %room maze4 lost in an underground maze. # Was room 16 in original %room maze5 lost in an underground maze. # Was room 17 in original %room maze6 lost in an underground maze. # Was room 18 in original %room maze7 lost in an underground maze. # Was room 19 in original %room maze8 lost in an underground maze. # Was room 20 in original %room pit at the bottom of a deep pit with completely smooth walls %exit s maze8 # Was room 21 in original %room clearing in a clearing above a pit, just to the South of a bridge %exit n bridge %exit e forest_path %exit d pit # Was room 22 in original %room wtunnel at the Western end of a narrow, muddy, and warm tunnel %exit e tunnel %exit w mountain_plateau # Was room 23 in original %room tunnel in a hot tunnel which leads to the very heart of the mountain %exit w wtunnel %exit d fire_chamber %action help at tunnel %result msg A mysterious voice says: msg `Don't go any further witout the right msg items ...` # Was room 24 in original %room fire_chamber in a vast fiery chamber in the heart of a mountain %exit u tunnel # Was room 25 in original %room forest_path walking along an overgrown forest path between a clearing and a well %exit e glade %exit w clearing # Was room 26 in original %room bridge on a sturdily constructed wooden bridge over a deep chasm %exit n gorge %exit s clearing %action help at bridge %result msg A mysterious voice says: msg `The grass is always greener ...` # Was room 27 in original %room gorge in a narrow gorge which leads to the North and the South %exit n gorge %exit s bridge # Was room 28 in original %room glade in a beautiful illuminated glade hidden deep in a forest %exit w forest_path %action help at glade %result msg A mysterious voice says: msg `More to this than meets the eye ...` # Was room 29 in original %room well at the bottom of a very deep well which is quite dark and very damp %action help at well %result msg A mysterious voice says: msg `There is no escape from here.` # Was room 30 in original %room cave_plateau on a small rocky plateau above a wooden door, and by a cave-mouth %exit e gravel_path %exit d outcrop %action help at cave_plateau %result msg A mysterious voice says: msg `The guards are Dentrassi!` # Was room 31 in original %room cave in a small, warm cave %exit s cave_plateau %action help at cave %result msg A mysterious voice says: msg `You'll have to look for what you want.` # Was room 32 in original %room beach on a wide sandy beach. The sea, to the West is very cold %exit n dock %exit s bottom # Was room 33 in original %room gravel_path on a gravel path form the West, which ends here %exit w cave_plateau # Was room 34 in original %room refuse standing in the middle of a pile of refuse from a coal-mine %exit s gravel_path # Was room 35 in original %room hidden_cave in a small hidden cave %exit u refuse ### What happened to rooms 36-48? See 'passage' file # Was room 36 in original %room room36 in a non-existent passage! # Was room 37 in original %room room37 in a non-existent passage! # Was room 38 in original %room room38 in a non-existent passage! # Was room 39 in original %room room39 in a non-existent passage! # Was room 40 in original %room room40 in a non-existent passage! # Was room 41 in original %room room41 in a non-existent passage! # Was room 42 in original %room room42 in a non-existent passage! # Was room 43 in original %room room43 in a non-existent passage! # Was room 44 in original %room room44 in a non-existent passage! # Was room 45 in original %room room45 in a non-existent passage! # Was room 46 in original %room room46 in a non-existent passage! # Was room 47 in original %room room47 in a non-existent passage! # Was room 48 in original %room room48 in a non-existent passage! # Was room 49 in original %room servants in the servants' quarters %action help at servants %result msg A mysterious voice says: msg `Doesn't the place look untidy?` # Was room 50 in original %room cellar in a hidden cellar which smells strongly of cheese # Was room 51 in original %room large_case inside a large packaging Case # Was room 52 in original %room vault in a secret vault. There is an overwhelming stench of putrefaction %action help at vault %result msg A mysterious voice says: msg `Bats have very good hearing ...` # Was room 53 in original %room chamber in a vast chamber. Every sound echoes about alarmingly # Was room 54 in original %room freezer in a storage-room full of frozen bodies %action help at freezer %result msg A mysterious voice says: msg `It's creepy in here!` # Was room 55 in original %room sauna in a very hot, very humid sauna. Steam rises all around you # Was room 56 in original %room tower at the bottom of a clock-tower. Stairs lead upwards from here # Was room 57 in original %room laboratory in a very untidy laboratory # Was room 58 in original %room cupboard in a very dusty broom-cupboard # Was room 59 in original %room playroom in the castle playroom # Was room 60 in original %room gatehouse standing inside the gatehouse of Count Vladimir's castle # Was room 61 in original %room hall in a vast vaulted hall, decorated by colourful tapestries # Was room 62 in original %room castle at the end of a gravel path, by Count Vladimir's castle # Was room 63 in original %room top at the top of a tall bell-tower. There are openings in all four walls %action help at top %result msg A mysterious voice says: msg `It's about seventy feet down!` # Was room 64 in original %room falling walking off the top of a tower. You're falling ... Splurk! # Was room 65 in original %room shore on the Eastern shore of a land covered with trees # Was room 66 in original %room forest1 lost in a dark forest of oaks. # Was room 67 in original %room forest2 lost in a dark forest of oaks. # Was room 68 in original %room forest3 lost in a dark forest of oaks. # Was room 69 in original %room forest4 lost in a dark forest of oaks. # Was room 70 in original %room forest5 lost in a dark forest of oaks. # Was room 71 in original %room galley in the ship's galley %action help at galley %result msg A mysterious voice says: msg `Yo ho ho ...` # Was room 72 in original %room deck on the deck of a small merchant- ship bound for Ognid # Was room 73 in original %room cabin in the Captain's cabin # Was room 74 in original %room sailors in the Sailors' quarters. There is a damp smell # Was room 75 in original %room hold in the Hold. There is a spicy smell, and one box is empty # Was room 76 in original %room brig in the Brig %action help at brig %result msg A mysterious voice says: msg `YOU can't do anything to escape!` # Was room 77 in original %room small_case inside a small packing case # Was room 78 in original %room dock standing at a dock, near a sandy beach to the South # Was item 1 in original %item gauntlets a pair of brown leather Gauntlets %getdrop gau %nowhere %at nlake # value=15, weight=2, strength=99, wearable # Was item 2 in original %item lake a vast Lake stretching out of sight %nowhere %at nlake # Was item 3 in original %item river a fast-flowing River to the South %nowhere %at nriver # Was item 4 in original %item waterfall a vast crashing Waterfall %nowhere %at waterfall # Was item 5 in original %item barrel a large sturdy Barrel %getdrop bar %nowhere %at nriver # value=10, weight=25, strength=50, wearable # Was item 6 in original %item telescope a Telescope, mounted on a podium %nowhere %at cliff # Was item 7 in original %item piranha deadly Piranha all around you %nowhere %at lake # Was item 8 in original %item rope a very long Rope %getdrop rop %nowhere %at slake # value=5, weight=5, strength=99 # Was item 9 in original %item door a locked wooden Door %nowhere %at outcrop # Was item 10 in original %item potion a leather bottle containing a Potion %getdrop pot %nowhere %at bottom # value=30, weight=2, strength=55 # Was item 11 in original %item key a delicate crystal Key %getdrop key %nowhere %at ledge # value=40, weight=3, strength=0 # Was item 12 in original %item rock a small but heavy volcanic Rock %getdrop roc %nowhere %at pit # value=3, weight=8, strength=30 # Was item 13 in original %item tunnel the entrance to a narrow muddy Tunnel %nowhere %at mountain_plateau # Was item 14 in original %item sign a small wooden Sign %getdrop sig %nowhere %at maze4 # value=5, weight=10, strength=30 # Was item 15 in original %item furnace a huge Furnace in the center of the cave melting the nearby rocks %nowhere %at fire_chamber # Was item 16 in original %item cloak a heavy elven Cloak %getdrop clo %nowhere %at bottom # value=20, weight=15, strength=99, wearable # Was item 17 in original %item demon a huge malevolent fire-Demon %nowhere %at fire_chamber # Was item 18 in original %item headdress a large ornate Headdress %getdrop hea %nowhere %at fire_chamber # value=10, weight=15, strength=70, wearable # Was item 19 in original %item note a crumpled Note %getdrop not %nowhere %at clearing # value=0, weight=1, strength=99 # Was item 20 in original %item troll a huge Troll, covered with warts %nowhere %at bridge # Was item 21 in original %item well a quaint old rustic-looking Well (with some graffiti on it) %nowhere %at glade # Was item 22 in original %item coin a small gold Coin %getdrop coi %nowhere %at gorge # value=12, weight=1, strength=80 # Was item 23 in original %item crown an immensely valuable jewelled Crown %getdrop cro %nowhere # value=100, weight=8, strength=70, wearable # Was item 24 in original %item mud lots of very gooey mud %nowhere %at well # Was item 25 in original %item bucket a sturdy wooden Bucket %getdrop buc %nowhere %at nlake # value=5, weight=5, strength=70 # Was item 26 in original %item sausage a foul-looking blue Sausage %getdrop sau %nowhere %at well # value=10, weight=2, strength=99 # Was item 27 in original %item steps a set of slimy Steps cut into the rock %nowhere %at outcrop # Was item 28 in original %item cave the well-guarded entrance to a Cave %nowhere %at cave_plateau # Was item 29 in original %item dentrassi four poisoned Dentrassi %nowhere %at cave # Was item 30 in original %item salt a bag of Salt %getdrop sal %nowhere %at mountain_plateau # value=10, weight=8, strength=99 # Was item 31 in original %item chain a fine silver Chain %getdrop cha %nowhere # value=75, weight=4, strength=99, wearable # Was item 32 in original %item spade a large heavy Spade %getdrop spa %nowhere %at maze1 # value=5, weight=15, strength=70 # Was item 33 in original %item book a leather-bound Book %getdrop boo %nowhere # value=25, weight=3, strength=99 # Was item 34 in original %item ruby a huge hollow Ruby %getdrop rub %nowhere # value=100, weight=7, strength=10 # Was item 35 in original %item coal a pile of Coal %nowhere %at gravel_path # Was item 36 in original %item slab a huge Slab of marble %getdrop sla %nowhere %at refuse # value=0, weight=99, strength=60 # Was item 37 in original %item trapdoor a jammed Trapdoor set into the rock %nowhere # Was item 38 in original %item rod a short iron Rod %getdrop rod %nowhere %at outcrop # value=5, weight=5, strength=80 # Was item 55 in original %item medallion a valuable gold Medallion %getdrop med %nowhere # value=106, weight=3, strength=99, wearable # Was item 56 in original %item goblet a delicate crystal Goblet %getdrop gob %nowhere %at hidden_cave # value=130, weight=2, strength=10 # Was item 57 in original %item broom an old wooden Broom %getdrop bro %nowhere %at cupboard # value=3, weight=7, strength=99 # Was item 58 in original %item bedding straw Bedding strewn around %nowhere %at servants # Was item 59 in original %item servant a sleeping Servant %nowhere %at servants # Was item 60 in original %item box a large wooden Box %nowhere %at cellar # Was item 61 in original %item rack a Rack of spices %nowhere %at cellar # Was item 62 in original %item footholds a set of Footholds leads downwards .. %nowhere %at large_case # Was item 63 in original %item coffin a Coffin with a heavy stone lid %nowhere %at vault # Was item 64 in original %item outline the Outline of a huge door in the wall to the West %nowhere %at vault # Was item 65 in original %item sceptre a jewel-encrusted Sceptre %getdrop sce %nowhere %at chamber # value=250, weight=10, strength=99 # Was item 66 in original %item staircase a stone Staircase descends from here %nowhere # Was item 67 in original %item corpse a large frozen Corpse %getdrop cor %nowhere %at freezer # value=0, weight=35, strength=99 # Was item 68 in original %item abwahsi a wise old man called Abwahsi %nowhere %at tower # Was item 69 in original %item gas a cylinder of poisonous Gas %getdrop gas %nowhere %at laboratory # value=10, weight=15, strength=99 # Was item 70 in original %item cupboard a broom Cupboard %nowhere %at playroom # Was item 71 in original %item baby a vampire's Baby %nowhere %at playroom # Was item 72 in original %item doll a Doll with two holes in its neck %getdrop dol %nowhere %at hidden_cave # value=3, weight=2, strength=99 # Was item 73 in original %item portcullis a solid Portcullis bars the way North %nowhere %at gatehouse # Was item 74 in original %item dynamite a stick of Dynamite wedged in the wall %nowhere %at gatehouse # Was item 75 in original %item match a safety Match %nowhere %at gorge # Was item 76 in original %item bell a large bronze Bell %nowhere %at top # Was item 77 in original %item carpet a rolled-up Carpet %getdrop car %nowhere # value=10, weight=12, strength=99 # Was item 78 in original %item mess a large red Mess %nowhere %at falling # Was item 79 in original %item poster a Poster on the wall says 'SILENCE!' %nowhere %at room44 # Was item 80 in original %item path a gravel Path leads off to the East %nowhere %at forest5 # Was item 81 in original %item trees lots of oak Trees %nowhere # Was item 82 in original %item ship a large wooden Ship %nowhere %at dock # Was item 83 in original %item cheese a lump of yellow Cheese %getdrop che %nowhere %at galley # value=1, weight=1, strength=99 # Was item 84 in original %item log the captain's Log %getdrop log %nowhere %at small_case # value=5, weight=4, strength=99 # Was item 85 in original %item sailors several angry-looking Sailors %nowhere %at sailors # Was item 86 in original %item rum a bottle of Rum %getdrop rum %nowhere %at sailors # value=5, weight=3, strength=99 # Was item 87 in original %item case a small empty Case %getdrop cas %nowhere %at hold # value=0, weight=99, strength=99 # Was item 88 in original %item rats lots of hungry Rats %nowhere %at small_case # Was item 89 in original %item hatch an open Hatch set into the deck %nowhere %at deck # Was item 90 in original %item cook the Cook, a very large man %nowhere %at galley # Was item 91 in original %item brig the Brig, to the East %nowhere %at hold # Was item 92 in original %item raven a Raven perching on a tree %nowhere %at forest2 # Was item 93 in original %item waterfall_steps stone Steps descend by the waterfall %nowhere # ---------------------------------------------------------------------------- # Actions, together with their additional objects. The original # Causes of Chaos used to mess about with object descriptions and # properties as the game was running, which the Scott Adams system # can't do. Instead, when we want to change an object, we substitute # a similar one. %item barrel_worn a large sturdy Barrel (which you are wearing) %nowhere # We'd like to say you can wear the barrel without having to pick it # up first, but then we'd have to walk through a logic maze to check # that we're not already carrying %maxload items in that case. Much # easier just to require that it's already being carried %action wear bar carried barrel %result swap barrel_worn barrel msg OK. %action remove bar carried barrel_worn %result swap barrel_worn barrel msg OK. %action go waterfall at waterfall carried barrel_worn %result msg You crash downwards, and arrive at the msg bottom, badly brused. msg OK. moveto bottom %action go waterfall at waterfall %result msg You crash downwards to your doom ... msg Your character is dead. game_over %item bottle an empty leather Bottle %nowhere %action drink pot accessible potion %result msg You feel strangely invulnerable ... set_flag 2 swap potion bottle %action swim lake here lake %result msg OK. moveto lake %occur at lake !flag 2 %result pause msg You are attacked by piranha! msg Your character us dead. game_over %item hanging_rope Rope hanging over the cliff %nowhere %action tie rope carried rope %result msg Tell me in two words to what. Eg: msg To Barrel set_flag 3 %action tie rope %result msg You can't see it from here. %action tie %result msg You can't tie a print_noun %action to tel flag 3 here telescope %result destroy rope drop hanging_rope msg OK. %action to tel flag 3 %result msg You can't see it from here. clear_flag 3 %action to flag 3 %result msg You can't tie a rope to a print_noun clear_flag 3 %action climb rope here hanging_rope %result msg OK. moveto ledge %action go tunnel here tunnel %result moveto wtunnel %item cloak_worn a heavy elven Cloak (which you are wearing) %nowhere %action wear clo carried cloak %result swap cloak_worn cloak msg OK. %action remove clo carried cloak_worn %result swap cloak_worn cloak msg OK. %occur at fire_chamber !carried cloak_worn %result msg The heat is so powerful, you slump to msg the floor unconcious! # ^s -- missing letter! nl msg The fire demon eats your inert body. msg Your character is dead. game_over # ---------------------------------------------------------------------------- # Postamble actions (must fire after body actions) %action help %result msg Sorry - I can't help you. %action examine %result msg OK. msg You see nothing special. %action wait %result msg OK. msg Time passes ... %action panic %result msg OK. msg `Yaaaaaaaarrrrgh!` msg Nothing happens ... %action jump %result msg Wheeeee! %action say %result msg OK print_noun nl msg Nothing happens ...