From: Jason Self Date: Wed, 24 Jan 2018 16:19:58 +0000 (-0800) Subject: Add Cloak of Darkness specification and example X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0c8901095ee48cd4dbf53d541f61230f637f6968;p=cloak-of-darkness.git Add Cloak of Darkness specification and example --- 0c8901095ee48cd4dbf53d541f61230f637f6968 diff --git a/README b/README new file mode 100644 index 0000000..c6da222 --- /dev/null +++ b/README @@ -0,0 +1,18 @@ +This repository contains the Cloak of Darkness specification +originally from Roger Firth at + + +Relicensing was done with permission of Roger Firth. + +The documents in this repository, including this one, are made +following Pandoc's extended version of Markdown: +. + +Converting them to other formats requires that Pandoc or some other +program that can understand this version of Markdown be installed on +your system. + +--- +This document by Jason Self is licensed under the Creative Commons +Attribution-ShareAlike 4.0 International Public License and all +future versions: . \ No newline at end of file diff --git a/cloak-of-darkness.inf b/cloak-of-darkness.inf new file mode 100644 index 0000000..e8d748c --- /dev/null +++ b/cloak-of-darkness.inf @@ -0,0 +1,126 @@ + ! ============================================================================ ! + ! Cloak of Darkness - a simple demonstration of Interactive Fiction + ! This version for Inform written by Roger Firth on 17Sep99 + ! Copyright (C) 1999 Roger Firth + ! Copying and distribution, with or without modification, are permitted in + ! any medium without royalty provided the copyright notice and this notice + ! are preserved. + ! ============================================================================ ! + + Constant Story "Cloak of Darkness"; + Constant Headline "^A basic IF demonstration.^"; + Constant MANUAL_PRONOUNS; + Constant MAX_SCORE 2; + + Include "Parser"; + Include "VerbLib"; + + ! ============================================================================ ! + + Object foyer "Foyer of the Opera House" + with description + "You are standing in a spacious hall, splendidly decorated in red + and gold, with glittering chandeliers overhead. The entrance from + the street is to the north, and there are doorways south and west.", + s_to bar, + w_to cloakroom, + n_to + "You've only just arrived, and besides, the weather outside + seems to be getting worse.", + has light; + + Object cloakroom "Cloakroom" + with description + "The walls of this small room were clearly once lined with hooks, + though now only one remains. The exit is a door to the east.", + e_to foyer, + has light; + + Object hook "small brass hook" cloakroom + with name 'small' 'brass' 'hook' 'peg', + description [; + print "It's just a small brass hook, "; + if (self == parent(cloak)) "with a cloak hanging on it."; + "screwed to the wall."; + ], + has scenery supporter; + + Object bar "Foyer bar" + with description + "The bar, much rougher than you'd have guessed after the opulence + of the foyer to the north, is completely empty. There seems to + be some sort of message scrawled in the sawdust on the floor.", + n_to foyer, + before [; + Go: + if (self hasnt light && noun ~= n_obj) { + message.number = message.number + 2; + "Blundering around in the dark isn't a good idea!"; + } + default: + if (self hasnt light) { + message.number = message.number + 1; + "In the dark? You could easily disturb something!"; + } + ], + has ~light; + + Object cloak "velvet cloak" + with name 'handsome' 'dark' 'black' 'velvet' 'satin' 'cloak', + description + "A handsome cloak, of velvet trimmed with satin, and slightly + spattered with raindrops. Its blackness is so deep that it + almost seems to suck light from the room.", + before [; + Drop, PutOn: + if (location == cloakroom) { + give bar light; + if (action == ##PutOn && self has general) { + give self ~general; + score++; + } + } + else + "This isn't the best place to leave a smart cloak + lying around."; + ], + after [; + Take: give bar ~light; + ], + has clothing general; + + Object message "scrawled message" bar + with name 'message' 'sawdust' 'floor', + description [; + if (self.number < 2) { + score++; + deadflag = 2; + print "The message, neatly marked in the sawdust, reads..."; + } + else { + deadflag = 3; + print "The message has been carelessly trampled, making it + difficult to read. You can just distinguish the words..."; + } + ], + number 0, + has scenery; + + [ Initialise; + location = foyer; + move cloak to player; + give cloak worn; + "^^Hurrying through the rainswept November night, you're glad to see the + bright lights of the Opera House. It's surprising that there aren't more + people about but, hey, what do you expect in a cheap demo game...?^^"; + ]; + + [ DeathMessage; print "You have lost"; ]; + + ! ============================================================================ ! + + Include "Grammar"; + + Verb 'hang' * held 'on' noun -> PutOn; + + ! ============================================================================ ! \ No newline at end of file diff --git a/spec.md b/spec.md new file mode 100644 index 0000000..f927458 --- /dev/null +++ b/spec.md @@ -0,0 +1,58 @@ +# The \"Cloak of Darkness\" specification + +Implementations should try be made as similar as possible. That is, +things like object names and room descriptions should be identical, +and the general flow of the game should be pretty comparable. Having +said that, games are implemented using the native capabilities of the +various systems, using features that a beginner might be expected to +master; there shouldn\'t be any need to resort to assembler routines, +library hacks, or other advanced techniques. The target is to write +naturally and simply, while sticking as closely as possible to the +goal of making the games directly equivalent. + +\"Cloak of Darkness\" is not going to win prizes for its prose, +imagination or subtlety. Or scope: it can be played to a successful +conclusion in five or six moves, so it\'s not going to keep you +guessing for long. (On the other hand, it may qualify as the most +widely-available game in the history of the genre.) There are just +three rooms and three objects. + +- The **Foyer** of the Opera House is where the game begins. This + empty room has doors to the south and west, also an unusable exit + to the north. There is nobody else around. +- The **Bar** lies south of the **Foyer**, and is initially unlit. + Trying to do anything other than return northwards results in a + warning message about disturbing things in the dark. +- On the wall of the **Cloakroom**, to the west of the **Foyer**, is + fixed a small brass **hook**. +- Taking an inventory of possessions reveals that the player is + wearing a black velvet **cloak** which, upon examination, is found + to be light-absorbent. The player can drop the **cloak** on the + floor of the **Cloakroom** or, better, put it on the **hook**. +- Returning to the **Bar** without the **cloak** reveals that the + room is now lit. A **message** is scratched in the sawdust on the + floor. +- The **message** reads either \"You have won\" or \"You have + lost\", depending on how much it was disturbed by the player while + the room was dark. +- The act of reading the **message** ends the game. + +And that\'s all there is to it\... + +# Acknowledgements + +Thanks to Stuart Allen, Mike Arnautov, Steve Breslin, Neil Cerutti, Al +Golden, Stephen Griffiths, Mark Hughes, John Menichelli, Todd Nathan, +Roger Plowman, Roddie Ramieson, Robin Rawson-Tetley, Dan Shiovitz, +Kent Tessman, Alex Warren and Campbell Wild for contributing versions +of \"Cloak of Darkness\". Not forgetting the special debt of gratitude +we owe to those who created the authoring systems, without whom we\'d +probably still be adventuring in FORTRAN. + +# Licensing + +Copyright (C) Roger Firth + +Copying and distribution, with or without modification, are permitted +in any medium without royalty provided the copyright notice and this +notice are preserved. \ No newline at end of file