...probably by the original FOTRAN-to-C translator.
static void blast(void)
/* Blast. No effect unless you've got dynamite, which is a neat trick! */
{
- if (game.prop[ROD2] == STATE_NOTFOUND ||
- !game.closed)
+ if (game.prop[ROD2] == STATE_NOTFOUND || !game.closed)
rspeak(REQUIRES_DYNAMITE);
else {
if (HERE(ROD2)) {
return GO_CLEAROBJ;
}
- if (obj == WATER ||
- obj == OIL) {
- if (!HERE(BOTTLE) ||
- LIQUID() != obj) {
+ if (obj == WATER || obj == OIL) {
+ if (!HERE(BOTTLE) || LIQUID() != obj) {
if (!TOTING(BOTTLE)) {
rspeak(NO_CONTAINER);
return GO_CLEAROBJ;
}
game.prop[BIRD] = BIRD_CAGED;
}
- if ((obj == BIRD ||
- obj == CAGE) &&
+ if ((obj == BIRD || obj == CAGE) &&
(game.prop[BIRD] == BIRD_CAGED || STASHED(BIRD) == BIRD_CAGED)) {
/* expression maps BIRD to CAGE and CAGE to BIRD */
carry(BIRD + CAGE - obj, game.loc);
return GO_CLEAROBJ;
}
- if (AT(obj) ||
- (LIQUID() == obj && AT(BOTTLE)) ||
- obj == LIQLOC(game.loc) ||
- (obj == DWARF && atdwrf(game.loc) > 0)) {
+ if (AT(obj) || (LIQUID() == obj && AT(BOTTLE)) ||
+ obj == LIQLOC(game.loc) || (obj == DWARF && atdwrf(game.loc) > 0)) {
rspeak(YOU_HAVEIT);
return GO_CLEAROBJ;
}
{
bool empty = true;
for (obj_t i = 1; i <= NOBJECTS; i++) {
- if (i == BEAR ||
- !TOTING(i))
+ if (i == BEAR || !TOTING(i))
continue;
if (empty) {
rspeak(NOW_HOLDING);
soundlatch = true;
}
for (obj_t i = 1; i <= NOBJECTS; i++) {
- if (!HERE(i) ||
- objects[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];
/* (ESR) Some unpleasant magic on object states here. Ideally
/* Pour. If no object, or object is bottle, assume contents of bottle.
* special tests for pouring water or oil on plant or rusty door. */
{
- if (obj == BOTTLE ||
- obj == INTRANSITIVE)
- obj = LIQUID();
+ if (obj == BOTTLE || obj == INTRANSITIVE)
+ obj = LIQUID();
if (obj == NO_OBJECT)
return GO_UNKNOWN;
if (!TOTING(obj)) {
return fill(verb, URN);
game.prop[BOTTLE] = EMPTY_BOTTLE;
game.place[obj] = LOC_NOWHERE;
- if (!(AT(PLANT) ||
- AT(DOOR))) {
+ if (!(AT(PLANT) || AT(DOOR))) {
rspeak(GROUND_WET);
return GO_CLEAROBJ;
}
if (HERE(i) && objects[i].texts[0] != NULL && game.prop[i] >= 0)
command.obj = command.obj * NOBJECTS + i;
}
- if (command.obj > NOBJECTS ||
- command.obj == NO_OBJECT ||
- DARK(game.loc))
+ if (command.obj > NOBJECTS || command.obj == NO_OBJECT || DARK(game.loc))
return GO_UNKNOWN;
}
static phase_codes_t wake(verb_t verb, obj_t obj)
/* Wake. Only use is to disturb the dwarves. */
{
- if (obj != DWARF ||
- !game.closed) {
+ if (obj != DWARF || !game.closed) {
speak(actions[verb].message);
return GO_CLEAROBJ;
} else {
static phase_codes_t wave(verb_t verb, obj_t obj)
/* Wave. No effect unless waving rod at fissure or at bird. */
{
- if (obj != ROD ||
- !TOTING(obj) ||
- (!HERE(BIRD) &&
- (game.closng ||
- !AT(FISSURE)))) {
+ if (obj != ROD || !TOTING(obj) || (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
speak(((!TOTING(obj)) && (obj != ROD ||
!TOTING(ROD2))) ?
arbitrary_messages[ARENT_CARRYING] :
FREE_FLY);
return GO_DWARFWAKE;
}
- if (game.closng ||
- !AT(FISSURE)) {
+ if (game.closng || !AT(FISSURE)) {
rspeak((game.prop[BIRD] == BIRD_CAGED) ?
CAGE_FLY :
FREE_FLY);
* will do here. We're preventing interpretation as an intransitive
* verb when the word is unknown. */
command.obj = command.word[1].raw[0] != '\0' ? KEYS : NO_OBJECT;
- if (command.obj == NO_OBJECT ||
- command.obj == INTRANSITIVE) {
+ if (command.obj == NO_OBJECT || command.obj == INTRANSITIVE) {
/* Analyse an intransitive verb (ie, no object given yet). */
switch (command.verb) {
case CARRY:
}
for (int i = 1; i <= NLOCATIONS; i++) {
- if (!(locations[i].description.big == 0 ||
- tkey[i] == 0)) {
+ if (!(locations[i].description.big == 0 || tkey[i] == 0)) {
int k = tkey[i];
if (travel[k].motion == HERE)
conditions[i] |= (1 << COND_FORCED);
* that game.place[CHEST] = LOC_NOWHERE might mean that he's thrown
* it to the troll, but in that case he's seen the chest
* (game.prop[CHEST] == STATE_FOUND). */
- if (game.loc == game.chloc ||
- game.prop[CHEST] != STATE_NOTFOUND)
+ if (game.loc == game.chloc || game.prop[CHEST] != STATE_NOTFOUND)
return true;
int snarfed = 0;
bool movechest = false, robplayer = false;
game.loc == objects[EMERALD].plac)) {
continue;
}
- if (TOTING(treasure) ||
- HERE(treasure))
+ if (TOTING(treasure) || HERE(treasure))
++snarfed;
if (TOTING(treasure)) {
movechest = true;
* steal return toll, and dwarves can't meet the bear. Also
* means dwarves won't follow him into dead end in maze, but
* c'est la vie. They'll wait for him outside the dead end. */
- if (game.loc == LOC_NOWHERE ||
- FORCED(game.loc) ||
- CNDBIT(game.newloc, COND_NOARRR))
+ if (game.loc == LOC_NOWHERE || FORCED(game.loc) || CNDBIT(game.newloc, COND_NOARRR))
return true;
/* Dwarf activity level ratchets up */
* replace him with the alternate. */
if (game.dflag == 1) {
if (!INDEEP(game.loc) ||
- (PCT(95) && (!CNDBIT(game.loc, COND_NOBACK) ||
- PCT(85))))
+ (PCT(95) && (!CNDBIT(game.loc, COND_NOBACK) || PCT(85))))
return true;
game.dflag = 2;
for (int i = 1; i <= 2; i++) {
/* Look for a way to fulfil the motion verb passed in - travel_entry indexes
* the beginning of the motion entries for here (game.loc). */
for (;;) {
- if ((travel[travel_entry].motion == HERE) ||
- travel[travel_entry].motion == motion)
+ if ((travel[travel_entry].motion == HERE) || travel[travel_entry].motion == motion)
break;
if (travel[travel_entry].stop) {
/* Couldn't find an entry matching the motion word passed
if (condtype < cond_not) {
/* YAML N and [pct N] conditionals */
if (condtype == cond_goto || condtype == cond_pct) {
- if (condarg1 == 0 ||
- PCT(condarg1))
+ if (condarg1 == 0 || PCT(condarg1))
break;
/* else fall through */
}
/* YAML [with OBJ] clause */
- else if (TOTING(condarg1) ||
- (condtype == cond_with && AT(condarg1)))
+ else if (TOTING(condarg1) || (condtype == cond_with && AT(condarg1)))
break;
/* else fall through to check [not OBJ STATE] */
} else if (game.prop[condarg1] != condarg2)
game.newloc = (game.loc == LOC_PLOVER)
? LOC_ALCOVE
: LOC_PLOVER;
- if (game.holdng > 1 ||
- (game.holdng == 1 && !TOTING(EMERALD))) {
+ if (game.holdng > 1 || (game.holdng == 1 && !TOTING(EMERALD))) {
game.newloc = game.loc;
rspeak(MUST_DROP);
}
free(firstword);
- if (yes == 0 ||
- y == 0) {
+ if (yes == 0 || y == 0) {
speak(yes_response);
outcome = true;
break;
- } else if (no == 0 ||
- n == 0) {
+ } else if (no == 0 || n == 0) {
speak(no_response);
outcome = false;
break;
--game.holdng;
game.place[object] = where;
}
- if (where == LOC_NOWHERE ||
- where == CARRIED)
+ if (where == LOC_NOWHERE || where == CARRIED)
return;
game.link[object] = game.atloc[where];
game.atloc[where] = object;