* enemies, or no enemies but 2 others. */
{
int spk = ACTSPK[verb];
- int d = ATDWRF(game.loc);
- if (obj == 0) {
- if (d > 0)
+ if (obj == 0 || obj == INTRANSITIVE) {
+ if (ATDWRF(game.loc) > 0)
obj = DWARF;
if (HERE(SNAKE))obj = obj * NOBJECTS + SNAKE;
if (AT(DRAGON) && game.prop[DRAGON] == 0)obj = obj * NOBJECTS + DRAGON;
if (obj == DRAGON)spk = ALREADY_DEAD;
if (obj == TROLL)spk = ROCKY_TROLL;
if (obj == OGRE)spk = OGRE_DODGE;
- if (obj == OGRE && d > 0) {
+ if (obj == OGRE && ATDWRF(game.loc) > 0) {
RSPEAK(spk);
RSPEAK(KNIFE_THROWN);
DESTROY(OGRE);
bool is_oyster = (obj == OYSTER);
spk = is_oyster ? OYSTER_OPENS : PEARL_FALLS;
if (TOTING(obj))spk = is_oyster ? DROP_OYSTER : DROP_CLAM;
- if (!TOTING(TRIDNT))spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER;
+ if (!TOTING(TRIDENT))spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER;
if (verb == LOCK)spk = HUH_MAN;
if (spk == PEARL_FALLS) {
DESTROY(CLAM);
if (HERE(ROD2))
game.bonus = SPLATTER_MESSAGE;
RSPEAK(game.bonus);
- score(endgame);
+ terminate(endgame);
}
}
RSPEAK(GEM_FITS);
game.prop[obj] = 1;
game.prop[CAVITY] = 0;
- if (HERE(RUG) && ((obj == EMRALD && game.prop[RUG] != 2) || (obj == RUBY &&
+ if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY &&
game.prop[RUG] == 2))) {
spk = RUG_RISES;
if (TOTING(RUG))spk = RUG_WIGGLES;
}
} else if (obj == COINS && HERE(VEND)) {
DESTROY(COINS);
- DROP(BATTER, game.loc);
- PSPEAK(BATTER, 0);
+ DROP(BATTERY, game.loc);
+ PSPEAK(BATTERY, 0);
return GO_CLEAROBJ;
} else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) {
RSPEAK(BIRD_BURNT);
game.prop[LAMP] = 0;
RSPEAK(LAMP_OFF);
spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
- } else if (obj == DRAGON || obj == VOLCAN)
+ } else if (obj == DRAGON || obj == VOLCANO)
spk = BEYOND_POWER;
RSPEAK(spk);
return GO_CLEAROBJ;
obj == LIQLOC(game.loc) ||
(obj == DWARF && ATDWRF(game.loc) > 0))
spk = YOU_HAVEIT;
- if (game.closed)spk = NEEDED_NEreplace;
+ if (game.closed)spk = NEEDED_NEARBY;
if (TOTING(obj))spk = ALREADY_CARRYING;
RSPEAK(spk);
return GO_CLEAROBJ;
if (AT(GRATE))obj = GRATE;
if (obj != 0 && HERE(CHAIN)) return GO_UNKNOWN;
if (HERE(CHAIN))obj = CHAIN;
- if (obj == 0) {
+ if (obj == 0 || obj == INTRANSITIVE) {
RSPEAK(spk);
return GO_CLEAROBJ;
}
return chain(verb);
if (game.closng) {
spk = EXIT_CLOSED;
- if (!game.panic)game.clock2 = 15;
+ if (!game.panic)game.clock2 = PANICTIME;
game.panic = true;
} else {
spk = game.prop[GRATE] ? GRATE_LOCKED : ALREADY_LOCKED;
}
}
-static int quit(FILE *input)
+static int quit(void)
/* Quit. Intransitive only. Verify intent and exit if that's what he wants. */
{
- if (YES(input, REALLY_QUIT, OK_MAN, OK_MAN))
- score(quitgame);
+ if (YES(arbitrary_messages[REALLY_QUIT], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
+ terminate(quitgame);
return GO_CLEAROBJ;
}
-static int read(FILE *input, token_t verb, token_t obj)
+static int read(token_t verb, token_t obj)
/* Read. Print stuff based on objtxt. Oyster (?) is special case. */
{
int spk = ACTSPK[verb];
return GO_CLEAROBJ;
}
if (obj == OYSTER && !game.clshnt) {
- game.clshnt = YES(input, CLUE_QUERY, WAYOUT_CLUE, OK_MAN);
+ game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
return GO_CLEAROBJ;
}
PSPEAK(obj, OBJTXT[obj] + game.prop[obj]);
return GO_MOVE;
}
-static int throw (FILE *cmdin, long verb, token_t obj)
+static int throw(FILE *cmdin, long verb, token_t obj)
/* Throw. Same as discard unless axe. Then same as attack except
* ignore bird, and if dwarf is present then one might be killed.
* (Only way to do so!) Axe also special for dragon, bear, and
}
if (obj != AXE)
return (discard(verb, obj, false));
- int i = ATDWRF(game.loc);
- if (i <= 0) {
- if (AT(DRAGON) && game.prop[DRAGON] == 0)
- return throw_support(DRAGON_SCALES);
- if (AT(TROLL))
- return throw_support(TROLL_RETURNS);
- else if (AT(OGRE))
- return throw_support(OGRE_DODGE);
- else if (HERE(BEAR) && game.prop[BEAR] == 0) {
- /* This'll teach him to throw the axe at the bear! */
- DROP(AXE, game.loc);
- game.fixed[AXE] = -1;
- game.prop[AXE] = 1;
- JUGGLE(BEAR);
- RSPEAK(AXE_LOST);
- return GO_CLEAROBJ;
- }
- return (attack(cmdin, verb, 0));
- }
+ else {
+ int i = ATDWRF(game.loc);
+ if (i <= 0) {
+ if (AT(DRAGON) && game.prop[DRAGON] == 0)
+ return throw_support(DRAGON_SCALES);
+ if (AT(TROLL))
+ return throw_support(TROLL_RETURNS);
+ else if (AT(OGRE))
+ return throw_support(OGRE_DODGE);
+ else if (HERE(BEAR) && game.prop[BEAR] == 0) {
+ /* This'll teach him to throw the axe at the bear! */
+ DROP(AXE, game.loc);
+ game.fixed[AXE] = -1;
+ game.prop[AXE] = 1;
+ JUGGLE(BEAR);
+ RSPEAK(AXE_LOST);
+ return GO_CLEAROBJ;
+ }
+ return (attack(cmdin, verb, 0));
+ }
- if (randrange(NDWARVES + 1) < game.dflag) {
- return throw_support(DWARF_DODGES);
+ if (randrange(NDWARVES + 1) < game.dflag) {
+ return throw_support(DWARF_DODGES);
+ } else {
+ game.dseen[i] = false;
+ game.dloc[i] = 0;
+ return throw_support((++game.dkill == 1)
+ ? DWARF_SMOKE : KILLED_DWARF);
+ }
}
- game.dseen[i] = false;
- game.dloc[i] = 0;
- return throw_support((++game.dkill == 1) ? DWARF_SMOKE : KILLED_DWARF);
-}
-
-static int vscore(void)
-/* Score. Call scoring routine but tell it to return. */
-{
- score(scoregame);
- return GO_CLEAROBJ;
}
static int wake(token_t verb, token_t obj)
if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk = ARENT_CARRYING;
if (obj != ROD ||
!TOTING(obj) ||
- (!HERE(BIRD) && (game.closng || !AT(FISSUR)))) {
+ (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
RSPEAK(spk);
return GO_CLEAROBJ;
}
RSPEAK(spk);
return GO_DWARFWAKE;
}
- if (game.closng || !AT(FISSUR)) {
+ if (game.closng || !AT(FISSURE)) {
RSPEAK(spk);
return GO_CLEAROBJ;
}
if (HERE(BIRD))RSPEAK(spk);
- game.prop[FISSUR] = 1 - game.prop[FISSUR];
- PSPEAK(FISSUR, 2 - game.prop[FISSUR]);
+ game.prop[FISSURE] = 1 - game.prop[FISSURE];
+ PSPEAK(FISSURE, 2 - game.prop[FISSURE]);
return GO_CLEAROBJ;
}
}
case 16: /* TOSS */
return GO_UNKNOWN;
case 17: /* QUIT */
- return quit(input);
+ return quit();
case 18: /* FIND */
return GO_UNKNOWN;
case 19: /* INVEN */
blast();
return GO_CLEAROBJ;
case 23: /* SCOR */
- return vscore();
+ score(scoregame);
+ return GO_CLEAROBJ;
case 24: /* FOO */
return bigwords(WD1);
case 25: /* BRIEF */
return brief();
case 26: /* READ */
- return read(input, verb, INTRANSITIVE);
+ return read(verb, INTRANSITIVE);
case 27: /* BREAK */
return GO_UNKNOWN;
case 28: /* WAKE */
return GO_UNKNOWN;
case 29: /* SUSP */
- return suspend(input);
+ return suspend();
case 30: /* RESU */
- return resume(input);
+ return resume();
case 31: /* FLY */
return fly(verb, INTRANSITIVE);
case 32: /* LISTE */
case 33: /* ZZZZ */
return reservoir();
}
- BUG(23);
+ BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
}
/* FALLTHRU */
case transitive:
return GO_CLEAROBJ;
}
case 26: /* READ */
- return read(input, verb, obj);
+ return read(verb, obj);
case 27: /* BREAK */
return vbreak(verb, obj);
case 28: /* WAKE */
case 33: /* ZZZZ */
return reservoir();
}
- BUG(24);
+ BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
case unknown:
/* Unknown verb, couldn't deduce object - might need hint */
SETPRM(1, WD1, WD1X);
RSPEAK(WHAT_DO);
return GO_CHECKHINT;
default:
- BUG(99);
+ BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN);
}
}