-/* $NetBSD: gamesupport.c,v 1.4 1997/10/13 02:18:16 lukem Exp $ */
+/* $NetBSD: gamesupport.c,v 1.10 2009/05/25 23:08:45 dholland Exp $ */
/*
* gamesupport.c - auxiliary routines for support of Phantasia
*/
#include "include.h"
+#undef bool
+#include <curses.h>
void
-changestats(ingameflag)
- bool ingameflag;
+changestats(phbool ingameflag)
{
static char flag[2] = /* for printing values of bools */
{'F', 'T'};
struct player *playerp; /* pointer to structure to alter */
- char *prompt; /* pointer to prompt string */
+ const char *prompt; /* pointer to prompt string */
int c; /* input */
int today; /* day of year of today */
int temp; /* temporary variable */
long loc; /* location in player file */
time_t now; /* time now */
double dtemp; /* temporary variable */
- bool *bptr; /* pointer to bool item to change */
+ phbool *bptr; /* pointer to bool item to change */
double *dptr; /* pointer to double item to change */
short *sptr; /* pointer to short item to change */
}
void
-monstlist()
+monstlist(void)
{
int count = 0; /* count in file */
puts(" #) Name Str Brain Quick Energy Exper Treas Type Flock%\n");
- fseek(Monstfp, 0L, 0);
+ fseek(Monstfp, 0L, SEEK_SET);
while (fread((char *) &Curmonster, SZ_MONSTERSTRUCT, 1, Monstfp) == 1)
printf("%2d) %-20.20s%4.0f %4.0f %2.0f %5.0f %5.0f %2d %2d %3.0f\n", count++,
Curmonster.m_name, Curmonster.m_strength, Curmonster.m_brains,
}
void
-scorelist()
+scorelist(void)
{
struct scoreboard sbuf; /* for reading entries */
FILE *fp; /* to open the file */
}
void
-activelist()
+activelist(void)
{
- fseek(Playersfp, 0L, 0);
+ fseek(Playersfp, 0L, SEEK_SET);
printf("Current characters on file are:\n\n");
while (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) == 1)
}
void
-purgeoldplayers()
+purgeoldplayers(void)
{
int today; /* day of year for today */
int daysold; /* how many days since the character has been
today = localtime(<ime)->tm_yday;
for (;;) {
- fseek(Playersfp, loc, 0);
+ fseek(Playersfp, loc, SEEK_SET);
if (fread((char *) &Other, SZ_PLAYERSTRUCT, 1, Playersfp) != 1)
break;
}
void
-enterscore()
+enterscore(void)
{
struct scoreboard sbuf; /* buffer to read in scoreboard entries */
FILE *fp; /* to open scoreboard file */
strcpy(sbuf.sb_type, descrtype(&Player, TRUE));
}
/* update entry */
- fseek(fp, loc, 0);
+ fseek(fp, loc, SEEK_SET);
fwrite((char *) &sbuf, SZ_SCORESTRUCT, 1, fp);
fclose(fp);
}