diff --git a/games/bare.arch b/games/bare.arch index f2aa500..6d41ace 100644 --- a/games/bare.arch +++ b/games/bare.arch @@ -84,10 +84,14 @@ methods # is in the room. Note the use of the write statement: just one string # after the other is printed with no regard to margins. This is OK because # it will wrap the words automatically. - 'FIRSTDESC' : >>Welcome to the demonstration adventure! - >>What you are seeing here is the 'FIRSTDESC' method. - >>Although in this case there is only some writing, there is no problem - >>with putting other executable statements here as well. + 'FIRSTDESC' : +>>Welcome to the demonstration adventure! +>>What you are seeing here is the 'FIRSTDESC' method. +>>Although in this case there is only some writing, there is no problem +>>with putting other executable statements here as well. +>>The '>>' operators chain to create a single statement, so be careful; +>>if you want other executable statements, put braces around this +>>sequence. # The LONGDESC message is sent when the player first sees the room and also # whenever they type "look" by itself at the prompt. diff --git a/games/starship.arch b/games/starship.arch index 37d5f2e..c37c384 100644 --- a/games/starship.arch +++ b/games/starship.arch @@ -84,7 +84,7 @@ methods >>I am awake. >> >>There is nothing to see; my eyes cannot focus on anything. ->>Something is happening around me - happening to me. I feel sharp, +>>Something is happening around me---happening to me. I feel sharp, >>prickling pains along my arms and in my neck, and the sound of tiny >>motors, a sense of something withdrawing from my body. >> @@ -150,6 +150,14 @@ methods times -:= 1 } # else + 'TechnicalIndexLookup' : +>>The cryogenic suspension cell, or "coffin", as it is commonly called +>>because of its appearance, is used for keeping the occupant alive and +>>monitoring their health. It performs the functions of initial freezing, +>>maintenance, and thawing of the suspended individual. These functions are +>>tied into the main computer so that a given individual can be awakened +>>should the computer determine that their specialty is required. + end @@ -361,6 +369,13 @@ methods >>There are no visible controls or buttons of any kind. } + 'TechnicalIndexLookup' : +>>The turbolift serves all six levels and takes its instructions by voice, +>>there being deliberately no controls inside it for the benefit of a crew +>>member arriving with full hands. It says what it wants and will wait +>>indefinitely to be told. It will not open onto a level with no +>>atmosphere. + end @@ -487,7 +502,7 @@ methods 'read' : { if not viewed then { >>The diary seems to belong to the doctor; he has kept extensive notes ->>on his patients - which are of course the crewmembers. The paper is +>>on his patients---which are of course the crewmembers. The paper is >>old by now and crackles when I turn the pages. I am struck by the >>fact that it has probably been many years since all of us went into >>those glass coffins. Most of the entries are personal and I feel like @@ -497,7 +512,7 @@ methods >> viewed := TRUE } ->> "May 17, 2321 - This morning we made the last of the preparations +>> "May 17, 2321---This morning we made the last of the preparations >> before Nap Time, as we have started to refer to the upcoming cryogenic >> suspension. All ship's stores have been removed to the far end of the >> ship and sealed off until arrival. The navigator has laid in our @@ -619,6 +634,16 @@ methods else >>It isn't on. + 'TechnicalIndexLookup' : { +>>This portable counter reports the radiation present in its surroundings. +>>The light shows green when levels are safe, and red when levels are +>>too high to be safe when not wearing protective clothing. + if not activated then { +>>I should remember, next time I have it in my hands, that a counter which is +>>switched off doesn't do any counting. + } + } + end @@ -742,6 +767,13 @@ methods 'lie down on' : 'sit on' 'lay down on' : 'sit on' + 'TechnicalIndexLookup' : +>>The automated medical couch located in Sickbay is a sophisticated device +>>capable of diagnosing and curing a wide range of commonly recognized +>>ailments. Its primary function is to detect and repair cell damage; it can +>>recognize other ailments but cannot always cure them---there is no +>>substitute for a knowledgeable physician. + end @@ -905,6 +937,10 @@ methods >>they look pretty heavy. } + 'TechnicalIndexLookup' : +>>Lead-lined coveralls are heavy, unlovely, and the only thing aboard that +>>lets the wearer linger in a place where radiation levels are high. + end @@ -1038,6 +1074,11 @@ stop "overcome... my last sensations are of pain and heat." } } + 'TechnicalIndexLookup' : +>>The highly radioactive reactor fuel is cast in blocks and stored well +>>away from the engine room until it is wanted. A block is far too heavy +>>to lift and is fitted underneath for gravlifting. + end @@ -1079,6 +1120,11 @@ methods location := player.location; 'MOVE' } + 'TechnicalIndexLookup' : +>>Sheet stock is carried to repair hull damage and must be welded into place. +>>There is nothing in the ship's stores that will hold something this heavy +>>by gripping it. + end @@ -1111,6 +1157,16 @@ powersource antimatter_cell desc : "small antimatter cell" location : hand_blaster +methods + + 'TechnicalIndexLookup' : +>>Small antimatter cells are the standard high-output power source aboard, +>>and drive everything from the gravlifter's hand unit to sidearms. The +>>output is prodigious and cannot be throttled: a device built around a cell +>>is built to survive one, while a device that merely accepts one will do the +>>most violent thing it is capable of doing. Where fine work is wanted, a +>>weaker source is called for. + end @@ -1210,6 +1266,15 @@ methods main.subj.location := UNDEFINED; 'MOVE' -> main.subj } + 'TechnicalIndexLookup' : +>>Apparently its primary feature is the power focusing crystal in the barrel; +>>it is normally powered with an antimatter cell so that it acts as a +>>destructive weapon, but when powered with a much weaker source, it can act +>>as either a light, a surgical instrument, or even an arc welder, depending +>>on the strength of the power cell. A power source as weak as a calculator +>>battery is usually sufficient for arc welding. Eye protection is not +>>optional at welding intensities. + end @@ -1253,7 +1318,7 @@ methods writes "There is a shuddering roar that I can feel through the floor " writes "and walls" if reactor.open then { - writes " - but like an idiot I have left the reactor open! Blazing " + writes "---but like an idiot I have left the reactor open! Blazing " writes "lethal radiation pours out over me and cooks me like a " stop "microwave dinner." } @@ -1308,6 +1373,13 @@ methods "vents, and rods cover the walls. The room is hexagonal ", "and barely large enough to stand in." + 'TechnicalIndexLookup' : +>>The reactor chamber is a part of the engine that's the size of a room. +>>The hexagonal space aft of the engine room is the vessel itself, and fueling +>>it is a question of what is present in the reactor. The chamber door is +>>shielding and not decorative. Engines are started from the panel in the +>>engine room, and the panel will say what it believes the chamber to contain. + end @@ -1318,6 +1390,13 @@ gravhalf lead_waste size : 100 +methods + + 'TechnicalIndexLookup' : +>>Spent fuel is inert and none the lighter for it. A block of it stands in +>>the reactor chamber between firings and is swapped out rather than carried +>>off. Like unspent fuel, it is fitted for gravlifting. + end @@ -1362,6 +1441,11 @@ methods write } + 'TechnicalIndexLookup' : +>>The helmet seals to the suit collar and holds a few minutes of air on its +>>own. That reserve is meant to cover the moment between one supply and the +>>next, and nothing more ambitious than that. + end @@ -1400,6 +1484,11 @@ methods else write "I don't think ", 'DEF' -> main.dobj, " is working." + 'TechnicalIndexLookup' : +>>This standard out-of-ship equipment is comprised primarily of a rubber and +>>vinyl spacesuit. The suit is one piece all the way through the gloves and +>>boots; the only separate pieces are the helmet and air tanks. + end @@ -1555,6 +1644,11 @@ methods 'exit' --> hollow_object } + 'TechnicalIndexLookup' : +>>Cycling the airlock evacuates the antechamber, and it does not ask whether +>>anybody standing in the antechamber is ready. Be wearing an intact spacesuit +>>with full air tanks and a helmet. + end @@ -1730,6 +1824,10 @@ methods else write "I try ", 'DEF' -> main.dobj, ", but I still can't open it." + 'TechnicalIndexLookup' : +>>The standard scientific calculator doesn't do anything the ship's +>>computer can't. Powered by a nine-volt battery. + end @@ -1738,6 +1836,15 @@ powersource battery desc : "nine-volt battery" location : calculator +methods + + 'TechnicalIndexLookup' : +>>The nine-volt dry cell is the humblest source in the catalogue, carried for +>>instruments rather than for equipment: clocks, calculators, hand tools with +>>nothing in them that turns. It fits the same standard socket as far more +>>serious cells, which is a convenience to the technician and ought to be a +>>caution to everybody else. + end @@ -1860,6 +1967,11 @@ object captains_ID syn : "id|card|ID card|captain's ID" location : wallet +methods + + 'TechnicalIndexLookup' : +>>Unfortunately the entry seems to be corrupted; I can't make it out. + end @@ -1894,6 +2006,16 @@ methods 'get' : >>It's way too heavy; not to mention bulky. + # The coin goes in and does not come out, and there is exactly one coin + # aboard. The trap stays; printing the terms where somebody is already + # looking is the difference between a mean puzzle and an unfair one. + + 'look' : { +>>A tall machine with a cloudy plastic front and a coin slot worn bright at +>>the edges. A strip of small print along the bottom reads: NO REFUNDS. NO +>>CHANGE GIVEN. ALL SALES FINAL. + } + 'Insert Me' : if sender ~= quarter then >>Only quarters fit. @@ -1904,6 +2026,11 @@ methods 'MENTION SELF' -> gatorade } + 'TechnicalIndexLookup' : +>>The kitchenette dispenser is coin-operated, a decision which strikes +>>me as remarkably penny-pinching. Or quarter-pinching. +>>It does not give change. It does not give anything back. + end @@ -2070,6 +2197,11 @@ methods write "A gauge on the tanks says there are ", minutes, " minutes remaining." + 'TechnicalIndexLookup' : +>>Air tanks are charged to thirty minutes and must be refilled using +>>an air compressor. The gauge on the side is meant to be read +>>before going out as well as during. + end @@ -2146,6 +2278,10 @@ methods fueled := TRUE } + 'TechnicalIndexLookup' : +>>The compressor in the recreation area is an antique and runs on liquid +>>fuel. Quaint. It is started by hand. Quainter. + end @@ -2322,6 +2458,15 @@ methods else write "It's not plugged into ", 'DEF' -> main.dobj, "." + 'TechnicalIndexLookup' : +>>The anti-gravitational gravlifter, or "lifter", is a device which +>>temporarily neutralizes the ship's artificial gravity over a small region. +>>The portable hand-held unit is only half of the device; the other half is a +>>tray with an outlet that fits the hand-held unit's plug. The tray +>>generally covers the entire lower surface of the object to be lifted. The +>>hand-held unit contains all the power and must be supplied with an +>>antimatter cell in order to work. + end @@ -2335,7 +2480,7 @@ methods 'fore' : briefing_room 'LONGDESC' : { ->>I'm standing in the ship's technical library. The walls are lines with +>>I'm standing in the ship's technical library. The walls are lined with >>thousands of cartridges; an enormous screen set into one wall reads >>"INDEX" in large letters across its screen; there is smaller writing >>beneath that. @@ -2344,6 +2489,36 @@ methods end +# The walls the room description mentions. There is nothing to be done with +# them, but they are the first thing anybody standing in here will try to +# look at, and the index has something to say about them. + +scenery cartridges + + desc : "cartridges" + syn : "cartridge" + pronoun : "them" + location : library + +methods + + 'INDEF' : "some " & desc + + 'get' : >>Not much point; there's nothing to read them with but the room. + + 'look' : +>>Thousands of them, racked from the deck to well above my head: each one a +>>finger's length of dull grey plastic with a printed number on the end and +>>nothing else to say for itself. + + 'TechnicalIndexLookup' : +>>Library cartridges are read by the room and not by hand; there has been no +>>portable reader aboard since the refit before last. The index is the way +>>in. + +end + + readable tech_index desc : "technical index" @@ -2356,8 +2531,10 @@ methods 'look' : >>There's some writing on the screen. 'read' : { - if never_read then + if never_read then { >>Reading the instructions, I discover the following: + never_read := FALSE + } else >>Once again: write "I can \"look up\" any object in the index; ", @@ -2365,59 +2542,30 @@ methods "on it, the entry will be displayed on this screen." } + # Whether the library covers a subject is the subject's own business. An + # object that has something to say about itself answers this message; one + # that has not lets it fall through, and an unhandled message comes back + # ABSENT, which is the whole of "the library doesn't cover it". A bicycle + # repair kit and a quarter need nothing written anywhere to be left out. + # + # Sending is also the asking, so an entry has already printed itself by the + # time the answer comes back. That is why the subject is named first and + # nothing is promised about what follows: the announcement has to be true + # whether an entry turns up or not. + 'look up' : if main.dobj and main.dobj ~= self then write "I don't know how to look up anything in ", 'INDEF' -> main.dobj, "." else { - write "The entry for ", 'DEF' -> main.subj, " appears on the screen." - case main.subj of { - medical_couch : - write "The automated medical couch located in Sickbay is a ", - "sophisticated device capable of diagnosing and curing a wide ", - "range of commonly recognized ailments. Its primary function ", - "is to detect and repair cell damage; it can recognize other ", - "ailments but cannot always cure them - there is no substitute ", - "for a knowledgeable physican." - coffin : - write "The cryogenic suspension cell, or \"coffin\", as it is ", - "commonly called because of its appearance, is used for ", - "keeping the occupant alive and monitoring their health. ", - "It performs the functions of initial freezing, ", - "maintenance, and thawing of the suspended individual. These ", - "functions are tied into the main computer so that a given ", - "individual can be awakened should the computer determine that ", - "their specialty is required." - spacesuit : write "Standard out-of-ship equipment is comprised ", - "primarily of this rubber and vinyl spacesuit. The ", - "suit is one piece all the way through the gloves and ", - "boots; the only separate pieces are the helmet and ", - "air tanks." - gravlifter : - write "The anti-gravitational gravlifter, or \"lifter\", ", - "is a device ", - "which temporarily neutralizes the ", - "ship's artifical gravity over a small region. ", - "The portable hand-held unit is only half of the ", - "device; the other half is a tray with an outlet that fits the ", - "hand-held unit's plug. The tray generally covers the entire ", - "lower surface of the object to be lifted. The hand-held unit ", - "contains all the power and must be supplied with an ", - "antimatter cell in order to work." - hand_blaster : - write "Apparently its primary feature is the power focusing crystal ", - "in the barrel; it is normally powered with an antimatter cell ", - "so that it acts as a destructive weapon, but when powered ", - "with a much weaker source, it can act as either a light, a ", - "surgical instrument, or even an arc welder, depending on the ", - "strength of the power cell. A power source as weak ", - "as a calculator battery is usually sufficient for ", - "arc welding." - default : - write "Unfortunately the entry seems to be corrupted; ", - "I can't make it out." - } # case - } # else + write "I look up ", 'DEF' -> main.subj, " in the index." + if ('TechnicalIndexLookup' -> main.subj) = ABSENT then { +>>The screen prints NO SUCH ENTRY. It is, after all, a technical library. + } + } + + 'TechnicalIndexLookup' : +>>INDEX: see INDEX. end @@ -2540,7 +2688,7 @@ bridge_furniture captains_chair methods 'LONGDESC' : { ->>I'm sitting in the captain's chair - sort of. There is an enormous +>>I'm sitting in the captain's chair---sort of. There is an enormous >>meteor in the way, smashed directly into the center of the chair. meteor_seen := TRUE } @@ -2695,7 +2843,7 @@ methods >>navigational array. Looks like there was a slight course deviation writes "three years ago" if captains_chair.meteor_seen then - writes " - probably that meteor sitting in the captain's chair -" + writes "---probably that meteor sitting in the captain's chair---" writes " that has been steadily getting worse. " if panel.engine_started then { writes "Deftly I make the corrections, feeling the floor vibrate " diff --git a/tests/golden/bare.acx b/tests/golden/bare.acx index 84aa72c..c99909a 100644 Binary files a/tests/golden/bare.acx and b/tests/golden/bare.acx differ