short mask;
};
+/* read.c, create_particular() & create_particular_parse() */
+struct _create_particular_data {
+ int quan;
+ int which;
+ int fem;
+ char monclass;
+ boolean randmonst;
+ boolean maketame, makepeaceful, makehostile;
+ boolean sleeping, saddled, invisible, hidden;
+};
+
/* instance_globals holds engine state that does not need to be
* persisted upon game exit. The initialization state is well defined
* an set in decl.c during early early engine initialization.
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
E struct selectionvar *NDECL(selection_new);
E void FDECL(selection_free, (struct selectionvar *, BOOLEAN_P));
+E struct selectionvar *FDECL(selection_clone, (struct selectionvar *));
E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int))));
E void FDECL(selection_floodfill, (struct selectionvar *, int, int,
BOOLEAN_P));
struct proto_dungeon *));
static xchar FDECL(pick_level, (boolean *, int));
static boolean FDECL(place_level, (int, struct proto_dungeon *));
+static int FDECL(get_dgn_flags, (lua_State *));
static boolean FDECL(unplaced_floater, (struct dungeon *));
static boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P));
static void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *,
#define SELECTSAVED
#endif
+static NHFILE *NDECL(new_nhfile);
+static void FDECL(free_nhfile, (NHFILE *));
#ifdef SELECTSAVED
static int FDECL(CFDECLSPEC strcmp_wrap, (const void *, const void *));
#endif
static char *FDECL(choose_random_part, (char *, CHAR_P));
static boolean FDECL(is_config_section, (const char *));
static boolean FDECL(handle_config_section, (char *));
+static char *FDECL(find_optparam, (const char *));
static void FDECL(parseformat, (int *, char *));
#ifdef SELF_RECOVER
}
}
-NHFILE *
+static NHFILE *
new_nhfile()
{
NHFILE *nhfp = (NHFILE *)alloc(sizeof(NHFILE));
return nhfp;
}
-void
+static void
free_nhfile(nhfp)
NHFILE *nhfp;
{
#define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE)
/* find the '=' or ':' */
-char *
+static char *
find_optparam(buf)
const char *buf;
{
static struct monst *FDECL(monstinroom, (struct permonst *, int));
static boolean FDECL(doorless_door, (int, int));
static void FDECL(move_update, (BOOLEAN_P));
+static int NDECL(pickup_checks);
static void FDECL(maybe_smudge_engr, (int, int, int, int));
static void NDECL(domove_core);
0 = cannot pickup, no time taken
-1 = do normal pickup
-2 = loot the monster */
-int
+static int
pickup_checks()
{
/* uswallow case added by GAN 01/29/87 */
static int FDECL(iswall_or_stone, (int, int));
static boolean FDECL(is_solid, (int, int));
static int FDECL(extend_spine, (int[3][3], int, int, int));
+static void FDECL(wall_cleanup, (int, int, int, int));
static boolean FDECL(okay, (int, int, int));
static void FDECL(maze0xy, (coord *));
static boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P,
static void FDECL(check_ransacked, (char *));
static void FDECL(migr_booty_item, (int, const char *));
static void FDECL(migrate_orc, (struct monst *, unsigned long));
+static void FDECL(shiny_orc_stuff, (struct monst *));
static void NDECL(stolen_booty);
+static boolean FDECL(maze_inbounds, (int, int));
+static void FDECL(maze_remove_deadends, (XCHAR_P));
+static void FDECL(create_maze, (int, int));
/* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \
}
/* Remove walls totally surrounded by stone */
-void
+static void
wall_cleanup(x1, y1, x2, y2)
int x1, y1, x2, y2;
{
migrate_to_level(mtmp, ledger_no(&dest), MIGR_RANDOM, (coord *) 0);
}
-void
+static void
shiny_orc_stuff(mtmp)
struct monst *mtmp;
{
#undef ORC_LEADER
-boolean
+static boolean
maze_inbounds(x, y)
int x, y;
{
&& x < g.x_maze_max && y < g.y_maze_max && isok(x, y));
}
-void
+static void
maze_remove_deadends(typ)
xchar typ;
{
/* Create a maze with specified corridor width and wall thickness
* TODO: rewrite walkfrom so it works on temp space, not levl
*/
-void
+static void
create_maze(corrwid, wallthick)
int corrwid;
int wallthick;
static boolean FDECL(isbig, (struct mkroom *));
static struct mkroom *FDECL(pick_room, (BOOLEAN_P));
static void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp);
+static void FDECL(mk_zoo_thronemon, (int, int));
static void NDECL(mktemple);
static coord *FDECL(shrine_pos, (int));
static struct permonst *NDECL(morguemon);
}
}
-void
+static void
mk_zoo_thronemon(x,y)
int x,y;
{
static void FDECL(calm_nymphs, (int));
static void FDECL(charm_monsters, (int));
static void FDECL(do_earthquake, (int));
+static const char *NDECL(generic_lvl_desc);
static int FDECL(do_improvisation, (struct obj *));
/*
}
}
-const char *
+static const char *
generic_lvl_desc()
{
if (Is_astralevel(&u.uz))
#include "hack.h"
#include "sp_lev.h"
+struct _lua_obj {
+ int state; /* UNUSED */
+ struct obj *obj;
+};
+
+static struct _lua_obj *FDECL(l_obj_check, (lua_State *, int));
static int FDECL(l_obj_add_to_container, (lua_State *));
static int FDECL(l_obj_gc, (lua_State *));
static int FDECL(l_obj_getcontents, (lua_State *));
static int FDECL(l_obj_at, (lua_State *));
static int FDECL(l_obj_container, (lua_State *));
-struct _lua_obj {
- int state; /* UNUSED */
- struct obj *obj;
-};
-
#define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE)
-struct _lua_obj *
+static struct _lua_obj *
l_obj_check(L, index)
lua_State *L;
int index;
schar x = -1, y = -1;
int val = 1;
int argc = lua_gettop(L);
- long coord = 0L;
+ long crd = 0L;
if (argc == 0) {
(void) l_selection_new(L);
}
if (x == -1 && y == -1)
- coord = SP_COORD_PACK_RANDOM(0);
+ crd = SP_COORD_PACK_RANDOM(0);
else
- coord = SP_COORD_PACK(x,y);
+ crd = SP_COORD_PACK(x,y);
get_location_coord(&x, &y, ANY_LOC,
- g.coder ? g.coder->croom : NULL, coord);
+ g.coder ? g.coder->croom : NULL, crd);
selection_setpoint(x, y, sel, val);
lua_settop(L, 1);
return 1;
schar x = (schar) luaL_checkinteger(L, 2);
schar y = (schar) luaL_checkinteger(L, 3);
int val;
- long coord;
+ long crd;
if (x == -1 && y == -1)
- coord = SP_COORD_PACK_RANDOM(0);
+ crd = SP_COORD_PACK_RANDOM(0);
else
- coord = SP_COORD_PACK(x,y);
- get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, coord);
+ crd = SP_COORD_PACK(x,y);
+ get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, crd);
val = selection_getpoint(x, y, sel);
lua_settop(L, 0);
/* lua_CFunction prototypes */
static int FDECL(nhl_test, (lua_State *));
static int FDECL(nhl_getmap, (lua_State *));
+static void FDECL(nhl_add_table_entry_bool, (lua_State *, const char *, BOOLEAN_P));
+static char FDECL(splev_typ2chr, (SCHAR_P));
static int FDECL(nhl_gettrap, (lua_State *));
static int FDECL(nhl_deltrap, (lua_State *));
#if 0
static int FDECL(nhl_an, (lua_State *));
static int FDECL(nhl_rn2, (lua_State *));
static int FDECL(nhl_random, (lua_State *));
+static void FDECL(init_nhc_data, (lua_State *));
+static int FDECL(nhl_push_anything, (lua_State *, int, void *));
static int FDECL(nhl_meta_u_index, (lua_State *));
static int FDECL(nhl_meta_u_newindex, (lua_State *));
static int FDECL(nhl_u_clear_inventory, (lua_State *));
static int FDECL(nhl_u_giveobj, (lua_State *));
+static void FDECL(init_u_data, (lua_State *));
+static int FDECL(nhl_set_package_path, (lua_State *, const char *));
static int FDECL(traceback_handler, (lua_State *));
void
return INVALID_TYPE;
}
-char
+static char
splev_typ2chr(typ)
schar typ;
{
};
/* register and init the constants table */
-void
+static void
init_nhc_data(L)
lua_State *L;
{
lua_setglobal(L, "nhc");
}
-int
+static int
nhl_push_anything(L, anytype, src)
lua_State *L;
int anytype;
{ NULL, NULL }
};
-void
+static void
init_u_data(L)
lua_State *L;
{
lua_setglobal(L, "u");
}
-int
+static int
nhl_set_package_path(L, path)
lua_State *L;
const char *path;
return optn_ok;
}
-int optfn_paranoid_confirmation(optidx, req, negated, opts, op)
+int
+optfn_paranoid_confirmation(optidx, req, negated, opts, op)
int optidx;
int req;
boolean negated;
static void NDECL(hmenu_dowhatis);
static void NDECL(hmenu_dowhatdoes);
static void NDECL(hmenu_doextlist);
+static void NDECL(domenucontrols);
#ifdef PORT_HELP
extern void NDECL(port_help);
#endif
(void) doextlist();
}
-void
+static void
domenucontrols(VOID_ARGS)
{
winid cwin = create_nhwindow(NHW_TEXT);
static void FDECL(deliver_by_pline, (const char *));
static void FDECL(deliver_by_window, (const char *, int));
static boolean FDECL(skip_pager, (BOOLEAN_P));
+static boolean FDECL(com_pager_core, (const char *, const char *, BOOLEAN_P));
short
quest_info(typ)
return FALSE;
}
-boolean
+static boolean
com_pager_core(section, msgid, showerror)
const char *section;
const char *msgid;
static boolean FDECL(learnscrolltyp, (SHORT_P));
static char *FDECL(erode_obj_text, (struct obj *, char *));
-static char *FDECL(apron_text, (struct obj *, char *buf));
+static char *FDECL(apron_text, (struct obj *, char *));
static void FDECL(stripspe, (struct obj *));
static void FDECL(p_glow1, (struct obj *));
static void FDECL(p_glow2, (struct obj *, const char *));
static void FDECL(display_stinking_cloud_positions, (int));
static void FDECL(set_lit, (int, int, genericptr));
static void NDECL(do_class_genocide);
+static boolean FDECL(create_particular_parse, (char *, struct _create_particular_data *));
+static boolean FDECL(create_particular_creation, (struct _create_particular_data *));
static boolean
learnscrolltyp(scrolltyp)
return FALSE;
}
-struct _create_particular_data {
- int quan;
- int which;
- int fem;
- char monclass;
- boolean randmonst;
- boolean maketame, makepeaceful, makehostile;
- boolean sleeping, saddled, invisible, hidden;
-};
-
-boolean
+static boolean
create_particular_parse(str, d)
char *str;
struct _create_particular_data *d;
return FALSE;
}
-boolean
+static boolean
create_particular_creation(d)
struct _create_particular_data *d;
{
#ifdef USE_ISAAC64
#include "isaac64.h"
+static int FDECL(whichrng, (int FDECL((*fn), (int))));
+
#if 0
static isaac64_ctx rng_state;
#endif
static void FDECL(flip_drawbridge_vertical, (struct rm *));
static void FDECL(flip_visuals, (int, int, int, int, int));
static int FDECL(flip_encoded_direction_bits, (int, int));
+static void FDECL(sel_set_wall_property, (int, int, genericptr_t));
static void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
int));
static void NDECL(count_features);
static void FDECL(sel_set_door, (int, int, genericptr_t));
static void FDECL(sel_set_feature, (int, int, genericptr_t));
static int FDECL(get_coord, (lua_State *, int, int *, int *));
+static void FDECL(levregion_add, (lev_region *));
static void FDECL(get_table_xy_or_coord, (lua_State *, int *, int *));
static int FDECL(get_table_region, (lua_State *, const char *,
int *, int *, int *, int *, BOOLEAN_P));
static int FDECL(floodfillchk_match_under, (int, int));
static int FDECL(floodfillchk_match_accessible, (int, int));
static void FDECL(l_push_wid_hei_table, (lua_State *, int, int));
+static int FDECL(get_table_align, (lua_State *));
+static int FDECL(get_table_monclass, (lua_State *));
+static int FDECL(find_montype, (lua_State *, const char *));
+static int FDECL(get_table_montype, (lua_State *));
+static int FDECL(get_table_int_or_random, (lua_State *, const char *, int));
+static int FDECL(get_table_buc, (lua_State *));
+static int FDECL(get_table_objclass, (lua_State *));
+static int FDECL(find_objtype, (lua_State *, const char *));
+static int FDECL(get_table_objtype, (lua_State *));
+static int FDECL(get_table_roomtype_opt, (lua_State *, const char *, int));
+static int FDECL(get_table_traptype_opt, (lua_State *, const char *, int));
+static int FDECL(get_traptype_byname, (const char *));
+static int FDECL(get_table_intarray_entry, (lua_State *, int, int));
+static struct sp_coder *NDECL(sp_level_coder_init);
/* lua_CFunction prototypes */
int FDECL(lspo_altar, (lua_State *));
}
-void
+static void
sel_set_wall_property(x, y, arg)
int x, y;
genericptr_t arg;
return 0; /* number of results */
}
-int
+static int
get_table_align(L)
lua_State *L;
{
return a;
}
-int
+static int
get_table_monclass(L)
lua_State *L;
{
return ret;
}
-int
+static int
find_montype(L, s)
lua_State *L;
const char *s;
return NON_PM;
}
-int
+static int
get_table_montype(L)
lua_State *L;
{
/* the hash key 'name' is an integer or "random",
or if not existent, also return rndval.
*/
-int
+static int
get_table_int_or_random(L, name, rndval)
lua_State *L;
const char *name;
return ret;
}
-int
+static int
get_table_buc(L)
lua_State *L;
{
return curse_state;
}
-int
+static int
get_table_objclass(L)
lua_State *L;
{
return ret;
}
-int
+static int
find_objtype(L, s)
lua_State *L;
const char *s;
return STRANGE_OBJECT;
}
-int
+static int
get_table_objtype(L)
lua_State *L;
{
{ 0, 0 }
};
-int
+static int
get_table_roomtype_opt(L, name, defval)
lua_State *L;
const char *name;
int x, y;
long acoord;
int shrine;
- int align;
+ int al;
create_des_coder();
get_table_xy_or_coord(L, &x, &y);
- align = get_table_align(L);
+ al = get_table_align(L);
shrine = shrines2i[get_table_option(L, "type", "altar", shrines)];
if (x == -1 && y == -1)
acoord = SP_COORD_PACK(x, y);
tmpaltar.coord = acoord;
- tmpaltar.align = align;
+ tmpaltar.align = al;
tmpaltar.shrine = shrine;
create_altar(&tmpaltar, g.coder->croom);
{ "random", -1 },
{ 0, NO_TRAP } };
-int
+static int
get_table_traptype_opt(L, name, defval)
lua_State *L;
const char *name;
return NULL;
}
-int
+static int
get_traptype_byname(trapname)
const char *trapname;
{
return s;
}
-struct selectionvar *
-selection_logical_oper(s1, s2, oper)
-struct selectionvar *s1, *s2;
-char oper;
-{
- struct selectionvar *ov;
- int x, y;
-
- ov = selection_new();
- if (!ov)
- return NULL;
-
- for (x = 0; x < ov->wid; x++)
- for (y = 0; y < ov->hei; y++) {
- switch (oper) {
- default:
- case '|':
- if (selection_getpoint(x, y, s1)
- || selection_getpoint(x, y, s2))
- selection_setpoint(x, y, ov, 1);
- break;
- case '&':
- if (selection_getpoint(x, y, s1)
- && selection_getpoint(x, y, s2))
- selection_setpoint(x, y, ov, 1);
- break;
- }
- }
-
- return ov;
-}
-
struct selectionvar *
selection_filter_mapchar(ov, typ, lit)
struct selectionvar *ov;
selection_free(ov, TRUE);
}
-int
+static int
get_table_intarray_entry(L, tableidx, entrynum)
lua_State *L;
int tableidx, entrynum;
return 0;
}
-void
+static void
levregion_add(lregion)
lev_region *lregion;
{
lspo_map(L)
lua_State *L;
{
- xchar tmpxstart, tmpystart, tmpxsize, tmpysize;
-
/*
TODO: allow passing an array of strings as map data
TODO: handle if map lines aren't same length
return 0;
}
- tmpxsize = g.xsize;
- tmpysize = g.ysize;
- tmpxstart = g.xstart;
- tmpystart = g.ystart;
-
g.xsize = mf->wid;
g.ysize = mf->hei;
lua_call(L, 1, 0);
}
- tmpxsize = g.xsize;
- tmpysize = g.ysize;
- tmpxstart = g.xstart;
- tmpystart = g.ystart;
-
return 0;
}
g.coder->croom = NULL;
}
-struct sp_coder *
+static struct sp_coder *
sp_level_coder_init()
{
int tmpi;