-/* $NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.u_init.c,v 1.13 2011/08/06 19:32:58 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.u_init.c,v 1.13 2011/08/06 19:32:58 dholland Exp $");
#endif /* not lint */
#include <ctype.h>
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
-struct you zerou;
-char pl_character[PL_CSIZ];
-const char *(roles[]) = { /* must all have distinct first letter */
+char pl_character[PL_CSIZ];
+
+static const struct you zerou;
+static const char *(roles[]) = { /* must all have distinct first letter */
/* roles[4] may be changed to -woman */
"Tourist", "Speleologist", "Fighter", "Knight",
"Cave-man", "Wizard"
};
#define NR_OF_ROLES SIZE(roles)
-char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
+static char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
struct trobj {
uchar trotyp;
};
#ifdef WIZARD
-struct trobj Extra_objs[] = {
+static struct trobj Extra_objs[] = {
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}
};
#endif /* WIZARD */
-struct trobj Cave_man[] = {
+static struct trobj Cave_man[] = {
{MACE, 1, WEAPON_SYM, 1, 1},
{BOW, 1, WEAPON_SYM, 1, 1},
{ARROW, 0, WEAPON_SYM, 25, 1}, /* quan is variable */
{0, 0, 0, 0, 0}
};
-struct trobj Fighter[] = {
+static struct trobj Fighter[] = {
{TWO_HANDED_SWORD, 0, WEAPON_SYM, 1, 1},
{RING_MAIL, 0, ARMOR_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Knight[] = {
+static struct trobj Knight[] = {
{LONG_SWORD, 0, WEAPON_SYM, 1, 1},
{SPEAR, 2, WEAPON_SYM, 1, 1},
{RING_MAIL, 1, ARMOR_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Speleologist[] = {
+static struct trobj Speleologist[] = {
{STUDDED_LEATHER_ARMOR, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, 0, POTION_SYM, 2, 0},
{FOOD_RATION, 0, FOOD_SYM, 3, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Tinopener[] = {
+static struct trobj Tinopener[] = {
{CAN_OPENER, 0, TOOL_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Tourist[] = {
+static struct trobj Tourist[] = {
{UNDEF_TYP, 0, FOOD_SYM, 10, 1},
{POT_EXTRA_HEALING, 0, POTION_SYM, 2, 0},
{EXPENSIVE_CAMERA, 0, TOOL_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Wizard[] = {
+static struct trobj Wizard[] = {
{ELVEN_CLOAK, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, UNDEF_SPE, WAND_SYM, 2, 0},
{UNDEF_TYP, UNDEF_SPE, RING_SYM, 2, 0},
{0, 0, 0, 0, 0}
};
+static void ini_inv(struct trobj *);
+static void wiz_inv(void);
+static int role_index(int);
+
void
u_init(void)
{
printf("\nAre you an experienced player? [ny] ");
while (!strchr("ynYN \n\004", (exper = readchar())))
- bell();
+ sound_bell();
if (exper == '\004') /* Give him an opportunity to get out */
end_of_input();
printf("%c\n", exper); /* echo */
if (pc == '\004') /* Give him the opportunity to get
* out */
end_of_input();
- bell();
+ sound_bell();
}
if (pc == '\n')
pc = 0;
if (obj->olet == WEAPON_SYM)
if (!uwep)
setuwep(obj);
-#ifndef PYRAMID_BUG
if (--trop->trquan)
continue; /* make a similar object */
-#else
- if (trop->trquan) { /* check if zero first */
- --trop->trquan;
- if (trop->trquan)
- continue; /* make a similar object */
- }
-#endif /* PYRAMID_BUG */
trop++;
}
}