-/* $NetBSD: inventory.c,v 1.4 1997/05/17 19:26:24 pk Exp $ */
+/* $NetBSD: inventory.c,v 1.5 1997/10/12 11:45:11 lukem Exp $ */
/*
* Copyright (c) 1988, 1993
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: inventory.c,v 1.4 1997/05/17 19:26:24 pk Exp $";
+__RCSID("$NetBSD: inventory.c,v 1.5 1997/10/12 11:45:11 lukem Exp $");
#endif
#endif /* not lint */
};
struct id_com_s com_id_tab[COMS] = {
- '?', "? prints help",
- 'r', "r read scroll",
- '/', "/ identify object",
- 'e', "e eat food",
- 'h', "h left ",
- 'w', "w wield a weapon",
- 'j', "j down",
- 'W', "W wear armor",
- 'k', "k up",
- 'T', "T take armor off",
- 'l', "l right",
- 'P', "P put on ring",
- 'y', "y up & left",
- 'R', "R remove ring",
- 'u', "u up & right",
- 'd', "d drop object",
- 'b', "b down & left",
- 'c', "c call object",
- 'n', "n down & right",
- '\0', "<SHIFT><dir>: run that way",
- ')', ") print current weapon",
- '\0', "<CTRL><dir>: run till adjacent",
- ']', "] print current armor",
- 'f', "f<dir> fight till death or near death",
- '=', "= print current rings",
- 't', "t<dir> throw something",
- '\001', "^A print Hp-raise average",
- 'm', "m<dir> move onto without picking up",
- 'z', "z<dir> zap a wand in a direction",
- 'o', "o examine/set options",
- '^', "^<dir> identify trap type",
- '\022', "^R redraw screen",
- '&', "& save screen into 'rogue.screen'",
- 's', "s search for trap/secret door",
- '\020', "^P repeat last message",
- '>', "> go down a staircase",
- '\033', "^[ cancel command",
- '<', "< go up a staircase",
- 'S', "S save game",
- '.', ". rest for a turn",
- 'Q', "Q quit",
- ',', ", pick something up",
- '!', "! shell escape",
- 'i', "i inventory",
- 'F', "F<dir> fight till either of you dies",
- 'I', "I inventory single item",
- 'v', "v print version number",
- 'q', "q quaff potion"
+ {'?', "? prints help"},
+ {'r', "r read scroll"},
+ {'/', "/ identify object"},
+ {'e', "e eat food"},
+ {'h', "h left "},
+ {'w', "w wield a weapon"},
+ {'j', "j down"},
+ {'W', "W wear armor"},
+ {'k', "k up"},
+ {'T', "T take armor off"},
+ {'l', "l right"},
+ {'P', "P put on ring"},
+ {'y', "y up & left"},
+ {'R', "R remove ring"},
+ {'u', "u up & right"},
+ {'d', "d drop object"},
+ {'b', "b down & left"},
+ {'c', "c call object"},
+ {'n', "n down & right"},
+ {'\0', "<SHIFT><dir>: run that way"},
+ {')', ") print current weapon"},
+ {'\0', "<CTRL><dir>: run till adjacent"},
+ {']', "] print current armor"},
+ {'f', "f<dir> fight till death or near death"},
+ {'=', "= print current rings"},
+ {'t', "t<dir> throw something"},
+ {'\001', "^A print Hp-raise average"},
+ {'m', "m<dir> move onto without picking up"},
+ {'z', "z<dir> zap a wand in a direction"},
+ {'o', "o examine/set options"},
+ {'^', "^<dir> identify trap type"},
+ {'\022', "^R redraw screen"},
+ {'&', "& save screen into 'rogue.screen'"},
+ {'s', "s search for trap/secret door"},
+ {'\020', "^P repeat last message"},
+ {'>', "> go down a staircase"},
+ {'\033', "^[ cancel command"},
+ {'<', "< go up a staircase"},
+ {'S', "S save game"},
+ {'.', ". rest for a turn"},
+ {'Q', "Q quit"},
+ {',', ", pick something up"},
+ {'!', "! shell escape"},
+ {'i', "i inventory"},
+ {'F', "F<dir> fight till either of you dies"},
+ {'I', "I inventory single item"},
+ {'v', "v print version number"},
+ {'q', "q quaff potion" }
};
-extern boolean wizard;
-extern char *m_names[], *more;
-
+void
inventory(pack, mask)
-object *pack;
-unsigned short mask;
+ object *pack;
+ unsigned short mask;
{
object *obj;
short i = 0, j, maxlen = 0, n;
}
}
+void
id_com()
{
int ch = 0;
{
char save[(((COMS / 2) + (COMS % 2)) + 1)][DCOLS];
short rows = (((COMS / 2) + (COMS % 2)) + 1);
- boolean need_two_screens;
+ boolean need_two_screens = FALSE;
if (rows > LINES) {
need_two_screens = 1;
}
}
+int
pr_com_id(ch)
-int ch;
+ int ch;
{
int i;
return(1);
}
+int
get_com_id(index, ch)
-int *index;
-short ch;
+ int *index;
+ short ch;
{
short i;
return(0);
}
+int
pr_motion_char(ch)
-int ch;
+ int ch;
{
if ( (ch == 'J') ||
(ch == 'K') ||
}
}
+void
mix_colors()
{
short i, j, k;
}
}
+void
make_scroll_titles()
{
short i, j, n;
}
}
+void
get_desc(obj, desc)
-object *obj;
-char *desc;
+ object *obj;
+ char *desc;
{
char *item_name;
struct id *id_table;
}
}
+void
get_wand_and_ring_materials()
{
short i, j;
}
}
+void
single_inv(ichar)
-short ichar;
+ short ichar;
{
short ch;
char desc[DCOLS];
struct id *
get_id_table(obj)
-object *obj;
+ object *obj;
{
switch(obj->what_is) {
case SCROL:
return((struct id *) 0);
}
+void
inv_armor_weapon(is_weapon)
-boolean is_weapon;
+ boolean is_weapon;
{
if (is_weapon) {
if (rogue.weapon) {
}
}
+void
id_type()
{
char *id;