Fix formatting of spec
[cloak-of-darkness.git] / cloak-of-darkness.inf
1     ! ============================================================================ !
2     !   Cloak of Darkness - a simple demonstration of Interactive Fiction
3     !       This version for Inform written by Roger Firth on 17Sep99
4     ! Copyright (C) 1999 Roger Firth
5     ! Copying and distribution, with or without modification, are permitted in 
6     ! any medium without royalty provided the copyright notice and this notice 
7     ! are preserved.
8     ! ============================================================================ !
9
10     Constant Story      "Cloak of Darkness";
11     Constant Headline   "^A basic IF demonstration.^";
12     Constant MANUAL_PRONOUNS;
13     Constant MAX_SCORE  2;
14
15     Include "Parser";
16     Include "VerbLib";
17
18     ! ============================================================================ !
19
20     Object  foyer "Foyer of the Opera House"
21       with  description
22                "You are standing in a spacious hall, splendidly decorated in red
23                 and gold, with glittering chandeliers overhead. The entrance from
24                 the street is to the north, and there are doorways south and west.",
25             s_to  bar,
26             w_to  cloakroom,
27             n_to
28                "You've only just arrived, and besides, the weather outside
29                 seems to be getting worse.",
30       has   light;
31
32     Object  cloakroom "Cloakroom"
33       with  description
34                "The walls of this small room were clearly once lined with hooks,
35                 though now only one remains. The exit is a door to the east.",
36             e_to  foyer,
37       has   light;
38
39     Object  hook "small brass hook" cloakroom
40       with  name 'small' 'brass' 'hook' 'peg',
41             description [;
42                 print "It's just a small brass hook, ";
43                 if (self == parent(cloak)) "with a cloak hanging on it.";
44                 "screwed to the wall.";
45                 ],
46       has   scenery supporter;
47
48     Object  bar "Foyer bar"
49       with  description
50                "The bar, much rougher than you'd have guessed after the opulence
51                 of the foyer to the north, is completely empty. There seems to
52                 be some sort of message scrawled in the sawdust on the floor.",
53             n_to  foyer,
54             before [;
55                 Go:
56                     if (self hasnt light && noun ~= n_obj) {
57                         message.number = message.number + 2;
58                         "Blundering around in the dark isn't a good idea!";
59                         }
60                 default:
61                     if (self hasnt light) {
62                         message.number = message.number + 1;
63                         "In the dark? You could easily disturb something!";
64                         }
65                 ],
66       has   ~light;
67
68     Object  cloak "velvet cloak"
69       with  name 'handsome' 'dark' 'black' 'velvet' 'satin' 'cloak',
70             description
71                "A handsome cloak, of velvet trimmed with satin, and slightly
72                 spattered with raindrops. Its blackness is so deep that it
73                 almost seems to suck light from the room.",
74             before [;
75                 Drop, PutOn:
76                     if (location == cloakroom) {
77                         give bar light;
78                         if (action == ##PutOn && self has general) {
79                             give self ~general;
80                             score++;
81                             }
82                         }
83                     else
84                        "This isn't the best place to leave a smart cloak
85                         lying around.";
86                 ],
87             after [;
88                 Take: give bar ~light;
89                 ],
90       has   clothing general;
91
92     Object  message "scrawled message" bar
93       with  name 'message' 'sawdust' 'floor',
94             description [;
95                 if (self.number < 2) {
96                     score++;
97                     deadflag = 2;
98                     print "The message, neatly marked in the sawdust, reads...";
99                     }
100                 else {
101                     deadflag = 3;
102                     print "The message has been carelessly trampled, making it
103                       difficult to read. You can just distinguish the words...";
104                     }
105                 ],
106             number  0,
107       has   scenery;
108
109     [ Initialise;
110         location = foyer;
111         move cloak to player;
112         give cloak worn;
113        "^^Hurrying through the rainswept November night, you're glad to see the
114         bright lights of the Opera House. It's surprising that there aren't more
115         people about but, hey, what do you expect in a cheap demo game...?^^";
116         ];
117
118     [ DeathMessage; print "You have lost"; ];
119
120     ! ============================================================================ !
121
122     Include "Grammar";
123
124     Verb 'hang'     * held 'on' noun    -> PutOn;
125
126     ! ============================================================================ !