aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/acci.h
blob: c80f09d9b98c2a324bae225fb3cb1f12a3b695d6 (plain)
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

/*
 * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
 * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
 */

#ifndef __acci_h__
#define __acci_h__

namespace Avalanche {

/* verb codes */
const char vb_exam = '\1';
const char vb_open = '\2';
const char vb_pause = '\3';
const char vb_get = '\4';
const char vb_drop = '\5';
const char vb_inv = '\6';
const char vb_talk = '\7';
const char vb_give = '\10';
const char vb_drink = '\11';
const char vb_load = '\12';
const char vb_save = '\13';
const char vb_pay = '\14';
const char vb_look = '\15';
const char vb_break = '\16';
const char vb_quit = '\17';
const char vb_sit = '\20';
const char vb_stand = '\21';
const char vb_go = '\22';
const char vb_info = '\23';
const char vb_undress = '\24';
const char vb_wear = '\25';
const char vb_play = '\26';
const char vb_ring = '\27';
const char vb_help = '\30';
const char vb_larrypass = '\31';
const char vb_phaon = '\32';
const char vb_boss = '\33';
const char vb_pee = '\34';
const char vb_cheat = '\35';
const char vb_magic = '\36';
const char vb_restart = '\37';
const char vb_eat = '\40';
const char vb_listen = '\41';
const char vb_buy = '\42';
const char vb_attack = '\43';
const char vb_password = '\44';
const char vb_dir = '\45';
const char vb_die = '\46';
const char vb_score = '\47';
const char vb_put = '\50';
const char vb_kiss = '\51';
const char vb_climb = '\52';
const char vb_jump = '\53';
const char vb_highscores = '\54';
const char vb_wake = '\55';
const char vb_hello = '\56';
const char vb_thanks = '\57';

const char vb_smartalec = '\371';
const char vb_expletive = '\375';

const char pardon = '\376'; /* =didn't understand / wasn't given. */

struct vocab {
	byte n;
	varying_string<11> w;
};

struct ranktype {
	word score;
	varying_string<12> title;
};


const integer nowords = 277; /* how many words does the parser know? */
const char nowt = '\372';
const char moved = '\0'; /* This word was moved. (Usually because it was the subject of
  conversation.) */

const integer first_password = 89; /* Words[first_password] should equal "TIROS". */

const array<1, nowords, vocab> words =

    /* Verbs, 1-49 */
{	{	{1, "EXAMINE"},   {1, "READ"},      {1, "XAM"},                  /* short */
		{2, "OPEN"},      {2, "LEAVE"},     {2, "UNLOCK"},
		{3, "PAUSE"},     {47, "TA"},            /* Early to avoid Take and Talk. */
		{4, "TAKE"},      {4, "GET"},       {4, "PICK"},
		{5, "DROP"},      {6, "INVENTORY"}, {7, "TALK"},
		{7, "SAY"},       {7, "ASK"},
		{8, "GIVE"},      {9, "DRINK"},     {9, "IMBIBE"},
		{9, "DRAIN"},     {10, "LOAD"},      {10, "RESTORE"},
		{11, "SAVE"},      {12, "BRIBE"},     {12, "PAY"},
		{13, "LOOK"},      {14, "BREAK"},     {15, "QUIT"},
		{15, "EXIT"},      {16, "SIT"},       {16, "SLEEP"},
		{17, "STAND"},

		{18, "GO"},        {19, "INFO"},      {20, "UNDRESS"},
		{20, "DOFF"},
		{21, "DRESS"},     {21, "WEAR"},      {21, "DON"},
		{22, "PLAY"},
		{22, "STRUM"},     {23, "RING"},      {24, "HELP"},
		{25, "KENDAL"},    {26, "CAPYBARA"},  {27, "BOSS"},
		{255, "NINET"},    /* block for NINETY */
		{28, "URINATE"},   {28, "MINGITE"},   {29, "NINETY"},
		{30, "ABRACADABRA"}, {30, "PLUGH"},     {30, "XYZZY"},
		{30, "HOCUS"},     {30, "POCUS"},     {30, "IZZY"},
		{30, "WIZZY"},     {30, "PLOVER"},
		{30, "MELENKURION"}, {30, "ZORTON"},    {30, "BLERBI"},
		{30, "THURB"},     {30, "SNOEZE"},    {30, "SAMOHT"},
		{30, "NOSIDE"},    {30, "PHUGGG"},    {30, "KNERL"},
		{30, "MAGIC"},     {30, "KLAETU"},    {30, "VODEL"},
		{30, "BONESCROLLS"}, {30, "RADOF"},

		{31, "RESTART"},
		{32, "SWALLOW"},   {32, "EAT"},       {33, "LISTEN"},
		{33, "HEAR"},      {34, "BUY"},       {34, "PURCHASE"},
		{34, "ORDER"},     {34, "DEMAND"},
		{35, "ATTACK"},    {35, "HIT"},       {35, "KILL"},
		{35, "PUNCH"},     {35, "KICK"},      {35, "SHOOT"},
		{35, "FIRE"},

		/* Passwords, 36: */

		{36, "TIROS"},     {36, "WORDY"},     {36, "STACK"},
		{36, "SHADOW"},    {36, "OWL"},       {36, "ACORN"},
		{36, "DOMESDAY"},  {36, "FLOPPY"},    {36, "DIODE"},
		{36, "FIELD"},     {36, "COWSLIP"},   {36, "OSBYTE"},
		{36, "OSCLI"},     {36, "TIMBER"},    {36, "ADVAL"},
		{36, "NEUTRON"},   {36, "POSITRON"},  {36, "ELECTRON"},
		{36, "CIRCUIT"},   {36, "AURUM"},     {36, "PETRIFY"},
		{36, "EBBY"},      {36, "CATAPULT"},  {36, "GAMERS"},
		{36, "FUDGE"},     {36, "CANDLE"},    {36, "BEEB"},
		{36, "MICRO"},     {36, "SESAME"},    {36, "LORDSHIP"},

		{37, "DIR"},       {37, "LS"},        {38, "DIE"},
		{39, "SCORE"},
		{40, "PUT"},       {40, "INSERT"},    {41, "KISS"},
		{41, "SNOG"},      {41, "CUDDLE"},    {42, "CLIMB"},
		{42, "CLAMBER"},   {43, "JUMP"},      {44, "HIGHSCORES"},
		{44, "HISCORES"},  {45, "WAKEN"},     {45, "AWAKEN"},
		{46, "HELLO"},     {46, "HI"},        {46, "YO"},
		{47, "THANKS"},       /* = 47, "ta", which was defined earlier. */


		/* Nouns - Objects: 50-100. */

		{50, "WINE"},      {50, "BOOZE"},    {50, "NASTY"},
		{50, "VINEGAR"},   {51, "MONEYBAG"},
		{51, "BAG"},       {51, "CASH"},     {51, "DOSH"},
		{51, "WALLET"},
		{52, "BODKIN"},    {52, "DAGGER"},   {53, "POTION"},
		{54, "CHASTITY"},  {54, "BELT"},     {55, "BOLT"},
		{55, "ARROW"},     {55, "DART"},
		{56, "CROSSBOW"},  {56, "BOW"},      {57, "LUTE"},
		{58, "PILGRIM"},   {58, "BADGE"},    {59, "MUSHROOMS"},
		{59, "TOADSTOOLS"}, {60, "KEY"},      {61, "BELL"},
		{62, "PRESCRIPT"}, {62, "SCROLL"},   {62, "MESSAGE"},
		{63, "PEN"},       {63, "QUILL"},    {64, "INK"},
		{64, "INKPOT"},    {65, "CLOTHES"},  {66, "HABIT"},
		{66, "DISGUISE"},  {67, "ONION"},

		{99, "PASSWORD"},

		/* Objects from Also are placed between 101 and 131. */

		/* Nouns - People - Male, 150-174 */
		{150, "AVVY"},      {150, "AVALOT"},    {150, "YOURSELF"},
		{150, "ME"},        {150, "MYSELF"},    {151, "SPLUDWICK"},
		{151, "THOMAS"},    {151, "ALCHEMIST"}, {151, "CHEMIST"},
		{152, "CRAPULUS"},  {152, "SERF"},      {152, "SLAVE"},
		{158, "DU"},      /* <<< Put in early for Baron DU Lustie to save confusion with Duck & Duke.*/
		{152, "CRAPPY"},    {153, "DUCK"},      {153, "DOCTOR"},
		{154, "MALAGAUCHE"},
		{155, "FRIAR"},     {155, "TUCK"},      {156, "ROBIN"},
		{156, "HOOD"},      {157, "CWYTALOT"},  {157, "GUARD"},
		{157, "BRIDGEKEEP"}, {158, "BARON"},     {158, "LUSTIE"},
		{159, "DUKE"},      {159, "GRACE"},     {160, "DOGFOOD"},
		{160, "MINSTREL"},  {161, "TRADER"},    {161, "SHOPKEEPER"},
		{161, "STALLHOLDER"},
		{162, "PILGRIM"},   {162, "IBYTHNETH"}, {163, "ABBOT"},
		{163, "AYLES"},     {164, "PORT"},      {165, "SPURGE"},
		{166, "JACQUES"},   {166, "SLEEPER"},   {166, "RINGER"},

		/* Nouns- People - Female: 175-199 */
		{175, "WIFE"},      {175, "ARKATA"},    {176, "GEDALODAVA"},
		{176, "GEIDA"},     {176, "PRINCESS"},  {178, "WISE"},
		{178, "WITCH"},

		/* Pronouns, 200-224 */
		{200, "HIM"},       {200, "MAN"},       {200, "GUY"},
		{200, "DUDE"},      {200, "CHAP"},      {200, "FELLOW"},
		{201, "HER"},       {201, "GIRL"},      {201, "WOMAN"},
		{202, "IT"},        {202, "THING"},

		{203, "MONK"},       {204, "BARMAN"},    {204, "BARTENDER"},

		/* Prepositions, 225-249 */
		{225, "TO"},        {226, "AT"},        {227, "UP"},
		{228, "INTO"},      {228, "INSIDE"},    {229, "OFF"},
		{230, "UP"},        {231, "DOWN"},      {232, "ON"},


		/* Please, 251 */
		{251, "PLEASE"},

		/* About, 252 */
		{252, "ABOUT"}, {252, "CONCERNING"},

		/* Swear words, 253 */
		/*              I M P O R T A N T    M E S S A G E

		   DO *NOT* READ THE LINES BELOW IF YOU ARE OF A SENSITIVE
		   DISPOSITION. THOMAS IS *NOT* RESPONSIBLE FOR THEM.
		   GOODNESS KNOWS WHO WROTE THEM.
		   READ THEM AT YOUR OWN RISK. BETTER STILL, DON'T READ THEM.
		   WHY ARE YOU SNOOPING AROUND IN MY PROGRAM, ANYWAY? */

		{253, "SHIT"},      {28 , "PISS"},    {28 , "PEE"},
		{253, "FART"},      {253, "FUCK"},    {253, "BALLS"},
		{253, "BLAST"},     {253, "BUGGER"},  {253, "KNICKERS"},
		{253, "BLOODY"},    {253, "HELL"},    {253, "DAMN"},
		{253, "SMEG"},
		/* and other even ruder words. You didn't read them, did you? Good. */

		/* Answer-back smart-alec words, 249 */
		{249, "YES"},       {249, "NO"},        {249, "BECAUSE"},

		/* Noise words, 255 */
		{255, "THE"},       {255, 'A'},         {255, "NOW"},
		{255, "SOME"},      {255, "AND"},       {255, "THAT"},
		{255, "POCUS"},     {255, "HIS"},
		{255, "THIS"},      {255, "SENTINEL"}
	}
};        /* for "Ken SENT Me" */

const char what[] = "That's not possible!";

const array<1, 9, ranktype> ranks = {
	{	{0, "Beginner"},    {10, "Novice"},
		{20, "Improving"},   {35, "Not bad"},
		{50, "Passable"},    {65, "Good"},
		{80, "Experienced"}, {108, "The BEST!"},
		{maxint, "copyright'93"}
	}
};


#ifdef __acci_implementation__
#undef EXTERN
#define EXTERN
#endif

EXTERN varying_string<11> thats;
EXTERN varying_string<20> unknown;
EXTERN array<1, 11, varying_string<20> > realwords;
EXTERN char verb, person, thing, thing2;
EXTERN boolean polite;
#undef EXTERN
#define EXTERN extern


void clearwords();
void parse();
void lookaround();
void opendoor();
void do_that();
void verbopt(char n, string &answer, char &anskey);
void have_a_drink();

} // End of namespace Avalanche.

#endif