-/* $NetBSD: main.c,v 1.22 2008/02/03 19:20:42 dholland Exp $ */
+/* $NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $ */
/* main.c */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.22 2008/02/03 19:20:42 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.24 2009/08/12 08:04:05 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
#include "header.h"
#include "extern.h"
+static void showstr(void);
+static void t_setup(int);
+static void t_endup(int);
+static void showwear(void);
+static void showwield(void);
+static void showread(void);
+static void showeat(void);
+static void showquaff(void);
+static void show1(int, const char *[]);
+static void randmonst(void);
+static void parse(void);
+static void run(int);
+static void wield(void);
+static void ydhi(int);
+static void ycwi(int);
+static void wear(void);
+static void dropobj(void);
+static void readscr(void);
+static void eatcookie(void);
+static void quaff(void);
static int whatitem(const char *);
static char copyright[] = "\nLarn is copyrighted 1986 by Noah Morgan.\n";
show character's inventory
*/
-void
+static void
showstr()
{
int i, number;
/*
* subroutine to clear screen depending on # lines to display
*/
-void
+static void
t_setup(count)
int count;
{
/*
* subroutine to restore normal display screen depending on t_setup()
*/
-void
+static void
t_endup(count)
int count;
{
/*
function to show the things player is wearing only
*/
-void
+static void
showwear()
{
int i, j, sigsav, count;
/*
function to show the things player can wield only
*/
-void
+static void
showwield()
{
int i, j, sigsav, count;
/*
* function to show the things player can read only
*/
-void
+static void
showread()
{
int i, j, sigsav, count;
/*
* function to show the things player can eat only
*/
-void
+static void
showeat()
{
int i, j, sigsav, count;
/*
function to show the things player can quaff only
*/
-void
+static void
showquaff()
{
int i, j, sigsav, count;
t_endup(count);
}
-void
+static void
show1(idx, str2)
int idx;
const char *str2[];
/*
subroutine to randomly create monsters if needed
*/
-void
+static void
randmonst()
{
if (c[TIMESTOP])
get and execute a command
*/
-void
+static void
parse()
{
int i, j, k, flag;
regen();
}
-void
+static void
run(dir)
int dir;
{
/*
function to wield a weapon
*/
-void
+static void
wield()
{
int i;
/*
common routine to say you don't have an item
*/
-void
+static void
ydhi(x)
int x;
{
cursors();
lprintf("\nYou don't have item %c!", x);
}
-void
+static void
ycwi(x)
int x;
{
/*
function to wear armor
*/
-void
+static void
wear()
{
int i;
/*
function to drop an object
*/
-void
+static void
dropobj()
{
int i;
/*
* readscr() Subroutine to read a scroll one is carrying
*/
-void
+static void
readscr()
{
int i;
/*
* subroutine to eat a cookie one is carrying
*/
-void
+static void
eatcookie(void)
{
const char *p;
/*
* subroutine to quaff a potion one is carrying
*/
-void
+static void
quaff()
{
int i;
lprintf("\nWhat do you want to %s [* for all] ? ", str);
i = 0;
while (i > 'z' || (i < 'a' && i != '*' && i != '\33' && i != '.'))
- i = lgetchar();
+ i = ttgetch();
if (i == '\33')
lprcat(" aborted");
return (i);
int i;
unsigned long amt = 0;
sncbr();
- if ((i = lgetchar()) == '*')
+ if ((i = ttgetch()) == '*')
amt = mx; /* allow him to say * for all gold */
else
while (i != '\n') {
}
if ((i <= '9') && (i >= '0') && (amt < 99999999))
amt = amt * 10 + i - '0';
- i = lgetchar();
+ i = ttgetch();
}
scbr();
return (amt);