Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7
This commit is contained in:
+13
-1
@@ -170,6 +170,19 @@ Variable names to avoid
|
||||
processors with segmented architectures may treat
|
||||
those as keywords. It is safest to just avoid them.
|
||||
|
||||
NEARDATA Some data is marked with this define; the Amiga port uses
|
||||
it to mark data items to be used with a short addressing mode.
|
||||
You don't need to use this.
|
||||
|
||||
static vs staticfn
|
||||
------------------
|
||||
|
||||
The staticfn macro evaluates to either "static" or to nothing (see config.h).
|
||||
If possible, functions in src/*.c that would otherwise be marked static should
|
||||
be marked staticfn so platforms that do not name static functions in their
|
||||
stack traces can be forced to do so; this means function names cannot be
|
||||
reused. Never use staticfn with data.
|
||||
|
||||
Spaces in Expressions
|
||||
---------------------
|
||||
|
||||
@@ -240,7 +253,6 @@ the final newline for every file, prior to release if not always maintained
|
||||
day-to-day. The name at the end can still be worthwhile when editing or
|
||||
browsing multiple files.
|
||||
|
||||
|
||||
Vim Configuration
|
||||
=================
|
||||
|
||||
|
||||
+1
-1
@@ -4996,7 +4996,7 @@ plus widen each inventory line by two columns.
|
||||
.lp windowcolors
|
||||
If NetHack can, it should display windows with the specified
|
||||
foreground/background colors.
|
||||
Windows GUI only.
|
||||
Windows GUI and curses windowport only.
|
||||
The format is
|
||||
.si
|
||||
.lp "OPTION=windowcolors:wintype foreground/background"
|
||||
|
||||
+1
-1
@@ -5513,7 +5513,7 @@ plus widen each inventory line by two columns.
|
||||
\item[\ib{windowcolors}]
|
||||
If {\it NetHack\/} can, it should display windows with the specified
|
||||
foreground/background colors.
|
||||
Windows GUI only.
|
||||
Windows GUI and curses windowport only.
|
||||
The format is
|
||||
\begin{verbatim}
|
||||
OPTION=windowcolors:wintype foreground/background
|
||||
|
||||
@@ -2043,6 +2043,7 @@ curses: if user's terminal was set to 'application keypad mode' (DEC VTxxx
|
||||
entry told the terminal to send 8-bit escape sequences (via 3 char
|
||||
"ESC SPC G"), nethack wasn't recognizing number pad keys
|
||||
curses: change petattr attributes, dropping support for curses-only ones
|
||||
curses: swap the grey and no-color color initialization
|
||||
macOS: Xcode project was failing to build if the path to the NetHack source
|
||||
tree contained a space; the issue was within some shell script code
|
||||
contained within the project
|
||||
@@ -2538,6 +2539,7 @@ curses: if panictrace is triggered, reset the terminal before giving backtrace
|
||||
curses: if a message is marked urgent, override message suppression initiated
|
||||
by user having typed ESC at previous More>> prompt
|
||||
curses: implement a dialog for the windowborders option
|
||||
curses: implement the windowcolors option
|
||||
Qt: the "paper doll" inventory subset can be controlled via the "Qt Settings"
|
||||
dialog box ("Preferences..." on macOS)
|
||||
Qt: draw a border around each tile in the paper doll inventory; when BUC is
|
||||
|
||||
+7
-5
@@ -681,7 +681,7 @@ getmsghistory(init)
|
||||
with the most recent.
|
||||
If init is TRUE, start over again from most recent message.
|
||||
|
||||
putmsghistory(msg)
|
||||
putmsghistory(const char *msg, boolean restoring)
|
||||
-- This is the counterpart to getmsghistory() for restores
|
||||
used to reload the port's message recall buffer.
|
||||
The routine is called repeatedly from the core restore
|
||||
@@ -690,14 +690,16 @@ putmsghistory(msg)
|
||||
savefile. The window port routine is expected to load the
|
||||
message recall buffers in such a way that the ordering
|
||||
remains correct. The window port routine should make no
|
||||
assumptions about how
|
||||
many messages are forthcoming, nor should it assume that
|
||||
another message will follow this one, so it must be careful
|
||||
to keep all pointers/indexes intact at the end of each call.
|
||||
assumptions about how many messages are forthcoming, nor
|
||||
should it assume that another message will follow this one,
|
||||
so it must be careful to keep all pointers/indexes intact
|
||||
at the end of each call.
|
||||
If the window port receives more messages that can fit in
|
||||
its buffers, it is expected to scroll away the oldest from
|
||||
its buffers, much like it would with new messages being
|
||||
produced.
|
||||
At the end of restoring messages, this will be called
|
||||
one more time with msg NULL.
|
||||
|
||||
|
||||
III. Global variables
|
||||
|
||||
+14
-2
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 config.h $NHDT-Date: 1704043695 2023/12/31 17:28:15 $ $NHDT-Branch: keni-luabits2 $:$NHDT-Revision: 1.181 $ */
|
||||
/* NetHack 3.7 config.h $NHDT-Date: 1710344316 2024/03/13 15:38:36 $ $NHDT-Branch: keni-staticfn $:$NHDT-Revision: 1.188 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2016. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -272,12 +272,24 @@
|
||||
# define PANICTRACE
|
||||
# endif
|
||||
# ifdef __linux__
|
||||
# define PANICTRACE
|
||||
# define PANICTRACE
|
||||
# define NOSTATICFN
|
||||
# endif
|
||||
// This test isn't quite right: CNG is only available from Windows 2000 on.
|
||||
// But we'll check that at runtime.
|
||||
# ifdef WIN32
|
||||
# define PANICTRACE
|
||||
# define NOSTATICFN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NONOSTATICFN
|
||||
# define staticfn static
|
||||
#else
|
||||
# ifdef NOSTATICFN
|
||||
# define staticfn
|
||||
# else
|
||||
# define staticfn static
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 extern.h $NHDT-Date: 1710008870 2024/03/09 18:27:50 $ $NHDT-Branch: keni-regex $:$NHDT-Revision: 1.1397 $ */
|
||||
/* NetHack 3.7 extern.h $NHDT-Date: 1710792423 2024/03/18 20:07:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1398 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -317,6 +317,7 @@ extern void free_one_menu_coloring(int);
|
||||
extern void free_menu_coloring(void);
|
||||
extern int count_menucolors(void);
|
||||
extern int32 check_enhanced_colors(char *) NONNULLARG1;
|
||||
extern const char *wc_color_name(int32) NONNULL;
|
||||
|
||||
/* ### cmd.c ### */
|
||||
|
||||
|
||||
@@ -195,6 +195,16 @@ struct debug_flags {
|
||||
#endif
|
||||
};
|
||||
|
||||
enum windowcolors_windows {
|
||||
wcolor_menu, wcolor_message, wcolor_status, wcolor_text,
|
||||
WC_COUNT
|
||||
};
|
||||
|
||||
struct windowcolors_struct {
|
||||
char *fg;
|
||||
char *bg;
|
||||
};
|
||||
|
||||
struct accessibility_data {
|
||||
boolean accessiblemsg; /* use msg_loc for plined messages */
|
||||
coord msg_loc; /* accessiblemsg: location */
|
||||
@@ -379,6 +389,7 @@ struct instance_flags {
|
||||
int wc_align_status; /* status win at top|bot|right|left */
|
||||
int wc_align_message; /* message win at top|bot|right|left */
|
||||
int wc_vary_msgcount; /* show more old messages at a time */
|
||||
#if 0
|
||||
char *wc_foregrnd_menu; /* points to foregrnd color name for menu win */
|
||||
char *wc_backgrnd_menu; /* points to backgrnd color name for menu win */
|
||||
char *wc_foregrnd_message; /* points to foregrnd color name for msg win */
|
||||
@@ -387,6 +398,9 @@ struct instance_flags {
|
||||
char *wc_backgrnd_status; /* points to backgrnd color name for status */
|
||||
char *wc_foregrnd_text; /* points to foregrnd color name for text win */
|
||||
char *wc_backgrnd_text; /* points to backgrnd color name for text win */
|
||||
#else
|
||||
struct windowcolors_struct wcolors[WC_COUNT];
|
||||
#endif
|
||||
char *wc_font_map; /* points to font name for the map win */
|
||||
char *wc_font_message; /* points to font name for message win */
|
||||
char *wc_font_status; /* points to font name for status win */
|
||||
|
||||
+7
-5
@@ -96,10 +96,12 @@ static int optfn_##a(int, int, boolean, char *, char *);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* B:nm, ln, opt_*, setwhere?, on?, negat?, val?, dup?, hndlr? Alias, bool_p, term */
|
||||
/* C:nm, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc */
|
||||
/* P:pfx, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc*/
|
||||
|
||||
/* B:nm, sec, ln, opt_*, setwhere?, on?, negat?, val?, dup?, hndlr? Alias,
|
||||
bool_p, term */
|
||||
/* C:nm, sec, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias,
|
||||
desc */
|
||||
/* P:pfx, sec, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias,
|
||||
desc*/
|
||||
/*
|
||||
* Most of the options are in alphabetical order; a few are forced
|
||||
* to the top of list so that doset() will list them first and
|
||||
@@ -850,7 +852,7 @@ static int optfn_##a(int, int, boolean, char *, char *);
|
||||
No, Yes, No, No, NoAlias, "window processor to use")
|
||||
#endif
|
||||
NHOPTC(windowcolors, Advanced, 80, opt_in, set_gameview,
|
||||
No, Yes, No, No, NoAlias,
|
||||
No, Yes, Yes, No, NoAlias,
|
||||
"the foreground/background colors of windows")
|
||||
/* NHOPTC(windowtype) -- moved to top */
|
||||
NHOPTB(wizmgender, Advanced, 0, opt_in, set_wizonly,
|
||||
|
||||
@@ -56,6 +56,7 @@ struct symdef {
|
||||
};
|
||||
|
||||
enum symparse_range {
|
||||
SYM_INVALID = 0,
|
||||
SYM_CONTROL = 1, /* start/finish markers */
|
||||
SYM_PCHAR = 2, /* index into showsyms */
|
||||
SYM_OC = 3, /* index into oc_syms */
|
||||
|
||||
+8
-2
@@ -32,7 +32,9 @@ extern WINDOW *activemenu; /* curses window for menu requesting a
|
||||
#define STATUS_WIN 2
|
||||
#define MAP_WIN 3
|
||||
#define INV_WIN 4
|
||||
#define NHWIN_MAX 5
|
||||
#define TEXT_WIN 5
|
||||
#define MENU_WIN 6
|
||||
#define NHWIN_MAX 7
|
||||
#if !defined(__APPLE__) || !defined(NCURSES_VERSION)
|
||||
# define USE_DARKGRAY /* Allow "bright" black; delete if not visible */
|
||||
#endif /* !__APPLE__ && !PDCURSES */
|
||||
@@ -117,7 +119,9 @@ extern win_request_info *curses_ctrl_nhwindow(winid, int, win_request_info *);
|
||||
|
||||
/* curswins.c */
|
||||
|
||||
extern WINDOW *curses_create_window(int width, int height, orient orientation);
|
||||
extern WINDOW *curses_create_window(int wid, int width, int height, orient orientation);
|
||||
extern void curses_set_wid_colors(int wid, WINDOW *win);
|
||||
extern void curses_parse_wid_colors(int wid, char *fg, char *bg);
|
||||
extern void curses_destroy_win(WINDOW *win);
|
||||
extern WINDOW *curses_get_nhwin(winid wid);
|
||||
extern void curses_add_nhwin(winid wid, int height, int width, int y,
|
||||
@@ -211,6 +215,8 @@ extern void curs_add_invt(int, char, attr_t, int, const char *);
|
||||
/* cursinit.c */
|
||||
|
||||
extern void curses_create_main_windows(void);
|
||||
extern int curses_init_rgb(int r, int g, int b);
|
||||
extern int curses_init_pair(int fg, int bg);
|
||||
extern void curses_init_nhcolors(void);
|
||||
extern void curses_choose_character(void);
|
||||
extern int curses_character_dialog(const char **choices, const char *prompt);
|
||||
|
||||
@@ -208,6 +208,7 @@ enum to_core_flags {
|
||||
};
|
||||
|
||||
enum from_core_requests {
|
||||
invalid_core_request = 0,
|
||||
set_mode = 1,
|
||||
request_settings = 2,
|
||||
set_menu_promptstyle = 3,
|
||||
|
||||
+33
-26
@@ -12,23 +12,29 @@
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
static void moveloop_preamble(boolean);
|
||||
static void u_calc_moveamt(int);
|
||||
static void maybe_do_tutorial(void);
|
||||
staticfn void moveloop_preamble(boolean);
|
||||
staticfn void u_calc_moveamt(int);
|
||||
staticfn void maybe_do_tutorial(void);
|
||||
#ifdef POSITIONBAR
|
||||
static void do_positionbar(void);
|
||||
staticfn void do_positionbar(void);
|
||||
#endif
|
||||
static void regen_pw(int);
|
||||
static void regen_hp(int);
|
||||
static void interrupt_multi(const char *);
|
||||
static void debug_fields(const char *);
|
||||
staticfn void regen_pw(int);
|
||||
staticfn void regen_hp(int);
|
||||
staticfn void interrupt_multi(const char *);
|
||||
staticfn void debug_fields(const char *);
|
||||
#ifndef NODUMPENUMS
|
||||
static void dump_enums(void);
|
||||
staticfn void dump_enums(void);
|
||||
#endif
|
||||
|
||||
#ifdef CRASHREPORT
|
||||
#define USED_FOR_CRASHREPORT
|
||||
#else
|
||||
#define USED_FOR_CRASHREPORT UNUSED
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
early_init(int argc UNUSED, char *argv[] UNUSED)
|
||||
early_init(int argc USED_FOR_CRASHREPORT, char *argv[] USED_FOR_CRASHREPORT)
|
||||
{
|
||||
#ifdef CRASHREPORT
|
||||
/* Do this as early as possible, but let ports do other things first. */
|
||||
@@ -41,7 +47,7 @@ early_init(int argc UNUSED, char *argv[] UNUSED)
|
||||
runtime_info_init();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
moveloop_preamble(boolean resuming)
|
||||
{
|
||||
/* if a save file created in normal mode is now being restored in
|
||||
@@ -101,7 +107,7 @@ moveloop_preamble(boolean resuming)
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
u_calc_moveamt(int wtcap)
|
||||
{
|
||||
int moveamt = 0;
|
||||
@@ -516,7 +522,7 @@ moveloop_core(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
maybe_do_tutorial(void)
|
||||
{
|
||||
s_level *sp = find_level("tut-1");
|
||||
@@ -549,7 +555,7 @@ moveloop(boolean resuming)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
regen_pw(int wtcap)
|
||||
{
|
||||
if (u.uen < u.uenmax
|
||||
@@ -571,7 +577,7 @@ regen_pw(int wtcap)
|
||||
#define U_CAN_REGEN() (Regeneration || (Sleepy && u.usleep))
|
||||
|
||||
/* maybe recover some lost health (or lose some when an eel out of water) */
|
||||
static void
|
||||
staticfn void
|
||||
regen_hp(int wtcap)
|
||||
{
|
||||
int heal = 0;
|
||||
@@ -832,7 +838,7 @@ welcome(boolean new_game) /* false => restoring an old game */
|
||||
}
|
||||
|
||||
#ifdef POSITIONBAR
|
||||
static void
|
||||
staticfn void
|
||||
do_positionbar(void)
|
||||
{
|
||||
/* FIXME: this will break if any coordinate is too big for (char);
|
||||
@@ -875,7 +881,7 @@ do_positionbar(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
interrupt_multi(const char *msg)
|
||||
{
|
||||
if (gm.multi > 0 && !gc.context.travel && !gc.context.run) {
|
||||
@@ -1043,7 +1049,7 @@ argcheck(int argc, char *argv[], enum earlyarg e_arg)
|
||||
* optimization so that display output
|
||||
* can be debugged without buffering.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
debug_fields(const char *opts)
|
||||
{
|
||||
char *op;
|
||||
@@ -1109,6 +1115,7 @@ timet_delta(time_t etim, time_t stim) /* end and start times */
|
||||
|
||||
#if !defined(NODUMPENUMS) || defined(ENHANCED_SYMBOLS)
|
||||
/* monsdump[] and objdump[] are also used in utf8map.c */
|
||||
|
||||
#define DUMP_ENUMS
|
||||
struct enum_dump monsdump[] = {
|
||||
#include "monsters.h"
|
||||
@@ -1124,46 +1131,46 @@ struct enum_dump objdump[] = {
|
||||
};
|
||||
|
||||
#define DUMP_ENUMS_PCHAR
|
||||
struct enum_dump defsym_cmap_dump[] = {
|
||||
static struct enum_dump defsym_cmap_dump[] = {
|
||||
#include "defsym.h"
|
||||
{ MAXPCHARS, "MAXPCHARS" },
|
||||
};
|
||||
#undef DUMP_ENUMS_PCHAR
|
||||
|
||||
#define DUMP_ENUMS_MONSYMS
|
||||
struct enum_dump defsym_mon_syms_dump[] = {
|
||||
static struct enum_dump defsym_mon_syms_dump[] = {
|
||||
#include "defsym.h"
|
||||
{ MAXMCLASSES, "MAXMCLASSES" },
|
||||
};
|
||||
#undef DUMP_ENUMS_MONSYMS
|
||||
|
||||
#define DUMP_ENUMS_MONSYMS_DEFCHAR
|
||||
struct enum_dump defsym_mon_defchars_dump[] = {
|
||||
static struct enum_dump defsym_mon_defchars_dump[] = {
|
||||
#include "defsym.h"
|
||||
};
|
||||
#undef DUMP_ENUMS_MONSYMS_DEFCHAR
|
||||
|
||||
#define DUMP_ENUMS_OBJCLASS_DEFCHARS
|
||||
struct enum_dump objclass_defchars_dump[] = {
|
||||
static struct enum_dump objclass_defchars_dump[] = {
|
||||
#include "defsym.h"
|
||||
};
|
||||
#undef DUMP_ENUMS_OBJCLASS_DEFCHARS
|
||||
|
||||
#define DUMP_ENUMS_OBJCLASS_CLASSES
|
||||
struct enum_dump objclass_classes_dump[] = {
|
||||
static struct enum_dump objclass_classes_dump[] = {
|
||||
#include "defsym.h"
|
||||
{ MAXOCLASSES, "MAXOCLASSES" },
|
||||
};
|
||||
#undef DUMP_ENUMS_OBJCLASS_CLASSES
|
||||
|
||||
#define DUMP_ENUMS_OBJCLASS_SYMS
|
||||
struct enum_dump objclass_syms_dump[] = {
|
||||
static struct enum_dump objclass_syms_dump[] = {
|
||||
#include "defsym.h"
|
||||
};
|
||||
#undef DUMP_ENUMS_OBJCLASS_SYMS
|
||||
|
||||
#define DUMP_ARTI_ENUM
|
||||
struct enum_dump arti_enum_dump[] = {
|
||||
static struct enum_dump arti_enum_dump[] = {
|
||||
#include "artilist.h"
|
||||
{ AFTER_LAST_ARTIFACT, "AFTER_LAST_ARTIFACT" }
|
||||
};
|
||||
@@ -1174,7 +1181,7 @@ struct enum_dump arti_enum_dump[] = {
|
||||
|
||||
#ifndef NODUMPENUMS
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dump_enums(void)
|
||||
{
|
||||
enum enum_dumps {
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ char *fmt_ptr(const genericptr) NONNULL;
|
||||
#undef re_alloc
|
||||
#undef free
|
||||
extern void free(genericptr_t);
|
||||
static void heapmon_init(void);
|
||||
staticfn void heapmon_init(void);
|
||||
|
||||
static FILE *heaplog = 0;
|
||||
static boolean tried_heaplog = FALSE;
|
||||
@@ -138,7 +138,7 @@ fmt_ptr(const genericptr ptr)
|
||||
|
||||
/* If ${NH_HEAPLOG} is defined and we can create a file by that name,
|
||||
then we'll log the allocation and release information to that file. */
|
||||
static void
|
||||
staticfn void
|
||||
heapmon_init(void)
|
||||
{
|
||||
char *logname = getenv("NH_HEAPLOG");
|
||||
|
||||
+90
-90
@@ -5,56 +5,56 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int use_camera(struct obj *);
|
||||
static int use_towel(struct obj *);
|
||||
static boolean its_dead(coordxy, coordxy, int *);
|
||||
static int use_stethoscope(struct obj *);
|
||||
static void use_whistle(struct obj *);
|
||||
static void use_magic_whistle(struct obj *);
|
||||
static void magic_whistled(struct obj *);
|
||||
static int use_leash(struct obj *);
|
||||
static boolean mleashed_next2u(struct monst *);
|
||||
static int use_mirror(struct obj *);
|
||||
static void use_bell(struct obj **);
|
||||
static void use_candelabrum(struct obj *);
|
||||
static void use_candle(struct obj **);
|
||||
static void use_lamp(struct obj *);
|
||||
static void light_cocktail(struct obj **);
|
||||
static int rub_ok(struct obj *);
|
||||
static void display_jump_positions(boolean);
|
||||
static void use_tinning_kit(struct obj *);
|
||||
static int use_figurine(struct obj **);
|
||||
static int grease_ok(struct obj *);
|
||||
static int use_grease(struct obj *);
|
||||
static void use_trap(struct obj *);
|
||||
static int touchstone_ok(struct obj *);
|
||||
static int use_stone(struct obj *);
|
||||
static int set_trap(void); /* occupation callback */
|
||||
static void display_polearm_positions(boolean);
|
||||
static int use_cream_pie(struct obj *);
|
||||
static int jelly_ok(struct obj *);
|
||||
static int use_royal_jelly(struct obj **);
|
||||
static int grapple_range(void);
|
||||
static boolean can_grapple_location(coordxy, coordxy);
|
||||
static void display_grapple_positions(boolean);
|
||||
static int use_grapple(struct obj *);
|
||||
static void discard_broken_wand(void);
|
||||
static void broken_wand_explode(struct obj *, int, int);
|
||||
static int do_break_wand(struct obj *);
|
||||
static int apply_ok(struct obj *);
|
||||
static int flip_through_book(struct obj *);
|
||||
static int flip_coin(struct obj *);
|
||||
static boolean figurine_location_checks(struct obj *, coord *, boolean);
|
||||
static boolean check_jump(genericptr_t, coordxy, coordxy);
|
||||
static boolean is_valid_jump_pos(coordxy, coordxy, int, boolean);
|
||||
static boolean get_valid_jump_position(coordxy, coordxy);
|
||||
static boolean get_valid_polearm_position(coordxy, coordxy);
|
||||
static boolean find_poleable_mon(coord *, int, int);
|
||||
staticfn int use_camera(struct obj *);
|
||||
staticfn int use_towel(struct obj *);
|
||||
staticfn boolean its_dead(coordxy, coordxy, int *);
|
||||
staticfn int use_stethoscope(struct obj *);
|
||||
staticfn void use_whistle(struct obj *);
|
||||
staticfn void use_magic_whistle(struct obj *);
|
||||
staticfn void magic_whistled(struct obj *);
|
||||
staticfn int use_leash(struct obj *);
|
||||
staticfn boolean mleashed_next2u(struct monst *);
|
||||
staticfn int use_mirror(struct obj *);
|
||||
staticfn void use_bell(struct obj **);
|
||||
staticfn void use_candelabrum(struct obj *);
|
||||
staticfn void use_candle(struct obj **);
|
||||
staticfn void use_lamp(struct obj *);
|
||||
staticfn void light_cocktail(struct obj **);
|
||||
staticfn int rub_ok(struct obj *);
|
||||
staticfn void display_jump_positions(boolean);
|
||||
staticfn void use_tinning_kit(struct obj *);
|
||||
staticfn int use_figurine(struct obj **);
|
||||
staticfn int grease_ok(struct obj *);
|
||||
staticfn int use_grease(struct obj *);
|
||||
staticfn void use_trap(struct obj *);
|
||||
staticfn int touchstone_ok(struct obj *);
|
||||
staticfn int use_stone(struct obj *);
|
||||
staticfn int set_trap(void); /* occupation callback */
|
||||
staticfn void display_polearm_positions(boolean);
|
||||
staticfn int use_cream_pie(struct obj *);
|
||||
staticfn int jelly_ok(struct obj *);
|
||||
staticfn int use_royal_jelly(struct obj **);
|
||||
staticfn int grapple_range(void);
|
||||
staticfn boolean can_grapple_location(coordxy, coordxy);
|
||||
staticfn void display_grapple_positions(boolean);
|
||||
staticfn int use_grapple(struct obj *);
|
||||
staticfn void discard_broken_wand(void);
|
||||
staticfn void broken_wand_explode(struct obj *, int, int);
|
||||
staticfn int do_break_wand(struct obj *);
|
||||
staticfn int apply_ok(struct obj *);
|
||||
staticfn int flip_through_book(struct obj *);
|
||||
staticfn int flip_coin(struct obj *);
|
||||
staticfn boolean figurine_location_checks(struct obj *, coord *, boolean);
|
||||
staticfn boolean check_jump(genericptr_t, coordxy, coordxy);
|
||||
staticfn boolean is_valid_jump_pos(coordxy, coordxy, int, boolean);
|
||||
staticfn boolean get_valid_jump_position(coordxy, coordxy);
|
||||
staticfn boolean get_valid_polearm_position(coordxy, coordxy);
|
||||
staticfn boolean find_poleable_mon(coord *, int, int);
|
||||
|
||||
static const char
|
||||
no_elbow_room[] = "don't have enough elbow-room to maneuver.";
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_camera(struct obj *obj)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -96,7 +96,7 @@ use_camera(struct obj *obj)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_towel(struct obj *obj)
|
||||
{
|
||||
boolean drying_feedback = (obj == uwep);
|
||||
@@ -182,7 +182,7 @@ use_towel(struct obj *obj)
|
||||
}
|
||||
|
||||
/* maybe give a stethoscope message based on floor objects */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
its_dead(coordxy rx, coordxy ry, int *resp)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -303,7 +303,7 @@ static const char hollow_str[] = "a hollow sound. This must be a secret %s!";
|
||||
not take any time; however, unless it did, the stethoscope would be
|
||||
almost useless. As a compromise, one use per turn is free, another
|
||||
uses up the turn; this makes curse status have a tangible effect. */
|
||||
static int
|
||||
staticfn int
|
||||
use_stethoscope(struct obj *obj)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -460,7 +460,7 @@ use_stethoscope(struct obj *obj)
|
||||
static const char whistle_str[] = "produce a %s whistling sound.",
|
||||
alt_whistle_str[] = "produce a %s, sharp vibration.";
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_whistle(struct obj *obj)
|
||||
{
|
||||
if (!can_blow(&gy.youmonst)) {
|
||||
@@ -479,7 +479,7 @@ use_whistle(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_magic_whistle(struct obj *obj)
|
||||
{
|
||||
if (!can_blow(&gy.youmonst)) {
|
||||
@@ -500,7 +500,7 @@ use_magic_whistle(struct obj *obj)
|
||||
}
|
||||
|
||||
/* 'obj' is assumed to be a magic whistle */
|
||||
static void
|
||||
staticfn void
|
||||
magic_whistled(struct obj *obj)
|
||||
{
|
||||
struct monst *mtmp, *nextmon;
|
||||
@@ -747,7 +747,7 @@ leashable(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
staticfn int
|
||||
use_leash(struct obj *obj)
|
||||
{
|
||||
coord cc;
|
||||
@@ -867,7 +867,7 @@ get_mleash(struct monst *mtmp)
|
||||
return otmp;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mleashed_next2u(struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->mleashed) {
|
||||
@@ -993,7 +993,7 @@ beautiful(void)
|
||||
|
||||
static const char look_str[] = "look %s.";
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_mirror(struct obj *obj)
|
||||
{
|
||||
const char *mirror, *uvisage;
|
||||
@@ -1177,7 +1177,7 @@ use_mirror(struct obj *obj)
|
||||
#undef SEENMON
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_bell(struct obj **optr)
|
||||
{
|
||||
struct obj *obj = *optr;
|
||||
@@ -1294,7 +1294,7 @@ use_bell(struct obj **optr)
|
||||
wake_nearby();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_candelabrum(struct obj *obj)
|
||||
{
|
||||
const char *s = (obj->spe != 1) ? "candles" : "candle";
|
||||
@@ -1362,7 +1362,7 @@ use_candelabrum(struct obj *obj)
|
||||
begin_burn(obj, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_candle(struct obj **optr)
|
||||
{
|
||||
struct obj *obj = *optr;
|
||||
@@ -1596,7 +1596,7 @@ catch_lit(struct obj *obj)
|
||||
}
|
||||
|
||||
/* light a lamp or candle */
|
||||
static void
|
||||
staticfn void
|
||||
use_lamp(struct obj *obj)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -1670,7 +1670,7 @@ use_lamp(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
light_cocktail(struct obj **optr)
|
||||
{
|
||||
struct obj *obj = *optr; /* obj is a potion of oil */
|
||||
@@ -1737,7 +1737,7 @@ light_cocktail(struct obj **optr)
|
||||
|
||||
/* getobj callback for object to be rubbed - not selecting a secondary object
|
||||
to rub on a gray stone or rub jelly on */
|
||||
static int
|
||||
staticfn int
|
||||
rub_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -1829,7 +1829,7 @@ enum jump_trajectory {
|
||||
};
|
||||
|
||||
/* callback routine for walk_path() */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
check_jump(genericptr arg, coordxy x, coordxy y)
|
||||
{
|
||||
int traj = *(int *) arg;
|
||||
@@ -1860,7 +1860,7 @@ check_jump(genericptr arg, coordxy x, coordxy y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_valid_jump_pos(coordxy x, coordxy y, int magic, boolean showmsg)
|
||||
{
|
||||
if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
|
||||
@@ -1926,7 +1926,7 @@ is_valid_jump_pos(coordxy x, coordxy y, int magic, boolean showmsg)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
get_valid_jump_position(coordxy x, coordxy y)
|
||||
{
|
||||
return (isok(x, y)
|
||||
@@ -1934,7 +1934,7 @@ get_valid_jump_position(coordxy x, coordxy y)
|
||||
&& is_valid_jump_pos(x, y, gj.jumping_is_magic, FALSE));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
display_jump_positions(boolean on_off)
|
||||
{
|
||||
coordxy x, y, dx, dy;
|
||||
@@ -2145,7 +2145,7 @@ tinnable(struct obj *corpse)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
use_tinning_kit(struct obj *obj)
|
||||
{
|
||||
struct obj *corpse, *can;
|
||||
@@ -2478,7 +2478,7 @@ fig_transform(anything *arg, long timeout)
|
||||
newsym(cc.x, cc.y);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
figurine_location_checks(struct obj *obj, coord *cc, boolean quietly)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -2511,7 +2511,7 @@ figurine_location_checks(struct obj *obj, coord *cc, boolean quietly)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_figurine(struct obj **optr)
|
||||
{
|
||||
struct obj *obj = *optr;
|
||||
@@ -2552,7 +2552,7 @@ use_figurine(struct obj **optr)
|
||||
}
|
||||
|
||||
/* getobj callback for object to apply grease to */
|
||||
static int
|
||||
staticfn int
|
||||
grease_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -2569,7 +2569,7 @@ grease_ok(struct obj *obj)
|
||||
return GETOBJ_SUGGEST;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_grease(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -2623,7 +2623,7 @@ use_grease(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for object to rub on a known touchstone */
|
||||
static int
|
||||
staticfn int
|
||||
touchstone_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -2645,7 +2645,7 @@ touchstone_ok(struct obj *obj)
|
||||
|
||||
|
||||
/* touchstones - by Ken Arnold */
|
||||
static int
|
||||
staticfn int
|
||||
use_stone(struct obj *tstone)
|
||||
{
|
||||
static const char scritch[] = "\"scritch, scritch\"";
|
||||
@@ -2786,7 +2786,7 @@ reset_trapset(void)
|
||||
}
|
||||
|
||||
/* Place a landmine/bear trap. Helge Hafting */
|
||||
static void
|
||||
staticfn void
|
||||
use_trap(struct obj *otmp)
|
||||
{
|
||||
int ttyp, tmp;
|
||||
@@ -2880,7 +2880,7 @@ use_trap(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* occupation routine called each turn while arming a beartrap or landmine */
|
||||
static int
|
||||
staticfn int
|
||||
set_trap(void)
|
||||
{
|
||||
struct obj *otmp = gt.trapinfo.tobj;
|
||||
@@ -3247,7 +3247,7 @@ static const char
|
||||
(glyph_is_monster(G) || glyph_is_invisible(G) || glyph_is_statue(G))
|
||||
|
||||
/* find pos of monster in range, if only one monster */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
find_poleable_mon(coord *pos, int min_range, int max_range)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -3285,7 +3285,7 @@ find_poleable_mon(coord *pos, int min_range, int max_range)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
get_valid_polearm_position(coordxy x, coordxy y)
|
||||
{
|
||||
int glyph;
|
||||
@@ -3298,7 +3298,7 @@ get_valid_polearm_position(coordxy x, coordxy y)
|
||||
&& glyph_is_poleable(glyph))));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
display_polearm_positions(boolean on_off)
|
||||
{
|
||||
coordxy x, y, dx, dy;
|
||||
@@ -3470,7 +3470,7 @@ use_pole(struct obj *obj, boolean autohit)
|
||||
|
||||
#undef glyph_is_poleable
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_cream_pie(struct obj *obj)
|
||||
{
|
||||
boolean wasblind = Blind;
|
||||
@@ -3509,7 +3509,7 @@ use_cream_pie(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for object to rub royal jelly on */
|
||||
static int
|
||||
staticfn int
|
||||
jelly_ok(struct obj *obj)
|
||||
{
|
||||
if (obj && obj->otyp == EGG)
|
||||
@@ -3518,7 +3518,7 @@ jelly_ok(struct obj *obj)
|
||||
return GETOBJ_EXCLUDE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_royal_jelly(struct obj **optr)
|
||||
{
|
||||
int oldcorpsenm;
|
||||
@@ -3588,7 +3588,7 @@ use_royal_jelly(struct obj **optr)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
grapple_range(void)
|
||||
{
|
||||
int typ = uwep_skill_type();
|
||||
@@ -3603,13 +3603,13 @@ grapple_range(void)
|
||||
return max_range;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
can_grapple_location(coordxy x, coordxy y)
|
||||
{
|
||||
return (isok(x, y) && cansee(x, y) && distu(x, y) <= grapple_range());
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
display_grapple_positions(boolean on_off)
|
||||
{
|
||||
coordxy x, y, dx, dy;
|
||||
@@ -3631,7 +3631,7 @@ display_grapple_positions(boolean on_off)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
use_grapple(struct obj *obj)
|
||||
{
|
||||
int res = ECMD_OK, typ, tohit;
|
||||
@@ -3777,7 +3777,7 @@ use_grapple(struct obj *obj)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
discard_broken_wand(void)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -3789,7 +3789,7 @@ discard_broken_wand(void)
|
||||
nomul(0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
broken_wand_explode(struct obj *obj, int dmg, int expltype)
|
||||
{
|
||||
explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
|
||||
@@ -3798,7 +3798,7 @@ broken_wand_explode(struct obj *obj, int dmg, int expltype)
|
||||
}
|
||||
|
||||
/* return 1 if the wand is broken, hence some time elapsed */
|
||||
static int
|
||||
staticfn int
|
||||
do_break_wand(struct obj *obj)
|
||||
{
|
||||
#define BY_OBJECT ((struct monst *) 0)
|
||||
@@ -4031,7 +4031,7 @@ do_break_wand(struct obj *obj)
|
||||
|
||||
/* getobj callback for object to apply - this is more complex than most other
|
||||
* callbacks because there are a lot of appliables */
|
||||
static int
|
||||
staticfn int
|
||||
apply_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -4343,7 +4343,7 @@ unfixable_trouble_count(boolean is_horn)
|
||||
return unfixable_trbl;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
flip_through_book(struct obj *obj)
|
||||
{
|
||||
if (Underwater) {
|
||||
@@ -4397,7 +4397,7 @@ flip_through_book(struct obj *obj)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
flip_coin(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp = obj;
|
||||
|
||||
+24
-23
@@ -21,17 +21,18 @@ static struct artifact *get_artifact(struct obj *) NONNULL; /* never returns nul
|
||||
? &artilist[(int) (o)->oartifact] \
|
||||
: &artilist[ART_NONARTIFACT]) */
|
||||
|
||||
static boolean bane_applies(const struct artifact *, struct monst *) NONNULLARG12;
|
||||
static int spec_applies(const struct artifact *, struct monst *) NONNULLARG12;
|
||||
static int invoke_ok(struct obj *);
|
||||
static int arti_invoke(struct obj *);
|
||||
static boolean Mb_hit(struct monst * magr, struct monst *mdef,
|
||||
staticfn boolean bane_applies(const struct artifact *, struct monst *)
|
||||
NONNULLARG12;
|
||||
staticfn int spec_applies(const struct artifact *, struct monst *) NONNULLARG12;
|
||||
staticfn int invoke_ok(struct obj *);
|
||||
staticfn int arti_invoke(struct obj *);
|
||||
staticfn boolean Mb_hit(struct monst * magr, struct monst *mdef,
|
||||
struct obj *, int *, int, boolean, char *);
|
||||
static unsigned long abil_to_spfx(long *) NONNULLARG1;
|
||||
static uchar abil_to_adtyp(long *) NONNULLARG1;
|
||||
static int glow_strength(int);
|
||||
static boolean untouchable(struct obj *, boolean);
|
||||
static int count_surround_traps(coordxy, coordxy);
|
||||
staticfn unsigned long abil_to_spfx(long *) NONNULLARG1;
|
||||
staticfn uchar abil_to_adtyp(long *) NONNULLARG1;
|
||||
staticfn int glow_strength(int);
|
||||
staticfn boolean untouchable(struct obj *, boolean);
|
||||
staticfn int count_surround_traps(coordxy, coordxy);
|
||||
|
||||
/* The amount added to the victim's total hit points to insure that the
|
||||
victim will be killed even after damage bonus/penalty adjustments.
|
||||
@@ -69,10 +70,10 @@ static xint16 artidisco[NROFARTIFACTS];
|
||||
*/
|
||||
static const struct arti_info zero_artiexist = {0}; /* all bits zero */
|
||||
|
||||
static void hack_artifacts(void);
|
||||
staticfn void hack_artifacts(void);
|
||||
|
||||
/* handle some special cases; must be called after u_init() */
|
||||
static void
|
||||
staticfn void
|
||||
hack_artifacts(void)
|
||||
{
|
||||
struct artifact *art;
|
||||
@@ -891,7 +892,7 @@ arti_immune(struct obj *obj, int dtyp)
|
||||
|| weap->cary.adtyp == dtyp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
bane_applies(const struct artifact *oart, struct monst *mon)
|
||||
{
|
||||
struct artifact atmp;
|
||||
@@ -907,7 +908,7 @@ bane_applies(const struct artifact *oart, struct monst *mon)
|
||||
}
|
||||
|
||||
/* decide whether an artifact's special attacks apply against mtmp */
|
||||
static int
|
||||
staticfn int
|
||||
spec_applies(const struct artifact *weap, struct monst *mtmp)
|
||||
{
|
||||
struct permonst *ptr;
|
||||
@@ -1147,7 +1148,7 @@ static const char *const mb_verb[2][NUM_MB_INDICES] = {
|
||||
};
|
||||
|
||||
/* called when someone is being hit by Magicbane */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
Mb_hit(struct monst *magr, /* attacker */
|
||||
struct monst *mdef, /* defender */
|
||||
struct obj *mb, /* Magicbane */
|
||||
@@ -1629,7 +1630,7 @@ artifact_hit(
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* getobj callback for object to be invoked */
|
||||
static int
|
||||
staticfn int
|
||||
invoke_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -1664,7 +1665,7 @@ doinvoke(void)
|
||||
return arti_invoke(obj);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
arti_invoke(struct obj *obj)
|
||||
{
|
||||
const struct artifact *oart = get_artifact(obj);
|
||||
@@ -2056,7 +2057,7 @@ arti_cost(struct obj *otmp)
|
||||
return (100L * (long) objects[otmp->otyp].oc_cost);
|
||||
}
|
||||
|
||||
static uchar
|
||||
staticfn uchar
|
||||
abil_to_adtyp(long *abil)
|
||||
{
|
||||
struct abil2adtyp_tag {
|
||||
@@ -2080,7 +2081,7 @@ abil_to_adtyp(long *abil)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
staticfn unsigned long
|
||||
abil_to_spfx(long *abil)
|
||||
{
|
||||
static const struct abil2spfx_tag {
|
||||
@@ -2174,7 +2175,7 @@ static const char *const glow_verbs[] = {
|
||||
};
|
||||
|
||||
/* relative strength that Sting is glowing (0..3), to select verb */
|
||||
static int
|
||||
staticfn int
|
||||
glow_strength(int count)
|
||||
{
|
||||
/* glow strength should also be proportional to proximity and
|
||||
@@ -2328,7 +2329,7 @@ retouch_object(
|
||||
or an artifact which conveys something via being carried or which
|
||||
has an #invoke effect currently in operation undergoes a touch test;
|
||||
if it fails, it will be unworn/unwielded and maybe dropped */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
untouchable(
|
||||
struct obj *obj, /* object to test; in invent or is steed's saddle */
|
||||
boolean drop_untouchable) /* whether to drop it if it can't be touched */
|
||||
@@ -2438,7 +2439,7 @@ retouch_equipment(
|
||||
clear_bypasses(); /* reset upon final exit */
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
count_surround_traps(coordxy x, coordxy y)
|
||||
{
|
||||
struct rm *levp;
|
||||
@@ -2552,7 +2553,7 @@ is_art(struct obj *obj, int art)
|
||||
? &artilist[(int) (o)->oartifact] \
|
||||
: &artilist[ART_NONARTIFACT]) */
|
||||
|
||||
static struct artifact *
|
||||
staticfn struct artifact *
|
||||
get_artifact(struct obj *obj)
|
||||
{
|
||||
if (obj) {
|
||||
|
||||
+17
-15
@@ -14,7 +14,9 @@ static const char
|
||||
*const minusattr[] = { "weak", "stupid",
|
||||
"foolish", "clumsy",
|
||||
"fragile", "repulsive" };
|
||||
/* also used by enlightenment for non-abbreviated status info */
|
||||
/* also used by enlightenment in insight.c for non-abbreviated status info */
|
||||
extern const char *const attrname[6];
|
||||
|
||||
const char
|
||||
*const attrname[] = { "strength", "intelligence", "wisdom",
|
||||
"dexterity", "constitution", "charisma" };
|
||||
@@ -103,13 +105,13 @@ static const struct innate {
|
||||
|
||||
hum_abil[] = { { 0, 0, 0, 0 } };
|
||||
|
||||
static void exerper(void);
|
||||
static int rnd_attr(void);
|
||||
static int init_attr_role_redist(int, boolean);
|
||||
static void postadjabil(long *);
|
||||
static const struct innate *role_abil(int);
|
||||
static const struct innate *check_innate_abil(long *, long);
|
||||
static int innately(long *);
|
||||
staticfn void exerper(void);
|
||||
staticfn int rnd_attr(void);
|
||||
staticfn int init_attr_role_redist(int, boolean);
|
||||
staticfn void postadjabil(long *);
|
||||
staticfn const struct innate *role_abil(int);
|
||||
staticfn const struct innate *check_innate_abil(long *, long);
|
||||
staticfn int innately(long *);
|
||||
|
||||
/* adjust an attribute; return TRUE if change is made, FALSE otherwise */
|
||||
boolean
|
||||
@@ -503,7 +505,7 @@ exercise(int i, boolean inc_or_dec)
|
||||
(void) encumber_msg();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
exerper(void)
|
||||
{
|
||||
if (!(gm.moves % 10)) {
|
||||
@@ -664,7 +666,7 @@ exerchk(void)
|
||||
|
||||
/* return random hero attribute (by role's attr distribution).
|
||||
returns A_MAX if failed. */
|
||||
static int
|
||||
staticfn int
|
||||
rnd_attr(void)
|
||||
{
|
||||
int i, x = rn2(100);
|
||||
@@ -681,7 +683,7 @@ rnd_attr(void)
|
||||
adjusting the base and maximum values of the attributes.
|
||||
if subtracting, np must be negative.
|
||||
returns the left over points. */
|
||||
static int
|
||||
staticfn int
|
||||
init_attr_role_redist(int np, boolean addition)
|
||||
{
|
||||
int tryct = 0;
|
||||
@@ -759,7 +761,7 @@ vary_init_attr(void)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
staticfn
|
||||
void
|
||||
postadjabil(long *ability)
|
||||
{
|
||||
@@ -769,7 +771,7 @@ postadjabil(long *ability)
|
||||
see_monsters();
|
||||
}
|
||||
|
||||
static const struct innate *
|
||||
staticfn const struct innate *
|
||||
role_abil(int r)
|
||||
{
|
||||
const struct {
|
||||
@@ -798,7 +800,7 @@ role_abil(int r)
|
||||
return roleabils[i].abil;
|
||||
}
|
||||
|
||||
static const struct innate *
|
||||
staticfn const struct innate *
|
||||
check_innate_abil(long *ability, long frommask)
|
||||
{
|
||||
const struct innate *abil = 0;
|
||||
@@ -844,7 +846,7 @@ check_innate_abil(long *ability, long frommask)
|
||||
#define FROM_LYCN 6
|
||||
|
||||
/* check whether particular ability has been obtained via innate attribute */
|
||||
static int
|
||||
staticfn int
|
||||
innately(long *ability)
|
||||
{
|
||||
const struct innate *iptr;
|
||||
|
||||
+10
-10
@@ -8,11 +8,11 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int bc_order(void);
|
||||
static void litter(void);
|
||||
static void placebc_core(void);
|
||||
static void unplacebc_core(void);
|
||||
static boolean check_restriction(int);
|
||||
staticfn int bc_order(void);
|
||||
staticfn void litter(void);
|
||||
staticfn void placebc_core(void);
|
||||
staticfn void unplacebc_core(void);
|
||||
staticfn boolean check_restriction(int);
|
||||
|
||||
static int bcrestriction = 0;
|
||||
#ifdef BREADCRUMBS
|
||||
@@ -116,7 +116,7 @@ ballfall(void)
|
||||
*
|
||||
* Should not be called while swallowed except on waterlevel.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
placebc_core(void)
|
||||
{
|
||||
if (!uchain || !uball) {
|
||||
@@ -143,7 +143,7 @@ placebc_core(void)
|
||||
bcrestriction = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
unplacebc_core(void)
|
||||
{
|
||||
if (u.uswallow) {
|
||||
@@ -176,7 +176,7 @@ unplacebc_core(void)
|
||||
u.bc_felt = 0; /* feel nothing */
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
check_restriction(int restriction)
|
||||
{
|
||||
boolean ret = FALSE;
|
||||
@@ -350,7 +350,7 @@ Lift_covet_and_placebc(int pin, char *funcnm, int linenum)
|
||||
* Return the stacking of the hero's ball & chain. This assumes that the
|
||||
* hero is being punished.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
bc_order(void)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -964,7 +964,7 @@ drop_ball(coordxy x, coordxy y)
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* ball&chain cause hero to randomly lose stuff from inventory */
|
||||
static void
|
||||
staticfn void
|
||||
litter(void)
|
||||
{
|
||||
struct obj *otmp, *nextobj = 0;
|
||||
|
||||
+14
-14
@@ -5,15 +5,15 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean no_bones_level(d_level *);
|
||||
static void goodfruit(int);
|
||||
static void resetobjs(struct obj *, boolean);
|
||||
static void give_to_nearby_mon(struct obj *, coordxy, coordxy) NONNULLARG1;
|
||||
static boolean fixuporacle(struct monst *) NONNULLARG1;
|
||||
static void remove_mon_from_bones(struct monst *) NONNULLARG1;
|
||||
static void set_ghostly_objlist(struct obj *objchain);
|
||||
staticfn boolean no_bones_level(d_level *);
|
||||
staticfn void goodfruit(int);
|
||||
staticfn void resetobjs(struct obj *, boolean);
|
||||
staticfn void give_to_nearby_mon(struct obj *, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn boolean fixuporacle(struct monst *) NONNULLARG1;
|
||||
staticfn void remove_mon_from_bones(struct monst *) NONNULLARG1;
|
||||
staticfn void set_ghostly_objlist(struct obj *objchain);
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
no_bones_level(d_level *lev)
|
||||
{
|
||||
s_level *sptr;
|
||||
@@ -37,7 +37,7 @@ no_bones_level(d_level *lev)
|
||||
* ID is positive instead of negative). This way, when we later save the
|
||||
* chain of fruit types, we know to only save the types that exist.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
goodfruit(int id)
|
||||
{
|
||||
struct fruit *f = fruit_from_indx(-id);
|
||||
@@ -46,7 +46,7 @@ goodfruit(int id)
|
||||
f->fid = id;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
resetobjs(struct obj *ochain, boolean restore)
|
||||
{
|
||||
struct obj *otmp, *nobj;
|
||||
@@ -220,7 +220,7 @@ sanitize_name(char *namebuf)
|
||||
/* Give object to a random object-liking monster on or adjacent to x,y
|
||||
but skipping hero's location.
|
||||
If no such monster, place object on floor at x,y. */
|
||||
static void
|
||||
staticfn void
|
||||
give_to_nearby_mon(struct obj *otmp, coordxy x, coordxy y)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -302,7 +302,7 @@ drop_upon_death(
|
||||
|
||||
/* possibly restore oracle's room and/or put her back inside it; returns
|
||||
False if she's on the wrong level and should be removed, True otherwise */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
fixuporacle(struct monst *oracle)
|
||||
{
|
||||
coord cc;
|
||||
@@ -384,7 +384,7 @@ can_make_bones(void)
|
||||
|
||||
/* monster might need to be removed before saving a bones file,
|
||||
in case these characters are not in their home bases */
|
||||
static void
|
||||
staticfn void
|
||||
remove_mon_from_bones(struct monst *mtmp)
|
||||
{
|
||||
struct permonst *mptr = mtmp->data;
|
||||
@@ -740,7 +740,7 @@ bones_include_name(const char *name)
|
||||
}
|
||||
|
||||
/* set the ghostly bit in a list of objects */
|
||||
static void
|
||||
staticfn void
|
||||
set_ghostly_objlist(struct obj *objchain)
|
||||
{
|
||||
while (objchain) {
|
||||
|
||||
+93
-93
@@ -10,17 +10,18 @@
|
||||
|
||||
extern const char *const hu_stat[]; /* defined in eat.c */
|
||||
|
||||
/* also used in insight.c */
|
||||
const char *const enc_stat[] = {
|
||||
"", "Burdened", "Stressed",
|
||||
"Strained", "Overtaxed", "Overloaded"
|
||||
};
|
||||
|
||||
static const char *rank(void);
|
||||
static void bot_via_windowport(void);
|
||||
static void stat_update_time(void);
|
||||
static char *get_strength_str(void);
|
||||
staticfn const char *rank(void);
|
||||
staticfn void bot_via_windowport(void);
|
||||
staticfn void stat_update_time(void);
|
||||
staticfn char *get_strength_str(void);
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
get_strength_str(void)
|
||||
{
|
||||
static char buf[32];
|
||||
@@ -360,7 +361,7 @@ rank_of(int lev, short monnum, boolean female)
|
||||
return "Player";
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
rank(void)
|
||||
{
|
||||
return rank_of(u.ulevel, Role_switch, flags.female);
|
||||
@@ -484,52 +485,52 @@ describe_level(
|
||||
#ifdef STATUS_HILITES
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
static boolean eval_notify_windowport_field(int, boolean *, int);
|
||||
static void evaluate_and_notify_windowport(boolean *, int);
|
||||
static void init_blstats(void);
|
||||
static int compare_blstats(struct istat_s *, struct istat_s *);
|
||||
static char *anything_to_s(char *, anything *, int);
|
||||
static int percentage(struct istat_s *, struct istat_s *);
|
||||
static int exp_percentage(void);
|
||||
static int QSORTCALLBACK cond_cmp(const genericptr, const genericptr);
|
||||
static int QSORTCALLBACK menualpha_cmp(const genericptr, const genericptr);
|
||||
staticfn boolean eval_notify_windowport_field(int, boolean *, int);
|
||||
staticfn void evaluate_and_notify_windowport(boolean *, int);
|
||||
staticfn void init_blstats(void);
|
||||
staticfn int compare_blstats(struct istat_s *, struct istat_s *);
|
||||
staticfn char *anything_to_s(char *, anything *, int);
|
||||
staticfn int percentage(struct istat_s *, struct istat_s *);
|
||||
staticfn int exp_percentage(void);
|
||||
staticfn int QSORTCALLBACK cond_cmp(const genericptr, const genericptr);
|
||||
staticfn int QSORTCALLBACK menualpha_cmp(const genericptr, const genericptr);
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
static void s_to_anything(anything *, char *, int);
|
||||
static enum statusfields fldname_to_bl_indx(const char *);
|
||||
static boolean hilite_reset_needed(struct istat_s *, long);
|
||||
static boolean noneoftheabove(const char *);
|
||||
static struct hilite_s *get_hilite(int, int, genericptr_t, int, int, int *);
|
||||
static void split_clridx(int, int *, int *);
|
||||
static boolean is_ltgt_percentnumber(const char *);
|
||||
static boolean has_ltgt_percentnumber(const char *);
|
||||
static int splitsubfields(char *, char ***, int);
|
||||
static boolean is_fld_arrayvalues(const char *, const char *const *, int, int,
|
||||
staticfn void s_to_anything(anything *, char *, int);
|
||||
staticfn enum statusfields fldname_to_bl_indx(const char *);
|
||||
staticfn boolean hilite_reset_needed(struct istat_s *, long);
|
||||
staticfn boolean noneoftheabove(const char *);
|
||||
staticfn struct hilite_s *get_hilite(int, int, genericptr_t, int, int, int *);
|
||||
staticfn void split_clridx(int, int *, int *);
|
||||
staticfn boolean is_ltgt_percentnumber(const char *);
|
||||
staticfn boolean has_ltgt_percentnumber(const char *);
|
||||
staticfn int splitsubfields(char *, char ***, int);
|
||||
staticfn boolean is_fld_arrayvalues(const char *, const char *const *, int, int,
|
||||
int *);
|
||||
static int query_arrayvalue(const char *, const char *const *, int, int);
|
||||
static void status_hilite_add_threshold(int, struct hilite_s *);
|
||||
static boolean parse_status_hl2(char (*)[QBUFSZ], boolean);
|
||||
static unsigned long query_conditions(void);
|
||||
static char *conditionbitmask2str(unsigned long);
|
||||
static unsigned long match_str2conditionbitmask(const char *);
|
||||
static unsigned long str2conditionbitmask(char *);
|
||||
static boolean parse_condition(char (*)[QBUFSZ], int);
|
||||
static char *hlattr2attrname(int, char *, size_t);
|
||||
static void status_hilite_linestr_add(int, struct hilite_s *, unsigned long,
|
||||
staticfn int query_arrayvalue(const char *, const char *const *, int, int);
|
||||
staticfn void status_hilite_add_threshold(int, struct hilite_s *);
|
||||
staticfn boolean parse_status_hl2(char (*)[QBUFSZ], boolean);
|
||||
staticfn unsigned long query_conditions(void);
|
||||
staticfn char *conditionbitmask2str(unsigned long);
|
||||
staticfn unsigned long match_str2conditionbitmask(const char *);
|
||||
staticfn unsigned long str2conditionbitmask(char *);
|
||||
staticfn boolean parse_condition(char (*)[QBUFSZ], int);
|
||||
staticfn char *hlattr2attrname(int, char *, size_t);
|
||||
staticfn void status_hilite_linestr_add(int, struct hilite_s *, unsigned long,
|
||||
const char *);
|
||||
static void status_hilite_linestr_done(void);
|
||||
static int status_hilite_linestr_countfield(int);
|
||||
static void status_hilite_linestr_gather_conditions(void);
|
||||
static void status_hilite_linestr_gather(void);
|
||||
static char *status_hilite2str(struct hilite_s *);
|
||||
static int status_hilite_menu_choose_field(void);
|
||||
static int status_hilite_menu_choose_behavior(int);
|
||||
static int status_hilite_menu_choose_updownboth(int, const char *, boolean,
|
||||
staticfn void status_hilite_linestr_done(void);
|
||||
staticfn int status_hilite_linestr_countfield(int);
|
||||
staticfn void status_hilite_linestr_gather_conditions(void);
|
||||
staticfn void status_hilite_linestr_gather(void);
|
||||
staticfn char *status_hilite2str(struct hilite_s *);
|
||||
staticfn int status_hilite_menu_choose_field(void);
|
||||
staticfn int status_hilite_menu_choose_behavior(int);
|
||||
staticfn int status_hilite_menu_choose_updownboth(int, const char *, boolean,
|
||||
boolean);
|
||||
static boolean status_hilite_menu_add(int);
|
||||
static boolean status_hilite_remove(int);
|
||||
static boolean status_hilite_menu_fld(int);
|
||||
static void status_hilites_viewall(void);
|
||||
staticfn boolean status_hilite_menu_add(int);
|
||||
staticfn boolean status_hilite_remove(int);
|
||||
staticfn boolean status_hilite_menu_fld(int);
|
||||
staticfn void status_hilites_viewall(void);
|
||||
|
||||
#define has_hilite(i) (gb.blstats[0][(i)].thresholds)
|
||||
/* TH_UPDOWN encompasses specific 'up' and 'down' also general 'changed' */
|
||||
@@ -591,7 +592,7 @@ static struct istat_s initblstats[MAXBLSTATS] = {
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
|
||||
const struct condmap condition_aliases[] = {
|
||||
static const struct condmap condition_aliases[] = {
|
||||
{ "strangled", BL_MASK_STRNGL },
|
||||
{ "all", BL_MASK_BAREH | BL_MASK_BLIND | BL_MASK_BUSY
|
||||
| BL_MASK_CONF | BL_MASK_DEAF | BL_MASK_ELF_IRON
|
||||
@@ -737,7 +738,7 @@ do { \
|
||||
* without STATUS_HILITES.
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
bot_via_windowport(void)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -1031,7 +1032,7 @@ bot_via_windowport(void)
|
||||
#undef cond_cache_prepA
|
||||
|
||||
/* update just the status lines' 'time' field */
|
||||
static void
|
||||
staticfn void
|
||||
stat_update_time(void)
|
||||
{
|
||||
int idx = gn.now_or_before_idx; /* no 0/1 toggle */
|
||||
@@ -1079,7 +1080,7 @@ condopt(int idx, boolean *addr, boolean negated)
|
||||
}
|
||||
|
||||
/* qsort callback routine for sorting the condition index */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
cond_cmp(const genericptr vptr1, const genericptr vptr2)
|
||||
{
|
||||
int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2,
|
||||
@@ -1092,7 +1093,7 @@ cond_cmp(const genericptr vptr1, const genericptr vptr2)
|
||||
}
|
||||
|
||||
/* qsort callback routine for alphabetical sorting of index */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
menualpha_cmp(const genericptr vptr1, const genericptr vptr2)
|
||||
{
|
||||
int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2;
|
||||
@@ -1239,7 +1240,7 @@ opt_next_cond(int indx, char *outbuf)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
eval_notify_windowport_field(
|
||||
int fld,
|
||||
boolean *valsetlist,
|
||||
@@ -1364,12 +1365,12 @@ eval_notify_windowport_field(
|
||||
return updated;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
evaluate_and_notify_windowport(
|
||||
boolean *valsetlist,
|
||||
int idx)
|
||||
{
|
||||
int i, fld, updated = 0, notpresent UNUSED = 0;
|
||||
int i, fld, updated = 0;
|
||||
|
||||
/*
|
||||
* Now pass the changed values to window port.
|
||||
@@ -1383,7 +1384,6 @@ evaluate_and_notify_windowport(
|
||||
|| ((fld == BL_XP || i == BL_EXP) && Upolyd)
|
||||
|| ((fld == BL_VERS) && !flags.showvers)
|
||||
) {
|
||||
notpresent++;
|
||||
continue;
|
||||
}
|
||||
if (eval_notify_windowport_field(fld, valsetlist, idx))
|
||||
@@ -1497,7 +1497,7 @@ status_finish(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_blstats(void)
|
||||
{
|
||||
static boolean initalready = FALSE;
|
||||
@@ -1547,7 +1547,7 @@ init_blstats(void)
|
||||
* - for strings, 0 = stayed the same, 1 = changed
|
||||
*
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
compare_blstats(struct istat_s *bl1, struct istat_s *bl2)
|
||||
{
|
||||
anything *a1, *a2;
|
||||
@@ -1620,7 +1620,7 @@ compare_blstats(struct istat_s *bl1, struct istat_s *bl2)
|
||||
return result;
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
anything_to_s(char *buf, anything *a, int anytype)
|
||||
{
|
||||
if (!buf)
|
||||
@@ -1664,7 +1664,7 @@ anything_to_s(char *buf, anything *a, int anytype)
|
||||
}
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
static void
|
||||
staticfn void
|
||||
s_to_anything(anything *a, char *buf, int anytype)
|
||||
{
|
||||
if (!buf || !a)
|
||||
@@ -1711,7 +1711,7 @@ s_to_anything(anything *a, char *buf, int anytype)
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
/* integer percentage is 100 * bl->a / maxbl->a */
|
||||
static int
|
||||
staticfn int
|
||||
percentage(struct istat_s *bl, struct istat_s *maxbl)
|
||||
{
|
||||
int result = 0;
|
||||
@@ -1786,7 +1786,7 @@ percentage(struct istat_s *bl, struct istat_s *maxbl)
|
||||
|
||||
/* percentage for both xp (level) and exp (points) is the percentage for
|
||||
(curr_exp - this_level_start) in (next_level_start - this_level_start) */
|
||||
static int
|
||||
staticfn int
|
||||
exp_percentage(void)
|
||||
{
|
||||
int res = 0;
|
||||
@@ -1942,7 +1942,7 @@ static const char threshold_value[] = "hilite_status threshold ",
|
||||
|
||||
|
||||
/* field name to bottom line index */
|
||||
static enum statusfields
|
||||
staticfn enum statusfields
|
||||
fldname_to_bl_indx(const char *name)
|
||||
{
|
||||
int i, nmatches = 0, fld = 0;
|
||||
@@ -1978,7 +1978,7 @@ fldname_to_bl_indx(const char *name)
|
||||
return (nmatches == 1) ? fld : BL_FLUSH;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
hilite_reset_needed(
|
||||
struct istat_s *bl_p,
|
||||
long augmented_time) /* no longer augmented; it once encoded fractional
|
||||
@@ -2057,7 +2057,7 @@ reset_status_hilites(void)
|
||||
|
||||
/* test whether the text from a title rule matches the string for
|
||||
title-while-polymorphed in the 'textmatch' menu */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
noneoftheabove(const char *hl_text)
|
||||
{
|
||||
if (fuzzymatch(hl_text, "none of the above", "\" -_", TRUE)
|
||||
@@ -2085,7 +2085,7 @@ noneoftheabove(const char *hl_text)
|
||||
* Get back:
|
||||
* pointer to rule that applies; Null if no rule does.
|
||||
*/
|
||||
static struct hilite_s *
|
||||
staticfn struct hilite_s *
|
||||
get_hilite(
|
||||
int idx, int fldidx,
|
||||
genericptr_t vp,
|
||||
@@ -2297,7 +2297,7 @@ get_hilite(
|
||||
#undef has_hilite
|
||||
#undef Is_Temp_Hilite
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
split_clridx(int idx, int *coloridx, int *attrib)
|
||||
{
|
||||
if (coloridx)
|
||||
@@ -2373,7 +2373,7 @@ parse_status_hl1(char *op, boolean from_configfile)
|
||||
}
|
||||
|
||||
/* is str in the format of "[<>]?=?[-+]?[0-9]+%?" regex */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_ltgt_percentnumber(const char *str)
|
||||
{
|
||||
const char *s = str;
|
||||
@@ -2394,7 +2394,7 @@ is_ltgt_percentnumber(const char *str)
|
||||
}
|
||||
|
||||
/* does str only contain "<>=-+0-9%" chars */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
has_ltgt_percentnumber(const char *str)
|
||||
{
|
||||
const char *s = str;
|
||||
@@ -2410,7 +2410,7 @@ has_ltgt_percentnumber(const char *str)
|
||||
/* splitsubfields(): splits str in place into '+' or '&' separated strings.
|
||||
* returns number of strings, or -1 if more than maxsf or MAX_SUBFIELDS
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
splitsubfields(char *str, char ***sfarr, int maxsf)
|
||||
{
|
||||
#define MAX_SUBFIELDS 16
|
||||
@@ -2452,7 +2452,7 @@ splitsubfields(char *str, char ***sfarr, int maxsf)
|
||||
#undef MAX_SUBFIELDS
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_fld_arrayvalues(
|
||||
const char *str,
|
||||
const char *const *arr,
|
||||
@@ -2469,7 +2469,7 @@ is_fld_arrayvalues(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
query_arrayvalue(
|
||||
const char *querystr,
|
||||
const char *const *arr,
|
||||
@@ -2504,7 +2504,7 @@ query_arrayvalue(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilite_add_threshold(int fld, struct hilite_s *hilite)
|
||||
{
|
||||
struct hilite_s *new_hilite, *old_hilite;
|
||||
@@ -2534,7 +2534,7 @@ status_hilite_add_threshold(int fld, struct hilite_s *hilite)
|
||||
gb.blstats[1][fld].thresholds = gb.blstats[0][fld].thresholds;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)
|
||||
{
|
||||
static const char *const aligntxt[] = { "chaotic", "neutral", "lawful" };
|
||||
@@ -2829,7 +2829,7 @@ parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)
|
||||
return (successes > 0);
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
staticfn unsigned long
|
||||
query_conditions(void)
|
||||
{
|
||||
int i,res;
|
||||
@@ -2861,7 +2861,7 @@ query_conditions(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
conditionbitmask2str(unsigned long ul)
|
||||
{
|
||||
static char buf[BUFSZ];
|
||||
@@ -2891,7 +2891,7 @@ conditionbitmask2str(unsigned long ul)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
staticfn unsigned long
|
||||
match_str2conditionbitmask(const char *str)
|
||||
{
|
||||
int i, nmatches = 0;
|
||||
@@ -2929,7 +2929,7 @@ match_str2conditionbitmask(const char *str)
|
||||
return mask;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
staticfn unsigned long
|
||||
str2conditionbitmask(char *str)
|
||||
{
|
||||
unsigned long conditions_bitmask = 0UL;
|
||||
@@ -2953,7 +2953,7 @@ str2conditionbitmask(char *str)
|
||||
return conditions_bitmask;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
parse_condition(char (*s)[QBUFSZ], int sidx)
|
||||
{
|
||||
int i;
|
||||
@@ -3089,7 +3089,7 @@ clear_status_hilites(void)
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
hlattr2attrname(int attrib, char *buf, size_t bufsz)
|
||||
{
|
||||
if (attrib && buf) {
|
||||
@@ -3137,7 +3137,7 @@ struct _status_hilite_line_str {
|
||||
static struct _status_hilite_line_str *status_hilite_str = 0;
|
||||
static int status_hilite_str_id = 0;
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilite_linestr_add(
|
||||
int fld,
|
||||
struct hilite_s *hl,
|
||||
@@ -3168,7 +3168,7 @@ status_hilite_linestr_add(
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilite_linestr_done(void)
|
||||
{
|
||||
struct _status_hilite_line_str *nxt, *tmp = status_hilite_str;
|
||||
@@ -3182,7 +3182,7 @@ status_hilite_linestr_done(void)
|
||||
status_hilite_str_id = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
status_hilite_linestr_countfield(int fld)
|
||||
{
|
||||
struct _status_hilite_line_str *tmp;
|
||||
@@ -3208,7 +3208,7 @@ count_status_hilites(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilite_linestr_gather_conditions(void)
|
||||
{
|
||||
int i;
|
||||
@@ -3290,7 +3290,7 @@ status_hilite_linestr_gather_conditions(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilite_linestr_gather(void)
|
||||
{
|
||||
int i;
|
||||
@@ -3310,7 +3310,7 @@ status_hilite_linestr_gather(void)
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
status_hilite2str(struct hilite_s *hl)
|
||||
{
|
||||
static char buf[BUFSZ];
|
||||
@@ -3392,7 +3392,7 @@ status_hilite2str(struct hilite_s *hl)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
status_hilite_menu_choose_field(void)
|
||||
{
|
||||
winid tmpwin;
|
||||
@@ -3427,7 +3427,7 @@ status_hilite_menu_choose_field(void)
|
||||
return fld;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
status_hilite_menu_choose_behavior(int fld)
|
||||
{
|
||||
winid tmpwin;
|
||||
@@ -3530,7 +3530,7 @@ status_hilite_menu_choose_behavior(int fld)
|
||||
return beh;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
status_hilite_menu_choose_updownboth(
|
||||
int fld,
|
||||
const char *str,
|
||||
@@ -3609,7 +3609,7 @@ status_hilite_menu_choose_updownboth(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
status_hilite_menu_add(int origfld)
|
||||
{
|
||||
int fld;
|
||||
@@ -4019,7 +4019,7 @@ status_hilite_menu_add(int origfld)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
status_hilite_remove(int id)
|
||||
{
|
||||
struct _status_hilite_line_str *hlstr = status_hilite_str;
|
||||
@@ -4071,7 +4071,7 @@ status_hilite_remove(int id)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
status_hilite_menu_fld(int fld)
|
||||
{
|
||||
winid tmpwin;
|
||||
@@ -4170,7 +4170,7 @@ status_hilite_menu_fld(int fld)
|
||||
return acted;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
status_hilites_viewall(void)
|
||||
{
|
||||
winid datawin;
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@
|
||||
#define LOCALTIME_type time_t *
|
||||
#endif
|
||||
|
||||
static struct tm *getlt(void);
|
||||
staticfn struct tm *getlt(void);
|
||||
|
||||
time_t
|
||||
getnow(void)
|
||||
@@ -37,7 +37,7 @@ getnow(void)
|
||||
return datetime;
|
||||
}
|
||||
|
||||
static struct tm *
|
||||
staticfn struct tm *
|
||||
getlt(void)
|
||||
{
|
||||
time_t date = getnow();
|
||||
|
||||
@@ -94,63 +94,65 @@ extern int dozap(void); /**/
|
||||
extern int doorganize(void); /**/
|
||||
#endif /* DUMB */
|
||||
|
||||
static int dosuspend_core(void);
|
||||
static int dosh_core(void);
|
||||
static int doherecmdmenu(void);
|
||||
static int dotherecmdmenu(void);
|
||||
static int doprev_message(void);
|
||||
static int timed_occupation(void);
|
||||
static boolean can_do_extcmd(const struct ext_func_tab *);
|
||||
static int dotravel(void);
|
||||
static int dotravel_target(void);
|
||||
static int doclicklook(void);
|
||||
static int domouseaction(void);
|
||||
static int doterrain(void);
|
||||
static boolean u_have_seen_whole_selection(struct selectionvar *);
|
||||
static boolean u_have_seen_bounds_selection(struct selectionvar *);
|
||||
static boolean u_can_see_whole_selection(struct selectionvar *);
|
||||
static int dolookaround_floodfill_findroom(coordxy, coordxy);
|
||||
static void lookaround_known_room(coordxy, coordxy);
|
||||
staticfn int dosuspend_core(void);
|
||||
staticfn int dosh_core(void);
|
||||
staticfn int doherecmdmenu(void);
|
||||
staticfn int dotherecmdmenu(void);
|
||||
staticfn int doprev_message(void);
|
||||
staticfn int timed_occupation(void);
|
||||
staticfn boolean can_do_extcmd(const struct ext_func_tab *);
|
||||
staticfn int dotravel(void);
|
||||
staticfn int dotravel_target(void);
|
||||
staticfn int doclicklook(void);
|
||||
staticfn int domouseaction(void);
|
||||
staticfn int doterrain(void);
|
||||
staticfn boolean u_have_seen_whole_selection(struct selectionvar *);
|
||||
staticfn boolean u_have_seen_bounds_selection(struct selectionvar *);
|
||||
staticfn boolean u_can_see_whole_selection(struct selectionvar *);
|
||||
staticfn int dolookaround_floodfill_findroom(coordxy, coordxy);
|
||||
staticfn void lookaround_known_room(coordxy, coordxy);
|
||||
|
||||
#if defined(__BORLANDC__) && !defined(_WIN32)
|
||||
extern void show_borlandc_stats(winid);
|
||||
#endif
|
||||
static boolean accept_menu_prefix(const struct ext_func_tab *);
|
||||
static void reset_cmd_vars(boolean);
|
||||
staticfn boolean accept_menu_prefix(const struct ext_func_tab *);
|
||||
staticfn void reset_cmd_vars(boolean);
|
||||
|
||||
static void mcmd_addmenu(winid, int, const char *);
|
||||
static int there_cmd_menu_self(winid, coordxy, coordxy, int *);
|
||||
static int there_cmd_menu_next2u(winid, coordxy, coordxy, int, int *);
|
||||
static int there_cmd_menu_far(winid, coordxy, coordxy, int);
|
||||
static int there_cmd_menu_common(winid, coordxy, coordxy, int, int *);
|
||||
static void act_on_act(int, coordxy, coordxy);
|
||||
static char there_cmd_menu(coordxy, coordxy, int);
|
||||
static char here_cmd_menu(void);
|
||||
staticfn void mcmd_addmenu(winid, int, const char *);
|
||||
staticfn int there_cmd_menu_self(winid, coordxy, coordxy, int *);
|
||||
staticfn int there_cmd_menu_next2u(winid, coordxy, coordxy, int, int *);
|
||||
staticfn int there_cmd_menu_far(winid, coordxy, coordxy, int);
|
||||
staticfn int there_cmd_menu_common(winid, coordxy, coordxy, int, int *);
|
||||
staticfn void act_on_act(int, coordxy, coordxy);
|
||||
staticfn char there_cmd_menu(coordxy, coordxy, int);
|
||||
staticfn char here_cmd_menu(void);
|
||||
|
||||
static char readchar_core(coordxy *, coordxy *, int *);
|
||||
static int parse(void);
|
||||
static void show_direction_keys(winid, char, boolean);
|
||||
static boolean help_dir(char, uchar, const char *);
|
||||
staticfn char readchar_core(coordxy *, coordxy *, int *);
|
||||
staticfn int parse(void);
|
||||
staticfn void show_direction_keys(winid, char, boolean);
|
||||
staticfn boolean help_dir(char, uchar, const char *);
|
||||
|
||||
static void handler_rebind_keys_add(boolean);
|
||||
static boolean bind_key_fn(uchar, int (*)(void));
|
||||
static void commands_init(void);
|
||||
static boolean keylist_func_has_key(const struct ext_func_tab *, boolean *);
|
||||
static int keylist_putcmds(winid, boolean, int, int, boolean *);
|
||||
static const char *spkey_name(int);
|
||||
staticfn void handler_rebind_keys_add(boolean);
|
||||
staticfn boolean bind_key_fn(uchar, int (*)(void));
|
||||
staticfn void commands_init(void);
|
||||
staticfn boolean keylist_func_has_key(const struct ext_func_tab *, boolean *);
|
||||
staticfn int keylist_putcmds(winid, boolean, int, int, boolean *);
|
||||
staticfn const char *spkey_name(int);
|
||||
|
||||
static int (*timed_occ_fn)(void);
|
||||
static char *doc_extcmd_flagstr(winid, const struct ext_func_tab *);
|
||||
staticfn int (*timed_occ_fn)(void);
|
||||
staticfn char *doc_extcmd_flagstr(winid, const struct ext_func_tab *);
|
||||
|
||||
static const char *readchar_queue = "";
|
||||
|
||||
/* for rejecting attempts to use wizard mode commands */
|
||||
/* for rejecting attempts to use wizard mode commands
|
||||
* Also used in wizcmds.c */
|
||||
const char unavailcmd[] = "Unavailable command '%s'.";
|
||||
|
||||
/* for rejecting #if !SHELL, !SUSPEND */
|
||||
static const char cmdnotavail[] = "'%s' command not available.";
|
||||
|
||||
/* the #prevmsg command */
|
||||
static int
|
||||
staticfn int
|
||||
doprev_message(void)
|
||||
{
|
||||
(void) nh_doprev_message();
|
||||
@@ -158,7 +160,7 @@ doprev_message(void)
|
||||
}
|
||||
|
||||
/* Count down by decrementing multi */
|
||||
static int
|
||||
staticfn int
|
||||
timed_occupation(void)
|
||||
{
|
||||
(*timed_occ_fn)();
|
||||
@@ -437,7 +439,7 @@ extcmd_initiator(void)
|
||||
return gc.Cmd.extcmd_char;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
can_do_extcmd(const struct ext_func_tab *extcmd)
|
||||
{
|
||||
int ecflags = extcmd->flags;
|
||||
@@ -498,7 +500,7 @@ doextcmd(void)
|
||||
}
|
||||
|
||||
/* format extended command flags for display */
|
||||
static char *
|
||||
staticfn char *
|
||||
doc_extcmd_flagstr(
|
||||
winid menuwin,
|
||||
const struct ext_func_tab *efp) /* if Null, add a footnote to the menu */
|
||||
@@ -1038,7 +1040,8 @@ makemap_prepost(boolean pre, boolean wiztower)
|
||||
}
|
||||
|
||||
/* temporary? hack, since level type codes aren't the same as screen
|
||||
symbols and only the latter have easily accessible descriptions */
|
||||
symbols and only the latter have easily accessible descriptions.
|
||||
Also used by wizcmds.c */
|
||||
const char *levltyp[MAX_TYPE + 2] = {
|
||||
"stone", "vertical wall", "horizontal wall", "top-left corner wall",
|
||||
"top-right corner wall", "bottom-left corner wall",
|
||||
@@ -1064,7 +1067,7 @@ levltyp_to_name(int typ)
|
||||
}
|
||||
|
||||
/* #terrain command -- show known map, inspired by crawl's '|' command */
|
||||
static int
|
||||
staticfn int
|
||||
doterrain(void)
|
||||
{
|
||||
winid men;
|
||||
@@ -1161,7 +1164,7 @@ doterrain(void)
|
||||
}
|
||||
|
||||
/* has hero seen all locations in selection? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
u_have_seen_whole_selection(struct selectionvar *sel)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -1179,7 +1182,7 @@ u_have_seen_whole_selection(struct selectionvar *sel)
|
||||
}
|
||||
|
||||
/* has hero seen all location of the rectangular outline in the selection */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
u_have_seen_bounds_selection(struct selectionvar *sel)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -1212,7 +1215,7 @@ u_have_seen_bounds_selection(struct selectionvar *sel)
|
||||
}
|
||||
|
||||
/* can hero currently see all locations in the selection */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
u_can_see_whole_selection(struct selectionvar *sel)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -1229,7 +1232,7 @@ u_can_see_whole_selection(struct selectionvar *sel)
|
||||
}
|
||||
|
||||
/* selection_floofill callback to get all locations in a room */
|
||||
static int
|
||||
staticfn int
|
||||
dolookaround_floodfill_findroom(coordxy x, coordxy y)
|
||||
{
|
||||
schar typ = levl[x][y].typ;
|
||||
@@ -1242,7 +1245,7 @@ dolookaround_floodfill_findroom(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* describe the room at x,y */
|
||||
static void
|
||||
staticfn void
|
||||
lookaround_known_room(coordxy x, coordxy y)
|
||||
{
|
||||
struct selectionvar *sel = selection_new();
|
||||
@@ -2029,7 +2032,7 @@ static const struct {
|
||||
{ 0, (const char *) 0, FALSE }
|
||||
};
|
||||
|
||||
int extcmdlist_length = SIZE(extcmdlist) - 1;
|
||||
static int extcmdlist_length = SIZE(extcmdlist) - 1;
|
||||
|
||||
/* get entry i in the extended commands list. for windowport use. */
|
||||
struct ext_func_tab *
|
||||
@@ -2085,7 +2088,7 @@ get_changed_key_binds(strbuf_t *sbuf)
|
||||
}
|
||||
|
||||
/* interactive key binding */
|
||||
static void
|
||||
staticfn void
|
||||
handler_rebind_keys_add(boolean keyfirst)
|
||||
{
|
||||
struct ext_func_tab *ec;
|
||||
@@ -2400,7 +2403,7 @@ bind_key(uchar key, const char *command)
|
||||
}
|
||||
|
||||
/* bind key by ext cmd function */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
bind_key_fn(uchar key, int (*fn)(void))
|
||||
{
|
||||
struct ext_func_tab *extcmd;
|
||||
@@ -2418,7 +2421,7 @@ bind_key_fn(uchar key, int (*fn)(void))
|
||||
}
|
||||
|
||||
/* initialize all keyboard commands */
|
||||
static void
|
||||
staticfn void
|
||||
commands_init(void)
|
||||
{
|
||||
struct ext_func_tab *extcmd;
|
||||
@@ -2453,7 +2456,7 @@ commands_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
keylist_func_has_key(const struct ext_func_tab *extcmd,
|
||||
boolean *skip_keys_used) /* boolean keys_used[256] */
|
||||
{
|
||||
@@ -2469,7 +2472,7 @@ keylist_func_has_key(const struct ext_func_tab *extcmd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
keylist_putcmds(winid datawin, boolean docount,
|
||||
int incl_flags, int excl_flags,
|
||||
boolean *keys_used) /* boolean keys_used[256] */
|
||||
@@ -2866,7 +2869,7 @@ bind_specialkey(uchar key, const char *command)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
spkey_name(int nhkf)
|
||||
{
|
||||
const char *name = 0;
|
||||
@@ -3134,7 +3137,7 @@ update_rest_on_space(void)
|
||||
/* commands which accept 'm' prefix to request menu operation or other
|
||||
alternate behavior; it's also overloaded for move-without-autopickup;
|
||||
there is no overlap between the two groups of commands */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
accept_menu_prefix(const struct ext_func_tab *ec)
|
||||
{
|
||||
return (ec && ((ec->flags & CMD_M_PREFIX) != 0));
|
||||
@@ -3222,7 +3225,7 @@ rnd_extcmd_idx(void)
|
||||
return rn2(extcmdlist_length + 1) - 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
reset_cmd_vars(boolean reset_cmdq)
|
||||
{
|
||||
gc.context.run = 0;
|
||||
@@ -3700,7 +3703,7 @@ getdir(const char *s)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
show_direction_keys(
|
||||
winid win, /* should specify a window which is using a fixed-width font */
|
||||
char centerchar, /* '.' or '@' or ' ' */
|
||||
@@ -3749,7 +3752,7 @@ show_direction_keys(
|
||||
/* explain choices if player has asked for getdir() help or has given
|
||||
an invalid direction after a prefix key ('F', 'g', 'm', &c), which
|
||||
might be bogus but could be up, down, or self when not applicable */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
help_dir(
|
||||
char sym,
|
||||
uchar spkey, /* actual key; either prefix or ESC */
|
||||
@@ -3912,7 +3915,7 @@ isok(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* #herecmdmenu command */
|
||||
static int
|
||||
staticfn int
|
||||
doherecmdmenu(void)
|
||||
{
|
||||
char ch = here_cmd_menu();
|
||||
@@ -3921,7 +3924,7 @@ doherecmdmenu(void)
|
||||
}
|
||||
|
||||
/* #therecmdmenu command, a way to test there_cmd_menu without mouse */
|
||||
static int
|
||||
staticfn int
|
||||
dotherecmdmenu(void)
|
||||
{
|
||||
char ch;
|
||||
@@ -3999,7 +4002,7 @@ enum menucmd {
|
||||
MCMD_TRAVEL,
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mcmd_addmenu(winid win, int act, const char *txt)
|
||||
{
|
||||
anything any;
|
||||
@@ -4013,7 +4016,7 @@ mcmd_addmenu(winid win, int act, const char *txt)
|
||||
}
|
||||
|
||||
/* command menu entries when targeting self */
|
||||
static int
|
||||
staticfn int
|
||||
there_cmd_menu_self(winid win, coordxy x, coordxy y, int *act UNUSED)
|
||||
{
|
||||
int K = 0;
|
||||
@@ -4102,7 +4105,7 @@ there_cmd_menu_self(winid win, coordxy x, coordxy y, int *act UNUSED)
|
||||
}
|
||||
|
||||
/* add entries to there_cmd_menu, when x,y is next to hero */
|
||||
static int
|
||||
staticfn int
|
||||
there_cmd_menu_next2u(
|
||||
winid win,
|
||||
coordxy x, coordxy y,
|
||||
@@ -4202,7 +4205,7 @@ there_cmd_menu_next2u(
|
||||
return K;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
there_cmd_menu_far(winid win, coordxy x, coordxy y, int mod)
|
||||
{
|
||||
int K = 0;
|
||||
@@ -4217,7 +4220,7 @@ there_cmd_menu_far(winid win, coordxy x, coordxy y, int mod)
|
||||
return K;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
there_cmd_menu_common(
|
||||
winid win,
|
||||
coordxy x, coordxy y,
|
||||
@@ -4236,7 +4239,7 @@ there_cmd_menu_common(
|
||||
}
|
||||
|
||||
/* queue up command(s) to perform #therecmdmenu action */
|
||||
static void
|
||||
staticfn void
|
||||
act_on_act(
|
||||
int act, /* action */
|
||||
coordxy dx, coordxy dy) /* delta to adjacent spot (farther sometimes) */
|
||||
@@ -4421,7 +4424,7 @@ act_on_act(
|
||||
|
||||
/* offer choice of actions to perform at adjacent location <x,y>;
|
||||
a few choices can be farther away */
|
||||
static char
|
||||
staticfn char
|
||||
there_cmd_menu(coordxy x, coordxy y, int mod)
|
||||
{
|
||||
winid win;
|
||||
@@ -4477,7 +4480,7 @@ there_cmd_menu(coordxy x, coordxy y, int mod)
|
||||
return ch;
|
||||
}
|
||||
|
||||
static char
|
||||
staticfn char
|
||||
here_cmd_menu(void)
|
||||
{
|
||||
there_cmd_menu(u.ux, u.uy, CLICK_1);
|
||||
@@ -4494,7 +4497,7 @@ click_to_cmd(coordxy x, coordxy y, int mod)
|
||||
cmdq_add_ec(CQ_CANNED, gc.Cmd.mousebtn[mod-1]->ef_funct);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
domouseaction(void)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -4669,7 +4672,7 @@ get_count(
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
parse(void)
|
||||
{
|
||||
int foo;
|
||||
@@ -4773,7 +4776,7 @@ end_of_input(void)
|
||||
}
|
||||
#endif /* HANGUPHANDLING */
|
||||
|
||||
static char
|
||||
staticfn char
|
||||
readchar_core(coordxy *x, coordxy *y, int *mod)
|
||||
{
|
||||
int sym;
|
||||
@@ -4859,7 +4862,7 @@ readchar_poskey(coordxy *x, coordxy *y, int *mod)
|
||||
}
|
||||
|
||||
/* '_' command, #travel, via keyboard rather than mouse click */
|
||||
static int
|
||||
staticfn int
|
||||
dotravel(void)
|
||||
{
|
||||
coord cc;
|
||||
@@ -4908,7 +4911,7 @@ dotravel(void)
|
||||
}
|
||||
|
||||
/* #retravel, travel to iflags.travelcc, which must be set */
|
||||
static int
|
||||
staticfn int
|
||||
dotravel_target(void)
|
||||
{
|
||||
if (!isok(iflags.travelcc.x, iflags.travelcc.y)) {
|
||||
@@ -4941,7 +4944,7 @@ dotravel_target(void)
|
||||
}
|
||||
|
||||
/* mouse click look command */
|
||||
static int
|
||||
staticfn int
|
||||
doclicklook(void)
|
||||
{
|
||||
if (!isok(gc.clicklook_cc.x, gc.clicklook_cc.y))
|
||||
@@ -5098,7 +5101,7 @@ paranoid_query(boolean be_paranoid, const char *prompt)
|
||||
}
|
||||
|
||||
/* ^Z command, #suspend */
|
||||
static int
|
||||
staticfn int
|
||||
dosuspend_core(void)
|
||||
{
|
||||
#ifdef SUSPEND
|
||||
@@ -5118,7 +5121,7 @@ dosuspend_core(void)
|
||||
}
|
||||
|
||||
/* '!' command, #shell */
|
||||
static int
|
||||
staticfn int
|
||||
dosh_core(void)
|
||||
{
|
||||
#ifdef SHELL
|
||||
|
||||
+77
-11
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 coloratt.c $NHDT-Date: 1709559438 2024/03/04 13:37:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1 $ */
|
||||
/* NetHack 3.7 coloratt.c $NHDT-Date: 1710792438 2024/03/18 20:07:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $ */
|
||||
/* Copyright (c) Pasi Kallinen, 2024 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -507,13 +507,16 @@ DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
extern const char regex_id[]; /* from sys/share/<various>regex.{c,cpp} */
|
||||
|
||||
/* True: temporarily replace menu color entries with a fake set of menu
|
||||
colors, { "light blue"=light_blue, "blue"=blue, "red"=red, &c }, that
|
||||
illustrates most colors for use when the pick-a-color menu is rendered;
|
||||
suppresses black and white because one of those will likely be invisible
|
||||
due to matching the background; False: restore user-specified colorings */
|
||||
/* set up a menu for picking a color, one that shows each name in its color;
|
||||
overrides player's MENUCOLORS with a set of "blue"=blue, "red"=red, and
|
||||
so forth; suppresses color for black and white because one of those will
|
||||
likely be invisible due to matching the background; the alternate set of
|
||||
MENUCOLORS is kept around for potential re-use */
|
||||
void
|
||||
basic_menu_colors(boolean load_colors)
|
||||
basic_menu_colors(
|
||||
boolean load_colors) /* True: temporarily replace menu color entries with
|
||||
* a fake set of menu colors which match their names;
|
||||
* False: restore user-specified colorings */
|
||||
{
|
||||
if (load_colors) {
|
||||
/* replace normal menu colors with a set specifically for colors */
|
||||
@@ -537,7 +540,9 @@ basic_menu_colors(boolean load_colors)
|
||||
|
||||
/* this orders the patterns last-in/first-out; that means
|
||||
that the "light <foo>" variations come before the basic
|
||||
"<foo>" ones, which is exactly what we want */
|
||||
"<foo>" ones, which is exactly what we want (so that the
|
||||
shorter basic names won't get false matches as substrings
|
||||
of the longer ones) */
|
||||
for (i = 0; i < SIZE(colornames); ++i) {
|
||||
if (!colornames[i].name) /* first alias entry has no name */
|
||||
break;
|
||||
@@ -703,17 +708,78 @@ count_menucolors(void)
|
||||
int32
|
||||
check_enhanced_colors(char *buf)
|
||||
{
|
||||
char xtra = '\0'; /* used to catch trailing junk after "#rrggbb" */
|
||||
unsigned r, g, b;
|
||||
int32 retcolor = -1, color;
|
||||
|
||||
if ((color = match_str2clr(buf, TRUE)) != CLR_MAX) {
|
||||
retcolor = color | NH_BASIC_COLOR;
|
||||
} else if (sscanf(buf, "#%02x%02x%02x%c", &r, &g, &b, &xtra) >= 3) {
|
||||
retcolor = !xtra ? (int32) ((r << 16) | (g << 8) | b) : -1;
|
||||
} else {
|
||||
for (color = 0; color < SIZE(colortable); ++color) {
|
||||
if (!strcmpi(buf, colortable[color].name))
|
||||
retcolor = colortable_to_int32(&colortable[color]);
|
||||
/* altbuf: allow user's "grey" to match colortable[]'s "gray";
|
||||
* fuzzymatch(): ignore spaces, hyphens, and underscores so that
|
||||
* space or underscore in user-supplied name will match hyphen
|
||||
* [note: caller splits text at spaces so we won't see any here]
|
||||
*/
|
||||
char *altbuf = NULL, *grey = strstri(buf, "grey");
|
||||
ptrdiff_t greyoffset = grey ? (grey - buf) : -1;
|
||||
|
||||
if (greyoffset >= 0) {
|
||||
altbuf = dupstr(buf);
|
||||
/* use direct copy because strsubst() is case-sensitive */
|
||||
/*(void) strncpy(&altbuf[greyoffset], "gray", 4);*/
|
||||
(void) memcpy(altbuf + greyoffset, "gray", 4);
|
||||
}
|
||||
for (color = 0; color < SIZE(colortable); ++color) {
|
||||
if (fuzzymatch(buf, colortable[color].name, " -_", TRUE)
|
||||
|| (altbuf && fuzzymatch(altbuf, colortable[color].name,
|
||||
" -_", TRUE))) {
|
||||
retcolor = colortable_to_int32(&colortable[color]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (altbuf)
|
||||
free(altbuf);
|
||||
}
|
||||
return retcolor;
|
||||
}
|
||||
|
||||
/* return the canonical name of a particular color */
|
||||
const char *
|
||||
wc_color_name(int32 colorindx)
|
||||
{
|
||||
static char hexcolor[sizeof "#rrggbb"]; /* includes room for '\0' */
|
||||
const char *result = "no-color";
|
||||
|
||||
if (colorindx >= 0) {
|
||||
int32 basicindx = colorindx & ~NH_BASIC_COLOR;
|
||||
|
||||
/* if colorindx has NH_BASIC_COLOR bit set, basicindx won't,
|
||||
so differing implies a basic color */
|
||||
if (basicindx != colorindx) {
|
||||
assert(basicindx < 16);
|
||||
result = colortable[basicindx].name;
|
||||
} else {
|
||||
int indx;
|
||||
long r = (colorindx >> 16) & 0x0000ff, /* shift rrXXXX to rr */
|
||||
g = (colorindx >> 8) & 0x0000ff, /* shift XXggXX to gg */
|
||||
b = colorindx & 0x0000ff; /* mask XXXXbb to bb */
|
||||
|
||||
Snprintf(hexcolor, sizeof hexcolor, "#%02x%02x%02x",
|
||||
(uint8) r, (uint8) g, (uint8) b);
|
||||
result = hexcolor;
|
||||
/* override hex value if this is a named color */
|
||||
for (indx = 16; indx < SIZE(colortable); ++indx)
|
||||
if (colortable[indx].r == r
|
||||
&& colortable[indx].g == g
|
||||
&& colortable[indx].b == b) {
|
||||
result = colortable[indx].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*coloratt.c*/
|
||||
|
||||
+28
-28
@@ -19,20 +19,20 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void get_wall_for_db(coordxy *, coordxy *);
|
||||
static struct entity *e_at(coordxy, coordxy);
|
||||
static void m_to_e(struct monst *, coordxy, coordxy, struct entity *);
|
||||
static void u_to_e(struct entity *);
|
||||
static void set_entity(coordxy, coordxy, struct entity *);
|
||||
static const char *e_nam(struct entity *);
|
||||
static const char *E_phrase(struct entity *, const char *);
|
||||
static boolean e_survives_at(struct entity *, coordxy, coordxy);
|
||||
static void e_died(struct entity *, int, int);
|
||||
static boolean automiss(struct entity *);
|
||||
static boolean e_missed(struct entity *, boolean);
|
||||
static boolean e_jumps(struct entity *);
|
||||
static void do_entity(struct entity *);
|
||||
static void nokiller(void);
|
||||
staticfn void get_wall_for_db(coordxy *, coordxy *);
|
||||
staticfn struct entity *e_at(coordxy, coordxy);
|
||||
staticfn void m_to_e(struct monst *, coordxy, coordxy, struct entity *);
|
||||
staticfn void u_to_e(struct entity *);
|
||||
staticfn void set_entity(coordxy, coordxy, struct entity *);
|
||||
staticfn const char *e_nam(struct entity *);
|
||||
staticfn const char *E_phrase(struct entity *, const char *);
|
||||
staticfn boolean e_survives_at(struct entity *, coordxy, coordxy);
|
||||
staticfn void e_died(struct entity *, int, int);
|
||||
staticfn boolean automiss(struct entity *);
|
||||
staticfn boolean e_missed(struct entity *, boolean);
|
||||
staticfn boolean e_jumps(struct entity *);
|
||||
staticfn void do_entity(struct entity *);
|
||||
staticfn void nokiller(void);
|
||||
|
||||
boolean
|
||||
is_waterwall(coordxy x, coordxy y)
|
||||
@@ -205,7 +205,7 @@ find_drawbridge(coordxy *x, coordxy *y)
|
||||
/*
|
||||
* Find the drawbridge wall associated with a drawbridge.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
get_wall_for_db(coordxy *x, coordxy *y)
|
||||
{
|
||||
switch (levl[*x][*y].drawbridgemask & DB_DIR) {
|
||||
@@ -279,7 +279,7 @@ create_drawbridge(coordxy x, coordxy y, int dir, boolean flag)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct entity *
|
||||
staticfn struct entity *
|
||||
e_at(coordxy x, coordxy y)
|
||||
{
|
||||
int entitycnt;
|
||||
@@ -296,7 +296,7 @@ e_at(coordxy x, coordxy y)
|
||||
: &(go.occupants[entitycnt]);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_to_e(struct monst *mtmp, coordxy x, coordxy y, struct entity *etmp)
|
||||
{
|
||||
etmp->emon = mtmp;
|
||||
@@ -313,7 +313,7 @@ m_to_e(struct monst *mtmp, coordxy x, coordxy y, struct entity *etmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
u_to_e(struct entity *etmp)
|
||||
{
|
||||
etmp->emon = &gy.youmonst;
|
||||
@@ -322,7 +322,7 @@ u_to_e(struct entity *etmp)
|
||||
etmp->edata = gy.youmonst.data;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
set_entity(
|
||||
coordxy x, coordxy y, /* location of span or portcullis */
|
||||
struct entity *etmp) /* pointer to occupants[0] or occupants[1] */
|
||||
@@ -343,7 +343,7 @@ set_entity(
|
||||
|
||||
/* #define e_strg(etmp, func) (is_u(etmp) ? (char *) 0 : func(etmp->emon)) */
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
e_nam(struct entity *etmp)
|
||||
{
|
||||
return is_u(etmp) ? "you" : mon_nam(etmp->emon);
|
||||
@@ -353,7 +353,7 @@ e_nam(struct entity *etmp)
|
||||
* Generates capitalized entity name, makes 2nd -> 3rd person conversion on
|
||||
* verb, where necessary.
|
||||
*/
|
||||
static const char *
|
||||
staticfn const char *
|
||||
E_phrase(struct entity *etmp, const char *verb)
|
||||
{
|
||||
static char wholebuf[80];
|
||||
@@ -372,7 +372,7 @@ E_phrase(struct entity *etmp, const char *verb)
|
||||
/*
|
||||
* Simple-minded "can it be here?" routine
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
e_survives_at(struct entity *etmp, coordxy x, coordxy y)
|
||||
{
|
||||
if (noncorporeal(etmp->edata))
|
||||
@@ -394,7 +394,7 @@ e_survives_at(struct entity *etmp, coordxy x, coordxy y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
e_died(struct entity *etmp, int xkill_flags, int how)
|
||||
{
|
||||
if (is_u(etmp)) {
|
||||
@@ -456,7 +456,7 @@ e_died(struct entity *etmp, int xkill_flags, int how)
|
||||
/*
|
||||
* These are never directly affected by a bridge or portcullis.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
automiss(struct entity *etmp)
|
||||
{
|
||||
return (boolean) ((is_u(etmp) ? Passes_walls : passes_walls(etmp->edata))
|
||||
@@ -466,7 +466,7 @@ automiss(struct entity *etmp)
|
||||
/*
|
||||
* Does falling drawbridge or portcullis miss etmp?
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
e_missed(struct entity *etmp, boolean chunks)
|
||||
{
|
||||
int misses;
|
||||
@@ -501,7 +501,7 @@ e_missed(struct entity *etmp, boolean chunks)
|
||||
/*
|
||||
* Can etmp jump from death?
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
e_jumps(struct entity *etmp)
|
||||
{
|
||||
int tmp = 4; /* out of 10 */
|
||||
@@ -524,7 +524,7 @@ e_jumps(struct entity *etmp)
|
||||
return (tmp >= rnd(10)) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_entity(struct entity *etmp)
|
||||
{
|
||||
coordxy newx, newy, oldx, oldy;
|
||||
@@ -733,7 +733,7 @@ do_entity(struct entity *etmp)
|
||||
}
|
||||
|
||||
/* clear stale reason for death and both 'entities' before returning */
|
||||
static void
|
||||
staticfn void
|
||||
nokiller(void)
|
||||
{
|
||||
gk.killer.name[0] = '\0';
|
||||
|
||||
+29
-29
@@ -51,7 +51,7 @@ const struct c_common_strings c_common_strings =
|
||||
{ "mon", "you" }
|
||||
};
|
||||
|
||||
const struct savefile_info default_sfinfo = {
|
||||
static const struct savefile_info default_sfinfo = {
|
||||
#ifdef NHSTDC
|
||||
0x00000000UL
|
||||
#else
|
||||
@@ -143,7 +143,7 @@ const char *ARGV0;
|
||||
|
||||
#define IVMAGIC 0xdeadbeef
|
||||
|
||||
const struct Role urole_init_data = {
|
||||
static const struct Role urole_init_data = {
|
||||
{ "Undefined", 0 },
|
||||
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
|
||||
@@ -168,7 +168,7 @@ const struct Role urole_init_data = {
|
||||
-3
|
||||
};
|
||||
|
||||
const struct Race urace_init_data = {
|
||||
static const struct Race urace_init_data = {
|
||||
"something",
|
||||
"undefined",
|
||||
"something",
|
||||
@@ -191,7 +191,7 @@ const struct Race urace_init_data = {
|
||||
|
||||
struct display_hints disp = { 0 };
|
||||
|
||||
const struct instance_globals_a g_init_a = {
|
||||
static const struct instance_globals_a g_init_a = {
|
||||
/* artifact.c */
|
||||
/* decl.c */
|
||||
UNDEFINED_PTR, /* afternmv */
|
||||
@@ -221,7 +221,7 @@ const struct instance_globals_a g_init_a = {
|
||||
IVMAGIC /* a_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_b g_init_b = {
|
||||
static const struct instance_globals_b g_init_b = {
|
||||
/* botl.c */
|
||||
{ { { NULL, NULL, 0L, FALSE, FALSE, 0, 0U, { 0 }, { 0 }, NULL, 0, 0, 0
|
||||
#ifdef STATUS_HILITES
|
||||
@@ -258,7 +258,7 @@ const struct instance_globals_b g_init_b = {
|
||||
IVMAGIC /* b_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_c g_init_c = {
|
||||
static const struct instance_globals_c g_init_c = {
|
||||
UNDEFINED_VALUES, /* command_queue */
|
||||
/* botl.c */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -310,7 +310,7 @@ const struct instance_globals_c g_init_c = {
|
||||
IVMAGIC /* c_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_d g_init_d = {
|
||||
static const struct instance_globals_d g_init_d = {
|
||||
/* decl.c */
|
||||
0, /* doorindex */
|
||||
0L, /* done_money */
|
||||
@@ -349,7 +349,7 @@ const struct instance_globals_d g_init_d = {
|
||||
IVMAGIC /* d_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_e g_init_e = {
|
||||
static const struct instance_globals_e g_init_e = {
|
||||
/* cmd.c */
|
||||
WIN_ERR, /* en_win */
|
||||
FALSE, /* en_via_menu */
|
||||
@@ -365,7 +365,7 @@ const struct instance_globals_e g_init_e = {
|
||||
IVMAGIC /* e_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_f g_init_f = {
|
||||
static const struct instance_globals_f g_init_f = {
|
||||
/* decl.c */
|
||||
UNDEFINED_PTR, /* ftrap */
|
||||
{ NULL }, /* fqn_prefix */
|
||||
@@ -384,7 +384,7 @@ const struct instance_globals_f g_init_f = {
|
||||
IVMAGIC /* f_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_g g_init_g = {
|
||||
static const struct instance_globals_g g_init_g = {
|
||||
/* display.c */
|
||||
{ { { 0 } } }, /* gbuf */
|
||||
UNDEFINED_VALUES, /* gbuf_start */
|
||||
@@ -416,7 +416,7 @@ const struct instance_globals_g g_init_g = {
|
||||
IVMAGIC /* g_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_h g_init_h = {
|
||||
static const struct instance_globals_h g_init_h = {
|
||||
/* decl.c */
|
||||
NULL, /* hname */
|
||||
0, /* hackpid */
|
||||
@@ -436,7 +436,7 @@ const struct instance_globals_h g_init_h = {
|
||||
IVMAGIC /* h_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_i g_init_i = {
|
||||
static const struct instance_globals_i g_init_i = {
|
||||
/* decl.c */
|
||||
0, /* in_doagain */
|
||||
{ 0, 0 } , /* inv_pos */
|
||||
@@ -460,14 +460,14 @@ const struct instance_globals_i g_init_i = {
|
||||
IVMAGIC /* i_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_j g_init_j = {
|
||||
static const struct instance_globals_j g_init_j = {
|
||||
/* apply.c */
|
||||
0, /* jumping_is_magic */
|
||||
TRUE, /* havestate*/
|
||||
IVMAGIC /* j_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_k g_init_k = {
|
||||
static const struct instance_globals_k g_init_k = {
|
||||
/* decl.c */
|
||||
UNDEFINED_PTR, /* kickedobj */
|
||||
DUMMY, /* killer */
|
||||
@@ -477,7 +477,7 @@ const struct instance_globals_k g_init_k = {
|
||||
IVMAGIC /* k_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_l g_init_l = {
|
||||
static const struct instance_globals_l g_init_l = {
|
||||
/* cmd.c */
|
||||
UNDEFINED_VALUE, /* last_command_count */
|
||||
/* decl.c */
|
||||
@@ -533,7 +533,7 @@ const struct instance_globals_l g_init_l = {
|
||||
IVMAGIC /* l_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_m g_init_m = {
|
||||
static const struct instance_globals_m g_init_m = {
|
||||
/* apply.c */
|
||||
0, /* mkot_trap_warn_count */
|
||||
/* botl.c */
|
||||
@@ -586,7 +586,7 @@ const struct instance_globals_m g_init_m = {
|
||||
IVMAGIC /* m_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_n g_init_n = {
|
||||
static const struct instance_globals_n g_init_n = {
|
||||
/* botl.c */
|
||||
0, /* now_or_before_idx */
|
||||
/* decl.c */
|
||||
@@ -626,7 +626,7 @@ const struct instance_globals_n g_init_n = {
|
||||
IVMAGIC /* n_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_o g_init_o = {
|
||||
static const struct instance_globals_o g_init_o = {
|
||||
/* dbridge.c */
|
||||
{ { 0 } }, /* occupants */
|
||||
/* decl.c */
|
||||
@@ -666,7 +666,7 @@ const struct instance_globals_o g_init_o = {
|
||||
IVMAGIC /* o_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_p g_init_p = {
|
||||
static const struct instance_globals_p g_init_p = {
|
||||
/* apply.c */
|
||||
-1, /* polearm_range_min */
|
||||
-1, /* polearm_range_max */
|
||||
@@ -706,14 +706,14 @@ const struct instance_globals_p g_init_p = {
|
||||
IVMAGIC /* p_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_q g_init_q = {
|
||||
static const struct instance_globals_q g_init_q = {
|
||||
/* quest.c */
|
||||
DUMMY, /* quest_status */
|
||||
TRUE, /* havestate*/
|
||||
IVMAGIC /* q_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_r g_init_r = {
|
||||
static const struct instance_globals_r g_init_r = {
|
||||
/* decl.c */
|
||||
{ DUMMY }, /* rooms */
|
||||
/* symbols.c */
|
||||
@@ -736,7 +736,7 @@ const struct instance_globals_r g_init_r = {
|
||||
IVMAGIC /* r_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_s g_init_s = {
|
||||
static const struct instance_globals_s g_init_s = {
|
||||
/* artifact.c */
|
||||
0, /* spec_dbon_applies */
|
||||
/* decl.c */
|
||||
@@ -796,7 +796,7 @@ const struct instance_globals_s g_init_s = {
|
||||
IVMAGIC /* s_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_t g_init_t = {
|
||||
static const struct instance_globals_t g_init_t = {
|
||||
/* apply.c */
|
||||
UNDEFINED_VALUES, /* trapinfo */
|
||||
/* decl.c */
|
||||
@@ -833,7 +833,7 @@ const struct instance_globals_t g_init_t = {
|
||||
IVMAGIC /* t_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_u g_init_u = {
|
||||
static const struct instance_globals_u g_init_u = {
|
||||
/* botl.c */
|
||||
FALSE, /* update_all */
|
||||
/* decl.c */
|
||||
@@ -848,7 +848,7 @@ const struct instance_globals_u g_init_u = {
|
||||
IVMAGIC /* u_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_v g_init_v = {
|
||||
static const struct instance_globals_v g_init_v = {
|
||||
/* botl.c */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* valset */
|
||||
@@ -874,7 +874,7 @@ const struct instance_globals_v g_init_v = {
|
||||
IVMAGIC /* v_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_w g_init_w = {
|
||||
static const struct instance_globals_w g_init_w = {
|
||||
/* decl.c */
|
||||
0, /* warn_obj_cnt */
|
||||
0L, /* wailmsg */
|
||||
@@ -892,7 +892,7 @@ const struct instance_globals_w g_init_w = {
|
||||
IVMAGIC /* w_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_x g_init_x = {
|
||||
static const struct instance_globals_x g_init_x = {
|
||||
/* decl.c */
|
||||
(COLNO - 1) & ~1, /* x_maze_max */
|
||||
/* lock.c */
|
||||
@@ -909,7 +909,7 @@ const struct instance_globals_x g_init_x = {
|
||||
IVMAGIC /* x_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_y g_init_y = {
|
||||
static const struct instance_globals_y g_init_y = {
|
||||
/* decl.c */
|
||||
(ROWNO - 1) & ~1, /* y_maze_max */
|
||||
DUMMY, /* youmonst */
|
||||
@@ -926,7 +926,7 @@ const struct instance_globals_y g_init_y = {
|
||||
IVMAGIC /* y_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
const struct instance_globals_z g_init_z = {
|
||||
static const struct instance_globals_z g_init_z = {
|
||||
/* mon.c */
|
||||
FALSE, /* zombify */
|
||||
/* muse.c */
|
||||
|
||||
+32
-32
@@ -11,22 +11,22 @@
|
||||
#include "hack.h"
|
||||
#include "artifact.h"
|
||||
|
||||
static boolean unconstrain_map(void);
|
||||
static void reconstrain_map(void);
|
||||
static void map_redisplay(void);
|
||||
static void browse_map(unsigned, const char *);
|
||||
static void map_monst(struct monst *, boolean);
|
||||
static void do_dknown_of(struct obj *);
|
||||
static boolean check_map_spot(coordxy, coordxy, char, unsigned);
|
||||
static boolean clear_stale_map(char, unsigned);
|
||||
static void sense_trap(struct trap *, coordxy, coordxy, int);
|
||||
static int detect_obj_traps(struct obj *, boolean, int);
|
||||
static void display_trap_map(int);
|
||||
static int furniture_detect(void);
|
||||
static void findone(coordxy, coordxy, genericptr_t);
|
||||
static void openone(coordxy, coordxy, genericptr_t);
|
||||
static int mfind0(struct monst *, boolean);
|
||||
static int reveal_terrain_getglyph(coordxy, coordxy, unsigned, int, unsigned);
|
||||
staticfn boolean unconstrain_map(void);
|
||||
staticfn void reconstrain_map(void);
|
||||
staticfn void map_redisplay(void);
|
||||
staticfn void browse_map(unsigned, const char *);
|
||||
staticfn void map_monst(struct monst *, boolean);
|
||||
staticfn void do_dknown_of(struct obj *);
|
||||
staticfn boolean check_map_spot(coordxy, coordxy, char, unsigned);
|
||||
staticfn boolean clear_stale_map(char, unsigned);
|
||||
staticfn void sense_trap(struct trap *, coordxy, coordxy, int);
|
||||
staticfn int detect_obj_traps(struct obj *, boolean, int);
|
||||
staticfn void display_trap_map(int);
|
||||
staticfn int furniture_detect(void);
|
||||
staticfn void findone(coordxy, coordxy, genericptr_t);
|
||||
staticfn void openone(coordxy, coordxy, genericptr_t);
|
||||
staticfn int mfind0(struct monst *, boolean);
|
||||
staticfn int reveal_terrain_getglyph(coordxy, coordxy, unsigned, int, unsigned);
|
||||
|
||||
/* dummytrap: used when detecting traps finds a door or chest trap; the
|
||||
couple of fields that matter are always re-initialized during use so
|
||||
@@ -51,7 +51,7 @@ struct found_things {
|
||||
|
||||
/* bring hero out from underwater or underground or being engulfed;
|
||||
return True iff any change occurred */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
unconstrain_map(void)
|
||||
{
|
||||
boolean res = u.uinwater || u.uburied || u.uswallow;
|
||||
@@ -66,7 +66,7 @@ unconstrain_map(void)
|
||||
}
|
||||
|
||||
/* put hero back underwater or underground or engulfed */
|
||||
static void
|
||||
staticfn void
|
||||
reconstrain_map(void)
|
||||
{
|
||||
/* if was in water and taken out, put back; bypass set_uinwater() */
|
||||
@@ -75,7 +75,7 @@ reconstrain_map(void)
|
||||
u.uswallow = iflags.save_uswallow, iflags.save_uswallow = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
map_redisplay(void)
|
||||
{
|
||||
reconstrain_map();
|
||||
@@ -87,7 +87,7 @@ map_redisplay(void)
|
||||
}
|
||||
|
||||
/* use getpos()'s 'autodescribe' to view whatever is currently shown on map */
|
||||
static void
|
||||
staticfn void
|
||||
browse_map(unsigned ter_typ, const char *ter_explain)
|
||||
{
|
||||
coord dummy_pos; /* don't care whether player actually picks a spot */
|
||||
@@ -103,7 +103,7 @@ browse_map(unsigned ter_typ, const char *ter_explain)
|
||||
}
|
||||
|
||||
/* extracted from monster_detection() so can be shared by do_vicinity_map() */
|
||||
static void
|
||||
staticfn void
|
||||
map_monst(struct monst *mtmp, boolean showtail)
|
||||
{
|
||||
int glyph = (monsym(mtmp->data) == ' ')
|
||||
@@ -230,7 +230,7 @@ o_material(struct obj *obj, unsigned material)
|
||||
return (struct obj *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_dknown_of(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -243,7 +243,7 @@ do_dknown_of(struct obj *obj)
|
||||
}
|
||||
|
||||
/* Check whether the location has an outdated object displayed on it. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
check_map_spot(coordxy x, coordxy y, char oclass, unsigned material)
|
||||
{
|
||||
int glyph;
|
||||
@@ -297,7 +297,7 @@ check_map_spot(coordxy x, coordxy y, char oclass, unsigned material)
|
||||
* reappear after the detection has completed. Return true if noticeable
|
||||
* change occurs.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
clear_stale_map(char oclass, unsigned material)
|
||||
{
|
||||
coordxy zx, zy;
|
||||
@@ -844,7 +844,7 @@ monster_detect(struct obj *otmp, /* detecting object (if any) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
sense_trap(struct trap *trap, coordxy x, coordxy y, int src_cursed)
|
||||
{
|
||||
if (Hallucination || src_cursed) {
|
||||
@@ -886,7 +886,7 @@ sense_trap(struct trap *trap, coordxy x, coordxy y, int src_cursed)
|
||||
/* check a list of objects for chest traps; return 1 if found at <ux,uy>,
|
||||
2 if found at some other spot, 3 if both, 0 otherwise; optionally
|
||||
update the map to show where such traps were found */
|
||||
static int
|
||||
staticfn int
|
||||
detect_obj_traps(
|
||||
struct obj *objlist,
|
||||
boolean show_them,
|
||||
@@ -917,7 +917,7 @@ detect_obj_traps(
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
display_trap_map(int cursed_src)
|
||||
{
|
||||
struct monst *mon;
|
||||
@@ -1051,7 +1051,7 @@ trap_detect(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
furniture_detect(void)
|
||||
{
|
||||
struct monst *mon;
|
||||
@@ -1563,7 +1563,7 @@ cvt_sdoor_to_door(struct rm *lev)
|
||||
|
||||
/* find something at one location; it should find all somethings there
|
||||
since it is used for magical detection rather than physical searching */
|
||||
static void
|
||||
staticfn void
|
||||
findone(coordxy zx, coordxy zy, genericptr_t whatfound)
|
||||
{
|
||||
struct trap *ttmp;
|
||||
@@ -1624,7 +1624,7 @@ findone(coordxy zx, coordxy zy, genericptr_t whatfound)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
openone(coordxy zx, coordxy zy, genericptr_t num)
|
||||
{
|
||||
struct trap *ttmp;
|
||||
@@ -1831,7 +1831,7 @@ find_trap(struct trap *trap)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
mfind0(struct monst *mtmp, boolean via_warning)
|
||||
{
|
||||
coordxy x = mtmp->mx, y = mtmp->my;
|
||||
@@ -2015,7 +2015,7 @@ premap_detect(void)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
reveal_terrain_getglyph(
|
||||
coordxy x, coordxy y,
|
||||
unsigned swallowed,
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean rm_waslit(void);
|
||||
static void mkcavepos(coordxy, coordxy, int, boolean, boolean);
|
||||
static void mkcavearea(boolean);
|
||||
static boolean pick_can_reach(struct obj *, coordxy, coordxy) NONNULLARG1;
|
||||
static int dig(void);
|
||||
static void dig_up_grave(coord *);
|
||||
static boolean watchman_canseeu(struct monst *) NONNULLARG1;
|
||||
static int adj_pit_checks(coord *, char *) NONNULLARG2;
|
||||
static void pit_flow(struct trap *, schar);
|
||||
static boolean furniture_handled(coordxy, coordxy, boolean);
|
||||
staticfn boolean rm_waslit(void);
|
||||
staticfn void mkcavepos(coordxy, coordxy, int, boolean, boolean);
|
||||
staticfn void mkcavearea(boolean);
|
||||
staticfn boolean pick_can_reach(struct obj *, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn int dig(void);
|
||||
staticfn void dig_up_grave(coord *);
|
||||
staticfn boolean watchman_canseeu(struct monst *) NONNULLARG1;
|
||||
staticfn int adj_pit_checks(coord *, char *) NONNULLARG2;
|
||||
staticfn void pit_flow(struct trap *, schar);
|
||||
staticfn boolean furniture_handled(coordxy, coordxy, boolean);
|
||||
|
||||
/* Indices returned by dig_typ() */
|
||||
enum dig_types {
|
||||
@@ -26,7 +26,7 @@ enum dig_types {
|
||||
DIGTYP_TREE
|
||||
};
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
rm_waslit(void)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -44,7 +44,7 @@ rm_waslit(void)
|
||||
* boulders in the name of a nice effect. Vision will get fixed up again
|
||||
* immediately after the effect is complete.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit)
|
||||
{
|
||||
struct rm *lev;
|
||||
@@ -84,7 +84,7 @@ mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit)
|
||||
feel_newsym(x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkcavearea(boolean rockit)
|
||||
{
|
||||
int dist;
|
||||
@@ -137,7 +137,7 @@ mkcavearea(boolean rockit)
|
||||
}
|
||||
|
||||
/* called when attempting to break a statue or boulder with a pick */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
pick_can_reach(struct obj *pick, coordxy x, coordxy y)
|
||||
{
|
||||
struct trap *t = t_at(x, y);
|
||||
@@ -260,7 +260,7 @@ dig_check(struct monst *madeby, boolean verbose, coordxy x, coordxy y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
dig(void)
|
||||
{
|
||||
struct rm *lev;
|
||||
@@ -518,7 +518,7 @@ dig(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
furniture_handled(coordxy x, coordxy y, boolean madeby_u)
|
||||
{
|
||||
struct rm *lev = &levl[x][y];
|
||||
@@ -963,7 +963,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dig_up_grave(coord *cc)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1296,7 +1296,7 @@ use_pick_axe2(struct obj *obj)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
watchman_canseeu(struct monst *mtmp)
|
||||
{
|
||||
if (is_watch(mtmp->data) && mtmp->mcansee && m_canseeu(mtmp)
|
||||
@@ -1696,7 +1696,7 @@ zap_dig(void)
|
||||
* you're zapping a wand of digging laterally while
|
||||
* down in the pit.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
adj_pit_checks(coord *cc, char *msg)
|
||||
{
|
||||
int ltyp;
|
||||
@@ -1777,7 +1777,7 @@ adj_pit_checks(coord *cc, char *msg)
|
||||
/*
|
||||
* Ensure that all conjoined pits fill up.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
pit_flow(struct trap *trap, schar filltyp)
|
||||
{
|
||||
/*
|
||||
|
||||
+41
-41
@@ -123,32 +123,32 @@
|
||||
*/
|
||||
#include "hack.h"
|
||||
|
||||
static void show_mon_or_warn(coordxy, coordxy, int);
|
||||
static void display_monster(coordxy, coordxy,
|
||||
staticfn void show_mon_or_warn(coordxy, coordxy, int);
|
||||
staticfn void display_monster(coordxy, coordxy,
|
||||
struct monst *, int, boolean) NONNULLPTRS;
|
||||
static int swallow_to_glyph(int, int);
|
||||
static void display_warning(struct monst *) NONNULLARG1;
|
||||
static boolean next_to_gas(struct monst *, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn int swallow_to_glyph(int, int);
|
||||
staticfn void display_warning(struct monst *) NONNULLARG1;
|
||||
staticfn boolean next_to_gas(struct monst *, coordxy, coordxy) NONNULLARG1;
|
||||
|
||||
static int check_pos(coordxy, coordxy, int);
|
||||
static void get_bkglyph_and_framecolor(coordxy x, coordxy y, int *, uint32 *);
|
||||
static int tether_glyph(coordxy, coordxy);
|
||||
static void mimic_light_blocking(struct monst *) NONNULLARG1;
|
||||
staticfn int check_pos(coordxy, coordxy, int);
|
||||
staticfn void get_bkglyph_and_framecolor(coordxy x, coordxy y, int *, uint32 *);
|
||||
staticfn int tether_glyph(coordxy, coordxy);
|
||||
staticfn void mimic_light_blocking(struct monst *) NONNULLARG1;
|
||||
|
||||
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
|
||||
#ifdef WA_VERBOSE
|
||||
static boolean more_than_one(coordxy, coordxy, coordxy, coordxy, coordxy);
|
||||
staticfn boolean more_than_one(coordxy, coordxy, coordxy, coordxy, coordxy);
|
||||
#endif
|
||||
|
||||
static int set_twall(coordxy, coordxy, coordxy, coordxy,
|
||||
staticfn int set_twall(coordxy, coordxy, coordxy, coordxy,
|
||||
coordxy, coordxy, coordxy, coordxy);
|
||||
static int set_wall(coordxy, coordxy, int);
|
||||
static int set_corn(coordxy, coordxy, coordxy, coordxy,
|
||||
staticfn int set_wall(coordxy, coordxy, int);
|
||||
staticfn int set_corn(coordxy, coordxy, coordxy, coordxy,
|
||||
coordxy, coordxy, coordxy, coordxy);
|
||||
static int set_crosswall(coordxy, coordxy);
|
||||
static void set_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
|
||||
static void t_warn(struct rm *);
|
||||
static int wall_angle(struct rm *);
|
||||
staticfn int set_crosswall(coordxy, coordxy);
|
||||
staticfn void set_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
|
||||
staticfn void t_warn(struct rm *);
|
||||
staticfn int wall_angle(struct rm *);
|
||||
|
||||
#define _glyph_at(x, y) gg.gbuf[y][x].glyphinfo.glyph
|
||||
|
||||
@@ -468,7 +468,7 @@ map_location(coordxy x, coordxy y, int show)
|
||||
}
|
||||
|
||||
/* display something on monster layer; may need to fixup object layer */
|
||||
static void
|
||||
staticfn void
|
||||
show_mon_or_warn(coordxy x, coordxy y, int monglyph)
|
||||
{
|
||||
struct obj *o;
|
||||
@@ -500,7 +500,7 @@ show_mon_or_warn(coordxy x, coordxy y, int monglyph)
|
||||
* a worm tail.
|
||||
*
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
display_monster(
|
||||
coordxy x, coordxy y, /* display position */
|
||||
struct monst *mon, /* monster to display */
|
||||
@@ -619,7 +619,7 @@ display_monster(
|
||||
*
|
||||
* Do not call for worm tails.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
display_warning(struct monst *mon)
|
||||
{
|
||||
coordxy x = mon->mx, y = mon->my;
|
||||
@@ -653,7 +653,7 @@ warning_of(struct monst *mon)
|
||||
|
||||
/* returns True if mon is adjacent and would be seen if vision wasn't
|
||||
blocked by being in a gas cloud (implicit; caller has already checked) */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
next_to_gas(
|
||||
struct monst *mon,
|
||||
coordxy mx, coordxy my) /* won't match mon->mx,my if long worm's tail */
|
||||
@@ -1072,7 +1072,7 @@ shieldeff(coordxy x, coordxy y)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
tether_glyph(coordxy x, coordxy y)
|
||||
{
|
||||
int tdx, tdy;
|
||||
@@ -1473,7 +1473,7 @@ see_monsters(void)
|
||||
newsym(u.ux, u.uy);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mimic_light_blocking(struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->minvis && is_lightblocker_mappear(mtmp)) {
|
||||
@@ -1583,7 +1583,7 @@ static glyph_info no_ginfo = {
|
||||
: &gg.gbuf[(y)][(x)].glyphinfo)
|
||||
#else
|
||||
static glyph_info ginfo;
|
||||
static glyph_info *glyphinfo_at(coordxy, coordxy, int);
|
||||
staticfn glyph_info *glyphinfo_at(coordxy, coordxy, int);
|
||||
#define Glyphinfo_at(x, y, glyph) glyphinfo_at((x), (y), (glyph))
|
||||
#endif
|
||||
|
||||
@@ -2343,7 +2343,7 @@ back_to_glyph(coordxy x, coordxy y)
|
||||
* If you don't want a patchwork monster while hallucinating, decide on
|
||||
* a random monster in swallowed() and don't use what_mon() here.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
swallow_to_glyph(int mnum, int loc)
|
||||
{
|
||||
int m_3 = what_mon(mnum, rn2_on_display_rng) << 3;
|
||||
@@ -2413,7 +2413,7 @@ glyphinfo_at(coordxy x, coordxy y, int glyph)
|
||||
*
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
get_bkglyph_and_framecolor(
|
||||
coordxy x, coordxy y,
|
||||
int *bkglyph,
|
||||
@@ -2609,9 +2609,9 @@ int wallcolors[sokoban_walls + 1] = {
|
||||
&& gl.level.objects[(x)][(y)]->nexthere)
|
||||
#endif
|
||||
|
||||
static int cmap_to_roguecolor(int);
|
||||
staticfn int cmap_to_roguecolor(int);
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
cmap_to_roguecolor(int cmap)
|
||||
{
|
||||
int color = NO_COLOR;
|
||||
@@ -3006,8 +3006,8 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
|
||||
#ifdef WA_VERBOSE
|
||||
|
||||
static const char *type_to_name(int);
|
||||
static void error4(coordxy, coordxy, int, int, int, int);
|
||||
staticfn const char *type_to_name(int);
|
||||
staticfn void error4(coordxy, coordxy, int, int, int, int);
|
||||
|
||||
static int bad_count[MAX_TYPE]; /* count of positions flagged as bad */
|
||||
static const char *const type_names[MAX_TYPE] = {
|
||||
@@ -3020,13 +3020,13 @@ static const char *const type_names[MAX_TYPE] = {
|
||||
"CLOUD"
|
||||
};
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
type_to_name(int type)
|
||||
{
|
||||
return (type < 0 || type >= MAX_TYPE) ? "unknown" : type_names[type];
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
error4(coordxy x, coordxy y, int a, int b, int c, int dd)
|
||||
{
|
||||
pline("set_wall_state: %s @ (%d,%d) %s%s%s%s",
|
||||
@@ -3042,7 +3042,7 @@ error4(coordxy x, coordxy y, int a, int b, int c, int dd)
|
||||
*
|
||||
* Things that are ambiguous: lava
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
check_pos(coordxy x, coordxy y, int which)
|
||||
{
|
||||
int type;
|
||||
@@ -3058,7 +3058,7 @@ check_pos(coordxy x, coordxy y, int which)
|
||||
/* Return TRUE if more than one is non-zero. */
|
||||
/*ARGSUSED*/
|
||||
#ifdef WA_VERBOSE
|
||||
static boolean
|
||||
staticfn boolean
|
||||
more_than_one(coordxy x, coordxy y, coordxy a, coordxy b, coordxy c)
|
||||
{
|
||||
if ((a && (b | c)) || (b && (a | c)) || (c && (a | b))) {
|
||||
@@ -3073,7 +3073,7 @@ more_than_one(coordxy x, coordxy y, coordxy a, coordxy b, coordxy c)
|
||||
#endif
|
||||
|
||||
/* Return the wall mode for a T wall. */
|
||||
static int
|
||||
staticfn int
|
||||
set_twall(
|
||||
#ifdef WA_VERBOSE
|
||||
coordxy x0, coordxy y0, /* used #if WA_VERBOSE */
|
||||
@@ -3096,7 +3096,7 @@ set_twall(
|
||||
}
|
||||
|
||||
/* Return wall mode for a horizontal or vertical wall. */
|
||||
static int
|
||||
staticfn int
|
||||
set_wall(coordxy x, coordxy y, int horiz)
|
||||
{
|
||||
int wmode, is_1, is_2;
|
||||
@@ -3117,7 +3117,7 @@ set_wall(coordxy x, coordxy y, int horiz)
|
||||
}
|
||||
|
||||
/* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */
|
||||
static int
|
||||
staticfn int
|
||||
set_corn(coordxy x1, coordxy y1, coordxy x2, coordxy y2, coordxy x3, coordxy y3, coordxy x4, coordxy y4)
|
||||
{
|
||||
coordxy wmode, is_1, is_2, is_3, is_4;
|
||||
@@ -3145,7 +3145,7 @@ set_corn(coordxy x1, coordxy y1, coordxy x2, coordxy y2, coordxy x3, coordxy y3,
|
||||
}
|
||||
|
||||
/* Return mode for a crosswall. */
|
||||
static int
|
||||
staticfn int
|
||||
set_crosswall(coordxy x, coordxy y)
|
||||
{
|
||||
coordxy wmode, is_1, is_2, is_3, is_4;
|
||||
@@ -3274,7 +3274,7 @@ const seenV seenv_matrix[3][3] = {
|
||||
#define sign(z) ((z) < 0 ? -1 : ((z) != 0))
|
||||
|
||||
/* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */
|
||||
static void
|
||||
staticfn void
|
||||
set_seenv(
|
||||
struct rm *lev,
|
||||
coordxy x0, coordxy y0, /* from */
|
||||
@@ -3358,7 +3358,7 @@ static const int cross_matrix[4][6] = {
|
||||
};
|
||||
|
||||
/* Print out a T wall warning and all interesting info. */
|
||||
static void
|
||||
staticfn void
|
||||
t_warn(struct rm *lev)
|
||||
{
|
||||
static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x";
|
||||
@@ -3418,7 +3418,7 @@ t_warn(struct rm *lev)
|
||||
* draw diagrams. See rm.h for more details on the wall modes and
|
||||
* seen vector (SV).
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
wall_angle(struct rm *lev)
|
||||
{
|
||||
unsigned int seenv = lev->seenv & 0xff;
|
||||
|
||||
@@ -59,20 +59,20 @@ extern unsigned FITSuint_(unsigned long long, const char *, int);
|
||||
*/
|
||||
|
||||
#define MAX_LIBS 4
|
||||
static library dlb_libs[MAX_LIBS];
|
||||
staticfn library dlb_libs[MAX_LIBS];
|
||||
|
||||
static boolean readlibdir(library * lp);
|
||||
static boolean find_file(const char *name, library **lib, long *startp,
|
||||
staticfn boolean readlibdir(library * lp);
|
||||
staticfn boolean find_file(const char *name, library **lib, long *startp,
|
||||
long *sizep);
|
||||
static boolean lib_dlb_init(void);
|
||||
static void lib_dlb_cleanup(void);
|
||||
static boolean lib_dlb_fopen(dlb *, const char *, const char *);
|
||||
static int lib_dlb_fclose(dlb *);
|
||||
static int lib_dlb_fread(char *, int, int, dlb *);
|
||||
static int lib_dlb_fseek(dlb *, long, int);
|
||||
static char *lib_dlb_fgets(char *, int, dlb *);
|
||||
static int lib_dlb_fgetc(dlb *);
|
||||
static long lib_dlb_ftell(dlb *);
|
||||
staticfn boolean lib_dlb_init(void);
|
||||
staticfn void lib_dlb_cleanup(void);
|
||||
staticfn boolean lib_dlb_fopen(dlb *, const char *, const char *);
|
||||
staticfn int lib_dlb_fclose(dlb *);
|
||||
staticfn int lib_dlb_fread(char *, int, int, dlb *);
|
||||
staticfn int lib_dlb_fseek(dlb *, long, int);
|
||||
staticfn char *lib_dlb_fgets(char *, int, dlb *);
|
||||
staticfn int lib_dlb_fgetc(dlb *);
|
||||
staticfn long lib_dlb_ftell(dlb *);
|
||||
|
||||
/* not static because shared with dlb_main.c */
|
||||
boolean open_library(const char *lib_name, library *lp);
|
||||
@@ -123,7 +123,7 @@ extern char *eos(char *);
|
||||
*
|
||||
* Return TRUE on success, FALSE on failure.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
readlibdir(library *lp) /* library pointer to fill in */
|
||||
{
|
||||
int i;
|
||||
@@ -171,7 +171,7 @@ readlibdir(library *lp) /* library pointer to fill in */
|
||||
* Look for the file in our directory structure. Return 1 if successful,
|
||||
* 0 if not found. Fill in the size and starting position.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
find_file(const char *name, library **lib, long *startp, long *sizep)
|
||||
{
|
||||
int i, j;
|
||||
@@ -228,7 +228,7 @@ close_library(library *lp)
|
||||
* Open the library file once using stdio. Keep it open, but
|
||||
* keep track of the file position.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
lib_dlb_init(void)
|
||||
{
|
||||
/* zero out array */
|
||||
@@ -248,7 +248,7 @@ lib_dlb_init(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
lib_dlb_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
@@ -269,7 +269,7 @@ build_dlb_filename(const char *lf)
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
lib_dlb_fopen(dlb *dp, const char *name, const char *mode UNUSED)
|
||||
{
|
||||
long start, size;
|
||||
@@ -288,14 +288,14 @@ lib_dlb_fopen(dlb *dp, const char *name, const char *mode UNUSED)
|
||||
}
|
||||
|
||||
/*ARGUSED*/
|
||||
static int
|
||||
staticfn int
|
||||
lib_dlb_fclose(dlb *dp UNUSED)
|
||||
{
|
||||
/* nothing needs to be done */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
lib_dlb_fread(char *buf, int size, int quan, dlb *dp)
|
||||
{
|
||||
long pos, nread, nbytes;
|
||||
@@ -320,7 +320,7 @@ lib_dlb_fread(char *buf, int size, int quan, dlb *dp)
|
||||
return (int) nread;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
lib_dlb_fseek(dlb *dp, long pos, int whence)
|
||||
{
|
||||
long curpos;
|
||||
@@ -345,7 +345,7 @@ lib_dlb_fseek(dlb *dp, long pos, int whence)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
lib_dlb_fgets(char *buf, int len, dlb *dp)
|
||||
{
|
||||
int i;
|
||||
@@ -377,7 +377,7 @@ lib_dlb_fgets(char *buf, int len, dlb *dp)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
lib_dlb_fgetc(dlb *dp)
|
||||
{
|
||||
char c;
|
||||
@@ -387,13 +387,13 @@ lib_dlb_fgetc(dlb *dp)
|
||||
return (int) c;
|
||||
}
|
||||
|
||||
static long
|
||||
staticfn long
|
||||
lib_dlb_ftell(dlb *dp)
|
||||
{
|
||||
return dp->mark;
|
||||
}
|
||||
|
||||
const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup,
|
||||
static const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup,
|
||||
lib_dlb_fopen, lib_dlb_fclose,
|
||||
lib_dlb_fread, lib_dlb_fseek,
|
||||
lib_dlb_fgets, lib_dlb_fgetc,
|
||||
@@ -402,7 +402,7 @@ const dlb_procs_t lib_dlb_procs = { lib_dlb_init, lib_dlb_cleanup,
|
||||
#endif /* DLBLIB */
|
||||
|
||||
#ifdef DLBRSRC
|
||||
const dlb_procs_t rsrc_dlb_procs = { rsrc_dlb_init, rsrc_dlb_cleanup,
|
||||
static const dlb_procs_t rsrc_dlb_procs = { rsrc_dlb_init, rsrc_dlb_cleanup,
|
||||
rsrc_dlb_fopen, rsrc_dlb_fclose,
|
||||
rsrc_dlb_fread, rsrc_dlb_fseek,
|
||||
rsrc_dlb_fgets, rsrc_dlb_fgetc,
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean teleport_sink(void);
|
||||
static void dosinkring(struct obj *);
|
||||
static int drop(struct obj *);
|
||||
static int menudrop_split(struct obj *, long);
|
||||
static boolean engulfer_digests_food(struct obj *);
|
||||
static boolean danger_uprops(void);
|
||||
static int wipeoff(void);
|
||||
static int menu_drop(int);
|
||||
static boolean u_stuck_cannot_go(const char *);
|
||||
static NHFILE *currentlevel_rewrite(void);
|
||||
static void familiar_level_msg(void);
|
||||
static void final_level(void);
|
||||
static void temperature_change_msg(schar);
|
||||
staticfn boolean teleport_sink(void);
|
||||
staticfn void dosinkring(struct obj *);
|
||||
staticfn int drop(struct obj *);
|
||||
staticfn int menudrop_split(struct obj *, long);
|
||||
staticfn boolean engulfer_digests_food(struct obj *);
|
||||
staticfn boolean danger_uprops(void);
|
||||
staticfn int wipeoff(void);
|
||||
staticfn int menu_drop(int);
|
||||
staticfn boolean u_stuck_cannot_go(const char *);
|
||||
staticfn NHFILE *currentlevel_rewrite(void);
|
||||
staticfn void familiar_level_msg(void);
|
||||
staticfn void final_level(void);
|
||||
staticfn void temperature_change_msg(schar);
|
||||
|
||||
/* static boolean badspot(coordxy,coordxy); */
|
||||
|
||||
@@ -447,7 +447,7 @@ polymorph_sink(void)
|
||||
|
||||
/* Teleports the sink at the player's position;
|
||||
return True if sink teleported. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
teleport_sink(void)
|
||||
{
|
||||
coordxy cx, cy;
|
||||
@@ -485,7 +485,7 @@ teleport_sink(void)
|
||||
}
|
||||
|
||||
/* obj is a ring being dropped over a kitchen sink */
|
||||
static void
|
||||
staticfn void
|
||||
dosinkring(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp, *otmp2;
|
||||
@@ -701,7 +701,7 @@ canletgo(struct obj *obj, const char *word)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
drop(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -834,7 +834,7 @@ dropz(struct obj *obj, boolean with_impact)
|
||||
/* when swallowed, move dropped object from OBJ_FREE to u.ustuck's inventory;
|
||||
for purple worm, immediately eat any corpse, glob, or special meat item
|
||||
from object polymorph; return True if object is used up, False otherwise */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
engulfer_digests_food(struct obj *obj)
|
||||
{
|
||||
/* animal swallower (purple worn) eats any
|
||||
@@ -932,7 +932,7 @@ doddrop(void)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int /* check callers */
|
||||
staticfn int /* check callers */
|
||||
menudrop_split(struct obj *otmp, long cnt)
|
||||
{
|
||||
if (cnt && cnt < otmp->quan) {
|
||||
@@ -949,7 +949,7 @@ menudrop_split(struct obj *otmp, long cnt)
|
||||
}
|
||||
|
||||
/* Drop things from the hero's inventory, using a menu. */
|
||||
static int
|
||||
staticfn int
|
||||
menu_drop(int retry)
|
||||
{
|
||||
int n, i, n_dropped = 0;
|
||||
@@ -1078,7 +1078,7 @@ menu_drop(int retry)
|
||||
return (n_dropped ? ECMD_TIME : ECMD_OK);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
u_stuck_cannot_go(const char *updn)
|
||||
{
|
||||
if (u.ustuck) {
|
||||
@@ -1315,7 +1315,7 @@ doup(void)
|
||||
}
|
||||
|
||||
/* check that we can write out the current level */
|
||||
static NHFILE *
|
||||
staticfn NHFILE *
|
||||
currentlevel_rewrite(void)
|
||||
{
|
||||
NHFILE *nhfp;
|
||||
@@ -1415,7 +1415,7 @@ u_collide_m(struct monst *mtmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
familiar_level_msg(void)
|
||||
{
|
||||
static const char *const fam_msgs[4] = {
|
||||
@@ -1969,7 +1969,7 @@ hellish_smoke_mesg(void)
|
||||
}
|
||||
|
||||
/* give a message when the level temperature is different from previous */
|
||||
static void
|
||||
staticfn void
|
||||
temperature_change_msg(schar prev_temperature)
|
||||
{
|
||||
if (prev_temperature != gl.level.flags.temperature) {
|
||||
@@ -1995,7 +1995,7 @@ maybe_lvltport_feedback(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
final_level(void)
|
||||
{
|
||||
/* reset monster hostility relative to player */
|
||||
@@ -2266,7 +2266,7 @@ zombify_mon(anything *arg, long timeout)
|
||||
}
|
||||
|
||||
/* return TRUE if hero properties are dangerous to hero */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
danger_uprops(void)
|
||||
{
|
||||
return (Stoned || Slimed || Strangled || Sick);
|
||||
@@ -2308,7 +2308,7 @@ donull(void)
|
||||
return ECMD_TIME; /* Do nothing, but let other things happen */
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
wipeoff(void)
|
||||
{
|
||||
unsigned udelta = u.ucreamed;
|
||||
|
||||
+16
-15
@@ -5,18 +5,18 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static char *nextmbuf(void);
|
||||
static char *name_from_player(char *, const char *, const char *);
|
||||
static void do_mgivenname(void);
|
||||
static boolean alreadynamed(struct monst *, char *, char *) NONNULLPTRS;
|
||||
static void do_oname(struct obj *) NONNULLARG1;
|
||||
static char *docall_xname(struct obj *) NONNULLARG1;
|
||||
static void namefloorobj(void);
|
||||
staticfn char *nextmbuf(void);
|
||||
staticfn char *name_from_player(char *, const char *, const char *);
|
||||
staticfn void do_mgivenname(void);
|
||||
staticfn boolean alreadynamed(struct monst *, char *, char *) NONNULLPTRS;
|
||||
staticfn void do_oname(struct obj *) NONNULLARG1;
|
||||
staticfn char *docall_xname(struct obj *) NONNULLARG1;
|
||||
staticfn void namefloorobj(void);
|
||||
|
||||
#define NUMMBUF 5
|
||||
|
||||
/* manage a pool of BUFSZ buffers, so callers don't have to */
|
||||
static char *
|
||||
staticfn char *
|
||||
nextmbuf(void)
|
||||
{
|
||||
static char NEARDATA bufs[NUMMBUF][BUFSZ];
|
||||
@@ -101,7 +101,7 @@ safe_oname(struct obj *obj)
|
||||
|
||||
/* get a name for a monster or an object from player;
|
||||
truncate if longer than PL_PSIZ, then return it */
|
||||
static char *
|
||||
staticfn char *
|
||||
name_from_player(
|
||||
char *outbuf, /* output buffer, assumed to be at least BUFSZ long;
|
||||
* anything longer than PL_PSIZ will be truncated */
|
||||
@@ -154,7 +154,7 @@ christen_monst(struct monst *mtmp, const char *name)
|
||||
/* check whether user-supplied name matches or nearly matches an unnameable
|
||||
monster's name, or is an attempt to delete the monster's name; if so, give
|
||||
alternate reject message for do_mgivenname() */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
alreadynamed(struct monst *mtmp, char *monnambuf, char *usrbuf)
|
||||
{
|
||||
char pronounbuf[10], *p;
|
||||
@@ -195,7 +195,7 @@ alreadynamed(struct monst *mtmp, char *monnambuf, char *usrbuf)
|
||||
}
|
||||
|
||||
/* allow player to assign a name to some chosen monster */
|
||||
static void
|
||||
staticfn void
|
||||
do_mgivenname(void)
|
||||
{
|
||||
char buf[BUFSZ], monnambuf[BUFSZ], qbuf[QBUFSZ];
|
||||
@@ -286,7 +286,7 @@ do_mgivenname(void)
|
||||
* used with extreme care. Applying a name to an object no longer
|
||||
* allocates a replacement object, so that old risk is gone.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
do_oname(struct obj *obj)
|
||||
{
|
||||
char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ];
|
||||
@@ -600,7 +600,7 @@ docallcmd(void)
|
||||
}
|
||||
|
||||
/* for use by safe_qbuf() */
|
||||
static char *
|
||||
staticfn char *
|
||||
docall_xname(struct obj *obj)
|
||||
{
|
||||
struct obj otemp;
|
||||
@@ -672,7 +672,7 @@ docall(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
namefloorobj(void)
|
||||
{
|
||||
coord cc;
|
||||
@@ -1318,7 +1318,8 @@ obj_pmname(struct obj *obj)
|
||||
|
||||
/* used by bogusmon(next) and also by init_CapMons(rumors.c);
|
||||
bogon_is_pname(below) checks a hard-coded subset of these rather than
|
||||
use this list */
|
||||
use this list.
|
||||
Also used in rumors.c */
|
||||
const char bogon_codes[] = "-_+|="; /* see dat/bonusmon.txt */
|
||||
|
||||
/* fake monsters used to be in a hard-coded array, now in a data file */
|
||||
|
||||
+58
-58
@@ -20,37 +20,37 @@ static NEARDATA const long takeoff_order[] = {
|
||||
WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L
|
||||
};
|
||||
|
||||
static void on_msg(struct obj *);
|
||||
static void toggle_stealth(struct obj *, long, boolean);
|
||||
static int Armor_on(void);
|
||||
staticfn void on_msg(struct obj *);
|
||||
staticfn void toggle_stealth(struct obj *, long, boolean);
|
||||
staticfn int Armor_on(void);
|
||||
/* int Boots_on(void); -- moved to extern.h */
|
||||
static int Cloak_on(void);
|
||||
static int Helmet_on(void);
|
||||
static int Gloves_on(void);
|
||||
static int Shield_on(void);
|
||||
static int Shirt_on(void);
|
||||
static void dragon_armor_handling(struct obj *, boolean, boolean);
|
||||
static void Amulet_on(void);
|
||||
static void learnring(struct obj *, boolean);
|
||||
static void adjust_attrib(struct obj *, int, int);
|
||||
static void Ring_off_or_gone(struct obj *, boolean);
|
||||
static int select_off(struct obj *);
|
||||
static struct obj *do_takeoff(void);
|
||||
static int take_off(void);
|
||||
static int menu_remarm(int);
|
||||
static void wornarm_destroyed(struct obj *);
|
||||
static void count_worn_stuff(struct obj **, boolean);
|
||||
static int armor_or_accessory_off(struct obj *);
|
||||
static int accessory_or_armor_on(struct obj *);
|
||||
static void already_wearing(const char *);
|
||||
static void already_wearing2(const char *, const char *);
|
||||
static int equip_ok(struct obj *, boolean, boolean);
|
||||
static int puton_ok(struct obj *);
|
||||
static int remove_ok(struct obj *);
|
||||
static int wear_ok(struct obj *);
|
||||
static int takeoff_ok(struct obj *);
|
||||
staticfn int Cloak_on(void);
|
||||
staticfn int Helmet_on(void);
|
||||
staticfn int Gloves_on(void);
|
||||
staticfn int Shield_on(void);
|
||||
staticfn int Shirt_on(void);
|
||||
staticfn void dragon_armor_handling(struct obj *, boolean, boolean);
|
||||
staticfn void Amulet_on(void);
|
||||
staticfn void learnring(struct obj *, boolean);
|
||||
staticfn void adjust_attrib(struct obj *, int, int);
|
||||
staticfn void Ring_off_or_gone(struct obj *, boolean);
|
||||
staticfn int select_off(struct obj *);
|
||||
staticfn struct obj *do_takeoff(void);
|
||||
staticfn int take_off(void);
|
||||
staticfn int menu_remarm(int);
|
||||
staticfn void wornarm_destroyed(struct obj *);
|
||||
staticfn void count_worn_stuff(struct obj **, boolean);
|
||||
staticfn int armor_or_accessory_off(struct obj *);
|
||||
staticfn int accessory_or_armor_on(struct obj *);
|
||||
staticfn void already_wearing(const char *);
|
||||
staticfn void already_wearing2(const char *, const char *);
|
||||
staticfn int equip_ok(struct obj *, boolean, boolean);
|
||||
staticfn int puton_ok(struct obj *);
|
||||
staticfn int remove_ok(struct obj *);
|
||||
staticfn int wear_ok(struct obj *);
|
||||
staticfn int takeoff_ok(struct obj *);
|
||||
/* maybe_destroy_armor() may return NULL */
|
||||
static struct obj *maybe_destroy_armor(struct obj *, struct obj *,
|
||||
staticfn struct obj *maybe_destroy_armor(struct obj *, struct obj *,
|
||||
boolean *) NONNULLARG3;
|
||||
|
||||
/* plural "fingers" or optionally "gloves" */
|
||||
@@ -70,7 +70,7 @@ off_msg(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* for items that involve no delay */
|
||||
static void
|
||||
staticfn void
|
||||
on_msg(struct obj *otmp)
|
||||
{
|
||||
if (flags.verbose) {
|
||||
@@ -91,7 +91,7 @@ on_msg(struct obj *otmp)
|
||||
give feedback and discover it iff stealth state is changing;
|
||||
stealth is blocked by riding unless hero+steed fly (handled with
|
||||
BStealth by mount and dismount routines) */
|
||||
static
|
||||
staticfn
|
||||
void
|
||||
toggle_stealth(
|
||||
struct obj *obj,
|
||||
@@ -297,7 +297,7 @@ Boots_off(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Cloak_on(void)
|
||||
{
|
||||
long oldprop =
|
||||
@@ -405,7 +405,7 @@ Cloak_off(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Helmet_on(void)
|
||||
{
|
||||
switch (uarmh->otyp) {
|
||||
@@ -540,7 +540,7 @@ hard_helmet(struct obj *obj)
|
||||
return (is_metallic(obj) || is_crackable(obj)) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Gloves_on(void)
|
||||
{
|
||||
long oldprop =
|
||||
@@ -669,7 +669,7 @@ Gloves_off(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Shield_on(void)
|
||||
{
|
||||
/* no shield currently requires special handling when put on, but we
|
||||
@@ -719,7 +719,7 @@ Shield_off(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Shirt_on(void)
|
||||
{
|
||||
/* no shirt currently requires special handling when put on, but we
|
||||
@@ -758,7 +758,7 @@ Shirt_off(void)
|
||||
}
|
||||
|
||||
/* handle extra abilities for hero wearing dragon scale armor */
|
||||
static void
|
||||
staticfn void
|
||||
dragon_armor_handling(
|
||||
struct obj *otmp, /* armor being put on or taken off */
|
||||
boolean puton, /* True: on, False: off */
|
||||
@@ -847,7 +847,7 @@ dragon_armor_handling(
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
Armor_on(void)
|
||||
{
|
||||
if (!uarm) /* no known instances of !uarm here but play it safe */
|
||||
@@ -923,7 +923,7 @@ Armor_gone(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
Amulet_on(void)
|
||||
{
|
||||
/* make sure amulet isn't wielded; can't use remove_worn_item()
|
||||
@@ -1094,7 +1094,7 @@ Amulet_off(void)
|
||||
}
|
||||
|
||||
/* handle ring discovery; comparable to learnwand() */
|
||||
static void
|
||||
staticfn void
|
||||
learnring(struct obj *ring, boolean observed)
|
||||
{
|
||||
int ringtype = ring->otyp;
|
||||
@@ -1124,7 +1124,7 @@ learnring(struct obj *ring, boolean observed)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
adjust_attrib(struct obj *obj, int which, int val)
|
||||
{
|
||||
int old_attrib;
|
||||
@@ -1246,7 +1246,7 @@ Ring_on(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
Ring_off_or_gone(struct obj *obj, boolean gone)
|
||||
{
|
||||
long mask = (obj->owornmask & W_RING);
|
||||
@@ -1632,7 +1632,7 @@ stop_donning(struct obj *stolenobj) /* no message if stolenobj is already
|
||||
static NEARDATA int Narmorpieces, Naccessories;
|
||||
|
||||
/* assign values to Narmorpieces and Naccessories */
|
||||
static void
|
||||
staticfn void
|
||||
count_worn_stuff(struct obj **which, /* caller wants this when count is 1 */
|
||||
boolean accessorizing)
|
||||
{
|
||||
@@ -1669,7 +1669,7 @@ count_worn_stuff(struct obj **which, /* caller wants this when count is 1 */
|
||||
|
||||
/* take off one piece or armor or one accessory;
|
||||
shared by dotakeoff('T') and doremring('R') */
|
||||
static int
|
||||
staticfn int
|
||||
armor_or_accessory_off(struct obj *obj)
|
||||
{
|
||||
if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) {
|
||||
@@ -1893,13 +1893,13 @@ armoroff(struct obj *otmp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
already_wearing(const char *cc)
|
||||
{
|
||||
You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
already_wearing2(const char *cc1, const char *cc2)
|
||||
{
|
||||
You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
|
||||
@@ -2091,7 +2091,7 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
|
||||
return !err;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
accessory_or_armor_on(struct obj *obj)
|
||||
{
|
||||
long mask = 0L;
|
||||
@@ -2575,7 +2575,7 @@ unchanger(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
staticfn
|
||||
int
|
||||
select_off(struct obj *otmp)
|
||||
{
|
||||
@@ -2702,7 +2702,7 @@ select_off(struct obj *otmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
do_takeoff(void)
|
||||
{
|
||||
struct obj *otmp = (struct obj *) 0;
|
||||
@@ -2778,7 +2778,7 @@ do_takeoff(void)
|
||||
}
|
||||
|
||||
/* occupation callback for 'A' */
|
||||
static int
|
||||
staticfn int
|
||||
take_off(void)
|
||||
{
|
||||
int i;
|
||||
@@ -2945,7 +2945,7 @@ remarm_swapwep(void)
|
||||
return (!uswapwep || uswapwep->bknown != oldbknown) ? ECMD_TIME : ECMD_OK;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
menu_remarm(int retry)
|
||||
{
|
||||
int n, i = 0;
|
||||
@@ -2999,7 +2999,7 @@ menu_remarm(int retry)
|
||||
/* take off the specific worn object and if it still exists after that,
|
||||
destroy it (taking off the item might already destroy it by dunking
|
||||
hero into lava) */
|
||||
static void
|
||||
staticfn void
|
||||
wornarm_destroyed(struct obj *wornarm)
|
||||
{
|
||||
struct obj *invobj;
|
||||
@@ -3042,7 +3042,7 @@ wornarm_destroyed(struct obj *wornarm)
|
||||
* returns impacted armor with its in_use bit set,
|
||||
* or Null. *resisted is updated to reflect whether
|
||||
* it resisted or not */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
maybe_destroy_armor(struct obj *armor, struct obj *atmp, boolean *resisted)
|
||||
{
|
||||
if ((armor != 0) && (!atmp || atmp == armor)
|
||||
@@ -3195,7 +3195,7 @@ inaccessible_equipment(struct obj *obj,
|
||||
}
|
||||
|
||||
/* not a getobj callback - unifies code among the other 4 getobj callbacks */
|
||||
static int
|
||||
staticfn int
|
||||
equip_ok(struct obj *obj, boolean removing, boolean accessory)
|
||||
{
|
||||
boolean is_worn;
|
||||
@@ -3240,28 +3240,28 @@ equip_ok(struct obj *obj, boolean removing, boolean accessory)
|
||||
}
|
||||
|
||||
/* getobj callback for P command */
|
||||
static int
|
||||
staticfn int
|
||||
puton_ok(struct obj *obj)
|
||||
{
|
||||
return equip_ok(obj, FALSE, TRUE);
|
||||
}
|
||||
|
||||
/* getobj callback for R command */
|
||||
static int
|
||||
staticfn int
|
||||
remove_ok(struct obj *obj)
|
||||
{
|
||||
return equip_ok(obj, TRUE, TRUE);
|
||||
}
|
||||
|
||||
/* getobj callback for W command */
|
||||
static int
|
||||
staticfn int
|
||||
wear_ok(struct obj *obj)
|
||||
{
|
||||
return equip_ok(obj, FALSE, FALSE);
|
||||
}
|
||||
|
||||
/* getobj callback for T command */
|
||||
static int
|
||||
staticfn int
|
||||
takeoff_ok(struct obj *obj)
|
||||
{
|
||||
return equip_ok(obj, TRUE, FALSE);
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int pet_type(void);
|
||||
static struct permonst * pick_familiar_pm(struct obj *, boolean);
|
||||
static void set_mon_lastmove(struct monst *);
|
||||
static int mon_leave(struct monst *) NONNULLARG1;
|
||||
static boolean keep_mon_accessible(struct monst *);
|
||||
staticfn int pet_type(void);
|
||||
staticfn struct permonst * pick_familiar_pm(struct obj *, boolean);
|
||||
staticfn void set_mon_lastmove(struct monst *);
|
||||
staticfn int mon_leave(struct monst *) NONNULLARG1;
|
||||
staticfn boolean keep_mon_accessible(struct monst *);
|
||||
|
||||
enum arrival {
|
||||
Before_you = 0, /* monsters kept on migrating_mons for accessibility;
|
||||
@@ -63,7 +63,7 @@ initedog(struct monst *mtmp)
|
||||
u.uconduct.pets++;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
pet_type(void)
|
||||
{
|
||||
if (gu.urole.petnum != NON_PM)
|
||||
@@ -76,7 +76,7 @@ pet_type(void)
|
||||
return rn2(2) ? PM_KITTEN : PM_LITTLE_DOG;
|
||||
}
|
||||
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
pick_familiar_pm(struct obj *otmp, boolean quietly)
|
||||
{
|
||||
struct permonst *pm = (struct permonst *) 0;
|
||||
@@ -235,7 +235,7 @@ makedog(void)
|
||||
return mtmp;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
set_mon_lastmove(struct monst *mtmp)
|
||||
{
|
||||
mtmp->mlstmv = gm.moves;
|
||||
@@ -667,7 +667,7 @@ mon_catchup_elapsed_time(
|
||||
|
||||
/* bookkeeping when mtmp is about to leave the current level;
|
||||
common to keepdogs() and migrate_to_level() */
|
||||
static int
|
||||
staticfn int
|
||||
mon_leave(struct monst *mtmp)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -706,7 +706,7 @@ mon_leave(struct monst *mtmp)
|
||||
|
||||
/* when hero leaves a level, some monsters should be placed on the
|
||||
migrating_mons list instead of being stashed inside the level's file */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
keep_mon_accessible(struct monst *mon)
|
||||
{
|
||||
/* the Wizard is kept accessible so that his harassment can fetch
|
||||
|
||||
+20
-20
@@ -11,15 +11,15 @@
|
||||
#define DOG_WEAK 500
|
||||
#define DOG_STARVE 750
|
||||
|
||||
static void dog_starve(struct monst *);
|
||||
static boolean dog_hunger(struct monst *, struct edog *);
|
||||
static int dog_invent(struct monst *, struct edog *, int);
|
||||
static int dog_goal(struct monst *, struct edog *, int, int, int);
|
||||
static struct monst *find_targ(struct monst *, int, int, int);
|
||||
static int find_friends(struct monst *, struct monst *, int);
|
||||
static struct monst *best_target(struct monst *);
|
||||
static long score_targ(struct monst *, struct monst *);
|
||||
static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
|
||||
staticfn void dog_starve(struct monst *);
|
||||
staticfn boolean dog_hunger(struct monst *, struct edog *);
|
||||
staticfn int dog_invent(struct monst *, struct edog *, int);
|
||||
staticfn int dog_goal(struct monst *, struct edog *, int, int, int);
|
||||
staticfn struct monst *find_targ(struct monst *, int, int, int);
|
||||
staticfn int find_friends(struct monst *, struct monst *, int);
|
||||
staticfn struct monst *best_target(struct monst *);
|
||||
staticfn long score_targ(struct monst *, struct monst *);
|
||||
staticfn boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
|
||||
coordxy) NONNULLARG1;
|
||||
|
||||
/* pick a carried item for pet to drop */
|
||||
@@ -135,7 +135,7 @@ static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS,
|
||||
0 };
|
||||
|
||||
|
||||
static void wantdoor(coordxy, coordxy, genericptr_t);
|
||||
staticfn void wantdoor(coordxy, coordxy, genericptr_t);
|
||||
|
||||
boolean
|
||||
cursed_object_at(coordxy x, coordxy y)
|
||||
@@ -325,7 +325,7 @@ dog_eat(struct monst *mtmp,
|
||||
return (DEADMONSTER(mtmp)) ? 2 : 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dog_starve(struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->mleashed && mtmp != u.usteed)
|
||||
@@ -339,7 +339,7 @@ dog_starve(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* hunger effects -- returns TRUE on starvation */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
dog_hunger(struct monst *mtmp, struct edog *edog)
|
||||
{
|
||||
if (gm.moves > edog->hungrytime + DOG_WEAK) {
|
||||
@@ -377,7 +377,7 @@ dog_hunger(struct monst *mtmp, struct edog *edog)
|
||||
/* do something with object (drop, pick up, eat) at current position
|
||||
* returns 1 if object eaten (since that counts as dog's move), 2 if died
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
dog_invent(struct monst *mtmp, struct edog *edog, int udist)
|
||||
{
|
||||
coordxy omx, omy;
|
||||
@@ -459,7 +459,7 @@ dog_invent(struct monst *mtmp, struct edog *edog, int udist)
|
||||
|
||||
/* set dog's goal -- gtyp, gx, gy;
|
||||
returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */
|
||||
static int
|
||||
staticfn int
|
||||
dog_goal(
|
||||
struct monst *mtmp,
|
||||
struct edog *edog,
|
||||
@@ -626,7 +626,7 @@ dog_goal(
|
||||
#undef FARAWAY
|
||||
}
|
||||
|
||||
static struct monst *
|
||||
staticfn struct monst *
|
||||
find_targ(
|
||||
struct monst *mtmp,
|
||||
int dx, int dy,
|
||||
@@ -670,7 +670,7 @@ find_targ(
|
||||
return targ;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
find_friends(struct monst *mtmp, struct monst *mtarg, int maxdist)
|
||||
{
|
||||
struct monst *pal;
|
||||
@@ -714,7 +714,7 @@ find_friends(struct monst *mtmp, struct monst *mtarg, int maxdist)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long
|
||||
staticfn long
|
||||
score_targ(struct monst *mtmp, struct monst *mtarg)
|
||||
{
|
||||
long score = 0L;
|
||||
@@ -814,7 +814,7 @@ score_targ(struct monst *mtmp, struct monst *mtarg)
|
||||
return score;
|
||||
}
|
||||
|
||||
static struct monst *
|
||||
staticfn struct monst *
|
||||
best_target(struct monst *mtmp) /* Pet */
|
||||
{
|
||||
int dx, dy;
|
||||
@@ -1331,7 +1331,7 @@ could_reach_item(struct monst *mon, coordxy nx, coordxy ny)
|
||||
* Since the maximum food distance is 5, this should never be more than 5
|
||||
* calls deep.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordxy fy)
|
||||
{
|
||||
int i, j;
|
||||
@@ -1367,7 +1367,7 @@ can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordx
|
||||
}
|
||||
|
||||
/* do_clear_area client */
|
||||
static void
|
||||
staticfn void
|
||||
wantdoor(coordxy x, coordxy y, genericptr_t distance)
|
||||
{
|
||||
int ndist, *dist_ptr = (int *) distance;
|
||||
|
||||
+28
-28
@@ -11,26 +11,26 @@
|
||||
|
||||
/* gk.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
|
||||
|
||||
static void kickdmg(struct monst *, boolean);
|
||||
static boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
|
||||
static void kick_monster(struct monst *, coordxy, coordxy);
|
||||
static int kick_object(coordxy, coordxy, char *) NONNULLARG3;
|
||||
static int really_kick_object(coordxy, coordxy);
|
||||
static char *kickstr(char *, const char *) NONNULLPTRS;
|
||||
static boolean watchman_thief_arrest(struct monst *) NONNULLPTRS;
|
||||
static boolean watchman_door_damage(struct monst *,
|
||||
staticfn void kickdmg(struct monst *, boolean);
|
||||
staticfn boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
|
||||
staticfn void kick_monster(struct monst *, coordxy, coordxy);
|
||||
staticfn int kick_object(coordxy, coordxy, char *) NONNULLARG3;
|
||||
staticfn int really_kick_object(coordxy, coordxy);
|
||||
staticfn char *kickstr(char *, const char *) NONNULLPTRS;
|
||||
staticfn boolean watchman_thief_arrest(struct monst *) NONNULLPTRS;
|
||||
staticfn boolean watchman_door_damage(struct monst *,
|
||||
coordxy, coordxy) NONNULLARG1;
|
||||
static void kick_dumb(coordxy, coordxy);
|
||||
static void kick_ouch(coordxy, coordxy, const char *) NONNULLARG3;
|
||||
static void kick_door(coordxy, coordxy, int);
|
||||
static int kick_nondoor(coordxy, coordxy, int);
|
||||
static void otransit_msg(struct obj *, boolean, boolean, long);
|
||||
static void drop_to(coord *, schar, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn void kick_dumb(coordxy, coordxy);
|
||||
staticfn void kick_ouch(coordxy, coordxy, const char *) NONNULLARG3;
|
||||
staticfn void kick_door(coordxy, coordxy, int);
|
||||
staticfn int kick_nondoor(coordxy, coordxy, int);
|
||||
staticfn void otransit_msg(struct obj *, boolean, boolean, long);
|
||||
staticfn void drop_to(coord *, schar, coordxy, coordxy) NONNULLARG1;
|
||||
|
||||
static const char kick_passes_thru[] = "kick passes harmlessly through";
|
||||
|
||||
/* kicking damage when not poly'd into a form with a kick attack */
|
||||
static void
|
||||
staticfn void
|
||||
kickdmg(struct monst *mon, boolean clumsy)
|
||||
{
|
||||
int mdx, mdy;
|
||||
@@ -122,7 +122,7 @@ kickdmg(struct monst *mon, boolean clumsy)
|
||||
use_skill(kick_skill, 1);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
maybe_kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
{
|
||||
if (mon) {
|
||||
@@ -142,7 +142,7 @@ maybe_kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
return (boolean) (mon != 0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
{
|
||||
boolean clumsy = FALSE;
|
||||
@@ -480,7 +480,7 @@ container_impact_dmg(
|
||||
}
|
||||
|
||||
/* jacket around really_kick_object */
|
||||
static int
|
||||
staticfn int
|
||||
kick_object(coordxy x, coordxy y, char *kickobjnam)
|
||||
{
|
||||
int res = 0;
|
||||
@@ -498,7 +498,7 @@ kick_object(coordxy x, coordxy y, char *kickobjnam)
|
||||
}
|
||||
|
||||
/* guts of kick_object */
|
||||
static int
|
||||
staticfn int
|
||||
really_kick_object(coordxy x, coordxy y)
|
||||
{
|
||||
int range;
|
||||
@@ -783,7 +783,7 @@ really_kick_object(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* cause of death if kicking kills kicker */
|
||||
static char *
|
||||
staticfn char *
|
||||
kickstr(char *buf, const char *kickobjnam)
|
||||
{
|
||||
const char *what;
|
||||
@@ -823,7 +823,7 @@ kickstr(char *buf, const char *kickobjnam)
|
||||
return strcat(strcpy(buf, "kicking "), what);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
watchman_thief_arrest(struct monst *mtmp)
|
||||
{
|
||||
if (is_watch(mtmp->data) && couldsee(mtmp->mx, mtmp->my)
|
||||
@@ -835,7 +835,7 @@ watchman_thief_arrest(struct monst *mtmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
watchman_door_damage(struct monst *mtmp, coordxy x, coordxy y)
|
||||
{
|
||||
if (is_watch(mtmp->data) && mtmp->mpeaceful
|
||||
@@ -853,7 +853,7 @@ watchman_door_damage(struct monst *mtmp, coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
kick_dumb(coordxy x, coordxy y)
|
||||
{
|
||||
exercise(A_DEX, FALSE);
|
||||
@@ -870,7 +870,7 @@ kick_dumb(coordxy x, coordxy y)
|
||||
hurtle(-u.dx, -u.dy, 1, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
|
||||
{
|
||||
int dmg;
|
||||
@@ -899,7 +899,7 @@ kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
|
||||
}
|
||||
|
||||
/* kick a door */
|
||||
static void
|
||||
staticfn void
|
||||
kick_door(coordxy x, coordxy y, int avrg_attrib)
|
||||
{
|
||||
if (gm.maploc->doormask == D_ISOPEN || gm.maploc->doormask == D_BROKEN
|
||||
@@ -958,7 +958,7 @@ kick_door(coordxy x, coordxy y, int avrg_attrib)
|
||||
}
|
||||
|
||||
/* kick non-door terrain */
|
||||
static int
|
||||
staticfn int
|
||||
kick_nondoor(coordxy x, coordxy y, int avrg_attrib)
|
||||
{
|
||||
if (gm.maploc->typ == SDOOR) {
|
||||
@@ -1455,7 +1455,7 @@ dokick(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
drop_to(coord *cc, schar loc, coordxy x, coordxy y)
|
||||
{
|
||||
stairway *stway = stairway_at(x, y);
|
||||
@@ -1889,7 +1889,7 @@ deliver_obj_to_mon(struct monst *mtmp, int cnt, unsigned long deliverflags)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
otransit_msg(struct obj *otmp, boolean nodrop, boolean chainthere, long num)
|
||||
{
|
||||
char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ];
|
||||
|
||||
+28
-28
@@ -7,21 +7,21 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int throw_obj(struct obj *, int);
|
||||
static boolean ok_to_throw(int *);
|
||||
static int throw_ok(struct obj *);
|
||||
static void autoquiver(void);
|
||||
static struct obj *find_launcher(struct obj *);
|
||||
static int gem_accept(struct monst *, struct obj *);
|
||||
static boolean toss_up(struct obj *, boolean) NONNULLARG1;
|
||||
static void sho_obj_return_to_u(struct obj * obj);
|
||||
static struct obj *return_throw_to_inv(struct obj *, long, boolean,
|
||||
staticfn int throw_obj(struct obj *, int);
|
||||
staticfn boolean ok_to_throw(int *);
|
||||
staticfn int throw_ok(struct obj *);
|
||||
staticfn void autoquiver(void);
|
||||
staticfn struct obj *find_launcher(struct obj *);
|
||||
staticfn int gem_accept(struct monst *, struct obj *);
|
||||
staticfn boolean toss_up(struct obj *, boolean) NONNULLARG1;
|
||||
staticfn void sho_obj_return_to_u(struct obj * obj);
|
||||
staticfn struct obj *return_throw_to_inv(struct obj *, long, boolean,
|
||||
struct obj *);
|
||||
static void tmiss(struct obj *, struct monst *, boolean);
|
||||
static int throw_gold(struct obj *);
|
||||
static void check_shop_obj(struct obj *, coordxy, coordxy, boolean);
|
||||
static void breakmsg(struct obj *, boolean);
|
||||
static boolean mhurtle_step(genericptr_t, coordxy, coordxy);
|
||||
staticfn void tmiss(struct obj *, struct monst *, boolean);
|
||||
staticfn int throw_gold(struct obj *);
|
||||
staticfn void check_shop_obj(struct obj *, coordxy, coordxy, boolean);
|
||||
staticfn void breakmsg(struct obj *, boolean);
|
||||
staticfn boolean mhurtle_step(genericptr_t, coordxy, coordxy);
|
||||
|
||||
/* uwep might already be removed from inventory so test for W_WEP instead;
|
||||
for Valk+Mjollnir, caller needs to validate the strength requirement */
|
||||
@@ -80,7 +80,7 @@ multishot_class_bonus(
|
||||
}
|
||||
|
||||
/* Throw the selected object, asking for direction */
|
||||
static int
|
||||
staticfn int
|
||||
throw_obj(struct obj *obj, int shotlimit)
|
||||
{
|
||||
struct obj *otmp, *oldslot;
|
||||
@@ -287,7 +287,7 @@ throw_obj(struct obj *obj, int shotlimit)
|
||||
}
|
||||
|
||||
/* common to dothrow() and dofire() */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
ok_to_throw(int *shotlimit_p) /* (see dothrow()) */
|
||||
{
|
||||
*shotlimit_p = LIMIT_TO_RANGE_INT(0, LARGEST_INT, gc.command_count);
|
||||
@@ -307,7 +307,7 @@ ok_to_throw(int *shotlimit_p) /* (see dothrow()) */
|
||||
}
|
||||
|
||||
/* getobj callback for object to be thrown */
|
||||
static int
|
||||
staticfn int
|
||||
throw_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -371,7 +371,7 @@ dothrow(void)
|
||||
|
||||
/* KMH -- Automatically fill quiver */
|
||||
/* Suggested by Jeffrey Bay <jbay@convex.hp.com> */
|
||||
static void
|
||||
staticfn void
|
||||
autoquiver(void)
|
||||
{
|
||||
struct obj *otmp, *oammo = 0, *omissile = 0, *omisc = 0, *altammo = 0;
|
||||
@@ -437,7 +437,7 @@ autoquiver(void)
|
||||
|
||||
/* look through hero inventory for launcher matching ammo,
|
||||
avoiding known cursed items. Returns NULL if no match. */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
find_launcher(struct obj *ammo)
|
||||
{
|
||||
struct obj *otmp, *oX;
|
||||
@@ -992,7 +992,7 @@ will_hurtle(struct monst *mon, coordxy x, coordxy y)
|
||||
return goodpos(x, y, mon, MM_IGNOREWATER | MM_IGNORELAVA);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
|
||||
{
|
||||
struct monst *mon = (struct monst *) arg;
|
||||
@@ -1180,7 +1180,7 @@ mhurtle(struct monst *mon, int dx, int dy, int range)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
check_shop_obj(struct obj *obj, coordxy x, coordxy y, boolean broken)
|
||||
{
|
||||
boolean costly_xy;
|
||||
@@ -1255,7 +1255,7 @@ harmless_missile(struct obj *obj)
|
||||
*
|
||||
* Returns FALSE if the object is gone.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
toss_up(struct obj *obj, boolean hitsroof)
|
||||
{
|
||||
const char *action;
|
||||
@@ -1432,7 +1432,7 @@ throwing_weapon(struct obj *obj)
|
||||
}
|
||||
|
||||
/* the currently thrown object is returning to you (not for boomerangs) */
|
||||
static void
|
||||
staticfn void
|
||||
sho_obj_return_to_u(struct obj *obj)
|
||||
{
|
||||
/* might already be our location (bounced off a wall) */
|
||||
@@ -1807,7 +1807,7 @@ throwit(struct obj *obj,
|
||||
/* handle a throw-and-return missile coming back into inventory; makes sure
|
||||
that if it was wielded, it will be re-wielded; if it was split off of a
|
||||
stack (boomerang), don't let it merge with a different compatible stack */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
return_throw_to_inv(
|
||||
struct obj *obj, /* object to add to invent */
|
||||
long wep_mask, /* its owornmask before it was removed from invent */
|
||||
@@ -1903,7 +1903,7 @@ omon_adj(struct monst *mon, struct obj *obj, boolean mon_notices)
|
||||
}
|
||||
|
||||
/* thrown object misses target monster */
|
||||
static void
|
||||
staticfn void
|
||||
tmiss(struct obj *obj, struct monst *mon, boolean maybe_wakeup)
|
||||
{
|
||||
const char *missile = mshot_xname(obj);
|
||||
@@ -2259,7 +2259,7 @@ thitmonst(
|
||||
|
||||
#undef special_obj_hits_leader
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
gem_accept(struct monst *mon, struct obj *obj)
|
||||
{
|
||||
static NEARDATA const char
|
||||
@@ -2557,7 +2557,7 @@ breaktest(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
breakmsg(struct obj *obj, boolean in_view)
|
||||
{
|
||||
const char *to_pieces;
|
||||
@@ -2599,7 +2599,7 @@ breakmsg(struct obj *obj, boolean in_view)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
throw_gold(struct obj *obj)
|
||||
{
|
||||
int range, odx, ody;
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
#include "wintype.h"
|
||||
#include "sym.h"
|
||||
|
||||
extern const struct symparse loadsyms[];
|
||||
extern const struct class_sym def_oc_syms[MAXOCLASSES];
|
||||
extern const struct class_sym def_monsyms[MAXMCLASSES];
|
||||
extern const uchar def_r_oc_syms[MAXOCLASSES];
|
||||
|
||||
/* Relevant header information in rm.h, objclass.h, sym.h, defsym.h. */
|
||||
|
||||
/* Default object class symbols. See objclass.h.
|
||||
|
||||
+91
-90
@@ -33,55 +33,56 @@ struct lchoice {
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void Fread(genericptr_t, int, int, dlb *);
|
||||
staticfn void Fread(genericptr_t, int, int, dlb *);
|
||||
#endif
|
||||
static xint16 dname_to_dnum(const char *);
|
||||
static int find_branch(const char *, struct proto_dungeon *);
|
||||
static xint16 parent_dnum(const char *, struct proto_dungeon *);
|
||||
static int level_range(xint16, int, int, int, struct proto_dungeon *, int *);
|
||||
static xint16 parent_dlevel(const char *, struct proto_dungeon *);
|
||||
static int correct_branch_type(struct tmpbranch *);
|
||||
static branch *add_branch(int, int, struct proto_dungeon *);
|
||||
static void add_level(s_level *);
|
||||
static void init_level(int, int, struct proto_dungeon *);
|
||||
static int possible_places(int, boolean *, struct proto_dungeon *);
|
||||
static xint16 pick_level(boolean *, int);
|
||||
static boolean place_level(int, struct proto_dungeon *);
|
||||
static int get_dgn_flags(lua_State *);
|
||||
static int get_dgn_align(lua_State *);
|
||||
static void init_dungeon_levels(lua_State *, struct proto_dungeon *, int);
|
||||
static void init_dungeon_branches(lua_State *, struct proto_dungeon *, int);
|
||||
static void init_dungeon_set_entry(struct proto_dungeon *, int);
|
||||
static void init_dungeon_set_depth(struct proto_dungeon *, int);
|
||||
static void init_castle_tune(void);
|
||||
static void fixup_level_locations(void);
|
||||
static void free_proto_dungeon(struct proto_dungeon *);
|
||||
static boolean init_dungeon_dungeons(lua_State *, struct proto_dungeon *, int);
|
||||
static boolean unplaced_floater(struct dungeon *);
|
||||
static boolean unreachable_level(d_level *, boolean);
|
||||
static void tport_menu(winid, char *, struct lchoice *, d_level *, boolean);
|
||||
static const char *br_string(int);
|
||||
static char chr_u_on_lvl(d_level *);
|
||||
static void print_branch(winid, int, int, int, boolean, struct lchoice *);
|
||||
static char *get_annotation(d_level *);
|
||||
static void query_annotation(d_level *);
|
||||
static mapseen *load_mapseen(NHFILE *);
|
||||
static void save_mapseen(NHFILE *, mapseen *);
|
||||
static mapseen *find_mapseen(d_level *);
|
||||
static mapseen *find_mapseen_by_str(const char *);
|
||||
static void print_mapseen(winid, mapseen *, int, int, boolean);
|
||||
static boolean interest_mapseen(mapseen *);
|
||||
static void count_feat_lastseentyp(mapseen *, coordxy, coordxy);
|
||||
static void traverse_mapseenchn(int, winid, int, int, int *);
|
||||
static const char *seen_string(xint16, const char *);
|
||||
static const char *br_string2(branch *);
|
||||
static const char *shop_string(int);
|
||||
static char *tunesuffix(mapseen *, char *, size_t);
|
||||
staticfn xint16 dname_to_dnum(const char *);
|
||||
staticfn int find_branch(const char *, struct proto_dungeon *);
|
||||
staticfn xint16 parent_dnum(const char *, struct proto_dungeon *);
|
||||
staticfn int level_range(xint16, int, int, int, struct proto_dungeon *, int *);
|
||||
staticfn xint16 parent_dlevel(const char *, struct proto_dungeon *);
|
||||
staticfn int correct_branch_type(struct tmpbranch *);
|
||||
staticfn branch *add_branch(int, int, struct proto_dungeon *);
|
||||
staticfn void add_level(s_level *);
|
||||
staticfn void init_level(int, int, struct proto_dungeon *);
|
||||
staticfn int possible_places(int, boolean *, struct proto_dungeon *);
|
||||
staticfn xint16 pick_level(boolean *, int);
|
||||
staticfn boolean place_level(int, struct proto_dungeon *);
|
||||
staticfn int get_dgn_flags(lua_State *);
|
||||
staticfn int get_dgn_align(lua_State *);
|
||||
staticfn void init_dungeon_levels(lua_State *, struct proto_dungeon *, int);
|
||||
staticfn void init_dungeon_branches(lua_State *, struct proto_dungeon *, int);
|
||||
staticfn void init_dungeon_set_entry(struct proto_dungeon *, int);
|
||||
staticfn void init_dungeon_set_depth(struct proto_dungeon *, int);
|
||||
staticfn void init_castle_tune(void);
|
||||
staticfn void fixup_level_locations(void);
|
||||
staticfn void free_proto_dungeon(struct proto_dungeon *);
|
||||
staticfn boolean init_dungeon_dungeons(lua_State *, struct proto_dungeon *,
|
||||
int);
|
||||
staticfn boolean unplaced_floater(struct dungeon *);
|
||||
staticfn boolean unreachable_level(d_level *, boolean);
|
||||
staticfn void tport_menu(winid, char *, struct lchoice *, d_level *, boolean);
|
||||
staticfn const char *br_string(int);
|
||||
staticfn char chr_u_on_lvl(d_level *);
|
||||
staticfn void print_branch(winid, int, int, int, boolean, struct lchoice *);
|
||||
staticfn char *get_annotation(d_level *);
|
||||
staticfn void query_annotation(d_level *);
|
||||
staticfn mapseen *load_mapseen(NHFILE *);
|
||||
staticfn void save_mapseen(NHFILE *, mapseen *);
|
||||
staticfn mapseen *find_mapseen(d_level *);
|
||||
staticfn mapseen *find_mapseen_by_str(const char *);
|
||||
staticfn void print_mapseen(winid, mapseen *, int, int, boolean);
|
||||
staticfn boolean interest_mapseen(mapseen *);
|
||||
staticfn void count_feat_lastseentyp(mapseen *, coordxy, coordxy);
|
||||
staticfn void traverse_mapseenchn(int, winid, int, int, int *);
|
||||
staticfn const char *seen_string(xint16, const char *);
|
||||
staticfn const char *br_string2(branch *);
|
||||
staticfn const char *shop_string(int);
|
||||
staticfn char *tunesuffix(mapseen *, char *, size_t);
|
||||
|
||||
#ifdef DEBUG
|
||||
static void dumpit(void);
|
||||
staticfn void dumpit(void);
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dumpit(void)
|
||||
{
|
||||
#define DD gd.dungeons[i]
|
||||
@@ -265,7 +266,7 @@ restore_dungeon(NHFILE *nhfp)
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
staticfn void
|
||||
Fread(genericptr_t ptr, int size, int nitems, dlb *stream)
|
||||
{
|
||||
int cnt;
|
||||
@@ -281,7 +282,7 @@ Fread(genericptr_t ptr, int size, int nitems, dlb *stream)
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
static xint16
|
||||
staticfn xint16
|
||||
dname_to_dnum(const char *s)
|
||||
{
|
||||
xint16 i;
|
||||
@@ -308,7 +309,7 @@ find_level(const char *s)
|
||||
}
|
||||
|
||||
/* Find the branch that links the named dungeon. */
|
||||
static int
|
||||
staticfn int
|
||||
find_branch(
|
||||
const char *s, /* dungeon name */
|
||||
struct proto_dungeon *pd)
|
||||
@@ -343,7 +344,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
* Find the "parent" by searching the prototype branch list for the branch
|
||||
* listing, then figuring out to which dungeon it belongs.
|
||||
*/
|
||||
static xint16
|
||||
staticfn xint16
|
||||
parent_dnum(
|
||||
const char *s, /* dungeon name */
|
||||
struct proto_dungeon *pd)
|
||||
@@ -377,7 +378,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
* a negative random component means from the (adjusted) base to the
|
||||
* end of the dungeon.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
level_range(
|
||||
xint16 dgn,
|
||||
int base, int randc, int chain,
|
||||
@@ -412,7 +413,7 @@ level_range(
|
||||
return 1;
|
||||
}
|
||||
|
||||
static xint16
|
||||
staticfn xint16
|
||||
parent_dlevel(const char *s, struct proto_dungeon *pd)
|
||||
{
|
||||
int i, j, num, base, dnum = parent_dnum(s, pd);
|
||||
@@ -437,7 +438,7 @@ parent_dlevel(const char *s, struct proto_dungeon *pd)
|
||||
}
|
||||
|
||||
/* Convert from the temporary branch type to the dungeon branch type. */
|
||||
static int
|
||||
staticfn int
|
||||
correct_branch_type(struct tmpbranch *tbr)
|
||||
{
|
||||
switch (tbr->type) {
|
||||
@@ -511,7 +512,7 @@ insert_branch(branch *new_branch, boolean extract_first)
|
||||
#undef branch_val
|
||||
|
||||
/* Add a dungeon branch to the branch list. */
|
||||
static branch *
|
||||
staticfn branch *
|
||||
add_branch(
|
||||
int dgn, int child_entry_level,
|
||||
struct proto_dungeon *pd)
|
||||
@@ -542,7 +543,7 @@ add_branch(
|
||||
* level that has a dungeon number less than the dungeon number of the
|
||||
* last entry.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
add_level(s_level *new_lev)
|
||||
{
|
||||
s_level *prev, *curr;
|
||||
@@ -563,7 +564,7 @@ add_level(s_level *new_lev)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_level(int dgn, int proto_index, struct proto_dungeon *pd)
|
||||
{
|
||||
s_level *new_level;
|
||||
@@ -595,7 +596,7 @@ init_level(int dgn, int proto_index, struct proto_dungeon *pd)
|
||||
new_level->next = (s_level *) 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
possible_places(
|
||||
int idx, /* prototype index */
|
||||
boolean *map, /* array MAXLEVEL+1 in length */
|
||||
@@ -629,7 +630,7 @@ possible_places(
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* Pick the nth TRUE entry in the given boolean array. */
|
||||
static xint16
|
||||
staticfn xint16
|
||||
pick_level(
|
||||
boolean *map, /* an array MAXLEVEL+1 in size */
|
||||
int nth)
|
||||
@@ -646,9 +647,9 @@ pick_level(
|
||||
RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
#ifdef DDEBUG
|
||||
static void indent(int);
|
||||
staticfn void indent(int);
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
indent(int d)
|
||||
{
|
||||
while (d-- > 0)
|
||||
@@ -663,7 +664,7 @@ indent(int d)
|
||||
* all possible places have been tried. If all possible places have
|
||||
* been exhausted, return false.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
place_level(int proto_index, struct proto_dungeon *pd)
|
||||
{
|
||||
boolean map[MAXLEVEL + 1]; /* valid levels are 1..MAXLEVEL inclusive */
|
||||
@@ -741,7 +742,7 @@ static struct level_map {
|
||||
#undef X_LOCATE
|
||||
#undef X_GOAL
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
get_dgn_flags(lua_State *L)
|
||||
{
|
||||
int dgn_flags = 0;
|
||||
@@ -778,7 +779,7 @@ get_dgn_flags(lua_State *L)
|
||||
return dgn_flags;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
get_dgn_align(lua_State *L)
|
||||
{
|
||||
static const char *const dgnaligns[] = {
|
||||
@@ -794,7 +795,7 @@ get_dgn_align(lua_State *L)
|
||||
return a;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_dungeon_levels(
|
||||
lua_State *L,
|
||||
struct proto_dungeon *pd,
|
||||
@@ -864,7 +865,7 @@ init_dungeon_levels(
|
||||
panic("init_dungeon: too many special levels");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_dungeon_branches(
|
||||
lua_State *L,
|
||||
struct proto_dungeon *pd,
|
||||
@@ -930,7 +931,7 @@ init_dungeon_branches(
|
||||
panic("init_dungeon: too many branches");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_dungeon_set_entry(struct proto_dungeon *pd, int dngidx)
|
||||
{
|
||||
int dgn_entry = pd->tmpdungeon[dngidx].entry_lev;
|
||||
@@ -957,7 +958,7 @@ init_dungeon_set_entry(struct proto_dungeon *pd, int dngidx)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_dungeon_set_depth(struct proto_dungeon *pd, int dngidx)
|
||||
{
|
||||
branch *br;
|
||||
@@ -994,7 +995,7 @@ init_dungeon_set_depth(struct proto_dungeon *pd, int dngidx)
|
||||
- (gd.dungeons[dngidx].entry_lev - 1);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
init_dungeon_dungeons(
|
||||
lua_State *L,
|
||||
struct proto_dungeon *pd,
|
||||
@@ -1104,7 +1105,7 @@ init_dungeon_dungeons(
|
||||
}
|
||||
|
||||
/* initialize the Castle drawbridge tune */
|
||||
static void
|
||||
staticfn void
|
||||
init_castle_tune(void)
|
||||
{
|
||||
int i;
|
||||
@@ -1115,7 +1116,7 @@ init_castle_tune(void)
|
||||
}
|
||||
|
||||
/* fix up the special level names and locations for quick access */
|
||||
static void
|
||||
staticfn void
|
||||
fixup_level_locations(void)
|
||||
{
|
||||
int i;
|
||||
@@ -1177,7 +1178,7 @@ fixup_level_locations(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
free_proto_dungeon(struct proto_dungeon *pd)
|
||||
{
|
||||
int i;
|
||||
@@ -2130,7 +2131,7 @@ lev_by_name(const char *nam)
|
||||
|
||||
#undef dlev_in_current_branch
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
unplaced_floater(struct dungeon *dptr)
|
||||
{
|
||||
branch *br;
|
||||
@@ -2145,7 +2146,7 @@ unplaced_floater(struct dungeon *dptr)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
unreachable_level(d_level *lvl_p, boolean unplaced)
|
||||
{
|
||||
s_level *dummy;
|
||||
@@ -2159,7 +2160,7 @@ unreachable_level(d_level *lvl_p, boolean unplaced)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
tport_menu(
|
||||
winid win,
|
||||
char *entry,
|
||||
@@ -2195,7 +2196,7 @@ tport_menu(
|
||||
}
|
||||
|
||||
/* Convert a branch type to a string usable by print_dungeon(). */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
br_string(int type)
|
||||
{
|
||||
switch (type) {
|
||||
@@ -2211,14 +2212,14 @@ br_string(int type)
|
||||
return " (unknown)";
|
||||
}
|
||||
|
||||
static char
|
||||
staticfn char
|
||||
chr_u_on_lvl(d_level *dlev)
|
||||
{
|
||||
return u.uz.dnum == dlev->dnum && u.uz.dlevel == dlev->dlevel ? '*' : ' ';
|
||||
}
|
||||
|
||||
/* Print all child branches between the lower and upper bounds. */
|
||||
static void
|
||||
staticfn void
|
||||
print_branch(
|
||||
winid win,
|
||||
int dnum, int lower_bound, int upper_bound,
|
||||
@@ -2433,7 +2434,7 @@ recbranch_mapseen(d_level *source, d_level *dest)
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
get_annotation(d_level *lev)
|
||||
{
|
||||
mapseen *mptr;
|
||||
@@ -2455,7 +2456,7 @@ print_level_annotation(void)
|
||||
|
||||
/* ask user to annotate level lev.
|
||||
if lev is NULL, uses current level. */
|
||||
static void
|
||||
staticfn void
|
||||
query_annotation(d_level *lev)
|
||||
{
|
||||
mapseen *mptr;
|
||||
@@ -2592,7 +2593,7 @@ load_exclusions(NHFILE *nhfp)
|
||||
}
|
||||
|
||||
/* find the particular mapseen object in the chain; may return null */
|
||||
static mapseen *
|
||||
staticfn mapseen *
|
||||
find_mapseen(d_level *lev)
|
||||
{
|
||||
mapseen *mptr;
|
||||
@@ -2604,7 +2605,7 @@ find_mapseen(d_level *lev)
|
||||
return mptr;
|
||||
}
|
||||
|
||||
static mapseen *
|
||||
staticfn mapseen *
|
||||
find_mapseen_by_str(const char *s)
|
||||
{
|
||||
mapseen *mptr;
|
||||
@@ -2650,7 +2651,7 @@ rm_mapseen(int ledger_num)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
save_mapseen(NHFILE *nhfp, mapseen *mptr)
|
||||
{
|
||||
branch *curr;
|
||||
@@ -2681,7 +2682,7 @@ save_mapseen(NHFILE *nhfp, mapseen *mptr)
|
||||
savecemetery(nhfp, &mptr->final_resting_place);
|
||||
}
|
||||
|
||||
static mapseen *
|
||||
staticfn mapseen *
|
||||
load_mapseen(NHFILE *nhfp)
|
||||
{
|
||||
int branchnum = 0, brindx;
|
||||
@@ -2842,7 +2843,7 @@ init_mapseen(d_level *lev)
|
||||
/* || (feat).water || (feat).ice || (feat).lava */
|
||||
|
||||
/* returns true if this level has something interesting to print out */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
interest_mapseen(mapseen *mptr)
|
||||
{
|
||||
if (on_level(&u.uz, &mptr->lev))
|
||||
@@ -2913,7 +2914,7 @@ update_mapseen_for(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* count mapseen feature from lastseentyp at x,y */
|
||||
static void
|
||||
staticfn void
|
||||
count_feat_lastseentyp(
|
||||
mapseen *mptr, /* remembered data for a level; update feat.X counts */
|
||||
coordxy x, coordxy y)
|
||||
@@ -3304,7 +3305,7 @@ show_overview(
|
||||
}
|
||||
|
||||
/* display endgame levels or non-endgame levels, not both */
|
||||
static void
|
||||
staticfn void
|
||||
traverse_mapseenchn(
|
||||
int viewendgame, /* 0: show endgame branch; 1: show other branches */
|
||||
winid win, /* output window */
|
||||
@@ -3328,7 +3329,7 @@ traverse_mapseenchn(
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
seen_string(xint16 x, const char *obj)
|
||||
{
|
||||
/* players are computer scientists: 0, 1, 2, n */
|
||||
@@ -3348,7 +3349,7 @@ seen_string(xint16 x, const char *obj)
|
||||
}
|
||||
|
||||
/* better br_string */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
br_string2(branch *br)
|
||||
{
|
||||
/* Special case: quest portal says closed if kicked from quest */
|
||||
@@ -3400,7 +3401,7 @@ endgamelevelname(char *outbuf, int indx)
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
shop_string(int rtype)
|
||||
{
|
||||
const char *str = "shop"; /* catchall */
|
||||
@@ -3451,7 +3452,7 @@ shop_string(int rtype)
|
||||
|
||||
/* if player knows about the mastermind tune, append it to Castle annotation;
|
||||
if drawbridge has been destroyed, flags.castletune will be zero */
|
||||
static char *
|
||||
staticfn char *
|
||||
tunesuffix(
|
||||
mapseen *mptr,
|
||||
char *outbuf,
|
||||
@@ -3507,7 +3508,7 @@ tunesuffix(
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
print_mapseen(
|
||||
winid win, mapseen *mptr,
|
||||
int final, /* -1: as menu; 0: not final;
|
||||
|
||||
@@ -5,46 +5,46 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int eatmdone(void);
|
||||
static int eatfood(void);
|
||||
static struct obj *costly_tin(int);
|
||||
static int opentin(void);
|
||||
static int unfaint(void);
|
||||
staticfn int eatmdone(void);
|
||||
staticfn int eatfood(void);
|
||||
staticfn struct obj *costly_tin(int);
|
||||
staticfn int opentin(void);
|
||||
staticfn int unfaint(void);
|
||||
|
||||
static const char *food_xname(struct obj *, boolean);
|
||||
static void choke(struct obj *);
|
||||
static void recalc_wt(void);
|
||||
static int adj_victual_nutrition(void);
|
||||
static struct obj *touchfood(struct obj *) NONNULL;
|
||||
static void do_reset_eat(void);
|
||||
static void done_eating(boolean);
|
||||
static void cprefx(int);
|
||||
static boolean temp_givit(int, struct permonst *);
|
||||
static void givit(int, struct permonst *);
|
||||
static void eye_of_newt_buzz(void);
|
||||
static void cpostfx(int);
|
||||
static void consume_tin(const char *);
|
||||
static void start_tin(struct obj *);
|
||||
static int eatcorpse(struct obj *);
|
||||
static void start_eating(struct obj *, boolean);
|
||||
static void garlic_breath(struct monst *);
|
||||
static void fprefx(struct obj *);
|
||||
static void fpostfx(struct obj *);
|
||||
static int bite(void);
|
||||
static int edibility_prompts(struct obj *);
|
||||
static int doeat_nonfood(struct obj *);
|
||||
static int tinopen_ok(struct obj *);
|
||||
static int rottenfood(struct obj *);
|
||||
static void eatspecial(void);
|
||||
static int bounded_increase(int, int, int);
|
||||
static void accessory_has_effect(struct obj *);
|
||||
static void eataccessory(struct obj *);
|
||||
static const char *foodword(struct obj *);
|
||||
static int tin_variety(struct obj *, boolean);
|
||||
static boolean maybe_cannibal(int, boolean);
|
||||
static int eat_ok(struct obj *);
|
||||
static int offer_ok(struct obj *);
|
||||
static int tin_ok(struct obj *);
|
||||
staticfn const char *food_xname(struct obj *, boolean);
|
||||
staticfn void choke(struct obj *);
|
||||
staticfn void recalc_wt(void);
|
||||
staticfn int adj_victual_nutrition(void);
|
||||
staticfn struct obj *touchfood(struct obj *) NONNULL;
|
||||
staticfn void do_reset_eat(void);
|
||||
staticfn void done_eating(boolean);
|
||||
staticfn void cprefx(int);
|
||||
staticfn boolean temp_givit(int, struct permonst *);
|
||||
staticfn void givit(int, struct permonst *);
|
||||
staticfn void eye_of_newt_buzz(void);
|
||||
staticfn void cpostfx(int);
|
||||
staticfn void consume_tin(const char *);
|
||||
staticfn void start_tin(struct obj *);
|
||||
staticfn int eatcorpse(struct obj *);
|
||||
staticfn void start_eating(struct obj *, boolean);
|
||||
staticfn void garlic_breath(struct monst *);
|
||||
staticfn void fprefx(struct obj *);
|
||||
staticfn void fpostfx(struct obj *);
|
||||
staticfn int bite(void);
|
||||
staticfn int edibility_prompts(struct obj *);
|
||||
staticfn int doeat_nonfood(struct obj *);
|
||||
staticfn int tinopen_ok(struct obj *);
|
||||
staticfn int rottenfood(struct obj *);
|
||||
staticfn void eatspecial(void);
|
||||
staticfn int bounded_increase(int, int, int);
|
||||
staticfn void accessory_has_effect(struct obj *);
|
||||
staticfn void eataccessory(struct obj *);
|
||||
staticfn const char *foodword(struct obj *);
|
||||
staticfn int tin_variety(struct obj *, boolean);
|
||||
staticfn boolean maybe_cannibal(int, boolean);
|
||||
staticfn int eat_ok(struct obj *);
|
||||
staticfn int offer_ok(struct obj *);
|
||||
staticfn int tin_ok(struct obj *);
|
||||
|
||||
/* also used to see if you're allowed to eat cats and dogs */
|
||||
#define CANNIBAL_ALLOWED() (Role_if(PM_CAVE_DWELLER) || Race_if(PM_ORC))
|
||||
@@ -64,7 +64,8 @@ static int tin_ok(struct obj *);
|
||||
#define nonrotting_food(otyp) \
|
||||
((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION)
|
||||
|
||||
/* see hunger states in hack.h - texts used on bottom line */
|
||||
/* see hunger states in hack.h - texts used on bottom line
|
||||
Also used in botl.c and insight.c */
|
||||
const char *const hu_stat[] = {
|
||||
"Satiated", " ", "Hungry ", "Weak ",
|
||||
"Fainting", "Fainted ", "Starved "
|
||||
@@ -157,7 +158,7 @@ static const struct {
|
||||
#define TTSZ SIZE(tintxts)
|
||||
|
||||
/* called after mimicking is over */
|
||||
static int
|
||||
staticfn int
|
||||
eatmdone(void)
|
||||
{
|
||||
/* release `eatmbuf' */
|
||||
@@ -211,7 +212,7 @@ eatmupdate(void)
|
||||
}
|
||||
|
||||
/* ``[the(] singular(food, xname) [)]'' */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
food_xname(struct obj *food, boolean the_pfx)
|
||||
{
|
||||
const char *result;
|
||||
@@ -239,7 +240,7 @@ food_xname(struct obj *food, boolean the_pfx)
|
||||
*
|
||||
* To a full belly all food is bad. (It.)
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
choke(struct obj *food)
|
||||
{
|
||||
/* only happens if you were satiated */
|
||||
@@ -286,7 +287,7 @@ choke(struct obj *food)
|
||||
}
|
||||
|
||||
/* modify victual.piece->owt depending on time spent consuming it */
|
||||
static void
|
||||
staticfn void
|
||||
recalc_wt(void)
|
||||
{
|
||||
struct obj *piece = gc.context.victual.piece;
|
||||
@@ -332,7 +333,7 @@ obj_nutrition(struct obj *otmp)
|
||||
/* nutrition increment for next byte; this used to be factored into
|
||||
victual.piece->oeaten but that produced weight change if hero
|
||||
polymorphed to or from one of the races which has nutrition adjusted */
|
||||
static int
|
||||
staticfn int
|
||||
adj_victual_nutrition(void)
|
||||
{
|
||||
int otyp = gc.context.victual.piece->otyp;
|
||||
@@ -353,7 +354,7 @@ adj_victual_nutrition(void)
|
||||
return nut;
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
touchfood(struct obj *otmp)
|
||||
{
|
||||
if (otmp->quan > 1L) {
|
||||
@@ -413,7 +414,7 @@ food_substitution(struct obj *old_obj, struct obj *new_obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_reset_eat(void)
|
||||
{
|
||||
debugpline0("do_reset_eat...");
|
||||
@@ -483,10 +484,10 @@ eating_dangerous_corpse(int res)
|
||||
}
|
||||
|
||||
#if 0 /* no longer used */
|
||||
static void maybe_extend_timed_resist(int);
|
||||
staticfn void maybe_extend_timed_resist(int);
|
||||
|
||||
/* if temp resist against 'prop' is about to timeout, extend it slightly */
|
||||
static void
|
||||
staticfn void
|
||||
maybe_extend_timed_resist(int prop)
|
||||
{
|
||||
long timeout = temp_resist(prop);
|
||||
@@ -505,7 +506,7 @@ maybe_extend_timed_resist(int prop)
|
||||
#endif
|
||||
|
||||
/* called each move during eating process */
|
||||
static int
|
||||
staticfn int
|
||||
eatfood(void)
|
||||
{
|
||||
struct obj *food = gc.context.victual.piece;
|
||||
@@ -530,7 +531,7 @@ eatfood(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
done_eating(boolean message)
|
||||
{
|
||||
struct obj *piece = gc.context.victual.piece;
|
||||
@@ -738,7 +739,7 @@ eat_brains(
|
||||
}
|
||||
|
||||
/* eating a corpse or egg of one's own species is usually naughty */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
maybe_cannibal(int pm, boolean allowmsg)
|
||||
{
|
||||
static NEARDATA long ate_brains = 0L;
|
||||
@@ -771,7 +772,7 @@ maybe_cannibal(int pm, boolean allowmsg)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
cprefx(int pm)
|
||||
{
|
||||
(void) maybe_cannibal(pm, TRUE);
|
||||
@@ -967,7 +968,7 @@ should_givit(int type, struct permonst *ptr)
|
||||
return (ptr->mlevel > rn2(chance));
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
temp_givit(int type, struct permonst *ptr)
|
||||
{
|
||||
int chance = (type == STONE_RES) ? 6 : (type == ACID_RES) ? 3 : 0;
|
||||
@@ -978,7 +979,7 @@ temp_givit(int type, struct permonst *ptr)
|
||||
/* givit() tries to give you an intrinsic based on the monster's level
|
||||
* and what type of intrinsic it is trying to give you.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
givit(int type, struct permonst *ptr)
|
||||
{
|
||||
debugpline1("Attempting to give intrinsic %d", type);
|
||||
@@ -1078,7 +1079,7 @@ givit(int type, struct permonst *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
eye_of_newt_buzz(void)
|
||||
{
|
||||
/* MRKR: "eye of newt" may give small magical energy boost */
|
||||
@@ -1104,7 +1105,7 @@ eye_of_newt_buzz(void)
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* called after completely consuming a corpse */
|
||||
static void
|
||||
staticfn void
|
||||
cpostfx(int pm)
|
||||
{
|
||||
int tmp = 0;
|
||||
@@ -1350,7 +1351,7 @@ violated_vegetarian(void)
|
||||
|
||||
/* common code to check and possibly charge for 1 gc.context.tin.tin,
|
||||
* will split() gc.context.tin.tin if necessary */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
costly_tin(int alter_type) /* COST_xxx */
|
||||
{
|
||||
struct obj *tin = gc.context.tin.tin;
|
||||
@@ -1450,7 +1451,7 @@ set_tin_variety(struct obj *obj, int forcetype)
|
||||
obj->spe = -(r + 1); /* offset by 1 to allow index 0 */
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
tin_variety(
|
||||
struct obj *obj,
|
||||
boolean displ) /* we're just displaying so leave things alone */
|
||||
@@ -1476,7 +1477,7 @@ tin_variety(
|
||||
return r;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
consume_tin(const char *mesg)
|
||||
{
|
||||
const char *what;
|
||||
@@ -1618,7 +1619,7 @@ consume_tin(const char *mesg)
|
||||
}
|
||||
|
||||
/* called during each move whilst opening a tin */
|
||||
static int
|
||||
staticfn int
|
||||
opentin(void)
|
||||
{
|
||||
/* perhaps it was stolen (although that should cause interruption) */
|
||||
@@ -1638,7 +1639,7 @@ opentin(void)
|
||||
}
|
||||
|
||||
/* called when starting to open a tin */
|
||||
static void
|
||||
staticfn void
|
||||
start_tin(struct obj *otmp)
|
||||
{
|
||||
const char *mesg = 0;
|
||||
@@ -1727,7 +1728,7 @@ Hear_again(void)
|
||||
}
|
||||
|
||||
/* called on the "first bite" of rotten food */
|
||||
static int
|
||||
staticfn int
|
||||
rottenfood(struct obj *obj)
|
||||
{
|
||||
pline("Blecch! %s %s!",
|
||||
@@ -1769,7 +1770,7 @@ rottenfood(struct obj *obj)
|
||||
}
|
||||
|
||||
/* called when a corpse is selected as food */
|
||||
static int
|
||||
staticfn int
|
||||
eatcorpse(struct obj *otmp)
|
||||
{
|
||||
int retcode = 0, tp = 0, mnum = otmp->corpsenm;
|
||||
@@ -1934,7 +1935,7 @@ eatcorpse(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* called as you start to eat */
|
||||
static void
|
||||
staticfn void
|
||||
start_eating(struct obj *otmp, boolean already_partly_eaten)
|
||||
{
|
||||
const char *old_nomovemsg, *save_nomovemsg;
|
||||
@@ -1997,7 +1998,7 @@ eating_glob(struct obj *glob)
|
||||
}
|
||||
|
||||
/* scare nearby monster when hero eats garlic */
|
||||
static void
|
||||
staticfn void
|
||||
garlic_breath(struct monst *mtmp)
|
||||
{
|
||||
if (olfaction(mtmp->data) && distu(mtmp->mx, mtmp->my) < 7)
|
||||
@@ -2010,7 +2011,7 @@ garlic_breath(struct monst *mtmp)
|
||||
* Messages should use present tense since multi-turn food won't be
|
||||
* finishing at the time they're issued.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
fprefx(struct obj *otmp)
|
||||
{
|
||||
switch (otmp->otyp) {
|
||||
@@ -2119,7 +2120,7 @@ fprefx(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* increment a combat intrinsic with limits on its growth */
|
||||
static int
|
||||
staticfn int
|
||||
bounded_increase(int old, int inc, int typ)
|
||||
{
|
||||
int absold, absinc, sgnold, sgninc;
|
||||
@@ -2156,14 +2157,14 @@ bounded_increase(int old, int inc, int typ)
|
||||
return old + inc;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
accessory_has_effect(struct obj *otmp)
|
||||
{
|
||||
pline("Magic spreads through your body as you digest the %s.",
|
||||
(otmp->oclass == RING_CLASS) ? "ring" : "amulet");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
eataccessory(struct obj *otmp)
|
||||
{
|
||||
int typ = otmp->otyp;
|
||||
@@ -2311,7 +2312,7 @@ eataccessory(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* called after eating non-food */
|
||||
static void
|
||||
staticfn void
|
||||
eatspecial(void)
|
||||
{
|
||||
struct obj *otmp = gc.context.victual.piece;
|
||||
@@ -2395,7 +2396,7 @@ static const char *const foodwords[] = {
|
||||
"plastic", "glass", "rich food", "stone"
|
||||
};
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
foodword(struct obj *otmp)
|
||||
{
|
||||
if (otmp->oclass == FOOD_CLASS)
|
||||
@@ -2407,7 +2408,7 @@ foodword(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* called after consuming (non-corpse) food */
|
||||
static void
|
||||
staticfn void
|
||||
fpostfx(struct obj *otmp)
|
||||
{
|
||||
switch (otmp->otyp) {
|
||||
@@ -2503,9 +2504,9 @@ fpostfx(struct obj *otmp)
|
||||
/* intended for eating a spellbook while polymorphed, but not used;
|
||||
"leather" applied to appearance, not composition, and has been
|
||||
changed to "leathery" to reflect that */
|
||||
static boolean leather_cover(struct obj *);
|
||||
staticfn boolean leather_cover(struct obj *);
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
leather_cover(struct obj *otmp)
|
||||
{
|
||||
const char *odesc = OBJ_DESCR(objects[otmp->otyp]);
|
||||
@@ -2523,7 +2524,7 @@ leather_cover(struct obj *otmp)
|
||||
* return 1 if the food was dangerous and you chose to stop.
|
||||
* return 2 if the food was dangerous and you chose to eat it anyway.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
edibility_prompts(struct obj *otmp)
|
||||
{
|
||||
/* Blessed food detection grants hero a one-use
|
||||
@@ -2630,7 +2631,7 @@ edibility_prompts(struct obj *otmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
doeat_nonfood(struct obj *otmp)
|
||||
{
|
||||
int basenutrit; /* nutrition of full item */
|
||||
@@ -2969,7 +2970,7 @@ doeat(void)
|
||||
}
|
||||
|
||||
/* getobj callback for object to be opened with a tin opener */
|
||||
static int
|
||||
staticfn int
|
||||
tinopen_ok(struct obj *obj)
|
||||
{
|
||||
if (obj && obj->otyp == TIN)
|
||||
@@ -3014,7 +3015,7 @@ use_tin_opener(struct obj *obj)
|
||||
/* Take a single bite from a piece of food, checking for choking and
|
||||
* modifying usedtime. Returns 1 if they choked and survived, 0 otherwise.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
bite(void)
|
||||
{
|
||||
/* hack to pacify static analyzer incorporated into gcc 12.2 */
|
||||
@@ -3217,7 +3218,7 @@ lesshungry(int num)
|
||||
newuhs(FALSE);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
unfaint(void)
|
||||
{
|
||||
(void) Hear_again();
|
||||
@@ -3398,7 +3399,7 @@ newuhs(boolean incr)
|
||||
}
|
||||
|
||||
/* getobj callback for object to eat - effectively just wraps is_edible() */
|
||||
static int
|
||||
staticfn int
|
||||
eat_ok(struct obj *obj)
|
||||
{
|
||||
/* 'getobj_else' will be non-zero if floor food is present and
|
||||
@@ -3420,7 +3421,7 @@ eat_ok(struct obj *obj)
|
||||
|
||||
/* getobj callback for object to be offered (corpses and things that look like
|
||||
* the Amulet only */
|
||||
static int
|
||||
staticfn int
|
||||
offer_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -3442,7 +3443,7 @@ offer_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for object to be tinned */
|
||||
static int
|
||||
staticfn int
|
||||
tin_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
|
||||
@@ -20,26 +20,26 @@
|
||||
#define nowrap_add(a, b) (a = ((a + b) < 0 ? LONG_MAX : (a + b)))
|
||||
|
||||
#ifndef NO_SIGNAL
|
||||
static void done_intr(int);
|
||||
staticfn void done_intr(int);
|
||||
# if defined(UNIX) || defined(VMS) || defined(__EMX__)
|
||||
static void done_hangup(int);
|
||||
staticfn void done_hangup(int);
|
||||
# endif
|
||||
#endif
|
||||
static void disclose(int, boolean);
|
||||
static void get_valuables(struct obj *) NO_NNARGS;
|
||||
static void sort_valuables(struct valuable_data *, int);
|
||||
static void artifact_score(struct obj *, boolean, winid);
|
||||
static boolean fuzzer_savelife(int);
|
||||
staticfn void disclose(int, boolean);
|
||||
staticfn void get_valuables(struct obj *) NO_NNARGS;
|
||||
staticfn void sort_valuables(struct valuable_data *, int);
|
||||
staticfn void artifact_score(struct obj *, boolean, winid);
|
||||
staticfn boolean fuzzer_savelife(int);
|
||||
ATTRNORETURN static void really_done(int) NORETURN;
|
||||
static void savelife(int);
|
||||
static boolean should_query_disclose_option(int, char *);
|
||||
staticfn void savelife(int);
|
||||
staticfn boolean should_query_disclose_option(int, char *);
|
||||
#ifdef DUMPLOG
|
||||
static void dump_plines(void);
|
||||
staticfn void dump_plines(void);
|
||||
#endif
|
||||
static void dump_everything(int, time_t);
|
||||
static void fixup_death(int);
|
||||
static int wordcount(char *);
|
||||
static void bel_copy1(char **, char *);
|
||||
staticfn void dump_everything(int, time_t);
|
||||
staticfn void fixup_death(int);
|
||||
staticfn int wordcount(char *);
|
||||
staticfn void bel_copy1(char **, char *);
|
||||
|
||||
#if defined(__BEOS__) || defined(MICRO) || defined(OS2) || defined(WIN32)
|
||||
ATTRNORETURN extern void nethack_exit(int) NORETURN;
|
||||
@@ -160,7 +160,7 @@ done2(void)
|
||||
#ifndef NO_SIGNAL
|
||||
/* called as signal() handler, so sent at least 1 arg */
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
done_intr(int sig_unused UNUSED)
|
||||
{
|
||||
done_stopprint++;
|
||||
@@ -175,7 +175,7 @@ done_intr(int sig_unused UNUSED)
|
||||
|
||||
#if defined(UNIX) || defined(VMS) || defined(__EMX__)
|
||||
/* signal() handler */
|
||||
static void
|
||||
staticfn void
|
||||
done_hangup(int sig)
|
||||
{
|
||||
#ifdef HANGUPHANDLING
|
||||
@@ -360,7 +360,7 @@ static const struct {
|
||||
|
||||
/* clear away while-helpless when the cause of death caused that
|
||||
helplessness (ie, "petrified by <foo> while getting stoned") */
|
||||
static void
|
||||
staticfn void
|
||||
fixup_death(int how)
|
||||
{
|
||||
int i;
|
||||
@@ -470,7 +470,7 @@ panic VA_DECL(const char *, str)
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
should_query_disclose_option(int category, char *defquery)
|
||||
{
|
||||
int idx;
|
||||
@@ -512,7 +512,7 @@ should_query_disclose_option(int category, char *defquery)
|
||||
}
|
||||
|
||||
#ifdef DUMPLOG
|
||||
static void
|
||||
staticfn void
|
||||
dump_plines(void)
|
||||
{
|
||||
int i, j;
|
||||
@@ -535,7 +535,7 @@ dump_plines(void)
|
||||
#endif /* DUMPLOG */
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
dump_everything(
|
||||
int how, /* ASCENDED, ESCAPED, QUIT, etc */
|
||||
time_t when) /* date+time at end of game */
|
||||
@@ -610,7 +610,7 @@ dump_everything(
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
disclose(int how, boolean taken)
|
||||
{
|
||||
char c = '\0', defquery;
|
||||
@@ -694,7 +694,7 @@ disclose(int how, boolean taken)
|
||||
}
|
||||
|
||||
/* try to get the player back in a viable state after being killed */
|
||||
static void
|
||||
staticfn void
|
||||
savelife(int how)
|
||||
{
|
||||
int uhpmin;
|
||||
@@ -753,7 +753,7 @@ savelife(int how)
|
||||
* Get valuables from the given list. Revised code: the list always remains
|
||||
* intact.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
get_valuables(struct obj *list) /* inventory or container contents */
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -788,7 +788,7 @@ get_valuables(struct obj *list) /* inventory or container contents */
|
||||
* Sort collected valuables, most frequent to least. We could just
|
||||
* as easily use qsort, but we don't care about efficiency here.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
sort_valuables(
|
||||
struct valuable_data list[],
|
||||
int size) /* max value is less than 20 */
|
||||
@@ -897,7 +897,7 @@ done_object_cleanup(void)
|
||||
}
|
||||
|
||||
/* called twice; first to calculate total, then to list relevant items */
|
||||
static void
|
||||
staticfn void
|
||||
artifact_score(
|
||||
struct obj *list,
|
||||
boolean counting, /* true => add up points; false => display them */
|
||||
@@ -934,7 +934,7 @@ artifact_score(
|
||||
|
||||
/* when dying while running the debug fuzzer, [almost] always keep going;
|
||||
True: forced survival; False: doomed unless wearing life-save amulet */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
fuzzer_savelife(int how)
|
||||
{
|
||||
/*
|
||||
@@ -1113,7 +1113,7 @@ done(int how)
|
||||
}
|
||||
|
||||
/* separated from done() in order to specify the __noreturn__ attribute */
|
||||
static void
|
||||
staticfn void
|
||||
really_done(int how)
|
||||
{
|
||||
boolean taken;
|
||||
@@ -1774,7 +1774,7 @@ restore_killers(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
wordcount(char *p)
|
||||
{
|
||||
int words = 0;
|
||||
@@ -1790,7 +1790,7 @@ wordcount(char *p)
|
||||
return words;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
bel_copy1(char **inp, char *out)
|
||||
{
|
||||
char *in = *inp;
|
||||
|
||||
+16
-16
@@ -38,14 +38,14 @@ struct _doengrave_ctx {
|
||||
size_t len; /* # of nonspace chars of new engraving text */
|
||||
};
|
||||
|
||||
static int stylus_ok(struct obj *);
|
||||
static boolean u_can_engrave(void);
|
||||
static void doengrave_ctx_init(struct _doengrave_ctx *);
|
||||
static void doengrave_sfx_item_WAN(struct _doengrave_ctx *);
|
||||
static boolean doengrave_sfx_item(struct _doengrave_ctx *);
|
||||
static void doengrave_ctx_verb(struct _doengrave_ctx *);
|
||||
static int engrave(void);
|
||||
static const char *blengr(void);
|
||||
staticfn int stylus_ok(struct obj *);
|
||||
staticfn boolean u_can_engrave(void);
|
||||
staticfn void doengrave_ctx_init(struct _doengrave_ctx *);
|
||||
staticfn void doengrave_sfx_item_WAN(struct _doengrave_ctx *);
|
||||
staticfn boolean doengrave_sfx_item(struct _doengrave_ctx *);
|
||||
staticfn void doengrave_ctx_verb(struct _doengrave_ctx *);
|
||||
staticfn int engrave(void);
|
||||
staticfn const char *blengr(void);
|
||||
|
||||
char *
|
||||
random_engraving(char *outbuf)
|
||||
@@ -423,7 +423,7 @@ freehand(void)
|
||||
}
|
||||
|
||||
/* getobj callback for an object to engrave with */
|
||||
static int
|
||||
staticfn int
|
||||
stylus_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -445,7 +445,7 @@ stylus_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
/* can hero engrave at all (at their location)? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
u_can_engrave(void)
|
||||
{
|
||||
int levtyp = SURFACE_AT(u.ux, u.uy);
|
||||
@@ -487,7 +487,7 @@ u_can_engrave(void)
|
||||
}
|
||||
|
||||
/* initialize the doengrave data */
|
||||
static void
|
||||
staticfn void
|
||||
doengrave_ctx_init(struct _doengrave_ctx *de)
|
||||
{
|
||||
de->dengr = FALSE;
|
||||
@@ -525,7 +525,7 @@ doengrave_ctx_init(struct _doengrave_ctx *de)
|
||||
}
|
||||
|
||||
/* special engraving effects for WAND objects */
|
||||
static void
|
||||
staticfn void
|
||||
doengrave_sfx_item_WAN(struct _doengrave_ctx *de)
|
||||
{
|
||||
switch (de->otmp->otyp) {
|
||||
@@ -682,7 +682,7 @@ doengrave_sfx_item_WAN(struct _doengrave_ctx *de)
|
||||
}
|
||||
|
||||
/* special engraving effects for all objects */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
doengrave_sfx_item(struct _doengrave_ctx *de)
|
||||
{
|
||||
switch (de->otmp->oclass) {
|
||||
@@ -828,7 +828,7 @@ doengrave_sfx_item(struct _doengrave_ctx *de)
|
||||
}
|
||||
|
||||
/* which verb phrasing to use for engraving */
|
||||
static void
|
||||
staticfn void
|
||||
doengrave_ctx_verb(struct _doengrave_ctx *de)
|
||||
{
|
||||
switch (de->type) {
|
||||
@@ -1178,7 +1178,7 @@ doengr_exit:
|
||||
}
|
||||
|
||||
/* occupation callback for engraving some text */
|
||||
static int
|
||||
staticfn int
|
||||
engrave(void)
|
||||
{
|
||||
struct engr *oep;
|
||||
@@ -1620,7 +1620,7 @@ static const char blind_writing[][21] = {
|
||||
0x69, 0x76, 0x6b, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
};
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
blengr(void)
|
||||
{
|
||||
return ROLL_FROM(blind_writing);
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
static int enermod(int);
|
||||
staticfn int enermod(int);
|
||||
|
||||
long
|
||||
newuexp(int lev)
|
||||
@@ -22,7 +22,7 @@ newuexp(int lev)
|
||||
return (10000000L * ((long) (lev - 19)));
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
enermod(int en)
|
||||
{
|
||||
switch (Role_switch) {
|
||||
|
||||
+4
-4
@@ -4,8 +4,8 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int explosionmask(struct monst *, uchar, char) NONNULLARG1;
|
||||
static void engulfer_explosion_msg(uchar, char);
|
||||
staticfn int explosionmask(struct monst *, uchar, char) NONNULLARG1;
|
||||
staticfn void engulfer_explosion_msg(uchar, char);
|
||||
|
||||
/* Note: Arrays are column first, while the screen is row first */
|
||||
static const int explosion[3][3] = {
|
||||
@@ -22,7 +22,7 @@ enum explode_action {
|
||||
};
|
||||
|
||||
/* check if shield effects are needed for location affected by explosion */
|
||||
static int
|
||||
staticfn int
|
||||
explosionmask(
|
||||
struct monst *m, /* target monster (might be youmonst) */
|
||||
uchar adtyp, /* damage type */
|
||||
@@ -114,7 +114,7 @@ explosionmask(
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
engulfer_explosion_msg(uchar adtyp, char olet)
|
||||
{
|
||||
const char *adj = (char *) 0;
|
||||
|
||||
+6
-9
@@ -13,12 +13,11 @@
|
||||
#define XL_LEFT 4
|
||||
#define XL_RIGHT 8
|
||||
|
||||
static void roguejoin(coordxy, coordxy, coordxy, coordxy, int);
|
||||
static void roguecorr(coordxy, coordxy, int);
|
||||
static void miniwalk(coordxy, coordxy);
|
||||
staticfn void roguejoin(coordxy, coordxy, coordxy, coordxy, int);
|
||||
staticfn void roguecorr(coordxy, coordxy, int);
|
||||
staticfn void miniwalk(coordxy, coordxy);
|
||||
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
roguejoin(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int horiz)
|
||||
{
|
||||
coordxy x, y, middle;
|
||||
@@ -42,8 +41,7 @@ roguejoin(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int horiz)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
roguecorr(coordxy x, coordxy y, int dir)
|
||||
{
|
||||
coordxy fromx, fromy, tox, toy;
|
||||
@@ -137,8 +135,7 @@ roguecorr(coordxy x, coordxy y, int dir)
|
||||
}
|
||||
|
||||
/* Modified walkfrom() from mkmaze.c */
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
miniwalk(coordxy x, coordxy y)
|
||||
{
|
||||
int q, dir;
|
||||
|
||||
+184
-186
@@ -120,119 +120,119 @@ extern char *translate_path_variables(const char *, char *);
|
||||
extern char *sounddir; /* defined in sounds.c */
|
||||
#endif
|
||||
|
||||
static NHFILE *new_nhfile(void);
|
||||
static void free_nhfile(NHFILE *);
|
||||
staticfn NHFILE *new_nhfile(void);
|
||||
staticfn void free_nhfile(NHFILE *);
|
||||
#ifdef SELECTSAVED
|
||||
static int QSORTCALLBACK strcmp_wrap(const void *, const void *);
|
||||
staticfn int QSORTCALLBACK strcmp_wrap(const void *, const void *);
|
||||
#endif
|
||||
static char *set_bonesfile_name(char *, d_level *);
|
||||
static char *set_bonestemp_name(void);
|
||||
staticfn char *set_bonesfile_name(char *, d_level *);
|
||||
staticfn char *set_bonestemp_name(void);
|
||||
#ifdef COMPRESS
|
||||
static void redirect(const char *, const char *, FILE *, boolean);
|
||||
staticfn void redirect(const char *, const char *, FILE *, boolean);
|
||||
#endif
|
||||
#if defined(COMPRESS) || defined(ZLIB_COMP)
|
||||
static void docompress_file(const char *, boolean);
|
||||
staticfn void docompress_file(const char *, boolean);
|
||||
#endif
|
||||
#if defined(ZLIB_COMP)
|
||||
static boolean make_compressed_name(const char *, char *);
|
||||
staticfn boolean make_compressed_name(const char *, char *);
|
||||
#endif
|
||||
#ifndef USE_FCNTL
|
||||
static char *make_lockname(const char *, char *);
|
||||
staticfn char *make_lockname(const char *, char *);
|
||||
#endif
|
||||
static void set_configfile_name(const char *);
|
||||
static FILE *fopen_config_file(const char *, int);
|
||||
static int get_uchars(char *, uchar *, boolean, int, const char *);
|
||||
staticfn void set_configfile_name(const char *);
|
||||
staticfn FILE *fopen_config_file(const char *, int);
|
||||
staticfn int get_uchars(char *, uchar *, boolean, int, const char *);
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
static void adjust_prefix(char *, int);
|
||||
staticfn void adjust_prefix(char *, int);
|
||||
#endif
|
||||
static char *choose_random_part(char *, char);
|
||||
static boolean config_error_nextline(const char *);
|
||||
static void free_config_sections(void);
|
||||
static char *is_config_section(char *);
|
||||
static boolean handle_config_section(char *);
|
||||
staticfn char *choose_random_part(char *, char);
|
||||
staticfn boolean config_error_nextline(const char *);
|
||||
staticfn void free_config_sections(void);
|
||||
staticfn char *is_config_section(char *);
|
||||
staticfn boolean handle_config_section(char *);
|
||||
boolean parse_config_line(char *);
|
||||
static char *find_optparam(const char *);
|
||||
static boolean cnf_line_OPTIONS(char *);
|
||||
static boolean cnf_line_AUTOPICKUP_EXCEPTION(char *);
|
||||
static boolean cnf_line_BINDINGS(char *);
|
||||
static boolean cnf_line_AUTOCOMPLETE(char *);
|
||||
static boolean cnf_line_MSGTYPE(char *);
|
||||
static boolean cnf_line_HACKDIR(char *);
|
||||
static boolean cnf_line_LEVELDIR(char *);
|
||||
static boolean cnf_line_SAVEDIR(char *);
|
||||
static boolean cnf_line_BONESDIR(char *);
|
||||
static boolean cnf_line_DATADIR(char *);
|
||||
static boolean cnf_line_SCOREDIR(char *);
|
||||
static boolean cnf_line_LOCKDIR(char *);
|
||||
static boolean cnf_line_CONFIGDIR(char *);
|
||||
static boolean cnf_line_TROUBLEDIR(char *);
|
||||
static boolean cnf_line_NAME(char *);
|
||||
static boolean cnf_line_ROLE(char *);
|
||||
static boolean cnf_line_dogname(char *);
|
||||
static boolean cnf_line_catname(char *);
|
||||
static boolean cnf_line_WIZARDS(char *);
|
||||
static boolean cnf_line_SHELLERS(char *);
|
||||
static boolean cnf_line_EXPLORERS(char *);
|
||||
static boolean cnf_line_DEBUGFILES(char *);
|
||||
static boolean cnf_line_DUMPLOGFILE(char *);
|
||||
static boolean cnf_line_GENERICUSERS(char *);
|
||||
static boolean cnf_line_BONES_POOLS(char *);
|
||||
static boolean cnf_line_SUPPORT(char *);
|
||||
static boolean cnf_line_RECOVER(char *);
|
||||
static boolean cnf_line_CHECK_SAVE_UID(char *);
|
||||
static boolean cnf_line_CHECK_PLNAME(char *);
|
||||
static boolean cnf_line_SEDUCE(char *);
|
||||
static boolean cnf_line_HIDEUSAGE(char *);
|
||||
static boolean cnf_line_MAXPLAYERS(char *);
|
||||
static boolean cnf_line_PERSMAX(char *);
|
||||
static boolean cnf_line_PERS_IS_UID(char *);
|
||||
static boolean cnf_line_ENTRYMAX(char *);
|
||||
static boolean cnf_line_POINTSMIN(char *);
|
||||
static boolean cnf_line_MAX_STATUENAME_RANK(char *);
|
||||
static boolean cnf_line_LIVELOG(char *);
|
||||
static boolean cnf_line_PANICTRACE_LIBC(char *);
|
||||
static boolean cnf_line_PANICTRACE_GDB(char *);
|
||||
static boolean cnf_line_GDBPATH(char *);
|
||||
static boolean cnf_line_GREPPATH(char *);
|
||||
static boolean cnf_line_CRASHREPORTURL(char *);
|
||||
static boolean cnf_line_SAVEFORMAT(char *);
|
||||
static boolean cnf_line_BONESFORMAT(char *);
|
||||
static boolean cnf_line_ACCESSIBILITY(char *);
|
||||
static boolean cnf_line_PORTABLE_DEVICE_PATHS(char *);
|
||||
static boolean cnf_line_BOULDER(char *);
|
||||
static boolean cnf_line_MENUCOLOR(char *);
|
||||
static boolean cnf_line_HILITE_STATUS(char *);
|
||||
static boolean cnf_line_WARNINGS(char *);
|
||||
static boolean cnf_line_ROGUESYMBOLS(char *);
|
||||
static boolean cnf_line_SYMBOLS(char *);
|
||||
static boolean cnf_line_WIZKIT(char *);
|
||||
staticfn char *find_optparam(const char *);
|
||||
staticfn boolean cnf_line_OPTIONS(char *);
|
||||
staticfn boolean cnf_line_AUTOPICKUP_EXCEPTION(char *);
|
||||
staticfn boolean cnf_line_BINDINGS(char *);
|
||||
staticfn boolean cnf_line_AUTOCOMPLETE(char *);
|
||||
staticfn boolean cnf_line_MSGTYPE(char *);
|
||||
staticfn boolean cnf_line_HACKDIR(char *);
|
||||
staticfn boolean cnf_line_LEVELDIR(char *);
|
||||
staticfn boolean cnf_line_SAVEDIR(char *);
|
||||
staticfn boolean cnf_line_BONESDIR(char *);
|
||||
staticfn boolean cnf_line_DATADIR(char *);
|
||||
staticfn boolean cnf_line_SCOREDIR(char *);
|
||||
staticfn boolean cnf_line_LOCKDIR(char *);
|
||||
staticfn boolean cnf_line_CONFIGDIR(char *);
|
||||
staticfn boolean cnf_line_TROUBLEDIR(char *);
|
||||
staticfn boolean cnf_line_NAME(char *);
|
||||
staticfn boolean cnf_line_ROLE(char *);
|
||||
staticfn boolean cnf_line_dogname(char *);
|
||||
staticfn boolean cnf_line_catname(char *);
|
||||
staticfn boolean cnf_line_WIZARDS(char *);
|
||||
staticfn boolean cnf_line_SHELLERS(char *);
|
||||
staticfn boolean cnf_line_EXPLORERS(char *);
|
||||
staticfn boolean cnf_line_DEBUGFILES(char *);
|
||||
staticfn boolean cnf_line_DUMPLOGFILE(char *);
|
||||
staticfn boolean cnf_line_GENERICUSERS(char *);
|
||||
staticfn boolean cnf_line_BONES_POOLS(char *);
|
||||
staticfn boolean cnf_line_SUPPORT(char *);
|
||||
staticfn boolean cnf_line_RECOVER(char *);
|
||||
staticfn boolean cnf_line_CHECK_SAVE_UID(char *);
|
||||
staticfn boolean cnf_line_CHECK_PLNAME(char *);
|
||||
staticfn boolean cnf_line_SEDUCE(char *);
|
||||
staticfn boolean cnf_line_HIDEUSAGE(char *);
|
||||
staticfn boolean cnf_line_MAXPLAYERS(char *);
|
||||
staticfn boolean cnf_line_PERSMAX(char *);
|
||||
staticfn boolean cnf_line_PERS_IS_UID(char *);
|
||||
staticfn boolean cnf_line_ENTRYMAX(char *);
|
||||
staticfn boolean cnf_line_POINTSMIN(char *);
|
||||
staticfn boolean cnf_line_MAX_STATUENAME_RANK(char *);
|
||||
staticfn boolean cnf_line_LIVELOG(char *);
|
||||
staticfn boolean cnf_line_PANICTRACE_LIBC(char *);
|
||||
staticfn boolean cnf_line_PANICTRACE_GDB(char *);
|
||||
staticfn boolean cnf_line_GDBPATH(char *);
|
||||
staticfn boolean cnf_line_GREPPATH(char *);
|
||||
staticfn boolean cnf_line_CRASHREPORTURL(char *);
|
||||
staticfn boolean cnf_line_SAVEFORMAT(char *);
|
||||
staticfn boolean cnf_line_BONESFORMAT(char *);
|
||||
staticfn boolean cnf_line_ACCESSIBILITY(char *);
|
||||
staticfn boolean cnf_line_PORTABLE_DEVICE_PATHS(char *);
|
||||
staticfn boolean cnf_line_BOULDER(char *);
|
||||
staticfn boolean cnf_line_MENUCOLOR(char *);
|
||||
staticfn boolean cnf_line_HILITE_STATUS(char *);
|
||||
staticfn boolean cnf_line_WARNINGS(char *);
|
||||
staticfn boolean cnf_line_ROGUESYMBOLS(char *);
|
||||
staticfn boolean cnf_line_SYMBOLS(char *);
|
||||
staticfn boolean cnf_line_WIZKIT(char *);
|
||||
#ifdef USER_SOUNDS
|
||||
static boolean cnf_line_SOUNDDIR(char *);
|
||||
static boolean cnf_line_SOUND(char *);
|
||||
staticfn boolean cnf_line_SOUNDDIR(char *);
|
||||
staticfn boolean cnf_line_SOUND(char *);
|
||||
#endif
|
||||
static boolean cnf_line_QT_TILEWIDTH(char *);
|
||||
static boolean cnf_line_QT_TILEHEIGHT(char *);
|
||||
static boolean cnf_line_QT_FONTSIZE(char *);
|
||||
static boolean cnf_line_QT_COMPACT(char *);
|
||||
staticfn boolean cnf_line_QT_TILEWIDTH(char *);
|
||||
staticfn boolean cnf_line_QT_TILEHEIGHT(char *);
|
||||
staticfn boolean cnf_line_QT_FONTSIZE(char *);
|
||||
staticfn boolean cnf_line_QT_COMPACT(char *);
|
||||
struct _cnf_parser_state; /* defined below (far below...) */
|
||||
static void cnf_parser_init(struct _cnf_parser_state *parser);
|
||||
static void cnf_parser_done(struct _cnf_parser_state *parser);
|
||||
static void parse_conf_buf(struct _cnf_parser_state *parser,
|
||||
staticfn void cnf_parser_init(struct _cnf_parser_state *parser);
|
||||
staticfn void cnf_parser_done(struct _cnf_parser_state *parser);
|
||||
staticfn void parse_conf_buf(struct _cnf_parser_state *parser,
|
||||
boolean (*proc)(char *arg));
|
||||
/* next one is in extern.h; why here too? */
|
||||
boolean parse_conf_str(const char *str, boolean (*proc)(char *arg));
|
||||
static boolean parse_conf_file(FILE *fp, boolean (*proc)(char *arg));
|
||||
static void parseformat(int *, char *);
|
||||
static FILE *fopen_wizkit_file(void);
|
||||
static void wizkit_addinv(struct obj *);
|
||||
staticfn boolean parse_conf_file(FILE *fp, boolean (*proc)(char *arg));
|
||||
staticfn void parseformat(int *, char *);
|
||||
staticfn FILE *fopen_wizkit_file(void);
|
||||
staticfn void wizkit_addinv(struct obj *);
|
||||
boolean proc_wizkit_line(char *buf);
|
||||
void read_wizkit(void); /* in extern.h; why here too? */
|
||||
static FILE *fopen_sym_file(void);
|
||||
staticfn FILE *fopen_sym_file(void);
|
||||
|
||||
#ifdef SELF_RECOVER
|
||||
static boolean copy_bytes(int, int);
|
||||
staticfn boolean copy_bytes(int, int);
|
||||
#endif
|
||||
static NHFILE *viable_nhfile(NHFILE *);
|
||||
staticfn NHFILE *viable_nhfile(NHFILE *);
|
||||
|
||||
/* return a file's name without its path and optionally trailing 'type' */
|
||||
const char *
|
||||
@@ -492,7 +492,7 @@ fopen_datafile(const char *filename, const char *mode, int prefix)
|
||||
/* ---------- EXTERNAL FILE SUPPORT ----------- */
|
||||
|
||||
/* determine byte order */
|
||||
const int bei = 1;
|
||||
static const int bei = 1;
|
||||
#define IS_BIGENDIAN() ( (*(char*)&bei) == 0 )
|
||||
|
||||
void
|
||||
@@ -512,7 +512,7 @@ zero_nhfile(NHFILE *nhfp)
|
||||
nhfp->fnidx = 0;
|
||||
}
|
||||
|
||||
static NHFILE *
|
||||
staticfn NHFILE *
|
||||
new_nhfile(void)
|
||||
{
|
||||
NHFILE *nhfp = (NHFILE *) alloc(sizeof(NHFILE));
|
||||
@@ -521,7 +521,7 @@ new_nhfile(void)
|
||||
return nhfp;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
free_nhfile(NHFILE *nhfp)
|
||||
{
|
||||
if (nhfp) {
|
||||
@@ -551,8 +551,7 @@ rewind_nhfile(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
NHFILE *
|
||||
staticfn NHFILE *
|
||||
viable_nhfile(NHFILE *nhfp)
|
||||
{
|
||||
/* perform some sanity checks before returning
|
||||
@@ -718,7 +717,7 @@ clearlocks(void)
|
||||
|
||||
#if defined(SELECTSAVED)
|
||||
/* qsort comparison routine */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
strcmp_wrap(const void *p, const void *q)
|
||||
{
|
||||
#if defined(UNIX) && defined(QT_GRAPHICS)
|
||||
@@ -750,7 +749,7 @@ nhclose(int fd)
|
||||
/* set up "file" to be file name for retrieving bones, and return a
|
||||
* bonesid to be read/written in the bones file.
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
set_bonesfile_name(char *file, d_level *lev)
|
||||
{
|
||||
s_level *sptr;
|
||||
@@ -799,7 +798,7 @@ set_bonesfile_name(char *file, d_level *lev)
|
||||
* (we are not reading or writing level files while writing bones files, so
|
||||
* the same array may be used instead of copying.)
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
set_bonestemp_name(void)
|
||||
{
|
||||
char *tf;
|
||||
@@ -1426,7 +1425,7 @@ free_saved_games(char **saved)
|
||||
|
||||
#ifdef COMPRESS /* external compression */
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
redirect(
|
||||
const char *filename,
|
||||
const char *mode,
|
||||
@@ -1454,7 +1453,7 @@ redirect(
|
||||
*
|
||||
* cf. child() in unixunix.c.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
docompress_file(const char *filename, boolean uncomp)
|
||||
{
|
||||
char *cfn = 0;
|
||||
@@ -1659,7 +1658,7 @@ nh_uncompress(const char *filename UNUSED_if_not_COMPRESS)
|
||||
}
|
||||
|
||||
#ifdef ZLIB_COMP /* RLC 09 Mar 1999: Support internal ZLIB */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
make_compressed_name(const char *filename, char *cfn)
|
||||
{
|
||||
#ifndef SHORT_FILENAMES
|
||||
@@ -1690,7 +1689,7 @@ make_compressed_name(const char *filename, char *cfn)
|
||||
#endif /* SHORT_FILENAMES */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
docompress_file(const char *filename, boolean uncomp)
|
||||
{
|
||||
gzFile compressedfile;
|
||||
@@ -1824,7 +1823,7 @@ docompress_file(const char *filename, boolean uncomp)
|
||||
static int lockfd = -1; /* for lock_file() to pass to unlock_file() */
|
||||
#endif
|
||||
#ifdef USE_FCNTL
|
||||
struct flock sflock; /* for unlocking, same as above */
|
||||
static struct flock sflock; /* for unlocking, same as above */
|
||||
#endif
|
||||
|
||||
#if defined(HANGUPHANDLING)
|
||||
@@ -1843,7 +1842,7 @@ struct flock sflock; /* for unlocking, same as above */
|
||||
|
||||
|
||||
#ifndef USE_FCNTL
|
||||
static char *
|
||||
staticfn char *
|
||||
make_lockname(const char *filename UNUSED_conditional, char *lockname)
|
||||
{
|
||||
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \
|
||||
@@ -2082,7 +2081,7 @@ unlock_file(const char *filename)
|
||||
|
||||
/* ---------- BEGIN CONFIG FILE HANDLING ----------- */
|
||||
|
||||
const char *default_configfile =
|
||||
static const char *default_configfile =
|
||||
#ifdef UNIX
|
||||
".nethackrc";
|
||||
#else
|
||||
@@ -2097,7 +2096,7 @@ const char *default_configfile =
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* used for messaging */
|
||||
/* used for messaging. Also used in options.c */
|
||||
char configfile[BUFSZ];
|
||||
|
||||
#ifdef MSDOS
|
||||
@@ -2158,14 +2157,14 @@ do_write_config_file(void)
|
||||
|
||||
/* remember the name of the file we're accessing;
|
||||
if may be used in option reject messages */
|
||||
static void
|
||||
staticfn void
|
||||
set_configfile_name(const char *fname)
|
||||
{
|
||||
(void) strncpy(configfile, fname, sizeof configfile - 1);
|
||||
configfile[sizeof configfile - 1] = '\0';
|
||||
}
|
||||
|
||||
static FILE *
|
||||
staticfn FILE *
|
||||
fopen_config_file(const char *filename, int src)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -2306,7 +2305,7 @@ fopen_config_file(const char *filename, int src)
|
||||
* NOTE: zeros are inserted unless modlist is TRUE, in which case the list
|
||||
* location is unchanged. Callers must handle zeros if modlist is FALSE.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
get_uchars(char *bufp, /* current pointer */
|
||||
uchar *list, /* return list */
|
||||
boolean modlist, /* TRUE: list is being modified in place */
|
||||
@@ -2366,7 +2365,7 @@ get_uchars(char *bufp, /* current pointer */
|
||||
}
|
||||
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
static void
|
||||
staticfn void
|
||||
adjust_prefix(char *bufp, int prefixid)
|
||||
{
|
||||
char *ptr;
|
||||
@@ -2389,7 +2388,7 @@ adjust_prefix(char *bufp, int prefixid)
|
||||
#endif
|
||||
|
||||
/* Choose at random one of the sep separated parts from str. Mangles str. */
|
||||
static char *
|
||||
staticfn char *
|
||||
choose_random_part(char *str, char sep)
|
||||
{
|
||||
int nsep = 1;
|
||||
@@ -2427,7 +2426,7 @@ choose_random_part(char *str, char sep)
|
||||
return (char *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
free_config_sections(void)
|
||||
{
|
||||
if (gc.config_section_chosen) {
|
||||
@@ -2443,7 +2442,7 @@ free_config_sections(void)
|
||||
/* check for " [ anything-except-bracket-or-empty ] # arbitrary-comment"
|
||||
with spaces optional; returns pointer to "anything-except..." (with
|
||||
trailing " ] #..." stripped) if ok, otherwise Null */
|
||||
static char *
|
||||
staticfn char *
|
||||
is_config_section(
|
||||
char *str) /* trailing spaces are stripped, ']' too iff result is good */
|
||||
{
|
||||
@@ -2472,7 +2471,7 @@ is_config_section(
|
||||
return trimspaces(a);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
handle_config_section(char *buf)
|
||||
{
|
||||
char *sect = is_config_section(buf);
|
||||
@@ -2507,7 +2506,7 @@ handle_config_section(char *buf)
|
||||
#define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE)
|
||||
|
||||
/* find the '=' or ':' */
|
||||
static char *
|
||||
staticfn char *
|
||||
find_optparam(const char *buf)
|
||||
{
|
||||
char *bufp, *altp;
|
||||
@@ -2520,7 +2519,7 @@ find_optparam(const char *buf)
|
||||
return bufp;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_OPTIONS(char *origbuf)
|
||||
{
|
||||
char *bufp = find_optparam(origbuf);
|
||||
@@ -2529,33 +2528,33 @@ cnf_line_OPTIONS(char *origbuf)
|
||||
return parseoptions(bufp, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_AUTOPICKUP_EXCEPTION(char *bufp)
|
||||
{
|
||||
add_autopickup_exception(bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BINDINGS(char *bufp)
|
||||
{
|
||||
return parsebindings(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_AUTOCOMPLETE(char *bufp)
|
||||
{
|
||||
parseautocomplete(bufp, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MSGTYPE(char *bufp)
|
||||
{
|
||||
return msgtype_parse_add(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HACKDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2570,7 +2569,7 @@ cnf_line_HACKDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LEVELDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2590,7 +2589,7 @@ cnf_line_LEVELDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SAVEDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2612,7 +2611,7 @@ cnf_line_SAVEDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONESDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2623,7 +2622,7 @@ cnf_line_BONESDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DATADIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2634,7 +2633,7 @@ cnf_line_DATADIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SCOREDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2645,7 +2644,7 @@ cnf_line_SCOREDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LOCKDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2656,7 +2655,7 @@ cnf_line_LOCKDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CONFIGDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2667,7 +2666,7 @@ cnf_line_CONFIGDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_TROUBLEDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2678,14 +2677,14 @@ cnf_line_TROUBLEDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_NAME(char *bufp)
|
||||
{
|
||||
(void) strncpy(gp.plname, bufp, PL_NSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ROLE(char *bufp)
|
||||
{
|
||||
int len;
|
||||
@@ -2695,21 +2694,21 @@ cnf_line_ROLE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_dogname(char *bufp)
|
||||
{
|
||||
(void) strncpy(gd.dogname, bufp, PL_PSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_catname(char *bufp)
|
||||
{
|
||||
(void) strncpy(gc.catname, bufp, PL_PSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WIZARDS(char *bufp)
|
||||
{
|
||||
if (sysopt.wizards)
|
||||
@@ -2726,7 +2725,7 @@ cnf_line_WIZARDS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SHELLERS(char *bufp)
|
||||
{
|
||||
if (sysopt.shellers)
|
||||
@@ -2735,7 +2734,7 @@ cnf_line_SHELLERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_EXPLORERS(char *bufp)
|
||||
{
|
||||
if (sysopt.explorers)
|
||||
@@ -2744,7 +2743,7 @@ cnf_line_EXPLORERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DEBUGFILES(char *bufp)
|
||||
{
|
||||
/* if showdebug() has already been called (perhaps we've added
|
||||
@@ -2758,7 +2757,7 @@ cnf_line_DEBUGFILES(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DUMPLOGFILE(char *bufp)
|
||||
{
|
||||
#ifdef DUMPLOG
|
||||
@@ -2771,7 +2770,7 @@ cnf_line_DUMPLOGFILE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GENERICUSERS(char *bufp)
|
||||
{
|
||||
if (sysopt.genericusers)
|
||||
@@ -2780,7 +2779,7 @@ cnf_line_GENERICUSERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONES_POOLS(char *bufp)
|
||||
{
|
||||
/* max value of 10 guarantees (N % bones.pools) will be one digit
|
||||
@@ -2794,7 +2793,7 @@ cnf_line_BONES_POOLS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SUPPORT(char *bufp)
|
||||
{
|
||||
if (sysopt.support)
|
||||
@@ -2803,7 +2802,7 @@ cnf_line_SUPPORT(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_RECOVER(char *bufp)
|
||||
{
|
||||
if (sysopt.recover)
|
||||
@@ -2812,7 +2811,7 @@ cnf_line_RECOVER(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CHECK_SAVE_UID(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2821,7 +2820,7 @@ cnf_line_CHECK_SAVE_UID(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CHECK_PLNAME(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2830,7 +2829,7 @@ cnf_line_CHECK_PLNAME(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SEDUCE(char *bufp)
|
||||
{
|
||||
int n = !!atoi(bufp); /* XXX this could be tighter */
|
||||
@@ -2852,7 +2851,7 @@ cnf_line_SEDUCE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HIDEUSAGE(char *bufp)
|
||||
{
|
||||
int n = !!atoi(bufp);
|
||||
@@ -2861,7 +2860,7 @@ cnf_line_HIDEUSAGE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MAXPLAYERS(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2875,7 +2874,7 @@ cnf_line_MAXPLAYERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PERSMAX(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2888,7 +2887,7 @@ cnf_line_PERSMAX(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PERS_IS_UID(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2901,7 +2900,7 @@ cnf_line_PERS_IS_UID(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ENTRYMAX(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2914,7 +2913,7 @@ cnf_line_ENTRYMAX(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_POINTSMIN(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2927,7 +2926,7 @@ cnf_line_POINTSMIN(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MAX_STATUENAME_RANK(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2941,7 +2940,7 @@ cnf_line_MAX_STATUENAME_RANK(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LIVELOG(char *bufp)
|
||||
{
|
||||
/* using 0 for base accepts "dddd" as decimal provided that first 'd'
|
||||
@@ -2958,7 +2957,7 @@ cnf_line_LIVELOG(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PANICTRACE_LIBC(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2973,7 +2972,7 @@ cnf_line_PANICTRACE_LIBC(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PANICTRACE_GDB(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2988,7 +2987,7 @@ cnf_line_PANICTRACE_GDB(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GDBPATH(char *bufp)
|
||||
{
|
||||
#if defined(PANICTRACE) && !defined(VMS)
|
||||
@@ -3003,7 +3002,7 @@ cnf_line_GDBPATH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GREPPATH(char *bufp)
|
||||
{
|
||||
#if defined(PANICTRACE) && !defined(VMS)
|
||||
@@ -3018,7 +3017,7 @@ cnf_line_GREPPATH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CRASHREPORTURL(char *bufp)
|
||||
{
|
||||
if (sysopt.crashreporturl)
|
||||
@@ -3027,21 +3026,21 @@ cnf_line_CRASHREPORTURL(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SAVEFORMAT(char *bufp)
|
||||
{
|
||||
parseformat(sysopt.saveformat, bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONESFORMAT(char *bufp)
|
||||
{
|
||||
parseformat(sysopt.bonesformat, bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ACCESSIBILITY(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -3054,7 +3053,7 @@ cnf_line_ACCESSIBILITY(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PORTABLE_DEVICE_PATHS(char *bufp)
|
||||
{
|
||||
#ifdef WIN32
|
||||
@@ -3073,7 +3072,7 @@ cnf_line_PORTABLE_DEVICE_PATHS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BOULDER(char *bufp)
|
||||
{
|
||||
(void) get_uchars(bufp, &go.ov_primary_syms[SYM_BOULDER + SYM_OFF_X],
|
||||
@@ -3081,13 +3080,13 @@ cnf_line_BOULDER(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MENUCOLOR(char *bufp)
|
||||
{
|
||||
return add_menu_coloring(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HILITE_STATUS(char *bufp)
|
||||
{
|
||||
#ifdef STATUS_HILITES
|
||||
@@ -3098,7 +3097,7 @@ cnf_line_HILITE_STATUS(char *bufp)
|
||||
#endif
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WARNINGS(char *bufp)
|
||||
{
|
||||
uchar translate[MAXPCHARS];
|
||||
@@ -3108,7 +3107,7 @@ cnf_line_WARNINGS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ROGUESYMBOLS(char *bufp)
|
||||
{
|
||||
if (parsesymbols(bufp, ROGUESET)) {
|
||||
@@ -3119,7 +3118,7 @@ cnf_line_ROGUESYMBOLS(char *bufp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SYMBOLS(char *bufp)
|
||||
{
|
||||
if (parsesymbols(bufp, PRIMARYSET)) {
|
||||
@@ -3130,7 +3129,7 @@ cnf_line_SYMBOLS(char *bufp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WIZKIT(char *bufp)
|
||||
{
|
||||
(void) strncpy(gw.wizkit, bufp, WIZKIT_MAX - 1);
|
||||
@@ -3138,7 +3137,7 @@ cnf_line_WIZKIT(char *bufp)
|
||||
}
|
||||
|
||||
#ifdef USER_SOUNDS
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SOUNDDIR(char *bufp)
|
||||
{
|
||||
if (sounddir)
|
||||
@@ -3147,7 +3146,7 @@ cnf_line_SOUNDDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SOUND(char *bufp)
|
||||
{
|
||||
add_sound_mapping(bufp);
|
||||
@@ -3155,7 +3154,7 @@ cnf_line_SOUND(char *bufp)
|
||||
}
|
||||
#endif /*USER_SOUNDS*/
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_TILEWIDTH(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3169,7 +3168,7 @@ cnf_line_QT_TILEWIDTH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_TILEHEIGHT(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3183,7 +3182,7 @@ cnf_line_QT_TILEHEIGHT(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_FONTSIZE(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3197,7 +3196,7 @@ cnf_line_QT_FONTSIZE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_COMPACT(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3400,7 +3399,7 @@ config_error_init(boolean from_file, const char *sourcename, boolean secure)
|
||||
gp.program_state.config_error_ready = TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
config_error_nextline(const char *line)
|
||||
{
|
||||
struct _config_error_frame *ced = config_error_data;
|
||||
@@ -3564,7 +3563,7 @@ struct _cnf_parser_state {
|
||||
};
|
||||
|
||||
/* Initialize config parser data */
|
||||
static void
|
||||
staticfn void
|
||||
cnf_parser_init(struct _cnf_parser_state *parser)
|
||||
{
|
||||
parser->rv = TRUE; /* assume successful parse */
|
||||
@@ -3579,7 +3578,7 @@ cnf_parser_init(struct _cnf_parser_state *parser)
|
||||
}
|
||||
|
||||
/* caller has finished with 'parser' (except for 'rv' so leave that intact) */
|
||||
static void
|
||||
staticfn void
|
||||
cnf_parser_done(struct _cnf_parser_state *parser)
|
||||
{
|
||||
parser->ep = 0; /* points into parser->inbuf, so becoming stale */
|
||||
@@ -3595,7 +3594,7 @@ cnf_parser_done(struct _cnf_parser_state *parser)
|
||||
*
|
||||
* Continued lines are merged together with one space in between.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
parse_conf_buf(struct _cnf_parser_state *p, boolean (*proc)(char *arg))
|
||||
{
|
||||
p->cont = FALSE;
|
||||
@@ -3745,7 +3744,7 @@ parse_conf_str(const char *str, boolean (*proc)(char *arg))
|
||||
*
|
||||
* Read from file fp, calling parse_conf_buf for each line.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
parse_conf_file(FILE *fp, boolean (*proc)(char *arg))
|
||||
{
|
||||
struct _cnf_parser_state parser;
|
||||
@@ -3764,7 +3763,7 @@ parse_conf_file(FILE *fp, boolean (*proc)(char *arg))
|
||||
return parser.rv;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
parseformat(int *arr, char *str)
|
||||
{
|
||||
const char *legal[] = { "historical", "lendian", "ascii" };
|
||||
@@ -3801,7 +3800,7 @@ parseformat(int *arr, char *str)
|
||||
|
||||
/* ---------- BEGIN WIZKIT FILE HANDLING ----------- */
|
||||
|
||||
static FILE *
|
||||
staticfn FILE *
|
||||
fopen_wizkit_file(void)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -3873,7 +3872,7 @@ fopen_wizkit_file(void)
|
||||
}
|
||||
|
||||
/* add to hero's inventory if there's room, otherwise put item on floor */
|
||||
static void
|
||||
staticfn void
|
||||
wizkit_addinv(struct obj *obj)
|
||||
{
|
||||
if (!obj || obj == &hands_obj)
|
||||
@@ -3945,8 +3944,7 @@ read_wizkit(void)
|
||||
extern const char *const known_handling[]; /* symbols.c */
|
||||
extern const char *const known_restrictions[]; /* symbols.c */
|
||||
|
||||
static
|
||||
FILE *
|
||||
staticfn FILE *
|
||||
fopen_sym_file(void)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -4749,11 +4747,11 @@ reveal_paths(void)
|
||||
|
||||
#define MAXPASSAGES SIZE(gc.context.novel.pasg) /* 20 */
|
||||
|
||||
static int choose_passage(int, unsigned);
|
||||
staticfn int choose_passage(int, unsigned);
|
||||
|
||||
/* choose a random passage that hasn't been chosen yet; once all have
|
||||
been chosen, reset the tracking to make all passages available again */
|
||||
static int
|
||||
staticfn int
|
||||
choose_passage(int passagecnt, /* total of available passages */
|
||||
unsigned oid) /* book.o_id, used to determine whether
|
||||
re-reading same book */
|
||||
|
||||
+12
-12
@@ -6,12 +6,12 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void dowatersnakes(void);
|
||||
static void dowaterdemon(void);
|
||||
static void dowaternymph(void);
|
||||
static void gush(coordxy, coordxy, genericptr_t) NONNULLARG3;
|
||||
static void dofindgem(void);
|
||||
static boolean watchman_warn_fountain(struct monst *) NONNULLARG1;
|
||||
staticfn void dowatersnakes(void);
|
||||
staticfn void dowaterdemon(void);
|
||||
staticfn void dowaternymph(void);
|
||||
staticfn void gush(coordxy, coordxy, genericptr_t) NONNULLARG3;
|
||||
staticfn void dofindgem(void);
|
||||
staticfn boolean watchman_warn_fountain(struct monst *) NONNULLARG1;
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
@@ -34,7 +34,7 @@ floating_above(const char *what)
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* Fountain of snakes! */
|
||||
static void
|
||||
staticfn void
|
||||
dowatersnakes(void)
|
||||
{
|
||||
int num = rn1(5, 2);
|
||||
@@ -60,7 +60,7 @@ dowatersnakes(void)
|
||||
}
|
||||
|
||||
/* Water demon */
|
||||
static void
|
||||
staticfn void
|
||||
dowaterdemon(void)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -90,7 +90,7 @@ dowaterdemon(void)
|
||||
}
|
||||
|
||||
/* Water Nymph */
|
||||
static void
|
||||
staticfn void
|
||||
dowaternymph(void)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -130,7 +130,7 @@ dogushforth(int drinking)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gush(coordxy x, coordxy y, genericptr_t poolcnt)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -161,7 +161,7 @@ gush(coordxy x, coordxy y, genericptr_t poolcnt)
|
||||
}
|
||||
|
||||
/* Find a gem in the sparkling waters. */
|
||||
static void
|
||||
staticfn void
|
||||
dofindgem(void)
|
||||
{
|
||||
if (!Blind)
|
||||
@@ -175,7 +175,7 @@ dofindgem(void)
|
||||
exercise(A_WIS, TRUE); /* a discovery! */
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
watchman_warn_fountain(struct monst *mtmp)
|
||||
{
|
||||
if (is_watch(mtmp->data) && couldsee(mtmp->mx, mtmp->my)
|
||||
|
||||
+28
-28
@@ -6,25 +6,25 @@
|
||||
|
||||
extern const char what_is_an_unknown_object[]; /* from pager.c */
|
||||
|
||||
static void getpos_toggle_hilite_state(void);
|
||||
static void getpos_getvalids_selection(struct selectionvar *,
|
||||
staticfn void getpos_toggle_hilite_state(void);
|
||||
staticfn void getpos_getvalids_selection(struct selectionvar *,
|
||||
boolean (*)(coordxy, coordxy));
|
||||
static void getpos_help_keyxhelp(winid, const char *, const char *, int);
|
||||
static void getpos_help(boolean, const char *);
|
||||
static int QSORTCALLBACK cmp_coord_distu(const void *, const void *);
|
||||
static int gloc_filter_classify_glyph(int);
|
||||
static int gloc_filter_floodfill_matcharea(coordxy, coordxy);
|
||||
static void gloc_filter_floodfill(coordxy, coordxy);
|
||||
static void gloc_filter_init(void);
|
||||
static void gloc_filter_done(void);
|
||||
static void gather_locs(coord **, int *, int);
|
||||
static void truncate_to_map(coordxy *, coordxy *, schar, schar);
|
||||
static void getpos_refresh(void);
|
||||
staticfn void getpos_help_keyxhelp(winid, const char *, const char *, int);
|
||||
staticfn void getpos_help(boolean, const char *);
|
||||
staticfn int QSORTCALLBACK cmp_coord_distu(const void *, const void *);
|
||||
staticfn int gloc_filter_classify_glyph(int);
|
||||
staticfn int gloc_filter_floodfill_matcharea(coordxy, coordxy);
|
||||
staticfn void gloc_filter_floodfill(coordxy, coordxy);
|
||||
staticfn void gloc_filter_init(void);
|
||||
staticfn void gloc_filter_done(void);
|
||||
staticfn void gather_locs(coord **, int *, int);
|
||||
staticfn void truncate_to_map(coordxy *, coordxy *, schar, schar);
|
||||
staticfn void getpos_refresh(void);
|
||||
/* Callback function for getpos() to highlight desired map locations.
|
||||
* Parameter TRUE: initialize and highlight, FALSE: done (remove highlights).
|
||||
*/
|
||||
static void (*getpos_hilitefunc)(boolean) = (void (*)(boolean)) 0;
|
||||
static boolean (*getpos_getvalid)(coordxy, coordxy)
|
||||
staticfn void (*getpos_hilitefunc)(boolean) = (void (*)(boolean)) 0;
|
||||
staticfn boolean (*getpos_getvalid)(coordxy, coordxy)
|
||||
= (boolean (*)(coordxy, coordxy)) 0;
|
||||
enum getposHiliteState {
|
||||
HiliteNormalMap = 0,
|
||||
@@ -67,7 +67,7 @@ getpos_sethilite(
|
||||
positions and showing them via temporary S_goodpos symbol;
|
||||
when 'bgcolors' is On, there are three states and showing them via
|
||||
setting background color becomes the default */
|
||||
static void
|
||||
staticfn void
|
||||
getpos_toggle_hilite_state(void)
|
||||
{
|
||||
/* getpos_hilitefunc isn't Null */
|
||||
@@ -97,7 +97,7 @@ mapxy_valid(coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
getpos_getvalids_selection(
|
||||
struct selectionvar *sel,
|
||||
boolean (*validf)(coordxy, coordxy))
|
||||
@@ -132,7 +132,7 @@ static const char *const gloc_filtertxt[NUM_GFILTER] = {
|
||||
" in this area"
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
getpos_help_keyxhelp(
|
||||
winid tmpwin,
|
||||
const char *k1, const char *k2,
|
||||
@@ -162,7 +162,7 @@ getpos_help_keyxhelp(
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* the response for '?' help request in getpos() */
|
||||
static void
|
||||
staticfn void
|
||||
getpos_help(boolean force, const char *goal)
|
||||
{
|
||||
static const char *const fastmovemode[2] = { "8 units at a time",
|
||||
@@ -307,7 +307,7 @@ getpos_help(boolean force, const char *goal)
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
cmp_coord_distu(const void *a, const void *b)
|
||||
{
|
||||
const coord *c1 = a;
|
||||
@@ -336,7 +336,7 @@ cmp_coord_distu(const void *a, const void *b)
|
||||
(isok((x), (y)) \
|
||||
&& (selection_getpoint((x),(y), gg.gloc_filter_map)))
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
gloc_filter_classify_glyph(int glyph)
|
||||
{
|
||||
int c;
|
||||
@@ -359,7 +359,7 @@ gloc_filter_classify_glyph(int glyph)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
gloc_filter_floodfill_matcharea(coordxy x, coordxy y)
|
||||
{
|
||||
int glyph = back_to_glyph(x, y);
|
||||
@@ -377,7 +377,7 @@ gloc_filter_floodfill_matcharea(coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gloc_filter_floodfill(coordxy x, coordxy y)
|
||||
{
|
||||
gg.gloc_filter_floodfill_match_glyph = back_to_glyph(x, y);
|
||||
@@ -386,7 +386,7 @@ gloc_filter_floodfill(coordxy x, coordxy y)
|
||||
selection_floodfill(gg.gloc_filter_map, x, y, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gloc_filter_init(void)
|
||||
{
|
||||
if (iflags.getloc_filter == GFILTER_AREA) {
|
||||
@@ -407,7 +407,7 @@ gloc_filter_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gloc_filter_done(void)
|
||||
{
|
||||
if (gg.gloc_filter_map) {
|
||||
@@ -490,7 +490,7 @@ gather_locs_interesting(coordxy x, coordxy y, int gloc)
|
||||
RESTORE_WARNINGS
|
||||
|
||||
/* gather locations for monsters or objects shown on the map */
|
||||
static void
|
||||
staticfn void
|
||||
gather_locs(coord **arr_p, int *cnt_p, int gloc)
|
||||
{
|
||||
int pass, idx;
|
||||
@@ -706,7 +706,7 @@ getpos_menu(coord *ccp, int gloc)
|
||||
}
|
||||
|
||||
/* add dx,dy to cx,cy, truncating at map edges */
|
||||
static void
|
||||
staticfn void
|
||||
truncate_to_map(coordxy *cx, coordxy *cy, schar dx, schar dy)
|
||||
{
|
||||
/* diagonal moves complicate this... */
|
||||
@@ -730,7 +730,7 @@ truncate_to_map(coordxy *cx, coordxy *cy, schar dx, schar dy)
|
||||
|
||||
/* called when ^R typed; if '$' is being shown for valid spots, remove that;
|
||||
if alternate background color is being shown for that, redraw it */
|
||||
static void
|
||||
staticfn void
|
||||
getpos_refresh(void)
|
||||
{
|
||||
if (getpos_hilitefunc && getpos_hilite_state == HiliteGoodposSymbol) {
|
||||
|
||||
+64
-64
@@ -8,40 +8,40 @@
|
||||
|
||||
/* #define DEBUG */ /* uncomment for debugging */
|
||||
|
||||
static boolean could_move_onto_boulder(coordxy, coordxy);
|
||||
static int moverock(void);
|
||||
static void dosinkfall(void);
|
||||
static boolean findtravelpath(int);
|
||||
static boolean trapmove(coordxy, coordxy, struct trap *);
|
||||
static int QSORTCALLBACK notice_mons_cmp(const genericptr, const genericptr);
|
||||
static schar u_simple_floortyp(coordxy, coordxy);
|
||||
static boolean swim_move_danger(coordxy, coordxy);
|
||||
static boolean domove_bump_mon(struct monst *, int) NONNULLARG1;
|
||||
static boolean domove_attackmon_at(struct monst *, coordxy, coordxy,
|
||||
staticfn boolean could_move_onto_boulder(coordxy, coordxy);
|
||||
staticfn int moverock(void);
|
||||
staticfn void dosinkfall(void);
|
||||
staticfn boolean findtravelpath(int);
|
||||
staticfn boolean trapmove(coordxy, coordxy, struct trap *);
|
||||
staticfn int QSORTCALLBACK notice_mons_cmp(const genericptr, const genericptr);
|
||||
staticfn schar u_simple_floortyp(coordxy, coordxy);
|
||||
staticfn boolean swim_move_danger(coordxy, coordxy);
|
||||
staticfn boolean domove_bump_mon(struct monst *, int) NONNULLARG1;
|
||||
staticfn boolean domove_attackmon_at(struct monst *, coordxy, coordxy,
|
||||
boolean *) NONNULLPTRS;
|
||||
static boolean domove_fight_ironbars(coordxy, coordxy);
|
||||
static boolean domove_fight_web(coordxy, coordxy);
|
||||
static boolean domove_swap_with_pet(struct monst *,
|
||||
staticfn boolean domove_fight_ironbars(coordxy, coordxy);
|
||||
staticfn boolean domove_fight_web(coordxy, coordxy);
|
||||
staticfn boolean domove_swap_with_pet(struct monst *,
|
||||
coordxy, coordxy) NONNULLARG1;
|
||||
static boolean domove_fight_empty(coordxy, coordxy);
|
||||
static boolean air_turbulence(void);
|
||||
static void slippery_ice_fumbling(void);
|
||||
static boolean impaired_movement(coordxy *, coordxy *) NONNULLPTRS;
|
||||
static boolean avoid_moving_on_trap(coordxy, coordxy, boolean);
|
||||
static boolean avoid_moving_on_liquid(coordxy, coordxy, boolean);
|
||||
static boolean avoid_running_into_trap_or_liquid(coordxy, coordxy);
|
||||
static boolean move_out_of_bounds(coordxy, coordxy);
|
||||
static boolean carrying_too_much(void);
|
||||
static boolean escape_from_sticky_mon(coordxy, coordxy);
|
||||
static void domove_core(void);
|
||||
static void maybe_smudge_engr(coordxy, coordxy, coordxy, coordxy);
|
||||
static struct monst *monstinroom(struct permonst *, int) NONNULLARG1;
|
||||
static boolean furniture_present(int, int);
|
||||
static void move_update(boolean);
|
||||
static int pickup_checks(void);
|
||||
static boolean doorless_door(coordxy, coordxy);
|
||||
static void maybe_wail(void);
|
||||
static boolean water_turbulence(coordxy *, coordxy *);
|
||||
staticfn boolean domove_fight_empty(coordxy, coordxy);
|
||||
staticfn boolean air_turbulence(void);
|
||||
staticfn void slippery_ice_fumbling(void);
|
||||
staticfn boolean impaired_movement(coordxy *, coordxy *) NONNULLPTRS;
|
||||
staticfn boolean avoid_moving_on_trap(coordxy, coordxy, boolean);
|
||||
staticfn boolean avoid_moving_on_liquid(coordxy, coordxy, boolean);
|
||||
staticfn boolean avoid_running_into_trap_or_liquid(coordxy, coordxy);
|
||||
staticfn boolean move_out_of_bounds(coordxy, coordxy);
|
||||
staticfn boolean carrying_too_much(void);
|
||||
staticfn boolean escape_from_sticky_mon(coordxy, coordxy);
|
||||
staticfn void domove_core(void);
|
||||
staticfn void maybe_smudge_engr(coordxy, coordxy, coordxy, coordxy);
|
||||
staticfn struct monst *monstinroom(struct permonst *, int) NONNULLARG1;
|
||||
staticfn boolean furniture_present(int, int);
|
||||
staticfn void move_update(boolean);
|
||||
staticfn int pickup_checks(void);
|
||||
staticfn boolean doorless_door(coordxy, coordxy);
|
||||
staticfn void maybe_wail(void);
|
||||
staticfn boolean water_turbulence(coordxy *, coordxy *);
|
||||
|
||||
#define IS_SHOP(x) (gr.rooms[x].rtype >= SHOPBASE)
|
||||
|
||||
@@ -131,7 +131,7 @@ revive_nasty(coordxy x, coordxy y, const char *msg)
|
||||
|
||||
/* can hero move onto a spot containing one or more boulders?
|
||||
used for m<dir> and travel and during boulder push failure */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
could_move_onto_boulder(coordxy sx, coordxy sy)
|
||||
{
|
||||
/* can if able to phaze through rock (must be poly'd, so not riding) */
|
||||
@@ -152,7 +152,7 @@ could_move_onto_boulder(coordxy sx, coordxy sy)
|
||||
return squeezeablylightinvent();
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
moverock(void)
|
||||
{
|
||||
coordxy rx, ry, sx, sy;
|
||||
@@ -752,7 +752,7 @@ movobj(struct obj *obj, coordxy ox, coordxy oy)
|
||||
newsym(ox, oy);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dosinkfall(void)
|
||||
{
|
||||
static const char fell_on_sink[] = "fell onto a sink";
|
||||
@@ -1164,7 +1164,7 @@ test_move(
|
||||
* gt.travelmap keeps track of map locations we've moved through
|
||||
* this travel session. It will be cleared once the travel stops.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
findtravelpath(int mode)
|
||||
{
|
||||
if (!gt.travelmap)
|
||||
@@ -1446,7 +1446,7 @@ is_valid_travelpt(coordxy x, coordxy y)
|
||||
/* try to escape being stuck in a trapped state by walking out of it;
|
||||
return true iff moving should continue to intended destination
|
||||
(all failures and most successful escapes leave hero at original spot) */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
trapmove(
|
||||
coordxy x, coordxy y, /* targeted destination, <u.ux+u.dx,u.uy+u.dy> */
|
||||
struct trap *desttrap) /* nonnull if another trap at <x,y> */
|
||||
@@ -1631,7 +1631,7 @@ notice_mon(struct monst *mtmp)
|
||||
}
|
||||
}
|
||||
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
notice_mons_cmp(const genericptr ptr1, const genericptr ptr2)
|
||||
{
|
||||
const struct monst *m1 = *(const struct monst **) ptr1,
|
||||
@@ -1720,7 +1720,7 @@ u_locomotion(const char *def)
|
||||
}
|
||||
|
||||
/* Return a simplified floor solid/liquid state based on hero's state */
|
||||
static schar
|
||||
staticfn schar
|
||||
u_simple_floortyp(coordxy x, coordxy y)
|
||||
{
|
||||
boolean u_in_air = (Levitation || Flying || !grounded(gy.youmonst.data));
|
||||
@@ -1768,7 +1768,7 @@ handle_tip(int tip)
|
||||
}
|
||||
|
||||
/* Is it dangerous for hero to move to x,y due to water or lava? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
swim_move_danger(coordxy x, coordxy y)
|
||||
{
|
||||
schar newtyp = u_simple_floortyp(x, y);
|
||||
@@ -1809,7 +1809,7 @@ swim_move_danger(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* moving with 'm' prefix, bump into a monster? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_bump_mon(struct monst *mtmp, int glyph)
|
||||
{
|
||||
/* If they used a 'm' command, trying to move onto a monster
|
||||
@@ -1839,7 +1839,7 @@ domove_bump_mon(struct monst *mtmp, int glyph)
|
||||
returns TRUE if hero movement is used up.
|
||||
sets displaceu, if hero and monster could swap places instead.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_attackmon_at(
|
||||
struct monst *mtmp,
|
||||
coordxy x, coordxy y,
|
||||
@@ -1878,7 +1878,7 @@ domove_attackmon_at(
|
||||
}
|
||||
|
||||
/* force-fight iron bars with your weapon? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_fight_ironbars(coordxy x, coordxy y)
|
||||
{
|
||||
if (gc.context.forcefight && levl[x][y].typ == IRONBARS && uwep) {
|
||||
@@ -1903,7 +1903,7 @@ domove_fight_ironbars(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* force-fight a spider web with your weapon */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_fight_web(coordxy x, coordxy y)
|
||||
{
|
||||
struct trap *trap = t_at(x, y);
|
||||
@@ -1980,7 +1980,7 @@ domove_fight_web(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* maybe swap places with a pet? returns TRUE if swapped places */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y)
|
||||
{
|
||||
struct trap *trap;
|
||||
@@ -2100,7 +2100,7 @@ domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* force-fight (x,y) which doesn't have anything to fight */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
domove_fight_empty(coordxy x, coordxy y)
|
||||
{
|
||||
static const char unknown_obstacle[] = "an unknown obstacle";
|
||||
@@ -2211,7 +2211,7 @@ domove_fight_empty(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* does the plane of air disturb movement? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
air_turbulence(void)
|
||||
{
|
||||
if (Is_airlevel(&u.uz) && rn2(4) && !Levitation && !Flying) {
|
||||
@@ -2234,7 +2234,7 @@ air_turbulence(void)
|
||||
}
|
||||
|
||||
/* does water disturb the movement? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
water_turbulence(coordxy *x, coordxy *y)
|
||||
{
|
||||
if (u.uinwater) {
|
||||
@@ -2265,7 +2265,7 @@ water_turbulence(coordxy *x, coordxy *y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
slippery_ice_fumbling(void)
|
||||
{
|
||||
boolean on_ice = !Levitation && is_ice(u.ux, u.uy);
|
||||
@@ -2294,7 +2294,7 @@ u_maybe_impaired(void)
|
||||
}
|
||||
|
||||
/* change movement dir if impaired. return TRUE if can't move */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
impaired_movement(coordxy *x, coordxy *y)
|
||||
{
|
||||
if (u_maybe_impaired()) {
|
||||
@@ -2313,7 +2313,7 @@ impaired_movement(coordxy *x, coordxy *y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
avoid_moving_on_trap(coordxy x, coordxy y, boolean msg)
|
||||
{
|
||||
struct trap *trap;
|
||||
@@ -2329,7 +2329,7 @@ avoid_moving_on_trap(coordxy x, coordxy y, boolean msg)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
avoid_moving_on_liquid(
|
||||
coordxy x, coordxy y,
|
||||
boolean msg)
|
||||
@@ -2361,7 +2361,7 @@ avoid_moving_on_liquid(
|
||||
|
||||
/* when running/rushing, avoid stepping on a known trap or pool of liquid.
|
||||
returns TRUE if avoided. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
avoid_running_into_trap_or_liquid(coordxy x, coordxy y)
|
||||
{
|
||||
boolean would_stop = (gc.context.run >= 2);
|
||||
@@ -2379,7 +2379,7 @@ avoid_running_into_trap_or_liquid(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* trying to move out-of-bounds? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
move_out_of_bounds(coordxy x, coordxy y)
|
||||
{
|
||||
if (!isok(x, y)) {
|
||||
@@ -2409,7 +2409,7 @@ move_out_of_bounds(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* carrying too much to be able to move? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
carrying_too_much(void)
|
||||
{
|
||||
int wtcap;
|
||||
@@ -2432,7 +2432,7 @@ carrying_too_much(void)
|
||||
|
||||
/* try to pull free from sticking monster, or you release a monster
|
||||
you're sticking to. returns TRUE if you lose your movement. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
escape_from_sticky_mon(coordxy x, coordxy y)
|
||||
{
|
||||
if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) {
|
||||
@@ -2499,7 +2499,7 @@ domove(void)
|
||||
gd.domove_attempting = 0L;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
domove_core(void)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -2831,7 +2831,7 @@ runmode_delay_output(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
maybe_smudge_engr(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
|
||||
{
|
||||
struct engr *ep;
|
||||
@@ -3181,7 +3181,7 @@ spoteffects(boolean pick)
|
||||
}
|
||||
|
||||
/* returns first matching monster */
|
||||
static struct monst *
|
||||
staticfn struct monst *
|
||||
monstinroom(struct permonst *mdat, int roomno)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -3197,7 +3197,7 @@ monstinroom(struct permonst *mdat, int roomno)
|
||||
}
|
||||
|
||||
/* check whether room contains a particular type of furniture */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
furniture_present(int furniture, int roomno)
|
||||
{
|
||||
int x, y, lx, ly, hx, hy;
|
||||
@@ -3303,7 +3303,7 @@ in_town(coordxy x, coordxy y)
|
||||
return !has_subrooms;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
move_update(boolean newlev)
|
||||
{
|
||||
char c, *ptr1, *ptr2, *ptr3, *ptr4;
|
||||
@@ -3502,7 +3502,7 @@ check_special_room(boolean newlev)
|
||||
0 = cannot pickup, no time taken
|
||||
-1 = do normal pickup
|
||||
-2 = loot the monster */
|
||||
static int
|
||||
staticfn int
|
||||
pickup_checks(void)
|
||||
{
|
||||
struct trap *traphere;
|
||||
@@ -3776,7 +3776,7 @@ lookaround(void)
|
||||
}
|
||||
|
||||
/* check for a doorway which lacks its door (NODOOR or BROKEN) */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
doorless_door(coordxy x, coordxy y)
|
||||
{
|
||||
struct rm *lev_p = &levl[x][y];
|
||||
@@ -3914,7 +3914,7 @@ unmul(const char *msg_override)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
maybe_wail(void)
|
||||
{
|
||||
static short powers[] = { TELEPORT, SEE_INVIS, POISON_RES, COLD_RES,
|
||||
|
||||
+44
-43
@@ -14,28 +14,28 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void enlght_out(const char *);
|
||||
static void enlght_line(const char *, const char *, const char *,
|
||||
staticfn void enlght_out(const char *);
|
||||
staticfn void enlght_line(const char *, const char *, const char *,
|
||||
const char *);
|
||||
static char *enlght_combatinc(const char *, int, int, char *);
|
||||
static void enlght_halfdmg(int, int);
|
||||
static boolean walking_on_water(void);
|
||||
static boolean cause_known(int);
|
||||
static char *attrval(int, int, char *);
|
||||
static char *fmt_elapsed_time(char *, int);
|
||||
static void background_enlightenment(int, int);
|
||||
static void basics_enlightenment(int, int);
|
||||
static void characteristics_enlightenment(int, int);
|
||||
static void one_characteristic(int, int, int);
|
||||
static void status_enlightenment(int, int);
|
||||
static void weapon_insight(int);
|
||||
static void attributes_enlightenment(int, int);
|
||||
static void show_achievements(int);
|
||||
static int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr);
|
||||
static int num_extinct(void);
|
||||
static int num_gone(int, int *);
|
||||
static char *size_str(int);
|
||||
static void item_resistance_message(int, const char *, int);
|
||||
staticfn char *enlght_combatinc(const char *, int, int, char *);
|
||||
staticfn void enlght_halfdmg(int, int);
|
||||
staticfn boolean walking_on_water(void);
|
||||
staticfn boolean cause_known(int);
|
||||
staticfn char *attrval(int, int, char *);
|
||||
staticfn char *fmt_elapsed_time(char *, int);
|
||||
staticfn void background_enlightenment(int, int);
|
||||
staticfn void basics_enlightenment(int, int);
|
||||
staticfn void characteristics_enlightenment(int, int);
|
||||
staticfn void one_characteristic(int, int, int);
|
||||
staticfn void status_enlightenment(int, int);
|
||||
staticfn void weapon_insight(int);
|
||||
staticfn void attributes_enlightenment(int, int);
|
||||
staticfn void show_achievements(int);
|
||||
staticfn int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr);
|
||||
staticfn int num_extinct(void);
|
||||
staticfn int num_gone(int, int *);
|
||||
staticfn char *size_str(int);
|
||||
staticfn void item_resistance_message(int, const char *, int);
|
||||
|
||||
extern const char *const hu_stat[]; /* hunger status from eat.c */
|
||||
extern const char *const enc_stat[]; /* encumbrance status from botl.c */
|
||||
@@ -112,7 +112,7 @@ static struct ll_achieve_msg achieve_msg [] = {
|
||||
#define you_have_X(something) \
|
||||
enl_msg(You_, have, (const char *) "", (something), "")
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
enlght_out(const char *buf)
|
||||
{
|
||||
if (ge.en_via_menu) {
|
||||
@@ -121,7 +121,7 @@ enlght_out(const char *buf)
|
||||
putstr(ge.en_win, 0, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
enlght_line(
|
||||
const char *start,
|
||||
const char *middle,
|
||||
@@ -154,7 +154,7 @@ enlght_line(
|
||||
}
|
||||
|
||||
/* format increased chance to hit or damage or defense (Protection) */
|
||||
static char *
|
||||
staticfn char *
|
||||
enlght_combatinc(const char *inctyp, int incamt, int final, char *outbuf)
|
||||
{
|
||||
const char *modif, *bonus;
|
||||
@@ -191,7 +191,7 @@ enlght_combatinc(const char *inctyp, int incamt, int final, char *outbuf)
|
||||
}
|
||||
|
||||
/* report half physical or half spell damage */
|
||||
static void
|
||||
staticfn void
|
||||
enlght_halfdmg(int category, int final)
|
||||
{
|
||||
const char *category_name;
|
||||
@@ -214,7 +214,7 @@ enlght_halfdmg(int category, int final)
|
||||
}
|
||||
|
||||
/* is hero actively using water walking capability on water (or lava)? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
walking_on_water(void)
|
||||
{
|
||||
if (u.uinwater || Levitation || Flying)
|
||||
@@ -257,7 +257,7 @@ trap_predicament(char *outbuf, int final, boolean wizxtra)
|
||||
/* check whether hero is wearing something that player definitely knows
|
||||
confers the target property; item must have been seen and its type
|
||||
discovered but it doesn't necessarily have to be fully identified */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cause_known(
|
||||
int propindx) /* index of a property which can be conveyed by worn item */
|
||||
{
|
||||
@@ -277,7 +277,7 @@ cause_known(
|
||||
}
|
||||
|
||||
/* format a characteristic value, accommodating Strength's strangeness */
|
||||
static char *
|
||||
staticfn char *
|
||||
attrval(
|
||||
int attrindx,
|
||||
int attrvalue,
|
||||
@@ -304,7 +304,7 @@ attrval(
|
||||
(note: for a list of more than two entries, nethack usually includes the
|
||||
[style-wise] optional comma before "and" but in this instance it does not)
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
fmt_elapsed_time(char *outbuf, int final)
|
||||
{
|
||||
int fieldcnt;
|
||||
@@ -432,7 +432,7 @@ enlightenment(
|
||||
|
||||
/*ARGSUSED*/
|
||||
/* display role, race, alignment and such to en_win */
|
||||
static void
|
||||
staticfn void
|
||||
background_enlightenment(int unused_mode UNUSED, int final)
|
||||
{
|
||||
const char *role_titl, *rank_titl;
|
||||
@@ -691,7 +691,7 @@ background_enlightenment(int unused_mode UNUSED, int final)
|
||||
/* hit points, energy points, armor class -- essential information which
|
||||
doesn't fit very well in other categories */
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
basics_enlightenment(int mode UNUSED, int final)
|
||||
{
|
||||
static char Power[] = "energy points (spell power)";
|
||||
@@ -790,7 +790,7 @@ basics_enlightenment(int mode UNUSED, int final)
|
||||
}
|
||||
|
||||
/* characteristics: expanded version of bottom line strength, dexterity, &c */
|
||||
static void
|
||||
staticfn void
|
||||
characteristics_enlightenment(int mode, int final)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -809,7 +809,7 @@ characteristics_enlightenment(int mode, int final)
|
||||
}
|
||||
|
||||
/* display one attribute value for characteristics_enlightenment() */
|
||||
static void
|
||||
staticfn void
|
||||
one_characteristic(int mode, int final, int attrindx)
|
||||
{
|
||||
extern const char *const attrname[]; /* attrib.c */
|
||||
@@ -903,7 +903,7 @@ one_characteristic(int mode, int final, int attrindx)
|
||||
}
|
||||
|
||||
/* status: selected obvious capabilities, assorted troubles */
|
||||
static void
|
||||
staticfn void
|
||||
status_enlightenment(int mode, int final)
|
||||
{
|
||||
boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE;
|
||||
@@ -1232,7 +1232,7 @@ status_enlightenment(int mode, int final)
|
||||
}
|
||||
|
||||
/* extracted from status_enlightenment() to reduce clutter there */
|
||||
static void
|
||||
staticfn void
|
||||
weapon_insight(int final)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -1430,7 +1430,7 @@ weapon_insight(int final)
|
||||
} /* skill applies */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
item_resistance_message(
|
||||
int adtyp,
|
||||
const char *prot_message,
|
||||
@@ -1449,7 +1449,7 @@ item_resistance_message(
|
||||
}
|
||||
|
||||
/* attributes: intrinsics and the like, other non-obvious capabilities */
|
||||
static void
|
||||
staticfn void
|
||||
attributes_enlightenment(
|
||||
int unused_mode UNUSED,
|
||||
int final)
|
||||
@@ -2190,7 +2190,7 @@ show_conduct(int final)
|
||||
* Achievements (see 'enum achievements' in you.h).
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
show_achievements(
|
||||
int final) /* 'final' is used "behind the curtain" by enl_foo() macros */
|
||||
{
|
||||
@@ -2547,7 +2547,8 @@ show_gamelog(int final)
|
||||
* Vanquished monsters.
|
||||
*/
|
||||
|
||||
/* the two uppercase choices are implemented but suppressed from menu */
|
||||
/* the two uppercase choices are implemented but suppressed from menu.
|
||||
also used in options.c */
|
||||
const char *const vanqorders[NUM_VANQ_ORDER_MODES][3] = {
|
||||
{ "t", "traditional: by monster level",
|
||||
"traditional: by monster level, by internal monster index" },
|
||||
@@ -2567,7 +2568,7 @@ const char *const vanqorders[NUM_VANQ_ORDER_MODES][3] = {
|
||||
"by count, low to high, by internal index within tied count" },
|
||||
};
|
||||
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
vanqsort_cmp(
|
||||
const genericptr vptr1,
|
||||
const genericptr vptr2)
|
||||
@@ -2879,7 +2880,7 @@ num_genocides(void)
|
||||
}
|
||||
|
||||
/* return a count of the number of extinct species */
|
||||
static int
|
||||
staticfn int
|
||||
num_extinct(void)
|
||||
{
|
||||
int i, n = 0;
|
||||
@@ -2894,7 +2895,7 @@ num_extinct(void)
|
||||
}
|
||||
|
||||
/* collect both genocides and extinctions, skipping uniques */
|
||||
static int
|
||||
staticfn int
|
||||
num_gone(int mvflags, int *mindx)
|
||||
{
|
||||
uchar mflg = (uchar) mvflags;
|
||||
@@ -3110,7 +3111,7 @@ align_str(aligntyp alignment)
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
size_str(int msize)
|
||||
{
|
||||
static char outbuf[40];
|
||||
|
||||
+74
-78
@@ -10,45 +10,45 @@
|
||||
#define CONTAINED_SYM '>' /* designator for inside a container */
|
||||
#define HANDS_SYM '-' /* hands|fingers|self depending on context */
|
||||
|
||||
static void inuse_classify(Loot *, struct obj *);
|
||||
static char *loot_xname(struct obj *);
|
||||
static int invletter_value(char);
|
||||
static int QSORTCALLBACK sortloot_cmp(const genericptr, const genericptr);
|
||||
static void reorder_invent(void);
|
||||
static struct obj *addinv_core0(struct obj *, struct obj *,
|
||||
staticfn void inuse_classify(Loot *, struct obj *);
|
||||
staticfn char *loot_xname(struct obj *);
|
||||
staticfn int invletter_value(char);
|
||||
staticfn int QSORTCALLBACK sortloot_cmp(const genericptr, const genericptr);
|
||||
staticfn void reorder_invent(void);
|
||||
staticfn struct obj *addinv_core0(struct obj *, struct obj *,
|
||||
boolean) NONNULLARG1;
|
||||
static void noarmor(boolean);
|
||||
static void invdisp_nothing(const char *, const char *);
|
||||
static boolean worn_wield_only(struct obj *);
|
||||
static char *cinv_doname(struct obj *);
|
||||
static char *cinv_ansimpleoname(struct obj *);
|
||||
static boolean only_here(struct obj *);
|
||||
static void compactify(char *);
|
||||
static boolean taking_off(const char *);
|
||||
static void mime_action(const char *);
|
||||
static char *getobj_hands_txt(const char *, char *);
|
||||
static int ckvalidcat(struct obj *);
|
||||
static int ckunpaid(struct obj *);
|
||||
static char *safeq_xprname(struct obj *);
|
||||
static char *safeq_shortxprname(struct obj *);
|
||||
static char display_pickinv(const char *, const char *, const char *,
|
||||
staticfn void noarmor(boolean);
|
||||
staticfn void invdisp_nothing(const char *, const char *);
|
||||
staticfn boolean worn_wield_only(struct obj *);
|
||||
staticfn char *cinv_doname(struct obj *);
|
||||
staticfn char *cinv_ansimpleoname(struct obj *);
|
||||
staticfn boolean only_here(struct obj *);
|
||||
staticfn void compactify(char *);
|
||||
staticfn boolean taking_off(const char *);
|
||||
staticfn void mime_action(const char *);
|
||||
staticfn char *getobj_hands_txt(const char *, char *);
|
||||
staticfn int ckvalidcat(struct obj *);
|
||||
staticfn int ckunpaid(struct obj *);
|
||||
staticfn char *safeq_xprname(struct obj *);
|
||||
staticfn char *safeq_shortxprname(struct obj *);
|
||||
staticfn char display_pickinv(const char *, const char *, const char *,
|
||||
boolean, boolean, long *);
|
||||
static char display_used_invlets(char);
|
||||
static boolean this_type_only(struct obj *);
|
||||
static void dounpaid(int, int, int);
|
||||
static struct obj *find_unpaid(struct obj *, struct obj **);
|
||||
static void menu_identify(int);
|
||||
static boolean tool_being_used(struct obj *);
|
||||
static int adjust_ok(struct obj *);
|
||||
static int adjust_gold_ok(struct obj *);
|
||||
static int doorganize_core(struct obj *);
|
||||
static char obj_to_let(struct obj *);
|
||||
static boolean item_naming_classification(struct obj *, char *, char *);
|
||||
static int item_reading_classification(struct obj *, char *);
|
||||
static void ia_addmenu(winid, int, char, const char *);
|
||||
static void itemactions_pushkeys(struct obj *, int);
|
||||
static int itemactions(struct obj *);
|
||||
static int dispinv_with_action(char *, boolean, const char *);
|
||||
staticfn char display_used_invlets(char);
|
||||
staticfn boolean this_type_only(struct obj *);
|
||||
staticfn void dounpaid(int, int, int);
|
||||
staticfn struct obj *find_unpaid(struct obj *, struct obj **);
|
||||
staticfn void menu_identify(int);
|
||||
staticfn boolean tool_being_used(struct obj *);
|
||||
staticfn int adjust_ok(struct obj *);
|
||||
staticfn int adjust_gold_ok(struct obj *);
|
||||
staticfn int doorganize_core(struct obj *);
|
||||
staticfn char obj_to_let(struct obj *);
|
||||
staticfn boolean item_naming_classification(struct obj *, char *, char *);
|
||||
staticfn int item_reading_classification(struct obj *, char *);
|
||||
staticfn void ia_addmenu(winid, int, char, const char *);
|
||||
staticfn void itemactions_pushkeys(struct obj *, int);
|
||||
staticfn int itemactions(struct obj *);
|
||||
staticfn int dispinv_with_action(char *, boolean, const char *);
|
||||
|
||||
/* enum and structs are defined in wintype.h */
|
||||
static win_request_info wri_info;
|
||||
@@ -76,7 +76,7 @@ static const char *inuse_headers[] = { /* [4] shown first, [1] last */
|
||||
|
||||
/* sortloot() classification for in-use sort;
|
||||
called at most once [per sort] for each object */
|
||||
static void
|
||||
staticfn void
|
||||
inuse_classify(Loot *sort_item, struct obj *obj)
|
||||
{
|
||||
long w_mask = (obj->owornmask & (W_ACCESSORY | W_WEAPONS | W_ARMOR));
|
||||
@@ -315,7 +315,7 @@ loot_classify(Loot *sort_item, struct obj *obj)
|
||||
}
|
||||
|
||||
/* sortloot() formatting routine; for alphabetizing, not shown to user */
|
||||
static char *
|
||||
staticfn char *
|
||||
loot_xname(struct obj *obj)
|
||||
{
|
||||
struct obj saveo;
|
||||
@@ -397,7 +397,7 @@ loot_xname(struct obj *obj)
|
||||
}
|
||||
|
||||
/* '$'==1, 'a'-'z'==2..27, 'A'-'Z'==28..53, '#'==54, catchall 55 */
|
||||
static int
|
||||
staticfn int
|
||||
invletter_value(char c)
|
||||
{
|
||||
return ('a' <= c && c <= 'z') ? (c - 'a' + 2)
|
||||
@@ -408,7 +408,7 @@ invletter_value(char c)
|
||||
}
|
||||
|
||||
/* qsort comparison routine for sortloot() */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
sortloot_cmp(const genericptr vptr1, const genericptr vptr2)
|
||||
{
|
||||
struct sortloot_item *sli1 = (struct sortloot_item *) vptr1,
|
||||
@@ -744,7 +744,7 @@ assigninvlet(struct obj *otmp)
|
||||
#define inv_rank(o) ((o)->invlet ^ 040)
|
||||
|
||||
/* sort the inventory; used by addinv() and doorganize() */
|
||||
static void
|
||||
staticfn void
|
||||
reorder_invent(void)
|
||||
{
|
||||
struct obj *otmp, *prev, *next;
|
||||
@@ -1038,7 +1038,7 @@ addinv_core2(struct obj *obj)
|
||||
* Add obj to the hero's inventory. Make sure the object is "free".
|
||||
* Adjust hero attributes as necessary.
|
||||
*/
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
addinv_core0(struct obj *obj, struct obj *other_obj,
|
||||
boolean update_perm_invent)
|
||||
{
|
||||
@@ -1581,7 +1581,7 @@ g_at(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* compact a string of inventory letters by dashing runs of letters */
|
||||
static void
|
||||
staticfn void
|
||||
compactify(char *buf)
|
||||
{
|
||||
int i1 = 1, i2 = 1;
|
||||
@@ -1626,13 +1626,13 @@ splittable(struct obj *obj)
|
||||
}
|
||||
|
||||
/* match the prompt for either 'T' or 'R' command */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
taking_off(const char *action)
|
||||
{
|
||||
return !strcmp(action, "take off") || !strcmp(action, "remove");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mime_action(const char *word)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -1673,7 +1673,7 @@ any_obj_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
/* return string describing your hands based on action. */
|
||||
static char *
|
||||
staticfn char *
|
||||
getobj_hands_txt(const char *action, char *qbuf)
|
||||
{
|
||||
if (!strcmp(action, "grease")) {
|
||||
@@ -2048,11 +2048,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
void
|
||||
silly_thing(const char *word,
|
||||
#ifdef OBSOLETE_HANDLING
|
||||
struct obj *otmp)
|
||||
#else
|
||||
struct obj *otmp UNUSED)
|
||||
#endif
|
||||
{
|
||||
#ifdef OBSOLETE_HANDLING
|
||||
/* 'P','R' vs 'W','T' handling is obsolete */
|
||||
@@ -2092,14 +2088,14 @@ silly_thing(const char *word,
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
ckvalidcat(struct obj *otmp)
|
||||
{
|
||||
/* use allow_category() from pickup.c */
|
||||
return (int) allow_category(otmp);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
ckunpaid(struct obj *otmp)
|
||||
{
|
||||
return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj)));
|
||||
@@ -2136,7 +2132,7 @@ static struct xprnctx {
|
||||
} safeq_xprn_ctx;
|
||||
|
||||
/* safe_qbuf() -> short_oname() callback */
|
||||
static char *
|
||||
staticfn char *
|
||||
safeq_xprname(struct obj *obj)
|
||||
{
|
||||
return xprname(obj, (char *) 0, safeq_xprn_ctx.let, safeq_xprn_ctx.dot,
|
||||
@@ -2144,7 +2140,7 @@ safeq_xprname(struct obj *obj)
|
||||
}
|
||||
|
||||
/* alternate safe_qbuf() -> short_oname() callback */
|
||||
static char *
|
||||
staticfn char *
|
||||
safeq_shortxprname(struct obj *obj)
|
||||
{
|
||||
return xprname(obj, ansimpleoname(obj), safeq_xprn_ctx.let,
|
||||
@@ -2530,7 +2526,7 @@ identify(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* menu of unidentified objects; select and identify up to id_limit of them */
|
||||
static void
|
||||
staticfn void
|
||||
menu_identify(int id_limit)
|
||||
{
|
||||
menu_item *pick_list;
|
||||
@@ -2728,7 +2724,7 @@ doperminv(void)
|
||||
}
|
||||
|
||||
/* should of course only be called for things in invent */
|
||||
static char
|
||||
staticfn char
|
||||
obj_to_let(struct obj *obj)
|
||||
{
|
||||
if (!flags.invlet_constant) {
|
||||
@@ -2855,7 +2851,7 @@ enum item_action_actions {
|
||||
};
|
||||
|
||||
/* construct text for the menu entries for IA_NAME_OBJ and IA_NAME_OTYP */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
item_naming_classification(
|
||||
struct obj *obj,
|
||||
char *onamebuf,
|
||||
@@ -2895,7 +2891,7 @@ item_naming_classification(
|
||||
}
|
||||
|
||||
/* construct text for the menu entries for IA_READ_OBJ */
|
||||
static int
|
||||
staticfn int
|
||||
item_reading_classification(struct obj *obj, char *outbuf)
|
||||
{
|
||||
int otyp = obj->otyp, res = IA_READ_OBJ;
|
||||
@@ -2936,7 +2932,7 @@ item_reading_classification(struct obj *obj, char *outbuf)
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
ia_addmenu(winid win, int act, char let, const char *txt)
|
||||
{
|
||||
anything any;
|
||||
@@ -2948,7 +2944,7 @@ ia_addmenu(winid win, int act, char let, const char *txt)
|
||||
ATR_NONE, clr, txt, MENU_ITEMFLAGS_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
itemactions_pushkeys(struct obj *otmp, int act)
|
||||
{
|
||||
switch (act) {
|
||||
@@ -3083,7 +3079,7 @@ itemactions_pushkeys(struct obj *otmp, int act)
|
||||
}
|
||||
|
||||
/* Show menu of possible actions hero could do with item otmp */
|
||||
static int
|
||||
staticfn int
|
||||
itemactions(struct obj *otmp)
|
||||
{
|
||||
int n, act = IA_NONE;
|
||||
@@ -3420,7 +3416,7 @@ itemactions(struct obj *otmp)
|
||||
order to preform context-sensitive item action on it; always returns 'ok';
|
||||
invent subsets specified by the ')', '[', '(', '=', '"', or '*' commands
|
||||
when they're invoked with the 'm' prefix (or without it for '*') */
|
||||
static int
|
||||
staticfn int
|
||||
dispinv_with_action(
|
||||
char *lets, /* list of invlet values to include */
|
||||
boolean use_inuse_ordering, /* affects sortloot() and header labels */
|
||||
@@ -3475,7 +3471,7 @@ ddoinv(void)
|
||||
* next unpaid object is returned. This routine recursively follows
|
||||
* containers.
|
||||
*/
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
find_unpaid(struct obj *list, struct obj **last_found)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -3511,7 +3507,7 @@ free_pickinv_cache(void)
|
||||
* Internal function used by display_inventory and getobj that can display
|
||||
* inventory and return a count as well as a letter.
|
||||
*/
|
||||
static char
|
||||
staticfn char
|
||||
display_pickinv(
|
||||
const char *lets, /* non-compacted list of invlet values */
|
||||
const char *xtra_choice, /* non-object "bare hands" or "fingers" */
|
||||
@@ -3906,7 +3902,7 @@ display_inventory(const char *lets, boolean want_reply)
|
||||
* Show what is current using inventory letters.
|
||||
*
|
||||
*/
|
||||
static char
|
||||
staticfn char
|
||||
display_used_invlets(char avoidlet)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -4092,7 +4088,7 @@ count_contents(
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dounpaid(
|
||||
int count, /* unpaid items in inventory */
|
||||
int floorcount, /* unpaid items on floor (rare) */
|
||||
@@ -4231,7 +4227,7 @@ dounpaid(
|
||||
}
|
||||
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
this_type_only(struct obj *obj)
|
||||
{
|
||||
boolean res = (obj->oclass == gt.this_type);
|
||||
@@ -4995,7 +4991,7 @@ doprwep(void)
|
||||
}
|
||||
|
||||
/* caller is responsible for checking !wearing_armor() */
|
||||
static void
|
||||
staticfn void
|
||||
noarmor(boolean report_uskin)
|
||||
{
|
||||
if (!uskin || !report_uskin) {
|
||||
@@ -5115,7 +5111,7 @@ dopramulet(void)
|
||||
}
|
||||
|
||||
/* is 'obj' a tool that's in use? can't simply check obj->owornmask */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
tool_being_used(struct obj *obj)
|
||||
{
|
||||
/*
|
||||
@@ -5334,7 +5330,7 @@ check_invent_gold(const char *why) /* 'why' == caller in case of warning */
|
||||
}
|
||||
|
||||
/* normal getobj callback for item to #adjust; excludes gold */
|
||||
static int
|
||||
staticfn int
|
||||
adjust_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj || obj->oclass == COIN_CLASS)
|
||||
@@ -5344,7 +5340,7 @@ adjust_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for item to #adjust if gold is wonky; allows gold */
|
||||
static int
|
||||
staticfn int
|
||||
adjust_gold_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -5485,7 +5481,7 @@ adjust_split(void)
|
||||
return doorganize_core(obj);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
doorganize_core(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp, *splitting, *bumped;
|
||||
@@ -5696,7 +5692,7 @@ doorganize_core(struct obj *obj)
|
||||
}
|
||||
|
||||
/* common to display_minventory and display_cinventory */
|
||||
static void
|
||||
staticfn void
|
||||
invdisp_nothing(const char *hdr, const char *txt)
|
||||
{
|
||||
winid win;
|
||||
@@ -5715,7 +5711,7 @@ invdisp_nothing(const char *hdr, const char *txt)
|
||||
}
|
||||
|
||||
/* query_objlist callback: return things that are worn or wielded */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
worn_wield_only(struct obj *obj)
|
||||
{
|
||||
#if 1
|
||||
@@ -5797,7 +5793,7 @@ display_minventory(
|
||||
|
||||
/* format a container name for cinventory_display(), inserting "trapped"
|
||||
if that's appropriate */
|
||||
static char *
|
||||
staticfn char *
|
||||
cinv_doname(struct obj *obj)
|
||||
{
|
||||
char *result = doname(obj);
|
||||
@@ -5829,7 +5825,7 @@ cinv_doname(struct obj *obj)
|
||||
}
|
||||
|
||||
/* used by safe_qbuf() if the full doname() result is too long */
|
||||
static char *
|
||||
staticfn char *
|
||||
cinv_ansimpleoname(struct obj *obj)
|
||||
{
|
||||
char *result = ansimpleoname(obj);
|
||||
@@ -5883,7 +5879,7 @@ display_cinventory(struct obj *obj)
|
||||
}
|
||||
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
only_here(struct obj *obj)
|
||||
{
|
||||
return (obj->ox == go.only.x && obj->oy == go.only.y);
|
||||
|
||||
+4
-4
@@ -32,8 +32,8 @@
|
||||
|
||||
static inline uint32_t lower_bits(uint64_t);
|
||||
static inline uint32_t upper_bits(uint64_t);
|
||||
static void isaac64_update(isaac64_ctx *);
|
||||
static void isaac64_mix(uint64_t[8]);
|
||||
staticfn void isaac64_update(isaac64_ctx *);
|
||||
staticfn void isaac64_mix(uint64_t[8]);
|
||||
|
||||
/* Extract ISAAC64_SZ_LOG bits (starting at bit 3). */
|
||||
static inline uint32_t lower_bits(uint64_t x)
|
||||
@@ -47,7 +47,7 @@ static inline uint32_t upper_bits(uint64_t y)
|
||||
return (y >> (ISAAC64_SZ_LOG+3)) & (ISAAC64_SZ-1);
|
||||
}
|
||||
|
||||
static void isaac64_update(isaac64_ctx *_ctx){
|
||||
staticfn void isaac64_update(isaac64_ctx *_ctx){
|
||||
uint64_t *m;
|
||||
uint64_t *r;
|
||||
uint64_t a;
|
||||
@@ -100,7 +100,7 @@ static void isaac64_update(isaac64_ctx *_ctx){
|
||||
_ctx->n=ISAAC64_SZ;
|
||||
}
|
||||
|
||||
static void isaac64_mix(uint64_t _x[8]){
|
||||
staticfn void isaac64_mix(uint64_t _x[8]){
|
||||
static const unsigned char SHIFT[8]={9,9,23,15,14,20,17,14};
|
||||
int i;
|
||||
for(i=0;i<8;i++){
|
||||
|
||||
+46
-26
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 light.c $NHDT-Date: 1702680171 2023/12/15 22:42:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.66 $ */
|
||||
/* NetHack 3.7 light.c $NHDT-Date: 1710549969 2024/03/16 00:46:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ */
|
||||
/* Copyright (c) Dean Luick, 1994 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -41,11 +41,12 @@
|
||||
#define LSF_SHOW 0x1 /* display the light source */
|
||||
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
|
||||
|
||||
static light_source *new_light_core(coordxy, coordxy,
|
||||
staticfn light_source *new_light_core(coordxy, coordxy,
|
||||
int, int, anything *) NONNULLPTRS;
|
||||
static void discard_flashes(void);
|
||||
static void write_ls(NHFILE *, light_source *);
|
||||
static int maybe_write_ls(NHFILE *, int, boolean);
|
||||
staticfn void delete_ls(light_source *);
|
||||
staticfn void discard_flashes(void);
|
||||
staticfn void write_ls(NHFILE *, light_source *);
|
||||
staticfn int maybe_write_ls(NHFILE *, int, boolean);
|
||||
|
||||
/* imported from vision.c, for small circles */
|
||||
extern const coordxy circle_data[];
|
||||
@@ -61,7 +62,7 @@ new_light_source(coordxy x, coordxy y, int range, int type, anything *id)
|
||||
}
|
||||
|
||||
/* Create a new light source and return it. Only used within this file. */
|
||||
static light_source *
|
||||
staticfn light_source *
|
||||
new_light_core(coordxy x, coordxy y, int range, int type, anything *id)
|
||||
{
|
||||
light_source *ls;
|
||||
@@ -89,14 +90,12 @@ new_light_core(coordxy x, coordxy y, int range, int type, anything *id)
|
||||
return ls;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete a light source. This assumes only one light source is attached
|
||||
* to an object at a time.
|
||||
*/
|
||||
/* Find and delete a light source.
|
||||
Assumes at most one light source is attached to an object at a time. */
|
||||
void
|
||||
del_light_source(int type, anything *id)
|
||||
{
|
||||
light_source *curr, *prev;
|
||||
light_source *curr;
|
||||
anything tmp_id;
|
||||
|
||||
tmp_id = cg.zeroany;
|
||||
@@ -115,23 +114,46 @@ del_light_source(int type, anything *id)
|
||||
break;
|
||||
}
|
||||
|
||||
for (prev = 0, curr = gl.light_base; curr; prev = curr, curr = curr->next) {
|
||||
/* find the light source from its id */
|
||||
for (curr = gl.light_base; curr; curr = curr->next) {
|
||||
if (curr->type != type)
|
||||
continue;
|
||||
if (curr->id.a_obj
|
||||
== ((curr->flags & LSF_NEEDS_FIXUP) ? tmp_id.a_obj : id->a_obj)) {
|
||||
== ((curr->flags & LSF_NEEDS_FIXUP) ? tmp_id.a_obj : id->a_obj))
|
||||
break;
|
||||
}
|
||||
if (curr) {
|
||||
delete_ls(curr);
|
||||
} else {
|
||||
impossible("del_light_source: not found type=%d, id=%s", type,
|
||||
fmt_ptr((genericptr_t) id->a_obj));
|
||||
}
|
||||
}
|
||||
|
||||
/* remove a light source from the light_base list and free it */
|
||||
staticfn void
|
||||
delete_ls(light_source *ls)
|
||||
{
|
||||
light_source *curr, *prev;
|
||||
|
||||
for (prev = 0, curr = gl.light_base; curr;
|
||||
prev = curr, curr = curr->next) {
|
||||
if (curr == ls) {
|
||||
if (prev)
|
||||
prev->next = curr->next;
|
||||
else
|
||||
gl.light_base = curr->next;
|
||||
|
||||
free((genericptr_t) curr);
|
||||
gv.vision_full_recalc = 1;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
impossible("del_light_source: not found type=%d, id=%s", type,
|
||||
fmt_ptr((genericptr_t) id->a_obj));
|
||||
if (curr) {
|
||||
assert(curr == ls);
|
||||
free((genericptr_t) ls);
|
||||
gv.vision_full_recalc = 1;
|
||||
} else {
|
||||
impossible("delete_ls not found, ls=%s", fmt_ptr((genericptr_t) ls));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Mark locations that are temporarily lit via mobile light sources. */
|
||||
@@ -327,17 +349,15 @@ transient_light_cleanup(void)
|
||||
}
|
||||
|
||||
/* camera flashes have Null object; caller wants to get rid of them now */
|
||||
static void
|
||||
staticfn void
|
||||
discard_flashes(void)
|
||||
{
|
||||
light_source *ls, *nxt_ls;
|
||||
|
||||
for (ls = gl.light_base; ls; ls = nxt_ls) {
|
||||
nxt_ls = ls->next;
|
||||
if (ls->type != LS_OBJECT)
|
||||
continue;
|
||||
if (!ls->id.a_obj)
|
||||
del_light_source(LS_OBJECT, &ls->id);
|
||||
if (ls->type == LS_OBJECT && !ls->id.a_obj)
|
||||
delete_ls(ls);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,7 +529,7 @@ relink_light_sources(boolean ghostly)
|
||||
* sources that would be written. If write_it is true, actually write
|
||||
* the light source out.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
maybe_write_ls(NHFILE *nhfp, int range, boolean write_it)
|
||||
{
|
||||
int count = 0, is_global;
|
||||
@@ -572,7 +592,7 @@ light_sources_sanity_check(void)
|
||||
}
|
||||
|
||||
/* Write a light source structure to disk. */
|
||||
static void
|
||||
staticfn void
|
||||
write_ls(NHFILE *nhfp, light_source *ls)
|
||||
{
|
||||
anything arg_save;
|
||||
|
||||
+10
-10
@@ -6,12 +6,12 @@
|
||||
#include "hack.h"
|
||||
|
||||
/* occupation callbacks */
|
||||
static int picklock(void);
|
||||
static int forcelock(void);
|
||||
staticfn int picklock(void);
|
||||
staticfn int forcelock(void);
|
||||
|
||||
static const char *lock_action(void);
|
||||
static boolean obstructed(coordxy, coordxy, boolean);
|
||||
static void chest_shatter_msg(struct obj *);
|
||||
staticfn const char *lock_action(void);
|
||||
staticfn boolean obstructed(coordxy, coordxy, boolean);
|
||||
staticfn void chest_shatter_msg(struct obj *);
|
||||
|
||||
boolean
|
||||
picking_lock(coordxy *x, coordxy *y)
|
||||
@@ -33,7 +33,7 @@ picking_at(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* produce an occupation string appropriate for the current activity */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
lock_action(void)
|
||||
{
|
||||
/* "unlocking"+2 == "locking" */
|
||||
@@ -63,7 +63,7 @@ lock_action(void)
|
||||
}
|
||||
|
||||
/* try to open/close a lock */
|
||||
static int
|
||||
staticfn int
|
||||
picklock(void)
|
||||
{
|
||||
if (gx.xlock.box) {
|
||||
@@ -207,7 +207,7 @@ breakchestlock(struct obj *box, boolean destroyit)
|
||||
}
|
||||
|
||||
/* try to force a locked chest */
|
||||
static int
|
||||
staticfn int
|
||||
forcelock(void)
|
||||
{
|
||||
if ((gx.xlock.box->ox != u.ux) || (gx.xlock.box->oy != u.uy))
|
||||
@@ -908,7 +908,7 @@ doopen_indir(coordxy x, coordxy y)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
obstructed(coordxy x, coordxy y, boolean quietly)
|
||||
{
|
||||
struct monst *mtmp = m_at(x, y);
|
||||
@@ -1257,7 +1257,7 @@ doorlock(struct obj *otmp, coordxy x, coordxy y)
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
chest_shatter_msg(struct obj *otmp)
|
||||
{
|
||||
const char *disposition;
|
||||
|
||||
+10
-10
@@ -40,12 +40,12 @@
|
||||
* random intervals.
|
||||
*/
|
||||
|
||||
static boolean md_start(coord *);
|
||||
static boolean md_stop(coord *, coord *);
|
||||
static boolean md_rush(struct monst *, int, int);
|
||||
static void newmail(struct mail_info *);
|
||||
staticfn boolean md_start(coord *);
|
||||
staticfn boolean md_stop(coord *, coord *);
|
||||
staticfn boolean md_rush(struct monst *, int, int);
|
||||
staticfn void newmail(struct mail_info *);
|
||||
#if defined(SIMPLE_MAIL) || defined(SERVER_ADMIN_MSG)
|
||||
static void read_simplemail(const char *mbox, boolean adminmsg);
|
||||
staticfn void read_simplemail(const char *mbox, boolean adminmsg);
|
||||
#endif
|
||||
|
||||
#if !defined(UNIX) && !defined(VMS)
|
||||
@@ -145,7 +145,7 @@ getmailstatus(void)
|
||||
* Pick coordinates for a starting position for the mail daemon. Called
|
||||
* from newmail() and newphone().
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
md_start(coord *startp)
|
||||
{
|
||||
coord testcc; /* scratch coordinates */
|
||||
@@ -243,7 +243,7 @@ md_start(coord *startp)
|
||||
* enexto(). Use enexto() as a last resort because enexto() chooses
|
||||
* its point randomly, which is not what we want.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
md_stop(coord *stopp, /* stopping position (we fill it in) */
|
||||
coord *startp) /* starting position (read only) */
|
||||
{
|
||||
@@ -273,7 +273,7 @@ md_stop(coord *stopp, /* stopping position (we fill it in) */
|
||||
}
|
||||
|
||||
/* Let the mail daemon have a larger vocabulary. */
|
||||
static NEARDATA const char *mail_text[] = { "Gangway!", "Look out!",
|
||||
staticfn NEARDATA const char *mail_text[] = { "Gangway!", "Look out!",
|
||||
"Pardon me!" };
|
||||
#define md_exclamations() (mail_text[rn2(3)])
|
||||
|
||||
@@ -283,7 +283,7 @@ static NEARDATA const char *mail_text[] = { "Gangway!", "Look out!",
|
||||
* FALSE if the md gets stuck in a position where there is a monster. Return
|
||||
* TRUE otherwise.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
md_rush(struct monst *md,
|
||||
int tx, int ty) /* destination of mail daemon */
|
||||
{
|
||||
@@ -387,7 +387,7 @@ md_rush(struct monst *md,
|
||||
|
||||
/* Deliver a scroll of mail. */
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
newmail(struct mail_info *info)
|
||||
{
|
||||
struct monst *md;
|
||||
|
||||
+22
-23
@@ -14,17 +14,17 @@
|
||||
(mptr->mlet == S_HUMAN && Role_if(role_pm) \
|
||||
&& (mptr->msound == MS_LEADER || mptr->msound == MS_NEMESIS))
|
||||
|
||||
static boolean uncommon(int);
|
||||
static int align_shift(struct permonst *);
|
||||
static int temperature_shift(struct permonst *);
|
||||
static boolean mk_gen_ok(int, unsigned, unsigned);
|
||||
static boolean wrong_elem_type(struct permonst *);
|
||||
static void m_initgrp(struct monst *, coordxy, coordxy, int, mmflags_nht);
|
||||
static void m_initthrow(struct monst *, int, int);
|
||||
static void m_initweap(struct monst *);
|
||||
static void m_initinv(struct monst *);
|
||||
static boolean makemon_rnd_goodpos(struct monst *, mmflags_nht, coord *);
|
||||
static void init_mextra(struct mextra *);
|
||||
staticfn boolean uncommon(int);
|
||||
staticfn int align_shift(struct permonst *);
|
||||
staticfn int temperature_shift(struct permonst *);
|
||||
staticfn boolean mk_gen_ok(int, unsigned, unsigned);
|
||||
staticfn boolean wrong_elem_type(struct permonst *);
|
||||
staticfn void m_initgrp(struct monst *, coordxy, coordxy, int, mmflags_nht);
|
||||
staticfn void m_initthrow(struct monst *, int, int);
|
||||
staticfn void m_initweap(struct monst *);
|
||||
staticfn void m_initinv(struct monst *);
|
||||
staticfn boolean makemon_rnd_goodpos(struct monst *, mmflags_nht, coord *);
|
||||
staticfn void init_mextra(struct mextra *);
|
||||
|
||||
#define m_initsgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 3, mmf)
|
||||
#define m_initlgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 10, mmf)
|
||||
@@ -51,7 +51,7 @@ is_home_elemental(struct permonst *ptr)
|
||||
/*
|
||||
* Return true if the given monster cannot exist on this elemental level.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
wrong_elem_type(struct permonst *ptr)
|
||||
{
|
||||
if (ptr->mlet == S_ELEMENTAL) {
|
||||
@@ -74,7 +74,7 @@ wrong_elem_type(struct permonst *ptr)
|
||||
}
|
||||
|
||||
/* make a group just like mtmp */
|
||||
static void
|
||||
staticfn void
|
||||
m_initgrp(struct monst *mtmp, coordxy x, coordxy y, int n, mmflags_nht mmflags)
|
||||
{
|
||||
coord mm;
|
||||
@@ -140,8 +140,7 @@ m_initgrp(struct monst *mtmp, coordxy x, coordxy y, int n, mmflags_nht mmflags)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
m_initthrow(struct monst *mtmp, int otyp, int oquan)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -154,7 +153,7 @@ m_initthrow(struct monst *mtmp, int otyp, int oquan)
|
||||
(void) mpickobj(mtmp, otmp);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_initweap(struct monst *mtmp)
|
||||
{
|
||||
struct permonst *ptr = mtmp->data;
|
||||
@@ -576,7 +575,7 @@ mkmonmoney(struct monst *mtmp, long amount)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_initinv(struct monst *mtmp)
|
||||
{
|
||||
int cnt;
|
||||
@@ -1041,7 +1040,7 @@ newmonhp(struct monst *mon, int mndx)
|
||||
|
||||
static const struct mextra zeromextra = DUMMY;
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_mextra(struct mextra *mex)
|
||||
{
|
||||
*mex = zeromextra;
|
||||
@@ -1058,7 +1057,7 @@ newmextra(void)
|
||||
return mextra;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
makemon_rnd_goodpos(
|
||||
struct monst *mon,
|
||||
mmflags_nht gpflags,
|
||||
@@ -1567,7 +1566,7 @@ create_critters(
|
||||
return known;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
uncommon(int mndx)
|
||||
{
|
||||
if (mons[mndx].geno & (G_NOGEN | G_UNIQ))
|
||||
@@ -1585,7 +1584,7 @@ uncommon(int mndx)
|
||||
* comparing the dungeon alignment and monster alignment.
|
||||
* return an integer in the range of 0-5.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
align_shift(struct permonst *ptr)
|
||||
{
|
||||
static NEARDATA long oldmoves = 0L; /* != 1, starting value of moves */
|
||||
@@ -1615,7 +1614,7 @@ align_shift(struct permonst *ptr)
|
||||
}
|
||||
|
||||
/* return larger value if monster prefers the level temperature */
|
||||
static int
|
||||
staticfn int
|
||||
temperature_shift(struct permonst *ptr)
|
||||
{
|
||||
if (gl.level.flags.temperature
|
||||
@@ -1710,7 +1709,7 @@ rndmonst_adj(int minadj, int maxadj)
|
||||
}
|
||||
|
||||
/* decide whether it's ok to generate a candidate monster by mkclass() */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mk_gen_ok(int mndx, unsigned mvflagsmask, unsigned genomask)
|
||||
{
|
||||
struct permonst *ptr = &mons[mndx];
|
||||
|
||||
+16
-17
@@ -35,17 +35,17 @@ enum mcast_cleric_spells {
|
||||
CLC_GEYSER
|
||||
};
|
||||
|
||||
static void cursetxt(struct monst *, boolean);
|
||||
static int choose_magic_spell(int);
|
||||
static int choose_clerical_spell(int);
|
||||
static int m_cure_self(struct monst *, int);
|
||||
static void cast_wizard_spell(struct monst *, int, int);
|
||||
static void cast_cleric_spell(struct monst *, int, int);
|
||||
static boolean is_undirected_spell(unsigned int, int);
|
||||
static boolean spell_would_be_useless(struct monst *, unsigned int, int);
|
||||
staticfn void cursetxt(struct monst *, boolean);
|
||||
staticfn int choose_magic_spell(int);
|
||||
staticfn int choose_clerical_spell(int);
|
||||
staticfn int m_cure_self(struct monst *, int);
|
||||
staticfn void cast_wizard_spell(struct monst *, int, int);
|
||||
staticfn void cast_cleric_spell(struct monst *, int, int);
|
||||
staticfn boolean is_undirected_spell(unsigned int, int);
|
||||
staticfn boolean spell_would_be_useless(struct monst *, unsigned int, int);
|
||||
|
||||
/* feedback when frustrated monster couldn't cast a spell */
|
||||
static void
|
||||
staticfn void
|
||||
cursetxt(struct monst *mtmp, boolean undirected)
|
||||
{
|
||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
|
||||
@@ -73,7 +73,7 @@ cursetxt(struct monst *mtmp, boolean undirected)
|
||||
|
||||
/* convert a level-based random selection into a specific mage spell;
|
||||
inappropriate choices will be screened out by spell_would_be_useless() */
|
||||
static int
|
||||
staticfn int
|
||||
choose_magic_spell(int spellval)
|
||||
{
|
||||
/* for 3.4.3 and earlier, val greater than 22 selected default spell */
|
||||
@@ -126,7 +126,7 @@ choose_magic_spell(int spellval)
|
||||
}
|
||||
|
||||
/* convert a level-based random selection into a specific cleric spell */
|
||||
static int
|
||||
staticfn int
|
||||
choose_clerical_spell(int spellnum)
|
||||
{
|
||||
/* for 3.4.3 and earlier, num greater than 13 selected the default spell
|
||||
@@ -357,7 +357,7 @@ castmu(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
m_cure_self(struct monst *mtmp, int dmg)
|
||||
{
|
||||
if (mtmp->mhp < mtmp->mhpmax) {
|
||||
@@ -439,8 +439,7 @@ death_inflicted_by(
|
||||
If you modify either of these, be sure to change is_undirected_spell()
|
||||
and spell_would_be_useless().
|
||||
*/
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum)
|
||||
{
|
||||
if (dmg == 0 && !is_undirected_spell(AD_SPEL, spellnum)) {
|
||||
@@ -618,7 +617,7 @@ cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum)
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
|
||||
{
|
||||
int orig_dmg = 0;
|
||||
@@ -865,7 +864,7 @@ cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_undirected_spell(unsigned int adtyp, int spellnum)
|
||||
{
|
||||
if (adtyp == AD_SPEL) {
|
||||
@@ -893,7 +892,7 @@ is_undirected_spell(unsigned int adtyp, int spellnum)
|
||||
}
|
||||
|
||||
/* Some spells are useless under some circumstances. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
spell_would_be_useless(struct monst *mtmp, unsigned int adtyp, int spellnum)
|
||||
{
|
||||
/* Some spells don't require the player to really be there and can be cast
|
||||
|
||||
+13
-13
@@ -60,7 +60,7 @@ char *version_id_string(char *, size_t, const char *) NONNULL NONNULLPTRS;
|
||||
char *bannerc_string(char *, size_t, const char *) NONNULL NONNULLPTRS;
|
||||
int case_insensitive_comp(const char *, const char *) NONNULLPTRS;
|
||||
|
||||
static void make_version(void);
|
||||
staticfn void make_version(void);
|
||||
|
||||
#ifndef HAS_NO_MKSTEMP
|
||||
#ifdef _MSC_VER
|
||||
@@ -83,10 +83,10 @@ const char *do_runtime_info(int *) NO_NNARGS;
|
||||
void release_runtime_info(void);
|
||||
char *mdlib_version_string(char *, const char *) NONNULL NONNULLPTRS;
|
||||
|
||||
static void build_options(void);
|
||||
static int count_and_validate_winopts(void);
|
||||
static void opt_out_words(char *, int *) NONNULLPTRS;
|
||||
static void build_savebones_compat_string(void);
|
||||
staticfn void build_options(void);
|
||||
staticfn int count_and_validate_winopts(void);
|
||||
staticfn void opt_out_words(char *, int *) NONNULLPTRS;
|
||||
staticfn void build_savebones_compat_string(void);
|
||||
|
||||
static int idxopttext, done_runtime_opt_init_once = 0;
|
||||
#define MAXOPT 60 /* 3.7: currently 40 lines get inserted into opttext[] */
|
||||
@@ -95,7 +95,7 @@ static char *opttext[MAXOPT] = { 0 };
|
||||
((void) ((idxopttext < MAXOPT) \
|
||||
? (opttext[idxopttext++] = dupstr(line)) \
|
||||
: 0))
|
||||
char optbuf[COLBUFSZ];
|
||||
static char optbuf[COLBUFSZ];
|
||||
static struct version_info version;
|
||||
static const char opt_indent[] = " ";
|
||||
|
||||
@@ -160,7 +160,7 @@ static struct win_information window_opts[] = {
|
||||
};
|
||||
|
||||
#if !defined(MAKEDEFS_C)
|
||||
static int count_and_validate_soundlibopts(void);
|
||||
staticfn int count_and_validate_soundlibopts(void);
|
||||
|
||||
struct soundlib_information {
|
||||
enum soundlib_ids id;
|
||||
@@ -252,7 +252,7 @@ md_ignored_features(void)
|
||||
);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
make_version(void)
|
||||
{
|
||||
int i;
|
||||
@@ -415,7 +415,7 @@ mkstemp(char *template)
|
||||
|
||||
static char save_bones_compat_buf[BUFSZ];
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
build_savebones_compat_string(void)
|
||||
{
|
||||
#ifdef VERSION_COMPATIBILITY
|
||||
@@ -633,7 +633,7 @@ static const char *const build_opts[] = {
|
||||
"and basic NetHack features"
|
||||
};
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
count_and_validate_winopts(void)
|
||||
{
|
||||
int i, cnt = 0;
|
||||
@@ -658,7 +658,7 @@ count_and_validate_winopts(void)
|
||||
}
|
||||
|
||||
#if !defined(MAKEDEFS_C)
|
||||
static int
|
||||
staticfn int
|
||||
count_and_validate_soundlibopts(void)
|
||||
{
|
||||
int i, cnt = 0;
|
||||
@@ -672,7 +672,7 @@ count_and_validate_soundlibopts(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
opt_out_words(
|
||||
char *str, /* input, but modified during processing */
|
||||
int *length_p) /* in/out */
|
||||
@@ -700,7 +700,7 @@ opt_out_words(
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
build_options(void)
|
||||
{
|
||||
char buf[COLBUFSZ];
|
||||
|
||||
+20
-21
@@ -9,21 +9,21 @@
|
||||
static const char brief_feeling[] =
|
||||
"have a %s feeling for a moment, then it passes.";
|
||||
|
||||
static void noises(struct monst *, struct attack *);
|
||||
static void pre_mm_attack(struct monst *, struct monst *);
|
||||
static void missmm(struct monst *, struct monst *, struct attack *);
|
||||
static int hitmm(struct monst *, struct monst *, struct attack *,
|
||||
staticfn void noises(struct monst *, struct attack *);
|
||||
staticfn void pre_mm_attack(struct monst *, struct monst *);
|
||||
staticfn void missmm(struct monst *, struct monst *, struct attack *);
|
||||
staticfn int hitmm(struct monst *, struct monst *, struct attack *,
|
||||
struct obj *, int);
|
||||
static int gazemm(struct monst *, struct monst *, struct attack *);
|
||||
static int gulpmm(struct monst *, struct monst *, struct attack *);
|
||||
static int explmm(struct monst *, struct monst *, struct attack *);
|
||||
static int mdamagem(struct monst *, struct monst *, struct attack *,
|
||||
staticfn int gazemm(struct monst *, struct monst *, struct attack *);
|
||||
staticfn int gulpmm(struct monst *, struct monst *, struct attack *);
|
||||
staticfn int explmm(struct monst *, struct monst *, struct attack *);
|
||||
staticfn int mdamagem(struct monst *, struct monst *, struct attack *,
|
||||
struct obj *, int);
|
||||
static void mswingsm(struct monst *, struct monst *, struct obj *);
|
||||
static int passivemm(struct monst *, struct monst *, boolean, int,
|
||||
staticfn void mswingsm(struct monst *, struct monst *, struct obj *);
|
||||
staticfn int passivemm(struct monst *, struct monst *, boolean, int,
|
||||
struct obj *);
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
noises(struct monst *magr, struct attack *mattk)
|
||||
{
|
||||
boolean farq = (mdistu(magr) > 15);
|
||||
@@ -37,7 +37,7 @@ noises(struct monst *magr, struct attack *mattk)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pre_mm_attack(struct monst *magr, struct monst *mdef)
|
||||
{
|
||||
boolean showit = FALSE;
|
||||
@@ -72,8 +72,7 @@ pre_mm_attack(struct monst *magr, struct monst *mdef)
|
||||
}
|
||||
|
||||
/* feedback for when a monster-vs-monster attack misses */
|
||||
static
|
||||
void
|
||||
staticfn void
|
||||
missmm(
|
||||
struct monst *magr, /* attacker */
|
||||
struct monst *mdef, /* defender */
|
||||
@@ -631,7 +630,7 @@ failed_grab(
|
||||
}
|
||||
|
||||
/* Returns the result of mdamagem(). */
|
||||
static int
|
||||
staticfn int
|
||||
hitmm(
|
||||
struct monst *magr,
|
||||
struct monst *mdef,
|
||||
@@ -722,7 +721,7 @@ hitmm(
|
||||
}
|
||||
|
||||
/* Returns the same values as mdamagem(). */
|
||||
static int
|
||||
staticfn int
|
||||
gazemm(struct monst *magr, struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
@@ -835,7 +834,7 @@ engulf_target(struct monst *magr, struct monst *mdef)
|
||||
}
|
||||
|
||||
/* Returns the same values as mattackm(). */
|
||||
static int
|
||||
staticfn int
|
||||
gulpmm(
|
||||
struct monst *magr,
|
||||
struct monst *mdef,
|
||||
@@ -954,7 +953,7 @@ gulpmm(
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
explmm(struct monst *magr, struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
int result;
|
||||
@@ -1000,7 +999,7 @@ explmm(struct monst *magr, struct monst *mdef, struct attack *mattk)
|
||||
/*
|
||||
* See comment at top of mattackm(), for return values.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
mdamagem(
|
||||
struct monst *magr,
|
||||
struct monst *mdef,
|
||||
@@ -1259,7 +1258,7 @@ rustm(struct monst *mdef, struct obj *obj)
|
||||
(void) erode_obj(obj, (char *) 0, dmgtyp, EF_GREASE | EF_VERBOSE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mswingsm(
|
||||
struct monst *magr, /* attacker */
|
||||
struct monst *mdef, /* defender */
|
||||
@@ -1279,7 +1278,7 @@ mswingsm(
|
||||
* Passive responses by defenders. Does not replicate responses already
|
||||
* handled above. Returns same values as mattackm.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
passivemm(
|
||||
struct monst *magr,
|
||||
struct monst *mdef,
|
||||
|
||||
+20
-20
@@ -8,18 +8,18 @@
|
||||
|
||||
static NEARDATA struct obj *mon_currwep = (struct obj *) 0;
|
||||
|
||||
static void missmu(struct monst *, boolean, struct attack *);
|
||||
static void mswings(struct monst *, struct obj *, boolean);
|
||||
static void wildmiss(struct monst *, struct attack *);
|
||||
static void calc_mattacku_vars(struct monst *, boolean *, boolean *,
|
||||
staticfn void missmu(struct monst *, boolean, struct attack *);
|
||||
staticfn void mswings(struct monst *, struct obj *, boolean);
|
||||
staticfn void wildmiss(struct monst *, struct attack *);
|
||||
staticfn void calc_mattacku_vars(struct monst *, boolean *, boolean *,
|
||||
boolean *, boolean *);
|
||||
static void summonmu(struct monst *, boolean);
|
||||
static int hitmu(struct monst *, struct attack *);
|
||||
static int gulpmu(struct monst *, struct attack *);
|
||||
static int explmu(struct monst *, struct attack *, boolean);
|
||||
static void mayberem(struct monst *, const char *, struct obj *,
|
||||
staticfn void summonmu(struct monst *, boolean);
|
||||
staticfn int hitmu(struct monst *, struct attack *);
|
||||
staticfn int gulpmu(struct monst *, struct attack *);
|
||||
staticfn int explmu(struct monst *, struct attack *, boolean);
|
||||
staticfn void mayberem(struct monst *, const char *, struct obj *,
|
||||
const char *);
|
||||
static int passiveum(struct permonst *, struct monst *, struct attack *);
|
||||
staticfn int passiveum(struct permonst *, struct monst *, struct attack *);
|
||||
|
||||
#define ld() ((yyyymmdd((time_t) 0) - (getyear() * 10000L)) == 0xe5)
|
||||
|
||||
@@ -80,7 +80,7 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
|
||||
}
|
||||
|
||||
/* monster missed you */
|
||||
static void
|
||||
staticfn void
|
||||
missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
|
||||
{
|
||||
gh.hitmsg_mid = 0;
|
||||
@@ -125,7 +125,7 @@ mswings_verb(
|
||||
}
|
||||
|
||||
/* monster swings obj */
|
||||
static void
|
||||
staticfn void
|
||||
mswings(
|
||||
struct monst *mtmp, /* attacker */
|
||||
struct obj *otemp, /* attacker's weapon */
|
||||
@@ -167,7 +167,7 @@ u_slow_down(void)
|
||||
|
||||
/* monster attacked wrong location due to monster blindness, hero
|
||||
invisibility, hero displacement, or hero being underwater */
|
||||
static void
|
||||
staticfn void
|
||||
wildmiss(struct monst *mtmp, struct attack *mattk)
|
||||
{
|
||||
int compat;
|
||||
@@ -405,7 +405,7 @@ getmattk(struct monst *magr, struct monst *mdef,
|
||||
}
|
||||
|
||||
/* calc some variables needed for mattacku() */
|
||||
static void
|
||||
staticfn void
|
||||
calc_mattacku_vars(
|
||||
struct monst *mtmp,
|
||||
boolean *ranged, boolean *range2,
|
||||
@@ -877,7 +877,7 @@ mattacku(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* monster summons help for its fight against hero */
|
||||
static void
|
||||
staticfn void
|
||||
summonmu(struct monst *mtmp, boolean youseeit)
|
||||
{
|
||||
struct permonst *mdat = mtmp->data;
|
||||
@@ -1062,7 +1062,7 @@ magic_negation(struct monst *mon)
|
||||
* hitmu: monster hits you
|
||||
* returns MM_ flags
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
hitmu(struct monst *mtmp, struct attack *mattk)
|
||||
{
|
||||
struct permonst *mdat = mtmp->data;
|
||||
@@ -1206,7 +1206,7 @@ gulp_blnd_check(void)
|
||||
}
|
||||
|
||||
/* monster swallows you, or damage if u.uswallow */
|
||||
static int
|
||||
staticfn int
|
||||
gulpmu(struct monst *mtmp, struct attack *mattk)
|
||||
{
|
||||
struct trap *t = t_at(u.ux, u.uy);
|
||||
@@ -1498,7 +1498,7 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
|
||||
}
|
||||
|
||||
/* monster explodes in your face */
|
||||
static int
|
||||
staticfn int
|
||||
explmu(struct monst *mtmp, struct attack *mattk, boolean ufound)
|
||||
{
|
||||
boolean kill_agr = TRUE;
|
||||
@@ -2195,7 +2195,7 @@ doseduce(struct monst *mon)
|
||||
}
|
||||
|
||||
/* 'mon' tries to remove a piece of hero's armor */
|
||||
static void
|
||||
staticfn void
|
||||
mayberem(struct monst *mon,
|
||||
const char *seducer, /* only used for alternate message */
|
||||
struct obj *obj, const char *str)
|
||||
@@ -2248,7 +2248,7 @@ mayberem(struct monst *mon,
|
||||
* to know whether hero reverted in order to decide whether passive
|
||||
* damage applies.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
passiveum(
|
||||
struct permonst *olduasmon,
|
||||
struct monst *mtmp,
|
||||
|
||||
+64
-64
@@ -9,40 +9,40 @@
|
||||
/* croom->lx etc are schar (width <= int), so % arith ensures that */
|
||||
/* conversion of result to int is reasonable */
|
||||
|
||||
static boolean generate_stairs_room_good(struct mkroom *, int);
|
||||
static struct mkroom *generate_stairs_find_room(void);
|
||||
static void generate_stairs(void);
|
||||
static void mkfount(struct mkroom *);
|
||||
static boolean find_okay_roompos(struct mkroom *, coord *) NONNULLARG12;
|
||||
static void mksink(struct mkroom *);
|
||||
static void mkaltar(struct mkroom *);
|
||||
static void mkgrave(struct mkroom *);
|
||||
static void mkinvpos(coordxy, coordxy, int);
|
||||
static int mkinvk_check_wall(coordxy x, coordxy y);
|
||||
static void mk_knox_portal(coordxy, coordxy);
|
||||
static void makevtele(void);
|
||||
static void fill_ordinary_room(struct mkroom *, boolean) NONNULLARG1;
|
||||
static void makelevel(void);
|
||||
static boolean bydoor(coordxy, coordxy);
|
||||
static void mktrap_victim(struct trap *);
|
||||
static int traptype_rnd(unsigned);
|
||||
static int traptype_roguelvl(void);
|
||||
static struct mkroom *find_branch_room(coord *) NONNULLARG1;
|
||||
static struct mkroom *pos_to_room(coordxy, coordxy);
|
||||
static boolean cardinal_nextto_room(struct mkroom *, coordxy, coordxy);
|
||||
static boolean place_niche(struct mkroom *, int *, coordxy *, coordxy *);
|
||||
static void makeniche(int);
|
||||
static void make_niches(void);
|
||||
static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
|
||||
static void dosdoor(coordxy, coordxy, struct mkroom *, int);
|
||||
static void join(int, int, boolean);
|
||||
static void alloc_doors(void);
|
||||
static void do_room_or_subroom(struct mkroom *,
|
||||
staticfn boolean generate_stairs_room_good(struct mkroom *, int);
|
||||
staticfn struct mkroom *generate_stairs_find_room(void);
|
||||
staticfn void generate_stairs(void);
|
||||
staticfn void mkfount(struct mkroom *);
|
||||
staticfn boolean find_okay_roompos(struct mkroom *, coord *) NONNULLARG12;
|
||||
staticfn void mksink(struct mkroom *);
|
||||
staticfn void mkaltar(struct mkroom *);
|
||||
staticfn void mkgrave(struct mkroom *);
|
||||
staticfn void mkinvpos(coordxy, coordxy, int);
|
||||
staticfn int mkinvk_check_wall(coordxy x, coordxy y);
|
||||
staticfn void mk_knox_portal(coordxy, coordxy);
|
||||
staticfn void makevtele(void);
|
||||
staticfn void fill_ordinary_room(struct mkroom *, boolean) NONNULLARG1;
|
||||
staticfn void makelevel(void);
|
||||
staticfn boolean bydoor(coordxy, coordxy);
|
||||
staticfn void mktrap_victim(struct trap *);
|
||||
staticfn int traptype_rnd(unsigned);
|
||||
staticfn int traptype_roguelvl(void);
|
||||
staticfn struct mkroom *find_branch_room(coord *) NONNULLARG1;
|
||||
staticfn struct mkroom *pos_to_room(coordxy, coordxy);
|
||||
staticfn boolean cardinal_nextto_room(struct mkroom *, coordxy, coordxy);
|
||||
staticfn boolean place_niche(struct mkroom *, int *, coordxy *, coordxy *);
|
||||
staticfn void makeniche(int);
|
||||
staticfn void make_niches(void);
|
||||
staticfn int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
|
||||
staticfn void dosdoor(coordxy, coordxy, struct mkroom *, int);
|
||||
staticfn void join(int, int, boolean);
|
||||
staticfn void alloc_doors(void);
|
||||
staticfn void do_room_or_subroom(struct mkroom *,
|
||||
coordxy, coordxy, coordxy, coordxy,
|
||||
boolean, schar, boolean, boolean);
|
||||
static void makerooms(void);
|
||||
static boolean door_into_nonjoined(coordxy, coordxy);
|
||||
static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
|
||||
staticfn void makerooms(void);
|
||||
staticfn boolean door_into_nonjoined(coordxy, coordxy);
|
||||
staticfn boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
|
||||
|
||||
#define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)
|
||||
#define init_vault() gv.vault_x = -1
|
||||
@@ -50,7 +50,7 @@ static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
|
||||
|
||||
/* Args must be (const genericptr) so that qsort will always be happy. */
|
||||
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
mkroom_cmp(const genericptr vx, const genericptr vy)
|
||||
{
|
||||
const struct mkroom *x, *y;
|
||||
@@ -68,7 +68,7 @@ mkroom_cmp(const genericptr vx, const genericptr vy)
|
||||
* (such as shops) that will never randomly generate unwanted doors in order
|
||||
* to connect them up to other areas.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
door_into_nonjoined(coordxy x, coordxy y)
|
||||
{
|
||||
coordxy tx, ty, i;
|
||||
@@ -88,7 +88,7 @@ door_into_nonjoined(coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
finddpos(coord *cc, coordxy xl, coordxy yl, coordxy xh, coordxy yh)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -140,7 +140,7 @@ sort_rooms(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_room_or_subroom(struct mkroom *croom,
|
||||
coordxy lowx, coordxy lowy, coordxy hix, coordxy hiy,
|
||||
boolean lit, schar rtype, boolean special, boolean is_room)
|
||||
@@ -264,7 +264,7 @@ free_luathemes(enum lua_theme_group theme_group)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
makerooms(void)
|
||||
{
|
||||
boolean tried_vault = FALSE;
|
||||
@@ -341,7 +341,7 @@ makerooms(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
join(int a, int b, boolean nxcor)
|
||||
{
|
||||
coord cc, tt, org, dest;
|
||||
@@ -460,7 +460,7 @@ makecorridors(void)
|
||||
}
|
||||
|
||||
/* (re)allocate space for gd.doors array */
|
||||
static void
|
||||
staticfn void
|
||||
alloc_doors(void)
|
||||
{
|
||||
if (!gd.doors || gd.doorindex >= gd.doors_alloc) {
|
||||
@@ -518,7 +518,7 @@ add_door(coordxy x, coordxy y, struct mkroom *aroom)
|
||||
gd.doors[aroom->fdoor].y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dosdoor(coordxy x, coordxy y, struct mkroom *aroom, int type)
|
||||
{
|
||||
boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE;
|
||||
@@ -584,7 +584,7 @@ dosdoor(coordxy x, coordxy y, struct mkroom *aroom, int type)
|
||||
|
||||
/* is x,y location such that NEWS direction from it is inside aroom,
|
||||
excluding subrooms */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cardinal_nextto_room(struct mkroom *aroom, coordxy x, coordxy y)
|
||||
{
|
||||
int rmno = (int) ((aroom - gr.rooms) + ROOMOFFSET);
|
||||
@@ -604,7 +604,7 @@ cardinal_nextto_room(struct mkroom *aroom, coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
place_niche(
|
||||
struct mkroom *aroom,
|
||||
int *dy,
|
||||
@@ -643,7 +643,7 @@ static NEARDATA const char *trap_engravings[TRAPNUM] = {
|
||||
(char *) 0, (char *) 0,
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
makeniche(int trap_type)
|
||||
{
|
||||
struct mkroom *aroom;
|
||||
@@ -705,7 +705,7 @@ makeniche(int trap_type)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
make_niches(void)
|
||||
{
|
||||
int ct = rnd((gn.nroom >> 1) + 1), dep = depth(&u.uz);
|
||||
@@ -724,7 +724,7 @@ make_niches(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
makevtele(void)
|
||||
{
|
||||
makeniche(TELEP_TRAP);
|
||||
@@ -841,7 +841,7 @@ clear_level_structures(void)
|
||||
|
||||
If bonus_items is TRUE, there may be an additional special item
|
||||
generated, depending on depth. */
|
||||
static void
|
||||
staticfn void
|
||||
fill_ordinary_room(
|
||||
struct mkroom *croom,
|
||||
boolean bonus_items)
|
||||
@@ -1076,7 +1076,7 @@ fill_ordinary_room(
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
makelevel(void)
|
||||
{
|
||||
struct mkroom *croom;
|
||||
@@ -1467,7 +1467,7 @@ topologize(struct mkroom *croom)
|
||||
}
|
||||
|
||||
/* Find an unused room for a branch location. */
|
||||
static struct mkroom *
|
||||
staticfn struct mkroom *
|
||||
find_branch_room(coord *mp)
|
||||
{
|
||||
struct mkroom *croom = 0;
|
||||
@@ -1484,7 +1484,7 @@ find_branch_room(coord *mp)
|
||||
}
|
||||
|
||||
/* Find the room for (x,y). Return null if not in a room. */
|
||||
static struct mkroom *
|
||||
staticfn struct mkroom *
|
||||
pos_to_room(coordxy x, coordxy y)
|
||||
{
|
||||
int i;
|
||||
@@ -1559,7 +1559,7 @@ place_branch(
|
||||
gm.made_branch = TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
bydoor(coordxy x, coordxy y)
|
||||
{
|
||||
int typ;
|
||||
@@ -1624,7 +1624,7 @@ occupied(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* generate a corpse and some items on top of a trap */
|
||||
static void
|
||||
staticfn void
|
||||
mktrap_victim(struct trap *ttmp)
|
||||
{
|
||||
/* Object generated by the trap; initially NULL, stays NULL if
|
||||
@@ -1744,7 +1744,7 @@ mktrap_victim(struct trap *ttmp)
|
||||
}
|
||||
|
||||
/* pick a random trap type, return NO_TRAP if "too hard" */
|
||||
static int
|
||||
staticfn int
|
||||
traptype_rnd(unsigned mktrapflags)
|
||||
{
|
||||
unsigned lvl = level_difficulty();
|
||||
@@ -1808,7 +1808,7 @@ traptype_rnd(unsigned mktrapflags)
|
||||
}
|
||||
|
||||
/* random trap type for the Rogue level */
|
||||
static int
|
||||
staticfn int
|
||||
traptype_roguelvl(void)
|
||||
{
|
||||
int kind;
|
||||
@@ -1999,7 +1999,7 @@ mkstairs(
|
||||
}
|
||||
|
||||
/* is room a good one to generate up or down stairs in? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
generate_stairs_room_good(struct mkroom *croom, int phase)
|
||||
{
|
||||
/*
|
||||
@@ -2017,7 +2017,7 @@ generate_stairs_room_good(struct mkroom *croom, int phase)
|
||||
}
|
||||
|
||||
/* find a good room to generate an up or down stairs in */
|
||||
static struct mkroom *
|
||||
staticfn struct mkroom *
|
||||
generate_stairs_find_room(void)
|
||||
{
|
||||
struct mkroom *croom;
|
||||
@@ -2048,7 +2048,7 @@ generate_stairs_find_room(void)
|
||||
|
||||
/* construct stairs up and down within the same branch,
|
||||
up and down in different rooms if possible */
|
||||
static void
|
||||
staticfn void
|
||||
generate_stairs(void)
|
||||
{
|
||||
/* generate_stairs_find_room() returns Null if nroom == 0, but that
|
||||
@@ -2083,7 +2083,7 @@ generate_stairs(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkfount(struct mkroom *croom)
|
||||
{
|
||||
coord m;
|
||||
@@ -2101,7 +2101,7 @@ mkfount(struct mkroom *croom)
|
||||
gl.level.flags.nfountains++;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
find_okay_roompos(struct mkroom *croom, coord *crd)
|
||||
{
|
||||
int tryct = 0;
|
||||
@@ -2115,7 +2115,7 @@ find_okay_roompos(struct mkroom *croom, coord *crd)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mksink(struct mkroom *croom)
|
||||
{
|
||||
coord m;
|
||||
@@ -2130,7 +2130,7 @@ mksink(struct mkroom *croom)
|
||||
gl.level.flags.nsinks++;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkaltar(struct mkroom *croom)
|
||||
{
|
||||
coord m;
|
||||
@@ -2151,7 +2151,7 @@ mkaltar(struct mkroom *croom)
|
||||
levl[m.x][m.y].altarmask = Align2amask(al);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkgrave(struct mkroom *croom)
|
||||
{
|
||||
coord m;
|
||||
@@ -2301,7 +2301,7 @@ mkinvokearea(void)
|
||||
/* Change level topology. Boulders in the vicinity are eliminated.
|
||||
* Temporarily overrides vision in the name of a nice effect.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
mkinvpos(coordxy x, coordxy y, int dist)
|
||||
{
|
||||
struct trap *ttmp;
|
||||
@@ -2401,7 +2401,7 @@ mkinvpos(coordxy x, coordxy y, int dist)
|
||||
|
||||
/* reduces clutter in mkinvokearea() while avoiding potential static analyzer
|
||||
confusion about using isok(x,y) to control access to levl[x][y] */
|
||||
static int
|
||||
staticfn int
|
||||
mkinvk_check_wall(coordxy x, coordxy y)
|
||||
{
|
||||
unsigned ltyp;
|
||||
@@ -2422,7 +2422,7 @@ mkinvk_check_wall(coordxy x, coordxy y)
|
||||
*
|
||||
* Ludios will remain isolated until the branch is corrected by this function.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
mk_knox_portal(coordxy x, coordxy y)
|
||||
{
|
||||
d_level *source;
|
||||
|
||||
+21
-21
@@ -8,19 +8,19 @@
|
||||
#define HEIGHT (ROWNO - 1)
|
||||
#define WIDTH (COLNO - 2)
|
||||
|
||||
static void init_map(schar);
|
||||
static void init_fill(schar, schar);
|
||||
static schar get_map(int, int, schar);
|
||||
static void pass_one(schar, schar);
|
||||
static void pass_two(schar, schar);
|
||||
static void pass_three(schar, schar);
|
||||
static void join_map_cleanup(void);
|
||||
static void join_map(schar, schar);
|
||||
static void finish_map(schar, schar, boolean, boolean, boolean);
|
||||
static void remove_room(unsigned);
|
||||
staticfn void init_map(schar);
|
||||
staticfn void init_fill(schar, schar);
|
||||
staticfn schar get_map(int, int, schar);
|
||||
staticfn void pass_one(schar, schar);
|
||||
staticfn void pass_two(schar, schar);
|
||||
staticfn void pass_three(schar, schar);
|
||||
staticfn void join_map_cleanup(void);
|
||||
staticfn void join_map(schar, schar);
|
||||
staticfn void finish_map(schar, schar, boolean, boolean, boolean);
|
||||
staticfn void remove_room(unsigned);
|
||||
void mkmap(lev_init *);
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_map(schar bg_typ)
|
||||
{
|
||||
int i, j;
|
||||
@@ -33,7 +33,7 @@ init_map(schar bg_typ)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_fill(schar bg_typ, schar fg_typ)
|
||||
{
|
||||
int i, j;
|
||||
@@ -51,7 +51,7 @@ init_fill(schar bg_typ, schar fg_typ)
|
||||
}
|
||||
}
|
||||
|
||||
static schar
|
||||
staticfn schar
|
||||
get_map(int col, int row, schar bg_typ)
|
||||
{
|
||||
if (col <= 0 || row < 0 || col > WIDTH || row >= HEIGHT)
|
||||
@@ -59,12 +59,12 @@ get_map(int col, int row, schar bg_typ)
|
||||
return levl[col][row].typ;
|
||||
}
|
||||
|
||||
static const int dirs[16] = {
|
||||
staticfn const int dirs[16] = {
|
||||
-1, -1 /**/, -1, 0 /**/, -1, 1 /**/, 0, -1 /**/,
|
||||
0, 1 /**/, 1, -1 /**/, 1, 0 /**/, 1, 1
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pass_one(schar bg_typ, schar fg_typ)
|
||||
{
|
||||
int i, j;
|
||||
@@ -97,7 +97,7 @@ pass_one(schar bg_typ, schar fg_typ)
|
||||
|
||||
#define new_loc(i, j) *(gn.new_locations + ((j) * (WIDTH + 1)) + (i))
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pass_two(schar bg_typ, schar fg_typ)
|
||||
{
|
||||
int i, j;
|
||||
@@ -120,7 +120,7 @@ pass_two(schar bg_typ, schar fg_typ)
|
||||
levl[i][j].typ = new_loc(i, j);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pass_three(schar bg_typ, schar fg_typ)
|
||||
{
|
||||
int i, j;
|
||||
@@ -243,7 +243,7 @@ flood_fill_rm(
|
||||
}
|
||||
|
||||
/* join_map uses temporary rooms; clean up after it */
|
||||
static void
|
||||
staticfn void
|
||||
join_map_cleanup(void)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -255,7 +255,7 @@ join_map_cleanup(void)
|
||||
gr.rooms[gn.nroom].hx = gs.subrooms[gn.nsubroom].hx = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
join_map(schar bg_typ, schar fg_typ)
|
||||
{
|
||||
struct mkroom *croom, *croom2;
|
||||
@@ -329,7 +329,7 @@ join_map(schar bg_typ, schar fg_typ)
|
||||
join_map_cleanup();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
finish_map(
|
||||
schar fg_typ,
|
||||
schar bg_typ,
|
||||
@@ -408,7 +408,7 @@ remove_rooms(int lx, int ly, int hx, int hy)
|
||||
* level structure contents corresponding to roomno have already been reset.
|
||||
* Currently handles only the removal of rooms that have no subrooms.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
remove_room(unsigned int roomno)
|
||||
{
|
||||
struct mkroom *croom = &gr.rooms[roomno];
|
||||
|
||||
+46
-46
@@ -6,27 +6,27 @@
|
||||
#include "hack.h"
|
||||
#include "sp_lev.h"
|
||||
|
||||
static int iswall(coordxy, coordxy);
|
||||
static int iswall_or_stone(coordxy, coordxy);
|
||||
static boolean is_solid(coordxy, coordxy);
|
||||
static int extend_spine(int[3][3], int, int, int);
|
||||
static void wall_cleanup(coordxy, coordxy, coordxy, coordxy);
|
||||
static boolean okay(coordxy, coordxy, coordxy);
|
||||
static void maze0xy(coord *);
|
||||
static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
|
||||
staticfn int iswall(coordxy, coordxy);
|
||||
staticfn int iswall_or_stone(coordxy, coordxy);
|
||||
staticfn boolean is_solid(coordxy, coordxy);
|
||||
staticfn int extend_spine(int[3][3], int, int, int);
|
||||
staticfn void wall_cleanup(coordxy, coordxy, coordxy, coordxy);
|
||||
staticfn boolean okay(coordxy, coordxy, coordxy);
|
||||
staticfn void maze0xy(coord *);
|
||||
staticfn boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
|
||||
coordxy, xint16, boolean, d_level *);
|
||||
static void baalz_fixup(void);
|
||||
static void setup_waterlevel(void);
|
||||
static void unsetup_waterlevel(void);
|
||||
static void check_ransacked(const char *);
|
||||
static void migr_booty_item(int, const char *);
|
||||
static void migrate_orc(struct monst *, unsigned long);
|
||||
static void shiny_orc_stuff(struct monst *);
|
||||
static void stolen_booty(void);
|
||||
static boolean maze_inbounds(coordxy, coordxy);
|
||||
static void maze_remove_deadends(xint16);
|
||||
static void populate_maze(void);
|
||||
static boolean is_exclusion_zone(xint16, coordxy, coordxy);
|
||||
staticfn void baalz_fixup(void);
|
||||
staticfn void setup_waterlevel(void);
|
||||
staticfn void unsetup_waterlevel(void);
|
||||
staticfn void check_ransacked(const char *);
|
||||
staticfn void migr_booty_item(int, const char *);
|
||||
staticfn void migrate_orc(struct monst *, unsigned long);
|
||||
staticfn void shiny_orc_stuff(struct monst *);
|
||||
staticfn void stolen_booty(void);
|
||||
staticfn boolean maze_inbounds(coordxy, coordxy);
|
||||
staticfn void maze_remove_deadends(xint16);
|
||||
staticfn void populate_maze(void);
|
||||
staticfn boolean is_exclusion_zone(xint16, coordxy, coordxy);
|
||||
|
||||
/* adjust a coordinate one step in the specified direction */
|
||||
#define mz_move(X, Y, dir) \
|
||||
@@ -40,7 +40,7 @@ static boolean is_exclusion_zone(xint16, coordxy, coordxy);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
iswall(coordxy x, coordxy y)
|
||||
{
|
||||
int type;
|
||||
@@ -52,7 +52,7 @@ iswall(coordxy x, coordxy y)
|
||||
|| type == SDOOR || type == IRONBARS);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
iswall_or_stone(coordxy x, coordxy y)
|
||||
{
|
||||
/* out of bounds = stone */
|
||||
@@ -63,7 +63,7 @@ iswall_or_stone(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* return TRUE if out of bounds, wall or rock */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_solid(coordxy x, coordxy y)
|
||||
{
|
||||
return (boolean) (!isok(x, y) || IS_STWALL(levl[x][y].typ));
|
||||
@@ -148,7 +148,7 @@ set_levltyp_lit(coordxy x, coordxy y, schar typ, schar lit)
|
||||
* W x W This would extend a spine from x down.
|
||||
* . W W
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
extend_spine(int locale[3][3], int wall_there, int dx, int dy)
|
||||
{
|
||||
int spine, nx, ny;
|
||||
@@ -180,7 +180,7 @@ extend_spine(int locale[3][3], int wall_there, int dx, int dy)
|
||||
}
|
||||
|
||||
/* Remove walls totally surrounded by stone */
|
||||
static void
|
||||
staticfn void
|
||||
wall_cleanup(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
|
||||
{
|
||||
uchar type;
|
||||
@@ -279,7 +279,7 @@ wallification(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
|
||||
fix_wall_spines(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
okay(coordxy x, coordxy y, coordxy dir)
|
||||
{
|
||||
mz_move(x, y, dir);
|
||||
@@ -291,7 +291,7 @@ okay(coordxy x, coordxy y, coordxy dir)
|
||||
}
|
||||
|
||||
/* find random starting point for maze generation */
|
||||
static void
|
||||
staticfn void
|
||||
maze0xy(coord *cc)
|
||||
{
|
||||
cc->x = 3 + 2 * rn2((gx.x_maze_max >> 1) - 1);
|
||||
@@ -299,7 +299,7 @@ maze0xy(coord *cc)
|
||||
return;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_exclusion_zone(xint16 type, coordxy x, coordxy y)
|
||||
{
|
||||
struct exclusion_zone *ez = ge.exclusion_zones;
|
||||
@@ -383,7 +383,7 @@ place_lregion(
|
||||
impossible("Couldn't place lregion type %d!", rtype);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
put_lregion_here(
|
||||
coordxy x, coordxy y,
|
||||
coordxy nlx, coordxy nly, coordxy nhx, coordxy nhy,
|
||||
@@ -443,7 +443,7 @@ put_lregion_here(
|
||||
/* fix up Baalzebub's lair, which depicts a level-sized beetle;
|
||||
its legs are walls within solid rock--regular wallification
|
||||
classifies them as superfluous and gets rid of them */
|
||||
static void
|
||||
staticfn void
|
||||
baalz_fixup(void)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -674,7 +674,7 @@ fixup_special(void)
|
||||
gn.num_lregions = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
check_ransacked(const char *s)
|
||||
{
|
||||
/* this kludge only works as long as orctown is minetn-1 */
|
||||
@@ -684,7 +684,7 @@ check_ransacked(const char *s)
|
||||
#define ORC_LEADER 1
|
||||
static const char *const orcfruit[] = { "paddle cactus", "dwarven root" };
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
migrate_orc(struct monst *mtmp, unsigned long mflags)
|
||||
{
|
||||
int nlev, max_depth, cur_depth;
|
||||
@@ -715,7 +715,7 @@ migrate_orc(struct monst *mtmp, unsigned long mflags)
|
||||
migrate_to_level(mtmp, ledger_no(&dest), MIGR_RANDOM, (coord *) 0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
shiny_orc_stuff(struct monst *mtmp)
|
||||
{
|
||||
int gemprob, goldprob, otyp;
|
||||
@@ -747,7 +747,7 @@ shiny_orc_stuff(struct monst *mtmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
migr_booty_item(int otyp, const char *gang)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -766,7 +766,7 @@ migr_booty_item(int otyp, const char *gang)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
stolen_booty(void)
|
||||
{
|
||||
char *gang, gang_name[BUFSZ];
|
||||
@@ -860,7 +860,7 @@ stolen_booty(void)
|
||||
|
||||
#undef ORC_LEADER
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
maze_inbounds(coordxy x, coordxy y)
|
||||
{
|
||||
return (x >= 2 && y >= 2
|
||||
@@ -870,7 +870,7 @@ maze_inbounds(coordxy x, coordxy y)
|
||||
&& isok(x, y));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
maze_remove_deadends(xint16 typ)
|
||||
{
|
||||
char dirok[4];
|
||||
@@ -1064,7 +1064,7 @@ pick_vibrasquare_location(void)
|
||||
}
|
||||
|
||||
/* add objects and monsters to random maze */
|
||||
static void
|
||||
staticfn void
|
||||
populate_maze(void)
|
||||
{
|
||||
int i;
|
||||
@@ -1488,9 +1488,9 @@ fumaroles(void)
|
||||
#define gbxmax (gx.xmax - 1)
|
||||
#define gbymax (gy.ymax - 1)
|
||||
|
||||
static void set_wportal(void);
|
||||
static void mk_bubble(coordxy, coordxy, int);
|
||||
static void mv_bubble(struct bubble *, coordxy, coordxy, boolean);
|
||||
staticfn void set_wportal(void);
|
||||
staticfn void mk_bubble(coordxy, coordxy, int);
|
||||
staticfn void mv_bubble(struct bubble *, coordxy, coordxy, boolean);
|
||||
|
||||
void
|
||||
movebubbles(void)
|
||||
@@ -1748,7 +1748,7 @@ restore_waterlevel(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
set_wportal(void)
|
||||
{
|
||||
/* there better be only one magic portal on water level... */
|
||||
@@ -1758,7 +1758,7 @@ set_wportal(void)
|
||||
impossible("set_wportal(): no portal!");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
setup_waterlevel(void)
|
||||
{
|
||||
int typ, glyph;
|
||||
@@ -1806,7 +1806,7 @@ setup_waterlevel(void)
|
||||
mk_bubble(x, y, rn2(7));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
unsetup_waterlevel(void)
|
||||
{
|
||||
struct bubble *b, *bb;
|
||||
@@ -1819,7 +1819,7 @@ unsetup_waterlevel(void)
|
||||
gb.bbubbles = ge.ebubbles = (struct bubble *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mk_bubble(coordxy x, coordxy y, int n)
|
||||
{
|
||||
/*
|
||||
@@ -1882,7 +1882,7 @@ mk_bubble(coordxy x, coordxy y, int n)
|
||||
* in the immediate neighborhood of one, he/she may get sucked inside.
|
||||
* This property also makes leaving a bubble slightly difficult.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
mv_bubble(struct bubble *b, coordxy dx, coordxy dy, boolean ini)
|
||||
{
|
||||
int i, j, colli = 0;
|
||||
|
||||
+40
-40
@@ -5,27 +5,27 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean may_generate_eroded(struct obj *);
|
||||
static void mkobj_erosions(struct obj *);
|
||||
static void mkbox_cnts(struct obj *);
|
||||
static unsigned nextoid(struct obj *, struct obj *);
|
||||
static void mksobj_init(struct obj *, boolean);
|
||||
static int item_on_ice(struct obj *);
|
||||
static void shrinking_glob_gone(struct obj *);
|
||||
static void obj_timer_checks(struct obj *, coordxy, coordxy, int);
|
||||
static struct obj *save_mtraits(struct obj *, struct monst *);
|
||||
static void objlist_sanity(struct obj *, int, const char *);
|
||||
static void shop_obj_sanity(struct obj *, const char *);
|
||||
static void mon_obj_sanity(struct monst *, const char *);
|
||||
static void insane_obj_bits(struct obj *, struct monst *);
|
||||
static boolean nomerge_exception(struct obj *);
|
||||
static const char *where_name(struct obj *);
|
||||
static void insane_object(struct obj *, const char *, const char *,
|
||||
staticfn boolean may_generate_eroded(struct obj *);
|
||||
staticfn void mkobj_erosions(struct obj *);
|
||||
staticfn void mkbox_cnts(struct obj *);
|
||||
staticfn unsigned nextoid(struct obj *, struct obj *);
|
||||
staticfn void mksobj_init(struct obj *, boolean);
|
||||
staticfn int item_on_ice(struct obj *);
|
||||
staticfn void shrinking_glob_gone(struct obj *);
|
||||
staticfn void obj_timer_checks(struct obj *, coordxy, coordxy, int);
|
||||
staticfn struct obj *save_mtraits(struct obj *, struct monst *);
|
||||
staticfn void objlist_sanity(struct obj *, int, const char *);
|
||||
staticfn void shop_obj_sanity(struct obj *, const char *);
|
||||
staticfn void mon_obj_sanity(struct monst *, const char *);
|
||||
staticfn void insane_obj_bits(struct obj *, struct monst *);
|
||||
staticfn boolean nomerge_exception(struct obj *);
|
||||
staticfn const char *where_name(struct obj *);
|
||||
staticfn void insane_object(struct obj *, const char *, const char *,
|
||||
struct monst *);
|
||||
static void check_contained(struct obj *, const char *);
|
||||
static void check_glob(struct obj *, const char *);
|
||||
static void sanity_check_worn(struct obj *);
|
||||
static void init_oextra(struct oextra *);
|
||||
staticfn void check_contained(struct obj *, const char *);
|
||||
staticfn void check_glob(struct obj *, const char *);
|
||||
staticfn void sanity_check_worn(struct obj *);
|
||||
staticfn void init_oextra(struct oextra *);
|
||||
|
||||
struct icp {
|
||||
int iprob; /* probability of an item type */
|
||||
@@ -75,7 +75,7 @@ static const struct icp hellprobs[] = { { 20, WEAPON_CLASS },
|
||||
|
||||
static const struct oextra zerooextra = DUMMY;
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_oextra(struct oextra *oex)
|
||||
{
|
||||
*oex = zerooextra;
|
||||
@@ -172,7 +172,7 @@ free_omailcmd(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* can object be generated eroded? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
may_generate_eroded(struct obj *otmp)
|
||||
{
|
||||
/* initial hero inventory */
|
||||
@@ -191,7 +191,7 @@ may_generate_eroded(struct obj *otmp)
|
||||
}
|
||||
|
||||
/* random chance of applying erosions/grease to object */
|
||||
static void
|
||||
staticfn void
|
||||
mkobj_erosions(struct obj *otmp)
|
||||
{
|
||||
if (may_generate_eroded(otmp)) {
|
||||
@@ -299,7 +299,7 @@ mkobj(int oclass, boolean artif)
|
||||
return mksobj(i, TRUE, artif);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkbox_cnts(struct obj *box)
|
||||
{
|
||||
int n;
|
||||
@@ -527,7 +527,7 @@ next_ident(void)
|
||||
|
||||
/* when splitting a stack that has o_id-based shop prices, pick an
|
||||
o_id value for the new stack that will maintain the same price */
|
||||
static unsigned
|
||||
staticfn unsigned
|
||||
nextoid(struct obj *oldobj, struct obj *newobj)
|
||||
{
|
||||
int olddif, newdif, trylimit = 256; /* limit of 4 suffices at present */
|
||||
@@ -857,7 +857,7 @@ unknow_object(struct obj *obj)
|
||||
}
|
||||
|
||||
/* do some initialization to newly created object; otyp must already be set */
|
||||
static void
|
||||
staticfn void
|
||||
mksobj_init(struct obj *otmp, boolean artif)
|
||||
{
|
||||
int mndx, tryct;
|
||||
@@ -1374,7 +1374,7 @@ enum obj_on_ice {
|
||||
};
|
||||
|
||||
/* used by shrink_glob(); is 'item' or enclosing container on or under ice? */
|
||||
static int
|
||||
staticfn int
|
||||
item_on_ice(struct obj *item)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1604,7 +1604,7 @@ shrink_glob(
|
||||
}
|
||||
|
||||
/* a glob has shrunk away to nothing; handle owornmask, then delete glob */
|
||||
static void
|
||||
staticfn void
|
||||
shrinking_glob_gone(struct obj *obj)
|
||||
{
|
||||
xint16 owhere = obj->where;
|
||||
@@ -2075,7 +2075,7 @@ obj_attach_mid(struct obj *obj, unsigned int mid)
|
||||
return obj;
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
save_mtraits(struct obj *obj, struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->ispriest)
|
||||
@@ -2356,7 +2356,7 @@ peek_at_iced_corpse_age(struct obj *otmp)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
obj_timer_checks(
|
||||
struct obj *otmp,
|
||||
coordxy x, coordxy y,
|
||||
@@ -2897,7 +2897,7 @@ obj_sanity_check(void)
|
||||
}
|
||||
|
||||
/* sanity check for objects on specified list (fobj, &c) */
|
||||
static void
|
||||
staticfn void
|
||||
objlist_sanity(struct obj *objlist, int wheretype, const char *mesg)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -2960,7 +2960,7 @@ objlist_sanity(struct obj *objlist, int wheretype, const char *mesg)
|
||||
|
||||
/* check obj->unpaid and obj->no_charge for shop sanity; caller has
|
||||
verified that at least one of them is set */
|
||||
static void
|
||||
staticfn void
|
||||
shop_obj_sanity(struct obj *obj, const char *mesg)
|
||||
{
|
||||
struct obj *otop;
|
||||
@@ -3030,7 +3030,7 @@ shop_obj_sanity(struct obj *obj, const char *mesg)
|
||||
}
|
||||
|
||||
/* sanity check for objects carried by all monsters in specified list */
|
||||
static void
|
||||
staticfn void
|
||||
mon_obj_sanity(struct monst *monlist, const char *mesg)
|
||||
{
|
||||
struct monst *mon;
|
||||
@@ -3063,7 +3063,7 @@ mon_obj_sanity(struct monst *monlist, const char *mesg)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
insane_obj_bits(struct obj *obj, struct monst *mon)
|
||||
{
|
||||
unsigned o_in_use = obj->in_use, o_bypass = obj->bypass,
|
||||
@@ -3086,7 +3086,7 @@ insane_obj_bits(struct obj *obj, struct monst *mon)
|
||||
}
|
||||
|
||||
/* does 'obj' use the 'nomerge' flag persistently? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
nomerge_exception(struct obj *obj)
|
||||
{
|
||||
/* special prize objects for achievement tracking are set 'nomerge'
|
||||
@@ -3104,7 +3104,7 @@ static const char *const obj_state_names[NOBJ_STATES] = {
|
||||
"luafree"
|
||||
};
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
where_name(struct obj *obj)
|
||||
{
|
||||
static char unknown[32]; /* big enough to handle rogue 64-bit int */
|
||||
@@ -3122,7 +3122,7 @@ where_name(struct obj *obj)
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
insane_object(
|
||||
struct obj *obj,
|
||||
const char *fmt,
|
||||
@@ -3180,7 +3180,7 @@ init_dummyobj(struct obj *obj, short otyp, long oquan)
|
||||
}
|
||||
|
||||
/* obj sanity check: check objects inside container */
|
||||
static void
|
||||
staticfn void
|
||||
check_contained(struct obj *container, const char *mesg)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -3226,7 +3226,7 @@ check_contained(struct obj *container, const char *mesg)
|
||||
}
|
||||
|
||||
/* called when 'obj->globby' is set so we don't recheck it here */
|
||||
static void
|
||||
staticfn void
|
||||
check_glob(struct obj *obj, const char *mesg)
|
||||
{
|
||||
#define LOWEST_GLOB GLOB_OF_GRAY_OOZE
|
||||
@@ -3253,7 +3253,7 @@ check_glob(struct obj *obj, const char *mesg)
|
||||
}
|
||||
|
||||
/* check an object in hero's or monster's inventory which has worn mask set */
|
||||
static void
|
||||
staticfn void
|
||||
sanity_check_worn(struct obj *obj)
|
||||
{
|
||||
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) || defined(DEBUG)
|
||||
|
||||
+24
-24
@@ -17,23 +17,23 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static boolean isbig(struct mkroom *);
|
||||
static struct mkroom *pick_room(boolean);
|
||||
static void mkshop(void), mkzoo(int), mkswamp(void);
|
||||
static void mk_zoo_thronemon(coordxy, coordxy);
|
||||
static void mktemple(void);
|
||||
static coord *shrine_pos(int);
|
||||
static struct permonst *morguemon(void);
|
||||
static struct permonst *squadmon(void);
|
||||
static void save_room(NHFILE *, struct mkroom *);
|
||||
static void rest_room(NHFILE *, struct mkroom *);
|
||||
static boolean invalid_shop_shape(struct mkroom *sroom);
|
||||
staticfn boolean isbig(struct mkroom *);
|
||||
staticfn struct mkroom *pick_room(boolean);
|
||||
staticfn void mkshop(void), mkzoo(int), mkswamp(void);
|
||||
staticfn void mk_zoo_thronemon(coordxy, coordxy);
|
||||
staticfn void mktemple(void);
|
||||
staticfn coord *shrine_pos(int);
|
||||
staticfn struct permonst *morguemon(void);
|
||||
staticfn struct permonst *squadmon(void);
|
||||
staticfn void save_room(NHFILE *, struct mkroom *);
|
||||
staticfn void rest_room(NHFILE *, struct mkroom *);
|
||||
staticfn boolean invalid_shop_shape(struct mkroom *sroom);
|
||||
|
||||
#define sq(x) ((x) * (x))
|
||||
|
||||
extern const struct shclass shtypes[]; /* defined in shknam.c */
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
isbig(struct mkroom *sroom)
|
||||
{
|
||||
int area = (sroom->hx - sroom->lx + 1)
|
||||
@@ -86,7 +86,7 @@ do_mkroom(int roomtype)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkshop(void)
|
||||
{
|
||||
struct mkroom *sroom;
|
||||
@@ -211,7 +211,7 @@ mkshop(void)
|
||||
}
|
||||
|
||||
/* pick an unused room, preferably with only one door */
|
||||
static struct mkroom *
|
||||
staticfn struct mkroom *
|
||||
pick_room(boolean strict)
|
||||
{
|
||||
struct mkroom *sroom;
|
||||
@@ -235,7 +235,7 @@ pick_room(boolean strict)
|
||||
return (struct mkroom *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkzoo(int type)
|
||||
{
|
||||
struct mkroom *sroom;
|
||||
@@ -248,7 +248,7 @@ mkzoo(int type)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mk_zoo_thronemon(coordxy x, coordxy y)
|
||||
{
|
||||
int i = rnd(level_difficulty());
|
||||
@@ -465,7 +465,7 @@ mkundead(
|
||||
gl.level.flags.graveyard = TRUE; /* reduced chance for undead corpse */
|
||||
}
|
||||
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
morguemon(void)
|
||||
{
|
||||
int i = rn2(100), hd = rn2(level_difficulty());
|
||||
@@ -517,7 +517,7 @@ antholemon(void)
|
||||
: &mons[mtyp]);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mkswamp(void) /* Michiel Huisjes & Fred de Wilde */
|
||||
{
|
||||
struct mkroom *sroom;
|
||||
@@ -564,7 +564,7 @@ mkswamp(void) /* Michiel Huisjes & Fred de Wilde */
|
||||
}
|
||||
}
|
||||
|
||||
static coord *
|
||||
staticfn coord *
|
||||
shrine_pos(int roomno)
|
||||
{
|
||||
static coord buf;
|
||||
@@ -585,7 +585,7 @@ shrine_pos(int roomno)
|
||||
return &buf;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mktemple(void)
|
||||
{
|
||||
struct mkroom *sroom;
|
||||
@@ -804,7 +804,7 @@ static const struct {
|
||||
{ PM_CAPTAIN, 1 } };
|
||||
|
||||
/* return soldier types. */
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
squadmon(void)
|
||||
{
|
||||
int sel_prob, i, cpro, mndx;
|
||||
@@ -831,7 +831,7 @@ squadmon(void)
|
||||
* save_room : A recursive function that saves a room and its subrooms
|
||||
* (if any).
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
save_room(NHFILE *nhfp, struct mkroom *r)
|
||||
{
|
||||
short i;
|
||||
@@ -863,7 +863,7 @@ save_rooms(NHFILE *nhfp)
|
||||
save_room(nhfp, &gr.rooms[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
rest_room(NHFILE *nhfp, struct mkroom *r)
|
||||
{
|
||||
short i;
|
||||
@@ -1039,7 +1039,7 @@ cmap_to_type(int sym)
|
||||
* Note that the invalidity of the shape derives from the position of its door
|
||||
* already being chosen. It's quite possible that if the door were somewhere
|
||||
* else on the perimeter of this room, it would work fine as a shop.*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
invalid_shop_shape(struct mkroom *sroom)
|
||||
{
|
||||
coordxy x, y;
|
||||
|
||||
@@ -7,33 +7,33 @@
|
||||
#include "mfndpos.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static void sanity_check_single_mon(struct monst *, boolean, const char *);
|
||||
static struct obj *make_corpse(struct monst *, unsigned);
|
||||
static int minliquid_core(struct monst *);
|
||||
static void m_calcdistress(struct monst *);
|
||||
static boolean monlineu(struct monst *, int, int);
|
||||
static long mm_2way_aggression(struct monst *, struct monst *);
|
||||
static long mm_aggression(struct monst *, struct monst *);
|
||||
static long mm_displacement(struct monst *, struct monst *);
|
||||
static void mon_leaving_level(struct monst *);
|
||||
static void m_detach(struct monst *, struct permonst *, boolean);
|
||||
static void set_mon_min_mhpmax(struct monst *, int);
|
||||
static void lifesaved_monster(struct monst *);
|
||||
static boolean vamprises(struct monst *);
|
||||
static void logdeadmon(struct monst *, int);
|
||||
static boolean ok_to_obliterate(struct monst *);
|
||||
static void qst_guardians_respond(void);
|
||||
static void peacefuls_respond(struct monst *);
|
||||
static void m_restartcham(struct monst *);
|
||||
static boolean restrap(struct monst *);
|
||||
static int pick_animal(void);
|
||||
static int pickvampshape(struct monst *);
|
||||
static boolean isspecmon(struct monst *);
|
||||
static boolean validspecmon(struct monst *, int);
|
||||
static int wiz_force_cham_form(struct monst *);
|
||||
static struct permonst *accept_newcham_form(struct monst *, int);
|
||||
static void kill_eggs(struct obj *) NO_NNARGS;
|
||||
static void pacify_guard(struct monst *);
|
||||
staticfn void sanity_check_single_mon(struct monst *, boolean, const char *);
|
||||
staticfn struct obj *make_corpse(struct monst *, unsigned);
|
||||
staticfn int minliquid_core(struct monst *);
|
||||
staticfn void m_calcdistress(struct monst *);
|
||||
staticfn boolean monlineu(struct monst *, int, int);
|
||||
staticfn long mm_2way_aggression(struct monst *, struct monst *);
|
||||
staticfn long mm_aggression(struct monst *, struct monst *);
|
||||
staticfn long mm_displacement(struct monst *, struct monst *);
|
||||
staticfn void mon_leaving_level(struct monst *);
|
||||
staticfn void m_detach(struct monst *, struct permonst *, boolean);
|
||||
staticfn void set_mon_min_mhpmax(struct monst *, int);
|
||||
staticfn void lifesaved_monster(struct monst *);
|
||||
staticfn boolean vamprises(struct monst *);
|
||||
staticfn void logdeadmon(struct monst *, int);
|
||||
staticfn boolean ok_to_obliterate(struct monst *);
|
||||
staticfn void qst_guardians_respond(void);
|
||||
staticfn void peacefuls_respond(struct monst *);
|
||||
staticfn void m_restartcham(struct monst *);
|
||||
staticfn boolean restrap(struct monst *);
|
||||
staticfn int pick_animal(void);
|
||||
staticfn int pickvampshape(struct monst *);
|
||||
staticfn boolean isspecmon(struct monst *);
|
||||
staticfn boolean validspecmon(struct monst *, int);
|
||||
staticfn int wiz_force_cham_form(struct monst *);
|
||||
staticfn struct permonst *accept_newcham_form(struct monst *, int);
|
||||
staticfn void kill_eggs(struct obj *) NO_NNARGS;
|
||||
staticfn void pacify_guard(struct monst *);
|
||||
|
||||
extern const struct shclass shtypes[]; /* defined in shknam.c */
|
||||
|
||||
@@ -51,7 +51,7 @@ const char *warnings[] = {
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
sanity_check_single_mon(
|
||||
struct monst *mtmp,
|
||||
boolean chk_geno,
|
||||
@@ -515,7 +515,7 @@ pm_to_cham(int mndx)
|
||||
* G_NOCORPSE set in order to prevent wishing for one, finding tins of one,
|
||||
* etc....
|
||||
*/
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
make_corpse(struct monst *mtmp, unsigned int corpseflags)
|
||||
{
|
||||
struct permonst *mdat = mtmp->data;
|
||||
@@ -746,7 +746,7 @@ minliquid(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* guts of minliquid() */
|
||||
static int
|
||||
staticfn int
|
||||
minliquid_core(struct monst *mtmp)
|
||||
{
|
||||
boolean inpool, inlava, infountain;
|
||||
@@ -944,7 +944,7 @@ mcalcdistress(void)
|
||||
iter_mons(m_calcdistress);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_calcdistress(struct monst *mtmp)
|
||||
{
|
||||
/* must check non-moving monsters once/turn in case they managed
|
||||
@@ -1824,7 +1824,7 @@ can_carry(struct monst *mtmp, struct obj *otmp)
|
||||
}
|
||||
|
||||
/* is <nx,ny> in direct line with where 'mon' thinks hero is? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
monlineu(struct monst *mon, int nx, int ny)
|
||||
{
|
||||
return online2(nx, ny, mon->mux, mon->muy);
|
||||
@@ -2151,7 +2151,7 @@ mfndpos(
|
||||
/* Part of mm_aggression that represents two-way aggression. To avoid
|
||||
having to code each case twice, this function contains those cases that
|
||||
ought to happen twice, and mm_aggression will call it twice. */
|
||||
static long
|
||||
staticfn long
|
||||
mm_2way_aggression(struct monst *magr, struct monst *mdef)
|
||||
{
|
||||
/* zombies vs things that can be zombified */
|
||||
@@ -2166,7 +2166,7 @@ mm_2way_aggression(struct monst *magr, struct monst *mdef)
|
||||
in the absence of Conflict. There is no provision for targeting
|
||||
other monsters; just hand to hand fighting when they happen to be
|
||||
next to each other. */
|
||||
static long
|
||||
staticfn long
|
||||
mm_aggression(
|
||||
struct monst *magr, /* monster that is currently deciding where to move */
|
||||
struct monst *mdef) /* another monster which is next to it */
|
||||
@@ -2189,7 +2189,7 @@ mm_aggression(
|
||||
}
|
||||
|
||||
/* Monster displacing another monster out of the way */
|
||||
static long
|
||||
staticfn long
|
||||
mm_displacement(
|
||||
struct monst *magr, /* monster that is currently deciding where to move */
|
||||
struct monst *mdef) /* another monster which is next to it */
|
||||
@@ -2426,7 +2426,7 @@ dealloc_monst(struct monst *mon)
|
||||
|
||||
/* 'mon' is being removed from level due to migration [relmon from keepdogs
|
||||
or migrate_to_level] or due to death [m_detach from mondead or mongone] */
|
||||
static void
|
||||
staticfn void
|
||||
mon_leaving_level(struct monst *mon)
|
||||
{
|
||||
coordxy mx = mon->mx, my = mon->my;
|
||||
@@ -2464,7 +2464,7 @@ mon_leaving_level(struct monst *mon)
|
||||
}
|
||||
|
||||
/* 'mtmp' is going away; remove effects of mtmp from other data structures */
|
||||
static void
|
||||
staticfn void
|
||||
m_detach(
|
||||
struct monst *mtmp,
|
||||
struct permonst *mptr, /* reflects mtmp->data _prior_ to mtmp's death */
|
||||
@@ -2536,7 +2536,7 @@ m_detach(
|
||||
|
||||
/* give a life-saved monster a reasonable mhpmax value in case it has
|
||||
been the victim of excessive life draining */
|
||||
static void
|
||||
staticfn void
|
||||
set_mon_min_mhpmax(
|
||||
struct monst *mon,
|
||||
int minimum_mhpmax) /* monster life-saving has traditionally used 10 */
|
||||
@@ -2567,7 +2567,7 @@ mlifesaver(struct monst *mon)
|
||||
return (struct obj *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
lifesaved_monster(struct monst *mtmp)
|
||||
{
|
||||
boolean surviver;
|
||||
@@ -2619,7 +2619,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* when a shape-shifted vampire is killed, it reverts to base form instead
|
||||
of dying; moved into separate routine to unclutter mondead() */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
vamprises(struct monst *mtmp)
|
||||
{
|
||||
int mndx = mtmp->cham;
|
||||
@@ -2694,7 +2694,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* when a mon has died, maybe record an achievement or issue livelog message;
|
||||
moved into separate routine to unclutter mondead() */
|
||||
static void
|
||||
staticfn void
|
||||
logdeadmon(struct monst *mtmp, int mndx)
|
||||
{
|
||||
int howmany = gm.mvitals[mndx].died;
|
||||
@@ -3528,7 +3528,7 @@ migrate_mon(
|
||||
migrate_to_level(mtmp, target_lev, xyloc, (coord *) 0);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
ok_to_obliterate(struct monst *mtmp)
|
||||
{
|
||||
/*
|
||||
@@ -3786,7 +3786,7 @@ m_respond(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* how quest guardians respond when you attack the quest leader */
|
||||
static void
|
||||
staticfn void
|
||||
qst_guardians_respond(void)
|
||||
{
|
||||
struct monst *mon;
|
||||
@@ -3814,7 +3814,7 @@ qst_guardians_respond(void)
|
||||
}
|
||||
|
||||
/* how other peacefuls react when you attack monster */
|
||||
static void
|
||||
staticfn void
|
||||
peacefuls_respond(struct monst *mtmp)
|
||||
{
|
||||
struct monst *mon;
|
||||
@@ -4226,7 +4226,7 @@ rescham(void)
|
||||
iter_mons(normal_shape);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_restartcham(struct monst *mtmp)
|
||||
{
|
||||
if (!mtmp->mcan)
|
||||
@@ -4261,7 +4261,7 @@ restore_cham(struct monst *mon)
|
||||
}
|
||||
|
||||
/* unwatched hiders may hide again; if so, returns True */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
restrap(struct monst *mtmp)
|
||||
{
|
||||
struct trap *t;
|
||||
@@ -4443,7 +4443,7 @@ mon_animal_list(boolean construct)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
pick_animal(void)
|
||||
{
|
||||
int res;
|
||||
@@ -4528,7 +4528,7 @@ decide_to_shapeshift(struct monst *mon, int shiftflags)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
pickvampshape(struct monst *mon)
|
||||
{
|
||||
int mndx = mon->cham, wolfchance = 10;
|
||||
@@ -4565,7 +4565,7 @@ pickvampshape(struct monst *mon)
|
||||
}
|
||||
|
||||
/* nonshapechangers who warrant special polymorph handling */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
isspecmon(struct monst *mon)
|
||||
{
|
||||
return (mon->isshk || mon->ispriest || mon->isgd
|
||||
@@ -4575,7 +4575,7 @@ isspecmon(struct monst *mon)
|
||||
/* restrict certain special monsters (shopkeepers, aligned priests,
|
||||
vault guards) to forms that allow them to behave sensibly (catching
|
||||
gold, speaking?) so that they don't need too much extra code */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
validspecmon(struct monst *mon, int mndx)
|
||||
{
|
||||
if (mndx == NON_PM)
|
||||
@@ -4659,7 +4659,7 @@ validvamp(struct monst *mon, int *mndx_p, int monclass)
|
||||
return (boolean) (*mndx_p != NON_PM);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
wiz_force_cham_form(struct monst *mon)
|
||||
{
|
||||
char pprompt[BUFSZ], parttwo[QBUFSZ], buf[BUFSZ], prevbuf[BUFSZ];
|
||||
@@ -4810,7 +4810,7 @@ select_newcham_form(struct monst *mon)
|
||||
}
|
||||
|
||||
/* this used to be inline within newcham() but monpolycontrol needs it too */
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
accept_newcham_form(struct monst *mon, int mndx)
|
||||
{
|
||||
struct permonst *mdat;
|
||||
@@ -5168,7 +5168,7 @@ dead_species(int m_idx, boolean egg)
|
||||
}
|
||||
|
||||
/* kill off any eggs of genocided monsters */
|
||||
static void
|
||||
staticfn void
|
||||
kill_eggs(struct obj *obj_list)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -5325,7 +5325,7 @@ angry_guards(boolean silent)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pacify_guard(struct monst *mtmp)
|
||||
{
|
||||
if (is_watch(mtmp->data))
|
||||
|
||||
+1
-1
@@ -401,7 +401,7 @@ mstrength(struct permonst *ptr)
|
||||
}
|
||||
|
||||
/* returns True if monster can attack at range */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mstrength_ranged_attk(struct permonst *ptr)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
+37
-37
@@ -7,29 +7,29 @@
|
||||
#include "mfndpos.h"
|
||||
#include "artifact.h"
|
||||
|
||||
static void msg_mon_movement(struct monst *, coordxy, coordxy) NONNULLARG1;
|
||||
static void watch_on_duty(struct monst *);
|
||||
static int disturb(struct monst *);
|
||||
static void release_hero(struct monst *);
|
||||
static void distfleeck(struct monst *, int *, int *, int *);
|
||||
static int m_arrival(struct monst *);
|
||||
static void mind_blast(struct monst *);
|
||||
static boolean holds_up_web(coordxy, coordxy);
|
||||
static int count_webbing_walls(coordxy, coordxy);
|
||||
static boolean soko_allow_web(struct monst *);
|
||||
static boolean m_search_items(struct monst *, coordxy *, coordxy *, int *,
|
||||
staticfn void msg_mon_movement(struct monst *, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn void watch_on_duty(struct monst *);
|
||||
staticfn int disturb(struct monst *);
|
||||
staticfn void release_hero(struct monst *);
|
||||
staticfn void distfleeck(struct monst *, int *, int *, int *);
|
||||
staticfn int m_arrival(struct monst *);
|
||||
staticfn void mind_blast(struct monst *);
|
||||
staticfn boolean holds_up_web(coordxy, coordxy);
|
||||
staticfn int count_webbing_walls(coordxy, coordxy);
|
||||
staticfn boolean soko_allow_web(struct monst *);
|
||||
staticfn boolean m_search_items(struct monst *, coordxy *, coordxy *, int *,
|
||||
int *);
|
||||
static int postmov(struct monst *, struct permonst *, coordxy, coordxy, int,
|
||||
boolean, boolean, boolean, boolean);
|
||||
static boolean leppie_avoidance(struct monst *);
|
||||
static void leppie_stash(struct monst *);
|
||||
static boolean m_balks_at_approaching(struct monst *);
|
||||
static boolean stuff_prevents_passage(struct monst *);
|
||||
static int vamp_shift(struct monst *, struct permonst *, boolean);
|
||||
static void maybe_spin_web(struct monst *);
|
||||
staticfn int postmov(struct monst *, struct permonst *, coordxy, coordxy, int,
|
||||
boolean, boolean, boolean, boolean);
|
||||
staticfn boolean leppie_avoidance(struct monst *);
|
||||
staticfn void leppie_stash(struct monst *);
|
||||
staticfn boolean m_balks_at_approaching(struct monst *);
|
||||
staticfn boolean stuff_prevents_passage(struct monst *);
|
||||
staticfn int vamp_shift(struct monst *, struct permonst *, boolean);
|
||||
staticfn void maybe_spin_web(struct monst *);
|
||||
|
||||
/* a11y: give a message when monster moved */
|
||||
static void
|
||||
staticfn void
|
||||
msg_mon_movement(struct monst *mtmp, coordxy omx, coordxy omy)
|
||||
{
|
||||
if (a11y.mon_movement && canspotmon(mtmp) && mtmp->mspotted) {
|
||||
@@ -158,7 +158,7 @@ m_break_boulder(struct monst *mtmp, coordxy x, coordxy y)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
watch_on_duty(struct monst *mtmp)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -299,7 +299,7 @@ mon_regen(struct monst *mon, boolean digest_meal)
|
||||
* Possibly awaken the given monster. Return a 1 if the monster has been
|
||||
* jolted awake.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
disturb(struct monst *mtmp)
|
||||
{
|
||||
/*
|
||||
@@ -334,7 +334,7 @@ disturb(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* ungrab/expel held/swallowed hero */
|
||||
static void
|
||||
staticfn void
|
||||
release_hero(struct monst *mon)
|
||||
{
|
||||
if (mon == u.ustuck) {
|
||||
@@ -478,7 +478,7 @@ monflee(
|
||||
mon_track_clear(mtmp);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
distfleeck(
|
||||
struct monst *mtmp,
|
||||
int *inrange, int *nearby, int *scared) /* output */
|
||||
@@ -519,7 +519,7 @@ distfleeck(
|
||||
|
||||
/* perform a special one-time action for a monster; returns -1 if nothing
|
||||
special happened, 0 if monster uses up its turn, 1 if monster is killed */
|
||||
static int
|
||||
staticfn int
|
||||
m_arrival(struct monst *mon)
|
||||
{
|
||||
mon->mstrategy &= ~STRAT_ARRIVE; /* always reset */
|
||||
@@ -528,7 +528,7 @@ m_arrival(struct monst *mon)
|
||||
}
|
||||
|
||||
/* a mind flayer unleashes a mind blast */
|
||||
static void
|
||||
staticfn void
|
||||
mind_blast(struct monst *mtmp)
|
||||
{
|
||||
struct monst *m2, *nmon = (struct monst *) 0;
|
||||
@@ -1052,7 +1052,7 @@ m_digweapon_check(
|
||||
}
|
||||
|
||||
/* does leprechaun want to avoid the hero? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
leppie_avoidance(struct monst *mtmp)
|
||||
{
|
||||
struct obj *lepgold, *ygold;
|
||||
@@ -1067,7 +1067,7 @@ leppie_avoidance(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* unseen leprechaun with gold might stash it */
|
||||
static void
|
||||
staticfn void
|
||||
leppie_stash(struct monst *mtmp)
|
||||
{
|
||||
struct obj *gold;
|
||||
@@ -1088,7 +1088,7 @@ leppie_stash(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* does monster want to avoid you? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
m_balks_at_approaching(struct monst *mtmp)
|
||||
{
|
||||
/* peaceful, far away, or can't see you */
|
||||
@@ -1115,7 +1115,7 @@ m_balks_at_approaching(struct monst *mtmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
holds_up_web(coordxy x, coordxy y)
|
||||
{
|
||||
stairway *sway;
|
||||
@@ -1132,7 +1132,7 @@ holds_up_web(coordxy x, coordxy y)
|
||||
|
||||
/* returns the number of walls in the four cardinal directions that could
|
||||
hold up a web */
|
||||
static int
|
||||
staticfn int
|
||||
count_webbing_walls(coordxy x, coordxy y)
|
||||
{
|
||||
return (holds_up_web(x, y - 1) + holds_up_web(x + 1, y)
|
||||
@@ -1140,7 +1140,7 @@ count_webbing_walls(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* reject webs which interfere with solving Sokoban */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
soko_allow_web(struct monst *mon)
|
||||
{
|
||||
stairway *stway;
|
||||
@@ -1157,7 +1157,7 @@ soko_allow_web(struct monst *mon)
|
||||
}
|
||||
|
||||
/* monster might spin a web */
|
||||
static void
|
||||
staticfn void
|
||||
maybe_spin_web(struct monst *mtmp)
|
||||
{
|
||||
if (webmaker(mtmp->data)
|
||||
@@ -1188,7 +1188,7 @@ maybe_spin_web(struct monst *mtmp)
|
||||
#define SQSRCHRADIUS 5
|
||||
|
||||
/* monster looks for items it wants nearby */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
m_search_items(
|
||||
struct monst *mtmp,
|
||||
coordxy *ggx, coordxy *ggy,
|
||||
@@ -1313,7 +1313,7 @@ finish_search:
|
||||
|
||||
#undef SQSRCHRADIUS
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
postmov(
|
||||
struct monst *mtmp,
|
||||
struct permonst *ptr,
|
||||
@@ -2156,7 +2156,7 @@ undesirable_disp(
|
||||
* Inventory prevents passage under door.
|
||||
* Used by can_ooze() and can_fog().
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
stuff_prevents_passage(struct monst *mtmp)
|
||||
{
|
||||
struct obj *chain, *obj;
|
||||
@@ -2211,7 +2211,7 @@ can_fog(struct monst *mtmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
vamp_shift(
|
||||
struct monst *mon,
|
||||
struct permonst *ptr,
|
||||
|
||||
+4
-1
@@ -10,6 +10,9 @@
|
||||
|
||||
#include "color.h"
|
||||
|
||||
extern const struct attack c_sa_yes[NATTK];
|
||||
extern const struct attack c_sa_no[NATTK];
|
||||
|
||||
#define NO_ATTK { 0, 0, 0, 0 }
|
||||
|
||||
/* monster type with single name */
|
||||
@@ -32,7 +35,7 @@
|
||||
#define ATTK(at, ad, n, d) { at, ad, n, d }
|
||||
#define A(a1, a2, a3, a4, a5, a6) { a1, a2, a3, a4, a5, a6 }
|
||||
|
||||
struct permonst mons_init[NUMMONS + 1] = {
|
||||
static struct permonst mons_init[NUMMONS + 1] = {
|
||||
#include "monsters.h"
|
||||
/*
|
||||
* Array terminator, added to the end of the entries in monsters.h.
|
||||
|
||||
+6
-6
@@ -4,9 +4,9 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static const char *dev_name(void);
|
||||
static void get_mplname(struct monst *, char *);
|
||||
static void mk_mplayer_armor(struct monst *, short);
|
||||
staticfn const char *dev_name(void);
|
||||
staticfn void get_mplname(struct monst *, char *);
|
||||
staticfn void mk_mplayer_armor(struct monst *, short);
|
||||
|
||||
/* These are the names of those who
|
||||
* contributed to the development of NetHack 3.2/3.3/3.4/3.6.
|
||||
@@ -40,7 +40,7 @@ static const char *const developers[] = {
|
||||
};
|
||||
|
||||
/* return a randomly chosen developer name */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
dev_name(void)
|
||||
{
|
||||
int i, m = 0, n = SIZE(developers);
|
||||
@@ -68,7 +68,7 @@ dev_name(void)
|
||||
return (developers[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
get_mplname(struct monst* mtmp, char *nam)
|
||||
{
|
||||
boolean fmlkind = is_female(mtmp->data);
|
||||
@@ -91,7 +91,7 @@ get_mplname(struct monst* mtmp, char *nam)
|
||||
(boolean) mtmp->female));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mk_mplayer_armor(struct monst *mon, short typ)
|
||||
{
|
||||
struct obj *obj;
|
||||
|
||||
+15
-15
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int monmulti(struct monst *, struct obj *, struct obj *);
|
||||
static void monshoot(struct monst *, struct obj *, struct obj *);
|
||||
static boolean ucatchgem(struct obj *, struct monst *);
|
||||
static const char *breathwep_name(int);
|
||||
static boolean drop_throw(struct obj *, boolean, coordxy, coordxy);
|
||||
static boolean blocking_terrain(coordxy, coordxy);
|
||||
static int m_lined_up(struct monst *, struct monst *) NONNULLARG12;
|
||||
staticfn int monmulti(struct monst *, struct obj *, struct obj *);
|
||||
staticfn void monshoot(struct monst *, struct obj *, struct obj *);
|
||||
staticfn boolean ucatchgem(struct obj *, struct monst *);
|
||||
staticfn const char *breathwep_name(int);
|
||||
staticfn boolean drop_throw(struct obj *, boolean, coordxy, coordxy);
|
||||
staticfn boolean blocking_terrain(coordxy, coordxy);
|
||||
staticfn int m_lined_up(struct monst *, struct monst *) NONNULLARG12;
|
||||
|
||||
#define URETREATING(x, y) \
|
||||
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))
|
||||
@@ -26,7 +26,7 @@ static NEARDATA const char *breathwep[] = {
|
||||
};
|
||||
|
||||
/* hallucinatory ray types */
|
||||
const char *const hallublasts[] = {
|
||||
static const char *const hallublasts[] = {
|
||||
"asteroids", "beads", "bubbles", "butterflies", "champagne", "chaos",
|
||||
"coins", "cotton candy", "crumbs", "dark matter", "darkness", "dust specks",
|
||||
"emoticons", "emotions", "entropy", "flowers", "foam", "fog", "gamma rays",
|
||||
@@ -156,7 +156,7 @@ thitu(
|
||||
* dothrow.c (for consistency). --KAA
|
||||
* Returns FALSE if object still exists (not destroyed).
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
drop_throw(
|
||||
struct obj *obj,
|
||||
boolean ohit,
|
||||
@@ -195,7 +195,7 @@ drop_throw(
|
||||
|
||||
/* calculate multishot volley count for mtmp throwing otmp (if not ammo) or
|
||||
shooting otmp with mwep (if otmp is ammo and mwep appropriate launcher) */
|
||||
static int
|
||||
staticfn int
|
||||
monmulti(struct monst *mtmp, struct obj *otmp, struct obj *mwep)
|
||||
{
|
||||
int multishot = 1;
|
||||
@@ -254,7 +254,7 @@ monmulti(struct monst *mtmp, struct obj *otmp, struct obj *mwep)
|
||||
}
|
||||
|
||||
/* mtmp throws otmp, or shoots otmp with mwep, at hero or at monster mtarg */
|
||||
static void
|
||||
staticfn void
|
||||
monshoot(struct monst *mtmp, struct obj *otmp, struct obj *mwep)
|
||||
{
|
||||
struct monst *mtarg = gm.mtarget;
|
||||
@@ -498,7 +498,7 @@ ohitmon(
|
||||
}
|
||||
|
||||
/* hero catches gem thrown by mon iff poly'd into unicorn; might drop it */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
ucatchgem(
|
||||
struct obj *gem, /* caller has verified gem->oclass */
|
||||
struct monst *mon)
|
||||
@@ -888,7 +888,7 @@ spitmm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg)
|
||||
/* Return the name of a breath weapon. If the player is hallucinating, return
|
||||
* a silly name instead.
|
||||
* typ is AD_MAGM, AD_FIRE, etc */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
breathwep_name(int typ)
|
||||
{
|
||||
if (Hallucination)
|
||||
@@ -1078,7 +1078,7 @@ breamu(struct monst *mtmp, struct attack *mattk)
|
||||
}
|
||||
|
||||
/* return TRUE if terrain at x,y blocks linedup checks */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
blocking_terrain(coordxy x, coordxy y)
|
||||
{
|
||||
if (!isok(x, y) || IS_ROCK(levl[x][y].typ) || closed_door(x, y)
|
||||
@@ -1172,7 +1172,7 @@ linedup(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
m_lined_up(struct monst *mtarg, struct monst *mtmp)
|
||||
{
|
||||
boolean utarget = (mtarg == &gy.youmonst);
|
||||
|
||||
+50
-50
@@ -14,43 +14,43 @@
|
||||
* are confused don't know not to read scrolls, etc....
|
||||
*/
|
||||
|
||||
static int precheck(struct monst *, struct obj *);
|
||||
static void mzapwand(struct monst *, struct obj *, boolean);
|
||||
static void mplayhorn(struct monst *, struct obj *, boolean);
|
||||
static void mreadmsg(struct monst *, struct obj *);
|
||||
static void mquaffmsg(struct monst *, struct obj *);
|
||||
static boolean m_use_healing(struct monst *);
|
||||
static boolean m_sees_sleepy_soldier(struct monst *);
|
||||
static void m_tele(struct monst *, boolean, boolean, int);
|
||||
static boolean m_next2m(struct monst *);
|
||||
static void reveal_trap(struct trap *, boolean);
|
||||
static boolean linedup_chk_corpse(coordxy, coordxy);
|
||||
static void m_use_undead_turning(struct monst *, struct obj *);
|
||||
static boolean hero_behind_chokepoint(struct monst *);
|
||||
static boolean mon_has_friends(struct monst *);
|
||||
static int mbhitm(struct monst *, struct obj *);
|
||||
static void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P),
|
||||
staticfn int precheck(struct monst *, struct obj *);
|
||||
staticfn void mzapwand(struct monst *, struct obj *, boolean);
|
||||
staticfn void mplayhorn(struct monst *, struct obj *, boolean);
|
||||
staticfn void mreadmsg(struct monst *, struct obj *);
|
||||
staticfn void mquaffmsg(struct monst *, struct obj *);
|
||||
staticfn boolean m_use_healing(struct monst *);
|
||||
staticfn boolean m_sees_sleepy_soldier(struct monst *);
|
||||
staticfn void m_tele(struct monst *, boolean, boolean, int);
|
||||
staticfn boolean m_next2m(struct monst *);
|
||||
staticfn void reveal_trap(struct trap *, boolean);
|
||||
staticfn boolean linedup_chk_corpse(coordxy, coordxy);
|
||||
staticfn void m_use_undead_turning(struct monst *, struct obj *);
|
||||
staticfn boolean hero_behind_chokepoint(struct monst *);
|
||||
staticfn boolean mon_has_friends(struct monst *);
|
||||
staticfn int mbhitm(struct monst *, struct obj *);
|
||||
staticfn void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P),
|
||||
int (*)(OBJ_P, OBJ_P), struct obj *);
|
||||
static struct permonst *muse_newcham_mon(struct monst *);
|
||||
static int mloot_container(struct monst *mon, struct obj *, boolean);
|
||||
static void you_aggravate(struct monst *);
|
||||
staticfn struct permonst *muse_newcham_mon(struct monst *);
|
||||
staticfn int mloot_container(struct monst *mon, struct obj *, boolean);
|
||||
staticfn void you_aggravate(struct monst *);
|
||||
#if 0
|
||||
static boolean necrophiliac(struct obj *, boolean);
|
||||
#endif
|
||||
static void mon_consume_unstone(struct monst *, struct obj *, boolean,
|
||||
staticfn void mon_consume_unstone(struct monst *, struct obj *, boolean,
|
||||
boolean);
|
||||
static boolean cures_stoning(struct monst *, struct obj *, boolean);
|
||||
static boolean mcould_eat_tin(struct monst *);
|
||||
static boolean muse_unslime(struct monst *, struct obj *, struct trap *,
|
||||
staticfn boolean cures_stoning(struct monst *, struct obj *, boolean);
|
||||
staticfn boolean mcould_eat_tin(struct monst *);
|
||||
staticfn boolean muse_unslime(struct monst *, struct obj *, struct trap *,
|
||||
boolean);
|
||||
static int cures_sliming(struct monst *, struct obj *);
|
||||
static boolean green_mon(struct monst *);
|
||||
staticfn int cures_sliming(struct monst *, struct obj *);
|
||||
staticfn boolean green_mon(struct monst *);
|
||||
|
||||
/* Any preliminary checks which may result in the monster being unable to use
|
||||
* the item. Returns 0 if nothing happened, 2 if the monster can't do
|
||||
* anything (i.e. it teleported) and 1 if it's dead.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
precheck(struct monst *mon, struct obj *obj)
|
||||
{
|
||||
boolean vis;
|
||||
@@ -155,7 +155,7 @@ precheck(struct monst *mon, struct obj *obj)
|
||||
|
||||
/* when a monster zaps a wand give a message, deduct a charge, and if it
|
||||
isn't directly seen, remove hero's memory of the number of charges */
|
||||
static void
|
||||
staticfn void
|
||||
mzapwand(
|
||||
struct monst *mtmp,
|
||||
struct obj *otmp,
|
||||
@@ -185,7 +185,7 @@ mzapwand(
|
||||
}
|
||||
|
||||
/* similar to mzapwand() but for magical horns (only instrument mons play) */
|
||||
static void
|
||||
staticfn void
|
||||
mplayhorn(
|
||||
struct monst *mtmp,
|
||||
struct obj *otmp,
|
||||
@@ -228,7 +228,7 @@ mplayhorn(
|
||||
|
||||
/* see or hear a monster reading a scroll;
|
||||
when scroll hasn't been seen, its label is revealed unless hero is deaf */
|
||||
static void
|
||||
staticfn void
|
||||
mreadmsg(struct monst *mtmp, struct obj *otmp)
|
||||
{
|
||||
char onambuf[BUFSZ];
|
||||
@@ -276,7 +276,7 @@ mreadmsg(struct monst *mtmp, struct obj *otmp)
|
||||
vismon ? mon_nam(mtmp) : mhe(mtmp));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mquaffmsg(struct monst *mtmp, struct obj *otmp)
|
||||
{
|
||||
if (canseemon(mtmp)) {
|
||||
@@ -320,7 +320,7 @@ mquaffmsg(struct monst *mtmp, struct obj *otmp)
|
||||
* that if you polymorph into one you teleport at will.
|
||||
*/
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
m_use_healing(struct monst *mtmp)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -344,7 +344,7 @@ m_use_healing(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* return TRUE if monster mtmp can see at least one sleeping soldier */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
m_sees_sleepy_soldier(struct monst *mtmp)
|
||||
{
|
||||
coordxy x = mtmp->mx, y = mtmp->my;
|
||||
@@ -367,7 +367,7 @@ m_sees_sleepy_soldier(struct monst *mtmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_tele(
|
||||
struct monst *mtmp, /* monst that might be teleported */
|
||||
boolean vismon, /* can see it */
|
||||
@@ -403,7 +403,7 @@ m_tele(
|
||||
* Called from find_defensive() where it is limited to Is_knox()
|
||||
* only, otherwise you could trap two monsters next to each other
|
||||
* in a boulder fort, and they would be happy to stay in there. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
m_next2m(struct monst *mtmp)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -740,7 +740,7 @@ find_defensive(struct monst *mtmp, boolean tryescape)
|
||||
accessible (trap doors and teleporters inside niches are located at
|
||||
secret corridor locations; convert such into normal corridor even if
|
||||
hero doesn't see it happen) */
|
||||
static void
|
||||
staticfn void
|
||||
reveal_trap(struct trap *t, boolean seeit)
|
||||
{
|
||||
struct rm *lev = &levl[t->tx][t->ty];
|
||||
@@ -1241,13 +1241,13 @@ rnd_defensive_item(struct monst *mtmp)
|
||||
/*#define MUSE_WAN_UNDEAD_TURNING 20*/ /* also a defensive item so don't
|
||||
* redefine; nonconsecutive value is ok */
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
linedup_chk_corpse(coordxy x, coordxy y)
|
||||
{
|
||||
return (sobj_at(CORPSE, x, y) != 0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
m_use_undead_turning(struct monst *mtmp, struct obj *obj)
|
||||
{
|
||||
coordxy ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3,
|
||||
@@ -1293,7 +1293,7 @@ m_use_undead_turning(struct monst *mtmp, struct obj *obj)
|
||||
}
|
||||
|
||||
/* from monster's point of view, is hero behind a chokepoint? */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
hero_behind_chokepoint(struct monst *mtmp)
|
||||
{
|
||||
coordxy dx = sgn(mtmp->mx - mtmp->mux);
|
||||
@@ -1320,7 +1320,7 @@ hero_behind_chokepoint(struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* hostile monster has another hostile next to it */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mon_has_friends(struct monst *mtmp)
|
||||
{
|
||||
coordxy dx, dy;
|
||||
@@ -1514,7 +1514,7 @@ find_offensive(struct monst *mtmp)
|
||||
#undef nomore
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
mbhitm(struct monst *mtmp, struct obj *otmp)
|
||||
{
|
||||
int tmp;
|
||||
@@ -1627,7 +1627,7 @@ mbhitm(struct monst *mtmp, struct obj *otmp)
|
||||
* zapping you, so we need a special function for it. (Unless someone wants
|
||||
* to merge the two functions...)
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
mbhit(
|
||||
struct monst *mon, /* monster shooting the wand */
|
||||
int range, /* direction and range */
|
||||
@@ -2151,7 +2151,7 @@ find_misc(struct monst *mtmp)
|
||||
|
||||
/* type of monster to polymorph into; defaults to one suitable for the
|
||||
current level rather than the totally arbitrary choice of newcham() */
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
muse_newcham_mon(struct monst *mon)
|
||||
{
|
||||
struct obj *m_armr;
|
||||
@@ -2165,7 +2165,7 @@ muse_newcham_mon(struct monst *mon)
|
||||
return rndmonst();
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
mloot_container(
|
||||
struct monst *mon,
|
||||
struct obj *container,
|
||||
@@ -2501,7 +2501,7 @@ use_misc(struct monst *mtmp)
|
||||
|
||||
RESTORE_WARNINGS
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
you_aggravate(struct monst *mtmp)
|
||||
{
|
||||
pline("For some reason, %s presence is known to you.",
|
||||
@@ -2776,7 +2776,7 @@ munstone(struct monst *mon, boolean by_you)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
mon_consume_unstone(
|
||||
struct monst *mon,
|
||||
struct obj *obj,
|
||||
@@ -2855,7 +2855,7 @@ mon_consume_unstone(
|
||||
}
|
||||
|
||||
/* decide whether obj can cure petrification; also used when picking up */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cures_stoning(struct monst *mon, struct obj *obj, boolean tinok)
|
||||
{
|
||||
if (obj->otyp == POT_ACID)
|
||||
@@ -2871,7 +2871,7 @@ cures_stoning(struct monst *mon, struct obj *obj, boolean tinok)
|
||||
|| acidic(&mons[obj->corpsenm]));
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mcould_eat_tin(struct monst *mon)
|
||||
{
|
||||
struct obj *obj, *mwep;
|
||||
@@ -2974,7 +2974,7 @@ munslime(struct monst *mon, boolean by_you)
|
||||
}
|
||||
|
||||
/* mon uses an item--selected by caller--to burn away incipient slime */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
muse_unslime(
|
||||
struct monst *mon,
|
||||
struct obj *obj,
|
||||
@@ -3115,7 +3115,7 @@ muse_unslime(
|
||||
}
|
||||
|
||||
/* decide whether obj can be used to cure green slime */
|
||||
static int
|
||||
staticfn int
|
||||
cures_sliming(struct monst *mon, struct obj *obj)
|
||||
{
|
||||
/* scroll of fire */
|
||||
@@ -3138,7 +3138,7 @@ cures_sliming(struct monst *mon, struct obj *obj)
|
||||
seem plausibly green (which didn't necessarily match the categorization
|
||||
by the color of the text).
|
||||
iflags.use_color is not meant for game behavior decisions */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
green_mon(struct monst *mon)
|
||||
{
|
||||
struct permonst *ptr = mon->data;
|
||||
|
||||
+23
-22
@@ -28,19 +28,19 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void awaken_scare(struct monst *, boolean);
|
||||
static void awaken_monsters(int);
|
||||
static void put_monsters_to_sleep(int);
|
||||
static void charm_snakes(int);
|
||||
static void calm_nymphs(int);
|
||||
static void charm_monsters(int);
|
||||
static void do_earthquake(int);
|
||||
static const char *generic_lvl_desc(void);
|
||||
static int do_improvisation(struct obj *);
|
||||
static char *improvised_notes(boolean *);
|
||||
staticfn void awaken_scare(struct monst *, boolean);
|
||||
staticfn void awaken_monsters(int);
|
||||
staticfn void put_monsters_to_sleep(int);
|
||||
staticfn void charm_snakes(int);
|
||||
staticfn void calm_nymphs(int);
|
||||
staticfn void charm_monsters(int);
|
||||
staticfn void do_earthquake(int);
|
||||
staticfn const char *generic_lvl_desc(void);
|
||||
staticfn int do_improvisation(struct obj *);
|
||||
staticfn char *improvised_notes(boolean *);
|
||||
|
||||
/* wake up monster, possibly scare it */
|
||||
static void
|
||||
staticfn void
|
||||
awaken_scare(struct monst *mtmp, boolean scary)
|
||||
{
|
||||
mtmp->msleeping = 0;
|
||||
@@ -62,7 +62,7 @@ awaken_scare(struct monst *mtmp, boolean scary)
|
||||
* Wake every monster in range...
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
awaken_monsters(int distance)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -80,7 +80,7 @@ awaken_monsters(int distance)
|
||||
* Make monsters fall asleep. Note that they may resist the spell.
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
put_monsters_to_sleep(int distance)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -100,7 +100,7 @@ put_monsters_to_sleep(int distance)
|
||||
* Charm snakes in range. Note that the snakes are NOT tamed.
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
charm_snakes(int distance)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -134,7 +134,7 @@ charm_snakes(int distance)
|
||||
* Calm nymphs in range.
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
calm_nymphs(int distance)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -191,7 +191,7 @@ awaken_soldiers(struct monst* bugler /* monster that played instrument */)
|
||||
}
|
||||
|
||||
/* Charm monsters in range. Note that they may resist the spell. */
|
||||
static void
|
||||
staticfn void
|
||||
charm_monsters(int distance)
|
||||
{
|
||||
struct monst *mtmp, *mtmp2;
|
||||
@@ -218,7 +218,7 @@ charm_monsters(int distance)
|
||||
/* Generate earthquake :-) of desired force.
|
||||
* That is: create random chasms (pits).
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
do_earthquake(int force)
|
||||
{
|
||||
static const char into_a_chasm[] = " into a chasm";
|
||||
@@ -455,7 +455,7 @@ do_earthquake(int force)
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
generic_lvl_desc(void)
|
||||
{
|
||||
if (Is_astralevel(&u.uz))
|
||||
@@ -472,7 +472,7 @@ generic_lvl_desc(void)
|
||||
return "dungeon";
|
||||
}
|
||||
|
||||
const char *beats[] = {
|
||||
static const char *beats[] = {
|
||||
"stepper", "one drop", "slow two", "triple stroke roll",
|
||||
"double shuffle", "half-time shuffle", "second line", "train"
|
||||
};
|
||||
@@ -480,14 +480,14 @@ const char *beats[] = {
|
||||
/*
|
||||
* The player is trying to extract something from his/her instrument.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
do_improvisation(struct obj *instr)
|
||||
{
|
||||
int damage, mode, do_spec = !(Stunned || Confusion);
|
||||
struct obj itmp;
|
||||
boolean mundane = FALSE, same_old_song = FALSE;
|
||||
static char my_goto_song[] = {'C', '\0'},
|
||||
*improvisation SOUNDLIBONLY = my_goto_song;
|
||||
*improvisation = my_goto_song;
|
||||
|
||||
itmp = *instr;
|
||||
itmp.oextra = (struct oextra *) 0; /* ok on this copy as instr maintains
|
||||
@@ -706,10 +706,11 @@ do_improvisation(struct obj *instr)
|
||||
impossible("What a weird instrument (%d)!", instr->otyp);
|
||||
return 0;
|
||||
}
|
||||
nhUse(improvisation);
|
||||
return 2; /* That takes time */
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
improvised_notes(boolean *same_as_last_time)
|
||||
{
|
||||
static const char notes[7] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G' };
|
||||
|
||||
+36
-36
@@ -10,28 +10,28 @@ struct _lua_obj {
|
||||
struct obj *obj;
|
||||
};
|
||||
|
||||
static struct _lua_obj *l_obj_check(lua_State *, int);
|
||||
static int l_obj_add_to_container(lua_State *);
|
||||
static int l_obj_gc(lua_State *);
|
||||
static int l_obj_getcontents(lua_State *);
|
||||
static int l_obj_isnull(lua_State *);
|
||||
static int l_obj_new_readobjnam(lua_State *);
|
||||
static int l_obj_nextobj(lua_State *);
|
||||
static int l_obj_objects_to_table(lua_State *);
|
||||
static int l_obj_placeobj(lua_State *);
|
||||
static int l_obj_to_table(lua_State *);
|
||||
static int l_obj_at(lua_State *);
|
||||
static int l_obj_container(lua_State *);
|
||||
static int l_obj_timer_has(lua_State *);
|
||||
static int l_obj_timer_peek(lua_State *);
|
||||
static int l_obj_timer_stop(lua_State *);
|
||||
static int l_obj_timer_start(lua_State *);
|
||||
static int l_obj_bury(lua_State *);
|
||||
static struct _lua_obj *l_obj_push(lua_State *, struct obj *);
|
||||
staticfn struct _lua_obj *l_obj_check(lua_State *, int);
|
||||
staticfn int l_obj_add_to_container(lua_State *);
|
||||
staticfn int l_obj_gc(lua_State *);
|
||||
staticfn int l_obj_getcontents(lua_State *);
|
||||
staticfn int l_obj_isnull(lua_State *);
|
||||
staticfn int l_obj_new_readobjnam(lua_State *);
|
||||
staticfn int l_obj_nextobj(lua_State *);
|
||||
staticfn int l_obj_objects_to_table(lua_State *);
|
||||
staticfn int l_obj_placeobj(lua_State *);
|
||||
staticfn int l_obj_to_table(lua_State *);
|
||||
staticfn int l_obj_at(lua_State *);
|
||||
staticfn int l_obj_container(lua_State *);
|
||||
staticfn int l_obj_timer_has(lua_State *);
|
||||
staticfn int l_obj_timer_peek(lua_State *);
|
||||
staticfn int l_obj_timer_stop(lua_State *);
|
||||
staticfn int l_obj_timer_start(lua_State *);
|
||||
staticfn int l_obj_bury(lua_State *);
|
||||
staticfn struct _lua_obj *l_obj_push(lua_State *, struct obj *);
|
||||
|
||||
#define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE)
|
||||
|
||||
static struct _lua_obj *
|
||||
staticfn struct _lua_obj *
|
||||
l_obj_check(lua_State *L, int indx)
|
||||
{
|
||||
struct _lua_obj *lo;
|
||||
@@ -43,7 +43,7 @@ l_obj_check(lua_State *L, int indx)
|
||||
return lo;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_gc(lua_State *L)
|
||||
{
|
||||
struct obj *obj, *otmp;
|
||||
@@ -69,7 +69,7 @@ l_obj_gc(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct _lua_obj *
|
||||
staticfn struct _lua_obj *
|
||||
l_obj_push(lua_State *L, struct obj *otmp)
|
||||
{
|
||||
struct _lua_obj *lo = (struct _lua_obj *) lua_newuserdata(L, sizeof(struct _lua_obj));
|
||||
@@ -92,7 +92,7 @@ nhl_push_obj(lua_State *L, struct obj *otmp)
|
||||
|
||||
/* local o = obj.new("large chest");
|
||||
local cobj = o:contents(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_getcontents(lua_State *L)
|
||||
{
|
||||
struct _lua_obj *lo = l_obj_check(L, 1);
|
||||
@@ -109,7 +109,7 @@ l_obj_getcontents(lua_State *L)
|
||||
/* local box = obj.new("large chest");
|
||||
box:addcontent(obj.new("rock"));
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_add_to_container(lua_State *L)
|
||||
{
|
||||
struct _lua_obj *lobox = l_obj_check(L, 1);
|
||||
@@ -166,7 +166,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
/* local odata = obj.class(otbl.otyp); */
|
||||
/* local odata = obj.class(obj.new("rock")); */
|
||||
/* local odata = o:class(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_objects_to_table(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -242,7 +242,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
object fields.
|
||||
local o = obj.new("rock");
|
||||
local otbl = o:totable(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_to_table(lua_State *L)
|
||||
{
|
||||
struct _lua_obj *lo = l_obj_check(L, 1);
|
||||
@@ -343,7 +343,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* create a new object via wishing routine */
|
||||
/* local o = obj.new("rock"); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_new_readobjnam(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -366,7 +366,7 @@ l_obj_new_readobjnam(lua_State *L)
|
||||
|
||||
/* Get the topmost object on the map at x,y */
|
||||
/* local o = obj.at(x, y); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_at(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -390,7 +390,7 @@ l_obj_at(lua_State *L)
|
||||
/* Place an object on the map at (x,y).
|
||||
local o = obj.new("rock");
|
||||
o:placeobj(u.ux, u.uy); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_placeobj(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -422,7 +422,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
local o2 = o:next(true);
|
||||
local firstobj = obj.next();
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_nextobj(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -446,7 +446,7 @@ l_obj_nextobj(lua_State *L)
|
||||
|
||||
/* Get the container object is in */
|
||||
/* local box = o:container(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_container(lua_State *L)
|
||||
{
|
||||
struct _lua_obj *lo = l_obj_check(L, 1);
|
||||
@@ -460,7 +460,7 @@ l_obj_container(lua_State *L)
|
||||
|
||||
/* Is the object a null? */
|
||||
/* local badobj = o:isnull(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_isnull(lua_State *L)
|
||||
{
|
||||
struct _lua_obj *lo = l_obj_check(L, 1);
|
||||
@@ -473,7 +473,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* does object have a timer of certain type? */
|
||||
/* local hastimer = o:has_timer("rot-organic"); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_timer_has(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -497,7 +497,7 @@ l_obj_timer_has(lua_State *L)
|
||||
/* peek at an object timer. return the turn when timer triggers.
|
||||
returns 0 if no such timer attached to the object. */
|
||||
/* local timeout = o:peek_timer("hatch-egg"); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_timer_peek(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -524,7 +524,7 @@ l_obj_timer_peek(lua_State *L)
|
||||
without a timer type parameter, stops all timers for the object. */
|
||||
/* local timeout = o:stop_timer("rot-organic"); */
|
||||
/* o:stop_timer(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_timer_stop(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -556,7 +556,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* start an object timer. */
|
||||
/* o:start_timer("hatch-egg", 10); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_timer_start(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -580,7 +580,7 @@ l_obj_timer_start(lua_State *L)
|
||||
false otherwise. */
|
||||
/* local ogone = o:bury(); */
|
||||
/* local ogone = o:bury(5,5); */
|
||||
static int
|
||||
staticfn int
|
||||
l_obj_bury(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
|
||||
+61
-61
@@ -7,41 +7,41 @@
|
||||
|
||||
|
||||
struct selectionvar *l_selection_check(lua_State *, int);
|
||||
static struct selectionvar *l_selection_push_new(lua_State *);
|
||||
staticfn struct selectionvar *l_selection_push_new(lua_State *);
|
||||
|
||||
/* lua_CFunction prototypes */
|
||||
static int l_selection_new(lua_State *);
|
||||
static int l_selection_clone(lua_State *);
|
||||
static int l_selection_numpoints(lua_State *);
|
||||
static int l_selection_getpoint(lua_State *);
|
||||
static int l_selection_setpoint(lua_State *);
|
||||
static int l_selection_filter_percent(lua_State *);
|
||||
static int l_selection_rndcoord(lua_State *);
|
||||
static int l_selection_room(lua_State *);
|
||||
static int l_selection_getbounds(lua_State *);
|
||||
static boolean params_sel_2coords(lua_State *, struct selectionvar **,
|
||||
staticfn int l_selection_new(lua_State *);
|
||||
staticfn int l_selection_clone(lua_State *);
|
||||
staticfn int l_selection_numpoints(lua_State *);
|
||||
staticfn int l_selection_getpoint(lua_State *);
|
||||
staticfn int l_selection_setpoint(lua_State *);
|
||||
staticfn int l_selection_filter_percent(lua_State *);
|
||||
staticfn int l_selection_rndcoord(lua_State *);
|
||||
staticfn int l_selection_room(lua_State *);
|
||||
staticfn int l_selection_getbounds(lua_State *);
|
||||
staticfn boolean params_sel_2coords(lua_State *, struct selectionvar **,
|
||||
coordxy *, coordxy *, coordxy *, coordxy *);
|
||||
static int l_selection_line(lua_State *);
|
||||
static int l_selection_randline(lua_State *);
|
||||
static int l_selection_rect(lua_State *);
|
||||
static int l_selection_fillrect(lua_State *);
|
||||
static int l_selection_grow(lua_State *);
|
||||
static int l_selection_filter_mapchar(lua_State *);
|
||||
static int l_selection_match(lua_State *);
|
||||
static int l_selection_flood(lua_State *);
|
||||
static int l_selection_circle(lua_State *);
|
||||
static int l_selection_ellipse(lua_State *);
|
||||
static int l_selection_gradient(lua_State *);
|
||||
static int l_selection_iterate(lua_State *);
|
||||
static int l_selection_gc(lua_State *);
|
||||
static int l_selection_not(lua_State *);
|
||||
static int l_selection_and(lua_State *);
|
||||
static int l_selection_or(lua_State *);
|
||||
static int l_selection_xor(lua_State *);
|
||||
staticfn int l_selection_line(lua_State *);
|
||||
staticfn int l_selection_randline(lua_State *);
|
||||
staticfn int l_selection_rect(lua_State *);
|
||||
staticfn int l_selection_fillrect(lua_State *);
|
||||
staticfn int l_selection_grow(lua_State *);
|
||||
staticfn int l_selection_filter_mapchar(lua_State *);
|
||||
staticfn int l_selection_match(lua_State *);
|
||||
staticfn int l_selection_flood(lua_State *);
|
||||
staticfn int l_selection_circle(lua_State *);
|
||||
staticfn int l_selection_ellipse(lua_State *);
|
||||
staticfn int l_selection_gradient(lua_State *);
|
||||
staticfn int l_selection_iterate(lua_State *);
|
||||
staticfn int l_selection_gc(lua_State *);
|
||||
staticfn int l_selection_not(lua_State *);
|
||||
staticfn int l_selection_and(lua_State *);
|
||||
staticfn int l_selection_or(lua_State *);
|
||||
staticfn int l_selection_xor(lua_State *);
|
||||
/* There doesn't seem to be a point in having a l_selection_add since it would
|
||||
* do the same thing as l_selection_or. The addition operator is mapped to
|
||||
* l_selection_or. */
|
||||
static int l_selection_sub(lua_State *);
|
||||
staticfn int l_selection_sub(lua_State *);
|
||||
#if 0
|
||||
/* the following do not appear to currently be
|
||||
used and because they are static, the OSX
|
||||
@@ -49,8 +49,8 @@ static int l_selection_sub(lua_State *);
|
||||
if ifdef'd out the prototype here and the
|
||||
function body below.
|
||||
*/
|
||||
static int l_selection_ipairs(lua_State *);
|
||||
static struct selectionvar *l_selection_to(lua_State *, int);
|
||||
staticfn int l_selection_ipairs(lua_State *);
|
||||
staticfn struct selectionvar *l_selection_to(lua_State *, int);
|
||||
#endif
|
||||
|
||||
struct selectionvar *
|
||||
@@ -65,7 +65,7 @@ l_selection_check(lua_State *L, int index)
|
||||
return sel;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_gc(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -76,7 +76,7 @@ l_selection_gc(lua_State *L)
|
||||
}
|
||||
|
||||
#if 0
|
||||
static struct selectionvar *
|
||||
staticfn struct selectionvar *
|
||||
l_selection_to(lua_State *L, int index)
|
||||
{
|
||||
struct selectionvar *sel = (struct selectionvar *) lua_touserdata(L, index);
|
||||
@@ -88,7 +88,7 @@ l_selection_to(lua_State *L, int index)
|
||||
#endif
|
||||
|
||||
/* push a new selection into lua stack, return the selectionvar */
|
||||
static struct selectionvar *
|
||||
staticfn struct selectionvar *
|
||||
l_selection_push_new(lua_State *L)
|
||||
{
|
||||
struct selectionvar *tmp = selection_new();
|
||||
@@ -121,7 +121,7 @@ l_selection_push_copy(lua_State *L, struct selectionvar *tmp)
|
||||
|
||||
|
||||
/* local sel = selection.new(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_new(lua_State *L)
|
||||
{
|
||||
(void) l_selection_push_new(L);
|
||||
@@ -130,7 +130,7 @@ l_selection_new(lua_State *L)
|
||||
|
||||
/* Replace the topmost selection in the stack with a clone of it. */
|
||||
/* local sel = selection.clone(sel); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_clone(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -153,7 +153,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
/* local sel = sel:set(); */
|
||||
/* local sel = selection.set(sel); */
|
||||
/* TODO: allow setting multiple coordinates at once: set({x,y}, {x,y}, ...); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_setpoint(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = (struct selectionvar *) 0;
|
||||
@@ -197,7 +197,7 @@ l_selection_setpoint(lua_State *L)
|
||||
}
|
||||
|
||||
/* local numpoints = selection.numpoints(sel); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_numpoints(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -218,7 +218,7 @@ l_selection_numpoints(lua_State *L)
|
||||
}
|
||||
|
||||
/* local value = selection.get(sel, x, y); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_getpoint(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -253,7 +253,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
/* local s = selection.negate(sel); */
|
||||
/* local s = selection.negate(); */
|
||||
/* local s = sel:negate(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_not(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -274,7 +274,7 @@ l_selection_not(lua_State *L)
|
||||
}
|
||||
|
||||
/* local sel = selection.area(4,5, 40,10) & selection.rect(7,8, 60,14); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_and(lua_State *L)
|
||||
{
|
||||
int x,y;
|
||||
@@ -297,7 +297,7 @@ l_selection_and(lua_State *L)
|
||||
}
|
||||
|
||||
/* local sel = selection.area(4,5, 40,10) | selection.rect(7,8, 60,14); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_or(lua_State *L)
|
||||
{
|
||||
int x,y;
|
||||
@@ -321,7 +321,7 @@ l_selection_or(lua_State *L)
|
||||
}
|
||||
|
||||
/* local sel = selection.area(4,5, 40,10) ~ selection.rect(7,8, 60,14); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_xor(lua_State *L)
|
||||
{
|
||||
int x,y;
|
||||
@@ -348,7 +348,7 @@ l_selection_xor(lua_State *L)
|
||||
|
||||
/* local sel = selection.area(10,10, 20,20) - selection.area(14,14, 17,17)
|
||||
* - i.e. points that are in A but not in B */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_sub(lua_State *L)
|
||||
{
|
||||
int x,y;
|
||||
@@ -376,7 +376,7 @@ l_selection_sub(lua_State *L)
|
||||
}
|
||||
|
||||
/* local s = selection.percentage(sel, 50); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_filter_percent(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -394,7 +394,7 @@ l_selection_filter_percent(lua_State *L)
|
||||
|
||||
/* local pt = selection.rndcoord(sel); */
|
||||
/* local pt = selection.rndcoord(sel, 1); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_rndcoord(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -419,7 +419,7 @@ l_selection_rndcoord(lua_State *L)
|
||||
}
|
||||
|
||||
/* local s = selection.room(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_room(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel;
|
||||
@@ -441,7 +441,7 @@ l_selection_room(lua_State *L)
|
||||
}
|
||||
|
||||
/* local rect = sel:bounds(); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_getbounds(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = l_selection_check(L, 1);
|
||||
@@ -463,7 +463,7 @@ l_selection_getbounds(lua_State *L)
|
||||
*/
|
||||
/* function(selection, x1,y1, x2,y2) */
|
||||
/* selection:function(x1,y1, x2,y2) */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
params_sel_2coords(lua_State *L, struct selectionvar **sel,
|
||||
coordxy *x1, coordxy *y1, coordxy *x2, coordxy *y2)
|
||||
{
|
||||
@@ -496,7 +496,7 @@ params_sel_2coords(lua_State *L, struct selectionvar **sel,
|
||||
/* local s = selection.line(sel, x1,y1, x2,y2); */
|
||||
/* local s = selection.line(x1,y1, x2,y2); */
|
||||
/* s:line(x1,y1, x2,y2); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_line(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = NULL;
|
||||
@@ -516,7 +516,7 @@ l_selection_line(lua_State *L)
|
||||
}
|
||||
|
||||
/* local s = selection.rect(sel, x1,y1, x2,y2); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_rect(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = NULL;
|
||||
@@ -544,7 +544,7 @@ l_selection_rect(lua_State *L)
|
||||
/* local s = selection.fillrect(x1,y1, x2,y2); */
|
||||
/* s:fillrect(x1,y1, x2,y2); */
|
||||
/* selection.area(x1,y1, x2,y2); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_fillrect(lua_State *L)
|
||||
{
|
||||
struct selectionvar *sel = NULL;
|
||||
@@ -576,7 +576,7 @@ l_selection_fillrect(lua_State *L)
|
||||
/* local s = selection.randline(x1,y1, x2,y2, roughness); */
|
||||
/* TODO: selection.randline(x1,y1, x2,y2, roughness); */
|
||||
/* TODO: selection.randline({x1,y1}, {x2,y2}, roughness); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_randline(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -616,7 +616,7 @@ l_selection_randline(lua_State *L)
|
||||
|
||||
/* local s = selection.grow(sel); */
|
||||
/* local s = selection.grow(sel, "north"); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_grow(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -637,7 +637,7 @@ l_selection_grow(lua_State *L)
|
||||
|
||||
|
||||
/* local s = selection.filter_mapchar(sel, mapchar, lit); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_filter_mapchar(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -662,7 +662,7 @@ l_selection_filter_mapchar(lua_State *L)
|
||||
}
|
||||
|
||||
/* local s = selection.match([[...]]); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_match(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -702,7 +702,7 @@ l_selection_match(lua_State *L)
|
||||
|
||||
/* local s = selection.floodfill(x,y); */
|
||||
/* local s = selection.floodfill(x,y, diagonals); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_flood(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -738,7 +738,7 @@ l_selection_flood(lua_State *L)
|
||||
/* local s = selection.circle(x, y, radius, filled); */
|
||||
/* local s = selection.circle(sel, x, y, radius); */
|
||||
/* local s = selection.circle(sel, x, y, radius, filled); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_circle(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -786,7 +786,7 @@ l_selection_circle(lua_State *L)
|
||||
/* local s = selection.ellipse(x, y, radius1, radius2, filled); */
|
||||
/* local s = selection.ellipse(sel, x, y, radius1, radius2); */
|
||||
/* local s = selection.ellipse(sel, x, y, radius1, radius2, filled); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_ellipse(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -838,7 +838,7 @@ l_selection_ellipse(lua_State *L)
|
||||
* non-obvious argument order. */
|
||||
/* selection.gradient({ type = "radial", x = 3, y = 5, x2 = 10, y2 = 12,
|
||||
* mindist = 4, maxdist = 10, limited = false }); */
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_gradient(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -898,7 +898,7 @@ l_selection_gradient(lua_State *L)
|
||||
* The x, y coordinates passed to the function are map- or room-relative
|
||||
* rather than absolute, unless there has been no previous map or room defined.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
l_selection_iterate(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
|
||||
+113
-113
@@ -27,68 +27,68 @@ struct e;
|
||||
|
||||
/* lua_CFunction prototypes */
|
||||
#ifdef DUMPLOG
|
||||
static int nhl_dump_fmtstr(lua_State *);
|
||||
staticfn int nhl_dump_fmtstr(lua_State *);
|
||||
#endif /* DUMPLOG */
|
||||
static int nhl_dnum_name(lua_State *);
|
||||
static int nhl_stairways(lua_State *);
|
||||
static int nhl_pushkey(lua_State *);
|
||||
static int nhl_doturn(lua_State *);
|
||||
static int nhl_debug_flags(lua_State *);
|
||||
static int nhl_timer_has_at(lua_State *);
|
||||
static int nhl_timer_peek_at(lua_State *);
|
||||
static int nhl_timer_stop_at(lua_State *);
|
||||
static int nhl_timer_start_at(lua_State *);
|
||||
static int nhl_get_cmd_key(lua_State *);
|
||||
static int nhl_callback(lua_State *);
|
||||
static int nhl_gamestate(lua_State *);
|
||||
static int nhl_test(lua_State *);
|
||||
static int nhl_getmap(lua_State *);
|
||||
static char splev_typ2chr(schar);
|
||||
static int nhl_gettrap(lua_State *);
|
||||
static int nhl_deltrap(lua_State *);
|
||||
staticfn int nhl_dnum_name(lua_State *);
|
||||
staticfn int nhl_stairways(lua_State *);
|
||||
staticfn int nhl_pushkey(lua_State *);
|
||||
staticfn int nhl_doturn(lua_State *);
|
||||
staticfn int nhl_debug_flags(lua_State *);
|
||||
staticfn int nhl_timer_has_at(lua_State *);
|
||||
staticfn int nhl_timer_peek_at(lua_State *);
|
||||
staticfn int nhl_timer_stop_at(lua_State *);
|
||||
staticfn int nhl_timer_start_at(lua_State *);
|
||||
staticfn int nhl_get_cmd_key(lua_State *);
|
||||
staticfn int nhl_callback(lua_State *);
|
||||
staticfn int nhl_gamestate(lua_State *);
|
||||
staticfn int nhl_test(lua_State *);
|
||||
staticfn int nhl_getmap(lua_State *);
|
||||
staticfn char splev_typ2chr(schar);
|
||||
staticfn int nhl_gettrap(lua_State *);
|
||||
staticfn int nhl_deltrap(lua_State *);
|
||||
#if 0
|
||||
static int nhl_setmap(lua_State *);
|
||||
staticfn int nhl_setmap(lua_State *);
|
||||
#endif
|
||||
static int nhl_impossible(lua_State *);
|
||||
static int nhl_pline(lua_State *);
|
||||
static int nhl_verbalize(lua_State *);
|
||||
static int nhl_parse_config(lua_State *);
|
||||
static int nhl_menu(lua_State *);
|
||||
static int nhl_text(lua_State *);
|
||||
static int nhl_getlin(lua_State *);
|
||||
static int nhl_makeplural(lua_State *);
|
||||
static int nhl_makesingular(lua_State *);
|
||||
static int nhl_s_suffix(lua_State *);
|
||||
static int nhl_ing_suffix(lua_State *);
|
||||
static int nhl_an(lua_State *);
|
||||
static int nhl_rn2(lua_State *);
|
||||
static int nhl_random(lua_State *);
|
||||
static int nhl_level_difficulty(lua_State *);
|
||||
static void init_nhc_data(lua_State *);
|
||||
static int nhl_push_anything(lua_State *, int, void *);
|
||||
static int nhl_meta_u_index(lua_State *);
|
||||
static int nhl_meta_u_newindex(lua_State *);
|
||||
static int nhl_u_clear_inventory(lua_State *);
|
||||
static int nhl_u_giveobj(lua_State *);
|
||||
static void init_u_data(lua_State *);
|
||||
staticfn int nhl_impossible(lua_State *);
|
||||
staticfn int nhl_pline(lua_State *);
|
||||
staticfn int nhl_verbalize(lua_State *);
|
||||
staticfn int nhl_parse_config(lua_State *);
|
||||
staticfn int nhl_menu(lua_State *);
|
||||
staticfn int nhl_text(lua_State *);
|
||||
staticfn int nhl_getlin(lua_State *);
|
||||
staticfn int nhl_makeplural(lua_State *);
|
||||
staticfn int nhl_makesingular(lua_State *);
|
||||
staticfn int nhl_s_suffix(lua_State *);
|
||||
staticfn int nhl_ing_suffix(lua_State *);
|
||||
staticfn int nhl_an(lua_State *);
|
||||
staticfn int nhl_rn2(lua_State *);
|
||||
staticfn int nhl_random(lua_State *);
|
||||
staticfn int nhl_level_difficulty(lua_State *);
|
||||
staticfn void init_nhc_data(lua_State *);
|
||||
staticfn int nhl_push_anything(lua_State *, int, void *);
|
||||
staticfn int nhl_meta_u_index(lua_State *);
|
||||
staticfn int nhl_meta_u_newindex(lua_State *);
|
||||
staticfn int nhl_u_clear_inventory(lua_State *);
|
||||
staticfn int nhl_u_giveobj(lua_State *);
|
||||
staticfn void init_u_data(lua_State *);
|
||||
#ifdef notyet
|
||||
static int nhl_set_package_path(lua_State *, const char *);
|
||||
staticfn int nhl_set_package_path(lua_State *, const char *);
|
||||
#endif
|
||||
static int traceback_handler(lua_State *);
|
||||
static uint32_t nhl_getmeminuse(lua_State *);
|
||||
staticfn int traceback_handler(lua_State *);
|
||||
staticfn uint32_t nhl_getmeminuse(lua_State *);
|
||||
#ifdef NHL_SANDBOX
|
||||
static void nhlL_openlibs(lua_State *, uint32_t);
|
||||
staticfn void nhlL_openlibs(lua_State *, uint32_t);
|
||||
#endif
|
||||
static void *nhl_alloc(void *, void *, size_t, size_t);
|
||||
static lua_State *nhlL_newstate (nhl_sandbox_info *, const char *);
|
||||
static void end_luapat(void);
|
||||
static int nhl_get_config(lua_State *);
|
||||
static int nhl_variable(lua_State *);
|
||||
static void nhl_clearfromtable(lua_State *, int, int, struct e *);
|
||||
static void nhl_warn(void *, const char *, int);
|
||||
static void nhl_clearfromtable(lua_State *, int, int, struct e *);
|
||||
static int nhl_panic(lua_State *);
|
||||
static void nhl_hookfn(lua_State *, lua_Debug *);
|
||||
staticfn void *nhl_alloc(void *, void *, size_t, size_t);
|
||||
staticfn lua_State *nhlL_newstate (nhl_sandbox_info *, const char *);
|
||||
staticfn void end_luapat(void);
|
||||
staticfn int nhl_get_config(lua_State *);
|
||||
staticfn int nhl_variable(lua_State *);
|
||||
staticfn void nhl_clearfromtable(lua_State *, int, int, struct e *);
|
||||
staticfn void nhl_warn(void *, const char *, int);
|
||||
staticfn void nhl_clearfromtable(lua_State *, int, int, struct e *);
|
||||
staticfn int nhl_panic(lua_State *);
|
||||
staticfn void nhl_hookfn(lua_State *, lua_Debug *);
|
||||
|
||||
static const char *const nhcore_call_names[NUM_NHCORE_CALLS] = {
|
||||
"start_new_game",
|
||||
@@ -329,7 +329,7 @@ nhl_add_table_entry_region(lua_State *L, const char *name, coordxy x1,
|
||||
|
||||
/* converting from special level "map character" to levl location type
|
||||
and back. order here is important. */
|
||||
const struct {
|
||||
static const struct {
|
||||
char ch;
|
||||
schar typ;
|
||||
} char2typ[] = {
|
||||
@@ -389,7 +389,7 @@ check_mapchr(const char *s)
|
||||
return INVALID_TYPE;
|
||||
}
|
||||
|
||||
static char
|
||||
staticfn char
|
||||
splev_typ2chr(schar typ)
|
||||
{
|
||||
int i;
|
||||
@@ -404,7 +404,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* local t = nh.gettrap(x,y); */
|
||||
/* local t = nh.gettrap({ x = 10, y = 10 }); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_gettrap(lua_State *L)
|
||||
{
|
||||
lua_Integer lx, ly;
|
||||
@@ -458,7 +458,7 @@ nhl_gettrap(lua_State *L)
|
||||
}
|
||||
|
||||
/* nh.deltrap(x,y); nh.deltrap({ x = 10, y = 15 }); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_deltrap(lua_State *L)
|
||||
{
|
||||
lua_Integer lx, ly;
|
||||
@@ -517,7 +517,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* local loc = nh.getmap(x,y); */
|
||||
/* local loc = nh.getmap({ x = 10, y = 35 }); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_getmap(lua_State *L)
|
||||
{
|
||||
lua_Integer lx, ly;
|
||||
@@ -607,7 +607,7 @@ nhl_getmap(lua_State *L)
|
||||
}
|
||||
|
||||
/* impossible("Error!") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_impossible(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -621,7 +621,7 @@ nhl_impossible(lua_State *L)
|
||||
|
||||
/* pline("It hits!") */
|
||||
/* pline("It hits!", true) */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_pline(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -637,7 +637,7 @@ nhl_pline(lua_State *L)
|
||||
}
|
||||
|
||||
/* verbalize("Fool!") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_verbalize(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -651,7 +651,7 @@ nhl_verbalize(lua_State *L)
|
||||
}
|
||||
|
||||
/* parse_config("OPTIONS=!color") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_parse_config(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -665,7 +665,7 @@ nhl_parse_config(lua_State *L)
|
||||
}
|
||||
|
||||
/* local windowtype = get_config("windowtype"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_get_config(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -682,7 +682,7 @@ nhl_get_config(lua_State *L)
|
||||
/*
|
||||
str = getlin("What do you want to call this dungeon level?");
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
nhl_getlin(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -707,7 +707,7 @@ nhl_getlin(lua_State *L)
|
||||
|
||||
selected = menu("prompt", default, pickX,
|
||||
{ {key:"a", text:"option a"}, {key:"b", text:"option b"}, ... } ) */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_menu(lua_State *L)
|
||||
{
|
||||
static const char *const pickX[] = { "none", "one", "any" }; /* PICK_x */
|
||||
@@ -796,7 +796,7 @@ nhl_menu(lua_State *L)
|
||||
}
|
||||
|
||||
/* text("foo\nbar\nbaz") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_text(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -841,7 +841,7 @@ nhl_text(lua_State *L)
|
||||
}
|
||||
|
||||
/* makeplural("zorkmid") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_makeplural(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -855,7 +855,7 @@ nhl_makeplural(lua_State *L)
|
||||
}
|
||||
|
||||
/* makesingular("zorkmids") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_makesingular(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -869,7 +869,7 @@ nhl_makesingular(lua_State *L)
|
||||
}
|
||||
|
||||
/* s_suffix("foo") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_s_suffix(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -883,7 +883,7 @@ nhl_s_suffix(lua_State *L)
|
||||
}
|
||||
|
||||
/* ing_suffix("foo") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_ing_suffix(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -897,7 +897,7 @@ nhl_ing_suffix(lua_State *L)
|
||||
}
|
||||
|
||||
/* an("foo") */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_an(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -911,7 +911,7 @@ nhl_an(lua_State *L)
|
||||
}
|
||||
|
||||
/* rn2(10) */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_rn2(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -926,7 +926,7 @@ nhl_rn2(lua_State *L)
|
||||
|
||||
/* random(10); -- is the same as rn2(10); */
|
||||
/* random(5,8); -- same as 5 + rn2(8); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_random(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -943,7 +943,7 @@ nhl_random(lua_State *L)
|
||||
}
|
||||
|
||||
/* level_difficulty() */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_level_difficulty(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1070,7 +1070,7 @@ get_table_option(lua_State *L,
|
||||
|
||||
#ifdef DUMPLOG
|
||||
/* local fname = dump_fmtstr("/tmp/nethack.%n.%d.log"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_dump_fmtstr(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1085,7 +1085,7 @@ nhl_dump_fmtstr(lua_State *L)
|
||||
#endif /* DUMPLOG */
|
||||
|
||||
/* local dungeon_name = dnum_name(u.dnum); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_dnum_name(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1108,7 +1108,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
/* set or get variables which are saved and restored along with the game.
|
||||
nh.variable("test", 10);
|
||||
local ten = nh.variable("test"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_variable(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1243,7 +1243,7 @@ restore_luadata(NHFILE *nhfp)
|
||||
}
|
||||
|
||||
/* local stairs = stairways(); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_stairways(lua_State *L)
|
||||
{
|
||||
stairway *tmp = gs.stairs;
|
||||
@@ -1274,7 +1274,7 @@ nhl_stairways(lua_State *L)
|
||||
/*
|
||||
test( { x = 123, y = 456 } );
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
nhl_test(lua_State *L)
|
||||
{
|
||||
coordxy x, y;
|
||||
@@ -1298,7 +1298,7 @@ nhl_test(lua_State *L)
|
||||
|
||||
/* push a key into command queue */
|
||||
/* nh.pushkey("i"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_pushkey(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1314,7 +1314,7 @@ nhl_pushkey(lua_State *L)
|
||||
|
||||
/* do a turn of moveloop, or until gm.multi is done if param is true. */
|
||||
/* nh.doturn(); nh.doturn(true); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_doturn(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1334,7 +1334,7 @@ nhl_doturn(lua_State *L)
|
||||
/* nh.debug_flags({ mongen = false,
|
||||
hunger = false,
|
||||
overwrite_stairs = true }); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_debug_flags(lua_State *L)
|
||||
{
|
||||
int val;
|
||||
@@ -1377,7 +1377,7 @@ DISABLE_WARNING_UNREACHABLE_CODE
|
||||
/* does location at x,y have timer? */
|
||||
/* local has_melttimer = nh.has_timer_at(x,y, "melt-ice"); */
|
||||
/* local has_melttimer = nh.has_timer_at({x=4,y=7}, "melt-ice"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_timer_has_at(lua_State *L)
|
||||
{
|
||||
boolean ret = FALSE;
|
||||
@@ -1408,7 +1408,7 @@ nhl_timer_has_at(lua_State *L)
|
||||
/* when does location at x,y timer trigger? */
|
||||
/* local melttime = nh.peek_timer_at(x,y, "melt-ice"); */
|
||||
/* local melttime = nh.peek_timer_at({x=5,y=6}, "melt-ice"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_timer_peek_at(lua_State *L)
|
||||
{
|
||||
long when = 0L;
|
||||
@@ -1436,7 +1436,7 @@ nhl_timer_peek_at(lua_State *L)
|
||||
/* stop timer at location x,y */
|
||||
/* nh.stop_timer_at(x,y, "melt-ice"); */
|
||||
/* nh.stop_timer_at({x=6,y=8}, "melt-ice"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_timer_stop_at(lua_State *L)
|
||||
{
|
||||
short timertype = nhl_get_timertype(L, -1);
|
||||
@@ -1461,7 +1461,7 @@ nhl_timer_stop_at(lua_State *L)
|
||||
|
||||
/* start timer at location x,y */
|
||||
/* nh.start_timer_at(x,y, "melt-ice", 10); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_timer_start_at(lua_State *L)
|
||||
{
|
||||
short timertype = nhl_get_timertype(L, -2);
|
||||
@@ -1493,7 +1493,7 @@ nhl_timer_start_at(lua_State *L)
|
||||
/* returns the visual interpretation of the key bound to an extended command,
|
||||
or the ext cmd name if not bound to any key */
|
||||
/* local helpkey = eckey("help"); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_get_cmd_key(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1513,7 +1513,7 @@ nhl_get_cmd_key(lua_State *L)
|
||||
/* callback("level_enter", "function_name"); */
|
||||
/* callback("level_enter", "function_name", true); */
|
||||
/* level_enter, level_leave, cmd_before */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_callback(lua_State *L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
@@ -1563,7 +1563,7 @@ nhl_callback(lua_State *L)
|
||||
/* currently handles inventory and turns. */
|
||||
/* gamestate(); -- save state */
|
||||
/* gamestate(true); -- restore state */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_gamestate(lua_State *L)
|
||||
{
|
||||
static struct obj *gmst_invent = NULL;
|
||||
@@ -1702,7 +1702,7 @@ static const struct {
|
||||
};
|
||||
|
||||
/* register and init the constants table */
|
||||
static void
|
||||
staticfn void
|
||||
init_nhc_data(lua_State *L)
|
||||
{
|
||||
int i;
|
||||
@@ -1718,7 +1718,7 @@ init_nhc_data(lua_State *L)
|
||||
lua_setglobal(L, "nhc");
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
nhl_push_anything(lua_State *L, int anytype, void *src)
|
||||
{
|
||||
anything any = cg.zeroany;
|
||||
@@ -1742,7 +1742,7 @@ nhl_push_anything(lua_State *L, int anytype, void *src)
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
nhl_meta_u_index(lua_State *L)
|
||||
{
|
||||
static const struct {
|
||||
@@ -1809,7 +1809,7 @@ nhl_meta_u_index(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
nhl_meta_u_newindex(lua_State *L)
|
||||
{
|
||||
nhl_error(L, "Cannot set u table values");
|
||||
@@ -1819,7 +1819,7 @@ nhl_meta_u_newindex(lua_State *L)
|
||||
|
||||
RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
nhl_u_clear_inventory(lua_State *L UNUSED)
|
||||
{
|
||||
while (gi.invent)
|
||||
@@ -1829,7 +1829,7 @@ nhl_u_clear_inventory(lua_State *L UNUSED)
|
||||
|
||||
/* Put object into player's inventory */
|
||||
/* u.giveobj(obj.new("rock")); */
|
||||
static int
|
||||
staticfn int
|
||||
nhl_u_giveobj(lua_State *L)
|
||||
{
|
||||
return nhl_obj_u_giveobj(L);
|
||||
@@ -1841,7 +1841,7 @@ static const struct luaL_Reg nhl_u_functions[] = {
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_u_data(lua_State *L)
|
||||
{
|
||||
lua_newtable(L);
|
||||
@@ -1856,7 +1856,7 @@ init_u_data(lua_State *L)
|
||||
}
|
||||
|
||||
#ifdef notyet
|
||||
static int
|
||||
staticfn int
|
||||
nhl_set_package_path(lua_State *L, const char *path)
|
||||
{
|
||||
if (LUA_TTABLE != lua_getglobal(L, "package")) {
|
||||
@@ -1870,7 +1870,7 @@ nhl_set_package_path(lua_State *L, const char *path)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
traceback_handler(lua_State *L)
|
||||
{
|
||||
luaL_traceback(L, L, lua_tostring(L, 1), 0);
|
||||
@@ -1878,7 +1878,7 @@ traceback_handler(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
staticfn uint32_t
|
||||
nhl_getmeminuse(lua_State *L)
|
||||
{
|
||||
return lua_gc(L, LUA_GCCOUNT) * 1024 + lua_gc(L, LUA_GCCOUNTB);
|
||||
@@ -2377,7 +2377,7 @@ static struct e ct_os_files[] = {
|
||||
#define DROPIF(flag, lib, ct) \
|
||||
nhl_clearfromtable(L, !!(lflags & flag), lib, ct)
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
nhl_clearfromtable(lua_State *L, int flag, int tndx, struct e *todo)
|
||||
{
|
||||
while (todo->when != EOT) {
|
||||
@@ -2428,7 +2428,7 @@ return values from "call it":
|
||||
* We're going to do #3.
|
||||
*/
|
||||
#ifdef notyet
|
||||
static boolean
|
||||
staticfn boolean
|
||||
start_luapat(void)
|
||||
{
|
||||
int rv;
|
||||
@@ -2449,7 +2449,7 @@ start_luapat(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
end_luapat(void)
|
||||
{
|
||||
if (luapat) {
|
||||
@@ -2459,7 +2459,7 @@ end_luapat(void)
|
||||
}
|
||||
|
||||
#ifdef notyet
|
||||
static int
|
||||
staticfn int
|
||||
opencheckpat(lua_State *L, const char *ename, int param)
|
||||
{
|
||||
/* careful - we're using 2 different and unrelated Lua states */
|
||||
@@ -2513,7 +2513,7 @@ nhl_pushhooked_open_table(lua_State *L)
|
||||
}
|
||||
|
||||
#ifdef notyet
|
||||
static int
|
||||
staticfn int
|
||||
hooked_open(lua_State *L)
|
||||
{
|
||||
const char *mode;
|
||||
@@ -2581,7 +2581,7 @@ hooked_open(lua_State *L)
|
||||
return (*io_open)(L);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
hook_open(lua_State *L)
|
||||
{
|
||||
boolean rv = FALSE;
|
||||
@@ -2613,7 +2613,7 @@ hook_open(lua_State *L)
|
||||
DISABLE_WARNING_CONDEXPR_IS_CONSTANT
|
||||
|
||||
#ifdef NHL_SANDBOX
|
||||
static void
|
||||
staticfn void
|
||||
nhlL_openlibs(lua_State *L, uint32_t lflags)
|
||||
{
|
||||
/* translate lflags from user-friendly to internal */
|
||||
@@ -2736,7 +2736,7 @@ UNSAFEIO:
|
||||
|
||||
RESTORE_WARNING_CONDEXPR_IS_CONSTANT
|
||||
|
||||
static void *
|
||||
staticfn void *
|
||||
nhl_alloc(void *ud, void *ptr, size_t osize UNUSED, size_t nsize)
|
||||
{
|
||||
nhl_user_data *nud = ud;
|
||||
@@ -2759,7 +2759,7 @@ nhl_alloc(void *ud, void *ptr, size_t osize UNUSED, size_t nsize)
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
nhl_panic(lua_State *L)
|
||||
{
|
||||
const char *msg = lua_tostring(L, -1);
|
||||
@@ -2775,7 +2775,7 @@ RESTORE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
/* called when lua issues a warning message; the text of the message
|
||||
is passed to us in pieces across multiple function calls */
|
||||
static void
|
||||
staticfn void
|
||||
nhl_warn(
|
||||
void *userdata UNUSED,
|
||||
const char *msg_fragment,
|
||||
@@ -2796,7 +2796,7 @@ nhl_warn(
|
||||
}
|
||||
|
||||
#ifdef NHL_SANDBOX
|
||||
static void
|
||||
staticfn void
|
||||
nhl_hookfn(lua_State *L, lua_Debug *ar UNUSED)
|
||||
{
|
||||
nhl_user_data *nud;
|
||||
@@ -2811,7 +2811,7 @@ nhl_hookfn(lua_State *L, lua_Debug *ar UNUSED)
|
||||
}
|
||||
#endif
|
||||
|
||||
static lua_State *
|
||||
staticfn lua_State *
|
||||
nhlL_newstate(nhl_sandbox_info *sbi, const char *name)
|
||||
{
|
||||
nhl_user_data *nud = 0;
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "nhmd4.h"
|
||||
|
||||
static const unsigned char *nhmd4_body(struct nhmd4_context *,
|
||||
staticfn const unsigned char *nhmd4_body(struct nhmd4_context *,
|
||||
const unsigned char *, size_t);
|
||||
|
||||
/* Avoid a conflict from a Lua header */
|
||||
@@ -79,7 +79,7 @@ static const unsigned char *nhmd4_body(struct nhmd4_context *,
|
||||
* This processes one or more 64-byte data blocks, but does NOT update
|
||||
* the bit counters. There're no alignment requirements.
|
||||
*/
|
||||
static const unsigned char *
|
||||
staticfn const unsigned char *
|
||||
nhmd4_body(
|
||||
struct nhmd4_context *ctx,
|
||||
const unsigned char *data,
|
||||
|
||||
+24
-24
@@ -5,20 +5,20 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void setgemprobs(d_level *);
|
||||
static void randomize_gem_colors(void);
|
||||
static void shuffle(int, int, boolean);
|
||||
static void shuffle_all(void);
|
||||
static int QSORTCALLBACK discovered_cmp(const genericptr, const genericptr);
|
||||
static char *sortloot_descr(int, char *);
|
||||
static char *disco_typename(int);
|
||||
static void disco_append_typename(char *, int);
|
||||
static void disco_output_sorted(winid, char **, int, boolean);
|
||||
static char *oclass_to_name(char, char *);
|
||||
staticfn void setgemprobs(d_level *);
|
||||
staticfn void randomize_gem_colors(void);
|
||||
staticfn void shuffle(int, int, boolean);
|
||||
staticfn void shuffle_all(void);
|
||||
staticfn int QSORTCALLBACK discovered_cmp(const genericptr, const genericptr);
|
||||
staticfn char *sortloot_descr(int, char *);
|
||||
staticfn char *disco_typename(int);
|
||||
staticfn void disco_append_typename(char *, int);
|
||||
staticfn void disco_output_sorted(winid, char **, int, boolean);
|
||||
staticfn char *oclass_to_name(char, char *);
|
||||
|
||||
#ifdef TILES_IN_GLYPHMAP
|
||||
extern glyph_map glyphmap[MAX_GLYPH];
|
||||
static void shuffle_tiles(void);
|
||||
staticfn void shuffle_tiles(void);
|
||||
|
||||
/* Shuffle tile assignments to match descriptions, so a red potion isn't
|
||||
* displayed with a blue tile and so on.
|
||||
@@ -29,7 +29,7 @@ static void shuffle_tiles(void);
|
||||
* is restored. So might as well do that the first time instead of writing
|
||||
* another routine.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
shuffle_tiles(void)
|
||||
{
|
||||
int i;
|
||||
@@ -48,7 +48,7 @@ shuffle_tiles(void)
|
||||
}
|
||||
#endif /* TILES_IN_GLYPHMAP */
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
setgemprobs(d_level *dlev)
|
||||
{
|
||||
int j, first, lev, sum = 0;
|
||||
@@ -79,7 +79,7 @@ setgemprobs(d_level *dlev)
|
||||
}
|
||||
|
||||
/* some gems can have different colors */
|
||||
static void
|
||||
staticfn void
|
||||
randomize_gem_colors(void)
|
||||
{
|
||||
#define COPY_OBJ_DESCR(o_dst, o_src) \
|
||||
@@ -107,7 +107,7 @@ randomize_gem_colors(void)
|
||||
}
|
||||
|
||||
/* shuffle descriptions on objects o_low to o_high */
|
||||
static void
|
||||
staticfn void
|
||||
shuffle(int o_low, int o_high, boolean domaterial)
|
||||
{
|
||||
int i, j, num_to_shuffle;
|
||||
@@ -312,7 +312,7 @@ obj_shuffle_range(
|
||||
}
|
||||
|
||||
/* randomize object descriptions */
|
||||
static void
|
||||
staticfn void
|
||||
shuffle_all(void)
|
||||
{
|
||||
/* entire classes; obj_shuffle_range() handles their exceptions */
|
||||
@@ -516,7 +516,7 @@ static const short uniq_objs[] = {
|
||||
};
|
||||
|
||||
/* discoveries qsort comparison function */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
discovered_cmp(const genericptr v1, const genericptr v2)
|
||||
{
|
||||
const char *s1 = *(const char **) v1;
|
||||
@@ -530,7 +530,7 @@ discovered_cmp(const genericptr v1, const genericptr v2)
|
||||
return res;
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
sortloot_descr(int otyp, char *outbuf)
|
||||
{
|
||||
Loot sl_cookie;
|
||||
@@ -562,8 +562,8 @@ sortloot_descr(int otyp, char *outbuf)
|
||||
#define DISCO_ALPHABYCLASS 2 /* alphabetized within each class */
|
||||
#define DISCO_ALPHABETIZED 3 /* alphabetized across all classes */
|
||||
/* also used in options.c (optfn_sortdiscoveries) */
|
||||
const char disco_order_let[] = "osca";
|
||||
const char *const disco_orders_descr[] = {
|
||||
static const char disco_order_let[] = "osca";
|
||||
static const char *const disco_orders_descr[] = {
|
||||
"by order of discovery within each class",
|
||||
"sortloot order (by class with some sub-class groupings)",
|
||||
"alphabetical within each class",
|
||||
@@ -621,7 +621,7 @@ choose_disco_sort(
|
||||
}
|
||||
|
||||
/* augment obj_typename() with explanation of Japanese item names */
|
||||
static char *
|
||||
staticfn char *
|
||||
disco_typename(int otyp)
|
||||
{
|
||||
char *result = obj_typename(otyp);
|
||||
@@ -653,7 +653,7 @@ disco_typename(int otyp)
|
||||
}
|
||||
|
||||
/* append typename(dis) to buf[], possibly truncating in the process */
|
||||
static void
|
||||
staticfn void
|
||||
disco_append_typename(char *buf, int dis)
|
||||
{
|
||||
unsigned len = (unsigned) strlen(buf);
|
||||
@@ -677,7 +677,7 @@ disco_append_typename(char *buf, int dis)
|
||||
}
|
||||
|
||||
/* sort and output sorted_lines to window and free the lines */
|
||||
static void
|
||||
staticfn void
|
||||
disco_output_sorted(winid tmpwin,
|
||||
char **sorted_lines, int sorted_ct,
|
||||
boolean lootsort)
|
||||
@@ -799,7 +799,7 @@ dodiscovered(void) /* free after Robert Viduya */
|
||||
}
|
||||
|
||||
/* lower case let_to_name() output, which differs from def_oc_syms[].name */
|
||||
static char *
|
||||
staticfn char *
|
||||
oclass_to_name(char oclass, char *buf)
|
||||
{
|
||||
char *s;
|
||||
|
||||
+2
-2
@@ -10,13 +10,13 @@
|
||||
#include "color.h"
|
||||
#include "objclass.h"
|
||||
|
||||
NEARDATA struct objdescr obj_descr_init[NUM_OBJECTS + 1] = {
|
||||
static struct objdescr obj_descr_init[NUM_OBJECTS + 1] = {
|
||||
#define OBJECTS_DESCR_INIT
|
||||
#include "objects.h"
|
||||
#undef OBJECTS_DESCR_INIT
|
||||
};
|
||||
|
||||
NEARDATA struct objclass obj_init[NUM_OBJECTS + 1] = {
|
||||
static struct objclass obj_init[NUM_OBJECTS + 1] = {
|
||||
#define OBJECTS_INIT
|
||||
#include "objects.h"
|
||||
#undef OBJECTS_INIT
|
||||
|
||||
+62
-46
@@ -32,30 +32,30 @@ struct _readobjnam_data {
|
||||
char fruitbuf[BUFSZ];
|
||||
};
|
||||
|
||||
static char *strprepend(char *, const char *);
|
||||
static char *nextobuf(void);
|
||||
static void releaseobuf(char *);
|
||||
static void xcalled(char *, int, const char *, const char *);
|
||||
static char *xname_flags(struct obj *, unsigned);
|
||||
static char *minimal_xname(struct obj *);
|
||||
static void add_erosion_words(struct obj *, char *);
|
||||
static char *doname_base(struct obj *obj, unsigned);
|
||||
static boolean singplur_lookup(char *, char *, boolean,
|
||||
staticfn char *strprepend(char *, const char *);
|
||||
staticfn char *nextobuf(void);
|
||||
staticfn void releaseobuf(char *);
|
||||
staticfn void xcalled(char *, int, const char *, const char *);
|
||||
staticfn char *xname_flags(struct obj *, unsigned);
|
||||
staticfn char *minimal_xname(struct obj *);
|
||||
staticfn void add_erosion_words(struct obj *, char *);
|
||||
staticfn char *doname_base(struct obj *obj, unsigned);
|
||||
staticfn boolean singplur_lookup(char *, char *, boolean,
|
||||
const char *const *);
|
||||
static char *singplur_compound(char *);
|
||||
static boolean ch_ksound(const char *basestr);
|
||||
static boolean badman(const char *, boolean);
|
||||
static boolean wishymatch(const char *, const char *, boolean);
|
||||
static short rnd_otyp_by_wpnskill(schar);
|
||||
static short rnd_otyp_by_namedesc(const char *, char, int);
|
||||
static struct obj *wizterrainwish(struct _readobjnam_data *);
|
||||
static void dbterrainmesg(const char *, coordxy, coordxy) NONNULLARG1;
|
||||
static void readobjnam_init(char *, struct _readobjnam_data *);
|
||||
static int readobjnam_preparse(struct _readobjnam_data *);
|
||||
static void readobjnam_parse_charges(struct _readobjnam_data *);
|
||||
static int readobjnam_postparse1(struct _readobjnam_data *);
|
||||
static int readobjnam_postparse2(struct _readobjnam_data *);
|
||||
static int readobjnam_postparse3(struct _readobjnam_data *);
|
||||
staticfn char *singplur_compound(char *);
|
||||
staticfn boolean ch_ksound(const char *basestr);
|
||||
staticfn boolean badman(const char *, boolean);
|
||||
staticfn boolean wishymatch(const char *, const char *, boolean);
|
||||
staticfn short rnd_otyp_by_wpnskill(schar);
|
||||
staticfn short rnd_otyp_by_namedesc(const char *, char, int);
|
||||
staticfn struct obj *wizterrainwish(struct _readobjnam_data *);
|
||||
staticfn void dbterrainmesg(const char *, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn void readobjnam_init(char *, struct _readobjnam_data *);
|
||||
staticfn int readobjnam_preparse(struct _readobjnam_data *);
|
||||
staticfn void readobjnam_parse_charges(struct _readobjnam_data *);
|
||||
staticfn int readobjnam_postparse1(struct _readobjnam_data *);
|
||||
staticfn int readobjnam_postparse2(struct _readobjnam_data *);
|
||||
staticfn int readobjnam_postparse3(struct _readobjnam_data *);
|
||||
|
||||
struct Jitem {
|
||||
int item;
|
||||
@@ -118,7 +118,7 @@ static const struct Jitem Japanese_items[] = {
|
||||
{ 0, "" }
|
||||
};
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
strprepend(char *s, const char *pref)
|
||||
{
|
||||
int i = (int) strlen(pref);
|
||||
@@ -136,7 +136,7 @@ strprepend(char *s, const char *pref)
|
||||
static char NEARDATA obufs[NUMOBUF][BUFSZ];
|
||||
static int obufidx = 0;
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
nextobuf(void)
|
||||
{
|
||||
obufidx = (obufidx + 1) % NUMOBUF;
|
||||
@@ -144,7 +144,7 @@ nextobuf(void)
|
||||
}
|
||||
|
||||
/* put the most recently allocated buffer back if possible */
|
||||
static void
|
||||
staticfn void
|
||||
releaseobuf(char *bufp)
|
||||
{
|
||||
/* caller may not know whether bufp is the most recently allocated
|
||||
@@ -528,7 +528,7 @@ reorder_fruit(boolean forward)
|
||||
}
|
||||
|
||||
/* add "<pfx> called <sfx>" to end of buf, truncating if necessary */
|
||||
static void
|
||||
staticfn void
|
||||
xcalled(
|
||||
char *buf, /* eos(obuf) or eos(&obuf[PREFIX]) */
|
||||
int siz, /* BUFSZ or BUFSZ-PREFIX */
|
||||
@@ -551,7 +551,7 @@ xname(struct obj *obj)
|
||||
return xname_flags(obj, CXN_NORMAL);
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
xname_flags(
|
||||
struct obj *obj,
|
||||
unsigned cxn_flags) /* bitmask of CXN_xxx values */
|
||||
@@ -995,7 +995,7 @@ xname_flags(
|
||||
brown potion -- if oc_name_known not set
|
||||
potion of object detection -- if discovered
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
minimal_xname(struct obj *obj)
|
||||
{
|
||||
char *bufp;
|
||||
@@ -1098,7 +1098,7 @@ the_unique_pm(struct permonst *ptr)
|
||||
return uniq;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
add_erosion_words(struct obj *obj, char *prefix)
|
||||
{
|
||||
boolean iscrys = (obj->otyp == CRYSKNIFE);
|
||||
@@ -1177,7 +1177,7 @@ erosion_matters(struct obj *obj)
|
||||
#define DONAME_FOR_MENU 4 /* [not used anywhere yet] */
|
||||
|
||||
/* core of doname() */
|
||||
static char *
|
||||
staticfn char *
|
||||
doname_base(
|
||||
struct obj *obj, /* object to format */
|
||||
unsigned doname_flags) /* special case requests */
|
||||
@@ -2596,7 +2596,7 @@ static const char *const as_is[] = {
|
||||
};
|
||||
|
||||
/* singularize/pluralize decisions common to both makesingular & makeplural */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
singplur_lookup(
|
||||
char *basestr, char *endstring, /* base string, pointer to eos(string) */
|
||||
boolean to_plural, /* true => makeplural, false => makesingular */
|
||||
@@ -2671,7 +2671,7 @@ singplur_lookup(
|
||||
}
|
||||
|
||||
/* searches for common compounds, ex. lump of royal jelly */
|
||||
static char *
|
||||
staticfn char *
|
||||
singplur_compound(char *str)
|
||||
{
|
||||
/* if new entries are added, be sure to keep compound_start[] in sync */
|
||||
@@ -3056,7 +3056,7 @@ makesingular(const char *oldstr)
|
||||
}
|
||||
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
ch_ksound(const char *basestr)
|
||||
{
|
||||
/* these are some *ch words/suffixes that make a k-sound. They pluralize by
|
||||
@@ -3082,7 +3082,7 @@ ch_ksound(const char *basestr)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
badman(
|
||||
const char *basestr,
|
||||
boolean to_plural) /* True: makeplural, False: makesingular */
|
||||
@@ -3131,7 +3131,7 @@ badman(
|
||||
}
|
||||
|
||||
/* compare user string against object name string using fuzzy matching */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
wishymatch(
|
||||
const char *u_str, /* from user, so might be variant spelling */
|
||||
const char *o_str, /* from objects[], so is in canonical form */
|
||||
@@ -3306,6 +3306,7 @@ static const struct alt_spellings {
|
||||
{ "grapnel", GRAPPLING_HOOK },
|
||||
{ "grapple", GRAPPLING_HOOK },
|
||||
{ "protection from shape shifters", RIN_PROTECTION_FROM_SHAPE_CHAN },
|
||||
{ "accuracy", RIN_INCREASE_ACCURACY },
|
||||
/* if we ever add other sizes, move this to o_ranges[] with "bag" */
|
||||
{ "box", LARGE_BOX },
|
||||
/* normally we wouldn't have to worry about unnecessary <space>, but
|
||||
@@ -3318,7 +3319,7 @@ static const struct alt_spellings {
|
||||
{ (const char *) 0, 0 },
|
||||
};
|
||||
|
||||
static short
|
||||
staticfn short
|
||||
rnd_otyp_by_wpnskill(schar skill)
|
||||
{
|
||||
int i, n = 0;
|
||||
@@ -3341,7 +3342,7 @@ rnd_otyp_by_wpnskill(schar skill)
|
||||
return otyp;
|
||||
}
|
||||
|
||||
static short
|
||||
staticfn short
|
||||
rnd_otyp_by_namedesc(
|
||||
const char *name,
|
||||
char oclass,
|
||||
@@ -3425,7 +3426,7 @@ shiny_obj(char oclass)
|
||||
}
|
||||
|
||||
/* in wizard mode, readobjnam() can accept wishes for traps and terrain */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
wizterrainwish(struct _readobjnam_data *d)
|
||||
{
|
||||
struct rm *lev;
|
||||
@@ -3796,7 +3797,7 @@ wizterrainwish(struct _readobjnam_data *d)
|
||||
}
|
||||
|
||||
/* message common to several wizterrainwish() results */
|
||||
static void
|
||||
staticfn void
|
||||
dbterrainmesg(
|
||||
const char *newtype,
|
||||
coordxy x, coordxy y)
|
||||
@@ -3809,7 +3810,7 @@ dbterrainmesg(
|
||||
#define TIN_EMPTY 1
|
||||
#define TIN_SPINACH 2
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
readobjnam_init(char *bp, struct _readobjnam_data *d)
|
||||
{
|
||||
d->otmp = (struct obj *) 0;
|
||||
@@ -3842,7 +3843,7 @@ readobjnam_init(char *bp, struct _readobjnam_data *d)
|
||||
|
||||
/* return 1 if d->bp is empty or contains only various qualifiers like
|
||||
"blessed", "rustproof", and so on, or 0 if anything else is present */
|
||||
static int
|
||||
staticfn int
|
||||
readobjnam_preparse(struct _readobjnam_data *d)
|
||||
{
|
||||
char *save_bp = 0;
|
||||
@@ -4054,7 +4055,7 @@ readobjnam_preparse(struct _readobjnam_data *d)
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
readobjnam_parse_charges(struct _readobjnam_data *d)
|
||||
{
|
||||
if (strlen(d->bp) > 1 && (d->p = strrchr(d->bp, '(')) != 0) {
|
||||
@@ -4116,7 +4117,7 @@ readobjnam_parse_charges(struct _readobjnam_data *d)
|
||||
d->rechrg = 7; /* recharge_limit */
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
readobjnam_postparse1(struct _readobjnam_data *d)
|
||||
{
|
||||
int i;
|
||||
@@ -4528,7 +4529,7 @@ readobjnam_postparse1(struct _readobjnam_data *d)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
readobjnam_postparse2(struct _readobjnam_data *d)
|
||||
{
|
||||
int i;
|
||||
@@ -4589,7 +4590,7 @@ readobjnam_postparse2(struct _readobjnam_data *d)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
readobjnam_postparse3(struct _readobjnam_data *d)
|
||||
{
|
||||
int i;
|
||||
@@ -4746,6 +4747,21 @@ readobjnam_postparse3(struct _readobjnam_data *d)
|
||||
}
|
||||
}
|
||||
|
||||
/* got a class, but not specific type;
|
||||
check alternate spellings of items with matching classes */
|
||||
if (d->oclass && !d->typ) {
|
||||
const struct alt_spellings *as = spellings;
|
||||
|
||||
while (as->sp) {
|
||||
if (objects[as->ob].oc_class == d->oclass
|
||||
&& wishymatch(d->bp, as->sp, TRUE)) {
|
||||
d->typ = as->ob;
|
||||
return 2; /*goto typfnd;*/
|
||||
}
|
||||
as++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+330
-299
File diff suppressed because it is too large
Load Diff
+63
-63
@@ -11,46 +11,46 @@
|
||||
#include "hack.h"
|
||||
#include "dlb.h"
|
||||
|
||||
static boolean is_swallow_sym(int);
|
||||
static int append_str(char *, const char *) NONNULLPTRS;
|
||||
static void trap_description(char *, int, coordxy, coordxy) NONNULLARG1;
|
||||
static void look_at_object(char *, coordxy, coordxy, int) NONNULLARG1;
|
||||
static void look_at_monster(char *, char *, struct monst *,
|
||||
staticfn boolean is_swallow_sym(int);
|
||||
staticfn int append_str(char *, const char *) NONNULLPTRS;
|
||||
staticfn void trap_description(char *, int, coordxy, coordxy) NONNULLARG1;
|
||||
staticfn void look_at_object(char *, coordxy, coordxy, int) NONNULLARG1;
|
||||
staticfn void look_at_monster(char *, char *, struct monst *,
|
||||
coordxy, coordxy) NONNULLARG13;
|
||||
/* lookat() can return Null */
|
||||
static struct permonst *lookat(coordxy, coordxy, char *, char *) NONNULLPTRS;
|
||||
static boolean checkfile(char *, struct permonst *, unsigned,
|
||||
staticfn struct permonst *lookat(coordxy, coordxy, char *, char *) NONNULLPTRS;
|
||||
staticfn boolean checkfile(char *, struct permonst *, unsigned,
|
||||
char *) NO_NNARGS;
|
||||
static int add_cmap_descr(int, int, int, int, coord,
|
||||
staticfn int add_cmap_descr(int, int, int, int, coord,
|
||||
const char *, const char *,
|
||||
boolean *, const char **, char *) NONNULLPTRS;
|
||||
static void look_region_nearby(coordxy *, coordxy *, coordxy *, coordxy *,
|
||||
staticfn void look_region_nearby(coordxy *, coordxy *, coordxy *, coordxy *,
|
||||
boolean) NONNULLPTRS;
|
||||
static void look_all(boolean, boolean);
|
||||
static void look_traps(boolean);
|
||||
static void look_engrs(boolean);
|
||||
static void do_supplemental_info(char *, struct permonst *,
|
||||
staticfn void look_all(boolean, boolean);
|
||||
staticfn void look_traps(boolean);
|
||||
staticfn void look_engrs(boolean);
|
||||
staticfn void do_supplemental_info(char *, struct permonst *,
|
||||
boolean) NONNULLPTRS;
|
||||
static void whatdoes_help(void);
|
||||
static void docontact(void);
|
||||
static void dispfile_help(void);
|
||||
static void dispfile_shelp(void);
|
||||
static void dispfile_optionfile(void);
|
||||
static void dispfile_optmenu(void);
|
||||
static void dispfile_license(void);
|
||||
static void dispfile_debughelp(void);
|
||||
static void dispfile_usagehelp(void);
|
||||
static void hmenu_doextversion(void);
|
||||
static void hmenu_dohistory(void);
|
||||
static void hmenu_dowhatis(void);
|
||||
static void hmenu_dowhatdoes(void);
|
||||
static void hmenu_doextlist(void);
|
||||
static void domenucontrols(void);
|
||||
staticfn void whatdoes_help(void);
|
||||
staticfn void docontact(void);
|
||||
staticfn void dispfile_help(void);
|
||||
staticfn void dispfile_shelp(void);
|
||||
staticfn void dispfile_optionfile(void);
|
||||
staticfn void dispfile_optmenu(void);
|
||||
staticfn void dispfile_license(void);
|
||||
staticfn void dispfile_debughelp(void);
|
||||
staticfn void dispfile_usagehelp(void);
|
||||
staticfn void hmenu_doextversion(void);
|
||||
staticfn void hmenu_dohistory(void);
|
||||
staticfn void hmenu_dowhatis(void);
|
||||
staticfn void hmenu_dowhatdoes(void);
|
||||
staticfn void hmenu_doextlist(void);
|
||||
staticfn void domenucontrols(void);
|
||||
#ifdef PORT_HELP
|
||||
extern void port_help(void);
|
||||
#endif
|
||||
static char *setopt_cmd(char *) NONNULL NONNULLARG1;
|
||||
static boolean add_quoted_engraving(coordxy, coordxy, char *) NONNULLARG3;
|
||||
staticfn char *setopt_cmd(char *) NONNULL NONNULLARG1;
|
||||
staticfn boolean add_quoted_engraving(coordxy, coordxy, char *) NONNULLARG3;
|
||||
|
||||
enum checkfileflags {
|
||||
chkfilNone = 0,
|
||||
@@ -63,7 +63,7 @@ static const char invisexplain[] = "remembered, unseen, creature",
|
||||
altinvisexplain[] = "unseen creature"; /* for clairvoyance */
|
||||
|
||||
/* Returns "true" for characters that could represent a monster's stomach. */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_swallow_sym(int c)
|
||||
{
|
||||
int i;
|
||||
@@ -77,7 +77,7 @@ is_swallow_sym(int c)
|
||||
/* Append " or "+new_str to the end of buf if new_str doesn't already exist
|
||||
as a substring of buf. Return 1 if the string was appended, 0 otherwise.
|
||||
It is expected that buf is of size BUFSZ. */
|
||||
static int
|
||||
staticfn int
|
||||
append_str(char *buf, const char *new_str)
|
||||
{
|
||||
static const char sep[] = " or ";
|
||||
@@ -159,7 +159,7 @@ monhealthdescr(struct monst *mon, boolean addspace, char *outbuf)
|
||||
}
|
||||
|
||||
/* copy a trap's description into outbuf[] */
|
||||
static void
|
||||
staticfn void
|
||||
trap_description(char *outbuf, int tnum, coordxy x, coordxy y)
|
||||
{
|
||||
/*
|
||||
@@ -310,7 +310,7 @@ object_from_map(int glyph, coordxy x, coordxy y, struct obj **obj_p)
|
||||
return fakeobj; /* when True, caller needs to dealloc *obj_p */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
look_at_object(
|
||||
char *buf, /* output buffer */
|
||||
coordxy x, coordxy y,
|
||||
@@ -346,7 +346,7 @@ look_at_object(
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
look_at_monster(
|
||||
char *buf, char *monbuf, /* buf: output, monbuf: optional output */
|
||||
struct monst *mtmp,
|
||||
@@ -578,7 +578,7 @@ ice_descr(coordxy x, coordxy y, char *outbuf)
|
||||
* Return the name of the glyph found at (x,y).
|
||||
* If not hallucinating and the glyph is a monster, also monster data.
|
||||
*/
|
||||
static struct permonst *
|
||||
staticfn struct permonst *
|
||||
lookat(coordxy x, coordxy y, char *buf, char *monbuf)
|
||||
{
|
||||
struct monst *mtmp = (struct monst *) 0;
|
||||
@@ -751,7 +751,7 @@ ia_checkfile(struct obj *otmp)
|
||||
*
|
||||
* Returns True if an entry is found, False otherwise.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
checkfile(
|
||||
char *inp, /* string to look up */
|
||||
struct permonst *pm, /* monster type to look up (overrides 'inp') */
|
||||
@@ -1054,7 +1054,7 @@ checkfile(
|
||||
}
|
||||
|
||||
/* extracted from do_screen_description() */
|
||||
static int
|
||||
staticfn int
|
||||
add_cmap_descr(
|
||||
int found, /* number of matching descriptions so far */
|
||||
int idx, /* cmap index into defsyms[] */
|
||||
@@ -1529,7 +1529,7 @@ do_screen_description(
|
||||
}
|
||||
|
||||
/* when farlook is reporting on an engraving, include its text */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
add_quoted_engraving(coordxy x, coordxy y, char *buf)
|
||||
{
|
||||
char temp_buf[BUFSZ];
|
||||
@@ -1562,7 +1562,7 @@ add_quoted_engraving(coordxy x, coordxy y, char *buf)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* also used by getpos hack in do_name.c */
|
||||
/* also used by getpos hack in getpos.c */
|
||||
const char what_is_an_unknown_object[] = "an unknown object";
|
||||
|
||||
int
|
||||
@@ -1828,7 +1828,7 @@ do_look(int mode, coord *click_cc)
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
look_region_nearby(
|
||||
coordxy *lo_x, coordxy *lo_y,
|
||||
coordxy *hi_x, coordxy *hi_y, boolean nearby)
|
||||
@@ -1841,7 +1841,7 @@ look_region_nearby(
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL /* RESTORE is after do_supplemental_info() */
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
look_all(
|
||||
boolean nearby, /* True => within BOLTLIM, False => entire map */
|
||||
boolean do_mons) /* True => monsters, False => objects */
|
||||
@@ -1942,7 +1942,7 @@ look_all(
|
||||
}
|
||||
|
||||
/* give a /M style display of discovered traps, even when they're covered */
|
||||
static void
|
||||
staticfn void
|
||||
look_traps(boolean nearby)
|
||||
{
|
||||
winid win;
|
||||
@@ -2008,7 +2008,7 @@ look_traps(boolean nearby)
|
||||
|
||||
/* display of discovered engravings including headstones, even when they're
|
||||
covered provided they've been read */
|
||||
static void
|
||||
staticfn void
|
||||
look_engrs(boolean nearby)
|
||||
{
|
||||
winid win;
|
||||
@@ -2119,7 +2119,7 @@ static const char *suptext2[] = {
|
||||
(char *) 0,
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_supplemental_info(
|
||||
char *name,
|
||||
struct permonst *pm,
|
||||
@@ -2287,7 +2287,7 @@ doidtrap(void)
|
||||
rest_on_space, #if SHELL, #if SUSPEND) are booleans.
|
||||
*/
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
whatdoes_help(void)
|
||||
{
|
||||
dlb *fp;
|
||||
@@ -2322,9 +2322,9 @@ struct wd_stack_frame {
|
||||
Bitfield(else_seen, 1);
|
||||
};
|
||||
|
||||
static boolean whatdoes_cond(char *, struct wd_stack_frame *, int *, int);
|
||||
staticfn boolean whatdoes_cond(char *, struct wd_stack_frame *, int *, int);
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
whatdoes_cond(char *buf, struct wd_stack_frame *stack, int *depth, int lnum)
|
||||
{
|
||||
const char badstackfmt[] = "cmdhlp: too many &%c directives at line %d.";
|
||||
@@ -2584,7 +2584,7 @@ dowhatdoes(void)
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
docontact(void)
|
||||
{
|
||||
winid cwin = create_nhwindow(NHW_TEXT);
|
||||
@@ -2614,79 +2614,79 @@ docontact(void)
|
||||
destroy_nhwindow(cwin);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_help(void)
|
||||
{
|
||||
display_file(HELP, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_shelp(void)
|
||||
{
|
||||
display_file(SHELP, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_optionfile(void)
|
||||
{
|
||||
display_file(OPTIONFILE, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_optmenu(void)
|
||||
{
|
||||
display_file(OPTMENUHELP, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_license(void)
|
||||
{
|
||||
display_file(LICENSE, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_debughelp(void)
|
||||
{
|
||||
display_file(DEBUGHELP, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
dispfile_usagehelp(void)
|
||||
{
|
||||
display_file(USAGEHELP, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
hmenu_doextversion(void)
|
||||
{
|
||||
(void) doextversion();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
hmenu_dohistory(void)
|
||||
{
|
||||
(void) dohistory();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
hmenu_dowhatis(void)
|
||||
{
|
||||
(void) dowhatis();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
hmenu_dowhatdoes(void)
|
||||
{
|
||||
(void) dowhatdoes();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
hmenu_doextlist(void)
|
||||
{
|
||||
(void) doextlist();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
domenucontrols(void)
|
||||
{
|
||||
winid cwin = create_nhwindow(NHW_TEXT);
|
||||
@@ -2774,7 +2774,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
normally 'O' but could be bound to something else, or not bound at all;
|
||||
with the implementation of a simple options subset, now need 'mO' to get
|
||||
the full options command; format it as 'm O' */
|
||||
static char *
|
||||
staticfn char *
|
||||
setopt_cmd(char *outbuf)
|
||||
{
|
||||
char cmdbuf[QBUFSZ];
|
||||
|
||||
+74
-75
@@ -11,47 +11,47 @@
|
||||
|
||||
#define CONTAINED_SYM '>' /* from invent.c */
|
||||
|
||||
static void simple_look(struct obj *, boolean);
|
||||
static boolean query_classes(char *, boolean *, boolean *, const char *,
|
||||
staticfn void simple_look(struct obj *, boolean);
|
||||
staticfn boolean query_classes(char *, boolean *, boolean *, const char *,
|
||||
struct obj *, boolean, int *);
|
||||
static boolean fatal_corpse_mistake(struct obj *, boolean);
|
||||
static boolean describe_decor(void);
|
||||
static void check_here(boolean);
|
||||
static boolean n_or_more(struct obj *);
|
||||
static boolean all_but_uchain(struct obj *);
|
||||
staticfn boolean fatal_corpse_mistake(struct obj *, boolean);
|
||||
staticfn boolean describe_decor(void);
|
||||
staticfn void check_here(boolean);
|
||||
staticfn boolean n_or_more(struct obj *);
|
||||
staticfn boolean all_but_uchain(struct obj *);
|
||||
#if 0 /* not used */
|
||||
static boolean allow_cat_no_uchain(struct obj *);
|
||||
staticfn boolean allow_cat_no_uchain(struct obj *);
|
||||
#endif
|
||||
static int autopick(struct obj *, int, menu_item **);
|
||||
static int count_categories(struct obj *, int);
|
||||
static int delta_cwt(struct obj *, struct obj *);
|
||||
static long carry_count(struct obj *, struct obj *, long, boolean, int *,
|
||||
staticfn int autopick(struct obj *, int, menu_item **);
|
||||
staticfn int count_categories(struct obj *, int);
|
||||
staticfn int delta_cwt(struct obj *, struct obj *);
|
||||
staticfn long carry_count(struct obj *, struct obj *, long, boolean, int *,
|
||||
int *);
|
||||
static int lift_object(struct obj *, struct obj *, long *, boolean);
|
||||
static void pickup_prinv(struct obj *, long, const char *);
|
||||
static boolean mbag_explodes(struct obj *, int);
|
||||
static boolean is_boh_item_gone(void);
|
||||
static void do_boh_explosion(struct obj *, boolean);
|
||||
static long boh_loss(struct obj *, boolean);
|
||||
static int in_container(struct obj *);
|
||||
static int out_container(struct obj *);
|
||||
static long mbag_item_gone(boolean, struct obj *, boolean);
|
||||
static int stash_ok(struct obj *);
|
||||
static void explain_container_prompt(boolean);
|
||||
static int traditional_loot(boolean);
|
||||
static int menu_loot(int, boolean);
|
||||
static int tip_ok(struct obj *);
|
||||
static int choose_tip_container_menu(void);
|
||||
static struct obj *tipcontainer_gettarget(struct obj *, boolean *);
|
||||
static int tipcontainer_checks(struct obj *, struct obj *, boolean);
|
||||
static char in_or_out_menu(const char *, struct obj *, boolean, boolean,
|
||||
staticfn int lift_object(struct obj *, struct obj *, long *, boolean);
|
||||
staticfn void pickup_prinv(struct obj *, long, const char *);
|
||||
staticfn boolean mbag_explodes(struct obj *, int);
|
||||
staticfn boolean is_boh_item_gone(void);
|
||||
staticfn void do_boh_explosion(struct obj *, boolean);
|
||||
staticfn long boh_loss(struct obj *, boolean);
|
||||
staticfn int in_container(struct obj *);
|
||||
staticfn int out_container(struct obj *);
|
||||
staticfn long mbag_item_gone(boolean, struct obj *, boolean);
|
||||
staticfn int stash_ok(struct obj *);
|
||||
staticfn void explain_container_prompt(boolean);
|
||||
staticfn int traditional_loot(boolean);
|
||||
staticfn int menu_loot(int, boolean);
|
||||
staticfn int tip_ok(struct obj *);
|
||||
staticfn int choose_tip_container_menu(void);
|
||||
staticfn struct obj *tipcontainer_gettarget(struct obj *, boolean *);
|
||||
staticfn int tipcontainer_checks(struct obj *, struct obj *, boolean);
|
||||
staticfn char in_or_out_menu(const char *, struct obj *, boolean, boolean,
|
||||
boolean, boolean);
|
||||
static boolean able_to_loot(coordxy, coordxy, boolean);
|
||||
static boolean reverse_loot(void);
|
||||
static boolean mon_beside(coordxy, coordxy);
|
||||
static int do_loot_cont(struct obj **, int, int);
|
||||
static int doloot_core(void);
|
||||
static void tipcontainer(struct obj *);
|
||||
staticfn boolean able_to_loot(coordxy, coordxy, boolean);
|
||||
staticfn boolean reverse_loot(void);
|
||||
staticfn boolean mon_beside(coordxy, coordxy);
|
||||
staticfn int do_loot_cont(struct obj **, int, int);
|
||||
staticfn int doloot_core(void);
|
||||
staticfn void tipcontainer(struct obj *);
|
||||
|
||||
/* define for query_objlist() and autopickup() */
|
||||
#define FOLLOW(curr, flags) \
|
||||
@@ -72,7 +72,7 @@ static const char
|
||||
/* BUG: this lets you look at cockatrice corpses while blind without
|
||||
touching them */
|
||||
/* much simpler version of the look-here code; used by query_classes() */
|
||||
static void
|
||||
staticfn void
|
||||
simple_look(struct obj *otmp, /* list of objects */
|
||||
boolean here) /* flag for type of obj list linkage */
|
||||
{
|
||||
@@ -137,7 +137,7 @@ collect_obj_classes(char ilets[], struct obj *otmp, boolean here,
|
||||
* it was changed to enhance menu entry ordering ('A' stands out, but
|
||||
* some players complain that it is too easy to choose accidentally).
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
query_classes(
|
||||
char oclasses[], /* selected classes */
|
||||
boolean *one_at_a_time, /* to tell caller that user picked 'A' */
|
||||
@@ -262,7 +262,7 @@ query_classes(
|
||||
}
|
||||
|
||||
/* check whether hero is bare-handedly touching a cockatrice corpse */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
fatal_corpse_mistake(struct obj *obj, boolean remotely)
|
||||
{
|
||||
if (uarmg || remotely || obj->otyp != CORPSE
|
||||
@@ -331,7 +331,7 @@ deferred_decor(
|
||||
|
||||
/* handle 'mention_decor' (when walking onto a dungeon feature such as
|
||||
stairs or altar, describe it even if it isn't covered up by an object) */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
describe_decor(void)
|
||||
{
|
||||
char outbuf[BUFSZ], fbuf[QBUFSZ];
|
||||
@@ -408,7 +408,7 @@ describe_decor(void)
|
||||
}
|
||||
|
||||
/* look at the objects at our location, unless there are too many of them */
|
||||
static void
|
||||
staticfn void
|
||||
check_here(boolean picked_some)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -438,7 +438,7 @@ check_here(boolean picked_some)
|
||||
}
|
||||
|
||||
/* query_objlist callback: return TRUE if obj's count is >= reference value */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
n_or_more(struct obj *obj)
|
||||
{
|
||||
if (obj == uchain)
|
||||
@@ -487,7 +487,7 @@ add_valid_menu_class(int c)
|
||||
}
|
||||
|
||||
/* query_objlist callback: return TRUE if not uchain */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
all_but_uchain(struct obj *obj)
|
||||
{
|
||||
return (boolean) (obj != uchain);
|
||||
@@ -575,7 +575,7 @@ allow_category(struct obj *obj)
|
||||
|
||||
#if 0 /* not used */
|
||||
/* query_objlist callback: return TRUE if valid category (class), no uchain */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
allow_cat_no_uchain(struct obj *obj)
|
||||
{
|
||||
if (obj != uchain
|
||||
@@ -949,7 +949,7 @@ autopick_testobj(struct obj *otmp, boolean calc_costly)
|
||||
* picked is zero, the pickup list is left alone. The caller of this
|
||||
* function must free the pickup list.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
autopick(
|
||||
struct obj *olist, /* the object list */
|
||||
int follow, /* how to follow the object list */
|
||||
@@ -1484,7 +1484,7 @@ query_category(
|
||||
return n;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
count_categories(struct obj *olist, int qflags)
|
||||
{
|
||||
char *pack;
|
||||
@@ -1517,7 +1517,7 @@ count_categories(struct obj *olist, int qflags)
|
||||
* object is removed from it. Use before and after weight amounts rather
|
||||
* than trying to match the calculation used by weight() in mkobj.c.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
delta_cwt(struct obj *container, struct obj *obj)
|
||||
{
|
||||
struct obj **prev;
|
||||
@@ -1543,7 +1543,7 @@ delta_cwt(struct obj *container, struct obj *obj)
|
||||
}
|
||||
|
||||
/* could we carry `obj'? if not, could we carry some of it/them? */
|
||||
static long
|
||||
staticfn long
|
||||
carry_count(struct obj *obj, /* object to pick up... */
|
||||
struct obj *container, /* ...bag it is coming out of */
|
||||
long count,
|
||||
@@ -1678,8 +1678,7 @@ carry_count(struct obj *obj, /* object to pick up... */
|
||||
}
|
||||
|
||||
/* determine whether character is able and player is willing to carry `obj' */
|
||||
static
|
||||
int
|
||||
staticfn int
|
||||
lift_object(
|
||||
struct obj *obj, /* object to pick up... */
|
||||
struct obj *container, /* ...bag it's coming out of */
|
||||
@@ -1922,7 +1921,7 @@ pick_obj(struct obj *otmp)
|
||||
/* pickup_object()/out_container() helper;
|
||||
print an added-to-invent message for current object, limiting feedback
|
||||
about encumbrance to the first item which causes that to change */
|
||||
static void
|
||||
staticfn void
|
||||
pickup_prinv(
|
||||
struct obj *obj,
|
||||
long count,
|
||||
@@ -2017,7 +2016,7 @@ container_at(coordxy x, coordxy y, boolean countem)
|
||||
return container_count;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
able_to_loot(
|
||||
coordxy x, coordxy y,
|
||||
boolean looting) /* loot vs tip */
|
||||
@@ -2048,7 +2047,7 @@ able_to_loot(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mon_beside(coordxy x, coordxy y)
|
||||
{
|
||||
int i, j;
|
||||
@@ -2064,7 +2063,7 @@ mon_beside(coordxy x, coordxy y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
do_loot_cont(
|
||||
struct obj **cobjp,
|
||||
int cindex, /* index of this container (1..N)... */
|
||||
@@ -2153,7 +2152,7 @@ doloot(void)
|
||||
}
|
||||
|
||||
/* loot a container on the floor or loot saddle from mon. */
|
||||
static int
|
||||
staticfn int
|
||||
doloot_core(void)
|
||||
{
|
||||
struct obj *cobj, *nobj;
|
||||
@@ -2325,7 +2324,7 @@ doloot_core(void)
|
||||
}
|
||||
|
||||
/* called when attempting to #loot while confused */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
reverse_loot(void)
|
||||
{
|
||||
struct obj *goldob = 0, *coffers, *otmp, boxdummy;
|
||||
@@ -2462,7 +2461,7 @@ loot_mon(struct monst *mtmp, int *passed_info, boolean *prev_loot)
|
||||
* Decide whether an object being placed into a magic bag will cause
|
||||
* it to explode. If the object is a bag itself, check recursively.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
mbag_explodes(struct obj *obj, int depthin)
|
||||
{
|
||||
/* these won't cause an explosion when they're empty */
|
||||
@@ -2484,7 +2483,7 @@ mbag_explodes(struct obj *obj, int depthin)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_boh_item_gone(void)
|
||||
{
|
||||
return (boolean) (!rn2(13));
|
||||
@@ -2492,7 +2491,7 @@ is_boh_item_gone(void)
|
||||
|
||||
/* Scatter most of Bag of holding contents around. Some items will be
|
||||
destroyed with the same chance as looting a cursed bag. */
|
||||
static void
|
||||
staticfn void
|
||||
do_boh_explosion(struct obj *boh, boolean on_floor)
|
||||
{
|
||||
struct obj *otmp, *nobj;
|
||||
@@ -2511,7 +2510,7 @@ do_boh_explosion(struct obj *boh, boolean on_floor)
|
||||
/* boh is about to be deleted so no need to reset its in_use flag here */
|
||||
}
|
||||
|
||||
static long
|
||||
staticfn long
|
||||
boh_loss(struct obj *container, boolean held)
|
||||
{
|
||||
/* sometimes toss objects if a cursed magic bag */
|
||||
@@ -2532,7 +2531,7 @@ boh_loss(struct obj *container, boolean held)
|
||||
}
|
||||
|
||||
/* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */
|
||||
static int
|
||||
staticfn int
|
||||
in_container(struct obj *obj)
|
||||
{
|
||||
boolean floor_container = !carried(gc.current_container);
|
||||
@@ -2699,7 +2698,7 @@ ck_bag(struct obj *obj)
|
||||
}
|
||||
|
||||
/* Returns: -1 to stop, 1 item was removed, 0 item was not removed. */
|
||||
static int
|
||||
staticfn int
|
||||
out_container(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -2775,7 +2774,7 @@ removed_from_icebox(struct obj *obj)
|
||||
}
|
||||
|
||||
/* an object inside a cursed bag of holding is being destroyed */
|
||||
static long
|
||||
staticfn long
|
||||
mbag_item_gone(boolean held, struct obj *item, boolean silent)
|
||||
{
|
||||
struct monst *shkp;
|
||||
@@ -2869,7 +2868,7 @@ container_gone(int (*fn)(OBJ_P))
|
||||
&& !gc.current_container);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
explain_container_prompt(boolean more_containers)
|
||||
{
|
||||
static const char *const explaintext[] = {
|
||||
@@ -2915,7 +2914,7 @@ u_handsy(void)
|
||||
}
|
||||
|
||||
/* getobj callback for object to be stashed into a container */
|
||||
static int
|
||||
staticfn int
|
||||
stash_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -3186,7 +3185,7 @@ use_container(
|
||||
}
|
||||
|
||||
/* loot current_container (take things out or put things in), by prompting */
|
||||
static int
|
||||
staticfn int
|
||||
traditional_loot(boolean put_in)
|
||||
{
|
||||
int (*actionfunc)(OBJ_P), (*checkfunc)(OBJ_P);
|
||||
@@ -3221,7 +3220,7 @@ traditional_loot(boolean put_in)
|
||||
}
|
||||
|
||||
/* loot current_container (take things out or put things in), using a menu */
|
||||
static int
|
||||
staticfn int
|
||||
menu_loot(int retry, boolean put_in)
|
||||
{
|
||||
int n, i, n_looted = 0;
|
||||
@@ -3352,7 +3351,7 @@ menu_loot(int retry, boolean put_in)
|
||||
return n_looted ? ECMD_TIME : ECMD_OK;
|
||||
}
|
||||
|
||||
static char
|
||||
staticfn char
|
||||
in_or_out_menu(
|
||||
const char *prompt,
|
||||
struct obj *obj,
|
||||
@@ -3435,7 +3434,7 @@ in_or_out_menu(
|
||||
}
|
||||
|
||||
/* getobj callback for object to tip */
|
||||
static int
|
||||
staticfn int
|
||||
tip_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj || obj->oclass == COIN_CLASS)
|
||||
@@ -3459,7 +3458,7 @@ tip_ok(struct obj *obj)
|
||||
returns ECMD_CANCEL if menu was canceled,
|
||||
ECMD_TIME if a container was picked,
|
||||
otherwise returns ECMD_OK. */
|
||||
static int
|
||||
staticfn int
|
||||
choose_tip_container_menu(void)
|
||||
{
|
||||
int n, i;
|
||||
@@ -3641,7 +3640,7 @@ enum tipping_check_values {
|
||||
TIPCHECK_EMPTY
|
||||
};
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
tipcontainer(struct obj *box) /* or bag */
|
||||
{
|
||||
coordxy ox = u.ux, oy = u.uy; /* #tip only works at hero's location */
|
||||
@@ -3797,11 +3796,11 @@ tipcontainer(struct obj *box) /* or bag */
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int count_target_containers(struct obj *, struct obj *);
|
||||
staticfn int count_target_containers(struct obj *, struct obj *);
|
||||
|
||||
/* returns number of containers in object chain; does not recurse into
|
||||
containers; skips bags of tricks when they're known */
|
||||
static int
|
||||
staticfn int
|
||||
count_target_containers(
|
||||
struct obj *olist, /* list of objects (invent) */
|
||||
struct obj *excludo) /* particular object to exclude if found in list */
|
||||
@@ -3823,7 +3822,7 @@ count_target_containers(
|
||||
/* ask user for a carried container into which they want box to be emptied;
|
||||
cancelled is TRUE if user cancelled the menu pick; hands aren't required
|
||||
when tipping to the floor but are when tipping into another container */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
tipcontainer_gettarget(
|
||||
struct obj *box,
|
||||
boolean *cancelled)
|
||||
@@ -3906,7 +3905,7 @@ tipcontainer_gettarget(
|
||||
/* Perform check on box if we can tip it.
|
||||
Returns one of TIPCHECK_foo values.
|
||||
If allowempty if TRUE, return TIPCHECK_OK instead of TIPCHECK_EMPTY. */
|
||||
static int
|
||||
staticfn int
|
||||
tipcontainer_checks(
|
||||
struct obj *box, /* container player wants to tip */
|
||||
struct obj *targetbox, /* destination (used here for horn of plenty) */
|
||||
|
||||
+12
-12
@@ -9,10 +9,10 @@
|
||||
* config file parsing) with modest decoration;
|
||||
* result will then be truncated to BUFSZ-1 */
|
||||
|
||||
static void putmesg(const char *);
|
||||
static char *You_buf(int);
|
||||
staticfn void putmesg(const char *);
|
||||
staticfn char *You_buf(int);
|
||||
#if defined(MSGHANDLER)
|
||||
static void execplinehandler(const char *);
|
||||
staticfn void execplinehandler(const char *);
|
||||
#endif
|
||||
#ifdef USER_SOUNDS
|
||||
extern void maybe_play_sound(const char *);
|
||||
@@ -63,7 +63,7 @@ dumplogfreemessages(void)
|
||||
#endif
|
||||
|
||||
/* keeps windowprocs usage out of pline() */
|
||||
static void
|
||||
staticfn void
|
||||
putmesg(const char *line)
|
||||
{
|
||||
int attr = ATR_NONE;
|
||||
@@ -78,7 +78,7 @@ putmesg(const char *line)
|
||||
SoundSpeak(line);
|
||||
}
|
||||
|
||||
static void vpline(const char *, va_list);
|
||||
staticfn void vpline(const char *, va_list);
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
@@ -133,7 +133,7 @@ set_msg_xy(coordxy x, coordxy y)
|
||||
a11y.msg_loc.y = y;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
vpline(const char *line, va_list the_args)
|
||||
{
|
||||
static int in_pline = 0;
|
||||
@@ -312,7 +312,7 @@ Norep(const char *line, ...)
|
||||
va_end(the_args);
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
You_buf(int siz)
|
||||
{
|
||||
if (siz > gy.you_buf_siz) {
|
||||
@@ -520,7 +520,7 @@ livelog_printf(
|
||||
|
||||
#endif /* !CHRONICLE */
|
||||
|
||||
static void vraw_printf(const char *, va_list);
|
||||
staticfn void vraw_printf(const char *, va_list);
|
||||
|
||||
void
|
||||
raw_printf(const char *line, ...)
|
||||
@@ -536,7 +536,7 @@ raw_printf(const char *line, ...)
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
vraw_printf(const char *line, va_list the_args)
|
||||
{
|
||||
char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
|
||||
@@ -609,7 +609,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
#if defined(MSGHANDLER)
|
||||
static boolean use_pline_handler = TRUE;
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
execplinehandler(const char *line)
|
||||
{
|
||||
#if defined(POSIX_TYPES) || defined(__GNUC__)
|
||||
@@ -664,7 +664,7 @@ execplinehandler(const char *line)
|
||||
/*
|
||||
* varargs handling for files.c
|
||||
*/
|
||||
static void vconfig_error_add(const char *, va_list);
|
||||
staticfn void vconfig_error_add(const char *, va_list);
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
@@ -678,7 +678,7 @@ config_error_add(const char *str, ...)
|
||||
va_end(the_args);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
vconfig_error_add(const char *str, va_list the_args)
|
||||
{ /* start of vconf...() or of nested block in USE_OLDARG's conf...() */
|
||||
int vlen = 0;
|
||||
|
||||
+16
-16
@@ -21,14 +21,14 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static void check_strangling(boolean);
|
||||
static void polyman(const char *, const char *);
|
||||
static void dropp(struct obj *);
|
||||
static void break_armor(void);
|
||||
static void drop_weapon(int);
|
||||
static int armor_to_dragon(int);
|
||||
static void newman(void);
|
||||
static void polysense(void);
|
||||
staticfn void check_strangling(boolean);
|
||||
staticfn void polyman(const char *, const char *);
|
||||
staticfn void dropp(struct obj *);
|
||||
staticfn void break_armor(void);
|
||||
staticfn void drop_weapon(int);
|
||||
staticfn int armor_to_dragon(int);
|
||||
staticfn void newman(void);
|
||||
staticfn void polysense(void);
|
||||
|
||||
static const char no_longer_petrify_resistant[] =
|
||||
"No longer petrify-resistant, you";
|
||||
@@ -157,7 +157,7 @@ steed_vs_stealth(void)
|
||||
}
|
||||
|
||||
/* for changing into form that's immune to strangulation */
|
||||
static void
|
||||
staticfn void
|
||||
check_strangling(boolean on)
|
||||
{
|
||||
/* on -- maybe resume strangling */
|
||||
@@ -189,7 +189,7 @@ check_strangling(boolean on)
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* make a (new) human out of the player */
|
||||
static void
|
||||
staticfn void
|
||||
polyman(const char *fmt, const char *arg)
|
||||
{
|
||||
boolean sticking = (sticks(gy.youmonst.data) && u.ustuck && !u.uswallow),
|
||||
@@ -321,7 +321,7 @@ livelog_newform(boolean viapoly, int oldgend, int newgend)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
newman(void)
|
||||
{
|
||||
const char *newform;
|
||||
@@ -1108,7 +1108,7 @@ uasmon_maxStr(void)
|
||||
}
|
||||
|
||||
/* dropx() jacket for break_armor() */
|
||||
static void
|
||||
staticfn void
|
||||
dropp(struct obj *obj)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1133,7 +1133,7 @@ dropp(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
break_armor(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1276,7 +1276,7 @@ break_armor(void)
|
||||
/* rings stay worn even when no hands */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
drop_weapon(int alone)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -2160,7 +2160,7 @@ ugolemeffects(int damtype, int dam)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
armor_to_dragon(int atyp)
|
||||
{
|
||||
switch (atyp) {
|
||||
@@ -2205,7 +2205,7 @@ armor_to_dragon(int atyp)
|
||||
}
|
||||
|
||||
/* some species have awareness of other species */
|
||||
static void
|
||||
staticfn void
|
||||
polysense(void)
|
||||
{
|
||||
short warnidx = NON_PM;
|
||||
|
||||
+72
-72
@@ -5,43 +5,43 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static long itimeout(long);
|
||||
static long itimeout_incr(long, int);
|
||||
static void ghost_from_bottle(void);
|
||||
static int drink_ok(struct obj *);
|
||||
static void peffect_restore_ability(struct obj *);
|
||||
static void peffect_hallucination(struct obj *);
|
||||
static void peffect_water(struct obj *);
|
||||
static void peffect_booze(struct obj *);
|
||||
static void peffect_enlightenment(struct obj *);
|
||||
static void peffect_invisibility(struct obj *);
|
||||
static void peffect_see_invisible(struct obj *);
|
||||
static void peffect_paralysis(struct obj *);
|
||||
static void peffect_sleeping(struct obj *);
|
||||
static int peffect_monster_detection(struct obj *);
|
||||
static int peffect_object_detection(struct obj *);
|
||||
static void peffect_sickness(struct obj *);
|
||||
static void peffect_confusion(struct obj *);
|
||||
static void peffect_gain_ability(struct obj *);
|
||||
static void peffect_speed(struct obj *);
|
||||
static void peffect_blindness(struct obj *);
|
||||
static void peffect_gain_level(struct obj *);
|
||||
static void peffect_healing(struct obj *);
|
||||
static void peffect_extra_healing(struct obj *);
|
||||
static void peffect_full_healing(struct obj *);
|
||||
static void peffect_levitation(struct obj *);
|
||||
static void peffect_gain_energy(struct obj *);
|
||||
static void peffect_oil(struct obj *);
|
||||
static void peffect_acid(struct obj *);
|
||||
static void peffect_polymorph(struct obj *);
|
||||
static boolean H2Opotion_dip(struct obj *, struct obj *, boolean,
|
||||
staticfn long itimeout(long);
|
||||
staticfn long itimeout_incr(long, int);
|
||||
staticfn void ghost_from_bottle(void);
|
||||
staticfn int drink_ok(struct obj *);
|
||||
staticfn void peffect_restore_ability(struct obj *);
|
||||
staticfn void peffect_hallucination(struct obj *);
|
||||
staticfn void peffect_water(struct obj *);
|
||||
staticfn void peffect_booze(struct obj *);
|
||||
staticfn void peffect_enlightenment(struct obj *);
|
||||
staticfn void peffect_invisibility(struct obj *);
|
||||
staticfn void peffect_see_invisible(struct obj *);
|
||||
staticfn void peffect_paralysis(struct obj *);
|
||||
staticfn void peffect_sleeping(struct obj *);
|
||||
staticfn int peffect_monster_detection(struct obj *);
|
||||
staticfn int peffect_object_detection(struct obj *);
|
||||
staticfn void peffect_sickness(struct obj *);
|
||||
staticfn void peffect_confusion(struct obj *);
|
||||
staticfn void peffect_gain_ability(struct obj *);
|
||||
staticfn void peffect_speed(struct obj *);
|
||||
staticfn void peffect_blindness(struct obj *);
|
||||
staticfn void peffect_gain_level(struct obj *);
|
||||
staticfn void peffect_healing(struct obj *);
|
||||
staticfn void peffect_extra_healing(struct obj *);
|
||||
staticfn void peffect_full_healing(struct obj *);
|
||||
staticfn void peffect_levitation(struct obj *);
|
||||
staticfn void peffect_gain_energy(struct obj *);
|
||||
staticfn void peffect_oil(struct obj *);
|
||||
staticfn void peffect_acid(struct obj *);
|
||||
staticfn void peffect_polymorph(struct obj *);
|
||||
staticfn boolean H2Opotion_dip(struct obj *, struct obj *, boolean,
|
||||
const char *);
|
||||
static short mixtype(struct obj *, struct obj *);
|
||||
static int dip_ok(struct obj *);
|
||||
static int dip_hands_ok(struct obj *);
|
||||
static void hold_potion(struct obj *, const char *, const char *,
|
||||
staticfn short mixtype(struct obj *, struct obj *);
|
||||
staticfn int dip_ok(struct obj *);
|
||||
staticfn int dip_hands_ok(struct obj *);
|
||||
staticfn void hold_potion(struct obj *, const char *, const char *,
|
||||
const char *);
|
||||
static int potion_dip(struct obj *obj, struct obj *potion);
|
||||
staticfn int potion_dip(struct obj *obj, struct obj *potion);
|
||||
|
||||
/* used to indicate whether quaff or dip has skipped an opportunity to
|
||||
use a fountain or such, in order to vary the feedback if hero lacks
|
||||
@@ -50,7 +50,7 @@ static int potion_dip(struct obj *obj, struct obj *potion);
|
||||
static int drink_ok_extra = 0;
|
||||
|
||||
/* force `val' to be within valid range for intrinsic timeout value */
|
||||
static long
|
||||
staticfn long
|
||||
itimeout(long val)
|
||||
{
|
||||
if (val >= TIMEOUT)
|
||||
@@ -62,7 +62,7 @@ itimeout(long val)
|
||||
}
|
||||
|
||||
/* increment `old' by `incr' and force result to be valid intrinsic timeout */
|
||||
static long
|
||||
staticfn long
|
||||
itimeout_incr(long old, int incr)
|
||||
{
|
||||
return itimeout((old & TIMEOUT) + (long) incr);
|
||||
@@ -475,7 +475,7 @@ self_invis_message(void)
|
||||
: "can't see yourself");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
ghost_from_bottle(void)
|
||||
{
|
||||
struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, MM_NOMSG);
|
||||
@@ -499,7 +499,7 @@ ghost_from_bottle(void)
|
||||
|
||||
/* getobj callback for object to drink from, which also does double duty as
|
||||
the callback for dipping into (both just allow potions). */
|
||||
static int
|
||||
staticfn int
|
||||
drink_ok(struct obj *obj)
|
||||
{
|
||||
/* getobj()'s callback to test whether hands/self is a valid "item" to
|
||||
@@ -630,7 +630,7 @@ dopotion(struct obj *otmp)
|
||||
|
||||
/* potion or spell of restore ability; for spell, otmp is a temporary
|
||||
spellbook object that will be blessed if hero is skilled in healing */
|
||||
static void
|
||||
staticfn void
|
||||
peffect_restore_ability(struct obj *otmp)
|
||||
{
|
||||
gp.potion_unkn++;
|
||||
@@ -677,7 +677,7 @@ peffect_restore_ability(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_hallucination(struct obj *otmp)
|
||||
{
|
||||
if (Halluc_resistance) {
|
||||
@@ -698,7 +698,7 @@ peffect_hallucination(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_water(struct obj *otmp)
|
||||
{
|
||||
if (!otmp->blessed && !otmp->cursed) {
|
||||
@@ -752,7 +752,7 @@ peffect_water(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_booze(struct obj *otmp)
|
||||
{
|
||||
gp.potion_unkn++;
|
||||
@@ -776,7 +776,7 @@ peffect_booze(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_enlightenment(struct obj *otmp)
|
||||
{
|
||||
if (otmp->cursed) {
|
||||
@@ -792,7 +792,7 @@ peffect_enlightenment(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_invisibility(struct obj *otmp)
|
||||
{
|
||||
boolean is_spell = (otmp->oclass == SPBOOK_CLASS);
|
||||
@@ -818,7 +818,7 @@ peffect_invisibility(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_see_invisible(struct obj *otmp)
|
||||
{
|
||||
int msg = Invisible && !Blind;
|
||||
@@ -857,7 +857,7 @@ peffect_see_invisible(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_paralysis(struct obj *otmp)
|
||||
{
|
||||
if (Free_action) {
|
||||
@@ -877,7 +877,7 @@ peffect_paralysis(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_sleeping(struct obj *otmp)
|
||||
{
|
||||
if (Sleep_resistance || Free_action) {
|
||||
@@ -890,7 +890,7 @@ peffect_sleeping(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
peffect_monster_detection(struct obj *otmp)
|
||||
{
|
||||
if (otmp->blessed) {
|
||||
@@ -931,7 +931,7 @@ peffect_monster_detection(struct obj *otmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
peffect_object_detection(struct obj *otmp)
|
||||
{
|
||||
if (object_detect(otmp, 0))
|
||||
@@ -940,7 +940,7 @@ peffect_object_detection(struct obj *otmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_sickness(struct obj *otmp)
|
||||
{
|
||||
pline("Yecch! This stuff tastes like poison.");
|
||||
@@ -990,7 +990,7 @@ peffect_sickness(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_confusion(struct obj *otmp)
|
||||
{
|
||||
if (!Confusion) {
|
||||
@@ -1006,7 +1006,7 @@ peffect_confusion(struct obj *otmp)
|
||||
FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_gain_ability(struct obj *otmp)
|
||||
{
|
||||
if (otmp->cursed) {
|
||||
@@ -1028,7 +1028,7 @@ peffect_gain_ability(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_speed(struct obj *otmp)
|
||||
{
|
||||
boolean is_speed = (otmp->otyp == POT_SPEED);
|
||||
@@ -1049,7 +1049,7 @@ peffect_speed(struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_blindness(struct obj *otmp)
|
||||
{
|
||||
if (Blind || ((HBlinded || EBlinded) && BBlinded))
|
||||
@@ -1059,7 +1059,7 @@ peffect_blindness(struct obj *otmp)
|
||||
(boolean) !Blind);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_gain_level(struct obj *otmp)
|
||||
{
|
||||
if (otmp->cursed) {
|
||||
@@ -1095,7 +1095,7 @@ peffect_gain_level(struct obj *otmp)
|
||||
u.uexp = rndexp(TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_healing(struct obj *otmp)
|
||||
{
|
||||
You_feel("better.");
|
||||
@@ -1104,7 +1104,7 @@ peffect_healing(struct obj *otmp)
|
||||
exercise(A_CON, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_extra_healing(struct obj *otmp)
|
||||
{
|
||||
You_feel("much better.");
|
||||
@@ -1120,7 +1120,7 @@ peffect_extra_healing(struct obj *otmp)
|
||||
heal_legs(0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_full_healing(struct obj *otmp)
|
||||
{
|
||||
You_feel("completely healed.");
|
||||
@@ -1141,7 +1141,7 @@ peffect_full_healing(struct obj *otmp)
|
||||
heal_legs(0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_levitation(struct obj *otmp)
|
||||
{
|
||||
/*
|
||||
@@ -1200,7 +1200,7 @@ peffect_levitation(struct obj *otmp)
|
||||
float_vs_flight();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_gain_energy(struct obj *otmp)
|
||||
{
|
||||
int num;
|
||||
@@ -1236,7 +1236,7 @@ peffect_gain_energy(struct obj *otmp)
|
||||
exercise(A_WIS, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_oil(struct obj *otmp)
|
||||
{
|
||||
boolean good_for_you = FALSE, vulnerable;
|
||||
@@ -1273,7 +1273,7 @@ peffect_oil(struct obj *otmp)
|
||||
exercise(A_WIS, good_for_you);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_acid(struct obj *otmp)
|
||||
{
|
||||
if (Acid_resistance) {
|
||||
@@ -1294,7 +1294,7 @@ peffect_acid(struct obj *otmp)
|
||||
gp.potion_unkn++; /* holy/unholy water can burn like acid too */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
peffect_polymorph(struct obj *otmp)
|
||||
{
|
||||
You_feel("a little %s.", Hallucination ? "normal" : "strange");
|
||||
@@ -1455,9 +1455,9 @@ strange_feeling(struct obj *obj, const char *txt)
|
||||
useup(obj);
|
||||
}
|
||||
|
||||
const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
|
||||
static const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
|
||||
"flask", "jar", "vial" };
|
||||
const char *hbottlenames[] = {
|
||||
static const char *hbottlenames[] = {
|
||||
"jug", "pitcher", "barrel", "tin", "bag", "box", "glass", "beaker",
|
||||
"tumbler", "vase", "flowerpot", "pan", "thingy", "mug", "teacup",
|
||||
"teapot", "keg", "bucket", "thermos", "amphora", "wineskin", "parcel",
|
||||
@@ -1474,7 +1474,7 @@ bottlename(void)
|
||||
}
|
||||
|
||||
/* handle item dipped into water potion or steed saddle splashed by same */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
H2Opotion_dip(
|
||||
struct obj *potion, /* water */
|
||||
struct obj *targobj, /* item being dipped into the water */
|
||||
@@ -2085,7 +2085,7 @@ potionbreathe(struct obj *obj)
|
||||
}
|
||||
|
||||
/* returns the potion type when o1 is dipped in o2 */
|
||||
static short
|
||||
staticfn short
|
||||
mixtype(struct obj *o1, struct obj *o2)
|
||||
{
|
||||
int o1typ = o1->otyp, o2typ = o2->otyp;
|
||||
@@ -2175,7 +2175,7 @@ mixtype(struct obj *o1, struct obj *o2)
|
||||
|
||||
/* getobj callback for object to be dipped (not the thing being dipped into,
|
||||
* that uses drink_ok) */
|
||||
static int
|
||||
staticfn int
|
||||
dip_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -2192,7 +2192,7 @@ dip_ok(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for object to be dipped when hero has slippery hands */
|
||||
static int
|
||||
staticfn int
|
||||
dip_hands_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj && (Glib && can_reach_floor(FALSE)))
|
||||
@@ -2204,7 +2204,7 @@ dip_hands_ok(struct obj *obj)
|
||||
/* call hold_another_object() to deal with a transformed potion; its weight
|
||||
won't have changed but it might require an extra slot that isn't available
|
||||
or it might merge into some other carried stack */
|
||||
static void
|
||||
staticfn void
|
||||
hold_potion(
|
||||
struct obj *potobj,
|
||||
const char *drop_fmt, const char *drop_arg,
|
||||
@@ -2370,7 +2370,7 @@ dip_into(void)
|
||||
}
|
||||
|
||||
/* called by dodip() or dip_into() after obj and potion have been chosen */
|
||||
static int
|
||||
staticfn int
|
||||
potion_dip(struct obj *obj, struct obj *potion)
|
||||
{
|
||||
struct obj *singlepotion;
|
||||
|
||||
+52
-52
@@ -4,32 +4,32 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
static int prayer_done(void);
|
||||
static void maybe_turn_mon_iter(struct monst *);
|
||||
static struct obj *worst_cursed_item(void);
|
||||
static int in_trouble(void);
|
||||
static void fix_curse_trouble(struct obj *, const char *);
|
||||
static void fix_worst_trouble(int);
|
||||
static void angrygods(aligntyp);
|
||||
static void at_your_feet(const char *);
|
||||
static void gcrownu(void);
|
||||
static void give_spell(void);
|
||||
static void pleased(aligntyp);
|
||||
static void godvoice(aligntyp, const char *);
|
||||
static void god_zaps_you(aligntyp);
|
||||
static void fry_by_god(aligntyp, boolean);
|
||||
static void gods_angry(aligntyp);
|
||||
static void gods_upset(aligntyp);
|
||||
static void consume_offering(struct obj *);
|
||||
static void offer_too_soon(aligntyp);
|
||||
static void offer_real_amulet(struct obj *, aligntyp); /* NORETURN */
|
||||
static void offer_fake_amulet(struct obj *, boolean, aligntyp);
|
||||
static void offer_different_alignment_altar(struct obj *, aligntyp);
|
||||
static void sacrifice_your_race(struct obj *, boolean, aligntyp);
|
||||
static int bestow_artifact(void);
|
||||
static boolean pray_revive(void);
|
||||
static boolean water_prayer(boolean);
|
||||
static boolean blocked_boulder(int, int);
|
||||
staticfn int prayer_done(void);
|
||||
staticfn void maybe_turn_mon_iter(struct monst *);
|
||||
staticfn struct obj *worst_cursed_item(void);
|
||||
staticfn int in_trouble(void);
|
||||
staticfn void fix_curse_trouble(struct obj *, const char *);
|
||||
staticfn void fix_worst_trouble(int);
|
||||
staticfn void angrygods(aligntyp);
|
||||
staticfn void at_your_feet(const char *);
|
||||
staticfn void gcrownu(void);
|
||||
staticfn void give_spell(void);
|
||||
staticfn void pleased(aligntyp);
|
||||
staticfn void godvoice(aligntyp, const char *);
|
||||
staticfn void god_zaps_you(aligntyp);
|
||||
staticfn void fry_by_god(aligntyp, boolean);
|
||||
staticfn void gods_angry(aligntyp);
|
||||
staticfn void gods_upset(aligntyp);
|
||||
staticfn void consume_offering(struct obj *);
|
||||
staticfn void offer_too_soon(aligntyp);
|
||||
staticfn void offer_real_amulet(struct obj *, aligntyp); /* NORETURN */
|
||||
staticfn void offer_fake_amulet(struct obj *, boolean, aligntyp);
|
||||
staticfn void offer_different_alignment_altar(struct obj *, aligntyp);
|
||||
staticfn void sacrifice_your_race(struct obj *, boolean, aligntyp);
|
||||
staticfn int bestow_artifact(void);
|
||||
staticfn boolean pray_revive(void);
|
||||
staticfn boolean water_prayer(boolean);
|
||||
staticfn boolean blocked_boulder(int, int);
|
||||
|
||||
/* simplify a few tests */
|
||||
#define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
|
||||
@@ -190,7 +190,7 @@ stuck_in_wall(void)
|
||||
* 3.4.2: make an exception if polymorphed into a form which lacks
|
||||
* hands; that's a case where the ramifications override this doubt.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
in_trouble(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -280,7 +280,7 @@ in_trouble(void)
|
||||
}
|
||||
|
||||
/* select an item for TROUBLE_CURSED_ITEMS */
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
worst_cursed_item(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -341,7 +341,7 @@ worst_cursed_item(void)
|
||||
return otmp;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
fix_curse_trouble(struct obj *otmp, const char *what)
|
||||
{
|
||||
if (!otmp) {
|
||||
@@ -365,7 +365,7 @@ fix_curse_trouble(struct obj *otmp, const char *what)
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
fix_worst_trouble(int trouble)
|
||||
{
|
||||
int i;
|
||||
@@ -601,7 +601,7 @@ fix_worst_trouble(int trouble)
|
||||
* bathroom walls, but who is foiled by bathrobes." --Bertrand Russell, 1943
|
||||
* Divine wrath, dungeon walls, and armor follow the same principle.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
god_zaps_you(aligntyp resp_god)
|
||||
{
|
||||
if (u.uswallow) {
|
||||
@@ -685,7 +685,7 @@ god_zaps_you(aligntyp resp_god)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
fry_by_god(aligntyp resp_god, boolean via_disintegration)
|
||||
{
|
||||
You("%s!", !via_disintegration ? "fry to a crisp"
|
||||
@@ -695,7 +695,7 @@ fry_by_god(aligntyp resp_god, boolean via_disintegration)
|
||||
done(DIED);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
angrygods(aligntyp resp_god)
|
||||
{
|
||||
int maxanger, new_ublesscnt;
|
||||
@@ -776,7 +776,7 @@ angrygods(aligntyp resp_god)
|
||||
}
|
||||
|
||||
/* helper to print "str appears at your feet", or appropriate */
|
||||
static void
|
||||
staticfn void
|
||||
at_your_feet(const char *str)
|
||||
{
|
||||
if (Blind)
|
||||
@@ -793,7 +793,7 @@ at_your_feet(const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gcrownu(void)
|
||||
{
|
||||
struct obj *obj;
|
||||
@@ -986,7 +986,7 @@ gcrownu(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
give_spell(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1057,7 +1057,7 @@ give_spell(void)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
pleased(aligntyp g_align)
|
||||
{
|
||||
/* don't use p_trouble, worst trouble may get fixed while praying */
|
||||
@@ -1365,7 +1365,7 @@ pleased(aligntyp g_align)
|
||||
/* either blesses or curses water on the altar,
|
||||
* returns true if it found any water here.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
water_prayer(boolean bless_water)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -1393,7 +1393,7 @@ water_prayer(boolean bless_water)
|
||||
return (boolean) (changed > 0L);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
godvoice(aligntyp g_align, const char *words)
|
||||
{
|
||||
const char *quot = "";
|
||||
@@ -1407,14 +1407,14 @@ godvoice(aligntyp g_align, const char *words)
|
||||
ROLL_FROM(godvoices), quot, words, quot);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
gods_angry(aligntyp g_align)
|
||||
{
|
||||
godvoice(g_align, "Thou hast angered me.");
|
||||
}
|
||||
|
||||
/* The g_align god is upset with you. */
|
||||
static void
|
||||
staticfn void
|
||||
gods_upset(aligntyp g_align)
|
||||
{
|
||||
if (g_align == u.ualign.type)
|
||||
@@ -1424,7 +1424,7 @@ gods_upset(aligntyp g_align)
|
||||
angrygods(g_align);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
consume_offering(struct obj *otmp)
|
||||
{
|
||||
if (Hallucination)
|
||||
@@ -1458,7 +1458,7 @@ consume_offering(struct obj *otmp)
|
||||
|
||||
/* feedback when attempting to offer the Amulet on a "low altar" (not one of
|
||||
the high altars in the temples on the Astral Plane or Moloch's Sanctum) */
|
||||
static void
|
||||
staticfn void
|
||||
offer_too_soon(aligntyp altaralign)
|
||||
{
|
||||
if (altaralign == A_NONE && Inhell) {
|
||||
@@ -1507,7 +1507,7 @@ desecrate_altar(boolean highaltar, aligntyp altaralign)
|
||||
/* offering the Amulet on a high altar (checked by caller) ends the game;
|
||||
we don't declare this 'NORETURN' because done() can return (if called
|
||||
with some reasons other than ASCENDED and ESCAPED) */
|
||||
static void
|
||||
staticfn void
|
||||
offer_real_amulet(struct obj *otmp, aligntyp altaralign)
|
||||
{
|
||||
static NEARDATA const char
|
||||
@@ -1570,7 +1570,7 @@ offer_real_amulet(struct obj *otmp, aligntyp altaralign)
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
offer_fake_amulet(
|
||||
struct obj *otmp,
|
||||
boolean highaltar,
|
||||
@@ -1604,7 +1604,7 @@ offer_fake_amulet(
|
||||
}
|
||||
|
||||
/* possibly convert an altar's alignment or the hero's alignment */
|
||||
static void
|
||||
staticfn void
|
||||
offer_different_alignment_altar(
|
||||
struct obj *otmp,
|
||||
aligntyp altaralign)
|
||||
@@ -1671,7 +1671,7 @@ offer_different_alignment_altar(
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
sacrifice_your_race(
|
||||
struct obj *otmp,
|
||||
boolean highaltar,
|
||||
@@ -1754,7 +1754,7 @@ sacrifice_your_race(
|
||||
useupf(otmp, 1L);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
bestow_artifact(void)
|
||||
{
|
||||
int nartifacts = nartifact_exist();
|
||||
@@ -2090,7 +2090,7 @@ can_pray(boolean praying) /* false means no messages should be given */
|
||||
}
|
||||
|
||||
/* return TRUE if praying revived a pet corpse */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
pray_revive(void)
|
||||
{
|
||||
struct obj *otmp;
|
||||
@@ -2183,7 +2183,7 @@ dopray(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
prayer_done(void) /* M. Stephenson (1.0.3b) */
|
||||
{
|
||||
aligntyp alignment = gp.p_aligntyp;
|
||||
@@ -2254,7 +2254,7 @@ prayer_done(void) /* M. Stephenson (1.0.3b) */
|
||||
}
|
||||
|
||||
/* iterable for undead turning by priest/knight */
|
||||
static void
|
||||
staticfn void
|
||||
maybe_turn_mon_iter(struct monst *mtmp)
|
||||
{
|
||||
/* 3.6.3: used to use cansee() here but the purpose is to prevent
|
||||
@@ -2578,7 +2578,7 @@ altar_wrath(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* assumes isok() at one space away, but not necessarily at two */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
blocked_boulder(int dx, int dy)
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
+4
-4
@@ -9,8 +9,8 @@
|
||||
#define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
|
||||
#define ALGN_PIOUS 14 /* better than fervent (9..13) */
|
||||
|
||||
static boolean histemple_at(struct monst *, coordxy, coordxy);
|
||||
static boolean has_shrine(struct monst *);
|
||||
staticfn boolean histemple_at(struct monst *, coordxy, coordxy);
|
||||
staticfn boolean has_shrine(struct monst *);
|
||||
|
||||
void
|
||||
newepri(struct monst *mtmp)
|
||||
@@ -148,7 +148,7 @@ temple_occupied(char *array)
|
||||
return '\0';
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
histemple_at(struct monst *priest, coordxy x, coordxy y)
|
||||
{
|
||||
return (boolean) (priest && priest->ispriest
|
||||
@@ -377,7 +377,7 @@ p_coaligned(struct monst *priest)
|
||||
return (boolean) (u.ualign.type == mon_aligntyp(priest));
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
has_shrine(struct monst *pri)
|
||||
{
|
||||
struct rm *lev;
|
||||
|
||||
+20
-20
@@ -11,18 +11,18 @@
|
||||
#define Not_firsttime (on_level(&u.uz0, &u.uz))
|
||||
#define Qstat(x) (gq.quest_status.x)
|
||||
|
||||
static void on_start(void);
|
||||
static void on_locate(void);
|
||||
static void on_goal(void);
|
||||
static boolean not_capable(void);
|
||||
static int is_pure(boolean);
|
||||
static void expulsion(boolean);
|
||||
static void chat_with_leader(struct monst *);
|
||||
static void chat_with_nemesis(void);
|
||||
static void chat_with_guardian(void);
|
||||
static void prisoner_speaks(struct monst *);
|
||||
staticfn void on_start(void);
|
||||
staticfn void on_locate(void);
|
||||
staticfn void on_goal(void);
|
||||
staticfn boolean not_capable(void);
|
||||
staticfn int is_pure(boolean);
|
||||
staticfn void expulsion(boolean);
|
||||
staticfn void chat_with_leader(struct monst *);
|
||||
staticfn void chat_with_nemesis(void);
|
||||
staticfn void chat_with_guardian(void);
|
||||
staticfn void prisoner_speaks(struct monst *);
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
on_start(void)
|
||||
{
|
||||
if (!Qstat(first_start)) {
|
||||
@@ -36,7 +36,7 @@ on_start(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
on_locate(void)
|
||||
{
|
||||
/* the locate messages are phrased in a manner such that they only
|
||||
@@ -58,7 +58,7 @@ on_locate(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
on_goal(void)
|
||||
{
|
||||
if (Qstat(killed_nemesis)) {
|
||||
@@ -143,13 +143,13 @@ ok_to_quest(void)
|
||||
&& is_pure(FALSE) > 0) || Qstat(killed_leader));
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
not_capable(void)
|
||||
{
|
||||
return (boolean) (u.ulevel < MIN_QUEST_LEVEL);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
is_pure(boolean talk)
|
||||
{
|
||||
int purity;
|
||||
@@ -182,7 +182,7 @@ is_pure(boolean talk)
|
||||
* This assumes that the hero is currently _in_ the quest dungeon and that
|
||||
* there is a single branch to and from it.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
expulsion(boolean seal)
|
||||
{
|
||||
branch *br;
|
||||
@@ -278,7 +278,7 @@ finish_quest(struct obj *obj) /* quest artifact or thrown unique item or faux
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
chat_with_leader(struct monst *mtmp)
|
||||
{
|
||||
if (!mtmp->mpeaceful || Qstat(pissed_off))
|
||||
@@ -376,7 +376,7 @@ leader_speaks(struct monst *mtmp)
|
||||
chat_with_leader(mtmp);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
chat_with_nemesis(void)
|
||||
{
|
||||
/* The nemesis will do most of the talking, but... */
|
||||
@@ -423,7 +423,7 @@ nemesis_stinks(coordxy mx, coordxy my)
|
||||
gc.context.mon_moving = save_mon_moving;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
chat_with_guardian(void)
|
||||
{
|
||||
/* These guys/gals really don't have much to say... */
|
||||
@@ -433,7 +433,7 @@ chat_with_guardian(void)
|
||||
qt_pager("guardtalk_before");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
prisoner_speaks(struct monst *mtmp)
|
||||
{
|
||||
if (mtmp->data == &mons[PM_PRISONER]
|
||||
|
||||
+24
-24
@@ -13,19 +13,19 @@
|
||||
#include "wintty.h"
|
||||
#endif
|
||||
|
||||
static const char *intermed(void);
|
||||
staticfn const char *intermed(void);
|
||||
/* sometimes find_qarti(gi.invent), and gi.invent can be null */
|
||||
static struct obj *find_qarti(struct obj *) NO_NNARGS;
|
||||
static const char *neminame(void);
|
||||
static const char *guardname(void);
|
||||
static const char *homebase(void);
|
||||
static void qtext_pronoun(char, char);
|
||||
static void convert_arg(char);
|
||||
static void convert_line(char *,char *);
|
||||
static void deliver_by_pline(const char *);
|
||||
static void deliver_by_window(const char *, int);
|
||||
static boolean skip_pager(boolean);
|
||||
static boolean com_pager_core(const char *, const char *, boolean, char **);
|
||||
staticfn struct obj *find_qarti(struct obj *) NO_NNARGS;
|
||||
staticfn const char *neminame(void);
|
||||
staticfn const char *guardname(void);
|
||||
staticfn const char *homebase(void);
|
||||
staticfn void qtext_pronoun(char, char);
|
||||
staticfn void convert_arg(char);
|
||||
staticfn void convert_line(char *,char *);
|
||||
staticfn void deliver_by_pline(const char *);
|
||||
staticfn void deliver_by_window(const char *, int);
|
||||
staticfn boolean skip_pager(boolean);
|
||||
staticfn boolean com_pager_core(const char *, const char *, boolean, char **);
|
||||
|
||||
short
|
||||
quest_info(int typ)
|
||||
@@ -57,7 +57,7 @@ ldrname(void)
|
||||
}
|
||||
|
||||
/* return your intermediate target string */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
intermed(void)
|
||||
{
|
||||
return gu.urole.intermed;
|
||||
@@ -69,7 +69,7 @@ is_quest_artifact(struct obj *otmp)
|
||||
return (boolean) (otmp->oartifact == gu.urole.questarti);
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
find_qarti(struct obj *ochain)
|
||||
{
|
||||
struct obj *otmp, *qarti;
|
||||
@@ -120,7 +120,7 @@ find_quest_artifact(unsigned whichchains)
|
||||
}
|
||||
|
||||
/* return your role nemesis' name */
|
||||
static const char *
|
||||
staticfn const char *
|
||||
neminame(void)
|
||||
{
|
||||
int i = gu.urole.neminum;
|
||||
@@ -130,7 +130,7 @@ neminame(void)
|
||||
return gn.nambuf;
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
guardname(void) /* return your role leader's guard monster name */
|
||||
{
|
||||
int i = gu.urole.guardnum;
|
||||
@@ -138,7 +138,7 @@ guardname(void) /* return your role leader's guard monster name */
|
||||
return mons[i].pmnames[NEUTRAL];
|
||||
}
|
||||
|
||||
static const char *
|
||||
staticfn const char *
|
||||
homebase(void) /* return your role leader's location */
|
||||
{
|
||||
return gu.urole.homebase;
|
||||
@@ -195,7 +195,7 @@ stinky_nemesis(struct monst *mon)
|
||||
|
||||
/* replace deity, leader, nemesis, or artifact name with pronoun;
|
||||
overwrites cvt_buf[] */
|
||||
static void
|
||||
staticfn void
|
||||
qtext_pronoun(
|
||||
char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => arti */
|
||||
char which) /* 'h'|'H'|'i'|'I'|'j'|'J' */
|
||||
@@ -232,7 +232,7 @@ qtext_pronoun(
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
convert_arg(char c)
|
||||
{
|
||||
const char *str;
|
||||
@@ -324,7 +324,7 @@ convert_arg(char c)
|
||||
Strcpy(gc.cvt_buf, str);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
convert_line(char *in_line, char *out_line)
|
||||
{
|
||||
char *c, *cc;
|
||||
@@ -416,7 +416,7 @@ convert_line(char *in_line, char *out_line)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
deliver_by_pline(const char *str)
|
||||
{
|
||||
char in_line[BUFSZ], out_line[BUFSZ];
|
||||
@@ -432,7 +432,7 @@ deliver_by_pline(const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
deliver_by_window(const char *msg, int how)
|
||||
{
|
||||
char in_line[BUFSZ], out_line[BUFSZ];
|
||||
@@ -452,7 +452,7 @@ deliver_by_window(const char *msg, int how)
|
||||
destroy_nhwindow(datawin);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
skip_pager(boolean common UNUSED)
|
||||
{
|
||||
/* WIZKIT: suppress plot feedback if starting with quest artifact */
|
||||
@@ -461,7 +461,7 @@ skip_pager(boolean common UNUSED)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
com_pager_core(
|
||||
const char *section,
|
||||
const char *msgid,
|
||||
|
||||
+80
-80
@@ -8,51 +8,51 @@
|
||||
#define Your_Own_Role(mndx) ((mndx) == gu.urole.mnum)
|
||||
#define Your_Own_Race(mndx) ((mndx) == gu.urace.mnum)
|
||||
|
||||
static boolean learnscrolltyp(short);
|
||||
static void cap_spe(struct obj *);
|
||||
static char *erode_obj_text(struct obj *, char *);
|
||||
static char *hawaiian_design(struct obj *, char *);
|
||||
static int read_ok(struct obj *);
|
||||
static void stripspe(struct obj *);
|
||||
static void p_glow1(struct obj *);
|
||||
static void p_glow2(struct obj *, const char *);
|
||||
static void forget(int);
|
||||
static int maybe_tame(struct monst *, struct obj *);
|
||||
static boolean can_center_cloud(coordxy, coordxy);
|
||||
static void display_stinking_cloud_positions(boolean);
|
||||
static void seffect_enchant_armor(struct obj **);
|
||||
static void seffect_destroy_armor(struct obj **);
|
||||
static void seffect_confuse_monster(struct obj **);
|
||||
static void seffect_scare_monster(struct obj **);
|
||||
static void seffect_remove_curse(struct obj **);
|
||||
static void seffect_create_monster(struct obj **);
|
||||
static void seffect_enchant_weapon(struct obj **);
|
||||
static void seffect_taming(struct obj **);
|
||||
static void seffect_genocide(struct obj **);
|
||||
static void seffect_light(struct obj **);
|
||||
static void seffect_charging(struct obj **);
|
||||
static void seffect_amnesia(struct obj **);
|
||||
static void seffect_fire(struct obj **);
|
||||
static void seffect_earth(struct obj **);
|
||||
static void seffect_punishment(struct obj **);
|
||||
static void seffect_stinking_cloud(struct obj **);
|
||||
static void seffect_blank_paper(struct obj **);
|
||||
static void seffect_teleportation(struct obj **);
|
||||
static void seffect_gold_detection(struct obj **);
|
||||
static void seffect_food_detection(struct obj **);
|
||||
static void seffect_identify(struct obj **);
|
||||
static void seffect_magic_mapping(struct obj **);
|
||||
staticfn boolean learnscrolltyp(short);
|
||||
staticfn void cap_spe(struct obj *);
|
||||
staticfn char *erode_obj_text(struct obj *, char *);
|
||||
staticfn char *hawaiian_design(struct obj *, char *);
|
||||
staticfn int read_ok(struct obj *);
|
||||
staticfn void stripspe(struct obj *);
|
||||
staticfn void p_glow1(struct obj *);
|
||||
staticfn void p_glow2(struct obj *, const char *);
|
||||
staticfn void forget(int);
|
||||
staticfn int maybe_tame(struct monst *, struct obj *);
|
||||
staticfn boolean can_center_cloud(coordxy, coordxy);
|
||||
staticfn void display_stinking_cloud_positions(boolean);
|
||||
staticfn void seffect_enchant_armor(struct obj **);
|
||||
staticfn void seffect_destroy_armor(struct obj **);
|
||||
staticfn void seffect_confuse_monster(struct obj **);
|
||||
staticfn void seffect_scare_monster(struct obj **);
|
||||
staticfn void seffect_remove_curse(struct obj **);
|
||||
staticfn void seffect_create_monster(struct obj **);
|
||||
staticfn void seffect_enchant_weapon(struct obj **);
|
||||
staticfn void seffect_taming(struct obj **);
|
||||
staticfn void seffect_genocide(struct obj **);
|
||||
staticfn void seffect_light(struct obj **);
|
||||
staticfn void seffect_charging(struct obj **);
|
||||
staticfn void seffect_amnesia(struct obj **);
|
||||
staticfn void seffect_fire(struct obj **);
|
||||
staticfn void seffect_earth(struct obj **);
|
||||
staticfn void seffect_punishment(struct obj **);
|
||||
staticfn void seffect_stinking_cloud(struct obj **);
|
||||
staticfn void seffect_blank_paper(struct obj **);
|
||||
staticfn void seffect_teleportation(struct obj **);
|
||||
staticfn void seffect_gold_detection(struct obj **);
|
||||
staticfn void seffect_food_detection(struct obj **);
|
||||
staticfn void seffect_identify(struct obj **);
|
||||
staticfn void seffect_magic_mapping(struct obj **);
|
||||
#ifdef MAIL_STRUCTURES
|
||||
static void seffect_mail(struct obj **);
|
||||
staticfn void seffect_mail(struct obj **);
|
||||
#endif /* MAIL_STRUCTURES */
|
||||
static void set_lit(coordxy, coordxy, genericptr);
|
||||
static void do_class_genocide(void);
|
||||
static void do_stinking_cloud(struct obj *, boolean);
|
||||
static boolean create_particular_parse(char *,
|
||||
staticfn void set_lit(coordxy, coordxy, genericptr);
|
||||
staticfn void do_class_genocide(void);
|
||||
staticfn void do_stinking_cloud(struct obj *, boolean);
|
||||
staticfn boolean create_particular_parse(char *,
|
||||
struct _create_particular_data *);
|
||||
static boolean create_particular_creation(struct _create_particular_data *);
|
||||
staticfn boolean create_particular_creation(struct _create_particular_data *);
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
learnscrolltyp(short scrolltyp)
|
||||
{
|
||||
if (!objects[scrolltyp].oc_name_known) {
|
||||
@@ -74,7 +74,7 @@ learnscroll(struct obj *sobj)
|
||||
}
|
||||
|
||||
/* max spe is +99, min is -99 */
|
||||
static void
|
||||
staticfn void
|
||||
cap_spe(struct obj *obj)
|
||||
{
|
||||
if (obj) {
|
||||
@@ -83,7 +83,7 @@ cap_spe(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
erode_obj_text(struct obj *otmp, char *buf)
|
||||
{
|
||||
int erosion = greatest_erosion(otmp);
|
||||
@@ -218,7 +218,7 @@ hawaiian_motif(struct obj *shirt, char *buf)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
hawaiian_design(struct obj *shirt, char *buf)
|
||||
{
|
||||
static const char *const hawaiian_bgs[] = {
|
||||
@@ -309,7 +309,7 @@ assign_candy_wrapper(struct obj *obj)
|
||||
}
|
||||
|
||||
/* getobj callback for object to read */
|
||||
static int
|
||||
staticfn int
|
||||
read_ok(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
@@ -644,7 +644,7 @@ doread(void)
|
||||
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
stripspe(struct obj *obj)
|
||||
{
|
||||
if (obj->blessed || obj->spe <= 0) {
|
||||
@@ -659,13 +659,13 @@ stripspe(struct obj *obj)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
p_glow1(struct obj *otmp)
|
||||
{
|
||||
pline("%s briefly.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
p_glow2(struct obj *otmp, const char *color)
|
||||
{
|
||||
pline("%s%s%s for a moment.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"),
|
||||
@@ -999,7 +999,7 @@ recharge(struct obj *obj, int curse_bless)
|
||||
* Other things are subject to flags:
|
||||
* howmuch & ALL_SPELLS = forget all spells
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
forget(int howmuch)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -1023,7 +1023,7 @@ forget(int howmuch)
|
||||
}
|
||||
|
||||
/* monster is hit by scroll of taming's effect */
|
||||
static int
|
||||
staticfn int
|
||||
maybe_tame(struct monst *mtmp, struct obj *sobj)
|
||||
{
|
||||
int was_tame = mtmp->mtame;
|
||||
@@ -1058,7 +1058,7 @@ valid_cloud_pos(coordxy x, coordxy y)
|
||||
/* Callback for getpos_sethilite, also used in determining whether a scroll
|
||||
* should have its regular effects, or not because it was out of range.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
can_center_cloud(coordxy x, coordxy y)
|
||||
{
|
||||
if (!valid_cloud_pos(x, y))
|
||||
@@ -1066,7 +1066,7 @@ can_center_cloud(coordxy x, coordxy y)
|
||||
return (cansee(x, y) && distu(x, y) < 32);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
display_stinking_cloud_positions(boolean on_off)
|
||||
{
|
||||
coordxy x, y, dx, dy;
|
||||
@@ -1093,7 +1093,7 @@ display_stinking_cloud_positions(boolean on_off)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_enchant_armor(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1243,7 +1243,7 @@ seffect_enchant_armor(struct obj **sobjp)
|
||||
Blind ? "again" : "unexpectedly");
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_destroy_armor(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1291,7 +1291,7 @@ seffect_destroy_armor(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_confuse_monster(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1346,7 +1346,7 @@ seffect_confuse_monster(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_scare_monster(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1381,7 +1381,7 @@ seffect_scare_monster(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_remove_curse(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp; /* scroll or fake spellbook */
|
||||
@@ -1500,7 +1500,7 @@ seffect_remove_curse(struct obj **sobjp)
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_create_monster(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1519,7 +1519,7 @@ seffect_create_monster(struct obj **sobjp)
|
||||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_enchant_weapon(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1569,7 +1569,7 @@ seffect_enchant_weapon(struct obj **sobjp)
|
||||
cap_spe(uwep);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_taming(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1612,7 +1612,7 @@ seffect_taming(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_genocide(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1631,7 +1631,7 @@ seffect_genocide(struct obj **sobjp)
|
||||
do_genocide((!scursed) | (2 * !!Confusion));
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_light(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1678,7 +1678,7 @@ seffect_light(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_charging(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1720,7 +1720,7 @@ seffect_charging(struct obj **sobjp)
|
||||
recharge(otmp, scursed ? -1 : sblessed ? 1 : 0);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_amnesia(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1740,7 +1740,7 @@ seffect_amnesia(struct obj **sobjp)
|
||||
exercise(A_WIS, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_fire(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1809,7 +1809,7 @@ seffect_fire(struct obj **sobjp)
|
||||
#undef ZT_SPELL_O_FIRE
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_earth(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1866,7 +1866,7 @@ seffect_earth(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_punishment(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1881,7 +1881,7 @@ seffect_punishment(struct obj **sobjp)
|
||||
punish(sobj);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_stinking_cloud(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1895,7 +1895,7 @@ seffect_stinking_cloud(struct obj **sobjp)
|
||||
do_stinking_cloud(sobj, already_known);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_blank_paper(struct obj **sobjp UNUSED)
|
||||
{
|
||||
if (Blind)
|
||||
@@ -1905,7 +1905,7 @@ seffect_blank_paper(struct obj **sobjp UNUSED)
|
||||
gk.known = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_teleportation(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1925,7 +1925,7 @@ seffect_teleportation(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_gold_detection(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1936,7 +1936,7 @@ seffect_gold_detection(struct obj **sobjp)
|
||||
*sobjp = 0; /* failure: strange_feeling() -> useup() */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_food_detection(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1945,7 +1945,7 @@ seffect_food_detection(struct obj **sobjp)
|
||||
*sobjp = 0; /* nothing detected: strange_feeling -> useup */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_identify(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -1992,7 +1992,7 @@ seffect_identify(struct obj **sobjp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
seffect_magic_mapping(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -2044,7 +2044,7 @@ seffect_magic_mapping(struct obj **sobjp)
|
||||
}
|
||||
|
||||
#ifdef MAIL_STRUCTURES
|
||||
static void
|
||||
staticfn void
|
||||
seffect_mail(struct obj **sobjp)
|
||||
{
|
||||
struct obj *sobj = *sobjp;
|
||||
@@ -2357,7 +2357,7 @@ static struct litmon *gremlins = 0;
|
||||
/*
|
||||
* Low-level lit-field update routine.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
set_lit(coordxy x, coordxy y, genericptr_t val)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
@@ -2513,7 +2513,7 @@ litroom(
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
do_class_genocide(void)
|
||||
{
|
||||
int i, j, immunecnt, gonecnt, goodcnt, class, feel_dead = 0;
|
||||
@@ -2950,7 +2950,7 @@ unpunish(void)
|
||||
|
||||
/* prompt the player to create a stinking cloud and then create it if they
|
||||
give a location */
|
||||
static void
|
||||
staticfn void
|
||||
do_stinking_cloud(struct obj *sobj, boolean mention_stinking)
|
||||
{
|
||||
coord cc;
|
||||
@@ -3005,7 +3005,7 @@ cant_revive(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
create_particular_parse(
|
||||
char *str,
|
||||
struct _create_particular_data *d)
|
||||
@@ -3120,7 +3120,7 @@ create_particular_parse(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
create_particular_creation(
|
||||
struct _create_particular_data *d)
|
||||
{
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
|
||||
int get_rect_ind(NhRect *);
|
||||
|
||||
static boolean intersect(NhRect *, NhRect *, NhRect *);
|
||||
staticfn boolean intersect(NhRect *, NhRect *, NhRect *);
|
||||
|
||||
/*
|
||||
* In this file, we will handle the various rectangle functions we
|
||||
@@ -111,7 +111,7 @@ rnd_rect(void)
|
||||
* otherwise returns FALSE
|
||||
*/
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
intersect(NhRect *r1, NhRect *r2, NhRect *r3)
|
||||
{
|
||||
if (r2->lx > r1->hx || r2->ly > r1->hy || r2->hx < r1->lx
|
||||
|
||||
+4
-4
@@ -37,8 +37,8 @@ boolean enter_force_field(genericptr,genericptr);
|
||||
NhRegion *create_force_field(coordxy,coordxy,int,long);
|
||||
#endif
|
||||
|
||||
static void reset_region_mids(NhRegion *);
|
||||
static boolean is_hero_inside_gas_cloud(void);
|
||||
staticfn void reset_region_mids(NhRegion *);
|
||||
staticfn boolean is_hero_inside_gas_cloud(void);
|
||||
|
||||
static const callback_proc callbacks[] = {
|
||||
#define INSIDE_GAS_CLOUD 0
|
||||
@@ -875,7 +875,7 @@ region_stats(
|
||||
RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* update monster IDs for region being loaded from bones; `ghostly' implied */
|
||||
static void
|
||||
staticfn void
|
||||
reset_region_mids(NhRegion *reg)
|
||||
{
|
||||
int i = 0, n = reg->n_monst;
|
||||
@@ -1109,7 +1109,7 @@ inside_gas_cloud(genericptr_t p1, genericptr_t p2)
|
||||
return FALSE; /* Monster is still alive */
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
is_hero_inside_gas_cloud(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 report.c $NHDT-Date: 1710949744 2024/03/20 15:49:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.7 $ */
|
||||
/* NetHack 3.7 report.c $NHDT-Date: 1710525914 2024/03/15 18:05:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.7 $ */
|
||||
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2024 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -219,7 +219,7 @@ crashreport_bidshow(void)
|
||||
mark = uend; \
|
||||
if (utmp >= urem) \
|
||||
goto full; \
|
||||
strncpy(uend, str, utmp); \
|
||||
memcpy(uend, str, utmp); \
|
||||
uend += utmp; urem -= utmp; \
|
||||
*uend = '\0';
|
||||
|
||||
|
||||
+45
-46
@@ -12,30 +12,30 @@ extern int dotrow; /* shared with save */
|
||||
#endif
|
||||
|
||||
#ifdef ZEROCOMP
|
||||
static void zerocomp_minit(void);
|
||||
static void zerocomp_mread(int, genericptr_t, unsigned int);
|
||||
static int zerocomp_mgetc(void);
|
||||
staticfn void zerocomp_minit(void);
|
||||
staticfn void zerocomp_mread(int, genericptr_t, unsigned int);
|
||||
staticfn int zerocomp_mgetc(void);
|
||||
#endif
|
||||
|
||||
static void find_lev_obj(void);
|
||||
static void restlevchn(NHFILE *);
|
||||
static void restdamage(NHFILE *);
|
||||
static void restobj(NHFILE *, struct obj *);
|
||||
static struct obj *restobjchn(NHFILE *, boolean);
|
||||
static void restmon(NHFILE *, struct monst *);
|
||||
static struct monst *restmonchn(NHFILE *);
|
||||
static struct fruit *loadfruitchn(NHFILE *);
|
||||
static void freefruitchn(struct fruit *);
|
||||
static void ghostfruit(struct obj *);
|
||||
static boolean restgamestate(NHFILE *);
|
||||
static void restlevelstate(void);
|
||||
static int restlevelfile(xint8);
|
||||
static void rest_bubbles(NHFILE *);
|
||||
static void restore_gamelog(NHFILE *);
|
||||
static void restore_msghistory(NHFILE *);
|
||||
static void reset_oattached_mids(boolean);
|
||||
static void rest_levl(NHFILE *, boolean);
|
||||
static void rest_stairs(NHFILE *);
|
||||
staticfn void find_lev_obj(void);
|
||||
staticfn void restlevchn(NHFILE *);
|
||||
staticfn void restdamage(NHFILE *);
|
||||
staticfn void restobj(NHFILE *, struct obj *);
|
||||
staticfn struct obj *restobjchn(NHFILE *, boolean);
|
||||
staticfn void restmon(NHFILE *, struct monst *);
|
||||
staticfn struct monst *restmonchn(NHFILE *);
|
||||
staticfn struct fruit *loadfruitchn(NHFILE *);
|
||||
staticfn void freefruitchn(struct fruit *);
|
||||
staticfn void ghostfruit(struct obj *);
|
||||
staticfn boolean restgamestate(NHFILE *);
|
||||
staticfn void restlevelstate(void);
|
||||
staticfn int restlevelfile(xint8);
|
||||
staticfn void rest_bubbles(NHFILE *);
|
||||
staticfn void restore_gamelog(NHFILE *);
|
||||
staticfn void restore_msghistory(NHFILE *);
|
||||
staticfn void reset_oattached_mids(boolean);
|
||||
staticfn void rest_levl(NHFILE *, boolean);
|
||||
staticfn void rest_stairs(NHFILE *);
|
||||
|
||||
/*
|
||||
* Save a mapping of IDs from ghost levels to the current level. This
|
||||
@@ -50,8 +50,8 @@ struct bucket {
|
||||
} map[N_PER_BUCKET];
|
||||
};
|
||||
|
||||
static void clear_id_mapping(void);
|
||||
static void add_id_mapping(unsigned, unsigned);
|
||||
staticfn void clear_id_mapping(void);
|
||||
staticfn void add_id_mapping(unsigned, unsigned);
|
||||
|
||||
#ifdef AMII_GRAPHICS
|
||||
void amii_setpens(int); /* use colors from save file */
|
||||
@@ -68,7 +68,7 @@ extern int amii_numcolors;
|
||||
#define Mread(fd,adr,siz) mread((fd), (genericptr_t) (adr), (unsigned) (siz))
|
||||
|
||||
/* Recalculate gl.level.objects[x][y], since this info was not saved. */
|
||||
static void
|
||||
staticfn void
|
||||
find_lev_obj(void)
|
||||
{
|
||||
struct obj *fobjtmp = (struct obj *) 0;
|
||||
@@ -125,7 +125,7 @@ inven_inuse(boolean quietly)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
restlevchn(NHFILE *nhfp)
|
||||
{
|
||||
int cnt = 0;
|
||||
@@ -151,7 +151,7 @@ restlevchn(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
restdamage(NHFILE *nhfp)
|
||||
{
|
||||
unsigned int dmgcount = 0;
|
||||
@@ -179,7 +179,7 @@ restdamage(NHFILE *nhfp)
|
||||
}
|
||||
|
||||
/* restore one object */
|
||||
static void
|
||||
staticfn void
|
||||
restobj(NHFILE *nhfp, struct obj *otmp)
|
||||
{
|
||||
int buflen = 0;
|
||||
@@ -234,7 +234,7 @@ restobj(NHFILE *nhfp, struct obj *otmp)
|
||||
}
|
||||
}
|
||||
|
||||
static struct obj *
|
||||
staticfn struct obj *
|
||||
restobjchn(NHFILE *nhfp, boolean frozen)
|
||||
{
|
||||
struct obj *otmp, *otmp2 = 0;
|
||||
@@ -303,7 +303,7 @@ restobjchn(NHFILE *nhfp, boolean frozen)
|
||||
}
|
||||
|
||||
/* restore one monster */
|
||||
static void
|
||||
staticfn void
|
||||
restmon(NHFILE *nhfp, struct monst *mtmp)
|
||||
{
|
||||
int buflen = 0;
|
||||
@@ -373,7 +373,7 @@ restmon(NHFILE *nhfp, struct monst *mtmp)
|
||||
} /* mextra */
|
||||
}
|
||||
|
||||
static struct monst *
|
||||
staticfn struct monst *
|
||||
restmonchn(NHFILE *nhfp)
|
||||
{
|
||||
struct monst *mtmp, *mtmp2 = 0;
|
||||
@@ -451,7 +451,7 @@ restmonchn(NHFILE *nhfp)
|
||||
return first;
|
||||
}
|
||||
|
||||
static struct fruit *
|
||||
staticfn struct fruit *
|
||||
loadfruitchn(NHFILE *nhfp)
|
||||
{
|
||||
struct fruit *flist, *fnext;
|
||||
@@ -471,7 +471,7 @@ loadfruitchn(NHFILE *nhfp)
|
||||
return flist;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
freefruitchn(struct fruit *flist)
|
||||
{
|
||||
struct fruit *fnext;
|
||||
@@ -483,7 +483,7 @@ freefruitchn(struct fruit *flist)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
ghostfruit(struct obj *otmp)
|
||||
{
|
||||
struct fruit *oldf;
|
||||
@@ -504,8 +504,7 @@ ghostfruit(struct obj *otmp)
|
||||
#define SYSOPT_CHECK_SAVE_UID TRUE
|
||||
#endif
|
||||
|
||||
static
|
||||
boolean
|
||||
staticfn boolean
|
||||
restgamestate(NHFILE *nhfp)
|
||||
{
|
||||
struct flag newgameflags;
|
||||
@@ -700,7 +699,7 @@ restgamestate(NHFILE *nhfp)
|
||||
|
||||
/* update game state pointers to those valid for the current level (so we
|
||||
don't dereference a wild u.ustuck when saving game state, for instance) */
|
||||
static void
|
||||
staticfn void
|
||||
restlevelstate(void)
|
||||
{
|
||||
/*
|
||||
@@ -711,7 +710,7 @@ restlevelstate(void)
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
staticfn int
|
||||
restlevelfile(xint8 ltmp)
|
||||
{
|
||||
char whynot[BUFSZ];
|
||||
@@ -882,7 +881,7 @@ dorecover(NHFILE *nhfp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
rest_stairs(NHFILE *nhfp)
|
||||
{
|
||||
int buflen = 0;
|
||||
@@ -937,7 +936,7 @@ restcemetery(NHFILE *nhfp, struct cemetery **cemeteryaddr)
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
rest_levl(
|
||||
NHFILE *nhfp,
|
||||
#ifdef RLECOMP
|
||||
@@ -1249,7 +1248,7 @@ get_plname_from_file(NHFILE *nhfp, char *plbuf)
|
||||
}
|
||||
|
||||
/* restore Plane of Water's air bubbles and Plane of Air's clouds */
|
||||
static void
|
||||
staticfn void
|
||||
rest_bubbles(NHFILE *nhfp)
|
||||
{
|
||||
xint8 bbubbly;
|
||||
@@ -1265,7 +1264,7 @@ rest_bubbles(NHFILE *nhfp)
|
||||
restore_waterlevel(nhfp);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
restore_gamelog(NHFILE *nhfp)
|
||||
{
|
||||
int slen = 0;
|
||||
@@ -1288,7 +1287,7 @@ restore_gamelog(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
restore_msghistory(NHFILE *nhfp)
|
||||
{
|
||||
int msgsize = 0, msgcount = 0;
|
||||
@@ -1313,7 +1312,7 @@ restore_msghistory(NHFILE *nhfp)
|
||||
}
|
||||
|
||||
/* Clear all structures for object and monster ID mapping. */
|
||||
static void
|
||||
staticfn void
|
||||
clear_id_mapping(void)
|
||||
{
|
||||
struct bucket *curr;
|
||||
@@ -1326,7 +1325,7 @@ clear_id_mapping(void)
|
||||
}
|
||||
|
||||
/* Add a mapping to the ID map. */
|
||||
static void
|
||||
staticfn void
|
||||
add_id_mapping(unsigned int gid, unsigned int nid)
|
||||
{
|
||||
int idx;
|
||||
@@ -1376,7 +1375,7 @@ lookup_id_mapping(unsigned int gid, unsigned int *nidp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
reset_oattached_mids(boolean ghostly)
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef TEXT_TOMBSTONE
|
||||
static void center(int, char *);
|
||||
staticfn void center(int, char *);
|
||||
|
||||
#ifndef NH320_DEDICATION
|
||||
/* A normal tombstone for end of game display. */
|
||||
@@ -70,7 +70,7 @@ static const char *const rip_txt[] = {
|
||||
#define DEATH_LINE 8 /* *char[] line # for death description */
|
||||
#define YEAR_LINE 12 /* *char[] line # for year */
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
center(int line, char *text)
|
||||
{
|
||||
char *ip, *op;
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
#ifdef USE_ISAAC64
|
||||
#include "isaac64.h"
|
||||
|
||||
static int whichrng(int (*fn)(int));
|
||||
static int RND(int);
|
||||
staticfn int whichrng(int (*fn)(int));
|
||||
staticfn int RND(int);
|
||||
staticfn void set_random(unsigned long, int (*)(int));
|
||||
|
||||
#if 0
|
||||
static isaac64_ctx rng_state;
|
||||
@@ -27,7 +28,7 @@ static struct rnglist_t rnglist[] = {
|
||||
{ rn2_on_display_rng, FALSE, { 0 } }, /* DISP */
|
||||
};
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
whichrng(int (*fn)(int))
|
||||
{
|
||||
int i;
|
||||
@@ -56,7 +57,7 @@ init_isaac64(unsigned long seed, int (*fn)(int))
|
||||
(int) sizeof seed);
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
RND(int x)
|
||||
{
|
||||
return (isaac64_next_uint64(&rnglist[CORE].rng_state) % x);
|
||||
@@ -230,7 +231,7 @@ rnz(int i)
|
||||
/* Sets the seed for the random number generator */
|
||||
#ifdef USE_ISAAC64
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
set_random(unsigned long seed,
|
||||
int (*fn)(int))
|
||||
{
|
||||
@@ -240,7 +241,7 @@ set_random(unsigned long seed,
|
||||
#else /* USE_ISAAC64 */
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
staticfn void
|
||||
set_random(unsigned long seed,
|
||||
int (*fn)(int) UNUSED)
|
||||
{
|
||||
|
||||
+8
-8
@@ -696,10 +696,10 @@ const struct Align aligns[] = {
|
||||
{ "evil", "unaligned", "Una", 0, A_NONE }
|
||||
};
|
||||
|
||||
static int randrole_filtered(void);
|
||||
static char *promptsep(char *, int);
|
||||
static int role_gendercount(int);
|
||||
static int race_alignmentcount(int);
|
||||
staticfn int randrole_filtered(void);
|
||||
staticfn char *promptsep(char *, int);
|
||||
staticfn int role_gendercount(int);
|
||||
staticfn int race_alignmentcount(int);
|
||||
|
||||
/* used by str2XXX() */
|
||||
static char NEARDATA randomstr[] = "random";
|
||||
@@ -722,7 +722,7 @@ randrole(boolean for_display)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
randrole_filtered(void)
|
||||
{
|
||||
int i, n = 0, set[SIZE(roles)];
|
||||
@@ -1374,7 +1374,7 @@ clearrolefilter(int which)
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
staticfn char *
|
||||
promptsep(char *buf, int num_post_attribs)
|
||||
{
|
||||
const char *conjuct = "and ";
|
||||
@@ -1389,7 +1389,7 @@ promptsep(char *buf, int num_post_attribs)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
role_gendercount(int rolenum)
|
||||
{
|
||||
int gendcount = 0;
|
||||
@@ -1405,7 +1405,7 @@ role_gendercount(int rolenum)
|
||||
return gendcount;
|
||||
}
|
||||
|
||||
static int
|
||||
staticfn int
|
||||
race_alignmentcount(int racenum)
|
||||
{
|
||||
int aligncount = 0;
|
||||
|
||||
+14
-14
@@ -41,14 +41,14 @@
|
||||
* and placed there by 'makedefs'.
|
||||
*/
|
||||
|
||||
static void unpadline(char *);
|
||||
static void init_rumors(dlb *);
|
||||
static char *get_rnd_line(dlb *, char *, unsigned, int (*)(int),
|
||||
staticfn void unpadline(char *);
|
||||
staticfn void init_rumors(dlb *);
|
||||
staticfn char *get_rnd_line(dlb *, char *, unsigned, int (*)(int),
|
||||
long, long, unsigned);
|
||||
static void init_oracles(dlb *);
|
||||
static void others_check(const char *ftype, const char *, winid *);
|
||||
static void couldnt_open_file(const char *);
|
||||
static void init_CapMons(void);
|
||||
staticfn void init_oracles(dlb *);
|
||||
staticfn void others_check(const char *ftype, const char *, winid *);
|
||||
staticfn void couldnt_open_file(const char *);
|
||||
staticfn void init_CapMons(void);
|
||||
|
||||
/* used by CapitalMon(); set up by init_CapMons(), released by free_CapMons();
|
||||
there's no need for these to be put into 'struct instance_globals g' */
|
||||
@@ -62,7 +62,7 @@ extern const char bogon_codes[]; /* from do_name.c */
|
||||
|
||||
/* makedefs pads short rumors, epitaphs, engravings, and hallucinatory
|
||||
monster names with trailing underscores; strip those off */
|
||||
static void
|
||||
staticfn void
|
||||
unpadline(char *line)
|
||||
{
|
||||
char *p = eos(line);
|
||||
@@ -80,7 +80,7 @@ unpadline(char *line)
|
||||
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_rumors(dlb *fp)
|
||||
{
|
||||
static const char rumors_header[] = "%d,%ld,%lx;%d,%ld,%lx;0,0,%lx\n";
|
||||
@@ -303,7 +303,7 @@ rumor_check(void)
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
/* 3.7: augments rumors_check(); test 'engrave' or 'epitaph' or 'bogusmon' */
|
||||
static void
|
||||
staticfn void
|
||||
others_check(
|
||||
const char *ftype, /* header: "{Engravings|Epitaphs|Bogus monsters}:" */
|
||||
const char *fname, /* filename: {ENGRAVEFILE|EPITAPHFILE|BOGUSMONFILE} */
|
||||
@@ -415,7 +415,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
chosen; however, if padlength is 0, lines following long lines are
|
||||
more likely than average to be picked, and lines after short lines
|
||||
are less likely */
|
||||
static char *
|
||||
staticfn char *
|
||||
get_rnd_line(
|
||||
dlb *fh, /* already opened file */
|
||||
char *buf, /* output buffer */
|
||||
@@ -571,7 +571,7 @@ outrumor(
|
||||
pline1(line);
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
init_oracles(dlb *fp)
|
||||
{
|
||||
int i;
|
||||
@@ -760,7 +760,7 @@ doconsult(struct monst *oracl)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
couldnt_open_file(const char *filename)
|
||||
{
|
||||
int save_something = gp.program_state.something_worth_saving;
|
||||
@@ -819,7 +819,7 @@ CapitalMon(
|
||||
having a capitalized type name like Green-elf or Archon, plus unique
|
||||
monsters whose "name" is a title rather than a personal name, plus
|
||||
hallucinatory monster names that fall into either of those categories */
|
||||
static void
|
||||
staticfn void
|
||||
init_CapMons(void)
|
||||
{
|
||||
unsigned pass;
|
||||
|
||||
+35
-35
@@ -16,28 +16,28 @@
|
||||
int dotcnt, dotrow; /* also used in restore */
|
||||
#endif
|
||||
|
||||
static void savelevchn(NHFILE *);
|
||||
static void savelevl(NHFILE *,boolean);
|
||||
static void savedamage(NHFILE *);
|
||||
static void save_bubbles(NHFILE *, xint8);
|
||||
static void save_stairs(NHFILE *);
|
||||
static void save_bc(NHFILE *);
|
||||
static void saveobj(NHFILE *, struct obj *);
|
||||
static void saveobjchn(NHFILE *, struct obj **) NO_NNARGS;
|
||||
static void savemon(NHFILE *, struct monst *);
|
||||
static void savemonchn(NHFILE *, struct monst *) NO_NNARGS;
|
||||
static void savetrapchn(NHFILE *, struct trap *) NO_NNARGS;
|
||||
static void save_gamelog(NHFILE *);
|
||||
static void savegamestate(NHFILE *);
|
||||
static void savelev_core(NHFILE *, xint8);
|
||||
static void save_msghistory(NHFILE *);
|
||||
staticfn void savelevchn(NHFILE *);
|
||||
staticfn void savelevl(NHFILE *,boolean);
|
||||
staticfn void savedamage(NHFILE *);
|
||||
staticfn void save_bubbles(NHFILE *, xint8);
|
||||
staticfn void save_stairs(NHFILE *);
|
||||
staticfn void save_bc(NHFILE *);
|
||||
staticfn void saveobj(NHFILE *, struct obj *);
|
||||
staticfn void saveobjchn(NHFILE *, struct obj **) NO_NNARGS;
|
||||
staticfn void savemon(NHFILE *, struct monst *);
|
||||
staticfn void savemonchn(NHFILE *, struct monst *) NO_NNARGS;
|
||||
staticfn void savetrapchn(NHFILE *, struct trap *) NO_NNARGS;
|
||||
staticfn void save_gamelog(NHFILE *);
|
||||
staticfn void savegamestate(NHFILE *);
|
||||
staticfn void savelev_core(NHFILE *, xint8);
|
||||
staticfn void save_msghistory(NHFILE *);
|
||||
|
||||
#ifdef ZEROCOMP
|
||||
static void zerocomp_bufon(int);
|
||||
static void zerocomp_bufoff(int);
|
||||
static void zerocomp_bflush(int);
|
||||
static void zerocomp_bwrite(int, genericptr_t, unsigned int);
|
||||
static void zerocomp_bputc(int);
|
||||
staticfn void zerocomp_bufon(int);
|
||||
staticfn void zerocomp_bufoff(int);
|
||||
staticfn void zerocomp_bflush(int);
|
||||
staticfn void zerocomp_bwrite(int, genericptr_t, unsigned int);
|
||||
staticfn void zerocomp_bputc(int);
|
||||
#endif
|
||||
|
||||
#if defined(HANGUPHANDLING)
|
||||
@@ -238,7 +238,7 @@ dosave0(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
save_gamelog(NHFILE *nhfp)
|
||||
{
|
||||
struct gamelog_line *tmp = gg.gamelog, *tmp2;
|
||||
@@ -271,7 +271,7 @@ save_gamelog(NHFILE *nhfp)
|
||||
gg.gamelog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savegamestate(NHFILE *nhfp)
|
||||
{
|
||||
unsigned long uid;
|
||||
@@ -462,7 +462,7 @@ savelev(NHFILE *nhfp, xint8 lev)
|
||||
gu.uz_save.dnum = gu.uz_save.dlevel = 0; /* unset */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savelev_core(NHFILE *nhfp, xint8 lev)
|
||||
{
|
||||
#ifdef TOS
|
||||
@@ -574,7 +574,7 @@ savelev_core(NHFILE *nhfp, xint8 lev)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savelevl(NHFILE *nhfp, boolean rlecomp)
|
||||
{
|
||||
#ifdef RLECOMP
|
||||
@@ -635,7 +635,7 @@ savelevl(NHFILE *nhfp, boolean rlecomp)
|
||||
}
|
||||
|
||||
/* save Plane of Water's air bubbles and Plane of Air's clouds */
|
||||
static void
|
||||
staticfn void
|
||||
save_bubbles(NHFILE *nhfp, xint8 lev)
|
||||
{
|
||||
xint8 bbubbly;
|
||||
@@ -682,7 +682,7 @@ savecemetery(NHFILE *nhfp, struct cemetery **cemeteryaddr)
|
||||
*cemeteryaddr = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savedamage(NHFILE *nhfp)
|
||||
{
|
||||
struct damage *damageptr, *tmp_dam;
|
||||
@@ -709,7 +709,7 @@ savedamage(NHFILE *nhfp)
|
||||
gl.level.damagelist = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
save_stairs(NHFILE *nhfp)
|
||||
{
|
||||
stairway *stway = gs.stairs;
|
||||
@@ -744,7 +744,7 @@ save_stairs(NHFILE *nhfp)
|
||||
|
||||
/* if ball and/or chain are loose, make an object chain for it/them and
|
||||
save that separately from other objects */
|
||||
static void
|
||||
staticfn void
|
||||
save_bc(NHFILE *nhfp)
|
||||
{
|
||||
struct obj *bc_objs = 0;
|
||||
@@ -774,7 +774,7 @@ save_bc(NHFILE *nhfp)
|
||||
|
||||
/* save one object;
|
||||
caveat: this is only for perform_bwrite(); caller handles release_data() */
|
||||
static void
|
||||
staticfn void
|
||||
saveobj(NHFILE *nhfp, struct obj *otmp)
|
||||
{
|
||||
int buflen, zerobuf = 0;
|
||||
@@ -818,7 +818,7 @@ saveobj(NHFILE *nhfp, struct obj *otmp)
|
||||
|
||||
/* save an object chain; sets head of list to Null when done;
|
||||
handles release_data() for each object in the list */
|
||||
static void
|
||||
staticfn void
|
||||
saveobjchn(NHFILE *nhfp, struct obj **obj_p)
|
||||
{
|
||||
struct obj *otmp = *obj_p;
|
||||
@@ -881,7 +881,7 @@ saveobjchn(NHFILE *nhfp, struct obj **obj_p)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savemon(NHFILE *nhfp, struct monst *mtmp)
|
||||
{
|
||||
int buflen;
|
||||
@@ -944,7 +944,7 @@ savemon(NHFILE *nhfp, struct monst *mtmp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savemonchn(NHFILE *nhfp, struct monst *mtmp)
|
||||
{
|
||||
struct monst *mtmp2;
|
||||
@@ -981,7 +981,7 @@ savemonchn(NHFILE *nhfp, struct monst *mtmp)
|
||||
}
|
||||
|
||||
/* save traps; gf.ftrap is the only trap chain so the 2nd arg is superfluous */
|
||||
static void
|
||||
staticfn void
|
||||
savetrapchn(NHFILE *nhfp, struct trap *trap)
|
||||
{
|
||||
static struct trap zerotrap;
|
||||
@@ -1039,7 +1039,7 @@ savefruitchn(NHFILE *nhfp)
|
||||
gf.ffruit = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
savelevchn(NHFILE *nhfp)
|
||||
{
|
||||
s_level *tmplev, *tmplev2;
|
||||
@@ -1079,7 +1079,7 @@ store_plname_in_file(NHFILE *nhfp)
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
save_msghistory(NHFILE *nhfp)
|
||||
{
|
||||
char *msg;
|
||||
|
||||
+6
-5
@@ -6,8 +6,9 @@
|
||||
#include "selvar.h"
|
||||
#include "sp_lev.h"
|
||||
|
||||
static boolean sel_flood_havepoint(coordxy, coordxy, coordxy *, coordxy *, int);
|
||||
static long line_dist_coord(long, long, long, long, long, long);
|
||||
staticfn boolean sel_flood_havepoint(coordxy, coordxy, coordxy *, coordxy *,
|
||||
int);
|
||||
staticfn long line_dist_coord(long, long, long, long, long, long);
|
||||
|
||||
/* selection */
|
||||
struct selectionvar *
|
||||
@@ -358,7 +359,7 @@ selection_do_grow(struct selectionvar *ov, int dir)
|
||||
selection_free(tmp, TRUE);
|
||||
}
|
||||
|
||||
static int (*selection_flood_check_func)(coordxy, coordxy);
|
||||
staticfn int (*selection_flood_check_func)(coordxy, coordxy);
|
||||
|
||||
void
|
||||
set_selection_floodfillchk(int (*f)(coordxy, coordxy))
|
||||
@@ -367,7 +368,7 @@ set_selection_floodfillchk(int (*f)(coordxy, coordxy))
|
||||
}
|
||||
|
||||
/* check whethere <x,y> is already in xs[],ys[] */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
sel_flood_havepoint(
|
||||
coordxy x, coordxy y,
|
||||
coordxy xs[], coordxy ys[],
|
||||
@@ -530,7 +531,7 @@ selection_do_ellipse(
|
||||
}
|
||||
|
||||
/* square of distance from line segment (x1,y1, x2,y2) to point (x3,y3) */
|
||||
static long
|
||||
staticfn long
|
||||
line_dist_coord(long x1, long y1, long x2, long y2, long x3, long y3)
|
||||
{
|
||||
long px = x2 - x1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user