-/* $NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $ */
+/* $NetBSD: movem.c,v 1.10 2019/02/03 03:19:25 mrg Exp $ */
/*
* movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan.
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: movem.c,v 1.7 2009/08/12 08:04:05 dholland Exp $");
+__RCSID("$NetBSD: movem.c,v 1.10 2019/02/03 03:19:25 mrg Exp $");
#endif /* not lint */
#include "header.h"
static short w1[9], w1x[9], w1y[9];
static int tmp1, tmp2, tmp3, tmp4, distance;
void
-movemonst()
+movemonst(void)
{
int i, j;
if (c[TIMESTOP])
*/
static int tmpitem, xl, xh, yl, yh;
static void
-movemt(i, j)
- int i, j;
+movemt(int i, int j)
{
int k, m, z, tmp, xtmp, ytmp, monst;
switch (monst = mitem[i][j]) { /* for half speed monsters */
case OMIRROR:
if (mitem[m][k] == VAMPIRE)
goto smm;
+ /* FALLTHROUGH */
default:
screen[m][k] = 0;
break;
* in (xd,yd).
*/
static void
-mmove(aa, bb, cc, dd)
- int aa, bb, cc, dd;
+mmove(int aa, int bb, int cc, int dd)
{
int tmp, i, flag;
- const char *who = NULL, *p;
+ const char *who = NULL;
flag = 0; /* set to 1 if monster hit by arrow trap */
if ((cc == playerx) && (dd == playery)) {
if (c[BLINDCOUNT])
return; /* if blind don't show where monsters are */
if (know[cc][dd] & 1) {
- p = 0;
if (flag)
cursors();
switch (flag) {
case 1:
- p = "\n%s hits the %s";
+ lprintf("\n%s hits the %s", who, monster[tmp].name);
+ beep();
break;
case 2:
- p = "\n%s hits and kills the %s";
+ lprintf("\n%s hits and kills the %s",
+ who, monster[tmp].name);
+ beep();
break;
case 3:
- p = "\nThe %s%s gets teleported";
- who = "";
- break;
- };
- if (p) {
- lprintf(p, who, monster[tmp].name);
+ lprintf("\nThe %s gets teleported", monster[tmp].name);
beep();
+ break;
}
}
/*
#define SPHMAX 20 /* maximum number of spheres movsphere can
* handle */
static void
-movsphere()
+movsphere(void)
{
int x, y, dir, len;
struct sphere *sp, *sp2;
case 1:
case 2: /* change direction to a random one */
sp->dir = rnd(8);
+ /* FALLTHROUGH */
default: /* move in normal direction */
dir = sp->dir;
len = sp->lifetime;