-/* $NetBSD: execute.c,v 1.10 2011/08/31 16:24:56 plunky Exp $ */
+/* $NetBSD: execute.c,v 1.12 2014/03/29 21:38:54 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: execute.c,v 1.10 2011/08/31 16:24:56 plunky Exp $");
+__RCSID("$NetBSD: execute.c,v 1.12 2014/03/29 21:38:54 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
{
PLAYER *newp;
int x, y;
- FLAG moved;
+ bool moved;
BULLET *bp;
y = pp->p_y;
break;
}
- moved = FALSE;
+ moved = false;
switch (Maze[y][x]) {
case SPACE:
#ifdef RANDOM
case DOOR:
#endif
- moved = TRUE;
+ moved = true;
break;
case WALL1:
case WALL2:
else
pickup(pp, y, x, 50, Maze[y][x]);
Maze[y][x] = SPACE;
- moved = TRUE;
+ moved = true;
break;
case SHOT:
case GRENADE:
#endif
bp = is_bullet(y, x);
if (bp != NULL)
- bp->b_expl = TRUE;
+ bp->b_expl = true;
Maze[y][x] = SPACE;
- moved = TRUE;
+ moved = true;
break;
case LEFTS:
case RIGHT:
else
message(pp, "You can hobble around on one boot.");
Maze[y][x] = SPACE;
- moved = TRUE;
+ moved = true;
break;
#endif
}
}
if (pp->p_undershot) {
fixshots(pp->p_y, pp->p_x, pp->p_over);
- pp->p_undershot = FALSE;
+ pp->p_undershot = false;
}
- drawplayer(pp, FALSE);
+ drawplayer(pp, false);
pp->p_over = Maze[y][x];
pp->p_y = y;
pp->p_x = x;
- drawplayer(pp, TRUE);
+ drawplayer(pp, true);
}
}
{
if (pp->p_face != dir) {
pp->p_face = dir;
- drawplayer(pp, TRUE);
+ drawplayer(pp, true);
}
}
outstr(pp, Buf, 3);
add_shot(shot_type[req_index], pp->p_y, pp->p_x, pp->p_face,
- shot_req[req_index], pp, FALSE, pp->p_face);
- pp->p_undershot = TRUE;
+ shot_req[req_index], pp, false, pp->p_face);
+ pp->p_undershot = true;
/*
* Show the object to everyone
outstr(pp, Buf, 3);
add_shot(SLIME, pp->p_y, pp->p_x, pp->p_face,
- slime_req[req_index] * SLIME_FACTOR, pp, FALSE, pp->p_face);
- pp->p_undershot = TRUE;
+ slime_req[req_index] * SLIME_FACTOR, pp, false, pp->p_face);
+ pp->p_undershot = true;
/*
* Show the object to everyone
* pickup:
* check whether the object blew up or whether he picked it up
*/
-void
+static void
pickup(PLAYER *pp, int y, int x, int prob, int obj)
{
int req;
abort();
}
if (rand_num(100) < prob)
- add_shot(obj, y, x, LEFTS, req, NULL, TRUE, pp->p_face);
+ add_shot(obj, y, x, LEFTS, req, NULL, true, pp->p_face);
else {
pp->p_ammo += req;
(void) snprintf(Buf, sizeof(Buf), "%3d", pp->p_ammo);