WARNS=5
This commit is contained in:
parent
16c47bfce7
commit
c34afa686b
@ -1,10 +1,10 @@
|
||||
/* $NetBSD: create.c,v 1.11 2008/02/03 19:29:50 dholland Exp $ */
|
||||
/* $NetBSD: create.c,v 1.12 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* create.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: create.c,v 1.11 2008/02/03 19:29:50 dholland Exp $");
|
||||
__RCSID("$NetBSD: create.c,v 1.12 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "header.h"
|
||||
@ -29,7 +29,7 @@ static void checkgen(void);
|
||||
this is called at the beginning of a game and at no other time
|
||||
*/
|
||||
void
|
||||
makeplayer()
|
||||
makeplayer(void)
|
||||
{
|
||||
int i;
|
||||
scbr();
|
||||
@ -72,8 +72,7 @@ makeplayer()
|
||||
Note that it is here we remove genocided monsters from the present level.
|
||||
*/
|
||||
void
|
||||
newcavelevel(x)
|
||||
int x;
|
||||
newcavelevel(int x)
|
||||
{
|
||||
int i, j;
|
||||
if (beenhere[level])
|
||||
@ -116,8 +115,7 @@ newcavelevel(x)
|
||||
static int mx, mxl, mxh, my, myl, myh, tmp2;
|
||||
|
||||
static void
|
||||
makemaze(k)
|
||||
int k;
|
||||
makemaze(int k)
|
||||
{
|
||||
int i, j, tmp;
|
||||
int z;
|
||||
@ -177,8 +175,7 @@ makemaze(k)
|
||||
function to eat away a filled in maze
|
||||
*/
|
||||
void
|
||||
eat(xx, yy)
|
||||
int xx, yy;
|
||||
eat(int xx, int yy)
|
||||
{
|
||||
int dir, try;
|
||||
dir = rnd(4);
|
||||
@ -241,8 +238,7 @@ eat(xx, yy)
|
||||
* - random object
|
||||
*/
|
||||
static int
|
||||
cannedlevel(k)
|
||||
int k;
|
||||
cannedlevel(int k)
|
||||
{
|
||||
char *row;
|
||||
int i, j;
|
||||
@ -318,8 +314,7 @@ cannedlevel(k)
|
||||
level V3 has potion of cure dianthroritis and demon prince
|
||||
*/
|
||||
static void
|
||||
treasureroom(lv)
|
||||
int lv;
|
||||
treasureroom(int lv)
|
||||
{
|
||||
int tx, ty, xsize, ysize;
|
||||
|
||||
@ -341,8 +336,7 @@ treasureroom(lv)
|
||||
* the coordinate given is that of the upper left corner of the room
|
||||
*/
|
||||
static void
|
||||
troom(lv, xsize, ysize, tx, ty, glyph)
|
||||
int lv, xsize, ysize, tx, ty, glyph;
|
||||
troom(int lv, int xsize, int ysize, int tx, int ty, int glyph)
|
||||
{
|
||||
int i, j;
|
||||
int tp1, tp2;
|
||||
@ -399,8 +393,7 @@ troom(lv, xsize, ysize, tx, ty, glyph)
|
||||
subroutine to create the objects in the maze for the given level
|
||||
*/
|
||||
static void
|
||||
makeobject(j)
|
||||
int j;
|
||||
makeobject(int j)
|
||||
{
|
||||
int i;
|
||||
if (j == 0) {
|
||||
@ -493,11 +486,13 @@ makeobject(j)
|
||||
*/
|
||||
|
||||
static void
|
||||
fillmroom(n, what, arg)
|
||||
int n, arg;
|
||||
char what;
|
||||
fillmroom(int n, int what_i, int arg)
|
||||
{
|
||||
int i;
|
||||
char what;
|
||||
|
||||
/* truncate to char width (just in case it matters) */
|
||||
what = (char)what_i;
|
||||
for (i = 0; i < n; i++)
|
||||
fillroom(what, arg);
|
||||
}
|
||||
@ -514,11 +509,13 @@ froom(int n, int theitem, int arg)
|
||||
* uses a random walk
|
||||
*/
|
||||
static void
|
||||
fillroom(what, arg)
|
||||
int arg;
|
||||
char what;
|
||||
fillroom(int what_i, int arg)
|
||||
{
|
||||
int x, y;
|
||||
char what;
|
||||
|
||||
/* truncate to char width (just in case it matters) */
|
||||
what = (char)what_i;
|
||||
|
||||
#ifdef EXTRA
|
||||
c[FILLROOM]++;
|
||||
@ -552,8 +549,7 @@ fillroom(what, arg)
|
||||
monsters
|
||||
*/
|
||||
int
|
||||
fillmonst(what)
|
||||
int what;
|
||||
fillmonst(int what)
|
||||
{
|
||||
int x, y, trys;
|
||||
for (trys = 5; trys > 0; --trys) { /* max # of creation attempts */
|
||||
@ -575,8 +571,7 @@ fillmonst(what)
|
||||
if sethp(1) then wipe out old monsters else leave them there
|
||||
*/
|
||||
static void
|
||||
sethp(flg)
|
||||
int flg;
|
||||
sethp(int flg)
|
||||
{
|
||||
int i, j;
|
||||
if (flg)
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: diag.c,v 1.12 2008/02/03 19:20:41 dholland Exp $ */
|
||||
/* $NetBSD: diag.c,v 1.13 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* diag.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: diag.c,v 1.12 2008/02/03 19:20:41 dholland Exp $");
|
||||
__RCSID("$NetBSD: diag.c,v 1.13 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -176,8 +176,7 @@ diagdrawscreen()
|
||||
*/
|
||||
static time_t zzz = 0;
|
||||
int
|
||||
savegame(fname)
|
||||
char *fname;
|
||||
savegame(char *fname)
|
||||
{
|
||||
int i, k;
|
||||
struct sphere *sp;
|
||||
@ -242,8 +241,7 @@ savegame(fname)
|
||||
}
|
||||
|
||||
void
|
||||
restoregame(fname)
|
||||
char *fname;
|
||||
restoregame(char *fname)
|
||||
{
|
||||
int i, k;
|
||||
struct sphere *sp, *sp2;
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: display.c,v 1.10 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* display.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: display.c,v 1.9 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: display.c,v 1.10 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "header.h"
|
||||
@ -26,26 +26,26 @@ static char always = 0;
|
||||
now for the bottom line of the display
|
||||
*/
|
||||
void
|
||||
bottomline()
|
||||
bottomline(void)
|
||||
{
|
||||
recalc();
|
||||
bot1f = 1;
|
||||
}
|
||||
|
||||
void
|
||||
bottomhp()
|
||||
bottomhp(void)
|
||||
{
|
||||
bot2f = 1;
|
||||
}
|
||||
|
||||
void
|
||||
bottomspell()
|
||||
bottomspell(void)
|
||||
{
|
||||
bot3f = 1;
|
||||
}
|
||||
|
||||
void
|
||||
bottomdo()
|
||||
bottomdo(void)
|
||||
{
|
||||
if (bot1f) {
|
||||
bot3f = bot1f = bot2f = 0;
|
||||
@ -63,7 +63,7 @@ bottomdo()
|
||||
}
|
||||
|
||||
void
|
||||
bot_linex()
|
||||
bot_linex(void)
|
||||
{
|
||||
int i;
|
||||
if (cbak[SPELLS] <= -50 || (always)) {
|
||||
@ -142,7 +142,7 @@ bot_linex()
|
||||
called from ogold()
|
||||
*/
|
||||
void
|
||||
bottomgold()
|
||||
bottomgold(void)
|
||||
{
|
||||
botsub(makecode(GOLD, 69, 19), "%-6ld");
|
||||
/* botsub(GOLD,"%-6ld",69,19); */
|
||||
@ -244,8 +244,7 @@ botsub(int idx, const char *str)
|
||||
static int d_xmin = 0, d_xmax = MAXX, d_ymin = 0, d_ymax = MAXY;
|
||||
|
||||
void
|
||||
draws(xmin, xmax, ymin, ymax)
|
||||
int xmin, xmax, ymin, ymax;
|
||||
draws(int xmin, int xmax, int ymin, int ymax)
|
||||
{
|
||||
int i, idx;
|
||||
if (xmin == 0 && xmax == MAXX) { /* clear section of screen as
|
||||
@ -283,7 +282,7 @@ draws(xmin, xmax, ymin, ymax)
|
||||
u_char screen[MAXX][MAXY]; /* template for the screen */
|
||||
static u_char d_flag;
|
||||
void
|
||||
drawscreen()
|
||||
drawscreen(void)
|
||||
{
|
||||
int i, j, kk;
|
||||
int lastx, lasty; /* variables used to optimize the
|
||||
@ -376,8 +375,7 @@ drawscreen()
|
||||
subroutine to display a cell location on the screen
|
||||
*/
|
||||
void
|
||||
showcell(x, y)
|
||||
int x, y;
|
||||
showcell(int x, int y)
|
||||
{
|
||||
int i, j, kk, mm;
|
||||
if (c[BLINDCOUNT])
|
||||
@ -441,8 +439,7 @@ showcell(x, y)
|
||||
used in godirect() in monster.c for missile weapons display
|
||||
*/
|
||||
void
|
||||
show1cell(x, y)
|
||||
int x, y;
|
||||
show1cell(int x, int y)
|
||||
{
|
||||
if (c[BLINDCOUNT])
|
||||
return; /* see nothing if blind */
|
||||
@ -475,7 +472,7 @@ show1cell(x, y)
|
||||
cursor values start from 1 up
|
||||
*/
|
||||
void
|
||||
showplayer()
|
||||
showplayer(void)
|
||||
{
|
||||
cursor(playerx + 1, playery + 1);
|
||||
oldx = playerx;
|
||||
@ -494,8 +491,8 @@ showplayer()
|
||||
short diroffx[] = {0, 0, 1, 0, -1, 1, -1, 1, -1};
|
||||
short diroffy[] = {0, 1, 0, -1, 0, -1, -1, 1, 1};
|
||||
int
|
||||
moveplayer(dir)
|
||||
int dir; /* from = present room # direction =
|
||||
moveplayer(int dir)
|
||||
/* from = present room # direction =
|
||||
* [1-north] [2-east] [3-south] [4-west]
|
||||
* [5-northeast] [6-northwest] [7-southeast]
|
||||
* [8-southwest] if direction=0, don't
|
||||
@ -550,8 +547,7 @@ moveplayer(dir)
|
||||
*/
|
||||
static int lincount, count;
|
||||
void
|
||||
seemagic(arg)
|
||||
int arg;
|
||||
seemagic(int arg)
|
||||
{
|
||||
int i, number = 0;
|
||||
count = lincount = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: global.c,v 1.13 2012/02/18 06:57:23 matt Exp $ */
|
||||
/* $NetBSD: global.c,v 1.14 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* global.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: global.c,v 1.13 2012/02/18 06:57:23 matt Exp $");
|
||||
__RCSID("$NetBSD: global.c,v 1.14 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <string.h>
|
||||
@ -42,7 +42,7 @@ extern const char *password;
|
||||
uses c[EXPERIENCE] c[LEVEL]
|
||||
*/
|
||||
void
|
||||
raiselevel()
|
||||
raiselevel(void)
|
||||
{
|
||||
if (c[LEVEL] < MAXPLEVEL)
|
||||
raiseexperience((long) (skill[c[LEVEL]] - c[EXPERIENCE]));
|
||||
@ -54,7 +54,7 @@ raiselevel()
|
||||
subroutine to lower the players character level by one
|
||||
*/
|
||||
void
|
||||
loselevel()
|
||||
loselevel(void)
|
||||
{
|
||||
if (c[LEVEL] > 1)
|
||||
loseexperience((long) (c[EXPERIENCE] - skill[c[LEVEL] - 1] + 1));
|
||||
@ -66,8 +66,7 @@ loselevel()
|
||||
subroutine to increase experience points
|
||||
*/
|
||||
void
|
||||
raiseexperience(x)
|
||||
long x;
|
||||
raiseexperience(long x)
|
||||
{
|
||||
int i, tmp;
|
||||
i = c[LEVEL];
|
||||
@ -94,8 +93,7 @@ raiseexperience(x)
|
||||
subroutine to lose experience points
|
||||
*/
|
||||
void
|
||||
loseexperience(x)
|
||||
long x;
|
||||
loseexperience(long x)
|
||||
{
|
||||
int i, tmp;
|
||||
i = c[LEVEL];
|
||||
@ -127,8 +125,7 @@ loseexperience(x)
|
||||
warning -- will kill player if hp goes to zero
|
||||
*/
|
||||
void
|
||||
losehp(x)
|
||||
int x;
|
||||
losehp(int x)
|
||||
{
|
||||
if ((c[HP] -= x) <= 0) {
|
||||
beep();
|
||||
@ -139,8 +136,7 @@ losehp(x)
|
||||
}
|
||||
|
||||
void
|
||||
losemhp(x)
|
||||
int x;
|
||||
losemhp(int x)
|
||||
{
|
||||
c[HP] -= x;
|
||||
if (c[HP] < 1)
|
||||
@ -157,16 +153,14 @@ losemhp(x)
|
||||
subroutine to gain maximum hit points
|
||||
*/
|
||||
void
|
||||
raisehp(x)
|
||||
int x;
|
||||
raisehp(int x)
|
||||
{
|
||||
if ((c[HP] += x) > c[HPMAX])
|
||||
c[HP] = c[HPMAX];
|
||||
}
|
||||
|
||||
void
|
||||
raisemhp(x)
|
||||
int x;
|
||||
raisemhp(int x)
|
||||
{
|
||||
c[HPMAX] += x;
|
||||
c[HP] += x;
|
||||
@ -178,8 +172,7 @@ raisemhp(x)
|
||||
subroutine to gain maximum spells
|
||||
*/
|
||||
void
|
||||
raisemspells(x)
|
||||
int x;
|
||||
raisemspells(int x)
|
||||
{
|
||||
c[SPELLMAX] += x;
|
||||
c[SPELLS] += x;
|
||||
@ -191,8 +184,7 @@ raisemspells(x)
|
||||
subroutine to lose maximum spells
|
||||
*/
|
||||
void
|
||||
losemspells(x)
|
||||
int x;
|
||||
losemspells(int x)
|
||||
{
|
||||
if ((c[SPELLMAX] -= x) < 0)
|
||||
c[SPELLMAX] = 0;
|
||||
@ -208,8 +200,7 @@ losemspells(x)
|
||||
for the given cave level
|
||||
*/
|
||||
int
|
||||
makemonst(lev)
|
||||
int lev;
|
||||
makemonst(int lev)
|
||||
{
|
||||
int tmp, x;
|
||||
if (lev < 1)
|
||||
@ -235,7 +226,7 @@ makemonst(lev)
|
||||
function to be sure player is not in a wall
|
||||
*/
|
||||
void
|
||||
positionplayer()
|
||||
positionplayer(void)
|
||||
{
|
||||
int try;
|
||||
try = 2;
|
||||
@ -255,7 +246,7 @@ positionplayer()
|
||||
recalc() function to recalculate the armor class of the player
|
||||
*/
|
||||
void
|
||||
recalc()
|
||||
recalc(void)
|
||||
{
|
||||
int i, j, k;
|
||||
c[AC] = c[MOREDEFENSES];
|
||||
@ -381,7 +372,7 @@ recalc()
|
||||
subroutine to ask if the player really wants to quit
|
||||
*/
|
||||
void
|
||||
quit()
|
||||
quit(void)
|
||||
{
|
||||
int i;
|
||||
cursors();
|
||||
@ -414,7 +405,7 @@ quit()
|
||||
function to ask --more-- then the user must enter a space
|
||||
*/
|
||||
void
|
||||
more()
|
||||
more(void)
|
||||
{
|
||||
lprcat("\n --- press ");
|
||||
standout("space");
|
||||
@ -496,8 +487,7 @@ take(int theitem, int arg)
|
||||
returns 1 if something there already else 0
|
||||
*/
|
||||
int
|
||||
drop_object(k)
|
||||
int k;
|
||||
drop_object(int k)
|
||||
{
|
||||
int theitem;
|
||||
if ((k < 0) || (k > 25))
|
||||
@ -538,7 +528,7 @@ drop_object(k)
|
||||
function to enchant armor player is currently wearing
|
||||
*/
|
||||
void
|
||||
enchantarmor()
|
||||
enchantarmor(void)
|
||||
{
|
||||
int tmp;
|
||||
if (c[WEAR] < 0) {
|
||||
@ -568,7 +558,7 @@ enchantarmor()
|
||||
function to enchant a weapon presently being wielded
|
||||
*/
|
||||
void
|
||||
enchweapon()
|
||||
enchweapon(void)
|
||||
{
|
||||
int tmp;
|
||||
if (c[WIELD] < 0) {
|
||||
@ -596,7 +586,7 @@ enchweapon()
|
||||
returns 1 if pockets are full, else 0
|
||||
*/
|
||||
int
|
||||
pocketfull()
|
||||
pocketfull(void)
|
||||
{
|
||||
int i, limit;
|
||||
if ((limit = 15 + (c[LEVEL] >> 1)) > 26)
|
||||
@ -611,7 +601,7 @@ pocketfull()
|
||||
function to return 1 if a monster is next to the player else returns 0
|
||||
*/
|
||||
int
|
||||
nearbymonst()
|
||||
nearbymonst(void)
|
||||
{
|
||||
int tmp, tmp2;
|
||||
for (tmp = playerx - 1; tmp < playerx + 2; tmp++)
|
||||
@ -626,7 +616,7 @@ nearbymonst()
|
||||
returns 1 if steals something else returns 0
|
||||
*/
|
||||
int
|
||||
stealsomething()
|
||||
stealsomething(void)
|
||||
{
|
||||
int i, j;
|
||||
j = 100;
|
||||
@ -651,7 +641,7 @@ stealsomething()
|
||||
function to return 1 is player carrys nothing else return 0
|
||||
*/
|
||||
int
|
||||
emptyhanded()
|
||||
emptyhanded(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 26; i++)
|
||||
@ -667,7 +657,7 @@ emptyhanded()
|
||||
function to create a gem on a square near the player
|
||||
*/
|
||||
void
|
||||
creategem()
|
||||
creategem(void)
|
||||
{
|
||||
int i, j;
|
||||
switch (rnd(4)) {
|
||||
@ -755,7 +745,7 @@ adjustcvalues(int theitem, int arg)
|
||||
*/
|
||||
static char gpwbuf[33];
|
||||
int
|
||||
getpassword()
|
||||
getpassword(void)
|
||||
{
|
||||
int i, j;
|
||||
char *gpwp;
|
||||
@ -781,7 +771,7 @@ getpassword()
|
||||
returns y or n
|
||||
*/
|
||||
int
|
||||
getyn()
|
||||
getyn(void)
|
||||
{
|
||||
int i;
|
||||
i = 0;
|
||||
@ -795,7 +785,7 @@ getyn()
|
||||
returns the number of pounds the player is carrying
|
||||
*/
|
||||
int
|
||||
packweight()
|
||||
packweight(void)
|
||||
{
|
||||
int i, j, k;
|
||||
k = c[GOLD] / 1000;
|
||||
@ -858,15 +848,13 @@ packweight()
|
||||
#ifndef MACRORND
|
||||
/* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */
|
||||
int
|
||||
rnd(x)
|
||||
int x;
|
||||
rnd(int x)
|
||||
{
|
||||
return ((((randx = randx * 1103515245 + 12345) >> 7) % (x)) + 1);
|
||||
}
|
||||
|
||||
int
|
||||
rund(x)
|
||||
int x;
|
||||
rund(int x)
|
||||
{
|
||||
return ((((randx = randx * 1103515245 + 12345) >> 7) % (x)));
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: help.c,v 1.9 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* help.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: help.c,v 1.8 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: help.c,v 1.9 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
@ -24,7 +24,7 @@ static int openhelp(void);
|
||||
* pages of help text (23 lines per page)
|
||||
*/
|
||||
void
|
||||
help()
|
||||
help(void)
|
||||
{
|
||||
int i, j;
|
||||
#ifndef VT100
|
||||
@ -73,7 +73,7 @@ help()
|
||||
* function to display the welcome message and background
|
||||
*/
|
||||
void
|
||||
welcome()
|
||||
welcome(void)
|
||||
{
|
||||
int i;
|
||||
#ifndef VT100
|
||||
@ -100,7 +100,7 @@ welcome()
|
||||
* function to say press return to continue and reset scroll when done
|
||||
*/
|
||||
static void
|
||||
retcont()
|
||||
retcont(void)
|
||||
{
|
||||
cursor(1, 24);
|
||||
lprcat("Press ");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: io.c,v 1.26 2011/10/03 12:32:28 roy Exp $ */
|
||||
/* $NetBSD: io.c,v 1.27 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* io.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: io.c,v 1.26 2011/10/03 12:32:28 roy Exp $");
|
||||
__RCSID("$NetBSD: io.c,v 1.27 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "header.h"
|
||||
@ -144,7 +144,7 @@ static char lgetwbuf[LINBUFSIZE]; /* get line (word) buffer */
|
||||
* Attributes off, clear screen, set scrolling region, set tty mode
|
||||
*/
|
||||
void
|
||||
setupvt100()
|
||||
setupvt100(void)
|
||||
{
|
||||
clear();
|
||||
setscroll();
|
||||
@ -157,7 +157,7 @@ setupvt100()
|
||||
* Attributes off, clear screen, unset scrolling region, restore tty mode
|
||||
*/
|
||||
void
|
||||
clearvt100()
|
||||
clearvt100(void)
|
||||
{
|
||||
resetscroll();
|
||||
clear();
|
||||
@ -168,7 +168,7 @@ clearvt100()
|
||||
* ttgetch() Routine to read in one character from the terminal
|
||||
*/
|
||||
int
|
||||
ttgetch()
|
||||
ttgetch(void)
|
||||
{
|
||||
char byt;
|
||||
#ifdef EXTRA
|
||||
@ -185,7 +185,7 @@ ttgetch()
|
||||
* like: system("stty cbreak -echo")
|
||||
*/
|
||||
void
|
||||
scbr()
|
||||
scbr(void)
|
||||
{
|
||||
gtty(0, &ttx);
|
||||
doraw(ttx);
|
||||
@ -198,7 +198,7 @@ scbr()
|
||||
* like: system("stty -cbreak echo")
|
||||
*/
|
||||
void
|
||||
sncbr()
|
||||
sncbr(void)
|
||||
{
|
||||
gtty(0, &ttx);
|
||||
unraw(ttx);
|
||||
@ -209,7 +209,7 @@ sncbr()
|
||||
* newgame() Subroutine to save the initial time and seed rnd()
|
||||
*/
|
||||
void
|
||||
newgame()
|
||||
newgame(void)
|
||||
{
|
||||
long *p, *pe;
|
||||
for (p = c, pe = c + 100; p < pe; *p++ = 0);
|
||||
@ -265,8 +265,7 @@ lprintf(const char *fmt, ...)
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
void
|
||||
lprint(x)
|
||||
long x;
|
||||
lprint(long x)
|
||||
{
|
||||
if (lpnt >= lpend)
|
||||
lflush();
|
||||
@ -285,9 +284,7 @@ lprint(x)
|
||||
* Returns nothing of value
|
||||
*/
|
||||
void
|
||||
lwrite(buf, len)
|
||||
char *buf;
|
||||
int len;
|
||||
lwrite(char *buf, int len)
|
||||
{
|
||||
char *s;
|
||||
u_char *t;
|
||||
@ -327,7 +324,7 @@ lwrite(buf, len)
|
||||
* Returns 0 if EOF, otherwise the character
|
||||
*/
|
||||
long
|
||||
lgetc()
|
||||
lgetc(void)
|
||||
{
|
||||
int i;
|
||||
if (ipoint != iepoint)
|
||||
@ -359,7 +356,7 @@ lgetc()
|
||||
* Returns the int read
|
||||
*/
|
||||
long
|
||||
larn_lrint()
|
||||
larn_lrint(void)
|
||||
{
|
||||
unsigned long i;
|
||||
i = 255 & lgetc();
|
||||
@ -378,9 +375,7 @@ larn_lrint()
|
||||
* Returns nothing of value
|
||||
*/
|
||||
void
|
||||
lrfill(adr, num)
|
||||
char *adr;
|
||||
int num;
|
||||
lrfill(char *adr, int num)
|
||||
{
|
||||
u_char *pnt;
|
||||
int num2;
|
||||
@ -415,7 +410,7 @@ lrfill(adr, num)
|
||||
* Returns pointer to a buffer that contains word. If EOF, returns a NULL
|
||||
*/
|
||||
char *
|
||||
lgetw()
|
||||
lgetw(void)
|
||||
{
|
||||
char *lgp, cc;
|
||||
int n = LINBUFSIZE, quote = 0;
|
||||
@ -443,7 +438,7 @@ lgetw()
|
||||
* Returns pointer to a buffer that contains the line. If EOF, returns NULL
|
||||
*/
|
||||
char *
|
||||
lgetl()
|
||||
lgetl(void)
|
||||
{
|
||||
int i = LINBUFSIZE, ch;
|
||||
char *str = lgetwbuf;
|
||||
@ -467,8 +462,7 @@ lgetl()
|
||||
* Returns -1 if error, otherwise the file descriptor opened.
|
||||
*/
|
||||
int
|
||||
lcreat(str)
|
||||
char *str;
|
||||
lcreat(char *str)
|
||||
{
|
||||
lflush();
|
||||
lpnt = lpbuf;
|
||||
@ -493,8 +487,7 @@ lcreat(str)
|
||||
* Returns -1 if error, otherwise the file descriptor opened.
|
||||
*/
|
||||
int
|
||||
lopen(str)
|
||||
char *str;
|
||||
lopen(char *str)
|
||||
{
|
||||
ipoint = iepoint = MAXIBUF;
|
||||
if (str == NULL)
|
||||
@ -516,8 +509,7 @@ lopen(str)
|
||||
* Returns -1 if error, otherwise the file descriptor opened.
|
||||
*/
|
||||
int
|
||||
lappend(str)
|
||||
char *str;
|
||||
lappend(char *str)
|
||||
{
|
||||
lpnt = lpbuf;
|
||||
lpend = lpbuf + BUFBIG;
|
||||
@ -537,7 +529,7 @@ lappend(str)
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
void
|
||||
lrclose()
|
||||
lrclose(void)
|
||||
{
|
||||
if (io_infd > 0) {
|
||||
close(io_infd);
|
||||
@ -551,7 +543,7 @@ lrclose()
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
void
|
||||
lwclose()
|
||||
lwclose(void)
|
||||
{
|
||||
lflush();
|
||||
if (io_outfd > 2) {
|
||||
@ -621,8 +613,7 @@ cursor(x, y)
|
||||
* cursor(x,y) Put cursor at specified coordinates staring at [1,1] (termcap)
|
||||
*/
|
||||
void
|
||||
cursor(x, y)
|
||||
int x, y;
|
||||
cursor(int x, int y)
|
||||
{
|
||||
if (lpnt >= lpend)
|
||||
lflush();
|
||||
@ -637,7 +628,7 @@ cursor(x, y)
|
||||
* Routine to position cursor at beginning of 24th line
|
||||
*/
|
||||
void
|
||||
cursors()
|
||||
cursors(void)
|
||||
{
|
||||
cursor(1, 24);
|
||||
}
|
||||
@ -655,7 +646,7 @@ static char *outbuf = 0; /* translated output buffer */
|
||||
* init_term() Terminal initialization -- setup termcap info
|
||||
*/
|
||||
void
|
||||
init_term()
|
||||
init_term(void)
|
||||
{
|
||||
setupterm(NULL, 0, NULL); /* will exit if invalid term */
|
||||
if (!cursor_address) {
|
||||
@ -683,8 +674,7 @@ init_term()
|
||||
* cl_line(x,y) Clear the whole line indicated by 'y' and leave cursor at [x,y]
|
||||
*/
|
||||
void
|
||||
cl_line(x, y)
|
||||
int x, y;
|
||||
cl_line(int x, int y)
|
||||
{
|
||||
#ifdef VT100
|
||||
cursor(x, y);
|
||||
@ -700,8 +690,7 @@ cl_line(x, y)
|
||||
* cl_up(x,y) Clear screen from [x,1] to current position. Leave cursor at [x,y]
|
||||
*/
|
||||
void
|
||||
cl_up(x, y)
|
||||
int x, y;
|
||||
cl_up(int x, int y)
|
||||
{
|
||||
#ifdef VT100
|
||||
cursor(x, y);
|
||||
@ -721,8 +710,7 @@ cl_up(x, y)
|
||||
* cl_dn(x,y) Clear screen from [1,y] to end of display. Leave cursor at [x,y]
|
||||
*/
|
||||
void
|
||||
cl_dn(x, y)
|
||||
int x, y;
|
||||
cl_dn(int x, int y)
|
||||
{
|
||||
#ifdef VT100
|
||||
cursor(x, y);
|
||||
@ -767,7 +755,7 @@ standout(const char *str)
|
||||
* set_score_output() Called when output should be literally printed.
|
||||
*/
|
||||
void
|
||||
set_score_output()
|
||||
set_score_output(void)
|
||||
{
|
||||
enable_scroll = -1;
|
||||
}
|
||||
@ -783,7 +771,7 @@ set_score_output()
|
||||
static int scrline = 18; /* line # for wraparound instead of scrolling
|
||||
* if no DL */
|
||||
void
|
||||
lflush()
|
||||
lflush(void)
|
||||
{
|
||||
int lpoint;
|
||||
u_char *str;
|
||||
@ -931,7 +919,7 @@ ttputch(int ch)
|
||||
* flush_buf() Flush buffer with decoded output.
|
||||
*/
|
||||
static void
|
||||
flush_buf()
|
||||
flush_buf(void)
|
||||
{
|
||||
if (vindex)
|
||||
write(io_outfd, outbuf, vindex);
|
||||
@ -944,8 +932,7 @@ flush_buf()
|
||||
* Processes only the \33[#m sequence (converts . files for termcap use
|
||||
*/
|
||||
char *
|
||||
tmcapcnv(sd, ss)
|
||||
char *sd, *ss;
|
||||
tmcapcnv(char *sd, char *ss)
|
||||
{
|
||||
int tmstate = 0; /* 0=normal, 1=\33 2=[ 3=# */
|
||||
char tmdigit = 0; /* the # in \33[#m */
|
||||
@ -997,7 +984,7 @@ tmcapcnv(sd, ss)
|
||||
* beep() Routine to emit a beep if enabled (see no-beep in .larnopts)
|
||||
*/
|
||||
void
|
||||
beep()
|
||||
beep(void)
|
||||
{
|
||||
if (!nobeep)
|
||||
*lpnt++ = '\7';
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* main.c */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -75,9 +75,7 @@ static char *termtypes[] = {"vt100", "vt101", "vt102", "vt103", "vt125",
|
||||
************
|
||||
*/
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int hard;
|
||||
@ -330,7 +328,7 @@ main(argc, argv)
|
||||
show character's inventory
|
||||
*/
|
||||
static void
|
||||
showstr()
|
||||
showstr(void)
|
||||
{
|
||||
int i, number;
|
||||
for (number = 3, i = 0; i < 26; i++)
|
||||
@ -342,7 +340,7 @@ showstr()
|
||||
}
|
||||
|
||||
void
|
||||
qshowstr()
|
||||
qshowstr(void)
|
||||
{
|
||||
int i, j, k, sigsav;
|
||||
srcount = 0;
|
||||
@ -369,8 +367,7 @@ qshowstr()
|
||||
* subroutine to clear screen depending on # lines to display
|
||||
*/
|
||||
static void
|
||||
t_setup(count)
|
||||
int count;
|
||||
t_setup(int count)
|
||||
{
|
||||
if (count < 20) { /* how do we clear the screen? */
|
||||
cl_up(79, count);
|
||||
@ -385,8 +382,7 @@ t_setup(count)
|
||||
* subroutine to restore normal display screen depending on t_setup()
|
||||
*/
|
||||
static void
|
||||
t_endup(count)
|
||||
int count;
|
||||
t_endup(int count)
|
||||
{
|
||||
if (count < 18) /* how did we clear the screen? */
|
||||
draws(0, MAXX, 0, (count > MAXY) ? MAXY : count);
|
||||
@ -400,7 +396,7 @@ t_endup(count)
|
||||
function to show the things player is wearing only
|
||||
*/
|
||||
static void
|
||||
showwear()
|
||||
showwear(void)
|
||||
{
|
||||
int i, j, sigsav, count;
|
||||
sigsav = nosignal;
|
||||
@ -449,7 +445,7 @@ showwear()
|
||||
function to show the things player can wield only
|
||||
*/
|
||||
static void
|
||||
showwield()
|
||||
showwield(void)
|
||||
{
|
||||
int i, j, sigsav, count;
|
||||
sigsav = nosignal;
|
||||
@ -507,7 +503,7 @@ showwield()
|
||||
* function to show the things player can read only
|
||||
*/
|
||||
static void
|
||||
showread()
|
||||
showread(void)
|
||||
{
|
||||
int i, j, sigsav, count;
|
||||
sigsav = nosignal;
|
||||
@ -539,7 +535,7 @@ showread()
|
||||
* function to show the things player can eat only
|
||||
*/
|
||||
static void
|
||||
showeat()
|
||||
showeat(void)
|
||||
{
|
||||
int i, j, sigsav, count;
|
||||
sigsav = nosignal;
|
||||
@ -569,7 +565,7 @@ showeat()
|
||||
function to show the things player can quaff only
|
||||
*/
|
||||
static void
|
||||
showquaff()
|
||||
showquaff(void)
|
||||
{
|
||||
int i, j, sigsav, count;
|
||||
sigsav = nosignal;
|
||||
@ -596,9 +592,7 @@ showquaff()
|
||||
}
|
||||
|
||||
static void
|
||||
show1(idx, str2)
|
||||
int idx;
|
||||
const char *str2[];
|
||||
show1(int idx, const char *str2[])
|
||||
{
|
||||
lprintf("\n%c) %s", idx + 'a', objectname[iven[idx]]);
|
||||
if (str2 != 0 && str2[ivenarg[idx]][0] != 0)
|
||||
@ -653,7 +647,7 @@ show3(int indx)
|
||||
subroutine to randomly create monsters if needed
|
||||
*/
|
||||
static void
|
||||
randmonst()
|
||||
randmonst(void)
|
||||
{
|
||||
if (c[TIMESTOP])
|
||||
return; /* don't make monsters if time is stopped */
|
||||
@ -671,7 +665,7 @@ randmonst()
|
||||
get and execute a command
|
||||
*/
|
||||
static void
|
||||
parse()
|
||||
parse(void)
|
||||
{
|
||||
int i, j, k, flag;
|
||||
while (1) {
|
||||
@ -980,7 +974,7 @@ parse()
|
||||
}
|
||||
|
||||
void
|
||||
parse2()
|
||||
parse2(void)
|
||||
{
|
||||
if (c[HASTEMONST])
|
||||
movemonst();
|
||||
@ -990,8 +984,7 @@ parse2()
|
||||
}
|
||||
|
||||
static void
|
||||
run(dir)
|
||||
int dir;
|
||||
run(int dir)
|
||||
{
|
||||
int i;
|
||||
i = 1;
|
||||
@ -1015,7 +1008,7 @@ run(dir)
|
||||
function to wield a weapon
|
||||
*/
|
||||
static void
|
||||
wield()
|
||||
wield(void)
|
||||
{
|
||||
int i;
|
||||
while (1) {
|
||||
@ -1053,15 +1046,13 @@ wield()
|
||||
common routine to say you don't have an item
|
||||
*/
|
||||
static void
|
||||
ydhi(x)
|
||||
int x;
|
||||
ydhi(int x)
|
||||
{
|
||||
cursors();
|
||||
lprintf("\nYou don't have item %c!", x);
|
||||
}
|
||||
static void
|
||||
ycwi(x)
|
||||
int x;
|
||||
ycwi(int x)
|
||||
{
|
||||
cursors();
|
||||
lprintf("\nYou can't wield item %c!", x);
|
||||
@ -1071,7 +1062,7 @@ ycwi(x)
|
||||
function to wear armor
|
||||
*/
|
||||
static void
|
||||
wear()
|
||||
wear(void)
|
||||
{
|
||||
int i;
|
||||
while (1) {
|
||||
@ -1123,7 +1114,7 @@ wear()
|
||||
function to drop an object
|
||||
*/
|
||||
static void
|
||||
dropobj()
|
||||
dropobj(void)
|
||||
{
|
||||
int i;
|
||||
unsigned char *p;
|
||||
@ -1187,7 +1178,7 @@ dropobj()
|
||||
* readscr() Subroutine to read a scroll one is carrying
|
||||
*/
|
||||
static void
|
||||
readscr()
|
||||
readscr(void)
|
||||
{
|
||||
int i;
|
||||
while (1) {
|
||||
@ -1260,7 +1251,7 @@ eatcookie(void)
|
||||
* subroutine to quaff a potion one is carrying
|
||||
*/
|
||||
static void
|
||||
quaff()
|
||||
quaff(void)
|
||||
{
|
||||
int i;
|
||||
while (1) {
|
||||
@ -1308,8 +1299,7 @@ whatitem(const char *str)
|
||||
and allow * to mean return amt, else return the number entered
|
||||
*/
|
||||
unsigned long
|
||||
readnum(mx)
|
||||
long mx;
|
||||
readnum(long mx)
|
||||
{
|
||||
int i;
|
||||
unsigned long amt = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: monster.c,v 1.17 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* monster.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -100,7 +100,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: monster.c,v 1.17 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <string.h>
|
||||
@ -141,8 +141,7 @@ static void genmonst(void);
|
||||
* Returns no value.
|
||||
*/
|
||||
void
|
||||
createmonster(mon)
|
||||
int mon;
|
||||
createmonster(int mon)
|
||||
{
|
||||
int x, y, k, i;
|
||||
if (mon < 1 || mon > MAXMONST + 8) { /* check for monster number
|
||||
@ -212,8 +211,7 @@ cgood(int x, int y, int theitem, int monst)
|
||||
* Returns no value, thus we don't know about createitem() failures.
|
||||
*/
|
||||
void
|
||||
createitem(it, arg)
|
||||
int it, arg;
|
||||
createitem(int it, int arg)
|
||||
{
|
||||
int x, y, k, i;
|
||||
if (it >= MAXOBJ)
|
||||
@ -240,7 +238,7 @@ createitem(it, arg)
|
||||
*/
|
||||
static char eys[] = "\nEnter your spell: ";
|
||||
void
|
||||
cast()
|
||||
cast(void)
|
||||
{
|
||||
int i, j, a, b, d;
|
||||
cursors();
|
||||
@ -653,7 +651,7 @@ speldamage(int x)
|
||||
* No arguments and no return value
|
||||
*/
|
||||
static void
|
||||
loseint()
|
||||
loseint(void)
|
||||
{
|
||||
if (--c[INTELLIGENCE] < 3)
|
||||
c[INTELLIGENCE] = 3;
|
||||
@ -666,7 +664,7 @@ loseint()
|
||||
* returns 0 if not confused, non-zero (time remaining confused) if confused
|
||||
*/
|
||||
static int
|
||||
isconfuse()
|
||||
isconfuse(void)
|
||||
{
|
||||
if (c[CONFUSE]) {
|
||||
lprcat(" You can't aim your magic!");
|
||||
@ -684,8 +682,7 @@ isconfuse()
|
||||
* Enter with the spell number in x, and the monster number in monst.
|
||||
*/
|
||||
static int
|
||||
nospell(x, monst)
|
||||
int x, monst;
|
||||
nospell(int x, int monst)
|
||||
{
|
||||
int tmp;
|
||||
if (x >= SPNUM || monst >= MAXMONST + 8 || monst < 0 || x < 0)
|
||||
@ -706,8 +703,7 @@ nospell(x, monst)
|
||||
* Enter with the number of full hits being done
|
||||
*/
|
||||
static int
|
||||
fullhit(xx)
|
||||
int xx;
|
||||
fullhit(int xx)
|
||||
{
|
||||
int i;
|
||||
if (xx < 0 || xx > 20)
|
||||
@ -729,9 +725,7 @@ fullhit(xx)
|
||||
* Returns no value.
|
||||
*/
|
||||
static void
|
||||
direct(spnum, dam, str, arg)
|
||||
int spnum, dam, arg;
|
||||
const char *str;
|
||||
direct(int spnum, int dam, const char *str, int arg)
|
||||
{
|
||||
int x, y;
|
||||
int m;
|
||||
@ -791,13 +785,16 @@ direct(spnum, dam, str, arg)
|
||||
* Returns no value.
|
||||
*/
|
||||
void
|
||||
godirect(spnum, dam, str, delay, cshow)
|
||||
int spnum, dam, delay;
|
||||
const char *str, cshow;
|
||||
godirect(int spnum, int dam, const char *str, int delay, int cshow_i)
|
||||
{
|
||||
u_char *p;
|
||||
int x, y, m;
|
||||
int dx, dy;
|
||||
char cshow;
|
||||
|
||||
/* truncate to char width in case it matters */
|
||||
cshow = (char)cshow_i;
|
||||
|
||||
if (spnum < 0 || spnum >= SPNUM || str == 0 || delay < 0)
|
||||
return; /* bad args */
|
||||
if (isconfuse())
|
||||
@ -939,8 +936,7 @@ ifblind(int x, int y)
|
||||
* Returns no value.
|
||||
*/
|
||||
static void
|
||||
tdirect(spnum)
|
||||
int spnum;
|
||||
tdirect(int spnum)
|
||||
{
|
||||
int x, y;
|
||||
int m;
|
||||
@ -1007,8 +1003,7 @@ omnidirect(int spnum, int dam, const char *str)
|
||||
* Returns index into diroffx[] (0-8).
|
||||
*/
|
||||
static int
|
||||
dirsub(x, y)
|
||||
int *x, *y;
|
||||
dirsub(int *x, int *y)
|
||||
{
|
||||
int i;
|
||||
lprcat("\nIn What Direction? ");
|
||||
@ -1050,8 +1045,7 @@ out:
|
||||
* routine are affected.
|
||||
*/
|
||||
int
|
||||
vxy(x, y)
|
||||
int *x, *y;
|
||||
vxy(int *x, int *y)
|
||||
{
|
||||
int flag = 0;
|
||||
if (*x < 0) {
|
||||
@ -1082,8 +1076,7 @@ vxy(x, y)
|
||||
* Returns no value.
|
||||
*/
|
||||
static void
|
||||
dirpoly(spnum)
|
||||
int spnum;
|
||||
dirpoly(int spnum)
|
||||
{
|
||||
int x, y, m;
|
||||
if (spnum < 0 || spnum >= SPNUM)
|
||||
@ -1115,8 +1108,7 @@ dirpoly(spnum)
|
||||
* Returns no value.
|
||||
*/
|
||||
void
|
||||
hitmonster(x, y)
|
||||
int x, y;
|
||||
hitmonster(int x, int y)
|
||||
{
|
||||
int tmp, monst, damag = 0, flag;
|
||||
if (c[TIMESTOP])
|
||||
@ -1168,9 +1160,7 @@ hitmonster(x, y)
|
||||
* Called by hitmonster(x,y)
|
||||
*/
|
||||
static int
|
||||
hitm(x, y, amt)
|
||||
int x, y;
|
||||
int amt;
|
||||
hitm(int x, int y, int amt)
|
||||
{
|
||||
int monst;
|
||||
int hpoints, amt2;
|
||||
@ -1225,8 +1215,7 @@ hitm(x, y, amt)
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
void
|
||||
hitplayer(x, y)
|
||||
int x, y;
|
||||
hitplayer(int x, int y)
|
||||
{
|
||||
int dam, tmp, mster, bias;
|
||||
vxy(&x, &y); /* verify coordinates are within range */
|
||||
@ -1302,8 +1291,7 @@ hitplayer(x, y)
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
static void
|
||||
dropsomething(monst)
|
||||
int monst;
|
||||
dropsomething(int monst)
|
||||
{
|
||||
switch (monst) {
|
||||
case ORC:
|
||||
@ -1336,8 +1324,7 @@ dropsomething(monst)
|
||||
* Returns nothing of value.
|
||||
*/
|
||||
void
|
||||
dropgold(amount)
|
||||
int amount;
|
||||
dropgold(int amount)
|
||||
{
|
||||
if (amount > 250)
|
||||
createitem(OMAXGOLD, amount / 100);
|
||||
@ -1384,8 +1371,7 @@ static char nobjtab[] = {
|
||||
OLONGSWORD};
|
||||
|
||||
int
|
||||
newobject(lev, i)
|
||||
int lev, *i;
|
||||
newobject(int lev, int *i)
|
||||
{
|
||||
int tmp = 32, j;
|
||||
if (level < 0 || level > MAXLEVEL + MAXVLEVEL)
|
||||
@ -1518,8 +1504,7 @@ static char rustarm[ARMORTYPES][2] = {
|
||||
};
|
||||
static char spsel[] = {1, 2, 3, 5, 6, 8, 9, 11, 13, 14};
|
||||
static int
|
||||
spattack(x, xx, yy)
|
||||
int x, xx, yy;
|
||||
spattack(int x, int xx, int yy)
|
||||
{
|
||||
int i, j = 0, k, m;
|
||||
const char *p = NULL;
|
||||
@ -1706,8 +1691,7 @@ spout3: p = "\nThe %s bit you!";
|
||||
* Note: if x > c[HP] this routine could kill the player!
|
||||
*/
|
||||
void
|
||||
checkloss(x)
|
||||
int x;
|
||||
checkloss(int x)
|
||||
{
|
||||
if (x > 0) {
|
||||
losehp(x);
|
||||
@ -1722,7 +1706,7 @@ checkloss(x)
|
||||
* Returns the experience gained from all monsters killed
|
||||
*/
|
||||
int
|
||||
annihilate()
|
||||
annihilate(void)
|
||||
{
|
||||
int i, j;
|
||||
long k;
|
||||
@ -1757,8 +1741,7 @@ annihilate()
|
||||
* Returns the number of spheres currently in existence
|
||||
*/
|
||||
int
|
||||
newsphere(x, y, dir, life)
|
||||
int x, y, dir, life;
|
||||
newsphere(int x, int y, int dir, int life)
|
||||
{
|
||||
int m;
|
||||
struct sphere *sp;
|
||||
@ -1847,8 +1830,7 @@ boom: sphboom(x, y); /* blow up stuff around sphere */
|
||||
* Returns the number of spheres currently in existence
|
||||
*/
|
||||
int
|
||||
rmsphere(x, y)
|
||||
int x, y;
|
||||
rmsphere(int x, int y)
|
||||
{
|
||||
struct sphere *sp, *sp2 = 0;
|
||||
for (sp = spheres; sp; sp2 = sp, sp = sp->p)
|
||||
@ -1881,8 +1863,7 @@ rmsphere(x, y)
|
||||
* Enter with the coordinates of the blast, Returns no value
|
||||
*/
|
||||
static void
|
||||
sphboom(x, y)
|
||||
int x, y;
|
||||
sphboom(int x, int y)
|
||||
{
|
||||
int i, j;
|
||||
if (c[HOLDMONST])
|
||||
@ -1909,7 +1890,7 @@ sphboom(x, y)
|
||||
* This is done by setting a flag in the monster[] structure
|
||||
*/
|
||||
static void
|
||||
genmonst()
|
||||
genmonst(void)
|
||||
{
|
||||
int i, j;
|
||||
cursors();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: moreobj.c,v 1.11 2008/02/19 06:05:26 dholland Exp $ */
|
||||
/* $NetBSD: moreobj.c,v 1.12 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* moreobj.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -9,7 +9,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: moreobj.c,v 1.11 2008/02/19 06:05:26 dholland Exp $");
|
||||
__RCSID("$NetBSD: moreobj.c,v 1.12 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -22,7 +22,7 @@ static void fch(int, long *);
|
||||
* subroutine to process an altar object
|
||||
*/
|
||||
void
|
||||
oaltar()
|
||||
oaltar(void)
|
||||
{
|
||||
|
||||
lprcat("\nDo you (p) pray (d) desecrate");
|
||||
@ -64,8 +64,7 @@ oaltar()
|
||||
subroutine to process a throne object
|
||||
*/
|
||||
void
|
||||
othrone(arg)
|
||||
int arg;
|
||||
othrone(int arg)
|
||||
{
|
||||
|
||||
lprcat("\nDo you (p) pry off jewels, (s) sit down");
|
||||
@ -92,7 +91,7 @@ othrone(arg)
|
||||
}
|
||||
|
||||
void
|
||||
odeadthrone()
|
||||
odeadthrone(void)
|
||||
{
|
||||
int k;
|
||||
|
||||
@ -124,7 +123,7 @@ odeadthrone()
|
||||
subroutine to process a throne object
|
||||
*/
|
||||
void
|
||||
ochest()
|
||||
ochest(void)
|
||||
{
|
||||
|
||||
lprcat("\nDo you (t) take it, (o) try to open it");
|
||||
@ -155,7 +154,7 @@ ochest()
|
||||
process a fountain object
|
||||
*/
|
||||
void
|
||||
ofountain()
|
||||
ofountain(void)
|
||||
{
|
||||
|
||||
cursors();
|
||||
@ -188,9 +187,7 @@ ofountain()
|
||||
subroutine to process an up/down of a character attribute for ofountain
|
||||
*/
|
||||
static void
|
||||
fch(how, x)
|
||||
int how;
|
||||
long *x;
|
||||
fch(int how, long *x)
|
||||
{
|
||||
if (how < 0) {
|
||||
lprcat(" went down by one!");
|
||||
@ -207,8 +204,7 @@ fch(how, x)
|
||||
if x > 0 they are raised if x < 0 they are lowered
|
||||
*/
|
||||
void
|
||||
fntchange(how)
|
||||
int how;
|
||||
fntchange(int how)
|
||||
{
|
||||
long j;
|
||||
lprc('\n');
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $ */
|
||||
/* $NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -12,7 +12,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: movem.c,v 1.8 2011/08/16 11:19:41 christos Exp $");
|
||||
__RCSID("$NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "header.h"
|
||||
@ -32,7 +32,7 @@ static void movsphere(void);
|
||||
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])
|
||||
@ -132,8 +132,7 @@ movemonst()
|
||||
*/
|
||||
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 */
|
||||
@ -274,8 +273,7 @@ out: if (tmp < distance) /* did find connectivity */
|
||||
* 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;
|
||||
@ -405,7 +403,7 @@ mmove(aa, bb, cc, dd)
|
||||
#define SPHMAX 20 /* maximum number of spheres movsphere can
|
||||
* handle */
|
||||
static void
|
||||
movsphere()
|
||||
movsphere(void)
|
||||
{
|
||||
int x, y, dir, len;
|
||||
struct sphere *sp, *sp2;
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $ */
|
||||
/* $NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* nap.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $");
|
||||
__RCSID("$NetBSD: nap.c,v 1.6 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
@ -14,8 +14,7 @@ __RCSID("$NetBSD: nap.c,v 1.5 1997/10/18 20:03:36 christos Exp $");
|
||||
* routine to take a nap for n milliseconds
|
||||
*/
|
||||
void
|
||||
nap(x)
|
||||
int x;
|
||||
nap(int x)
|
||||
{
|
||||
if (x <= 0)
|
||||
return; /* eliminate chance for infinite loop */
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $ */
|
||||
|
||||
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: object.c,v 1.15 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
#include "header.h"
|
||||
#include "extern.h"
|
||||
@ -31,7 +31,7 @@ static void ohome(void);
|
||||
if an object was found.
|
||||
*/
|
||||
void
|
||||
lookforobject()
|
||||
lookforobject(void)
|
||||
{
|
||||
int i, j;
|
||||
if (c[TIMESTOP])
|
||||
@ -554,8 +554,7 @@ finditem(int theitem)
|
||||
if dir > 0 the up else down
|
||||
*/
|
||||
static void
|
||||
ostairs(dir)
|
||||
int dir;
|
||||
ostairs(int dir)
|
||||
{
|
||||
int k;
|
||||
lprcat("\nDo you (s) stay here ");
|
||||
@ -620,8 +619,7 @@ ostairs(dir)
|
||||
subroutine to handle a teleport trap +/- 1 level maximum
|
||||
*/
|
||||
void
|
||||
oteleport(err)
|
||||
int err;
|
||||
oteleport(int err)
|
||||
{
|
||||
int tmp;
|
||||
if (err)
|
||||
@ -657,8 +655,7 @@ oteleport(err)
|
||||
function to process a potion
|
||||
*/
|
||||
static void
|
||||
opotion(pot)
|
||||
int pot;
|
||||
opotion(int pot)
|
||||
{
|
||||
lprcat("\nDo you (d) drink it, (t) take it");
|
||||
iopts();
|
||||
@ -687,8 +684,7 @@ opotion(pot)
|
||||
function to drink a potion
|
||||
*/
|
||||
void
|
||||
quaffpotion(pot)
|
||||
int pot;
|
||||
quaffpotion(int pot)
|
||||
{
|
||||
int i, j, k;
|
||||
if (pot < 0 || pot >= MAXPOTION)
|
||||
@ -866,8 +862,7 @@ quaffpotion(pot)
|
||||
function to process a magic scroll
|
||||
*/
|
||||
static void
|
||||
oscroll(typ)
|
||||
int typ;
|
||||
oscroll(int typ)
|
||||
{
|
||||
lprcat("\nDo you ");
|
||||
if (c[BLINDCOUNT] == 0)
|
||||
@ -927,8 +922,7 @@ static u_char time_change[] = {
|
||||
* function to adjust time when time warping and taking courses in school
|
||||
*/
|
||||
void
|
||||
adjusttime(tim)
|
||||
long tim;
|
||||
adjusttime(long tim)
|
||||
{
|
||||
int j;
|
||||
for (j = 0; j < 26; j++)/* adjust time related parameters */
|
||||
@ -942,8 +936,7 @@ adjusttime(tim)
|
||||
function to read a scroll
|
||||
*/
|
||||
void
|
||||
read_scroll(typ)
|
||||
int typ;
|
||||
read_scroll(int typ)
|
||||
{
|
||||
int i, j;
|
||||
if (typ < 0 || typ >= MAXSCROLL)
|
||||
@ -1098,12 +1091,12 @@ read_scroll(typ)
|
||||
|
||||
|
||||
static void
|
||||
oorb()
|
||||
oorb(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
opit()
|
||||
opit(void)
|
||||
{
|
||||
int i;
|
||||
if (rnd(101) < 81) {
|
||||
@ -1132,7 +1125,7 @@ opit()
|
||||
}
|
||||
|
||||
static void
|
||||
obottomless()
|
||||
obottomless(void)
|
||||
{
|
||||
lprcat("\nYou fell into a bottomless pit!");
|
||||
beep();
|
||||
@ -1141,8 +1134,7 @@ obottomless()
|
||||
}
|
||||
|
||||
static void
|
||||
oelevator(dir)
|
||||
int dir;
|
||||
oelevator(int dir)
|
||||
{
|
||||
#ifdef lint
|
||||
int x;
|
||||
@ -1152,17 +1144,17 @@ oelevator(dir)
|
||||
}
|
||||
|
||||
static void
|
||||
ostatue()
|
||||
ostatue(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
omirror()
|
||||
omirror(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
obook()
|
||||
obook(void)
|
||||
{
|
||||
lprcat("\nDo you ");
|
||||
if (c[BLINDCOUNT] == 0)
|
||||
@ -1196,8 +1188,7 @@ obook()
|
||||
function to read a book
|
||||
*/
|
||||
void
|
||||
readbook(lev)
|
||||
int lev;
|
||||
readbook(int lev)
|
||||
{
|
||||
int i, tmp;
|
||||
if (lev <= 3)
|
||||
@ -1252,8 +1243,7 @@ ocookie(void)
|
||||
* 100* the argument
|
||||
*/
|
||||
static void
|
||||
ogold(arg)
|
||||
int arg;
|
||||
ogold(int arg)
|
||||
{
|
||||
long i;
|
||||
i = iarg[playerx][playery];
|
||||
@ -1270,7 +1260,7 @@ ogold(arg)
|
||||
}
|
||||
|
||||
static void
|
||||
ohome()
|
||||
ohome(void)
|
||||
{
|
||||
int i;
|
||||
nosignal = 1; /* disable signals */
|
||||
@ -1334,13 +1324,13 @@ ohome()
|
||||
|
||||
/* routine to save program space */
|
||||
void
|
||||
iopts()
|
||||
iopts(void)
|
||||
{
|
||||
lprcat(", or (i) ignore it? ");
|
||||
}
|
||||
|
||||
void
|
||||
ignore()
|
||||
ignore(void)
|
||||
{
|
||||
lprcat("ignore\n");
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $ */
|
||||
/* $NetBSD: regen.c,v 1.6 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/* regen.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $");
|
||||
__RCSID("$NetBSD: regen.c,v 1.6 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include "header.h"
|
||||
@ -17,7 +17,7 @@ __RCSID("$NetBSD: regen.c,v 1.5 1997/10/18 20:03:43 christos Exp $");
|
||||
subroutine to regenerate player hp and spells
|
||||
*/
|
||||
void
|
||||
regen()
|
||||
regen(void)
|
||||
{
|
||||
int i, flag;
|
||||
long *d;
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $ */
|
||||
/* $NetBSD: savelev.c,v 1.7 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/* savelev.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $");
|
||||
__RCSID("$NetBSD: savelev.c,v 1.7 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
#include "header.h"
|
||||
#include "extern.h"
|
||||
@ -12,7 +12,7 @@ __RCSID("$NetBSD: savelev.c,v 1.6 2008/02/03 19:29:50 dholland Exp $");
|
||||
* routine to save the present level into storage
|
||||
*/
|
||||
void
|
||||
savelevel()
|
||||
savelevel(void)
|
||||
{
|
||||
struct cel *pcel;
|
||||
u_char *pitem, *pknow, *pmitem;
|
||||
@ -41,7 +41,7 @@ savelevel()
|
||||
* routine to restore a level from storage
|
||||
*/
|
||||
void
|
||||
getlevel()
|
||||
getlevel(void)
|
||||
{
|
||||
struct cel *pcel;
|
||||
u_char *pitem, *pknow, *pmitem;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scores.c,v 1.20 2010/04/24 00:56:14 dholland Exp $ */
|
||||
/* $NetBSD: scores.c,v 1.21 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* scores.c Larn is copyrighted 1986 by Noah Morgan.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: scores.c,v 1.20 2010/04/24 00:56:14 dholland Exp $");
|
||||
__RCSID("$NetBSD: scores.c,v 1.21 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
@ -118,7 +118,7 @@ static void diedsub(int);
|
||||
* returns -1 if unable to read in the scoreboard, returns 0 if all is OK
|
||||
*/
|
||||
static int
|
||||
readboard()
|
||||
readboard(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -145,7 +145,7 @@ readboard()
|
||||
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
|
||||
*/
|
||||
static int
|
||||
writeboard()
|
||||
writeboard(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -173,7 +173,7 @@ writeboard()
|
||||
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
|
||||
*/
|
||||
int
|
||||
makeboard()
|
||||
makeboard(void)
|
||||
{
|
||||
int i;
|
||||
set_score_output();
|
||||
@ -200,7 +200,7 @@ makeboard()
|
||||
* the winners scoreboard.
|
||||
*/
|
||||
int
|
||||
hashewon()
|
||||
hashewon(void)
|
||||
{
|
||||
int i;
|
||||
c[HARDGAME] = 0;
|
||||
@ -223,8 +223,7 @@ hashewon()
|
||||
* Returns amount actually paid.
|
||||
*/
|
||||
long
|
||||
paytaxes(x)
|
||||
long x;
|
||||
paytaxes(long x)
|
||||
{
|
||||
int i;
|
||||
long amt;
|
||||
@ -257,7 +256,7 @@ paytaxes(x)
|
||||
* Returns the number of players on scoreboard that were shown
|
||||
*/
|
||||
static int
|
||||
winshou()
|
||||
winshou(void)
|
||||
{
|
||||
struct wscofmt *p;
|
||||
int i, j, count;
|
||||
@ -296,8 +295,7 @@ winshou()
|
||||
* Returns the number of players on scoreboard that were shown
|
||||
*/
|
||||
static int
|
||||
shou(x)
|
||||
int x;
|
||||
shou(int x)
|
||||
{
|
||||
int i, j, n, k;
|
||||
int count;
|
||||
@ -351,7 +349,7 @@ shou(x)
|
||||
*/
|
||||
static char esb[] = "The scoreboard is empty.\n";
|
||||
void
|
||||
showscores()
|
||||
showscores(void)
|
||||
{
|
||||
int i, j;
|
||||
lflush();
|
||||
@ -373,7 +371,7 @@ showscores()
|
||||
* Returns nothing of value
|
||||
*/
|
||||
void
|
||||
showallscores()
|
||||
showallscores(void)
|
||||
{
|
||||
int i, j;
|
||||
lflush();
|
||||
@ -401,7 +399,7 @@ showallscores()
|
||||
* Returns 0 if no sorting done, else returns 1
|
||||
*/
|
||||
static int
|
||||
sortboard()
|
||||
sortboard(void)
|
||||
{
|
||||
int i, j = 0, pos;
|
||||
long jdat;
|
||||
@ -440,10 +438,7 @@ sortboard()
|
||||
* ex. newscore(1000, "player 1", 32, 0);
|
||||
*/
|
||||
static void
|
||||
newscore(score, whoo, whyded, winner)
|
||||
long score;
|
||||
int winner, whyded;
|
||||
char *whoo;
|
||||
newscore(long score, char *whoo, int whyded, int winner)
|
||||
{
|
||||
int i;
|
||||
long taxes;
|
||||
@ -509,10 +504,7 @@ newscore(score, whoo, whyded, winner)
|
||||
* Returns nothing of value
|
||||
*/
|
||||
static void
|
||||
new1sub(score, i, whoo, taxes)
|
||||
long score, taxes;
|
||||
int i;
|
||||
char *whoo;
|
||||
new1sub(long score, int i, char *whoo, long taxes)
|
||||
{
|
||||
struct wscofmt *p;
|
||||
p = &winr[i];
|
||||
@ -536,10 +528,7 @@ new1sub(score, i, whoo, taxes)
|
||||
* Returns nothing of value
|
||||
*/
|
||||
static void
|
||||
new2sub(score, i, whoo, whyded)
|
||||
long score;
|
||||
int i, whyded;
|
||||
char *whoo;
|
||||
new2sub(long score, int i, char *whoo, int whyded)
|
||||
{
|
||||
int j;
|
||||
struct scofmt *p;
|
||||
@ -601,8 +590,7 @@ new2sub(score, i, whoo, whyded)
|
||||
|
||||
static int scorerror;
|
||||
void
|
||||
died(x)
|
||||
int x;
|
||||
died(int x)
|
||||
{
|
||||
int f, win;
|
||||
char ch;
|
||||
@ -768,7 +756,7 @@ diedsub(int x)
|
||||
* diedlog() Subroutine to read a log file and print it out in ascii format
|
||||
*/
|
||||
void
|
||||
diedlog()
|
||||
diedlog(void)
|
||||
{
|
||||
int n;
|
||||
char *p;
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $NetBSD: signal.c,v 1.8 2004/01/27 20:30:30 jsm Exp $ */
|
||||
/* $NetBSD: signal.c,v 1.9 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/* "Larn is copyrighted 1986 by Noah Morgan.\n" */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: signal.c,v 1.8 2004/01/27 20:30:30 jsm Exp $");
|
||||
__RCSID("$NetBSD: signal.c,v 1.9 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
@ -23,7 +23,7 @@ static void sigpanic(int);
|
||||
#define BIT(a) (1<<((a)-1))
|
||||
|
||||
static void
|
||||
s2choose()
|
||||
s2choose(void)
|
||||
{ /* text to be displayed if ^C during intro
|
||||
* screen */
|
||||
cursor(1, 24);
|
||||
@ -36,8 +36,7 @@ s2choose()
|
||||
}
|
||||
|
||||
static void
|
||||
cntlc(n)
|
||||
int n;
|
||||
cntlc(int n)
|
||||
{ /* what to do for a ^C */
|
||||
if (nosignal)
|
||||
return; /* don't do anything if inhibited */
|
||||
@ -57,8 +56,7 @@ cntlc(n)
|
||||
* subroutine to save the game if a hangup signal
|
||||
*/
|
||||
static void
|
||||
sgam(n)
|
||||
int n;
|
||||
sgam(int n)
|
||||
{
|
||||
savegame(savefilename);
|
||||
wizard = 1;
|
||||
@ -67,8 +65,7 @@ sgam(n)
|
||||
|
||||
#ifdef SIGTSTP
|
||||
static void
|
||||
tstop(n)
|
||||
int n;
|
||||
tstop(int n)
|
||||
{ /* control Y */
|
||||
if (nosignal)
|
||||
return; /* nothing if inhibited */
|
||||
@ -100,7 +97,7 @@ tstop(n)
|
||||
* subroutine to issue the needed signal traps called from main()
|
||||
*/
|
||||
void
|
||||
sigsetup()
|
||||
sigsetup(void)
|
||||
{
|
||||
signal(SIGQUIT, cntlc);
|
||||
signal(SIGINT, cntlc);
|
||||
@ -126,8 +123,7 @@ sigsetup()
|
||||
* routine to process a fatal error signal
|
||||
*/
|
||||
static void
|
||||
sigpanic(sig)
|
||||
int sig;
|
||||
sigpanic(int sig)
|
||||
{
|
||||
char buf[128];
|
||||
signal(sig, SIG_DFL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: store.c,v 1.15 2009/08/12 08:04:05 dholland Exp $ */
|
||||
/* $NetBSD: store.c,v 1.16 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988 The Regents of the University of California.
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
|
||||
#else
|
||||
__RCSID("$NetBSD: store.c,v 1.15 2009/08/12 08:04:05 dholland Exp $");
|
||||
__RCSID("$NetBSD: store.c,v 1.16 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -210,7 +210,7 @@ dnd_hed(void)
|
||||
}
|
||||
|
||||
static void
|
||||
handsfull()
|
||||
handsfull(void)
|
||||
{
|
||||
lprcat("\nYou can't carry anything more!");
|
||||
lflush();
|
||||
@ -218,7 +218,7 @@ handsfull()
|
||||
}
|
||||
|
||||
static void
|
||||
outofstock()
|
||||
outofstock(void)
|
||||
{
|
||||
lprcat("\nSorry, but we are out of that item.");
|
||||
lflush();
|
||||
@ -226,7 +226,7 @@ outofstock()
|
||||
}
|
||||
|
||||
static void
|
||||
nogold()
|
||||
nogold(void)
|
||||
{
|
||||
lprcat("\nYou don't have enough gold to pay for that!");
|
||||
lflush();
|
||||
@ -234,7 +234,7 @@ nogold()
|
||||
}
|
||||
|
||||
void
|
||||
dndstore()
|
||||
dndstore(void)
|
||||
{
|
||||
int i;
|
||||
dnditm = 0;
|
||||
@ -320,8 +320,7 @@ dndstore()
|
||||
to print the item list; used in dndstore() enter with the index into itm
|
||||
*/
|
||||
static void
|
||||
dnditem(i)
|
||||
int i;
|
||||
dnditem(int i)
|
||||
{
|
||||
int j, k;
|
||||
if (i >= MAXITM)
|
||||
@ -390,7 +389,7 @@ sch_hed(void)
|
||||
}
|
||||
|
||||
void
|
||||
oschool()
|
||||
oschool(void)
|
||||
{
|
||||
int i;
|
||||
long time_used;
|
||||
@ -515,12 +514,12 @@ oschool()
|
||||
int lasttime = 0; /* last time he was in bank */
|
||||
|
||||
void
|
||||
obank()
|
||||
obank(void)
|
||||
{
|
||||
banktitle(" Welcome to the First National Bank of Larn.");
|
||||
}
|
||||
void
|
||||
obank2()
|
||||
obank2(void)
|
||||
{
|
||||
banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
|
||||
}
|
||||
@ -560,7 +559,7 @@ banktitle(const char *str)
|
||||
* function to put interest on your bank account
|
||||
*/
|
||||
void
|
||||
ointerest()
|
||||
ointerest(void)
|
||||
{
|
||||
int i;
|
||||
if (c[BANKACCOUNT] < 0)
|
||||
@ -579,7 +578,7 @@ static short gemorder[26] = {0}; /* the reference to screen location
|
||||
* for each */
|
||||
static long gemvalue[26] = {0}; /* the appraisal of the gems */
|
||||
void
|
||||
obanksub()
|
||||
obanksub(void)
|
||||
{
|
||||
long amt;
|
||||
int i, k;
|
||||
@ -746,7 +745,7 @@ appraise(int gemstone)
|
||||
function for the trading post
|
||||
*/
|
||||
static void
|
||||
otradhead()
|
||||
otradhead(void)
|
||||
{
|
||||
clear();
|
||||
lprcat("Welcome to the Larn Trading Post. We buy items that explorers no longer find\n");
|
||||
@ -757,7 +756,7 @@ otradhead()
|
||||
}
|
||||
|
||||
void
|
||||
otradepost()
|
||||
otradepost(void)
|
||||
{
|
||||
int i, j, value, isub, izarg;
|
||||
dnditm = dndcount = 0;
|
||||
@ -853,7 +852,7 @@ cnsitm(void)
|
||||
* for the Larn Revenue Service
|
||||
*/
|
||||
void
|
||||
olrs()
|
||||
olrs(void)
|
||||
{
|
||||
int i, first;
|
||||
long amt;
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: tok.c,v 1.10 2008/02/04 01:07:01 dholland Exp $ */
|
||||
/* $NetBSD: tok.c,v 1.11 2012/06/19 05:30:44 dholland Exp $ */
|
||||
|
||||
/* tok.c Larn is copyrighted 1986 by Noah Morgan. */
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: tok.c,v 1.10 2008/02/04 01:07:01 dholland Exp $");
|
||||
__RCSID("$NetBSD: tok.c,v 1.11 2012/06/19 05:30:44 dholland Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -35,7 +35,7 @@ static u_char usermpoint = 0; /* the user monster pointer */
|
||||
lexical analyzer for larn
|
||||
*/
|
||||
int
|
||||
yylex()
|
||||
yylex(void)
|
||||
{
|
||||
char cc;
|
||||
int ic;
|
||||
@ -111,7 +111,7 @@ yylex()
|
||||
* flushall() Function to flush all type-ahead in the input buffer
|
||||
*/
|
||||
void
|
||||
flushall()
|
||||
flushall(void)
|
||||
{
|
||||
char cc;
|
||||
int ic;
|
||||
@ -132,8 +132,7 @@ flushall()
|
||||
enter with hard= -1 for default hardness, else any desired hardness
|
||||
*/
|
||||
void
|
||||
sethard(hard)
|
||||
int hard;
|
||||
sethard(int hard)
|
||||
{
|
||||
int j, k, i;
|
||||
struct monst *mp;
|
||||
@ -167,7 +166,7 @@ sethard(hard)
|
||||
function to read and process the larn options file
|
||||
*/
|
||||
void
|
||||
readopts()
|
||||
readopts(void)
|
||||
{
|
||||
const char *i;
|
||||
int j, k;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cards.c,v 1.24 2010/09/26 21:12:23 dholland Exp $ */
|
||||
/* $NetBSD: cards.c,v 1.25 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: cards.c,v 1.24 2010/09/26 21:12:23 dholland Exp $");
|
||||
__RCSID("$NetBSD: cards.c,v 1.25 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -190,7 +190,7 @@ static const struct cardinfo ch_cards[] = {
|
||||
* This routine initializes the decks from the data above.
|
||||
*/
|
||||
void
|
||||
init_decks()
|
||||
init_decks(void)
|
||||
{
|
||||
CC_D.info = cc_cards;
|
||||
CC_D.num_cards = sizeof(cc_cards) / sizeof(cc_cards[0]);
|
||||
@ -204,8 +204,7 @@ init_decks()
|
||||
* This routine sets up the offset pointers for the given deck.
|
||||
*/
|
||||
static void
|
||||
set_up(dp)
|
||||
DECK *dp;
|
||||
set_up(DECK *dp)
|
||||
{
|
||||
int r1, r2;
|
||||
int i;
|
||||
@ -235,8 +234,7 @@ set_up(dp)
|
||||
* This routine draws a card from the given deck
|
||||
*/
|
||||
void
|
||||
get_card(dp)
|
||||
DECK *dp;
|
||||
get_card(DECK *dp)
|
||||
{
|
||||
char type_maj, type_min;
|
||||
int num;
|
||||
@ -358,8 +356,7 @@ printmes(const char *text)
|
||||
* deck.
|
||||
*/
|
||||
void
|
||||
ret_card(plr)
|
||||
PLAY *plr;
|
||||
ret_card(PLAY *plr)
|
||||
{
|
||||
char type_maj;
|
||||
int gojfpos, last_card;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: execute.c,v 1.21 2008/02/24 06:12:49 dholland Exp $ */
|
||||
/* $NetBSD: execute.c,v 1.22 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: execute.c,v 1.21 2008/02/24 06:12:49 dholland Exp $");
|
||||
__RCSID("$NetBSD: execute.c,v 1.22 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -78,8 +78,7 @@ static int getnum_withbrace(const char *what, char *txt, int min, int max,
|
||||
* This routine executes the given command by index number
|
||||
*/
|
||||
void
|
||||
execute(com_num)
|
||||
int com_num;
|
||||
execute(int com_num)
|
||||
{
|
||||
new_play = FALSE; /* new_play is true if fixing */
|
||||
(*func[com_num])();
|
||||
@ -95,7 +94,7 @@ execute(com_num)
|
||||
* This routine moves a piece around.
|
||||
*/
|
||||
void
|
||||
do_move()
|
||||
do_move(void)
|
||||
{
|
||||
int r1, r2;
|
||||
bool was_jail;
|
||||
@ -128,8 +127,7 @@ ret:
|
||||
* This routine moves a normal move
|
||||
*/
|
||||
void
|
||||
move(rl)
|
||||
int rl;
|
||||
move(int rl)
|
||||
{
|
||||
int old_loc;
|
||||
|
||||
@ -146,7 +144,7 @@ move(rl)
|
||||
* This routine shows the results of a move
|
||||
*/
|
||||
static void
|
||||
show_move()
|
||||
show_move(void)
|
||||
{
|
||||
SQUARE *sqp;
|
||||
|
||||
@ -241,7 +239,7 @@ reset_game(void)
|
||||
* This routine saves the current game for use at a later date
|
||||
*/
|
||||
void
|
||||
save()
|
||||
save(void)
|
||||
{
|
||||
char *sp;
|
||||
FILE *outf;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: getinp.c,v 1.18 2008/02/24 01:57:34 dholland Exp $ */
|
||||
/* $NetBSD: getinp.c,v 1.19 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: getinp.c,v 1.18 2008/02/24 01:57:34 dholland Exp $");
|
||||
__RCSID("$NetBSD: getinp.c,v 1.19 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -51,8 +51,7 @@ static char buf[257];
|
||||
static int comp(const char *);
|
||||
|
||||
int
|
||||
getinp(prompt, lst)
|
||||
const char *prompt, *const lst[];
|
||||
getinp(const char *prompt, const char *const lst [])
|
||||
{
|
||||
int i, n_match, match = 0;
|
||||
char *sp;
|
||||
@ -102,8 +101,7 @@ getinp(prompt, lst)
|
||||
}
|
||||
|
||||
static int
|
||||
comp(s1)
|
||||
const char *s1;
|
||||
comp(const char *s1)
|
||||
{
|
||||
const char *sp, *tsp;
|
||||
char c;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: houses.c,v 1.14 2008/02/24 03:26:26 dholland Exp $ */
|
||||
/* $NetBSD: houses.c,v 1.15 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)houses.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: houses.c,v 1.14 2008/02/24 03:26:26 dholland Exp $");
|
||||
__RCSID("$NetBSD: houses.c,v 1.15 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -56,7 +56,7 @@ static bool ready_for_hotels(MON *);
|
||||
* These routines deal with buying and selling houses
|
||||
*/
|
||||
void
|
||||
buy_houses()
|
||||
buy_houses(void)
|
||||
{
|
||||
int num_mon;
|
||||
MON *mp;
|
||||
@ -112,8 +112,7 @@ over:
|
||||
}
|
||||
|
||||
static void
|
||||
buy_h(mnp)
|
||||
MON *mnp;
|
||||
buy_h(MON *mnp)
|
||||
{
|
||||
int i;
|
||||
MON *mp;
|
||||
@ -217,7 +216,7 @@ err: printf("That makes the spread too wide. Try again\n");
|
||||
* This routine sells houses.
|
||||
*/
|
||||
void
|
||||
sell_houses()
|
||||
sell_houses(void)
|
||||
{
|
||||
int num_mon;
|
||||
MON *mp;
|
||||
@ -263,8 +262,7 @@ over:
|
||||
}
|
||||
|
||||
static void
|
||||
sell_h(mnp)
|
||||
MON *mnp;
|
||||
sell_h(MON *mnp)
|
||||
{
|
||||
int i;
|
||||
MON *mp;
|
||||
@ -323,8 +321,7 @@ err: printf("That makes the spread too wide. Try again\n");
|
||||
}
|
||||
|
||||
static void
|
||||
list_cur(mp)
|
||||
MON *mp;
|
||||
list_cur(MON *mp)
|
||||
{
|
||||
int i;
|
||||
SQUARE *sqp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: jail.c,v 1.9 2008/02/24 01:57:34 dholland Exp $ */
|
||||
/* $NetBSD: jail.c,v 1.10 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)jail.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: jail.c,v 1.9 2008/02/24 01:57:34 dholland Exp $");
|
||||
__RCSID("$NetBSD: jail.c,v 1.10 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -45,7 +45,7 @@ __RCSID("$NetBSD: jail.c,v 1.9 2008/02/24 01:57:34 dholland Exp $");
|
||||
* player out of jail.
|
||||
*/
|
||||
void
|
||||
card()
|
||||
card(void)
|
||||
{
|
||||
if (cur_p->loc != JAIL) {
|
||||
printf("But you're not IN Jail\n");
|
||||
@ -64,7 +64,7 @@ card()
|
||||
* This routine deals with paying your way out of jail.
|
||||
*/
|
||||
void
|
||||
pay()
|
||||
pay(void)
|
||||
{
|
||||
if (cur_p->loc != JAIL) {
|
||||
printf("But you're not IN Jail\n");
|
||||
@ -80,8 +80,7 @@ pay()
|
||||
* This routine deals with a move in jail
|
||||
*/
|
||||
int
|
||||
move_jail(r1, r2)
|
||||
int r1, r2;
|
||||
move_jail(int r1, int r2)
|
||||
{
|
||||
if (r1 != r2) {
|
||||
printf("Sorry, that doesn't get you out\n");
|
||||
@ -104,7 +103,7 @@ moveit:
|
||||
}
|
||||
|
||||
void
|
||||
printturn()
|
||||
printturn(void)
|
||||
{
|
||||
if (cur_p->loc != JAIL)
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: misc.c,v 1.22 2011/12/01 07:05:52 ahoka Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.23 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: misc.c,v 1.22 2011/12/01 07:05:52 ahoka Exp $");
|
||||
__RCSID("$NetBSD: misc.c,v 1.23 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -52,8 +52,7 @@ static void is_monop(MON *, int);
|
||||
* "yes or "no" answer is gotten.
|
||||
*/
|
||||
int
|
||||
getyn(prompt)
|
||||
const char *prompt;
|
||||
getyn(const char *prompt)
|
||||
{
|
||||
int com;
|
||||
|
||||
@ -68,7 +67,7 @@ getyn(prompt)
|
||||
* This routine tells the player if he's out of money.
|
||||
*/
|
||||
void
|
||||
notify()
|
||||
notify(void)
|
||||
{
|
||||
if (cur_p->money < 0)
|
||||
printf("That leaves you $%d in debt\n", -cur_p->money);
|
||||
@ -84,7 +83,7 @@ notify()
|
||||
* This routine switches to the next player
|
||||
*/
|
||||
void
|
||||
next_play()
|
||||
next_play(void)
|
||||
{
|
||||
player = (player + 1) % num_play;
|
||||
cur_p = &play[player];
|
||||
@ -96,8 +95,7 @@ next_play()
|
||||
* given prompt.
|
||||
*/
|
||||
int
|
||||
get_int(prompt)
|
||||
const char *prompt;
|
||||
get_int(const char *prompt)
|
||||
{
|
||||
long num;
|
||||
char *sp;
|
||||
@ -126,8 +124,7 @@ get_int(prompt)
|
||||
* This routine sets the monopoly flag from the list given.
|
||||
*/
|
||||
void
|
||||
set_ownlist(pl)
|
||||
int pl;
|
||||
set_ownlist(int pl)
|
||||
{
|
||||
int num; /* general counter */
|
||||
MON *orig; /* remember starting monop ptr */
|
||||
@ -238,9 +235,7 @@ set_ownlist(pl)
|
||||
* This routine sets things up as if it is a new monopoly
|
||||
*/
|
||||
static void
|
||||
is_monop(mp, pl)
|
||||
MON *mp;
|
||||
int pl;
|
||||
is_monop(MON *mp, int pl)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -255,8 +250,7 @@ is_monop(mp, pl)
|
||||
* This routine sets things up as if it is no longer a monopoly
|
||||
*/
|
||||
void
|
||||
is_not_monop(mp)
|
||||
MON *mp;
|
||||
is_not_monop(MON *mp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -270,7 +264,7 @@ is_not_monop(mp)
|
||||
* This routine gives a list of the current player's routine
|
||||
*/
|
||||
void
|
||||
list()
|
||||
list(void)
|
||||
{
|
||||
printhold(player);
|
||||
}
|
||||
@ -279,7 +273,7 @@ list()
|
||||
* This routine gives a list of a given players holdings
|
||||
*/
|
||||
void
|
||||
list_all()
|
||||
list_all(void)
|
||||
{
|
||||
int pl;
|
||||
|
||||
@ -292,7 +286,7 @@ list_all()
|
||||
* This routine gives the players a chance before it exits.
|
||||
*/
|
||||
void
|
||||
quit()
|
||||
quit(void)
|
||||
{
|
||||
putchar('\n');
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: monop.c,v 1.26 2011/12/01 07:05:52 ahoka Exp $ */
|
||||
/* $NetBSD: monop.c,v 1.27 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: monop.c,v 1.26 2011/12/01 07:05:52 ahoka Exp $");
|
||||
__RCSID("$NetBSD: monop.c,v 1.27 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -223,9 +223,7 @@ SQUARE board[N_SQRS+1] = { /* board itself (+1 for Jail) */
|
||||
* This program implements a monopoly game
|
||||
*/
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
char *av[];
|
||||
main(int ac, char *av[])
|
||||
{
|
||||
/* Revoke setgid privileges */
|
||||
setgid(getgid());
|
||||
@ -254,8 +252,7 @@ main(ac, av)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
do_quit(n)
|
||||
int n __unused;
|
||||
do_quit(int n __unused)
|
||||
{
|
||||
quit();
|
||||
}
|
||||
@ -264,7 +261,7 @@ do_quit(n)
|
||||
* This routine gets the names of the players
|
||||
*/
|
||||
static void
|
||||
getplayers()
|
||||
getplayers(void)
|
||||
{
|
||||
int i, j;
|
||||
char buf[257];
|
||||
@ -318,7 +315,7 @@ blew_it:
|
||||
* This routine figures out who goes first
|
||||
*/
|
||||
static void
|
||||
init_players()
|
||||
init_players(void)
|
||||
{
|
||||
int i, rl, cur_max;
|
||||
bool over = 0;
|
||||
@ -350,7 +347,7 @@ again:
|
||||
* This routine initializes the monopoly structures.
|
||||
*/
|
||||
static void
|
||||
init_monops()
|
||||
init_monops(void)
|
||||
{
|
||||
MON *mp;
|
||||
int i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: morg.c,v 1.18 2008/02/24 06:07:06 dholland Exp $ */
|
||||
/* $NetBSD: morg.c,v 1.19 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: morg.c,v 1.18 2008/02/24 06:07:06 dholland Exp $");
|
||||
__RCSID("$NetBSD: morg.c,v 1.19 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -80,7 +80,7 @@ static void unm(int);
|
||||
* be mortgaged.
|
||||
*/
|
||||
void
|
||||
mortgage()
|
||||
mortgage(void)
|
||||
{
|
||||
int propnum;
|
||||
|
||||
@ -114,7 +114,7 @@ mortgage()
|
||||
* This routine sets up the list of mortgageable property
|
||||
*/
|
||||
static int
|
||||
set_mlist()
|
||||
set_mlist(void)
|
||||
{
|
||||
OWN *op;
|
||||
|
||||
@ -137,8 +137,7 @@ set_mlist()
|
||||
* This routine actually mortgages the property.
|
||||
*/
|
||||
static void
|
||||
m(propnum)
|
||||
int propnum;
|
||||
m(int propnum)
|
||||
{
|
||||
int price;
|
||||
|
||||
@ -154,7 +153,7 @@ m(propnum)
|
||||
* to be unmortgaged.
|
||||
*/
|
||||
void
|
||||
unmortgage()
|
||||
unmortgage(void)
|
||||
{
|
||||
int propnum;
|
||||
|
||||
@ -182,7 +181,7 @@ unmortgage()
|
||||
* This routine sets up the list of mortgaged property
|
||||
*/
|
||||
static int
|
||||
set_umlist()
|
||||
set_umlist(void)
|
||||
{
|
||||
OWN *op;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: print.c,v 1.12 2008/02/24 03:56:49 christos Exp $ */
|
||||
/* $NetBSD: print.c,v 1.13 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.12 2008/02/24 03:56:49 christos Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.13 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -48,7 +48,7 @@ static void printmorg(const SQUARE *);
|
||||
* This routine prints out the current board
|
||||
*/
|
||||
void
|
||||
printboard()
|
||||
printboard(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -64,7 +64,7 @@ printboard()
|
||||
* This routine lists where each player is.
|
||||
*/
|
||||
void
|
||||
where()
|
||||
where(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -160,8 +160,7 @@ printsq(int sqn, bool eoln)
|
||||
* This routine prints out the mortgage flag.
|
||||
*/
|
||||
static void
|
||||
printmorg(sqp)
|
||||
const SQUARE *sqp;
|
||||
printmorg(const SQUARE *sqp)
|
||||
{
|
||||
if (sqp->desc->morg)
|
||||
printf(" * ");
|
||||
@ -173,8 +172,7 @@ printmorg(sqp)
|
||||
* This routine lists the holdings of the player given
|
||||
*/
|
||||
void
|
||||
printhold(pl)
|
||||
int pl;
|
||||
printhold(int pl)
|
||||
{
|
||||
OWN *op;
|
||||
PLAY *pp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: prop.c,v 1.19 2008/02/24 05:53:33 dholland Exp $ */
|
||||
/* $NetBSD: prop.c,v 1.20 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: prop.c,v 1.19 2008/02/24 05:53:33 dholland Exp $");
|
||||
__RCSID("$NetBSD: prop.c,v 1.20 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -49,9 +49,7 @@ static int value(SQUARE *);
|
||||
* appropriate flags.
|
||||
*/
|
||||
void
|
||||
buy(playernum, sqrp)
|
||||
int playernum;
|
||||
SQUARE *sqrp;
|
||||
buy(int playernum, SQUARE *sqrp)
|
||||
{
|
||||
trading = FALSE;
|
||||
sqrp->owner = playernum;
|
||||
@ -62,10 +60,7 @@ buy(playernum, sqrp)
|
||||
* This routine adds an item to the list.
|
||||
*/
|
||||
void
|
||||
add_list(plr, head, op_sqr)
|
||||
int plr;
|
||||
OWN **head;
|
||||
int op_sqr;
|
||||
add_list(int plr, OWN **head, int op_sqr)
|
||||
{
|
||||
int val;
|
||||
OWN *tp, *last_tp;
|
||||
@ -133,8 +128,7 @@ del_list(int plr, OWN **head, short op_sqr)
|
||||
* given square.
|
||||
*/
|
||||
static int
|
||||
value(sqp)
|
||||
SQUARE *sqp;
|
||||
value(SQUARE *sqp)
|
||||
{
|
||||
int sqr;
|
||||
|
||||
@ -160,7 +154,7 @@ value(sqp)
|
||||
* This routine accepts bids for the current piece of property.
|
||||
*/
|
||||
void
|
||||
bid()
|
||||
bid(void)
|
||||
{
|
||||
static bool in[MAX_PL];
|
||||
int i, num_in, cur_max;
|
||||
@ -214,8 +208,7 @@ bid()
|
||||
* of given player.
|
||||
*/
|
||||
int
|
||||
prop_worth(plp)
|
||||
PLAY *plp;
|
||||
prop_worth(PLAY *plp)
|
||||
{
|
||||
OWN *op;
|
||||
int worth;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rent.c,v 1.8 2008/02/24 01:57:34 dholland Exp $ */
|
||||
/* $NetBSD: rent.c,v 1.9 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)rent.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: rent.c,v 1.8 2008/02/24 01:57:34 dholland Exp $");
|
||||
__RCSID("$NetBSD: rent.c,v 1.9 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -44,8 +44,7 @@ __RCSID("$NetBSD: rent.c,v 1.8 2008/02/24 01:57:34 dholland Exp $");
|
||||
* This routine has the player pay rent
|
||||
*/
|
||||
void
|
||||
rent(sqp)
|
||||
SQUARE *sqp;
|
||||
rent(SQUARE *sqp)
|
||||
{
|
||||
int rnt = 0;
|
||||
PROP *pp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: roll.c,v 1.13 2008/02/24 06:07:06 dholland Exp $ */
|
||||
/* $NetBSD: roll.c,v 1.14 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: roll.c,v 1.13 2008/02/24 06:07:06 dholland Exp $");
|
||||
__RCSID("$NetBSD: roll.c,v 1.14 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -47,8 +47,7 @@ __RCSID("$NetBSD: roll.c,v 1.13 2008/02/24 06:07:06 dholland Exp $");
|
||||
*/
|
||||
|
||||
int
|
||||
roll(ndie, nsides)
|
||||
int ndie, nsides;
|
||||
roll(int ndie, int nsides)
|
||||
{
|
||||
long tot;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: spec.c,v 1.10 2008/02/24 01:57:34 dholland Exp $ */
|
||||
/* $NetBSD: spec.c,v 1.11 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: spec.c,v 1.10 2008/02/24 01:57:34 dholland Exp $");
|
||||
__RCSID("$NetBSD: spec.c,v 1.11 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -49,7 +49,7 @@ static const char *const perc[] = {
|
||||
* collect income tax
|
||||
*/
|
||||
void
|
||||
inc_tax()
|
||||
inc_tax(void)
|
||||
{
|
||||
int worth, com_num;
|
||||
|
||||
@ -81,7 +81,7 @@ inc_tax()
|
||||
* move player to jail
|
||||
*/
|
||||
void
|
||||
goto_jail()
|
||||
goto_jail(void)
|
||||
{
|
||||
cur_p->loc = JAIL;
|
||||
}
|
||||
@ -90,7 +90,7 @@ goto_jail()
|
||||
* landing on luxury tax
|
||||
*/
|
||||
void
|
||||
lux_tax()
|
||||
lux_tax(void)
|
||||
{
|
||||
printf("You lose $75\n");
|
||||
cur_p->money -= 75;
|
||||
@ -100,7 +100,7 @@ lux_tax()
|
||||
* draw community chest card
|
||||
*/
|
||||
void
|
||||
cc()
|
||||
cc(void)
|
||||
{
|
||||
get_card(&CC_D);
|
||||
}
|
||||
@ -109,7 +109,7 @@ cc()
|
||||
* draw chance card
|
||||
*/
|
||||
void
|
||||
chance()
|
||||
chance(void)
|
||||
{
|
||||
get_card(&CH_D);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trade.c,v 1.15 2008/02/24 01:57:34 dholland Exp $ */
|
||||
/* $NetBSD: trade.c,v 1.16 2012/06/19 05:35:32 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: trade.c,v 1.15 2008/02/24 01:57:34 dholland Exp $");
|
||||
__RCSID("$NetBSD: trade.c,v 1.16 2012/06/19 05:35:32 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -62,7 +62,7 @@ static void do_trade(void);
|
||||
static void move_em(TRADE *, TRADE *);
|
||||
|
||||
void
|
||||
trade()
|
||||
trade(void)
|
||||
{
|
||||
int tradee, i;
|
||||
|
||||
@ -102,8 +102,7 @@ over:
|
||||
* player, and puts in the structure given.
|
||||
*/
|
||||
static void
|
||||
get_list(struct_no, play_no)
|
||||
int struct_no, play_no;
|
||||
get_list(int struct_no, int play_no)
|
||||
{
|
||||
int sn, pn;
|
||||
PLAY *pp;
|
||||
@ -155,8 +154,7 @@ once_more:
|
||||
* This routine sets up the list of tradable property.
|
||||
*/
|
||||
static int
|
||||
set_list(the_list)
|
||||
OWN *the_list;
|
||||
set_list(OWN *the_list)
|
||||
{
|
||||
int i;
|
||||
OWN *op;
|
||||
@ -174,7 +172,7 @@ set_list(the_list)
|
||||
* This routine summates the trade.
|
||||
*/
|
||||
static void
|
||||
summate()
|
||||
summate(void)
|
||||
{
|
||||
bool some;
|
||||
int i;
|
||||
@ -205,7 +203,7 @@ summate()
|
||||
* This routine actually executes the trade.
|
||||
*/
|
||||
static void
|
||||
do_trade()
|
||||
do_trade(void)
|
||||
{
|
||||
move_em(&trades[0], &trades[1]);
|
||||
move_em(&trades[1], &trades[0]);
|
||||
@ -215,8 +213,7 @@ do_trade()
|
||||
* This routine does a switch from one player to another
|
||||
*/
|
||||
static void
|
||||
move_em(from, to)
|
||||
TRADE *from, *to;
|
||||
move_em(TRADE *from, TRADE *to)
|
||||
{
|
||||
PLAY *pl_fr, *pl_to;
|
||||
OWN *op;
|
||||
@ -240,7 +237,7 @@ move_em(from, to)
|
||||
* This routine lets a player resign
|
||||
*/
|
||||
void
|
||||
resign()
|
||||
resign(void)
|
||||
{
|
||||
int i, new_own;
|
||||
OWN *op;
|
||||
|
Loading…
Reference in New Issue
Block a user