pspeak(DRAGON, look, 3);
game.prop[DRAGON] = 1;
game.prop[RUG] = 0;
- int k = (object_descriptions[DRAGON].plac + object_descriptions[DRAGON].fixd) / 2;
+ int k = (objects[DRAGON].plac + objects[DRAGON].fixd) / 2;
move(DRAGON + NOBJECTS, -1);
move(RUG + NOBJECTS, 0);
move(DRAGON, k);
move(RUG, k);
drop(BLOOD, k);
for (obj = 1; obj <= NOBJECTS; obj++) {
- if (game.place[obj] == object_descriptions[DRAGON].plac || game.place[obj] == object_descriptions[DRAGON].fixd)
+ if (game.place[obj] == objects[DRAGON].plac || game.place[obj] == objects[DRAGON].fixd)
move(obj, k);
}
game.loc = k;
return GO_CLEAROBJ;
}
game.foobar = 0;
- if (game.place[EGGS] == object_descriptions[EGGS].plac || (TOTING(EGGS) && game.loc == object_descriptions[EGGS].plac)) {
+ if (game.place[EGGS] == objects[EGGS].plac || (TOTING(EGGS) && game.loc == objects[EGGS].plac)) {
rspeak(spk);
return GO_CLEAROBJ;
} else {
game.prop[TROLL] = 1;
k = 2;
if (HERE(EGGS))k = 1;
- if (game.loc == object_descriptions[EGGS].plac)k = 0;
- move(EGGS, object_descriptions[EGGS].plac);
+ if (game.loc == objects[EGGS].plac)k = 0;
+ move(EGGS, objects[EGGS].plac);
pspeak(EGGS, look, k);
return GO_CLEAROBJ;
}
} else {
spk = CHAIN_LOCKED;
if (game.prop[CHAIN] != 0)spk = ALREADY_LOCKED;
- if (game.loc != object_descriptions[CHAIN].plac)spk = NO_LOCKSITE;
+ if (game.loc != objects[CHAIN].plac)spk = NO_LOCKSITE;
if (spk != CHAIN_LOCKED) {
rspeak(spk);
return GO_CLEAROBJ;
if (spk != RUG_WIGGLES) {
int k = 2 - game.prop[RUG];
game.prop[RUG] = k;
- if (k == 2) k = object_descriptions[SAPPH].plac;
+ if (k == 2) k = objects[SAPPH].plac;
move(RUG + NOBJECTS, k);
}
}
rspeak(TROLL_SCAMPERS);
move(TROLL, 0);
move(TROLL + NOBJECTS, 0);
- move(TROLL2, object_descriptions[TROLL].plac);
- move(TROLL2 + NOBJECTS, object_descriptions[TROLL].fixd);
+ move(TROLL2, objects[TROLL].plac);
+ move(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
game.prop[TROLL] = 2;
- } else if (obj != VASE || game.loc == object_descriptions[PILLOW].plac) {
+ } else if (obj != VASE || game.loc == objects[PILLOW].plac) {
rspeak(OK_MAN);
} else {
game.prop[VASE] = 2;
spk = NO_MESSAGE;
}
for (int i = 1; i <= NOBJECTS; i++) {
- if (!HERE(i) || object_descriptions[i].sounds[0] == NULL || game.prop[i] < 0)
+ if (!HERE(i) || objects[i].sounds[0] == NULL || game.prop[i] < 0)
continue;
int mi = game.prop[i];
if (i == BIRD)
if (command.obj == INTRANSITIVE) {
command.obj = 0;
for (int i = 1; i <= NOBJECTS; i++) {
- if (HERE(i) && object_descriptions[i].texts[0] != NULL && game.prop[i] >= 0)
+ if (HERE(i) && objects[i].texts[0] != NULL && game.prop[i] >= 0)
command.obj = command.obj * NOBJECTS + i;
}
if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
rspeak(NO_SEE, command.wd1, command.wd1x);
} else if (command.obj == OYSTER && !game.clshnt && game.closed) {
game.clshnt = yes(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
- } else if (object_descriptions[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
+ } else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
rspeak(actspk[command.verb]);
} else
pspeak(command.obj, study, game.prop[command.obj]);
rspeak(spk);
return GO_CLEAROBJ;
}
- if (object_descriptions[command->obj].is_treasure && AT(TROLL)) {
+ if (objects[command->obj].is_treasure && AT(TROLL)) {
spk = TROLL_SATISFIED;
/* Snarf a treasure for the troll. */
drop(command->obj, 0);
move(TROLL, 0);
move(TROLL + NOBJECTS, 0);
- drop(TROLL2, object_descriptions[TROLL].plac);
- drop(TROLL2 + NOBJECTS, object_descriptions[TROLL].fixd);
+ drop(TROLL2, objects[TROLL].plac);
+ drop(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
rspeak(spk);
return GO_CLEAROBJ;
point_loss: 10
message: 'Good grief, don''t you *EVER* give up? Do you realize you''ve spent\nover 2500 turns at this? That''s another ten points off, a total of\ntwenty points lost for taking so long.'
-object_descriptions: !!omap
+objects: !!omap
- OBJ_0:
inventory: !!null
longs: !!null
* "FIXD". Also, since two-placed objects are typically best
* described last, we'll drop them first. */
for (int i = NOBJECTS; i >= 1; i--) {
- if (object_descriptions[i].fixd > 0) {
- drop(i + NOBJECTS, object_descriptions[i].fixd);
- drop(i, object_descriptions[i].plac);
+ if (objects[i].fixd > 0) {
+ drop(i + NOBJECTS, objects[i].fixd);
+ drop(i, objects[i].plac);
}
}
for (int i = 1; i <= NOBJECTS; i++) {
int k = NOBJECTS + 1 - i;
- game.fixed[k] = object_descriptions[k].fixd;
- if (object_descriptions[k].plac != 0 && object_descriptions[k].fixd <= 0)
- drop(k, object_descriptions[k].plac);
+ game.fixed[k] = objects[k].fixd;
+ if (objects[k].plac != 0 && objects[k].fixd <= 0)
+ drop(k, objects[k].plac);
}
/* Treasure props are initially -1, and are set to 0 the first time
* not yet found, so we know when to close the cave. */
game.tally = 0;
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
- if (object_descriptions[treasure].is_treasure) {
- if (object_descriptions[treasure].inventory != 0)
+ if (objects[treasure].is_treasure) {
+ if (objects[treasure].inventory != 0)
game.prop[treasure] = -1;
game.tally = game.tally - game.prop[treasure];
}
int snarfed = 0;
bool movechest = false, robplayer = false;
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
- if (!object_descriptions[treasure].is_treasure)
+ if (!objects[treasure].is_treasure)
continue;
/* Pirate won't take pyramid from plover room or dark
* room (too easy!). */
- if (treasure == PYRAMID && (game.loc == object_descriptions[PYRAMID].plac || game.loc == object_descriptions[EMERALD].plac)) {
+ if (treasure == PYRAMID && (game.loc == objects[PYRAMID].plac || game.loc == objects[EMERALD].plac)) {
continue;
}
if (TOTING(treasure) || HERE(treasure))
if (robplayer) {
rspeak(PIRATE_POUNCES);
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
- if (!object_descriptions[treasure].is_treasure)
+ if (!objects[treasure].is_treasure)
continue;
- if (!(treasure == PYRAMID && (game.loc == object_descriptions[PYRAMID].plac || game.loc == object_descriptions[EMERALD].plac))) {
+ if (!(treasure == PYRAMID && (game.loc == objects[PYRAMID].plac || game.loc == objects[EMERALD].plac))) {
if (AT(treasure) && game.fixed[treasure] == 0)
carry(treasure, game.loc);
if (TOTING(treasure))
game.prop[TROLL] = 0;
move(TROLL2, 0);
move(TROLL2 + NOBJECTS, 0);
- move(TROLL, object_descriptions[TROLL].plac);
- move(TROLL + NOBJECTS, object_descriptions[TROLL].fixd);
+ move(TROLL, objects[TROLL].plac);
+ move(TROLL + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
game.newloc = game.loc;
return true;
} else {
- game.newloc = object_descriptions[TROLL].plac + object_descriptions[TROLL].fixd - game.loc;
+ game.newloc = objects[TROLL].plac + objects[TROLL].fixd - game.loc;
if (game.prop[TROLL] == 0)game.prop[TROLL] = 1;
if (!TOTING(BEAR)) return true;
rspeak(BRIDGE_COLLAPSE);
}
move(TROLL, 0);
move(TROLL + NOBJECTS, 0);
- move(TROLL2, object_descriptions[TROLL].plac);
- move(TROLL2 + NOBJECTS, object_descriptions[TROLL].fixd);
+ move(TROLL2, objects[TROLL].plac);
+ move(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
if (game.prop[BEAR] != 3)DESTROY(BEAR);
game.prop[CHAIN] = 0;
va_start(ap, skip);
switch (mode) {
case touch:
- vspeak(object_descriptions[msg].inventory, ap);
+ vspeak(objects[msg].inventory, ap);
break;
case look:
- vspeak(object_descriptions[msg].longs[skip], ap);
+ vspeak(objects[msg].longs[skip], ap);
break;
case hear:
- vspeak(object_descriptions[msg].sounds[skip], ap);
+ vspeak(objects[msg].sounds[skip], ap);
break;
case study:
- vspeak(object_descriptions[msg].texts[skip], ap);
+ vspeak(objects[msg].texts[skip], ap);
break;
}
va_end(ap);
const char** longs;
const char** sounds;
const char** texts;
-}} object_description_t;
+}} object_t;
typedef struct {{
const char* small;
}} vocabulary_t;
extern const location_t locations[];
-extern const object_description_t object_descriptions[];
+extern const object_t objects[];
extern const char* arbitrary_messages[];
extern const class_t classes[];
extern const turn_threshold_t turn_thresholds[];
{}
}};
-enum object_descriptions_refs {{
+enum object_refs {{
{}
}};
{}
}};
-const object_description_t object_descriptions[] = {{
+const object_t objects[] = {{
{}
}};
loc_str = loc_str[:-1] # trim trailing newline
return loc_str
-def get_object_descriptions(obj):
+def get_objects(obj):
template = """ {{ // {}
.inventory = {},
.plac = {},
get_class_messages(db["classes"]),
get_turn_thresholds(db["turn_thresholds"]),
get_locations(db["locations"]),
- get_object_descriptions(db["object_descriptions"]),
+ get_objects(db["objects"]),
get_obituaries(db["obituaries"]),
get_hints(db["hints"], db["arbitrary_messages"]),
get_condbits(db["locations"]),
h = h_template.format(
len(db["locations"])-1,
- len(db["object_descriptions"])-1,
+ len(db["objects"])-1,
len(db["hints"]),
len(db["classes"]),
len(db["obituaries"]),
len(db["vocabulary"]),
get_refs(db["arbitrary_messages"]),
get_refs(db["locations"]),
- get_refs(db["object_descriptions"]),
+ get_refs(db["objects"]),
statedefines,
)
* Give the poor guy 2 points just for finding each treasure. */
mxscor = 0;
for (int i = 1; i <= NOBJECTS; i++) {
- if (!object_descriptions[i].is_treasure)
+ if (!objects[i].is_treasure)
continue;
- if (object_descriptions[i].inventory != 0) {
+ if (objects[i].inventory != 0) {
long k = 12;
if (i == CHEST)k = 14;
if (i > CHEST)k = 16;