-/* $NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkshop.c,v 1.11 2011/08/07 06:03:45 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkshop.c,v 1.11 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "extern.h"
#include "def.mkroom.h"
#include "def.eshk.h"
+
#define ESHK ((struct eshk *)(&(shk->mextra[0])))
-const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50}; /* their probabilities */
+
+/* their probabilities */
+static const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50};
+
+static const struct permonst *morguemon(void);
+static int nexttodoor(int, int);
+static int has_dnstairs(struct mkroom *);
+static int has_upstairs(struct mkroom *);
+static int isbig(struct mkroom *);
+static int dist2(int, int, int, int);
+static int sq(int);
void
mkshop(void)
return;
shk->isshk = shk->mpeaceful = 1;
shk->msleep = 0;
- shk->mtrapseen = ~0; /* we know all the traps already */
+ shk->mtrapseen = ~0U; /* we know all the traps already */
ESHK->shoproom = roomno;
ESHK->shoplevel = dlevel;
ESHK->shd = doors[sh];
}
}
-const struct permonst *
+static const struct permonst *
morguemon(void)
{
int i = rn2(100), hd = rn2(dlevel);
}
}
-int
+static int
nexttodoor(int sx, int sy)
{
int dx, dy;
return (0);
}
-int
+static int
has_dnstairs(struct mkroom *sroom)
{
return (sroom->lx <= xdnstair && xdnstair <= sroom->hx &&
sroom->ly <= ydnstair && ydnstair <= sroom->hy);
}
-int
+static int
has_upstairs(struct mkroom *sroom)
{
return (sroom->lx <= xupstair && xupstair <= sroom->hx &&
sroom->ly <= yupstair && yupstair <= sroom->hy);
}
-int
+static int
isbig(struct mkroom *sroom)
{
int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly);
return (area > 20);
}
-int
+static int
dist2(int x0, int y0, int x1, int y1)
{
return ((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));
}
-int
+static int
sq(int a)
{
return (a * a);