-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcloak.inf
176 lines (148 loc) · 4.84 KB
/
cloak.inf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
!% -~S
!% $OMIT_UNUSED_ROUTINES=1
!% $ZCODE_LESS_DICT_DATA=1
! The very first lines of the main source code file for a game can
! contain compiler options, like the lines above. -~S disables
! strict error checking. This is otherwise used in z5 and z8 games by
! default. While useful for debugging, it adds ~10 KB to the story file
! size and it makes the game slower.
! $OMIT_UNUSED_ROUTINES=1 makes the compiler remove all routines which
! aren't used. This can save some space.
! ============================================================================ !
! Cloak of Darkness - a simple demonstration of Interactive Fiction
! This version for INFORM written by Roger Firth on 17Sep99
! ============================================================================ !
! When compiling to z8, use the standard library instead
#Iftrue (#version_number == 8);
Constant USEINFORM;
Constant MANUAL_PRONOUNS;
#Endif;
Constant Story "Cloak of Darkness";
Constant Headline "^A basic IF demonstration.^";
Constant MAX_SCORE 2;
Release 3;
Serial "221116";
Constant STATUSLINE_SCORE; Statusline score;
Constant INITIAL_LOCATION_VALUE = foyer;
[ DeathMessage; print "You have lost"; ];
#Ifndef USEINFORM;
Include "globals.h";
Include "puny.h";
#Endif;
#Ifdef USEINFORM;
Include "Parser";
Include "VerbLib";
#Endif;
! ============================================================================ !
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 [ _test;
Look, Inv, Going:
rfalse;
Go:
#ifdef USEINFORM;
_test = self hasnt light && noun ~= n_obj;
#IfNot;
_test = self hasnt light && selected_direction ~= n_to;
#EndIf;
if (_test) {
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
parse_name [ _words;
while(NextWord() == 'handsome' or 'dark' or 'black' or 'velvet' or 'satin' or 'cloak') _words++;
return _words;
],
! 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)
"This isn't the best place to leave a smart cloak
lying around.";
],
after [;
Take: give bar ~light;
Drop, PutOn:
if (location == cloakroom) {
give bar light;
if (action == ##PutOn && self has general) {
give self ~general;
score++;
}
}
],
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;
#Ifdef USEINFORM; ! The location is set with INITIAL_LOCATION_VALUE in PunyInform
location = foyer;
#Endif;
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...?^^";
];
! ============================================================================ !
#Ifdef USEINFORM;
Include "Grammar";
#Endif;
Verb 'hang' * held 'on' noun -> PutOn;
! ============================================================================ !