the possible mutations of this */
char *nextc; /* next character(s) in text[] to engrave */
struct obj *stylus; /* object doing the writing */
- xchar type; /* type of engraving (DUST, MARK, etc) */
+ xint8 type; /* type of engraving (DUST, MARK, etc) */
coord pos; /* location the engraving is being placed on */
int actionct; /* nth turn spent engraving */
};
struct novel_tracking { /* for choosing random passage when reading novel */
unsigned id; /* novel oid from previous passage selection */
int count; /* number of passage indices available in pasg[] */
- xchar pasg[30]; /* pasg[0..count-1] are passage indices */
+ xint8 pasg[30]; /* pasg[0..count-1] are passage indices */
/* tribute file is allowed to have more than 30 passages for a novel;
if it does, reading will first choose a random subset of 30 of them;
reading all 30 or switching to a different novel and then back again
#define COORD_H
typedef struct nhcoord {
- xchar x, y;
+ coordxy x, y;
} coord;
#endif /* COORD_H */
d_level d_fire_level;
d_level d_air_level;
d_level d_astral_level;
- xchar d_tower_dnum;
- xchar d_sokoban_dnum;
- xchar d_mines_dnum, d_quest_dnum;
+ xint16 d_tower_dnum;
+ xint16 d_sokoban_dnum;
+ xint16 d_mines_dnum, d_quest_dnum;
d_level d_qstart_level, d_qlocate_level, d_nemesis_level;
d_level d_knox_level;
d_level d_mineend_level;
};
struct plinemsg_type {
- xchar msgtype; /* one of MSGTYP_foo */
+ xint16 msgtype; /* one of MSGTYP_foo */
struct nhregex *regex;
char *pattern;
struct plinemsg_type *next;
struct trapinfo {
struct obj *tobj;
- xchar tx, ty;
+ coordxy tx, ty;
int time_needed;
boolean force_bungle;
};
};
struct rogueroom {
- xchar rlx, rly;
- xchar dx, dy;
+ coordxy rlx, rly;
+ coordxy dx, dy;
boolean real;
uchar doortable;
int nroom; /* Only meaningful for "real" rooms */
typedef struct ls_t {
struct ls_t *next;
- xchar x, y; /* source's position */
+ coordxy x, y; /* source's position */
short range; /* source's current range */
short flags;
short type; /* type of light source */
struct container {
struct container *next;
- xchar x, y;
+ coordxy x, y;
short what;
genericptr_t list;
};
#define MAX_BMASK 4
struct bubble {
- xchar x, y; /* coordinates of the upper left corner */
+ coordxy x, y; /* coordinates of the upper left corner */
schar dx, dy; /* the general direction of the bubble's movement */
uchar bm[MAX_BMASK + 2]; /* bubble bit mask */
struct bubble *prev, *next; /* need to traverse the list up and down */
struct launchplace {
struct obj *obj;
- xchar x, y;
+ coordxy x, y;
};
struct repo { /* repossession context */
/* display.c */
gbuf_entry gbuf[ROWNO][COLNO];
- xchar gbuf_start[ROWNO];
- xchar gbuf_stop[ROWNO];
+ coordxy gbuf_start[ROWNO];
+ coordxy gbuf_stop[ROWNO];
/* do.c */
/* dog.c */
int petname_used; /* user preferred pet name has been used */
- xchar gtyp; /* type of dog's current goal */
- xchar gx; /* x position of dog's current goal */
- xchar gy; /* y position of dog's current goal */
+ xint16 gtyp; /* type of dog's current goal */
+ coordxy gx; /* x position of dog's current goal */
+ coordxy gy; /* y position of dog's current goal */
char dogname[PL_PSIZ];
char catname[PL_PSIZ];
char horsename[PL_PSIZ];
/* mklev.c */
genericptr_t luathemes[MAXDUNGEON];
- xchar vault_x;
- xchar vault_y;
+ coordxy vault_x;
+ coordxy vault_y;
boolean made_branch; /* used only during level creation */
/* mkmap.c */
lev_region *lregions;
int num_lregions;
struct sp_coder *coder;
- xchar xstart, ystart;
- xchar xsize, ysize;
+ coordxy xstart, ystart;
+ coordxy xsize, ysize;
boolean in_mk_themerooms;
boolean themeroom_failed;
Stormbringer's maliciousness. */
/* vision.c */
- xchar **viz_array; /* used in cansee() and couldsee() macros */
- xchar *viz_rmin; /* min could see indices */
- xchar *viz_rmax; /* max could see indices */
+ coordxy **viz_array; /* used in cansee() and couldsee() macros */
+ coordxy *viz_rmin; /* min could see indices */
+ coordxy *viz_rmax; /* max could see indices */
boolean vision_full_recalc;
int seethru; /* 'bubble' debugging: clouds and water don't block light */
#define MG_BADXY 0x04000 /* bad coordinates were passed */
typedef struct {
- xchar gnew; /* perhaps move this bit into the rm structure. */
+ xint8 gnew; /* perhaps move this bit into the rm structure. */
glyph_info glyphinfo;
} gbuf_entry;
#define DUNGEON_H
typedef struct d_level { /* basic dungeon level element */
- xchar dnum; /* dungeon number */
- xchar dlevel; /* level number */
+ xint16 dnum; /* dungeon number */
+ xint16 dlevel; /* level number */
} d_level;
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
} s_level;
typedef struct stairway { /* basic stairway identifier */
- xchar sx, sy; /* x / y location of the stair */
+ coordxy sx, sy; /* x / y location of the stair */
d_level tolev; /* where does it go */
boolean up; /* up or down? */
boolean isladder; /* ladder or stairway? */
};
typedef struct dest_area { /* non-stairway level change identifier */
- xchar lx, ly; /* "lower" left corner (near [0,0]) */
- xchar hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */
- xchar nlx, nly; /* outline of invalid area */
- xchar nhx, nhy; /* opposite corner of invalid area */
+ coordxy lx, ly; /* "lower" left corner (near [0,0]) */
+ coordxy hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */
+ coordxy nlx, nly; /* outline of invalid area */
+ coordxy nhx, nhy; /* opposite corner of invalid area */
} dest_area;
typedef struct dungeon { /* basic dungeon identifier */
char themerms[15]; /* lua file name containing themed rooms */
char boneid; /* character to id dungeon in bones files */
d_flags flags; /* dungeon flags */
- xchar entry_lev; /* entry level */
- xchar num_dunlevs; /* number of levels in this dungeon */
- xchar dunlev_ureached; /* how deep you have been in this dungeon */
+ xint16 entry_lev; /* entry level */
+ xint16 num_dunlevs; /* number of levels in this dungeon */
+ xint16 dunlev_ureached; /* how deep you have been in this dungeon */
int ledger_start, /* the starting depth in "real" terms */
depth_start; /* the starting depth in "logical" terms */
} dungeon;
struct engr {
struct engr *nxt_engr;
char *engr_txt;
- xchar engr_x, engr_y;
+ coordxy engr_x, engr_y;
unsigned engr_lth; /* for save & restore; not length of text */
long engr_time; /* moment engraving was (will be) finished */
- xchar engr_type;
+ xint8 engr_type;
#define DUST 1
#define ENGRAVE 2
#define BURN 3
extern boolean next_to_u(void);
extern struct obj *get_mleash(struct monst *);
extern const char *beautiful(void);
-extern void check_leash(xchar, xchar);
-extern boolean um_dist(xchar, xchar, xchar);
+extern void check_leash(coordxy, coordxy);
+extern boolean um_dist(coordxy, coordxy, xint16);
extern boolean snuff_candle(struct obj *);
extern boolean snuff_lit(struct obj *);
extern boolean splash_lit(struct obj *);
extern int touch_artifact(struct obj *, struct monst *);
extern int spec_abon(struct obj *, struct monst *);
extern int spec_dbon(struct obj *, struct monst *, int);
-extern void discover_artifact(xchar);
-extern boolean undiscovered_artifact(xchar);
+extern void discover_artifact(xint16);
+extern boolean undiscovered_artifact(xint16);
extern int disp_artifact_discoveries(winid);
extern void dump_artifact_info(winid);
extern boolean artifact_hit(struct monst *, struct monst *, struct obj *,
Lift_covet_and_placebc(x, __FUNCTION__, __LINE__)
#endif
extern void set_bc(int);
-extern void move_bc(int, int, xchar, xchar, xchar, xchar);
-extern boolean drag_ball(xchar, xchar, int *, xchar *, xchar *, xchar *,
- xchar *, boolean *, boolean);
-extern void drop_ball(xchar, xchar);
+extern void move_bc(int, int, coordxy, coordxy, coordxy, coordxy);
+extern boolean drag_ball(coordxy, coordxy, int *, coordxy *, coordxy *, coordxy *,
+ coordxy *, boolean *, boolean);
+extern void drop_ball(coordxy, coordxy);
extern void drag_down(void);
extern void bc_sanity_check(void);
extern void confdir(void);
extern const char *directionname(int);
extern int isok(int, int);
-extern int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *);
+extern int get_adjacent_loc(const char *, const char *, coordxy, coordxy, coord *);
extern const char *click_to_cmd(int, int, int);
extern char get_count(const char *, char, long, cmdcount_nht *, unsigned);
#ifdef HANGUPHANDLING
/* ### dbridge.c ### */
-extern boolean is_waterwall(xchar, xchar);
+extern boolean is_waterwall(coordxy, coordxy);
extern boolean is_pool(int, int);
extern boolean is_lava(int, int);
extern boolean is_pool_or_lava(int, int);
/* ### dig.c ### */
-extern int dig_typ(struct obj *, xchar, xchar);
+extern int dig_typ(struct obj *, coordxy, coordxy);
extern boolean is_digging(void);
extern int holetime(void);
extern boolean dig_check(struct monst *, boolean, int, int);
extern int use_pick_axe2(struct obj *);
extern boolean mdig_tunnel(struct monst *);
extern void draft_message(boolean);
-extern void watch_dig(struct monst *, xchar, xchar, boolean);
+extern void watch_dig(struct monst *, coordxy, coordxy, boolean);
extern void zap_dig(void);
extern struct obj *bury_an_obj(struct obj *, boolean *);
extern void bury_objs(int, int);
extern void buried_ball_to_punishment(void);
extern void buried_ball_to_freedom(void);
extern schar fillholetyp(int, int, boolean);
-extern void liquid_flow(xchar, xchar, schar, struct trap *, const char *);
+extern void liquid_flow(coordxy, coordxy, schar, struct trap *, const char *);
extern boolean conjoined_pits(struct trap *, struct trap *, boolean);
#if 0
extern void bury_monst(struct monst *);
extern int canseemon(struct monst *);
extern int knowninvisible(struct monst *);
extern int is_safemon(struct monst *);
-extern void magic_map_background(xchar, xchar, int);
-extern void map_background(xchar, xchar, int);
+extern void magic_map_background(coordxy, coordxy, int);
+extern void map_background(coordxy, coordxy, int);
extern void map_trap(struct trap *, int);
extern void map_object(struct obj *, int);
-extern void map_invisible(xchar, xchar);
+extern void map_invisible(coordxy, coordxy);
extern boolean unmap_invisible(int, int);
extern void unmap_object(int, int);
extern void map_location(int, int, int);
extern boolean suppress_map_output(void);
-extern void feel_newsym(xchar, xchar);
-extern void feel_location(xchar, xchar);
+extern void feel_newsym(coordxy, coordxy);
+extern void feel_location(coordxy, coordxy);
extern void newsym(int, int);
extern void newsym_force(int, int);
-extern void shieldeff(xchar, xchar);
+extern void shieldeff(coordxy, coordxy);
extern void tmp_at(int, int);
extern void flash_glyph_at(int, int, int, int);
extern void swallowed(int);
extern void row_refresh(int, int, int);
extern void cls(void);
extern void flush_screen(int);
-extern int back_to_glyph(xchar, xchar);
+extern int back_to_glyph(coordxy, coordxy);
extern int zapdir_to_glyph(int, int, int);
-extern int glyph_at(xchar, xchar);
+extern int glyph_at(coordxy, coordxy);
extern void reglyph_darkroom(void);
extern void xy_set_wall_state(int, int);
extern void set_wall_state(void);
extern void unset_seenv(struct rm *, int, int, int, int);
extern int warning_of(struct monst *);
-extern void map_glyphinfo(xchar, xchar, int, unsigned, glyph_info *);
+extern void map_glyphinfo(coordxy, coordxy, int, unsigned, glyph_info *);
extern void reset_glyphmap(enum glyphmap_change_triggers trigger);
extern int fn_cmap_to_glyph(int);
extern void newedog(struct monst *);
extern void free_edog(struct monst *);
extern void initedog(struct monst *);
-extern struct monst *make_familiar(struct obj *, xchar, xchar, boolean);
+extern struct monst *make_familiar(struct obj *, coordxy, coordxy, boolean);
extern struct monst *makedog(void);
extern void update_mlstmv(void);
extern void losedogs(void);
extern void mon_arrive(struct monst *, boolean);
extern void mon_catchup_elapsed_time(struct monst *, long);
extern void keepdogs(boolean);
-extern void migrate_to_level(struct monst *, xchar, xchar, coord *);
+extern void migrate_to_level(struct monst *, coordxy, coordxy, coord *);
extern int dogfood(struct monst *, struct obj *);
extern boolean tamedog(struct monst *, struct obj *);
extern void abuse_dog(struct monst *);
/* ### dokick.c ### */
extern boolean ghitm(struct monst *, struct obj *);
-extern void container_impact_dmg(struct obj *, xchar, xchar);
+extern void container_impact_dmg(struct obj *, coordxy, coordxy);
extern int dokick(void);
-extern boolean ship_object(struct obj *, xchar, xchar, boolean);
+extern boolean ship_object(struct obj *, coordxy, coordxy, boolean);
extern void obj_delivery(boolean);
extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long);
-extern schar down_gate(xchar, xchar);
-extern void impact_drop(struct obj *, xchar, xchar, xchar);
+extern schar down_gate(coordxy, coordxy);
+extern void impact_drop(struct obj *, coordxy, coordxy, coordxy);
/* ### dothrow.c ### */
extern void throwit(struct obj *, long, boolean, struct obj *);
extern int omon_adj(struct monst *, struct obj *, boolean);
extern int thitmonst(struct monst *, struct obj *);
-extern int hero_breaks(struct obj *, xchar, xchar, unsigned);
-extern int breaks(struct obj *, xchar, xchar);
-extern void release_camera_demon(struct obj *, xchar, xchar);
-extern void breakobj(struct obj *, xchar, xchar, boolean, boolean);
+extern int hero_breaks(struct obj *, coordxy, coordxy, unsigned);
+extern int breaks(struct obj *, coordxy, coordxy);
+extern void release_camera_demon(struct obj *, coordxy, coordxy);
+extern void breakobj(struct obj *, coordxy, coordxy, boolean, boolean);
extern boolean breaktest(struct obj *);
extern boolean walk_path(coord *, coord *, boolean(*)(void *, int, int),
genericptr_t);
extern s_level *Is_special(d_level *);
extern branch *Is_branchlev(d_level *);
extern boolean builds_up(d_level *);
-extern xchar ledger_no(d_level *);
-extern xchar maxledgerno(void);
+extern xint16 ledger_no(d_level *);
+extern xint16 maxledgerno(void);
extern schar depth(d_level *);
-extern xchar dunlev(d_level *);
-extern xchar dunlevs_in_dungeon(d_level *);
-extern xchar ledger_to_dnum(xchar);
-extern xchar ledger_to_dlev(xchar);
-extern xchar deepest_lev_reached(boolean);
+extern xint16 dunlev(d_level *);
+extern xint16 dunlevs_in_dungeon(d_level *);
+extern xint16 ledger_to_dnum(xint16);
+extern xint16 ledger_to_dlev(xint16);
+extern xint16 deepest_lev_reached(boolean);
extern boolean on_level(d_level *, d_level *);
extern void next_level(boolean);
extern void prev_level(boolean);
extern void u_on_sstairs(int);
extern void u_on_upstairs(void);
extern void u_on_dnstairs(void);
-extern boolean On_stairs(xchar, xchar);
-extern boolean On_ladder(xchar, xchar);
-extern boolean On_stairs_up(xchar, xchar);
-extern boolean On_stairs_dn(xchar, xchar);
+extern boolean On_stairs(coordxy, coordxy);
+extern boolean On_ladder(coordxy, coordxy);
+extern boolean On_stairs_up(coordxy, coordxy);
+extern boolean On_stairs_dn(coordxy, coordxy);
extern void get_level(d_level *, int);
extern boolean Is_botlevel(d_level *);
extern boolean Can_fall_thru(d_level *);
extern void assign_rnd_level(d_level *, d_level *, int);
extern unsigned int induced_align(int);
extern boolean Invocation_lev(d_level *);
-extern xchar level_difficulty(void);
+extern xint16 level_difficulty(void);
extern schar lev_by_name(const char *);
extern boolean known_branch_stairs(stairway *);
extern char *stairs_description(stairway *, char *, boolean);
-extern schar print_dungeon(boolean, schar *, xchar *);
+extern schar print_dungeon(boolean, schar *, xint16 *);
extern char *get_annotation(d_level *);
extern int donamelevel(void);
extern int dooverview(void);
extern void cant_reach_floor(int, int, boolean, boolean);
extern const char *surface(int, int);
extern const char *ceiling(int, int);
-extern struct engr *engr_at(xchar, xchar);
-extern boolean sengr_at(const char *, xchar, xchar, boolean);
+extern struct engr *engr_at(coordxy, coordxy);
+extern boolean sengr_at(const char *, coordxy, coordxy, boolean);
extern void u_wipe_engr(int);
-extern void wipe_engr_at(xchar, xchar, xchar, boolean);
+extern void wipe_engr_at(coordxy, coordxy, coordxy, boolean);
extern void read_engr_at(int, int);
-extern void make_engr_at(int, int, const char *, long, xchar);
+extern void make_engr_at(int, int, const char *, long, xint16);
extern void del_engr_at(int, int);
extern int freehand(void);
extern int doengrave(void);
extern void floating_above(const char *);
extern void dogushforth(int);
-extern void dryup(xchar, xchar, boolean);
+extern void dryup(coordxy, coordxy, boolean);
extern void drinkfountain(void);
extern void dipfountain(struct obj *);
extern void breaksink(int, int);
extern anything *monst_to_any(struct monst *);
extern anything *obj_to_any(struct obj *);
extern boolean revive_nasty(int, int, const char *);
-extern int still_chewing(xchar, xchar);
-extern void movobj(struct obj *, xchar, xchar);
-extern boolean may_dig(xchar, xchar);
-extern boolean may_passwall(xchar, xchar);
-extern boolean bad_rock(struct permonst *, xchar, xchar);
+extern int still_chewing(coordxy, coordxy);
+extern void movobj(struct obj *, coordxy, coordxy);
+extern boolean may_dig(coordxy, coordxy);
+extern boolean may_passwall(coordxy, coordxy);
+extern boolean bad_rock(struct permonst *, coordxy, coordxy);
extern int cant_squeeze_thru(struct monst *);
-extern boolean invocation_pos(xchar, xchar);
+extern boolean invocation_pos(coordxy, coordxy);
extern boolean test_move(int, int, int, int, int);
#ifdef DEBUG
extern int wiz_debug_cmd_traveldisplay(void);
extern void set_uinwater(int);
extern boolean pooleffects(boolean);
extern void spoteffects(boolean);
-extern char *in_rooms(xchar, xchar, int);
+extern char *in_rooms(coordxy, coordxy, int);
extern boolean in_town(int, int);
extern void check_special_room(boolean);
extern int dopickup(void);
extern boolean check_capacity(const char *);
extern int inv_cnt(boolean);
extern long money_cnt(struct obj *);
-extern void spot_checks(xchar, xchar, schar);
+extern void spot_checks(coordxy, coordxy, schar);
/* ### hacklib.c ### */
/* ### light.c ### */
-extern void new_light_source(xchar, xchar, int, int, union any *);
+extern void new_light_source(coordxy, coordxy, int, int, union any *);
extern void del_light_source(int, union any *);
-extern void do_light_sources(xchar **);
+extern void do_light_sources(coordxy **);
extern void show_transient_light(struct obj *, int, int);
extern void transient_light_cleanup(void);
extern struct monst *find_mid(unsigned, unsigned);
extern void reset_pick(void);
extern void maybe_reset_pick(struct obj *);
extern struct obj *autokey(boolean);
-extern int pick_lock(struct obj *, xchar, xchar, struct obj *);
+extern int pick_lock(struct obj *, coordxy, coordxy, struct obj *);
extern boolean u_have_forceable_weapon(void);
extern int doforce(void);
extern boolean boxlock(struct obj *, struct obj *);
extern void dealloc_monst(struct monst *);
extern boolean is_home_elemental(struct permonst *);
-extern struct monst *clone_mon(struct monst *, xchar, xchar);
+extern struct monst *clone_mon(struct monst *, coordxy, coordxy);
extern int monhp_per_lvl(struct monst *);
extern void newmonhp(struct monst *, int);
extern struct mextra *newmextra(void);
#else
extern void topologize(struct mkroom *);
#endif
-extern void place_branch(branch *, xchar, xchar);
-extern boolean occupied(xchar, xchar);
-extern int okdoor(xchar, xchar);
+extern void place_branch(branch *, coordxy, coordxy);
+extern boolean occupied(coordxy, coordxy);
+extern int okdoor(coordxy, coordxy);
extern void dodoor(int, int, struct mkroom *);
extern void mktrap(int, int, struct mkroom *, coord *);
-extern void mkstairs(xchar, xchar, char, struct mkroom *, boolean);
+extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean);
extern void mkinvokearea(void);
extern void mineralize(int, int, int, int, boolean);
/* ### mkmaze.c ### */
-extern boolean set_levltyp(xchar, xchar, schar);
-extern boolean set_levltyp_lit(xchar, xchar, schar, schar);
+extern boolean set_levltyp(coordxy, coordxy, schar);
+extern boolean set_levltyp_lit(coordxy, coordxy, schar, schar);
extern void create_maze(int, int, boolean);
extern void wallification(int, int, int, int);
extern void fix_wall_spines(int, int, int, int);
extern void mazexy(coord *);
extern void get_level_extends(int *, int *, int *, int *);
extern void bound_digging(void);
-extern void mkportal(xchar, xchar, xchar, xchar);
-extern boolean bad_location(xchar, xchar, xchar, xchar, xchar, xchar);
-extern void place_lregion(xchar, xchar, xchar, xchar, xchar, xchar, xchar,
- xchar, xchar, d_level *);
+extern void mkportal(coordxy, coordxy, coordxy, coordxy);
+extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
+extern void place_lregion(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy,
+ coordxy, coordxy, d_level *);
extern void fixup_special(void);
extern void fumaroles(void);
extern void movebubbles(void);
extern boolean has_upstairs(struct mkroom *);
extern int somex(struct mkroom *);
extern int somey(struct mkroom *);
-extern boolean inside_room(struct mkroom *, xchar, xchar);
+extern boolean inside_room(struct mkroom *, coordxy, coordxy);
extern boolean somexy(struct mkroom *, coord *);
extern boolean somexyspace(struct mkroom *, coord *);
extern void mkundead(coord *, boolean, int);
extern void m_into_limbo(struct monst *);
extern void mnexto(struct monst *, unsigned);
extern void maybe_mnexto(struct monst *);
-extern int mnearto(struct monst *, xchar, xchar, boolean, unsigned);
+extern int mnearto(struct monst *, coordxy, coordxy, boolean, unsigned);
extern void m_respond(struct monst *);
extern void setmangry(struct monst *, boolean);
extern void wake_msg(struct monst *, boolean);
extern void normal_shape(struct monst *);
extern void iter_mons(void (*)(struct monst *));
extern struct monst *get_iter_mons(boolean (*)(struct monst *));
-extern struct monst *get_iter_mons_xy(boolean (*)(struct monst *, xchar, xchar), xchar, xchar);
+extern struct monst *get_iter_mons_xy(boolean (*)(struct monst *, coordxy, coordxy), coordxy, coordxy);
extern void rescham(void);
extern void restartcham(void);
extern void restore_cham(struct monst *);
-extern void maybe_unhide_at(xchar, xchar);
+extern void maybe_unhide_at(coordxy, coordxy);
extern boolean hideunder(struct monst *);
extern void hide_monst(struct monst *);
extern void mon_animal_list(boolean);
extern void monflee(struct monst *, int, boolean, boolean);
extern void mon_yells(struct monst *, const char *);
extern int dochug(struct monst *);
-extern boolean m_digweapon_check(struct monst *, xchar, xchar);
+extern boolean m_digweapon_check(struct monst *, coordxy, coordxy);
extern int m_move(struct monst *, int);
-extern int m_move_aggress(struct monst *, xchar, xchar);
+extern int m_move_aggress(struct monst *, coordxy, coordxy);
extern void dissolve_bars(int, int);
extern boolean closed_door(int, int);
extern boolean accessible(int, int);
extern void set_apparxy(struct monst *);
extern boolean can_ooze(struct monst *);
extern boolean can_fog(struct monst *);
-extern boolean should_displace(struct monst *, coord *, long *, int, xchar,
- xchar);
-extern boolean undesirable_disp(struct monst *, xchar, xchar);
+extern boolean should_displace(struct monst *, coord *, long *, int, coordxy,
+ coordxy);
+extern boolean undesirable_disp(struct monst *, coordxy, coordxy);
/* ### monst.c ### */
/* ### mplayer.c ### */
-extern struct monst *mk_mplayer(struct permonst *, xchar, xchar, boolean);
+extern struct monst *mk_mplayer(struct permonst *, coordxy, coordxy, boolean);
extern void create_mplayers(int, boolean);
extern void mplayer_talk(struct monst *);
extern void thrwmu(struct monst *);
extern int spitmu(struct monst *, struct attack *);
extern int breamu(struct monst *, struct attack *);
-extern boolean linedup_callback(xchar, xchar, xchar, xchar,
+extern boolean linedup_callback(coordxy, coordxy, coordxy, coordxy,
boolean(*)(int,int));
-extern boolean linedup(xchar, xchar, xchar, xchar, int);
+extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int);
extern boolean lined_up(struct monst *);
extern struct obj *m_carrying(struct monst *, int);
extern int thrwmm(struct monst *, struct monst *);
extern void nhl_add_table_entry_str(lua_State *, const char *, const char *);
extern void nhl_add_table_entry_bool(lua_State *, const char *, boolean);
extern void nhl_add_table_entry_region(lua_State *, const char *,
- xchar, xchar, xchar, xchar);
+ coordxy, coordxy, coordxy, coordxy);
extern schar splev_chr2typ(char);
extern schar check_mapchr(const char *);
extern int get_table_int(lua_State *, const char *);
extern char *monhealthdescr(struct monst *mon, boolean, char *);
extern void mhidden_description(struct monst *, boolean, char *);
extern boolean object_from_map(int,int,int,struct obj **);
-extern const char *waterbody_name(xchar, xchar);
+extern const char *waterbody_name(coordxy, coordxy);
extern int do_screen_description(coord, boolean, int, char *, const char **,
struct permonst **);
extern int do_look(int, coord *);
extern int doturn(void);
extern int altarmask_at(int, int);
extern const char *a_gname(void);
-extern const char *a_gname_at(xchar x, xchar y);
+extern const char *a_gname_at(coordxy x, coordxy y);
extern const char *align_gname(aligntyp);
extern const char *halu_gname(aligntyp);
extern const char *align_gtitle(aligntyp);
/* ### priest.c ### */
extern int move_special(struct monst *, boolean, schar, boolean, boolean,
- xchar, xchar, xchar, xchar);
+ coordxy, coordxy, coordxy, coordxy);
extern char temple_occupied(char *);
extern boolean inhistemple(struct monst *);
extern int pri_move(struct monst *);
extern void intemple(int);
extern void forget_temple_entry(struct monst *);
extern void priest_talk(struct monst *);
-extern struct monst *mk_roamer(struct permonst *, aligntyp, xchar, xchar,
+extern struct monst *mk_roamer(struct permonst *, aligntyp, coordxy, coordxy,
boolean);
extern void reset_hostility(struct monst *);
-extern boolean in_your_sanctuary(struct monst *, xchar, xchar);
+extern boolean in_your_sanctuary(struct monst *, coordxy, coordxy);
extern void ghod_hitsu(struct monst *);
extern void angry_priest(void);
extern void clearpriests(void);
extern boolean inside_region(NhRegion *, int, int);
extern void clear_regions(void);
extern void run_regions(void);
-extern boolean in_out_region(xchar, xchar);
-extern boolean m_in_out_region(struct monst *, xchar, xchar);
+extern boolean in_out_region(coordxy, coordxy);
+extern boolean m_in_out_region(struct monst *, coordxy, coordxy);
extern void update_player_regions(void);
extern void update_monster_region(struct monst *);
-extern NhRegion *visible_region_at(xchar, xchar);
-extern void show_region(NhRegion *, xchar, xchar);
+extern NhRegion *visible_region_at(coordxy, coordxy);
+extern void show_region(NhRegion *, coordxy, coordxy);
extern void save_regions(NHFILE *);
extern void rest_regions(NHFILE *);
extern void region_stats(const char *, char *, long *, long *);
-extern NhRegion *create_gas_cloud(xchar, xchar, int, int);
+extern NhRegion *create_gas_cloud(coordxy, coordxy, int, int);
extern boolean region_danger(void);
extern void region_safety(void);
extern int dorecover(NHFILE *);
extern void restcemetery(NHFILE *, struct cemetery **);
extern void trickery(char *);
-extern void getlev(NHFILE *, int, xchar);
+extern void getlev(NHFILE *, int, xint8);
extern void get_plname_from_file(NHFILE *, char *);
#ifdef SELECTSAVED
extern int restore_menu(winid);
#ifdef INSURANCE
extern void savestateinlock(void);
#endif
-extern void savelev(NHFILE *, xchar);
+extern void savelev(NHFILE *, xint8);
extern genericptr_t mon_to_buffer(struct monst *, int *);
extern boolean close_check(int);
extern void savecemetery(NHFILE *, struct cemetery **);
extern void set_residency(struct monst *, boolean);
extern void replshk(struct monst *, struct monst *);
extern void restshk(struct monst *, boolean);
-extern char inside_shop(xchar, xchar);
+extern char inside_shop(coordxy, coordxy);
extern void u_left_shop(char *, boolean);
-extern void remote_burglary(xchar, xchar);
+extern void remote_burglary(coordxy, coordxy);
extern void u_entered_shop(char *);
extern void pick_pick(struct obj *);
extern boolean same_price(struct obj *, struct obj *);
extern void make_happy_shk(struct monst *, boolean);
extern void make_happy_shoppers(boolean);
extern void hot_pursuit(struct monst *);
-extern void make_angry_shk(struct monst *, xchar, xchar);
+extern void make_angry_shk(struct monst *, coordxy, coordxy);
extern int dopay(void);
extern boolean paybill(int, boolean);
extern void finish_paybill(void);
extern void addtobill(struct obj *, boolean, boolean, boolean);
extern void splitbill(struct obj *, struct obj *);
extern void subfrombill(struct obj *, struct monst *);
-extern long stolen_value(struct obj *, xchar, xchar, boolean, boolean);
+extern long stolen_value(struct obj *, coordxy, coordxy, boolean, boolean);
extern void donate_gold(long, struct monst *, boolean);
extern void sellobj_state(int);
-extern void sellobj(struct obj *, xchar, xchar);
+extern void sellobj(struct obj *, coordxy, coordxy);
extern int doinvbill(int);
-extern struct monst *shkcatch(struct obj *, xchar, xchar);
-extern void add_damage(xchar, xchar, long);
+extern struct monst *shkcatch(struct obj *, coordxy, coordxy);
+extern void add_damage(coordxy, coordxy, long);
extern void fix_shop_damage(void);
extern int shk_move(struct monst *);
extern void after_shk_move(struct monst *);
extern boolean is_fshk(struct monst *);
extern void shopdig(int);
extern void pay_for_damage(const char *, boolean);
-extern boolean costly_spot(xchar, xchar);
-extern struct obj *shop_object(xchar, xchar);
+extern boolean costly_spot(coordxy, coordxy);
+extern struct obj *shop_object(coordxy, coordxy);
extern void price_quote(struct obj *);
extern void shk_chat(struct monst *);
extern void check_unpaid_usage(struct obj *, boolean);
extern void check_unpaid(struct obj *);
-extern void costly_gold(xchar, xchar, long, boolean);
+extern void costly_gold(coordxy, coordxy, long, boolean);
extern long get_cost_of_shop_item(struct obj *, int *);
extern int oid_price_adjustment(struct obj *, unsigned);
-extern boolean block_door(xchar, xchar);
-extern boolean block_entry(xchar, xchar);
+extern boolean block_door(coordxy, coordxy);
+extern boolean block_entry(coordxy, coordxy);
extern char *shk_your(char *, struct obj *);
extern char *Shk_Your(char *, struct obj *);
extern void globby_bill_fixup(struct obj *, struct obj *);
extern boolean mapfrag_match(struct mapfragment *, int, int);
extern void flip_level(int, boolean);
extern void flip_level_rnd(int, boolean);
-extern boolean check_room(xchar *, xchar *, xchar *, xchar *, boolean);
-extern boolean create_room(xchar, xchar, xchar, xchar, xchar, xchar, xchar,
- xchar);
+extern boolean check_room(coordxy *, coordxy *, coordxy *, coordxy *, boolean);
+extern boolean create_room(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, xint16,
+ xint16);
extern boolean dig_corridor(coord *, coord *, boolean, schar, schar);
extern void fill_special_room(struct mkroom *);
extern void wallify_map(int, int, int, int);
extern boolean load_special(const char *);
-extern xchar selection_getpoint(int, int, struct selectionvar *);
+extern coordxy selection_getpoint(int, int, struct selectionvar *);
extern struct selectionvar *selection_new(void);
extern void selection_free(struct selectionvar *, boolean);
extern struct selectionvar *selection_clone(struct selectionvar *);
extern void set_selection_floodfillchk(int(*)(int,int));
extern void selection_floodfill(struct selectionvar *, int, int, boolean);
extern boolean pm_good_location(int, int, struct permonst *);
-extern void get_location_coord(xchar *, xchar *, int, struct mkroom *, long);
-extern void selection_setpoint(int, int, struct selectionvar *, xchar);
+extern void get_location_coord(coordxy *, coordxy *, int, struct mkroom *, long);
+extern void selection_setpoint(int, int, struct selectionvar *, coordxy);
extern struct selectionvar * selection_not(struct selectionvar *);
extern void selection_filter_percent(struct selectionvar *, int);
-extern int selection_rndcoord(struct selectionvar *, xchar *, xchar *,
+extern int selection_rndcoord(struct selectionvar *, coordxy *, coordxy *,
boolean);
extern void selection_do_grow(struct selectionvar *, int);
-extern void selection_do_line(xchar, xchar, xchar, xchar,
+extern void selection_do_line(coordxy, coordxy, coordxy, coordxy,
struct selectionvar *);
-extern void selection_do_randline(xchar, xchar, xchar, xchar, schar, schar,
+extern void selection_do_randline(coordxy, coordxy, coordxy, coordxy, schar, schar,
struct selectionvar *);
extern struct selectionvar *selection_filter_mapchar(struct selectionvar *,
- xchar, int);
-extern void set_floodfillchk_match_under(xchar);
+ coordxy, int);
+extern void set_floodfillchk_match_under(coordxy);
extern void selection_do_ellipse(struct selectionvar *, int, int, int, int,
int);
extern void selection_do_gradient(struct selectionvar *, long, long, long,
extern boolean noteleport_level(struct monst *);
extern boolean goodpos(int, int, struct monst *, mmflags_nht);
-extern boolean enexto(coord *, xchar, xchar, struct permonst *);
-extern boolean enexto_core(coord *, xchar, xchar, struct permonst *,
+extern boolean enexto(coord *, coordxy, coordxy, struct permonst *);
+extern boolean enexto_core(coord *, coordxy, coordxy, struct permonst *,
mmflags_nht);
extern void teleds(int, int, int);
extern boolean safe_teleds(int);
extern void obj_split_timers(struct obj *, struct obj *);
extern void obj_stop_timers(struct obj *);
extern boolean obj_has_timer(struct obj *, short);
-extern void spot_stop_timers(xchar, xchar, short);
-extern long spot_time_expires(xchar, xchar, short);
-extern long spot_time_left(xchar, xchar, short);
+extern void spot_stop_timers(coordxy, coordxy, short);
+extern long spot_time_expires(coordxy, coordxy, short);
+extern long spot_time_left(coordxy, coordxy, short);
extern boolean obj_is_local(struct obj *);
extern void save_timers(NHFILE *, int);
extern void restore_timers(NHFILE *, int, long);
extern boolean grease_protect(struct obj *, const char *, struct monst *);
extern struct trap *maketrap(int, int, int);
extern void fall_through(boolean, unsigned);
-extern struct monst *animate_statue(struct obj *, xchar, xchar, int, int *);
-extern struct monst *activate_statue_trap(struct trap *, xchar, xchar,
+extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *);
+extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
boolean);
extern void set_utrap(unsigned, unsigned);
extern void reset_utrap(boolean);
extern void fill_pit(int, int);
extern int float_down(long, long);
extern void climb_pit(void);
-extern boolean fire_damage(struct obj *, boolean, xchar, xchar);
-extern int fire_damage_chain(struct obj *, boolean, boolean, xchar, xchar);
-extern boolean lava_damage(struct obj *, xchar, xchar);
+extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy);
+extern int fire_damage_chain(struct obj *, boolean, boolean, coordxy, coordxy);
+extern boolean lava_damage(struct obj *, coordxy, coordxy);
extern void acid_damage(struct obj *);
extern int water_damage(struct obj *, const char *, boolean);
extern void water_damage_chain(struct obj *, boolean);
extern void sokoban_guilt(void);
extern const char * trapname(int, boolean);
extern void ignite_items(struct obj *);
-extern void trap_ice_effects(xchar x, xchar y, boolean ice_is_melting);
+extern void trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting);
extern void trap_sanity_check(void);
/* ### u_init.c ### */
extern void amulet(void);
extern int mon_has_amulet(struct monst *);
extern int mon_has_special(struct monst *);
-extern void choose_stairs(xchar *, xchar *, boolean);
+extern void choose_stairs(coordxy *, coordxy *, boolean);
extern int tactics(struct monst *);
extern boolean has_aggravatables(struct monst *);
extern void aggravate(void);
extern void worm_nomove(struct monst *);
extern void wormgone(struct monst *);
extern int wormhitu(struct monst *);
-extern void cutworm(struct monst *, xchar, xchar, boolean);
+extern void cutworm(struct monst *, coordxy, coordxy, boolean);
extern void see_wsegs(struct monst *);
extern void detect_wsegs(struct monst *, boolean);
extern void save_worm(NHFILE *);
extern void sanity_check_worm(struct monst *);
extern void wormno_sanity_check(void);
extern void remove_worm(struct monst *);
-extern void place_worm_tail_randomly(struct monst *, xchar, xchar);
+extern void place_worm_tail_randomly(struct monst *, coordxy, coordxy);
extern int size_wseg(struct monst *);
extern int count_wsegs(struct monst *);
extern boolean worm_known(struct monst *);
extern int bhitm(struct monst *, struct obj *);
extern void release_hold(void);
extern void probe_monster(struct monst *);
-extern boolean get_obj_location(struct obj *, xchar *, xchar *, int);
-extern boolean get_mon_location(struct monst *, xchar *, xchar *, int);
+extern boolean get_obj_location(struct obj *, coordxy *, coordxy *, int);
+extern boolean get_mon_location(struct monst *, coordxy *, coordxy *, int);
extern struct monst *get_container_location(struct obj * obj, int *, int *);
extern struct monst *montraits(struct obj *, coord *, boolean);
extern struct monst *revive(struct obj *, boolean);
extern struct monst *boomhit(struct obj *, int, int);
extern int zhitm(struct monst *, int, int, struct obj **);
extern int burn_floor_objects(int, int, boolean, boolean);
-extern void buzz(int, int, xchar, xchar, int, int);
-extern void dobuzz(int, int, xchar, xchar, int, int, boolean);
-extern void melt_ice(xchar, xchar, const char *);
-extern void start_melt_ice_timeout(xchar, xchar, long);
+extern void buzz(int, int, coordxy, coordxy, int, int);
+extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean);
+extern void melt_ice(coordxy, coordxy, const char *);
+extern void start_melt_ice_timeout(coordxy, coordxy, long);
extern void melt_ice_away(union any *, long);
-extern int zap_over_floor(xchar, xchar, int, boolean *, short);
+extern int zap_over_floor(coordxy, coordxy, int, boolean *, short);
extern void fracture_rock(struct obj *);
extern boolean break_statue(struct obj *);
extern boolean u_adtyp_resistance_obj(int);
#endif /* DUMB */
/*
- * type xchar: small integers (typedef'd as signed char,
- * so in the range -127 - 127), usually coordinates.
+ * type xint8: small integers (typedef'd as signed,
+ * in the range -127 - 127).
*/
-typedef schar xchar;
+typedef int8_t xint8;
+/*
+ * type coordxy: integers (typedef'd as signed,
+ * in the range −32768 to 32767), mostly coordinates.
+ * Note that in 2022, screen coordinates easily
+ * surpass an upper limit of 127.
+ */
+typedef int16_t coordxy;
+/*
+ * type xint16: integers (typedef'd as signed,
+ * in the range −32768 to 32767), non-coordinates.
+ */
+typedef int16_t xint16;
#ifdef __MINGW32__
/* Resolve conflict with Qt 5 and MinGW-w32 */
typedef unsigned char boolean; /* 0 or 1 */
#else
#ifndef SKIP_BOOLEAN
-typedef xchar boolean; /* 0 or 1 */
+typedef schar boolean; /* 0 or 1 */
#endif
#endif
/* lev_region from sp_lev.h */
typedef struct {
struct {
- xchar x1, y1, x2, y2;
+ coordxy x1, y1, x2, y2;
} inarea;
struct {
- xchar x1, y1, x2, y2;
+ coordxy x1, y1, x2, y2;
} delarea;
boolean in_islev, del_islev;
- xchar rtype, padding;
+ coordxy rtype, padding;
Str_or_Len rname;
} lev_region;
char *str; /* result of loot_xname(obj) in some cases, otherwise null */
int indx; /* signed int, because sortloot()'s qsort comparison routine
assumes (a->indx - b->indx) might yield a negative result */
- xchar orderclass; /* order rather than object class; 0 => not yet init'd */
- xchar subclass; /* subclass for some classes */
- xchar disco; /* discovery status */
+ xint16 orderclass; /* order rather than object class; 0 => not yet init'd */
+ xint16 subclass; /* subclass for some classes */
+ xint16 disco; /* discovery status */
};
typedef struct sortloot_item Loot;
#define GD_DESTROYGOLD 0x02
struct fakecorridor {
- xchar fx, fy;
+ coordxy fx, fy;
schar ftyp; /* from struct rm's typ */
uchar flags; /* also from struct rm; an unsigned 5-bit field there */
};
struct egd {
int fcbeg, fcend; /* fcend: first unused pos */
int vroom; /* room number of the vault */
- xchar gdx, gdy; /* goal of guard's walk */
- xchar ogx, ogy; /* guard's last position */
+ coordxy gdx, gdy; /* goal of guard's walk */
+ coordxy ogx, ogy; /* guard's last position */
d_level gdlevel; /* level (& dungeon) guard was created in */
- xchar warncnt; /* number of warnings to follow */
+ xint16 warncnt; /* number of warnings to follow */
Bitfield(gddone, 1); /* true iff guard has released player */
Bitfield(witness, 2); /* the guard saw you do something */
Bitfield(unused, 5);
/* mkroom.h - types and structures for room and shop initialization */
struct mkroom {
- xchar lx, hx, ly, hy; /* usually xchar, but hx may be -1 */
+ coordxy lx, hx, ly, hy; /* usually coordxy, but hx may be -1 */
schar rtype; /* type of room (zoo, throne, etc...) */
schar orig_rtype; /* same as rtype, but not zeroed later */
schar rlit; /* is the room lit ? */
uchar m_lev; /* adjusted difficulty level of monster */
aligntyp malign; /* alignment of this monster, relative to the
player (positive = good to kill) */
- xchar mx, my;
- xchar mux, muy; /* where the monster thinks you are */
+ coordxy mx, my;
+ coordxy mux, muy; /* where the monster thinks you are */
#define MTSZ 4
/* mtrack[0..2] is used to keep extra data when migrating the monster */
coord mtrack[MTSZ]; /* monster track */
#define STRAT_XMASK 0x00ff0000L
#define STRAT_YMASK 0x0000ff00L
#define STRAT_GOAL 0x000000ffL
-#define STRAT_GOALX(s) ((xchar) ((s & STRAT_XMASK) >> 16))
-#define STRAT_GOALY(s) ((xchar) ((s & STRAT_YMASK) >> 8))
+#define STRAT_GOALX(s) ((coordxy) ((s & STRAT_XMASK) >> 16))
+#define STRAT_GOALY(s) ((coordxy) ((s & STRAT_YMASK) >> 8))
long mtrapseen; /* bitmap of traps we've been trapped in */
long mlstmv; /* for catching up with lost time */
struct obj *minvent; /* mon's inventory */
struct obj *mw; /* mon's weapon */
long misc_worn_check; /* mon's wornmask */
- xchar weapon_check; /* flag for whether to try switching weapons */
+ xint16 weapon_check; /* flag for whether to try switching weapons */
int meating; /* monster is eating timeout */
struct mextra *mextra; /* point to mextra struct */
struct obj *cobj; /* contents list for containers */
unsigned o_id;
- xchar ox, oy;
+ coordxy ox, oy;
short otyp; /* object class number */
unsigned owt;
long quan; /* number of items */
char invlet; /* designation in inventory */
char oartifact; /* artifact array index */
- xchar where; /* where the object thinks it is */
+ xint8 where; /* where the object thinks it is */
#define OBJ_FREE 0 /* object not attached to anything */
#define OBJ_FLOOR 1 /* object on floor */
#define OBJ_CONTAINED 2 /* object in a container */
#define OBJ_ONBILL 7 /* object on shk bill */
#define OBJ_LUAFREE 8 /* object has been dealloc'd, but is ref'd by lua */
#define NOBJ_STATES 9
- xchar timed; /* # of fuses (timers) attached to this obj */
+ xint16 timed; /* # of fuses (timers) attached to this obj */
Bitfield(cursed, 1);
Bitfield(blessed, 1);
* overloaded for the destination of migrating
* objects (which can't be worn at same time) */
unsigned lua_ref_cnt; /* # of lua script references for this object */
- xchar omigr_from_dnum; /* where obj is migrating from */
- xchar omigr_from_dlevel; /* where obj is migrating from */
+ xint16 omigr_from_dnum; /* where obj is migrating from */
+ xint16 omigr_from_dlevel; /* where obj is migrating from */
struct oextra *oextra; /* pointer to oextra struct */
};
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 59
+#define EDITLEVEL 60
/*
* Development status possibilities.
#define RECT_H
typedef struct nhrect {
- xchar lx, ly;
- xchar hx, hy;
+ coordxy lx, ly;
+ coordxy hx, hy;
} NhRect;
#endif /* RECT_H */
/* date+time in string of digits rather than binary */
char when[4 + 2 + 2 + 2 + 2 + 2 + 1]; /* "YYYYMMDDhhmmss\0" */
/* final resting place spot */
- xchar frpx, frpy;
+ coordxy frpx, frpy;
boolean bonesknown;
};
/* The hero's skill in various weapons. */
struct skills {
- xchar skill;
- xchar max_skill;
+ xint16 skill;
+ xint16 max_skill;
unsigned short advance;
};
/* Initial skill matrix structure; used in u_init.c and weapon.c */
struct def_skill {
- xchar skill;
- xchar skmax;
+ xint16 skill;
+ xint16 skmax;
};
#endif /* SKILLS_H */
#define packed_coord long
typedef uint32_t getloc_flags_t;
typedef struct {
- xchar is_random;
+ xint16 is_random;
getloc_flags_t getloc_flags;
int x, y;
} unpacked_coord;
typedef struct {
- xchar init_style; /* one of LVLINIT_foo */
+ xint16 init_style; /* one of LVLINIT_foo */
long flags;
schar filling;
boolean init_present, padding;
char fg, bg;
boolean smoothed, joined;
- xchar lit, walled;
+ xint16 lit, walled;
boolean icedpools;
int corrwid, wallthick;
boolean rm_deadends;
} lev_init;
typedef struct {
- xchar wall, pos, secret, mask;
+ xint16 wall, pos, secret, mask;
} room_door;
typedef struct {
packed_coord coord;
- xchar x, y, type;
+ coordxy x, y;
+ xint16 type;
boolean spider_on_web;
boolean seen;
} spltrap;
short id;
unsigned int sp_amask; /* splev amask */
packed_coord coord;
- xchar x, y, class, appear;
+ coordxy x, y;
+ xint16 class, appear;
schar peaceful, asleep;
short female, invis, cancelled, revived, avenge, fleeing, blinded,
paralyzed, stunned, confused, waiting;
int corpsenm;
short id, spe;
packed_coord coord;
- xchar x, y, class, containment;
+ coordxy x, y;
+ xint16 class, containment;
schar curse_state;
int quan;
short buried;
typedef struct {
packed_coord coord;
- xchar x, y;
+ coordxy x, y;
unsigned int sp_amask; /* splev amask */
- xchar shrine;
+ xint16 shrine;
} altar;
typedef struct {
- xchar x1, y1, x2, y2;
- xchar rtype, rlit, rirreg;
+ coordxy x1, y1, x2, y2;
+ xint16 rtype, rlit, rirreg;
} region;
typedef struct {
- xchar ter, tlit;
+ xint16 ter, tlit;
} terrain;
typedef struct {
struct {
- xchar room;
- xchar wall;
- xchar door;
+ xint16 room;
+ xint16 wall;
+ xint16 door;
} src, dest;
} corridor;
typedef struct _room {
Str_or_Len name;
Str_or_Len parent;
- xchar x, y, w, h;
- xchar xalign, yalign;
- xchar rtype, chance, rlit, needfill;
+ coordxy x, y;
+ xint16 w, h;
+ xint16 xalign, yalign;
+ xint16 rtype, chance, rlit, needfill;
boolean joined;
} room;
struct spell {
short sp_id; /* spell id (== object.otyp) */
- xchar sp_lev; /* power level */
+ xint16 sp_lev; /* power level */
int sp_know; /* knowlege of spell */
};
#define CHAR_P char
#define SCHAR_P schar
#define UCHAR_P uchar
-#define XCHAR_P xchar
+#define XCHAR_P coordxy
#define SHORT_P short
#ifndef SKIP_BOOLEAN
#define BOOLEAN_P boolean
struct trap {
struct trap *ntrap;
- xchar tx, ty;
+ coordxy tx, ty;
d_level dst; /* destination for portals */
coord launch;
Bitfield(ttyp, 5);
struct map_info_t {
Dimension viewport_width, /* Saved viewport size, so we can */
viewport_height; /* clip to cursor on a resize. */
- xchar t_start[ROWNO], /* Starting column for new info. */
+ coordxy t_start[ROWNO], /* Starting column for new info. */
t_stop[ROWNO]; /* Ending column for new info. */
boolean is_tile; /* true if currently using tiles */
#ifdef CLIPPING
extern void X11_cliparound(int, int);
#endif
-extern void X11_print_glyph(winid, xchar, xchar, const glyph_info *,
+extern void X11_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *);
extern void X11_raw_print(const char *);
extern void X11_raw_print_bold(const char *);
* tty-style windows also, then things will need to change. */
/* per-window data */
struct amii_WinDesc {
- xchar type; /* type of window */
+ xint16 type; /* type of window */
struct amii_menu menu;
boolean active; /* true if window is active */
boolean wasup; /* true if menu/text window was already open */
short
disprows; /* Rows displayed so far (used for paging in message win) */
- xchar offx, offy; /* offset from topleft of display */
+ coordxy offx, offy; /* offset from topleft of display */
short vwx, vwy, vcx, vcy; /* View cursor location */
short rows, cols; /* dimensions */
short curx, cury; /* current cursor position */
extern void curses_mark_synch(void);
extern void curses_wait_synch(void);
extern void curses_cliparound(int x, int y);
-extern void curses_print_glyph(winid wid, xchar x, xchar y,
+extern void curses_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *, const glyph_info *);
extern void curses_raw_print(const char *str);
extern void curses_raw_print_bold(const char *str);
#ifdef POSITIONBAR
void (*win_update_positionbar)(char *);
#endif
- void (*win_print_glyph)(winid, xchar, xchar,
+ void (*win_print_glyph)(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
void (*win_raw_print)(const char *);
void (*win_raw_print_bold)(const char *);
#ifdef POSITIONBAR
void (*win_update_positionbar)(CARGS, char *);
#endif
- void (*win_print_glyph)(CARGS, winid, xchar, xchar,
+ void (*win_print_glyph)(CARGS, winid, coordxy, coordxy,
const glyph_info *,
const glyph_info *);
void (*win_raw_print)(CARGS, const char *);
#ifdef POSITIONBAR
extern void safe_update_positionbar(char *);
#endif
-extern void safe_print_glyph(winid, xchar, xchar,
+extern void safe_print_glyph(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
extern void safe_raw_print(const char *);
extern void safe_raw_print_bold(const char *);
/* descriptor for tty-based windows */
struct WinDesc {
int flags; /* window flags */
- xchar type; /* type of window */
+ xint16 type; /* type of window */
boolean active; /* true if window is active */
short offx, offy; /* offset from topleft of display */
long rows, cols; /* dimensions */
#ifdef POSITIONBAR
E void tty_update_positionbar(char *);
#endif
-E void tty_print_glyph(winid, xchar, xchar, const glyph_info *,
+E void tty_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *);
E void tty_raw_print(const char *);
E void tty_raw_print_bold(const char *);
struct RoleAdvance {
/* "fix" is the fixed amount, "rnd" is the random amount */
- xchar infix, inrnd; /* at character initialization */
- xchar lofix, lornd; /* gained per level < g.urole.xlev */
- xchar hifix, hirnd; /* gained per level >= g.urole.xlev */
+ xint16 infix, inrnd; /* at character initialization */
+ xint16 lofix, lornd; /* gained per level < g.urole.xlev */
+ xint16 hifix, hirnd; /* gained per level >= g.urole.xlev */
};
struct u_have {
#define ROLE_CHAOTIC AM_CHAOTIC
/*** Attributes (from attrib.c and exper.c) ***/
- xchar attrbase[A_MAX]; /* lowest initial attributes */
- xchar attrdist[A_MAX]; /* distribution of initial attributes */
+ xint16 attrbase[A_MAX]; /* lowest initial attributes */
+ xint16 attrdist[A_MAX]; /* distribution of initial attributes */
struct RoleAdvance hpadv; /* hit point advancement */
struct RoleAdvance enadv; /* energy advancement */
- xchar xlev; /* cutoff experience level */
- xchar initrecord; /* initial alignment record */
+ xint16 xlev; /* cutoff experience level */
+ xint16 initrecord; /* initial alignment record */
/*** Spell statistics (from spell.c) ***/
int spelbase; /* base spellcasting penalty */
hatemask; /* bit mask of always hostile */
/*** Attributes ***/
- xchar attrmin[A_MAX]; /* minimum allowable attribute */
- xchar attrmax[A_MAX]; /* maximum allowable attribute */
+ xint16 attrmin[A_MAX]; /* minimum allowable attribute */
+ xint16 attrmax[A_MAX]; /* maximum allowable attribute */
struct RoleAdvance hpadv; /* hit point advancement */
struct RoleAdvance enadv; /* energy advancement */
#if 0 /* DEFERRED */
/*** Information about the player ***/
struct you {
- xchar ux, uy; /* current map coordinates */
+ coordxy ux, uy; /* current map coordinates */
schar dx, dy, dz; /* direction of move (or zap or ... ) */
schar di; /* direction of FF */
- xchar tx, ty; /* destination of travel */
- xchar ux0, uy0; /* initial position FF */
+ coordxy tx, ty; /* destination of travel */
+ coordxy ux0, uy0; /* initial position FF */
d_level uz, uz0; /* your level on this and the previous turn */
d_level utolev; /* level monster teleported you to, or uz */
uchar utotype; /* bitmask of goto_level() flags for utolev */
uhppeak; /* highest value of uhpmax so far */
int uen, uenmax, /* magical energy, aka spell power */
uenpeak; /* highest value of uenmax so far */
- xchar uhpinc[MAXULEV], /* increases to uhpmax for each level gain */
+ xint16 uhpinc[MAXULEV], /* increases to uhpmax for each level gain */
ueninc[MAXULEV]; /* increases to uenmax for each level gain */
int ugangr; /* if the gods are angry at you */
int ugifts; /* number of artifacts bestowed */
int ugrave_arise; /* you die and become something aside from a ghost */
int weapon_slots; /* unused skill slots */
int skills_advanced; /* # of advances made so far */
- xchar skill_record[P_SKILL_LIMIT]; /* skill advancements */
+ xint16 skill_record[P_SKILL_LIMIT]; /* skill advancements */
struct skills weapon_skills[P_NUM_SKILLS];
boolean twoweap; /* KMH -- Using two-weapon combat */
short mcham; /* vampire mndx if shapeshifted to bat/cloud */
if (!u.uinvulnerable) {
if (Teleportation && !rn2(85)) {
- xchar old_ux = u.ux, old_uy = u.uy;
+ coordxy old_ux = u.ux, old_uy = u.uy;
tele();
if (u.ux != old_ux || u.uy != old_uy) {
}
boolean
-um_dist(xchar x, xchar y, xchar n)
+um_dist(coordxy x, coordxy y, xint16 n)
{
return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
}
}
void
-check_leash(xchar x, xchar y)
+check_leash(coordxy x, coordxy y)
{
register struct obj *otmp;
register struct monst *mtmp;
if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
&& otmp->lamplit) {
char buf[BUFSZ];
- xchar x, y;
+ coordxy x, y;
boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
(void) get_obj_location(otmp, &x, &y, 0);
boolean
snuff_lit(struct obj *obj)
{
- xchar x, y;
+ coordxy x, y;
if (obj->lamplit) {
if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
/* don't assume that lit lantern has been swallowed;
a nymph might have stolen it or picked it up */
&& ((mtmp = obj->ocarry), humanoid(mtmp->data))) {
- xchar x, y;
+ coordxy x, y;
useeit = get_obj_location(obj, &x, &y, 0) && cansee(x, y);
uhearit = couldsee(x, y) && distu(x, y) < 5 * 5;
boolean
catch_lit(struct obj *obj)
{
- xchar x, y;
+ coordxy x, y;
if (!obj->lamplit && ignitable(obj) && get_obj_location(obj, &x, &y, 0)) {
if (((obj->otyp == MAGIC_LAMP /* spe==0 => no djinni inside */
static boolean
figurine_location_checks(struct obj *obj, coord *cc, boolean quietly)
{
- xchar x, y;
+ coordxy x, y;
if (carried(obj) && u.uswallow) {
if (!quietly)
use_figurine(struct obj **optr)
{
register struct obj *obj = *optr;
- xchar x, y;
+ coordxy x, y;
coord cc;
if (u.uswallow) {
static struct arti_info artiexist[1 + NROFARTIFACTS];
/* discovery list; for N discovered artifacts, the first N entries are ART_xx
values in discovery order, the remaining (NROFARTIFACTS-N) slots are 0 */
-static xchar artidisco[NROFARTIFACTS];
+static xint16 artidisco[NROFARTIFACTS];
/* note: artiexist[] and artidisco[] don't need to be in struct g; they
* get explicitly initialized at game start so don't need to be part of
* bulk re-init if game restart ever gets implemented. They are saved
/* add identified artifact to discoveries list */
void
-discover_artifact(xchar m)
+discover_artifact(xint16 m)
{
int i;
/* used to decide whether an artifact has been fully identified */
boolean
-undiscovered_artifact(xchar m)
+undiscovered_artifact(xint16 m)
{
int i;
hp = 1;
if (u.ulevel < MAXULEV) {
/* remember increment; future level drain could take it away again */
- u.uhpinc[u.ulevel] = (xchar) hp;
+ u.uhpinc[u.ulevel] = (xint16) hp;
} else {
/* after level 30, throttle hit point gains from extra experience;
once max reaches 1200, further increments will be just 1 more */
* Should not be called while swallowed.
*/
void
-move_bc(int before, int control, xchar ballx, xchar bally,
- xchar chainx, xchar chainy)
+move_bc(int before, int control, coordxy ballx, coordxy bally,
+ coordxy chainx, coordxy chainy)
{
if (Blind) {
/*
/* return TRUE if the caller needs to place the ball and chain down again */
boolean
-drag_ball(xchar x, xchar y, int *bc_control,
- xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy,
+drag_ball(coordxy x, coordxy y, int *bc_control,
+ coordxy *ballx, coordxy *bally, coordxy *chainx, coordxy *chainy,
boolean *cause_delay, boolean allow_drag)
{
struct trap *t = (struct trap *) 0;
/* only need to move the chain? */
if (carried(uball) || distmin(x, y, uball->ox, uball->oy) <= 2) {
- xchar oldchainx = uchain->ox, oldchainy = uchain->oy;
+ coordxy oldchainx = uchain->ox, oldchainy = uchain->oy;
*bc_control = BC_CHAIN;
move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy);
* 0
*/
case 5: {
- xchar tempx, tempy, tempx2, tempy2;
+ coordxy tempx, tempy, tempx2, tempy2;
/* find position closest to current position of chain;
no effect if current position is already OK */
*ballx = *chainx = x;
*bally = *chainy = y;
} else {
- xchar newchainx = u.ux, newchainy = u.uy;
+ coordxy newchainx = u.ux, newchainy = u.uy;
/*
* Generally, chain moves to hero's previous location and ball
* Should not be called while swallowed.
*/
void
-drop_ball(xchar x, xchar y)
+drop_ball(coordxy x, coordxy y)
{
if (Blind) {
/* get the order */
if (otmp->oclass == FOOD_CLASS && otmp->oeaten) {
struct obj *top;
char *p;
- xchar ox, oy;
+ coordxy ox, oy;
for (top = otmp; top->where == OBJ_CONTAINED;
top = top->ocontainer)
wiz_where(void)
{
if (wizard)
- (void) print_dungeon(FALSE, (schar *) 0, (xchar *) 0);
+ (void) print_dungeon(FALSE, (schar *) 0, (xint16 *) 0);
else
pline(unavailcmd, ecname_from_fn(wiz_where));
return ECMD_OK;
get_adjacent_loc(
const char *prompt,
const char *emsg,
- xchar x, xchar y,
+ coordxy x, coordxy y,
coord *cc)
{
- xchar new_x, new_y;
+ coordxy new_x, new_y;
if (!getdir(prompt)) {
pline1(Never_mind);
return 0;
}
static int
-there_cmd_menu_far(winid win, xchar x, xchar y, int mod)
+there_cmd_menu_far(winid win, coordxy x, coordxy y, int mod)
{
int K = 0;
static int
there_cmd_menu_common(
winid win,
- xchar x UNUSED, xchar y UNUSED,
+ coordxy x UNUSED, coordxy y UNUSED,
int mod,
int *act UNUSED)
{
static void do_entity(struct entity *);
boolean
-is_waterwall(xchar x, xchar y)
+is_waterwall(coordxy x, coordxy y)
{
if (isok(x, y) && IS_WATERWALL(levl[x][y].typ))
return TRUE;
static void do_dknown_of(struct obj *);
static boolean check_map_spot(int, int, char, unsigned);
static boolean clear_stale_map(char, unsigned);
-static void sense_trap(struct trap *, xchar, xchar, int);
+static void sense_trap(struct trap *, coordxy, coordxy, int);
static int detect_obj_traps(struct obj *, boolean, int);
static void display_trap_map(struct trap *, int);
static int furniture_detect(void);
}
static void
-sense_trap(struct trap *trap, xchar x, xchar y, int src_cursed)
+sense_trap(struct trap *trap, coordxy x, coordxy y, int src_cursed)
{
if (Hallucination || src_cursed) {
struct obj obj; /* fake object */
int how) /* 1 for misleading map feedback */
{
struct obj *otmp;
- xchar x, y;
+ coordxy x, y;
int result = OTRAP_NONE;
/*
int
dosearch0(int aflag) /* intrinsic autosearch vs explicit searching */
{
- xchar x, y;
+ coordxy x, y;
register struct trap *trap;
register struct monst *mtmp;
#include "hack.h"
static boolean rm_waslit(void);
-static void mkcavepos(xchar, xchar, int, boolean, boolean);
+static void mkcavepos(coordxy, coordxy, int, boolean, boolean);
static void mkcavearea(boolean);
static int dig(void);
static void dig_up_grave(coord *);
static boolean
rm_waslit(void)
{
- register xchar x, y;
+ register coordxy x, y;
if (levl[u.ux][u.uy].typ == ROOM && levl[u.ux][u.uy].waslit)
return TRUE;
* immediately after the effect is complete.
*/
static void
-mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit)
+mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit)
{
register struct rm *lev;
mkcavearea(boolean rockit)
{
int dist;
- xchar xmin = u.ux, xmax = u.ux;
- xchar ymin = u.uy, ymax = u.uy;
- register xchar i;
+ coordxy xmin = u.ux, xmax = u.ux;
+ coordxy ymin = u.uy, ymax = u.uy;
+ register coordxy i;
register boolean waslit = rm_waslit();
if (rockit)
/* When digging into location <x,y>, what are you actually digging into? */
int
-dig_typ(struct obj *otmp, xchar x, xchar y)
+dig_typ(struct obj *otmp, coordxy x, coordxy y)
{
boolean ispick;
dig(void)
{
struct rm *lev;
- xchar dpx = g.context.digging.pos.x, dpy = g.context.digging.pos.y;
+ coordxy dpx = g.context.digging.pos.x, dpy = g.context.digging.pos.y;
boolean ispick = uwep && is_pick(uwep);
const char *verb = (!uwep || is_pick(uwep)) ? "dig into" : "chop through";
* in apply.c.
*/
void
-liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp,
+liquid_flow(coordxy x, coordxy y, schar typ, struct trap *ttmp,
const char *fillmsg)
{
struct obj *objchain;
struct rm *lev;
struct obj *boulder_here;
schar typ, old_typ;
- xchar dig_x, dig_y;
+ coordxy dig_x, dig_y;
boolean nohole, retval = FALSE;
if (!cc) {
dig_up_grave(coord *cc)
{
struct obj *otmp;
- xchar dig_x, dig_y;
+ coordxy dig_x, dig_y;
if (!cc) {
dig_x = u.ux;
* zap == TRUE if wand/spell of digging, FALSE otherwise (chewing)
*/
void
-watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap)
+watch_dig(struct monst *mtmp, coordxy x, coordxy y, boolean zap)
{
struct rm *lev = &levl[x][y];
void
rot_corpse(anything *arg, long timeout)
{
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
struct obj *obj = arg->a_obj;
boolean on_floor = obj->where == OBJ_FLOOR,
in_invent = obj->where == OBJ_INVENT;
#include "hack.h"
static void show_mon_or_warn(int, int, int);
-static void display_monster(xchar, xchar, struct monst *, int, boolean);
+static void display_monster(coordxy, coordxy, struct monst *, int, boolean);
static int swallow_to_glyph(int, int);
static void display_warning(struct monst *);
static int check_pos(int, int, int);
-static int get_bk_glyph(xchar x, xchar y);
+static int get_bk_glyph(coordxy x, coordxy y);
static int tether_glyph(int, int);
static void mimic_light_blocking(struct monst *);
#ifdef UNBUFFERED_GLYPHINFO
-static glyph_info *glyphinfo_at(xchar, xchar, int);
+static glyph_info *glyphinfo_at(coordxy, coordxy, int);
#endif
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
* attention to and correct unexplored, lit ROOM and CORR spots.
*/
void
-magic_map_background(xchar x, xchar y, int show)
+magic_map_background(coordxy x, coordxy y, int show)
{
int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */
struct rm *lev = &levl[x][y];
* having to create fake objects and traps. However, I am reluctant to
* make this change.
*/
-/* FIXME: some of these use xchars for x and y, and some use ints. Make
+/* FIXME: some of these use coordxys for x and y, and some use ints. Make
* this consistent.
*/
* the hero can physically see the location. Update the screen if directed.
*/
void
-map_background(register xchar x, register xchar y, register int show)
+map_background(register coordxy x, register coordxy y, register int show)
{
register int glyph = back_to_glyph(x, y);
* by newsym() if necessary.
*/
void
-map_invisible(register xchar x, register xchar y)
+map_invisible(register coordxy x, register coordxy y)
{
if (x != u.ux || y != u.uy) { /* don't display I at hero's location */
if (g.level.flags.hero_memory)
*
*/
static void
-display_monster(xchar x, xchar y, /* display position */
+display_monster(coordxy x, coordxy y, /* display position */
struct monst *mon, /* monster to display */
int sightflags, /* 1 if the monster is physically seen;
2 if detected using Detect_monsters */
* When hero knows what happened to location, even when blind.
*/
void
-feel_newsym(xchar x, xchar y)
+feel_newsym(coordxy x, coordxy y)
{
if (Blind)
feel_location(x, y);
* searching only finds one monster per turn so we must check that separately.
*/
void
-feel_location(xchar x, xchar y)
+feel_location(coordxy x, coordxy y)
{
struct rm *lev;
struct obj *boulder;
* pulled into a platform dependent routine for fancier graphics if desired.
*/
void
-shieldeff(xchar x, xchar y)
+shieldeff(coordxy x, coordxy y)
{
register int i;
void
swallowed(int first)
{
- static xchar lastx, lasty; /* last swallowed position */
+ static coordxy lastx, lasty; /* last swallowed position */
int swallower, left_ok, rght_ok;
if (first) {
void
under_water(int mode)
{
- static xchar lastx, lasty;
+ static coordxy lastx, lasty;
static boolean dela;
register int x, y;
void
reglyph_darkroom(void)
{
- xchar x, y;
+ coordxy x, y;
for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) {
* variables.
*/
int
-back_to_glyph(xchar x, xchar y)
+back_to_glyph(coordxy x, coordxy y)
{
int idx, bypass_glyph = NO_GLYPH;
struct rm *ptr = &(levl[x][y]);
* structure, so we must check the "third screen".
*/
int
-glyph_at(xchar x, xchar y)
+glyph_at(coordxy x, coordxy y)
{
if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO)
return cmap_to_glyph(S_room); /* XXX */
#ifdef UNBUFFERED_GLYPHINFO
glyph_info *
-glyphinfo_at(xchar x, xchar y, int glyph)
+glyphinfo_at(coordxy x, coordxy y, int glyph)
{
map_glyphinfo(x, y, glyph, 0, &ginfo);
return &ginfo;
*/
static int
-get_bk_glyph(xchar x, xchar y)
+get_bk_glyph(coordxy x, coordxy y)
{
int idx, bkglyph = GLYPH_UNEXPLORED;
struct rm *lev = &levl[x][y];
void
map_glyphinfo(
- xchar x, xchar y,
+ coordxy x, coordxy y,
int glyph,
unsigned mgflags,
glyph_info *glyphinfo)
static NHFILE *currentlevel_rewrite(void);
static void final_level(void);
-/* static boolean badspot(xchar,xchar); */
+/* static boolean badspot(coordxy,coordxy); */
/* the #drop command: drop one inventory item */
int
/*
static boolean
-badspot(register xchar x, register xchar y)
+badspot(register coordxy x, register coordxy y)
{
return (boolean) ((levl[x][y].typ != ROOM
&& levl[x][y].typ != AIR
{
int l_idx, save_mode;
NHFILE *nhfp;
- xchar new_ledger;
+ xint16 new_ledger;
boolean cant_go_back, great_effort,
up = (depth(newlevel) < depth(&u.uz)),
newdungeon = (u.uz.dnum != newlevel->dnum),
{
struct monst *mtmp, *mcarry;
boolean is_uwep, chewed;
- xchar where;
+ xint16 where;
char cname[BUFSZ];
struct obj *container = (struct obj *) 0;
int container_where = 0;
struct obj *body = arg->a_obj;
struct permonst *mptr = &mons[body->corpsenm];
struct monst *mtmp;
- xchar x, y;
+ coordxy x, y;
/* corpse will revive somewhere else if there is a monster in the way;
Riders get a chance to try to bump the obstacle out of their way */
}
struct monst *
-make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly)
+make_familiar(struct obj *otmp, coordxy x, coordxy y, boolean quietly)
{
struct permonst *pm;
struct monst *mtmp = 0;
mon_arrive(struct monst *mtmp, boolean with_you)
{
struct trap *t;
- xchar xlocale, ylocale, xyloc, xyflags, wander;
+ coordxy xlocale, ylocale, xyloc, xyflags;
+ xint16 wander;
int num_segs;
boolean failed_to_place = FALSE;
stairway *stway;
mtmp->mlstmv = g.moves - 1L;
/* let monster move a bit on new level (see placement code below) */
- wander = (xchar) min(nmv, 8);
+ wander = (xint16) min(nmv, 8);
} else
wander = 0;
void
migrate_to_level(
struct monst *mtmp,
- xchar tolev, /* destination level */
- xchar xyloc, /* MIGR_xxx destination xy location: */
+ xint16 tolev, /* destination level */
+ xint16 xyloc, /* MIGR_xxx destination xy location: */
coord *cc) /* optional destination coordinates */
{
d_level new_lev;
- xchar xyflags, mx = mtmp->mx, my = mtmp->my; /* <mx,my> needed below */
+ coordxy xyflags;
+ coordxy mx = mtmp->mx, my = mtmp->my; /* <mx,my> needed below */
int num_segs; /* count of worm segments */
if (mtmp->mleashed) {
relmon(mtmp, &g.migrating_mons); /* mtmp->mx,my retain their value */
mtmp->mstate |= MON_MIGRATING;
- new_lev.dnum = ledger_to_dnum((xchar) tolev);
- new_lev.dlevel = ledger_to_dlev((xchar) tolev);
+ new_lev.dnum = ledger_to_dnum((xint16) tolev);
+ new_lev.dlevel = ledger_to_dlev((xint16) tolev);
/* overload mtmp->[mx,my], mtmp->[mux,muy], and mtmp->mtrack[] as
destination codes */
xyflags = (depth(&new_lev) < depth(&u.uz)); /* 1 => up */
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 *, xchar, xchar, xchar,
- xchar);
-static boolean could_reach_item(struct monst *, xchar, xchar);
+static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy,
+ coordxy);
+static boolean could_reach_item(struct monst *, coordxy, coordxy);
static void quickmimic(struct monst *);
/* pick a carried item for pet to drop */
register int omx, omy;
boolean in_masters_sight, dog_has_minvent;
register struct obj *obj;
- xchar otyp;
+ xint16 otyp;
int appr;
/* Steeds don't move on their own will */
int i, j, k;
register struct edog *edog = EDOG(mtmp);
struct obj *obj = (struct obj *) 0;
- xchar otyp;
+ xint16 otyp;
boolean has_edog, cursemsg[9], do_eat = FALSE;
boolean better_with_displacing = FALSE;
- xchar nix, niy; /* position mtmp is (considering) moving to */
+ coordxy nix, niy; /* position mtmp is (considering) moving to */
register int nx, ny; /* temporary coordinates */
- xchar cnt, uncursedcnt, chcnt;
+ xint16 cnt, uncursedcnt, chcnt;
int chi = -1, nidist, ndist;
coord poss[9];
long info[9], allowflags;
/* check if a monster could pick up objects from a location */
static boolean
-could_reach_item(struct monst *mon, xchar nx, xchar ny)
+could_reach_item(struct monst *mon, coordxy nx, coordxy ny)
{
if ((!is_pool(nx, ny) || is_swimmer(mon->data))
&& (!is_lava(nx, ny) || likes_lava(mon->data))
* calls deep.
*/
static boolean
-can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy)
+can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordxy fy)
{
int i, j;
int dist;
/* g.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
static void kickdmg(struct monst *, boolean);
-static boolean maybe_kick_monster(struct monst *, xchar, xchar);
-static void kick_monster(struct monst *, xchar, xchar);
-static int kick_object(xchar, xchar, char *);
-static int really_kick_object(xchar, xchar);
+static boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
+static void kick_monster(struct monst *, coordxy, coordxy);
+static int kick_object(coordxy, coordxy, char *);
+static int really_kick_object(coordxy, coordxy);
static char *kickstr(char *, const char *);
static boolean watchman_thief_arrest(struct monst *);
-static boolean watchman_door_damage(struct monst *, xchar, xchar);
+static boolean watchman_door_damage(struct monst *, coordxy, coordxy);
static void kick_dumb(int, int);
static void kick_ouch(int, int, const char *);
static void otransit_msg(struct obj *, boolean, boolean, long);
-static void drop_to(coord *, schar, xchar, xchar);
+static void drop_to(coord *, schar, coordxy, coordxy);
static const char kick_passes_thru[] = "kick passes harmlessly through";
}
static boolean
-maybe_kick_monster(struct monst *mon, xchar x, xchar y)
+maybe_kick_monster(struct monst *mon, coordxy x, coordxy y)
{
if (mon) {
boolean save_forcefight = g.context.forcefight;
}
static void
-kick_monster(struct monst *mon, xchar x, xchar y)
+kick_monster(struct monst *mon, coordxy x, coordxy y)
{
boolean clumsy = FALSE;
int i, j;
/* container is kicked, dropped, thrown or otherwise impacted by player.
* Assumes container is on floor. Checks contents for possible damage. */
void
-container_impact_dmg(struct obj *obj, xchar x,
- xchar y) /* coordinates where object was before the impact, not after */
+container_impact_dmg(struct obj *obj, coordxy x,
+ coordxy y) /* coordinates where object was before the impact, not after */
{
struct monst *shkp;
struct obj *otmp, *otmp2;
/* jacket around really_kick_object */
static int
-kick_object(xchar x, xchar y, char *kickobjnam)
+kick_object(coordxy x, coordxy y, char *kickobjnam)
{
int res = 0;
/* guts of kick_object */
static int
-really_kick_object(xchar x, xchar y)
+really_kick_object(coordxy x, coordxy y)
{
int range;
struct monst *mon, *shkp = 0;
}
static boolean
-watchman_door_damage(struct monst *mtmp, xchar x, xchar y)
+watchman_door_damage(struct monst *mtmp, coordxy x, coordxy y)
{
if (is_watch(mtmp->data) && mtmp->mpeaceful
&& couldsee(mtmp->mx, mtmp->my)) {
}
static void
-drop_to(coord *cc, schar loc, xchar x, xchar y)
+drop_to(coord *cc, schar loc, coordxy x, coordxy y)
{
stairway *stway = stairway_at(x, y);
/* player or missile impacts location, causing objects to fall down */
void
impact_drop(struct obj *missile, /* caused impact, won't drop itself */
- xchar x, xchar y, /* location affected */
- xchar dlev) /* if !0 send to dlev near player */
+ coordxy x, coordxy y, /* location affected */
+ xint16 dlev) /* if !0 send to dlev near player */
{
schar toloc;
register struct obj *obj, *obj2;
* otmp is either a kicked, dropped, or thrown object.
*/
boolean
-ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj)
+ship_object(struct obj *otmp, coordxy x, coordxy y, boolean shop_floor_obj)
{
schar toloc;
- xchar ox, oy;
+ coordxy ox, oy;
coord cc;
struct obj *obj;
struct trap *t;
/* migration destination for objects which fall down to next level */
schar
-down_gate(xchar x, xchar y)
+down_gate(coordxy x, coordxy y)
{
struct trap *ttmp;
stairway *stway = stairway_at(x, y);
static int gem_accept(struct monst *, struct obj *);
static void tmiss(struct obj *, struct monst *, boolean);
static int throw_gold(struct obj *);
-static void check_shop_obj(struct obj *, xchar, xchar, boolean);
+static void check_shop_obj(struct obj *, coordxy, coordxy, boolean);
static boolean harmless_missile(struct obj *);
static void breakmsg(struct obj *, boolean);
static boolean toss_up(struct obj *, boolean);
if ball is carried we might still need to drag the chain */
if (Punished) {
int bc_control;
- xchar ballx, bally, chainx, chainy;
+ coordxy ballx, bally, chainx, chainy;
boolean cause_delay;
if (drag_ball(x, y, &bc_control, &ballx, &bally, &chainx,
}
static void
-check_shop_obj(struct obj *obj, xchar x, xchar y, boolean broken)
+check_shop_obj(struct obj *obj, coordxy x, coordxy y, boolean broken)
{
boolean costly_xy;
struct monst *shkp = shop_keeper(*u.ushops);
*/
int
hero_breaks(struct obj *obj,
- xchar x, xchar y, /* object location (ox, oy may not be right) */
+ coordxy x, coordxy y, /* object location (ox, oy may not be right) */
unsigned breakflags)
{
/* from_invent: thrown or dropped by player; maybe on shop bill;
*/
int
breaks(struct obj *obj,
- xchar x, xchar y) /* object location (ox, oy may not be right) */
+ coordxy x, coordxy y) /* object location (ox, oy may not be right) */
{
boolean in_view = Blind ? FALSE : cansee(x, y);
}
void
-release_camera_demon(struct obj *obj, xchar x, xchar y)
+release_camera_demon(struct obj *obj, coordxy x, coordxy y)
{
struct monst *mtmp;
if (!rn2(3)
void
breakobj(
struct obj *obj,
- xchar x, xchar y, /* object location (ox, oy may not be right) */
+ coordxy x, coordxy y, /* object location (ox, oy may not be right) */
boolean hero_caused, /* is this the hero's fault? */
boolean from_invent)
{
int idx;
schar lev[MAXLINFO];
schar playerlev[MAXLINFO];
- xchar dgn[MAXLINFO];
+ xint16 dgn[MAXLINFO];
char menuletter;
};
#if 0
static void Fread(genericptr_t, int, int, dlb *);
#endif
-static xchar dname_to_dnum(const char *);
+static xint16 dname_to_dnum(const char *);
static int find_branch(const char *, struct proto_dungeon *);
-static xchar parent_dnum(const char *, struct proto_dungeon *);
-static int level_range(xchar, int, int, int, 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 xchar parent_dlevel(const char *, struct proto_dungeon *);
+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 xchar pick_level(boolean *, int);
+static xint16 pick_level(boolean *, int);
static boolean place_level(int, struct proto_dungeon *);
static int get_dgn_flags(lua_State *);
static boolean unplaced_floater(struct dungeon *);
static void print_mapseen(winid, mapseen *, int, int, boolean);
static boolean interest_mapseen(mapseen *);
static void traverse_mapseenchn(boolean, winid, int, int, int *);
-static const char *seen_string(xchar, const char *);
+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);
}
#endif
-static xchar
+static xint16
dname_to_dnum(const char *s)
{
- xchar i;
+ xint16 i;
for (i = 0; i < g.n_dgns; i++)
if (!strcmp(g.dungeons[i].dname, s))
panic("Couldn't resolve dungeon number for name \"%s\".", s);
/*NOT REACHED*/
- return (xchar) 0;
+ return (xint16) 0;
}
s_level *
* Find the "parent" by searching the prototype branch list for the branch
* listing, then figuring out to which dungeon it belongs.
*/
-static xchar
+static xint16
parent_dnum(const char *s, /* dungeon name */
struct proto_dungeon *pd)
{
int i;
- xchar pdnum;
+ xint16 pdnum;
i = find_branch(s, pd);
/*
panic("parent_dnum: couldn't resolve branch.");
/*NOT REACHED*/
- return (xchar) 0;
+ return (xint16) 0;
}
/*
* end of the dungeon.
*/
static int
-level_range(xchar dgn, int base, int randc, int chain,
+level_range(xint16 dgn, int base, int randc, int chain,
struct proto_dungeon *pd, int *adjusted_base)
{
int lmax = g.dungeons[dgn].num_dunlevs;
return 1;
}
-static xchar
+static xint16
parent_dlevel(const char *s, struct proto_dungeon *pd)
{
int i, j, num, base, dnum = parent_dnum(s, pd);
}
/* Pick the nth TRUE entry in the given boolean array. */
-static xchar
+static xint16
pick_level(boolean *map, /* an array MAXLEVEL+1 in size */
int nth)
{
- int i;
+ xint16 i;
for (i = 1; i <= MAXLEVEL; i++)
if (map[i] && !nth--)
- return (xchar) i;
+ return i;
panic("pick_level: ran out of valid levels");
return 0;
}
free((genericptr) dgn_themerms);
if (dgn_range)
- g.dungeons[i].num_dunlevs = (xchar) rn1(dgn_range, dgn_base);
+ g.dungeons[i].num_dunlevs = (xint16) rn1(dgn_range, dgn_base);
else
- g.dungeons[i].num_dunlevs = (xchar) dgn_base;
+ g.dungeons[i].num_dunlevs = (xint16) dgn_base;
if (!i) {
g.dungeons[i].ledger_start = 0;
}
/* return the level number for lev in *this* dungeon */
-xchar
+xint16
dunlev(d_level *lev)
{
return lev->dlevel;
}
/* return the lowest level number for *this* dungeon */
-xchar
+xint16
dunlevs_in_dungeon(d_level *lev)
{
return g.dungeons[lev->dnum].num_dunlevs;
}
/* return the lowest level explored in the game*/
-xchar
+xint16
deepest_lev_reached(boolean noquest)
{
/* this function is used for three purposes: to provide a factor
*/
register int i;
d_level tmp;
- register schar ret = 0;
+ xint16 ret = 0;
for (i = 0; i < g.n_dgns; i++) {
if (noquest && i == quest_dnum)
if (depth(&tmp) > ret)
ret = depth(&tmp);
}
- return (xchar) ret;
+ return ret;
}
/* return a bookkeeping level number for purpose of comparisons and
save/restore */
-xchar
+xint16
ledger_no(d_level *lev)
{
- return (xchar) (lev->dlevel + g.dungeons[lev->dnum].ledger_start);
+ return (xint16) (lev->dlevel + g.dungeons[lev->dnum].ledger_start);
}
/*
* not be confused with deepest_lev_reached() -- which returns the lowest
* depth visited by the player.
*/
-xchar
+xint16
maxledgerno(void)
{
- return (xchar) (g.dungeons[g.n_dgns - 1].ledger_start
+ return (xint16) (g.dungeons[g.n_dgns - 1].ledger_start
+ g.dungeons[g.n_dgns - 1].num_dunlevs);
}
/* return the dungeon that this ledgerno exists in */
-xchar
-ledger_to_dnum(xchar ledgerno)
+xint16
+ledger_to_dnum(xint16 ledgerno)
{
- register int i;
+ xint16 i;
/* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */
for (i = 0; i < g.n_dgns; i++)
if (g.dungeons[i].ledger_start < ledgerno
&& (ledgerno
<= g.dungeons[i].ledger_start + g.dungeons[i].num_dunlevs))
- return (xchar) i;
+ return i;
panic("level number out of range [ledger_to_dnum(%d)]", (int) ledgerno);
/*NOT REACHED*/
- return (xchar) 0;
+ return (xint16) 0;
}
/* return the level of the dungeon this ledgerno exists in */
-xchar
-ledger_to_dlev(xchar ledgerno)
+xint16
+ledger_to_dlev(xint16 ledgerno)
{
- return (xchar) (ledgerno
+ return (xint16) (ledgerno
- g.dungeons[ledger_to_dnum(ledgerno)].ledger_start);
}
}
boolean
-On_stairs(xchar x, xchar y)
+On_stairs(coordxy x, coordxy y)
{
return (stairway_at(x,y) != NULL);
}
boolean
-On_ladder(xchar x, xchar y)
+On_ladder(coordxy x, coordxy y)
{
stairway *stway = stairway_at(x,y);
}
boolean
-On_stairs_up(xchar x, xchar y)
+On_stairs_up(coordxy x, coordxy y)
{
stairway *stway = stairway_at(x,y);
}
boolean
-On_stairs_dn(xchar x, xchar y)
+On_stairs_dn(coordxy x, coordxy y)
{
stairway *stway = stairway_at(x,y);
get_level(d_level *newlevel, int levnum)
{
branch *br;
- xchar dgn = u.uz.dnum;
+ xint16 dgn = u.uz.dnum;
if (levnum <= 0) {
/* can only currently happen in endgame */
dungeon_branch(const char *s)
{
branch *br;
- xchar dnum;
+ xint16 dnum;
dnum = dname_to_dnum(s);
/* use instead of depth() wherever a degree of difficulty is made
* dependent on the location in the dungeon (eg. monster creation).
*/
-xchar
+xint16
level_difficulty(void)
{
- int res;
+ xint16 res;
if (In_endgame(&u.uz)) {
res = depth(&sanctum_level) + u.ulevel / 2;
*/
#endif /*0*/
}
- return (xchar) res;
+ return res;
}
/* Take one word and try to match it to a level.
/* Print available dungeon information. */
schar
-print_dungeon(boolean bymenu, schar *rlev, xchar *rdgn)
+print_dungeon(boolean bymenu, schar *rlev, xint16 *rdgn)
{
int i, last_level, nlev;
char buf[BUFSZ];
}
static const char *
-seen_string(xchar x, const char *obj)
+seen_string(xint16 x, const char *obj)
{
/* players are computer scientists: 0, 1, 2, n */
switch (x) {
}
struct engr *
-engr_at(xchar x, xchar y)
+engr_at(coordxy x, coordxy y)
{
register struct engr *ep = head_engr;
* present if it is intact and is the entire content of the engraving.
*/
boolean
-sengr_at(const char *s, xchar x, xchar y, boolean strict)
+sengr_at(const char *s, coordxy x, coordxy y, boolean strict)
{
register struct engr *ep = engr_at(x, y);
}
void
-wipe_engr_at(xchar x, xchar y, xchar cnt, boolean magical)
+wipe_engr_at(coordxy x, coordxy y, xint16 cnt, boolean magical)
{
register struct engr *ep = engr_at(x, y);
}
void
-make_engr_at(int x, int y, const char *s, long e_time, xchar e_type)
+make_engr_at(int x, int y, const char *s, long e_time, xint16 e_type)
{
struct engr *ep;
unsigned smem = Strlen(s) + 1;
boolean ptext = TRUE; /* TRUE if we must prompt for engrave text */
boolean teleengr = FALSE; /* TRUE if we move the old engraving */
boolean zapwand = FALSE; /* TRUE if we remove a wand charge */
- xchar type = DUST; /* Type of engraving made */
- xchar oetype = 0; /* will be set to type of current engraving */
+ xint16 type = DUST; /* Type of engraving made */
+ xint16 oetype = 0; /* will be set to type of current engraving */
char buf[BUFSZ]; /* Buffer for final/poly engraving text */
char ebuf[BUFSZ]; /* Buffer for initial engraving text */
char fbuf[BUFSZ]; /* Buffer for "your fingers" */
case WAN_POLYMORPH:
if (oep) {
if (!Blind) {
- type = (xchar) 0; /* random */
+ type = (xint16) 0; /* random */
(void) random_engraving(buf);
} else {
/* keep the same type so that feels don't
en = 1;
if (u.ulevel < MAXULEV) {
/* remember increment; future level drain could take it away again */
- u.ueninc[u.ulevel] = (xchar) en;
+ u.ueninc[u.ulevel] = (xint16) en;
} else {
/* after level 30, throttle energy gains from extra experience;
once max reaches 600, further increments will be just 1 more */
/* Affect the floor unless the player caused the explosion from
* inside their engulfer. */
if (!(u.uswallow && !g.context.mon_moving))
- (void) zap_over_floor((xchar) (i + x - 1),
- (xchar) (j + y - 1), type,
+ (void) zap_over_floor((coordxy) (i + x - 1),
+ (coordxy) (j + y - 1), type,
&shopdamage, exploding_wand_typ);
mtmp = m_at(i + x - 1, j + y - 1);
struct scatter_chain {
struct scatter_chain *next; /* pointer to next scatter item */
struct obj *obj; /* pointer to the object */
- xchar ox; /* location of */
- xchar oy; /* item */
+ coordxy ox; /* location of */
+ coordxy oy; /* item */
schar dx; /* direction of */
schar dy; /* travel */
int range; /* range of object */
} else if ((scflags & MAY_DESTROY) != 0
&& (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS
|| otmp->otyp == EGG))) {
- if (breaks(otmp, (xchar) sx, (xchar) sy))
+ if (breaks(otmp, (coordxy) sx, (coordxy) sy))
used_up = TRUE;
}
{
NHFILE *gnhfp, *lnhfp, *snhfp;
int lev, savelev, hpid, pltmpsiz, filecmc;
- xchar levc;
+ xint16 levc;
struct version_info version_data;
int processed[256];
char savename[SAVESIZE], errbuf[BUFSZ], indicator;
processed[0] = 1;
for (lev = 1; lev < 256; lev++) {
- /* level numbers are kept in xchars in save.c, so the
+ /* level numbers are kept in xint16s in save.c, so the
* maximum level number (for the endlevel) must be < 256
*/
if (lev != savelev) {
lnhfp = open_levelfile(lev, (char *) 0);
if (lnhfp) {
/* any or all of these may not exist */
- levc = (xchar) lev;
+ levc = (xint16) lev;
write(snhfp->fd, (genericptr_t) &levc, sizeof(levc));
if (!copy_bytes(lnhfp->fd, snhfp->fd)) {
close_nhfile(lnhfp);
/* collect all of the N indices */
g.context.novel.count = passagecnt;
for (idx = 0; idx < MAXPASSAGES; idx++)
- g.context.novel.pasg[idx] = (xchar) ((idx < passagecnt)
+ g.context.novel.pasg[idx] = (xint16) ((idx < passagecnt)
? idx + 1 : 0);
} else {
/* collect MAXPASSAGES of the N indices */
g.context.novel.count = MAXPASSAGES;
for (idx = i = 0; i < passagecnt; ++i, --range)
if (range > 0 && rn2(range) < limit) {
- g.context.novel.pasg[idx++] = (xchar) (i + 1);
+ g.context.novel.pasg[idx++] = (xint16) (i + 1);
--limit;
}
}
}
void
-dryup(xchar x, xchar y, boolean isyou)
+dryup(coordxy x, coordxy y, boolean isyou)
{
if (IS_FOUNTAIN(levl[x][y].typ)
&& (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) {
static void dosinkfall(void);
static boolean findtravelpath(int);
static boolean trapmove(int, int, struct trap *);
-static void check_buried_zombies(xchar, xchar);
-static schar u_simple_floortyp(xchar, xchar);
-static boolean swim_move_danger(xchar, xchar);
+static void check_buried_zombies(coordxy, coordxy);
+static schar u_simple_floortyp(coordxy, coordxy);
+static boolean swim_move_danger(coordxy, coordxy);
static boolean domove_bump_mon(struct monst *, int);
-static boolean domove_attackmon_at(struct monst *, xchar, xchar, boolean *);
-static boolean domove_fight_ironbars(xchar, xchar);
-static boolean domove_swap_with_pet(struct monst *, xchar, xchar);
-static boolean domove_fight_empty(xchar, xchar);
+static boolean domove_attackmon_at(struct monst *, coordxy, coordxy, boolean *);
+static boolean domove_fight_ironbars(coordxy, coordxy);
+static boolean domove_swap_with_pet(struct monst *, coordxy, coordxy);
+static boolean domove_fight_empty(coordxy, coordxy);
static boolean air_turbulence(void);
static void slippery_ice_fumbling(void);
-static boolean impaired_movement(xchar *, xchar *);
-static boolean avoid_moving_on_trap(xchar, xchar, boolean);
-static boolean avoid_moving_on_liquid(xchar, xchar, boolean);
-static boolean avoid_running_into_trap_or_liquid(xchar, xchar);
-static boolean move_out_of_bounds(xchar, xchar);
+static boolean impaired_movement(coordxy *, coordxy *);
+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(xchar, xchar);
+static boolean escape_from_sticky_mon(coordxy, coordxy);
static void domove_core(void);
static void maybe_smudge_engr(int, int, int, int);
static struct monst *monstinroom(struct permonst *, int);
static int
moverock(void)
{
- register xchar rx, ry, sx, sy;
+ register coordxy rx, ry, sx, sy;
struct obj *otmp;
struct trap *ttmp;
struct monst *mtmp;
* Returns TRUE if still eating, FALSE when done.
*/
int
-still_chewing(xchar x, xchar y)
+still_chewing(coordxy x, coordxy y)
{
struct rm *lev = &levl[x][y];
struct obj *boulder = sobj_at(BOULDER, x, y);
}
void
-movobj(struct obj *obj, xchar ox, xchar oy)
+movobj(struct obj *obj, coordxy ox, coordxy oy)
{
/* optimize by leaving on the fobj chain? */
remove_object(obj);
/* intended to be called only on ROCKs or TREEs */
boolean
-may_dig(register xchar x, register xchar y)
+may_dig(register coordxy x, register coordxy y)
{
struct rm *lev = &levl[x][y];
}
boolean
-may_passwall(register xchar x, register xchar y)
+may_passwall(register coordxy x, register coordxy y)
{
return (boolean) !(IS_STWALL(levl[x][y].typ)
&& (levl[x][y].wall_info & W_NONPASSWALL));
}
boolean
-bad_rock(struct permonst *mdat, register xchar x, register xchar y)
+bad_rock(struct permonst *mdat, register coordxy x, register coordxy y)
{
return (boolean) ((Sokoban && sobj_at(BOULDER, x, y))
|| (IS_ROCK(levl[x][y].typ)
}
boolean
-invocation_pos(xchar x, xchar y)
+invocation_pos(coordxy x, coordxy y)
{
return (boolean) (Invocation_lev(&u.uz)
&& x == g.inv_pos.x && y == g.inv_pos.y);
g.context.run = 8;
}
if (u.tx != u.ux || u.ty != u.uy) {
- xchar travel[COLNO][ROWNO];
- xchar travelstepx[2][COLNO * ROWNO];
- xchar travelstepy[2][COLNO * ROWNO];
- xchar tx, ty, ux, uy;
+ coordxy travel[COLNO][ROWNO];
+ coordxy travelstepx[2][COLNO * ROWNO];
+ coordxy travelstepy[2][COLNO * ROWNO];
+ coordxy tx, ty, ux, uy;
int n = 1; /* max offset in travelsteps */
int set = 0; /* two sets current and previous */
int radius = 1; /* search radius */
/* reduce zombification timeout of buried zombies around px, py */
static void
-check_buried_zombies(xchar x, xchar y)
+check_buried_zombies(coordxy x, coordxy y)
{
struct obj *otmp;
long t;
/* Return a simplified floor solid/liquid state based on hero's state */
static schar
-u_simple_floortyp(xchar x, xchar y)
+u_simple_floortyp(coordxy x, coordxy y)
{
boolean u_in_air = (Levitation || Flying || !grounded(g.youmonst.data));
/* Is it dangerous for hero to move to x,y due to water or lava? */
static boolean
-swim_move_danger(xchar x, xchar y)
+swim_move_danger(coordxy x, coordxy y)
{
schar newtyp = u_simple_floortyp(x, y);
boolean liquid_wall = IS_WATERWALL(newtyp);
sets displaceu, if hero and monster could swap places instead.
*/
static boolean
-domove_attackmon_at(struct monst *mtmp, xchar x, xchar y, boolean *displaceu)
+domove_attackmon_at(struct monst *mtmp, coordxy x, coordxy y, boolean *displaceu)
{
/* only attack if we know it's there */
/* or if we used the 'F' command to fight blindly */
/* force-fight iron bars with your weapon? */
static boolean
-domove_fight_ironbars(xchar x, xchar y)
+domove_fight_ironbars(coordxy x, coordxy y)
{
if (g.context.forcefight && levl[x][y].typ == IRONBARS && uwep) {
struct obj *obj = uwep;
/* maybe swap places with a pet? returns TRUE if swapped places */
static boolean
-domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y)
+domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y)
{
struct trap *trap;
/* if it turns out we can't actually move */
/* force-fight (x,y) which doesn't have anything to fight */
static boolean
-domove_fight_empty(xchar x, xchar y)
+domove_fight_empty(coordxy x, coordxy y)
{
static const char unknown_obstacle[] = "an unknown obstacle";
boolean off_edge = !isok(x, y);
/* does water disturb the movement? */
static boolean
-water_turbulence(xchar *x, xchar *y)
+water_turbulence(coordxy *x, coordxy *y)
{
if (u.uinwater) {
int wtcap;
/* change movement dir if impaired. return TRUE if can't move */
static boolean
-impaired_movement(xchar *x, xchar *y)
+impaired_movement(coordxy *x, coordxy *y)
{
if (Stunned || (Confusion && !rn2(5))) {
register int tries = 0;
}
static boolean
-avoid_moving_on_trap(xchar x, xchar y, boolean msg)
+avoid_moving_on_trap(coordxy x, coordxy y, boolean msg)
{
struct trap *trap;
}
static boolean
-avoid_moving_on_liquid(xchar x, xchar y, boolean msg)
+avoid_moving_on_liquid(coordxy x, coordxy y, boolean msg)
{
if (!Levitation && !Flying && !is_clinger(g.youmonst.data)
&& is_pool_or_lava(x, y) && levl[x][y].seenv) {
/* when running/rushing, avoid stepping on a known trap or pool of liquid.
returns TRUE if avoided. */
static boolean
-avoid_running_into_trap_or_liquid(xchar x, xchar y)
+avoid_running_into_trap_or_liquid(coordxy x, coordxy y)
{
if (!g.context.run)
return FALSE;
/* trying to move out-of-bounds? */
static boolean
-move_out_of_bounds(xchar x, xchar y)
+move_out_of_bounds(coordxy x, coordxy y)
{
if (!isok(x, y)) {
if (g.context.forcefight)
/* 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
-escape_from_sticky_mon(xchar x, xchar y)
+escape_from_sticky_mon(coordxy x, coordxy y)
{
if (u.ustuck && (x != u.ustuck->mx || y != u.ustuck->my)) {
struct monst *mtmp;
{
register struct monst *mtmp;
register struct rm *tmpr;
- xchar x, y;
+ coordxy x, y;
struct trap *trap = NULL;
int glyph;
- xchar chainx = 0, chainy = 0,
+ coordxy chainx = 0, chainy = 0,
ballx = 0, bally = 0; /* ball&chain new positions */
int bc_control = 0; /* control for ball&chain */
boolean cause_delay = FALSE, /* dragging ball will skip a move */
}
char *
-in_rooms(register xchar x, register xchar y, register int typewanted)
+in_rooms(register coordxy x, register coordxy y, register int typewanted)
{
static char buf[5];
char rno, *ptr = &buf[4];
}
void
-spot_checks(xchar x, xchar y, schar old_typ)
+spot_checks(coordxy x, coordxy y, schar old_typ)
{
schar new_typ = levl[x][y].typ;
boolean db_ice_now = FALSE;
k = 1 + (int) (p - classorder);
else
k = 1 + (int) strlen(classorder) + (oclass != VENOM_CLASS);
- sort_item->orderclass = (xchar) k;
+ sort_item->orderclass = (coordxy) k;
/* subclass designation; only a few classes have subclasses
and the non-armor ones we use are fairly arbitrary */
switch (oclass) {
k = 1; /* any non-zero would do */
break;
}
- sort_item->subclass = (xchar) k;
+ sort_item->subclass = (coordxy) k;
/* discovery status */
k = !seen ? 1 /* unseen */
: (discovered || !OBJ_DESCR(objects[otyp])) ? 4
: (objects[otyp].oc_uname) ? 3 /* named (partially discovered) */
: 2; /* undiscovered */
- sort_item->disco = (xchar) k;
+ sort_item->disco = (coordxy) k;
}
/* sortloot() formatting routine; for alphabetizing, not shown to user */
{
makeknown(otmp->otyp);
if (otmp->oartifact)
- discover_artifact((xchar) otmp->oartifact);
+ discover_artifact((coordxy) otmp->oartifact);
otmp->known = otmp->dknown = otmp->bknown = otmp->rknown = 1;
set_cknown_lknown(otmp); /* set otmp->{cknown,lknown} if applicable */
if (otmp->otyp == EGG && otmp->corpsenm != NON_PM)
long count = 0L;
if (!everything && !newdrop) {
- xchar x, y;
+ coordxy x, y;
for (topc = container; topc->where == OBJ_CONTAINED;
topc = topc->ocontainer)
#define LSF_SHOW 0x1 /* display the light source */
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
-static light_source *new_light_core(xchar, xchar, int, int, anything *);
+static light_source *new_light_core(coordxy, coordxy, int, int, anything *);
static void discard_flashes(void);
static void write_ls(NHFILE *, light_source *);
static int maybe_write_ls(NHFILE *, int, boolean);
/* imported from vision.c, for small circles */
-extern xchar circle_data[];
-extern xchar circle_start[];
+extern coordxy circle_data[];
+extern coordxy circle_start[];
/* Create a new light source. Caller (and extern.h) doesn't need to know
anything about type 'light_source'. */
void
-new_light_source(xchar x, xchar y, int range, int type, anything *id)
+new_light_source(coordxy x, coordxy y, int range, int type, anything *id)
{
(void) new_light_core(x, y, range, type, id);
}
/* Create a new light source and return it. Only used within this file. */
static light_source *
-new_light_core(xchar x, xchar y, int range, int type, anything *id)
+new_light_core(coordxy x, coordxy y, int range, int type, anything *id)
{
light_source *ls;
/* Mark locations that are temporarily lit via mobile light sources. */
void
-do_light_sources(xchar **cs_rows)
+do_light_sources(coordxy **cs_rows)
{
int x, y, min_x, max_x, max_y, offset;
- xchar *limits;
+ coordxy *limits;
short at_hero_range = 0;
light_source *ls;
- xchar *row;
+ coordxy *row;
for (ls = g.light_base; ls; ls = ls->next) {
ls->flags &= ~LSF_SHOW;
int
pick_lock(
struct obj *pick,
- xchar rx, xchar ry, /* coordinates of door/container, for autounlock:
+ coordxy rx, coordxy ry, /* coordinates of door/container, for autounlock:
* does not prompt for direction if these are set */
struct obj *container) /* container, for autounlock */
{
startp->y = row;
startp->x = g.viz_rmin[row];
- } else if (enexto(&testcc, (xchar) g.viz_rmin[row], row,
+ } else if (enexto(&testcc, (coordxy) g.viz_rmin[row], row,
(struct permonst *) 0)
&& !cansee(testcc.x, testcc.y)
&& couldsee(testcc.x, testcc.y)) {
startp->y = row;
startp->x = g.viz_rmax[row];
- } else if (enexto(&testcc, (xchar) g.viz_rmax[row], row,
+ } else if (enexto(&testcc, (coordxy) g.viz_rmax[row], row,
(struct permonst *) 0)
&& !cansee(testcc.x, testcc.y)
&& couldsee(testcc.x, testcc.y)) {
/* Note: for long worms, always call cutworm (cutworm calls clone_mon) */
struct monst *
clone_mon(struct monst *mon,
- xchar x, xchar y) /* clone's preferred location or 0 (near mon) */
+ coordxy x, coordxy y) /* clone's preferred location or 0 (near mon) */
{
coord mm;
struct monst *m2;
gulpmm(register struct monst *magr, register struct monst *mdef,
register struct attack *mattk)
{
- xchar ax, ay, dx, dy;
+ coordxy ax, ay, dx, dy;
int status;
char buf[BUFSZ];
struct obj *obj;
{
struct permonst *pagr;
boolean agrinvis, defperc;
- xchar genagr, gendef;
+ xint16 genagr, gendef;
int adtyp;
if (is_animal(magr->data))
void clear_level_structures(void);
static void fill_ordinary_room(struct mkroom *);
static void makelevel(void);
-static boolean bydoor(xchar, xchar);
+static boolean bydoor(coordxy, coordxy);
static struct mkroom *find_branch_room(coord *);
-static struct mkroom *pos_to_room(xchar, xchar);
+static struct mkroom *pos_to_room(coordxy, coordxy);
static boolean place_niche(struct mkroom *, int *, int *, int *);
static void makeniche(int);
static void make_niches(void);
static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
-static void dosdoor(xchar, xchar, struct mkroom *, int);
+static void dosdoor(coordxy, coordxy, struct mkroom *, int);
static void join(int, int, boolean);
static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean,
schar, boolean, boolean);
static void makerooms(void);
-static boolean door_into_nonjoined(xchar, xchar);
-static boolean finddpos(coord *, xchar, xchar, xchar, xchar);
-static void mkinvpos(xchar, xchar, int);
-static void mk_knox_portal(xchar, xchar);
+static boolean door_into_nonjoined(coordxy, coordxy);
+static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
+static void mkinvpos(coordxy, coordxy, int);
+static void mk_knox_portal(coordxy, coordxy);
#define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)
#define init_vault() g.vault_x = -1
* to connect them up to other areas.
*/
static boolean
-door_into_nonjoined(xchar x, xchar y)
+door_into_nonjoined(coordxy x, coordxy y)
{
- xchar tx, ty, i;
+ coordxy tx, ty, i;
for (i = 0; i < 4; i++) {
tx = x + xdir[dirs_ord[i]];
}
static boolean
-finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh)
+finddpos(coord *cc, coordxy xl, coordxy yl, coordxy xh, coordxy yh)
{
- register xchar x, y;
+ register coordxy x, y;
x = rn1(xh - xl + 1, xl);
y = rn1(yh - yl + 1, yl);
join(register int a, register int b, boolean nxcor)
{
coord cc, tt, org, dest;
- register xchar tx, ty, xx, yy;
+ register coordxy tx, ty, xx, yy;
register struct mkroom *croom, *troom;
register int dx, dy;
}
static void
-dosdoor(register xchar x, register xchar y, struct mkroom *aroom, int type)
+dosdoor(register coordxy x, register coordxy y, struct mkroom *aroom, int type)
{
boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE;
/* make a secret treasure vault, not connected to the rest */
if (do_vault()) {
- xchar w, h;
+ coordxy w, h;
debugpline0("trying to make a vault...");
w = 1;
/* Find the room for (x,y). Return null if not in a room. */
static struct mkroom *
-pos_to_room(xchar x, xchar y)
+pos_to_room(coordxy x, coordxy y)
{
int i;
struct mkroom *curr;
void
place_branch(
branch *br, /* branch to place */
- xchar x, xchar y) /* location */
+ coordxy x, coordxy y) /* location */
{
coord m = {0};
d_level *dest;
}
static boolean
-bydoor(register xchar x, register xchar y)
+bydoor(register coordxy x, register coordxy y)
{
register int typ;
/* see whether it is allowable to create a door at [x,y] */
int
-okdoor(xchar x, xchar y)
+okdoor(coordxy x, coordxy y)
{
boolean near_door = bydoor(x, y);
}
boolean
-occupied(xchar x, xchar y)
+occupied(coordxy x, coordxy y)
{
return (boolean) (t_at(x, y) || IS_FURNITURE(levl[x][y].typ)
|| is_lava(x, y) || is_pool(x, y)
If force is TRUE, change the terrain to ROOM first */
void
mkstairs(
- xchar x, xchar y,
+ coordxy x, coordxy y,
char up, /* [why 'char' when usage is boolean?] */
struct mkroom *croom UNUSED,
boolean force)
mkinvokearea(void)
{
int dist;
- xchar xmin = g.inv_pos.x, xmax = g.inv_pos.x,
+ coordxy xmin = g.inv_pos.x, xmax = g.inv_pos.x,
ymin = g.inv_pos.y, ymax = g.inv_pos.y;
- register xchar i;
+ register coordxy i;
/* slightly odd if levitating, but not wrong */
pline_The("floor shakes violently under you!");
* Temporarily overrides vision in the name of a nice effect.
*/
static void
-mkinvpos(xchar x, xchar y, int dist)
+mkinvpos(coordxy x, coordxy y, int dist)
{
struct trap *ttmp;
struct obj *otmp;
* Ludios will remain isolated until the branch is corrected by this function.
*/
static void
-mk_knox_portal(xchar x, xchar y)
+mk_knox_portal(coordxy x, coordxy y)
{
d_level *source;
branch *br;
{
schar bg_typ = init_lev->bg, fg_typ = init_lev->fg;
boolean smooth = init_lev->smoothed, join = init_lev->joined;
- xchar lit = init_lev->lit, walled = init_lev->walled;
+ xint16 lit = init_lev->lit, walled = init_lev->walled;
int i;
lit = litstate_rnd(lit);
static void wall_cleanup(int, int, int, int);
static boolean okay(int, int, int);
static void maze0xy(coord *);
-static boolean put_lregion_here(xchar, xchar, xchar, xchar, xchar,
- xchar, xchar, boolean, d_level *);
+static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
+ coordxy, coordxy, boolean, d_level *);
static void baalz_fixup(void);
static void setup_waterlevel(void);
static void unsetup_waterlevel(void);
static void shiny_orc_stuff(struct monst *);
static void stolen_booty(void);
static boolean maze_inbounds(int, int);
-static void maze_remove_deadends(xchar);
+static void maze_remove_deadends(xint16);
/* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \
/* set map terrain type, handling lava lit, ice melt timers, etc */
boolean
-set_levltyp(xchar x, xchar y, schar typ)
+set_levltyp(coordxy x, coordxy y, schar typ)
{
if (isok(x, y)) {
if ((typ < MAX_TYPE) && CAN_OVERWRITE_TERRAIN(levl[x][y].typ)) {
/* set map terrain type and light state */
boolean
-set_levltyp_lit(xchar x, xchar y, schar typ, schar lit)
+set_levltyp_lit(coordxy x, coordxy y, schar typ, schar lit)
{
boolean ret = set_levltyp(x, y, typ);
* so even though this table says VWALL, we actually leave whatever
* typ was there alone.
*/
- static xchar spine_array[16] = { VWALL, HWALL, HWALL, HWALL,
+ static xint16 spine_array[16] = { VWALL, HWALL, HWALL, HWALL,
VWALL, TRCORNER, TLCORNER, TDWALL,
VWALL, BRCORNER, BLCORNER, TUWALL,
VWALL, TLWALL, TRWALL, CROSSWALL };
* NOT (pos is corridor and a maze level OR pos is a room OR pos is air)
*/
boolean
-bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy)
+bad_location(coordxy x, coordxy y, coordxy lx, coordxy ly, coordxy hx, coordxy hy)
{
return (boolean) (occupied(x, y)
|| within_bounded_area(x, y, lx, ly, hx, hy)
and place something (based on rtype) in that region */
void
place_lregion(
- xchar lx, xchar ly, xchar hx, xchar hy,
- xchar nlx, xchar nly, xchar nhx,xchar nhy,
- xchar rtype,
+ coordxy lx, coordxy ly, coordxy hx, coordxy hy,
+ coordxy nlx, coordxy nly, coordxy nhx,coordxy nhy,
+ xint16 rtype,
d_level *lev)
{
int trycnt;
boolean oneshot;
- xchar x, y;
+ coordxy x, y;
if (!lx) { /* default to whole level */
/*
static boolean
put_lregion_here(
- xchar x, xchar y,
- xchar nlx, xchar nly, xchar nhx, xchar nhy,
- xchar rtype,
+ coordxy x, coordxy y,
+ coordxy nlx, coordxy nly, coordxy nhx, coordxy nhy,
+ xint16 rtype,
boolean oneshot,
d_level *lev)
{
}
static void
-maze_remove_deadends(xchar typ)
+maze_remove_deadends(xint16 typ)
{
char dirok[4];
int x, y, dir, idx, idx2, dx, dy, dx2, dy2;
x = rnd(g.x_maze_max);
y = rnd(g.y_maze_max);
if (levl[x][y].typ == allowedtyp) {
- cc->x = (xchar) x;
- cc->y = (xchar) y;
+ cc->x = (coordxy) x;
+ cc->y = (coordxy) y;
return;
}
} while (++cpt < 100);
for (x = 1; x <= g.x_maze_max; x++)
for (y = 1; y <= g.y_maze_max; y++)
if (levl[x][y].typ == allowedtyp) {
- cc->x = (xchar) x;
- cc->y = (xchar) y;
+ cc->x = (coordxy) x;
+ cc->y = (coordxy) y;
return;
}
/* every spot on the area of map allowed for mazes has been rejected */
}
void
-mkportal(xchar x, xchar y, xchar todnum, xchar todlevel)
+mkportal(coordxy x, coordxy y, xint16 todnum, xint16 todlevel)
{
/* a portal "trap" must be matched by a
portal in the destination dungeon/dlevel */
void
fumaroles(void)
{
- xchar n;
+ xint16 n;
boolean snd = FALSE, loud = FALSE;
for (n = rn2(3) + 2; n; n--) {
- xchar x = rn1(COLNO - 4, 3);
- xchar y = rn1(ROWNO - 4, 3);
+ coordxy x = rn1(COLNO - 4, 3);
+ coordxy y = rn1(ROWNO - 4, 3);
if (levl[x][y].typ == LAVAPOOL) {
NhRegion *r = create_gas_cloud(x, y, rn1(30, 20), rn1(10, 5));
static unsigned nextoid(struct obj *, struct obj *);
static int item_on_ice(struct obj *);
static void shrinking_glob_gone(struct obj *);
-static void obj_timer_checks(struct obj *, xchar, xchar, int);
+static void obj_timer_checks(struct obj *, coordxy, coordxy, int);
static void container_weight(struct obj *);
static struct obj *save_mtraits(struct obj *, struct monst *);
static void objlist_sanity(struct obj *, int, const char *);
void
costly_alteration(struct obj *obj, int alter_type)
{
- xchar ox, oy;
+ coordxy ox, oy;
char objroom;
boolean learn_bknown;
const char *those, *them;
item_on_ice(struct obj *item)
{
struct obj *otmp;
- xchar ox, oy;
+ coordxy ox, oy;
otmp = item;
/* if in a container, it might be nested so find outermost one since
}
if (gone) {
- xchar ox = 0, oy = 0;
+ coordxy ox = 0, oy = 0;
/* check location for visibility before destroying obj */
boolean seeit = (obj->where == OBJ_FLOOR
&& get_obj_location(obj, &ox, &oy, 0)
static void
shrinking_glob_gone(struct obj *obj)
{
- xchar owhere = obj->where;
+ xint16 owhere = obj->where;
if (owhere == OBJ_INVENT) {
if (obj->owornmask) {
maybe_adjust_light(struct obj *obj, int old_range)
{
char buf[BUFSZ];
- xchar ox, oy;
+ coordxy ox, oy;
int new_range = arti_light_radius(obj), delta = new_range - old_range;
/* radius of light emitting artifact varies by curse/bless state
static void
obj_timer_checks(
struct obj *otmp,
- xchar x, xchar y,
+ coordxy x, coordxy y,
int force) /* 0 = no force so do checks, <0 = force off, >0 force on */
{
long tleft = 0L;
void
remove_object(struct obj *otmp)
{
- xchar x = otmp->ox;
- xchar y = otmp->oy;
+ coordxy x = otmp->ox;
+ coordxy y = otmp->oy;
if (otmp->where != OBJ_FLOOR)
panic("remove_object: obj not on floor");
(void) somexy(sroom, &mm);
tx = mm.x;
ty = mm.y;
- } while (occupied((xchar) tx, (xchar) ty) && --i > 0);
+ } while (occupied((coordxy) tx, (coordxy) ty) && --i > 0);
throne_placed:
mk_zoo_thronemon(tx, ty);
break;
}
boolean
-inside_room(struct mkroom* croom, xchar x, xchar y)
+inside_room(struct mkroom* croom, coordxy x, coordxy y)
{
if (croom->irregular) {
int i = (int) ((croom - g.rooms) + ROOMOFFSET);
static void m_detach(struct monst *, struct permonst *);
static void set_mon_min_mhpmax(struct monst *, int);
static void lifesaved_monster(struct monst *);
-static void migrate_mon(struct monst *, xchar, xchar);
+static void migrate_mon(struct monst *, coordxy, coordxy);
static boolean ok_to_obliterate(struct monst *);
static void deal_with_overcrowding(struct monst *);
static void m_restartcham(struct monst *);
{
struct permonst *mdat = mon->data;
register struct trap *ttmp;
- xchar x, y, nx, ny;
+ coordxy x, y, nx, ny;
int cnt = 0;
uchar ntyp;
uchar nowtyp;
struct monst *mtmp,
struct permonst *mptr) /* reflects mtmp->data _prior_ to mtmp's death */
{
- xchar mx = mtmp->mx, my = mtmp->my;
+ coordxy mx = mtmp->mx, my = mtmp->my;
if (mtmp->mleashed)
m_unleash(mtmp, FALSE);
monstone(struct monst* mdef)
{
struct obj *otmp, *obj, *oldminvent;
- xchar x = mdef->mx, y = mdef->my;
+ coordxy x = mdef->mx, y = mdef->my;
boolean wasinside = FALSE;
/* vampshifter reverts to vampire;
void
m_into_limbo(struct monst *mtmp)
{
- xchar target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY;
+ xint16 target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY;
mtmp->mstate |= MON_LIMBO;
migrate_mon(mtmp, target_lev, xyloc);
}
static void
-migrate_mon(struct monst *mtmp, xchar target_lev, xchar xyloc)
+migrate_mon(struct monst *mtmp, xint16 target_lev, xint16 xyloc)
{
if (!mtmp->mx) {
/* this was a failed arrival attempt from a prior migration;
/* last resort - migrate mon to the next plane */
} else if (!Is_astralevel(&u.uz)) {
d_level dest;
- xchar target_lev;
+ coordxy target_lev;
dest = u.uz;
dest.dlevel--;
int
mnearto(
register struct monst *mtmp,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
boolean move_other, /* make sure mtmp gets to x, y! so move m_at(x, y) */
unsigned int rlocflags)
{
struct monst *othermon = (struct monst *) 0;
- xchar newx, newy;
+ coordxy newx, newy;
coord mm;
int res = 1;
passing x,y to the function.
if func returns TRUE, stop and return that monster. */
struct monst *
-get_iter_mons_xy(boolean (*func)(struct monst *, xchar, xchar),
- xchar x, xchar y)
+get_iter_mons_xy(boolean (*func)(struct monst *, coordxy, coordxy),
+ coordxy x, coordxy y)
{
struct monst *mtmp;
/* reveal a monster at x,y hiding under an object,
if there are no objects there */
void
-maybe_unhide_at(xchar x, xchar y)
+maybe_unhide_at(coordxy x, coordxy y)
{
struct monst *mtmp;
{
struct trap *t;
boolean oldundetctd, undetected = FALSE, is_u = (mtmp == &g.youmonst);
- xchar x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my;
+ coordxy x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my;
if (mtmp == u.ustuck) {
; /* can't hide if holding you or held by you */
if ((is_hider(mon->data) || hider_under)
&& !(mon->mundetected || M_AP_TYPE(mon))) {
- xchar x = mon->mx, y = mon->my;
+ coordxy x = mon->mx, y = mon->my;
char save_viz = g.viz_array[y][x];
/* override vision, forcing hero to be unable to see monster's spot */
*p = '\0';
if (mtmp->wormno) { /* throw tail away */
- xchar mx = mtmp->mx, my = mtmp->my;
+ coordxy mx = mtmp->mx, my = mtmp->my;
wormgone(mtmp); /* discards tail segments, takes head off the map */
/* put the head back; it will morph into mtmp's new form */
static void release_hero(struct monst *);
static void distfleeck(struct monst *, int *, int *, int *);
static int m_arrival(struct monst *);
-static boolean holds_up_web(xchar, xchar);
-static int count_webbing_walls(xchar, xchar);
+static boolean holds_up_web(coordxy, coordxy);
+static int count_webbing_walls(coordxy, coordxy);
static boolean soko_allow_web(struct monst *);
static boolean leppie_avoidance(struct monst *);
static void leppie_stash(struct monst *);
coord *poss, /* coord poss[9] */
long *info, /* long info[9] */
int cnt,
- xchar gx,
- xchar gy)
+ coordxy gx,
+ coordxy gy)
{
int shortest_with_displacing = -1;
int shortest_without_displacing = -1;
}
boolean
-m_digweapon_check(struct monst* mtmp, xchar nix, xchar niy)
+m_digweapon_check(struct monst* mtmp, coordxy nix, coordxy niy)
{
boolean can_tunnel = 0;
struct obj *mw_tmp = MON_WEP(mtmp);
}
static boolean
-holds_up_web(xchar x, xchar y)
+holds_up_web(coordxy x, coordxy y)
{
stairway *sway;
/* returns the number of walls in the four cardinal directions that could
hold up a web */
static int
-count_webbing_walls(xchar x, xchar y)
+count_webbing_walls(coordxy x, coordxy y)
{
return (holds_up_web(x, y - 1) + holds_up_web(x + 1, y)
+ holds_up_web(x, y + 1) + holds_up_web(x - 1, y));
m_move(register struct monst* mtmp, register int after)
{
int appr, etmp;
- xchar gx, gy, nix, niy, chcnt;
+ coordxy gx, gy, nix, niy;
+ xint16 chcnt;
int chi; /* could be schar except for stupid Sun-2 compiler */
boolean likegold = 0, likegems = 0, likeobjs = 0, likemagic = 0,
conceals = 0;
/* and the acquisitive monsters get special treatment */
if (is_covetous(ptr)) {
- xchar tx = STRAT_GOALX(mtmp->mstrategy),
+ coordxy tx = STRAT_GOALX(mtmp->mstrategy),
ty = STRAT_GOALY(mtmp->mstrategy);
struct monst *intruder = m_at(tx, ty);
/*
* (mtmp died) or 3 (mtmp made its move).
*/
int
-m_move_aggress(struct monst* mtmp, xchar x, xchar y)
+m_move_aggress(struct monst* mtmp, coordxy x, coordxy y)
{
struct monst *mtmp2;
int mstatus;
boolean
undesirable_disp(
struct monst *mtmp, /* barging creature */
- xchar x,
- xchar y) /* spot 'mtmp' is considering moving to */
+ coordxy x,
+ coordxy y) /* spot 'mtmp' is considering moving to */
{
boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion);
struct trap *trap = t_at(x, y);
}
struct monst *
-mk_mplayer(struct permonst *ptr, xchar x, xchar y, boolean special)
+mk_mplayer(struct permonst *ptr, coordxy x, coordxy y, boolean special)
{
struct monst *mtmp;
char nam[PL_NSIZ];
if (tryct > 50)
return;
- (void) mk_mplayer(&mons[pm], (xchar) x, (xchar) y, special);
+ (void) mk_mplayer(&mons[pm], (coordxy) x, (coordxy) y, special);
num--;
}
}
thrwmm(struct monst* mtmp, struct monst* mtarg)
{
struct obj *otmp, *mwep;
- register xchar x, y;
+ register coordxy x, y;
boolean ispole;
/* Polearms won't be applied by monsters against other monsters */
}
if (m_lined_up(mtarg, mtmp)) {
boolean utarg = (mtarg == &g.youmonst);
- xchar tx = utarg ? mtmp->mux : mtarg->mx;
- xchar ty = utarg ? mtmp->muy : mtarg->my;
+ coordxy tx = utarg ? mtmp->mux : mtarg->mx;
+ coordxy ty = utarg ? mtmp->muy : mtarg->my;
switch (mattk->adtyp) {
case AD_BLND:
thrwmu(struct monst* mtmp)
{
struct obj *otmp, *mwep;
- xchar x, y;
+ coordxy x, y;
const char *onm;
/* Rearranged beginning so monsters can use polearms not in a line */
Returns TRUE if fnc returned TRUE. */
boolean
linedup_callback(
- xchar ax,
- xchar ay,
- xchar bx,
- xchar by,
+ coordxy ax,
+ coordxy ay,
+ coordxy bx,
+ coordxy by,
boolean (*fnc)(int, int))
{
int dx, dy;
boolean
linedup(
- register xchar ax,
- register xchar ay,
- register xchar bx,
- register xchar by,
+ register coordxy ax,
+ register coordxy ay,
+ register coordxy bx,
+ register coordxy by,
int boulderhandling) /* 0=block, 1=ignore, 2=conditionally block */
{
int dx, dy, boulderspots;
m_lined_up(struct monst* mtarg, struct monst* mtmp)
{
boolean utarget = (mtarg == &g.youmonst);
- xchar tx = utarget ? mtmp->mux : mtarg->mx;
- xchar ty = utarget ? mtmp->muy : mtarg->my;
+ coordxy tx = utarget ? mtmp->mux : mtarg->mx;
+ coordxy ty = utarget ? mtmp->muy : mtarg->my;
boolean ignore_boulders = utarget && (throws_rocks(mtmp->data)
|| m_carrying(mtmp, WAN_STRIKING));
int argc = lua_gettop(L);
boolean dealloced = FALSE;
struct _lua_obj *lo = l_obj_check(L, 1);
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
if (argc == 1) {
x = lo->obj->ox;
y = lo->obj->oy;
} else if (argc == 3) {
- x = (xchar) lua_tointeger(L, 2);
- y = (xchar) lua_tointeger(L, 3);
+ x = (coordxy) lua_tointeger(L, 2);
+ y = (coordxy) lua_tointeger(L, 3);
} else
nhl_error(L, "l_obj_bury: Wrong args");
static int l_selection_filter_percent(lua_State *);
static int l_selection_rndcoord(lua_State *);
static boolean params_sel_2coords(lua_State *, struct selectionvar **,
- xchar *, xchar *, xchar *, xchar *);
+ 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 *);
l_selection_setpoint(lua_State *L)
{
struct selectionvar *sel = (struct selectionvar *) 0;
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
int val = 1;
int argc = lua_gettop(L);
long crd = 0L;
} else if (argc == 1) {
sel = l_selection_check(L, 1);
} else if (argc == 2) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
lua_pop(L, 2);
(void) l_selection_new(L);
sel = l_selection_check(L, 1);
} else {
sel = l_selection_check(L, 1);
- x = (xchar) luaL_checkinteger(L, 2);
- y = (xchar) luaL_checkinteger(L, 3);
+ x = (coordxy) luaL_checkinteger(L, 2);
+ y = (coordxy) luaL_checkinteger(L, 3);
val = (int) luaL_optinteger(L, 4, 1);
}
l_selection_getpoint(lua_State *L)
{
struct selectionvar *sel = l_selection_check(L, 1);
- xchar x, y;
+ coordxy x, y;
int ix, iy;
int val;
long crd;
nhl_error(L, "l_selection_getpoint: Incorrect params");
return 0;
}
- x = (xchar) ix;
- y = (xchar) iy;
+ x = (coordxy) ix;
+ y = (coordxy) iy;
if (x == -1 && y == -1)
crd = SP_COORD_PACK_RANDOM(0);
for (x = 0; x < selr->wid; x++) {
for (y = 0; y < selr->hei; y++) {
- xchar a_pt = selection_getpoint(x, y, sela);
- xchar b_pt = selection_getpoint(x, y, selb);
+ coordxy a_pt = selection_getpoint(x, y, sela);
+ coordxy b_pt = selection_getpoint(x, y, selb);
int val = (a_pt ^ b_pt) & a_pt;
selection_setpoint(x, y, selr, val);
}
{
struct selectionvar *sel = l_selection_check(L, 1);
int removeit = (int) luaL_optinteger(L, 2, 0);
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
selection_rndcoord(sel, &x, &y, removeit);
if (!(x == -1 && y == -1)) {
update_croom();
/* selection:function(x1,y1, x2,y2) */
static boolean
params_sel_2coords(lua_State *L, struct selectionvar **sel,
- xchar *x1, xchar *y1, xchar *x2, xchar *y2)
+ coordxy *x1, coordxy *y1, coordxy *x2, coordxy *y2)
{
int argc = lua_gettop(L);
if (argc == 4) {
(void) l_selection_new(L);
- *x1 = (xchar) luaL_checkinteger(L, 1);
- *y1 = (xchar) luaL_checkinteger(L, 2);
- *x2 = (xchar) luaL_checkinteger(L, 3);
- *y2 = (xchar) luaL_checkinteger(L, 4);
+ *x1 = (coordxy) luaL_checkinteger(L, 1);
+ *y1 = (coordxy) luaL_checkinteger(L, 2);
+ *x2 = (coordxy) luaL_checkinteger(L, 3);
+ *y2 = (coordxy) luaL_checkinteger(L, 4);
*sel = l_selection_check(L, 5);
lua_remove(L, 1);
lua_remove(L, 1);
return TRUE;
} else if (argc == 5) {
*sel = l_selection_check(L, 1);
- *x1 = (xchar) luaL_checkinteger(L, 2);
- *y1 = (xchar) luaL_checkinteger(L, 3);
- *x2 = (xchar) luaL_checkinteger(L, 4);
- *y2 = (xchar) luaL_checkinteger(L, 5);
+ *x1 = (coordxy) luaL_checkinteger(L, 2);
+ *y1 = (coordxy) luaL_checkinteger(L, 3);
+ *x2 = (coordxy) luaL_checkinteger(L, 4);
+ *y2 = (coordxy) luaL_checkinteger(L, 5);
lua_pop(L, 4);
return TRUE;
}
l_selection_line(lua_State *L)
{
struct selectionvar *sel = NULL;
- xchar x1, y1, x2, y2;
+ coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.line: illegal arguments");
l_selection_rect(lua_State *L)
{
struct selectionvar *sel = NULL;
- xchar x1, y1, x2, y2;
+ coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.rect: illegal arguments");
{
struct selectionvar *sel = NULL;
int y;
- xchar x1, y1, x2, y2;
+ coordxy x1, y1, x2, y2;
if (!params_sel_2coords(L, &sel, &x1, &y1, &x2, &y2)) {
nhl_error(L, "selection.fillrect: illegal arguments");
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
- xchar x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+ coordxy x1 = 0, y1 = 0, x2 = 0, y2 = 0;
int roughness = 7;
if (argc == 6) {
sel = l_selection_check(L, 1);
- x1 = (xchar) luaL_checkinteger(L, 2);
- y1 = (xchar) luaL_checkinteger(L, 3);
- x2 = (xchar) luaL_checkinteger(L, 4);
- y2 = (xchar) luaL_checkinteger(L, 5);
+ x1 = (coordxy) luaL_checkinteger(L, 2);
+ y1 = (coordxy) luaL_checkinteger(L, 3);
+ x2 = (coordxy) luaL_checkinteger(L, 4);
+ y2 = (coordxy) luaL_checkinteger(L, 5);
roughness = (int) luaL_checkinteger(L, 6);
lua_pop(L, 5);
} else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) {
- x1 = (xchar) luaL_checkinteger(L, 1);
- y1 = (xchar) luaL_checkinteger(L, 2);
- x2 = (xchar) luaL_checkinteger(L, 3);
- y2 = (xchar) luaL_checkinteger(L, 4);
+ x1 = (coordxy) luaL_checkinteger(L, 1);
+ y1 = (coordxy) luaL_checkinteger(L, 2);
+ x2 = (coordxy) luaL_checkinteger(L, 3);
+ y2 = (coordxy) luaL_checkinteger(L, 4);
roughness = (int) luaL_checkinteger(L, 5);
lua_pop(L, 5);
(void) l_selection_new(L);
int argc = lua_gettop(L);
struct selectionvar *sel = l_selection_check(L, 1);
char *mapchr = dupstr(luaL_checkstring(L, 2));
- xchar typ = check_mapchr(mapchr);
+ coordxy typ = check_mapchr(mapchr);
int lit = (int) luaL_optinteger(L, 3, -2); /* TODO: special lit values */
struct selectionvar *tmp, *tmp2;
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
boolean diagonals = FALSE;
if (argc == 2 || argc == 3) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
if (argc == 3)
diagonals = lua_toboolean(L, 3);
lua_pop(L, argc);
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
int r = 0, filled = 0;
if (argc == 3) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
r = (int) luaL_checkinteger(L, 3);
lua_pop(L, 3);
(void) l_selection_new(L);
sel = l_selection_check(L, 1);
filled = 0;
} else if (argc == 4 && lua_type(L, 1) == LUA_TNUMBER) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
r = (int) luaL_checkinteger(L, 3);
filled = (int) luaL_checkinteger(L, 4); /* TODO: boolean*/
lua_pop(L, 4);
sel = l_selection_check(L, 1);
} else if (argc == 4 || argc == 5) {
sel = l_selection_check(L, 1);
- x = (xchar) luaL_checkinteger(L, 2);
- y = (xchar) luaL_checkinteger(L, 3);
+ x = (coordxy) luaL_checkinteger(L, 2);
+ y = (coordxy) luaL_checkinteger(L, 3);
r = (int) luaL_checkinteger(L, 4);
filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */
} else {
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
int r1 = 0, r2 = 0, filled = 0;
if (argc == 4) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
r1 = (int) luaL_checkinteger(L, 3);
r2 = (int) luaL_checkinteger(L, 4);
lua_pop(L, 4);
sel = l_selection_check(L, 1);
filled = 0;
} else if (argc == 5 && lua_type(L, 1) == LUA_TNUMBER) {
- x = (xchar) luaL_checkinteger(L, 1);
- y = (xchar) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
r1 = (int) luaL_checkinteger(L, 3);
r2 = (int) luaL_checkinteger(L, 4);
filled = (int) luaL_optinteger(L, 5, 0); /* TODO: boolean */
sel = l_selection_check(L, 1);
} else if (argc == 5 || argc == 6) {
sel = l_selection_check(L, 1);
- x = (xchar) luaL_checkinteger(L, 2);
- y = (xchar) luaL_checkinteger(L, 3);
+ x = (coordxy) luaL_checkinteger(L, 2);
+ y = (coordxy) luaL_checkinteger(L, 3);
r1 = (int) luaL_checkinteger(L, 4);
r2 = (int) luaL_checkinteger(L, 5);
filled = (int) luaL_optinteger(L, 6, 0); /* TODO: boolean */
struct selectionvar *sel = (struct selectionvar *) 0;
/* if x2 and y2 aren't set, the gradient has a single center point of x,y;
* if they are set, the gradient is centered on a (x,y) to (x2,y2) line */
- xchar x = 0, y = 0, x2 = -1, y2 = -1;
+ coordxy x = 0, y = 0, x2 = -1, y2 = -1;
/* points will not be added within mindist of the center; the chance for a
* point between mindist and maxdist to be added to the selection starts at
* 0% at mindist and increases linearly to 100% at maxdist */
- xchar mindist = 0, maxdist = 0;
+ coordxy mindist = 0, maxdist = 0;
/* if limited is true, no points farther than maxdist will be added; if
* false, all points farther than maxdist will be added */
boolean limited = FALSE;
if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
lcheck_param_table(L);
type = gradtypes2i[get_table_option(L, "type", "radial", gradtypes)];
- x = (xchar) get_table_int(L, "x");
- y = (xchar) get_table_int(L, "y");
- x2 = (xchar) get_table_int_opt(L, "x2", -1);
- y2 = (xchar) get_table_int_opt(L, "y2", -1);
+ x = (coordxy) get_table_int(L, "x");
+ y = (coordxy) get_table_int(L, "y");
+ x2 = (coordxy) get_table_int_opt(L, "x2", -1);
+ y2 = (coordxy) get_table_int_opt(L, "y2", -1);
/* maxdist is required because there's no obvious default value for it,
* whereas mindist has an obvious defalt of 0 */
maxdist = get_table_int(L, "maxdist");
get_table_mapchr(lua_State *L, const char *name)
{
char *ter;
- xchar typ;
+ xint8 typ;
ter = get_table_str(L, name);
typ = check_mapchr(ter);
get_table_mapchr_opt(lua_State *L, const char *name, schar defval)
{
char *ter;
- xchar typ;
+ xint8 typ;
ter = get_table_str_opt(L, name, emptystr);
if (name && *ter) {
- typ = check_mapchr(ter);
+ typ = (xint8) check_mapchr(ter);
if (typ == INVALID_TYPE)
nhl_error(L, "Erroneous map char");
} else
- typ = defval;
+ typ = (xint8) defval;
if (ter)
free(ter);
return typ;
void
nhl_add_table_entry_region(lua_State *L, const char *name,
- xchar x1, xchar y1, xchar x2, xchar y2)
+ coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
lua_pushstring(L, name);
lua_newtable(L);
{ "mh", &(u.mh), ANY_INT },
{ "mhmax", &(u.mhmax), ANY_INT },
{ "mtimedone", &(u.mtimedone), ANY_INT },
- { "dlevel", &(u.uz.dlevel), ANY_SCHAR }, /* actually xchar */
- { "dnum", &(u.uz.dnum), ANY_SCHAR }, /* actually xchar */
+ { "dlevel", &(u.uz.dlevel), ANY_SCHAR }, /* actually coordxy */
+ { "dnum", &(u.uz.dnum), ANY_SCHAR }, /* actually coordxy */
{ "uluck", &(u.uluck), ANY_SCHAR },
{ "uhp", &(u.uhp), ANY_INT },
{ "uhpmax", &(u.uhpmax), ANY_INT },
char *(*func)(OBJ_P)) /* formatting routine (usually xname or doname) */
{
char *str;
- xchar ox = 0, oy = 0;
+ coordxy ox = 0, oy = 0;
/*
* (r * r): square of the x or y distance;
* (r * r) * 2: sum of squares of both x and y distances
static const struct {
const char *name;
- xchar msgtyp;
+ xint8 msgtyp;
const char *descr;
} msgtype_names[] = {
{ "show", MSGTYP_NORMAL, "Show message normally" },
caller should use it or copy it before calling waterbody_name() again
[3.7: moved here from mkmaze.c] */
const char *
-waterbody_name(xchar x, xchar y)
+waterbody_name(coordxy x, coordxy y)
{
static char pooltype[40];
struct rm *lev;
if (flags.autounlock) {
struct obj *otmp, *unlocktool = 0;
- xchar ox = cobj->ox, oy = cobj->oy;
+ coordxy ox = cobj->ox, oy = cobj->oy;
u.dz = 0; /* might be non-zero from previous command since
* #loot isn't a move command; pick_lock() cares */
static NEARDATA const char sc[] = "Schroedinger's Cat";
struct obj *deadcat;
struct monst *livecat = 0;
- xchar ox, oy;
+ coordxy ox, oy;
boolean itsalive = !rn2(2);
if (get_obj_location(box, &ox, &oy, 0))
static void
tipcontainer(struct obj *box) /* or bag */
{
- xchar ox = u.ux, oy = u.uy; /* #tip only works at hero's location */
+ coordxy ox = u.ux, oy = u.uy; /* #tip only works at hero's location */
boolean empty_it = TRUE, maybeshopgoods;
struct obj *targetbox = (struct obj *) 0;
boolean cancelled = FALSE;
boolean bag = box->otyp == BAG_OF_TRICKS;
int old_spe = box->spe, seen = 0;
boolean maybeshopgoods = !carried(box) && costly_spot(box->ox, box->oy);
- xchar ox = u.ux, oy = u.uy;
+ coordxy ox = u.ux, oy = u.uy;
if (get_obj_location(box, &ox, &oy, 0))
box->ox = ox, box->oy = oy;
/* returns the name of an altar's deity */
const char *
-a_gname_at(xchar x, xchar y)
+a_gname_at(coordxy x, coordxy y)
{
if (!IS_ALTAR(levl[x][y].typ))
return (char *) 0;
#define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
#define ALGN_PIOUS 14 /* better than fervent (9..13) */
-static boolean histemple_at(struct monst *, xchar, xchar);
+static boolean histemple_at(struct monst *, coordxy, coordxy);
static boolean has_shrine(struct monst *);
void
int
move_special(struct monst *mtmp, boolean in_his_shop, schar appr,
boolean uondoor, boolean avoid,
- xchar omx, xchar omy, xchar gx, xchar gy)
+ coordxy omx, coordxy omy, coordxy gx, coordxy gy)
{
- register xchar nx, ny, nix, niy;
+ register coordxy nx, ny, nix, niy;
register schar i;
schar chcnt, cnt;
coord poss[9];
}
static boolean
-histemple_at(struct monst *priest, xchar x, xchar y)
+histemple_at(struct monst *priest, coordxy x, coordxy y)
{
return (boolean) (priest && priest->ispriest
&& (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE))
int
pri_move(struct monst *priest)
{
- register xchar gx, gy, omx, omy;
+ register coordxy gx, gy, omx, omy;
schar temple;
boolean avoid = TRUE;
}
struct monst *
-mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y,
+mk_roamer(struct permonst *ptr, aligntyp alignment, coordxy x, coordxy y,
boolean peaceful)
{
register struct monst *roamer;
boolean
in_your_sanctuary(
struct monst *mon, /* if non-null, <mx,my> overrides <x,y> */
- xchar x, xchar y)
+ coordxy x, coordxy y)
{
register char roomno;
register struct monst *priest;
#if 0
void replace_mon_regions(struct monst *,struct monst *);
void remove_mon_from_regions(struct monst *);
-NhRegion *create_msg_region(xchar,xchar,xchar,xchar, const char *,
+NhRegion *create_msg_region(coordxy,coordxy,coordxy,coordxy, const char *,
const char *);
boolean enter_force_field(genericptr,genericptr);
-NhRegion *create_force_field(xchar,xchar,int,long);
+NhRegion *create_force_field(coordxy,coordxy,int,long);
#endif
static void reset_region_mids(NhRegion *);
* check whether player enters/leaves one or more regions.
*/
boolean
-in_out_region(xchar x, xchar y)
+in_out_region(coordxy x, coordxy y)
{
int i, f_indx = 0;
* check whether a monster enters/leaves one or more regions.
*/
boolean
-m_in_out_region(struct monst *mon, xchar x, xchar y)
+m_in_out_region(struct monst *mon, coordxy x, coordxy y)
{
int i, f_indx = 0;
* Returns NULL if not, otherwise returns region.
*/
NhRegion *
-visible_region_at(xchar x, xchar y)
+visible_region_at(coordxy x, coordxy y)
{
register int i;
}
void
-show_region(NhRegion *reg, xchar x, xchar y)
+show_region(NhRegion *reg, coordxy x, coordxy y)
{
show_glyph(x, y, reg->glyph);
}
NhRegion *
create_msg_region(
- xchar x, xchar y, xchar w, xchar h,
+ coordxy x, coordxy y, coordxy w, coordxy h,
const char *msg_enter, const char *msg_leave)
{
NhRect tmprect;
}
NhRegion *
-create_force_field(xchar x, xchar y, int radius, long ttl)
+create_force_field(coordxy x, coordxy y, int radius, long ttl)
{
int i;
NhRegion *ff;
{
NhRegion *reg;
int damage;
- xchar x, y;
+ coordxy x, y;
reg = (NhRegion *) p1;
damage = reg->arg.a_int;
* damage is how much it deals to afflicted creatures. */
#define MAX_CLOUD_SIZE 150
NhRegion *
-create_gas_cloud(xchar x, xchar y, int cloudsize, int damage)
+create_gas_cloud(coordxy x, coordxy y, int cloudsize, int damage)
{
NhRegion *cloud;
int i, j;
NhRect tmprect;
/* store visited coords */
- xchar xcoords[MAX_CLOUD_SIZE];
- xchar ycoords[MAX_CLOUD_SIZE];
+ coordxy xcoords[MAX_CLOUD_SIZE];
+ coordxy ycoords[MAX_CLOUD_SIZE];
xcoords[0] = x;
ycoords[0] = y;
int curridx;
* directions chosen. */
coord dirs[4] = { {0, -1}, {0, 1}, {-1, 0}, {1, 0} };
for (i = 4; i > 0; --i) {
- xchar swapidx = rn2(i);
+ coordxy swapidx = rn2(i);
coord tmp = dirs[swapidx];
dirs[swapidx] = dirs[i-1];
dirs[i-1] = tmp;
static void ghostfruit(struct obj *);
static boolean restgamestate(NHFILE *, unsigned int *, unsigned int *);
static void restlevelstate(unsigned int, unsigned int);
-static int restlevelfile(xchar);
+static int restlevelfile(xint8);
static void rest_bubbles(NHFILE *);
static void restore_gamelog(NHFILE *);
static void restore_msghistory(NHFILE *);
/*ARGSUSED*/
static int
-restlevelfile(xchar ltmp)
+restlevelfile(xint8 ltmp)
{
char whynot[BUFSZ];
NHFILE *nhfp = (NHFILE *) 0;
dorecover(NHFILE* nhfp)
{
unsigned int stuckid = 0, steedid = 0; /* not a register */
- xchar ltmp = 0;
+ xint8 ltmp = 0;
int rtmp;
/* suppress map display if some part of the code tries to update that */
g.program_state.restoring = 1;
get_plname_from_file(nhfp, g.plname);
- getlev(nhfp, 0, (xchar) 0);
+ getlev(nhfp, 0, (xint8) 0);
if (!restgamestate(nhfp, &stuckid, &steedid)) {
NHFILE tnhfp;
(void) validate(nhfp, (char *) 0);
get_plname_from_file(nhfp, g.plname);
- getlev(nhfp, 0, (xchar) 0);
+ getlev(nhfp, 0, (xint8) 0);
close_nhfile(nhfp);
restlevelstate(stuckid, steedid);
g.program_state.something_worth_saving = 1; /* useful data now exists */
}
void
-getlev(NHFILE* nhfp, int pid, xchar lev)
+getlev(NHFILE* nhfp, int pid, xint8 lev)
{
register struct trap *trap;
register struct monst *mtmp;
long elapsed;
branch *br;
int hpid = 0;
- xchar dlvl = 0;
+ xint8 dlvl = 0;
int x, y;
boolean ghostly = (nhfp->ftype == NHF_BONESFILE);
#ifdef TOS
static void
rest_bubbles(NHFILE *nhfp)
{
- xchar bbubbly;
+ xint8 bbubbly;
/* whether or not the Plane of Water's air bubbles or Plane of Air's
clouds are present is recorded during save so that we don't have to
static void savelevchn(NHFILE *);
static void savelevl(NHFILE *,boolean);
static void savedamage(NHFILE *);
-static void save_bubbles(NHFILE *, xchar);
+static void save_bubbles(NHFILE *, xint8);
static void save_stairs(NHFILE *);
static void save_bc(NHFILE *);
static void saveobj(NHFILE *,struct obj *);
static void savetrapchn(NHFILE *,struct trap *);
static void save_gamelog(NHFILE *);
static void savegamestate(NHFILE *);
-static void savelev_core(NHFILE *, xchar);
+static void savelev_core(NHFILE *, xint8);
static void save_msghistory(NHFILE *);
#ifdef ZEROCOMP
dosave0(void)
{
const char *fq_save;
- xchar ltmp;
+ xint8 ltmp;
char whynot[BUFSZ];
NHFILE *nhfp, *onhfp;
int res = 0;
set_ustuck((struct monst *) 0);
u.usteed = (struct monst *) 0;
- for (ltmp = (xchar) 1; ltmp <= maxledgerno(); ltmp++) {
+ for (ltmp = (xint8) 1; ltmp <= maxledgerno(); ltmp++) {
if (ltmp == ledger_no(&g.uz_save))
continue;
if (!(g.level_info[ltmp].flags & LFILE_EXISTS))
#endif
void
-savelev(NHFILE *nhfp, xchar lev)
+savelev(NHFILE *nhfp, xint8 lev)
{
boolean set_uz_save = (g.uz_save.dnum == 0 && g.uz_save.dlevel == 0);
}
static void
-savelev_core(NHFILE *nhfp, xchar lev)
+savelev_core(NHFILE *nhfp, xint8 lev)
{
#ifdef TOS
short tlev;
/* save Plane of Water's air bubbles and Plane of Air's clouds */
static void
-save_bubbles(NHFILE *nhfp, xchar lev)
+save_bubbles(NHFILE *nhfp, xint8 lev)
{
- xchar bbubbly;
+ xint8 bbubbly;
/* air bubbles and clouds used to be saved as part of game state
because restoring them needs dungeon data that isn't available
static void discard_damage_struct(struct damage *);
static void discard_damage_owned_by(struct monst *);
static void shk_fixes_damage(struct monst *);
-static xchar *litter_getpos(int *, xchar, xchar, struct monst *);
-static void litter_scatter(xchar *, int, xchar, xchar, struct monst *);
-static void litter_newsyms(xchar *, xchar, xchar);
+static coordxy *litter_getpos(int *, coordxy, coordxy, struct monst *);
+static void litter_scatter(coordxy *, int, coordxy, coordxy, struct monst *);
+static void litter_newsyms(coordxy *, coordxy, coordxy);
static int repair_damage(struct monst *, struct damage *, boolean);
static void sub_one_frombill(struct obj *, struct monst *);
static void add_one_tobill(struct obj *, boolean, struct monst *);
{
coord mm;
- xchar sx = 0, sy = 0;
+ coordxy sx = 0, sy = 0;
choose_stairs(&sx, &sy, TRUE);
/* x,y is strictly inside shop */
char
-inside_shop(register xchar x, register xchar y)
+inside_shop(register coordxy x, register coordxy y)
{
register char rno;
/* robbery from outside the shop via telekinesis or grappling hook */
void
-remote_burglary(xchar x, xchar y)
+remote_burglary(coordxy x, coordxy y)
{
struct monst *shkp;
struct eshk *eshkp;
static void
home_shk(struct monst *shkp, boolean killkops)
{
- xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
+ coordxy x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
(void) mnearto(shkp, x, y, TRUE, RLOC_NOMSG);
g.level.flags.has_shop = 1;
the shop. These conditions must be checked by the calling function. */
/*ARGSUSED*/
void
-make_angry_shk(struct monst* shkp, xchar ox UNUSED, xchar oy UNUSED)
+make_angry_shk(struct monst* shkp, coordxy ox UNUSED, coordxy oy UNUSED)
/* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */
{
struct eshk *eshkp = ESHK(shkp);
static void
set_repo_loc(struct monst* shkp)
{
- register xchar ox, oy;
+ register coordxy ox, oy;
struct eshk *eshkp = ESHK(shkp);
/* if you're not in this shk's shop room, or if you're in its doorway
{
struct monst *shkp;
struct obj *top;
- xchar x, y;
+ coordxy x, y;
boolean freespot;
long cost = 0L;
boolean unpaid_only)
{
register struct obj *otmp, *top;
- xchar x, y;
+ coordxy x, y;
boolean on_floor, freespot;
for (top = obj; top->where == OBJ_CONTAINED; top = top->ocontainer)
long amt = 0L;
#if 0 /* if two shops share a wall, this might find wrong shk */
- xchar ox, oy;
+ coordxy ox, oy;
if (!get_obj_location(unp_obj, &ox, &oy, BURIED_TOO | CONTAINED_TOO))
ox = u.ux, oy = u.uy; /* (shouldn't happen) */
long
stolen_value(
struct obj *obj,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
boolean peaceful,
boolean silent)
{
}
void
-sellobj(register struct obj* obj, xchar x, xchar y)
+sellobj(register struct obj* obj, coordxy x, coordxy y)
{
register struct monst *shkp;
register struct eshk *eshkp;
/* shk catches thrown pick-axe */
struct monst *
-shkcatch(register struct obj* obj, register xchar x, register xchar y)
+shkcatch(register struct obj* obj, register coordxy x, register coordxy y)
{
register struct monst *shkp;
void
add_damage(
- register xchar x,
- register xchar y,
+ register coordxy x,
+ register coordxy y,
long cost)
{
struct damage *tmp_dam;
static boolean
repairable_damage(struct damage *dam, struct monst *shkp)
{
- xchar x, y;
+ coordxy x, y;
struct trap* ttmp;
struct monst *mtmp;
struct damage *dam = g.level.damagelist, *dam2, *prevdam = NULL;
while (dam) {
- xchar x = dam->place.x, y = dam->place.y;
+ coordxy x = dam->place.x, y = dam->place.y;
if (index(in_rooms(x, y, SHOPBASE), ESHK(shkp)->shoproom)) {
dam2 = dam->next;
#define horiz(i) ((i % 3) - 1)
#define vert(i) ((i / 3) - 1)
-static xchar *
-litter_getpos(int *k, xchar x, xchar y, struct monst *shkp)
+static coordxy *
+litter_getpos(int *k, coordxy x, coordxy y, struct monst *shkp)
{
- static xchar litter[9];
+ static xint16 litter[9];
int i, ix, iy;
(void) memset((genericptr_t) litter, 0, sizeof litter);
static void
litter_scatter(
- xchar *litter,
+ xint16 *litter,
int k,
- xchar x, xchar y,
+ coordxy x, coordxy y,
struct monst *shkp)
{
struct obj *otmp;
}
static void
-litter_newsyms(xchar *litter, xchar x, xchar y)
+litter_newsyms(xint16 *litter, coordxy x, coordxy y)
{
int i;
struct damage *tmp_dam,
boolean catchup)
{
- xchar x, y;
- xchar *litter;
+ coordxy x, y;
+ xint16 *litter;
struct obj *otmp;
struct trap *ttmp;
int k, disposition = 1;
int
shk_move(struct monst *shkp)
{
- xchar gx, gy, omx, omy;
+ coordxy gx, gy, omx, omy;
int udist;
schar appr;
struct eshk *eshkp = ESHK(shkp);
char shops_affected[5];
boolean uinshp = (*u.ushops != '\0');
char qbuf[80];
- xchar x, y;
+ coordxy x, y;
boolean dugwall = (!strcmp(dmgstr, "dig into") /* wand */
|| !strcmp(dmgstr, "damage")); /* pick-axe */
boolean animal, pursue;
if (yn(qbuf) != 'n') {
boolean is_seen, was_seen = canseemon(shkp),
was_outside = !inhishop(shkp);
- xchar sx = shkp->mx, sy = shkp->my;
+ coordxy sx = shkp->mx, sy = shkp->my;
cost_of_damage = check_credit(cost_of_damage, shkp);
if (cost_of_damage > 0L) {
/* called in dokick.c when we kick an object that might be in a store */
boolean
-costly_spot(register xchar x, register xchar y)
+costly_spot(register coordxy x, register coordxy y)
{
struct monst *shkp;
struct eshk *eshkp;
/* called by dotalk(sounds.c) when #chatting; returns obj if location
contains shop goods and shopkeeper is willing & able to speak */
struct obj *
-shop_object(register xchar x, register xchar y)
+shop_object(register coordxy x, register coordxy y)
{
register struct obj *otmp;
register struct monst *shkp;
}
void
-costly_gold(xchar x, xchar y, long amount, boolean silent)
+costly_gold(coordxy x, coordxy y, long amount, boolean silent)
{
register long delta;
register struct monst *shkp;
/* used in domove to block diagonal shop-exit */
/* x,y should always be a door */
boolean
-block_door(register xchar x, register xchar y)
+block_door(register coordxy x, register coordxy y)
{
register int roomno = *in_rooms(x, y, SHOPBASE);
register struct monst *shkp;
/* used in domove to block diagonal shop-entry;
u.ux, u.uy should always be a door */
boolean
-block_entry(register xchar x, register xchar y)
+block_entry(register coordxy x, register coordxy y)
{
- register xchar sx, sy;
+ register coordxy sx, sy;
register int roomno;
register struct monst *shkp;
shk_owns(char *buf, struct obj *obj)
{
struct monst *shkp;
- xchar x, y;
+ coordxy x, y;
if (get_obj_location(obj, &x, &y, 0)
&& (obj->unpaid || (obj->where == OBJ_FLOOR && !obj->no_charge
extern void mkmap(lev_init *);
-static boolean match_maptyps(xchar, xchar);
+static boolean match_maptyps(xint16, xint16);
static void solidify_map(void);
static void lvlfill_maze_grid(int, int, int, int, schar);
static void lvlfill_solid(schar, schar);
static void flip_visuals(int, int, int, int, int);
static int flip_encoded_direction_bits(int, int);
static void sel_set_wall_property(int, int, genericptr_t);
-static void set_wall_property(xchar, xchar, xchar, xchar, int);
+static void set_wall_property(coordxy, coordxy, coordxy, coordxy, int);
static void count_features(void);
static void remove_boundary_syms(void);
static void set_door_orientation(int, int);
static void link_doors_rooms(void);
static int rnddoor(void);
static int rndtrap(void);
-static void get_location(xchar *, xchar *, getloc_flags_t, struct mkroom *);
-static void set_ok_location_func(boolean (*)(xchar, xchar));
-static boolean is_ok_location(xchar, xchar, getloc_flags_t);
+static void get_location(coordxy *, coordxy *, getloc_flags_t, struct mkroom *);
+static void set_ok_location_func(boolean (*)(coordxy, coordxy));
+static boolean is_ok_location(coordxy, coordxy, getloc_flags_t);
static unpacked_coord get_unpacked_coord(long, int);
-static void get_room_loc(xchar *, xchar *, struct mkroom *);
-static void get_free_room_loc(xchar *, xchar *, struct mkroom *,
+static void get_room_loc(coordxy *, coordxy *, struct mkroom *);
+static void get_free_room_loc(coordxy *, coordxy *, struct mkroom *,
packed_coord);
-static boolean create_subroom(struct mkroom *, xchar, xchar, xchar,
- xchar, xchar, xchar);
+static boolean create_subroom(struct mkroom *, coordxy, coordxy, coordxy,
+ coordxy, xint16, xint16);
static void create_door(room_door *, struct mkroom *);
static void create_trap(spltrap *, struct mkroom *);
static int noncoalignment(aligntyp);
static void create_monster(monster *, struct mkroom *);
static void create_object(object *, struct mkroom *);
static void create_altar(altar *, struct mkroom *);
-static boolean search_door(struct mkroom *, xchar *, xchar *, xchar, int);
+static boolean search_door(struct mkroom *, coordxy *, coordxy *, coordxy, int);
static void create_corridor(corridor *);
static struct mkroom *build_room(room *, struct mkroom *);
static void light_region(region *);
static int get_table_region(lua_State *, const char *, lua_Integer *,
lua_Integer *, lua_Integer *, lua_Integer *, boolean);
static void set_wallprop_in_selection(lua_State *, int);
-static xchar random_wdir(void);
+static coordxy random_wdir(void);
static int floodfillchk_match_under(int, int);
static int floodfillchk_match_accessible(int, int);
-static boolean sel_flood_havepoint(int, int, xchar *, xchar *, int);
+static boolean sel_flood_havepoint(int, int, coordxy *, coordxy *, int);
static long line_dist_coord(long, long, long, long, long, long);
static void l_push_mkroom_table(lua_State *, struct mkroom *);
static int get_table_align(lua_State *);
/* Does typ match with levl[][].typ, considering special types
MATCH_WALL and MAX_TYPE (aka transparency)? */
static boolean
-match_maptyps(xchar typ, xchar levltyp)
+match_maptyps(xint16 typ, xint16 levltyp)
{
if ((typ == MATCH_WALL) && !IS_STWALL(levltyp))
return FALSE;
static void
solidify_map(void)
{
- xchar x, y;
+ coordxy x, y;
for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++)
* Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able
*/
static void
-set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop)
+set_wall_property(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int prop)
{
- register xchar x, y;
+ register coordxy x, y;
x1 = max(x1, 1);
x2 = min(x2, COLNO - 1);
static void
count_features(void)
{
- xchar x, y;
+ coordxy x, y;
g.level.flags.nfountains = g.level.flags.nsinks = 0;
for (y = 0; y < ROWNO; y++)
* are laid out. CROSSWALLS are used to specify "invisible"
* boundaries where DOOR syms look bad or aren't desirable.
*/
- xchar x, y;
+ coordxy x, y;
boolean has_bounds = FALSE;
for (x = 0; x < COLNO - 1; x++)
*/
static void
get_location(
- xchar *x, xchar *y,
+ coordxy *x, coordxy *y,
getloc_flags_t humidity,
struct mkroom *croom)
{
}
}
-static boolean (*is_ok_location_func)(xchar, xchar) = NULL;
+static boolean (*is_ok_location_func)(coordxy, coordxy) = NULL;
static void
-set_ok_location_func(boolean (*func)(xchar, xchar))
+set_ok_location_func(boolean (*func)(coordxy, coordxy))
{
is_ok_location_func = func;
}
static boolean
-is_ok_location(xchar x, xchar y, getloc_flags_t humidity)
+is_ok_location(coordxy x, coordxy y, getloc_flags_t humidity)
{
register int typ = levl[x][y].typ;
void
get_location_coord(
- xchar *x, xchar *y,
+ coordxy *x, coordxy *y,
int humidity,
struct mkroom *croom,
long crd)
* negative values for x or y means RANDOM!
*/
static void
-get_room_loc(xchar *x, xchar *y, struct mkroom *croom)
+get_room_loc(coordxy *x, coordxy *y, struct mkroom *croom)
{
coord c;
*/
static void
get_free_room_loc(
- xchar *x, xchar *y,
+ coordxy *x, coordxy *y,
struct mkroom *croom,
packed_coord pos)
{
- xchar try_x, try_y;
+ coordxy try_x, try_y;
register int trycnt = 0;
get_location_coord(&try_x, &try_y, DRY, croom, pos);
boolean
check_room(
- xchar *lowx, xchar *ddx,
- xchar *lowy, xchar *ddy,
+ coordxy *lowx, coordxy *ddx,
+ coordxy *lowy, coordxy *ddy,
boolean vault)
{
register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy;
register struct rm *lev;
int xlim, ylim, ymax;
- xchar s_lowx, s_ddx, s_lowy, s_ddy;
+ coordxy s_lowx, s_ddx, s_lowy, s_ddy;
s_lowx = *lowx; s_ddx = *ddx;
s_lowy = *lowy; s_ddy = *ddy;
*/
boolean
create_room(
- xchar x, xchar y,
- xchar w, xchar h,
- xchar xal, xchar yal,
- xchar rtype, xchar rlit)
+ coordxy x, coordxy y,
+ coordxy w, coordxy h,
+ coordxy xal, coordxy yal,
+ xint16 rtype, xint16 rlit)
{
- xchar xabs = 0, yabs = 0;
+ coordxy xabs = 0, yabs = 0;
int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp;
NhRect *r1 = 0, r2;
int trycnt = 0;
* it up.
*/
do {
- xchar xborder, yborder;
+ coordxy xborder, yborder;
wtmp = w;
htmp = h;
if ((xtmp < 0 && ytmp < 0 && wtmp < 0 && xaltmp < 0 && yaltmp < 0)
|| vault) {
- xchar hx, hy, lx, ly, dx, dy;
+ coordxy hx, hy, lx, ly, dx, dy;
r1 = rnd_rect(); /* Get a random rectangle */
r2.hy = yabs + htmp;
} else { /* Only some parameters are random */
int rndpos = 0;
- xchar dx, dy;
+ coordxy dx, dy;
if (xtmp < 0 && ytmp < 0) { /* Position is RANDOM */
xtmp = rnd(5);
static boolean
create_subroom(
struct mkroom *proom,
- xchar x, xchar y,
- xchar w, xchar h,
- xchar rtype, xchar rlit)
+ coordxy x, coordxy y,
+ coordxy w, coordxy h,
+ xint16 rtype, xint16 rlit)
{
- xchar width, height;
+ coordxy width, height;
width = proom->hx - proom->lx + 1;
height = proom->hy - proom->ly + 1;
static void
create_trap(spltrap* t, struct mkroom* croom)
{
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
coord tm;
int mktrap_flags = MKTRAP_MAZEFLAG;
create_monster(monster* m, struct mkroom* croom)
{
struct monst *mtmp;
- xchar x, y;
+ coordxy x, y;
char class;
unsigned int amask;
coord cc;
create_object(object* o, struct mkroom* croom)
{
struct obj *otmp;
- xchar x, y;
+ coordxy x, y;
char c;
boolean named; /* has a name been supplied in level description? */
create_altar(altar* a, struct mkroom* croom)
{
schar sproom;
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
unsigned int amask;
boolean croom_is_temple = TRUE;
static boolean
search_door(
struct mkroom* croom,
- xchar *x, xchar * y,
- xchar wall, int cnt)
+ coordxy *x, coordxy * y,
+ xint16 wall, int cnt)
{
int dx, dy;
int xx, yy;
{
boolean okroom;
struct mkroom *aroom;
- xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM;
+ xint16 rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM;
if (mkr) {
aroom = &g.subrooms[g.nsubroom];
if (--tryct < 0)
break; /* give up */
} while (!(x % 2) || !(y % 2) || SpLev_Map[x][y]
- || !is_ok_location((xchar) x, (xchar) y, humidity));
+ || !is_ok_location((coordxy) x, (coordxy) y, humidity));
- m->x = (xchar) x, m->y = (xchar) y;
+ m->x = (coordxy) x, m->y = (coordxy) y;
}
/*
fill_empty_maze(void)
{
int mapcountmax, mapcount, mapfact;
- xchar x, y;
+ coordxy x, y;
coord mm;
mapcountmax = mapcount = (g.x_maze_max - 2) * (g.y_maze_max - 2);
int etyp = DUST;
char *txt = (char *) 0;
long ecoord;
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
int argc = lua_gettop(L);
create_des_coder();
/* callback for is_ok_location.
stairs generated at random location shouldn't overwrite special terrain */
static boolean
-good_stair_loc(xchar x, xchar y)
+good_stair_loc(coordxy x, coordxy y)
{
schar typ = levl[x][y].typ;
static const char *const stairdirs[] = { "down", "up", NULL };
static const int stairdirs2i[] = { 0, 1 };
int argc = lua_gettop(L);
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
struct trap *badtrap;
long scoord;
lspo_grave(lua_State *L)
{
int argc = lua_gettop(L);
- xchar x, y;
+ coordxy x, y;
long scoord;
lua_Integer ax,ay;
char *txt;
lspo_gold(lua_State *L)
{
int argc = lua_gettop(L);
- xchar x, y;
+ coordxy x, y;
long amount;
long gcoord;
lua_Integer gx, gy;
return tmps;
}
-xchar
+coordxy
selection_getpoint(int x, int y, struct selectionvar* sel)
{
if (!sel || !sel->map)
}
void
-selection_setpoint(int x, int y, struct selectionvar* sel, xchar c)
+selection_setpoint(int x, int y, struct selectionvar* sel, coordxy c)
{
if (!sel || !sel->map)
return;
}
struct selectionvar *
-selection_filter_mapchar(struct selectionvar* ov, xchar typ, int lit)
+selection_filter_mapchar(struct selectionvar* ov, coordxy typ, int lit)
{
int x, y;
struct selectionvar *ret;
}
int
-selection_rndcoord(struct selectionvar* ov, xchar *x, xchar *y, boolean removeit)
+selection_rndcoord(struct selectionvar* ov, coordxy *x, coordxy *y, boolean removeit)
{
int idx = 0;
int c;
}
/* Choose a single random W_* direction. */
-static xchar
+static coordxy
random_wdir(void)
{
- static const xchar wdirs[4] = { W_NORTH, W_SOUTH, W_EAST, W_WEST };
+ static const coordxy wdirs[4] = { W_NORTH, W_SOUTH, W_EAST, W_WEST };
return wdirs[rn2(4)];
}
}
void
-set_floodfillchk_match_under(xchar typ)
+set_floodfillchk_match_under(coordxy typ)
{
floodfillchk_match_under_typ = typ;
set_selection_floodfillchk(floodfillchk_match_under);
/* check whethere <x,y> is already in xs[],ys[] */
static boolean
-sel_flood_havepoint(int x, int y, xchar xs[], xchar ys[], int n)
+sel_flood_havepoint(int x, int y, coordxy xs[], coordxy ys[], int n)
{
- xchar xx = (xchar) x, yy = (xchar) y;
+ coordxy xx = (coordxy) x, yy = (coordxy) y;
while (n > 0) {
--n;
} while (0)
static const char floodfill_stack_overrun[] = "floodfill stack overrun";
int idx = 0;
- xchar dx[SEL_FLOOD_STACK];
- xchar dy[SEL_FLOOD_STACK];
+ coordxy dx[SEL_FLOOD_STACK];
+ coordxy dy[SEL_FLOOD_STACK];
if (selection_flood_check_func == (int (*)(int, int)) 0) {
selection_free(tmp, TRUE);
/* bresenham line algo */
void
selection_do_line(
- xchar x1, xchar y1,
- xchar x2, xchar y2,
+ coordxy x1, coordxy y1,
+ coordxy x2, coordxy y2,
struct selectionvar *ov)
{
int d0, dx, dy, ai, bi, xi, yi;
void
selection_do_randline(
- xchar x1, xchar y1,
- xchar x2, xchar y2,
+ coordxy x1, coordxy y1,
+ coordxy x2, coordxy y2,
schar rough,
schar rec,
struct selectionvar *ov)
static void
sel_set_door(int dx, int dy, genericptr_t arg)
{
- xchar typ = *(xchar *) arg;
- xchar x = dx, y = dy;
+ coordxy typ = *(coordxy *) arg;
+ coordxy x = dx, y = dy;
if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR)
levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR;
-1, D_ISOPEN, D_CLOSED, D_LOCKED, D_NODOOR, D_BROKEN, D_SECRET
};
int msk;
- xchar x, y;
- xchar typ;
+ coordxy x, y;
+ coordxy typ;
int argc = lua_gettop(L);
create_des_coder();
msk = doorstates2i[get_table_option(L, "state", "random", doorstates)];
}
- typ = (msk == -1) ? rnddoor() : (xchar) msk;
+ typ = (msk == -1) ? rnddoor() : (coordxy) msk;
if (x == -1 && y == -1) {
static const char *const walldirs[] = {
nhl_abs_coord(lua_State *L)
{
int argc = lua_gettop(L);
- xchar x = -1, y = -1;
+ coordxy x = -1, y = -1;
if (argc == 2) {
- x = (xchar) lua_tointeger(L, 1);
- y = (xchar) lua_tointeger(L, 2);
+ x = (coordxy) lua_tointeger(L, 1);
+ y = (coordxy) lua_tointeger(L, 2);
x += g.xstart;
y += g.ystart;
lua_pushinteger(L, x);
lua_pushinteger(L, y);
return 2;
} else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
- x = (xchar) get_table_int(L, "x");
- y = (xchar) get_table_int(L, "y");
+ x = (coordxy) get_table_int(L, "x");
+ y = (coordxy) get_table_int(L, "y");
x += g.xstart;
y += g.ystart;
lua_newtable(L);
"throne", "tree", NULL };
static const int features2i[] = { FOUNTAIN, SINK, POOL,
THRONE, TREE, STONE };
- xchar x, y;
+ coordxy x, y;
int typ;
int argc = lua_gettop(L);
boolean can_have_flags = FALSE;
lspo_terrain(lua_State *L)
{
terrain tmpterrain;
- xchar x = 0, y = 0;
+ coordxy x = 0, y = 0;
struct selectionvar *sel = NULL;
int argc = lua_gettop(L);
int
lspo_replace_terrain(lua_State *L)
{
- xchar totyp, fromtyp;
+ coordxy totyp, fromtyp;
struct mapfragment *mf = NULL;
struct selectionvar *sel = NULL;
boolean freesel = FALSE;
if (x1 == -1 && y1 == -1 && x2 == -1 && y2 == -1) {
(void) selection_not(sel);
} else {
- xchar rx1, ry1, rx2, ry2;
+ coordxy rx1, ry1, rx2, ry2;
rx1 = x1, ry1 = y1, rx2 = x2, ry2 = y2;
get_location(&rx1, &ry1, ANY_LOC, g.coder->croom);
get_location(&rx2, &ry2, ANY_LOC, g.coder->croom);
WAN_TELEPORTATION, SCR_TELEPORTATION, RIN_TELEPORTATION
};
struct selectionvar *ov2 = selection_new(), *ov3;
- xchar x, y;
+ coordxy x, y;
boolean res = TRUE;
selection_floodfill(ov2, nx, ny, TRUE);
int
lspo_region(lua_State *L)
{
- xchar dx1, dy1, dx2, dy2;
+ coordxy dx1, dy1, dx2, dy2;
register struct mkroom *troom;
boolean do_arrival_room = FALSE, room_not_needed,
irregular = FALSE, joined = TRUE;
"open", "closed", "random", NULL
};
static const int dbopens2i[] = { 1, 0, -1, -2 };
- xchar x, y;
+ coordxy x, y;
lua_Integer mx, my;
int dir;
int db_open;
static const int mwdirs2i[] = {
W_NORTH, W_SOUTH, W_EAST, W_WEST, W_RANDOM, -2
};
- xchar x, y;
+ coordxy x, y;
lua_Integer mx, my;
- xchar ftyp = ROOM;
+ coordxy ftyp = ROOM;
int fstocked = 1, dir = -1;
long mcoord;
int argc = lua_gettop(L);
{
static const char *const wprops[] = { "nondiggable", "nonpasswall", NULL };
static const int wprop2i[] = { W_NONDIGGABLE, W_NONPASSWALL, -1 };
- xchar dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1;
+ coordxy dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1;
int wprop;
create_des_coder();
g.xsize = COLNO - 1;
g.ysize = ROWNO;
} else {
- xchar mptyp;
+ coordxy mptyp;
/* Themed rooms should never overwrite anything */
if (g.in_mk_themerooms) {
boolean
enexto(
coord *cc,
- xchar xx, xchar yy,
+ coordxy xx, coordxy yy,
struct permonst *mdat)
{
return (enexto_core(cc, xx, yy, mdat, GP_CHECKSCARY)
boolean
enexto_core(
coord *cc,
- xchar xx, xchar yy,
+ coordxy xx, coordxy yy,
struct permonst *mdat,
mmflags_nht entflags)
{
}
if (ball_active && (ball_still_in_range || allow_drag)) {
int bc_control;
- xchar ballx, bally, chainx, chainy;
+ coordxy ballx, bally, chainx, chainy;
boolean cause_delay;
if (drag_ball(nux, nuy, &bc_control, &ballx, &bally, &chainx,
}
if (wizard && !strcmp(buf, "?")) {
schar destlev;
- xchar destdnum;
+ coordxy destdnum;
levTport_menu:
destlev = 0;
boolean
rloco(register struct obj* obj)
{
- register xchar tx, ty, otx, oty;
+ register coordxy tx, ty, otx, oty;
boolean restricted_fall;
int try_limit = 4000;
struct obj *egg;
struct monst *mon, *mon2;
coord cc;
- xchar x, y;
+ coordxy x, y;
boolean yours, silent, knows_egg = FALSE;
boolean cansee_hatchspot = FALSE;
int i, mnum, hatchcount = 0;
{
struct obj *obj = arg->a_obj;
boolean canseeit, many, menorah, need_newsym, need_invupdate;
- xchar x, y;
+ coordxy x, y;
char whose[BUFSZ];
menorah = obj->otyp == CANDELABRUM_OF_INVOCATION;
}
if (obj->lamplit && !already_lit) {
- xchar x, y;
+ coordxy x, y;
if (get_obj_location(obj, &x, &y, CONTAINED_TOO | BURIED_TOO))
new_light_source(x, y, radius, LS_OBJECT, obj_to_any(obj));
}
} else if (curr->kind == TIMER_LEVEL) {
long where = curr->arg.a_long;
- xchar x = (xchar) ((where >> 16) & 0xFFFF),
- y = (xchar) (where & 0xFFFF);
+ coordxy x = (coordxy) ((where >> 16) & 0xFFFF),
+ y = (coordxy) (where & 0xFFFF);
if (!isok(x, y)) {
impossible("timer sanity: spot timer %lu at <%d,%d>",
*
*/
void
-spot_stop_timers(xchar x, xchar y, short func_index)
+spot_stop_timers(coordxy x, coordxy y, short func_index)
{
timeout_proc cleanup_func;
timer_element *curr, *prev, *next_timer = 0;
* Returns 0L if no such timer.
*/
long
-spot_time_expires(xchar x, xchar y, short func_index)
+spot_time_expires(coordxy x, coordxy y, short func_index)
{
timer_element *curr;
long where = (((long) x << 16) | ((long) y));
}
long
-spot_time_left(xchar x, xchar y, short func_index)
+spot_time_left(coordxy x, coordxy y, short func_index)
{
long expires = spot_time_expires(x, y, func_index);
return (expires > 0L) ? expires - g.moves : 0L;
extern const char *const destroy_strings[][3]; /* from zap.c */
-static void mk_trap_statue(xchar, xchar);
+static void mk_trap_statue(coordxy, coordxy);
static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *,
struct obj *);
static boolean mu_maybe_destroy_web(struct monst *, boolean, struct trap *);
static char *trapnote(struct trap *, boolean);
static int choose_trapnote(struct trap *);
static int steedintrap(struct trap *, struct obj *);
-static void launch_drop_spot(struct obj *, xchar, xchar);
+static void launch_drop_spot(struct obj *, coordxy, coordxy);
static boolean find_random_launch_coord(struct trap *, coord *);
-static int mkroll_launch(struct trap *, xchar, xchar, short, long);
+static int mkroll_launch(struct trap *, coordxy, coordxy, short, long);
static boolean isclearpath(coord *, int, schar, schar);
static void dofiretrap(struct obj *);
static void domagictrap(void);
/* create a "living" statue at x,y */
static void
-mk_trap_statue(xchar x, xchar y)
+mk_trap_statue(coordxy x, coordxy y)
{
struct monst *mtmp;
struct obj *otmp, *statue;
struct monst *
animate_statue(
struct obj *statue,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
int cause,
int *fail_reason)
{
struct monst *
activate_statue_trap(
struct trap *trap,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
boolean shatter)
{
struct monst *mtmp = (struct monst *) 0;
if (mtmp->m_id == steed_mid) {
/* move saddle */
- xchar x, y;
+ coordxy x, y;
if (get_obj_location(objchn, &x, &y, 0)) {
obj_extract_self(saddle);
place_object(saddle, x, y);
if (amorphous(mptr) || is_whirly(mptr) || flaming(mptr)
|| unsolid(mptr) || mptr == &mons[PM_GELATINOUS_CUBE]) {
- xchar x = trap->tx;
- xchar y = trap->ty;
+ coordxy x = trap->tx;
+ coordxy y = trap->ty;
if (flaming(mptr) || acidic(mptr)) {
if (domsg) {
boolean trapkilled = FALSE;
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
struct permonst *mptr = mtmp->data;
- xchar tx = trap->tx, ty = trap->ty;
+ coordxy tx = trap->tx, ty = trap->ty;
if (rn2(3))
return Trap_Effect_Finished; /* monsters usually don't set it off */
}
static void
-launch_drop_spot(struct obj* obj, xchar x, xchar y)
+launch_drop_spot(struct obj* obj, coordxy x, coordxy y)
{
if (!obj) {
g.launchplace.obj = (struct obj *) 0;
int distance;
int mindist = 4;
int trycount = 0;
- xchar dx, dy;
- xchar x, y;
+ coordxy dx, dy;
+ coordxy x, y;
if (!ttmp || !cc)
return FALSE;
static int
mkroll_launch(
struct trap *ttmp,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
short otyp,
long ocount)
{
{
struct trap *t;
uchar typ;
- xchar x, y;
+ coordxy x, y;
x = cc->x;
y = cc->y;
fire_damage(
struct obj *obj,
boolean force,
- xchar x,
- xchar y)
+ coordxy x,
+ coordxy y)
{
int chance;
struct obj *otmp, *ncobj;
struct obj *chain,
boolean force,
boolean here,
- xchar x,
- xchar y)
+ coordxy x,
+ coordxy y)
{
struct obj *obj, *nobj;
int num = 0;
/* obj has been thrown or dropped into lava; damage is worse than mere fire */
boolean
-lava_damage(struct obj* obj, xchar x, xchar y)
+lava_damage(struct obj* obj, coordxy x, coordxy y)
{
int otyp = obj->otyp, ocls = obj->oclass;
boolean here)
{
struct obj *otmp;
- xchar x, y;
+ coordxy x, y;
if (!obj)
return;
move_into_trap(struct trap *ttmp)
{
int bc = 0;
- xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
+ coordxy x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
boolean unused;
bx = by = cx = cy = 0; /* lint suppression */
struct monst *shkp = 0;
long loss = 0L;
boolean costly, insider;
- xchar ox = obj->ox, oy = obj->oy;
+ coordxy ox = obj->ox, oy = obj->oy;
/* the obj location need not be that of player */
costly = (costly_spot(ox, oy)
}
void
-trap_ice_effects(xchar x, xchar y, boolean ice_is_melting)
+trap_ice_effects(coordxy x, coordxy y, boolean ice_is_melting)
{
struct trap *ttmp = t_at(x, y);
static void restfakecorr(struct monst *);
static void parkguard(struct monst *);
static boolean in_fcorridor(struct monst *, int, int);
-static boolean find_guard_dest(struct monst *, xchar *, xchar *);
+static boolean find_guard_dest(struct monst *, coordxy *, coordxy *);
static void move_gold(struct obj *, int);
static void wallify_vault(struct monst *);
static void gd_mv_monaway(struct monst *, int, int);
}
static boolean
-find_guard_dest(struct monst *guard, xchar *rx, xchar *ry)
+find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry)
{
register int x, y, dd, lx, ly;
/* if time ok and no guard now. */
char buf[BUFSZ];
int x, y, gx, gy, typ;
- xchar rx, ry;
+ coordxy rx, ry;
long umoney;
/* first find the goal for the guard */
dug into an empty doorway (which could subsequently have
been plugged with an intact door by use of locking magic) */
int vlt = EGD(guard)->vroom;
- xchar lowx = g.rooms[vlt].lx, hix = g.rooms[vlt].hx;
- xchar lowy = g.rooms[vlt].ly, hiy = g.rooms[vlt].hy;
+ coordxy lowx = g.rooms[vlt].lx, hix = g.rooms[vlt].hx;
+ coordxy lowy = g.rooms[vlt].ly, hiy = g.rooms[vlt].hy;
if (x == lowx - 1 && y == lowy - 1)
typ = TLCORNER;
static void
move_gold(struct obj *gold, int vroom)
{
- xchar nx, ny;
+ coordxy nx, ny;
remove_object(gold);
newsym(gold->ox, gold->oy);
int x, y, typ;
int vlt = EGD(grd)->vroom;
char tmp_viz;
- xchar lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
+ coordxy lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
loy = g.rooms[vlt].ly - 1, hiy = g.rooms[vlt].hy + 1;
struct monst *mon;
struct obj *gold, *rocks;
gdelta = distu(guardx, guardy);
if (gdelta > 2 && see_it) { /* skip if player won't see it */
bestdelta = gdelta;
- bestcc.x = (xchar) guardx, bestcc.y = (xchar) guardy;
+ bestcc.x = (coordxy) guardx, bestcc.y = (coordxy) guardy;
tryct = 9;
do {
/* pick an available spot nearest the hero and also try
* @...X +4
*
*/
-const xchar circle_data[] = {
+const coordxy circle_data[] = {
/* 0*/ 0,
/* 1*/ 1, 1,
/* 3*/ 2, 2, 1,
* used for a single point: temporary light source of a camera flash
* as it traverses its path.
*/
-const xchar circle_start[] = {
+const coordxy circle_start[] = {
/* 0*/ 0,
/* 1*/ 1,
/* 2*/ 3,
/*------ local variables ------*/
-static xchar could_see[2][ROWNO][COLNO]; /* vision work space */
-static xchar *cs_rows0[ROWNO], *cs_rows1[ROWNO];
-static xchar cs_rmin0[ROWNO], cs_rmax0[ROWNO];
-static xchar cs_rmin1[ROWNO], cs_rmax1[ROWNO];
+static coordxy could_see[2][ROWNO][COLNO]; /* vision work space */
+static coordxy *cs_rows0[ROWNO], *cs_rows1[ROWNO];
+static coordxy cs_rmin0[ROWNO], cs_rmax0[ROWNO];
+static coordxy cs_rmin1[ROWNO], cs_rmax1[ROWNO];
static char viz_clear[ROWNO][COLNO]; /* vision clear/blocked map */
static char *viz_clear_rows[ROWNO];
-static xchar left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */
-static xchar right_ptrs[ROWNO][COLNO];
+static coordxy left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */
+static coordxy right_ptrs[ROWNO][COLNO];
/* Forward declarations. */
static void fill_point(int, int);
static void dig_point(int, int);
static void view_init(void);
-static void view_from(int, int, xchar **, xchar *, xchar *, int,
+static void view_from(int, int, coordxy **, coordxy *, coordxy *, int,
void (*)(int, int, genericptr_t),
genericptr_t);
-static void get_unused_cs(xchar ***, xchar **, xchar **);
-static void rogue_vision(xchar **, xchar *, xchar *);
+static void get_unused_cs(coordxy ***, coordxy **, coordxy **);
+static void rogue_vision(coordxy **, coordxy *, coordxy *);
/* Macro definitions that I can't find anywhere. */
#define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0))
* to the unused vision work area.
*/
static void
-get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax)
+get_unused_cs(coordxy ***rows, coordxy **rmin, coordxy **rmax)
{
register int row;
- register xchar *nrmin, *nrmax;
+ register coordxy *nrmin, *nrmax;
if (g.viz_array == cs_rows0) {
*rows = cs_rows1;
nrmin = *rmin;
nrmax = *rmax;
- (void) memset((genericptr_t) **rows, 0, sizeof(xchar) * (ROWNO * COLNO)); /* see nothing */
+ (void) memset((genericptr_t) **rows, 0, sizeof(coordxy) * (ROWNO * COLNO)); /* see nothing */
for (row = 0; row < ROWNO; row++) { /* set row min & max */
*nrmin++ = COLNO - 1;
*nrmax++ = 1;
* due to the one-sided lit wall hack.
*/
static void
-rogue_vision(xchar **next, xchar *rmin, xchar *rmax)
+rogue_vision(coordxy **next, coordxy *rmin, coordxy *rmax)
{
int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */
int start, stop, in_door, xhi, xlo, yhi, ylo;
{
extern unsigned char seenv_matrix[3][3]; /* from display.c */
static unsigned char colbump[COLNO + 1]; /* cols to bump sv */
- xchar **temp_array; /* points to the old vision array */
- xchar **next_array; /* points to the new vision array */
- xchar *next_row; /* row pointer for the new array */
- xchar *old_row; /* row pointer for the old array */
- xchar *next_rmin; /* min pointer for the new array */
- xchar *next_rmax; /* max pointer for the new array */
- const xchar *ranges; /* circle ranges -- used for xray & night vision */
+ coordxy **temp_array; /* points to the old vision array */
+ coordxy **next_array; /* points to the new vision array */
+ coordxy *next_row; /* row pointer for the new array */
+ coordxy *old_row; /* row pointer for the old array */
+ coordxy *next_rmin; /* min pointer for the new array */
+ coordxy *next_rmax; /* max pointer for the new array */
+ const coordxy *ranges; /* circle ranges -- used for xray & night vision */
int row = 0; /* row counter (outer loop) */
int start, stop; /* inner loop starting/stopping index */
int dx, dy; /* one step from a lit door or lit wall (see below) */
static int start_row;
static int start_col;
static int step;
-static xchar **cs_rows;
-static xchar *cs_left;
-static xchar *cs_right;
+static coordxy **cs_rows;
+static coordxy *cs_left;
+static coordxy *cs_right;
static void (*vis_func)(int, int, genericptr_t);
static genericptr_t varg;
/*
* Defines local to Algorithm C.
*/
-static void right_side(int, int, int, const xchar *);
-static void left_side(int, int, int, const xchar *);
+static void right_side(int, int, int, const coordxy *);
+static void left_side(int, int, int, const coordxy *);
/* Initialize algorithm C (nothing). */
static void
* limits points at range limit for current row, or NULL
*/
static void
-right_side(int row, int left, int right_mark, const xchar *limits)
+right_side(int row, int left, int right_mark, const coordxy *limits)
{
int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */
int deeper; /* if TRUE, call self as needed */
int result; /* set by q?_path() */
register int i; /* loop counter */
- register xchar *rowp = NULL; /* row optimization */
- xchar *row_min = NULL; /* left most [used by macro set_min()] */
- xchar *row_max = NULL; /* right most [used by macro set_max()] */
+ register coordxy *rowp = NULL; /* row optimization */
+ coordxy *row_min = NULL; /* left most [used by macro set_min()] */
+ coordxy *row_max = NULL; /* right most [used by macro set_max()] */
int lim_max; /* right most limit of circle */
nrow = row + step;
* extensive comments.
*/
static void
-left_side(int row, int left_mark, int right, const xchar *limits)
+left_side(int row, int left_mark, int right, const coordxy *limits)
{
int left, left_edge, nrow, deeper, result;
register int i;
- register xchar *rowp = NULL;
- xchar *row_min = NULL;
- xchar *row_max = NULL;
+ register coordxy *rowp = NULL;
+ coordxy *row_min = NULL;
+ coordxy *row_max = NULL;
int lim_min;
#ifdef GCC_WARN
* arg argument for func
*/
static void
-view_from(int srow, int scol, xchar **loc_cs_rows,
- xchar *left_most, xchar *right_most, int range,
+view_from(int srow, int scol, coordxy **loc_cs_rows,
+ coordxy *left_most, coordxy *right_most, int range,
void (*func)(int, int, genericptr_t), genericptr_t arg)
{
register int i; /* loop counter */
- xchar *rowp; /* optimization for setting could_see */
+ coordxy *rowp; /* optimization for setting could_see */
int nrow; /* the next row */
int left; /* the left-most visible column */
int right; /* the right-most visible column */
- const xchar *limits; /* range limit for next row */
+ const coordxy *limits; /* range limit for next row */
/* Set globals for q?_path(), left_side(), and right_side() to use. */
start_col = scol;
if (right > scol + range)
right = scol + range;
} else
- limits = (xchar *) 0;
+ limits = (coordxy *) 0;
if (func) {
for (i = left; i <= right; i++)
{
/* If not centered on hero, do the hard work of figuring the area */
if (scol != u.ux || srow != u.uy) {
- view_from(srow, scol, (xchar **) 0, (xchar *) 0, (xchar *) 0, range,
+ view_from(srow, scol, (coordxy **) 0, (coordxy *) 0, (coordxy *) 0, range,
func, arg);
} else {
register int x;
int y, min_x, max_x, max_y, offset;
- const xchar *limits;
+ const coordxy *limits;
boolean override_vision;
/* vision doesn't pass through water or clouds, detection should
char, int, int, const char *, unsigned int);
static void hup_end_menu(winid, const char *);
static void hup_putstr(winid, int, const char *);
-static void hup_print_glyph(winid, xchar, xchar, const glyph_info *,
+static void hup_print_glyph(winid, coordxy, coordxy, const glyph_info *,
const glyph_info *);
static void hup_outrip(winid, int, time_t);
static void hup_curs(winid, int, int);
/*ARGSUSED*/
static void
hup_print_glyph(winid window UNUSED,
- xchar x UNUSED, xchar y UNUSED,
+ coordxy x UNUSED, coordxy y UNUSED,
const glyph_info *glyphinfo UNUSED,
const glyph_info *bkglyphinfo UNUSED)
{
heal or for guardians (Kops) to congregate at to block hero's progress */
void
choose_stairs(
- xchar *sx, xchar *sy, /* output; left as-is if no spot found */
+ coordxy *sx, coordxy *sy, /* output; left as-is if no spot found */
boolean dir) /* True: forward, False: backtrack (usually up) */
{
stairway *stway;
tactics(struct monst *mtmp)
{
unsigned long strat = strategy(mtmp);
- xchar sx = 0, sy = 0, mx, my;
+ coordxy sx = 0, sy = 0, mx, my;
mtmp->mstrategy =
(mtmp->mstrategy & (STRAT_WAITMASK | STRAT_APPEARMSG)) | strat;
default: /* kill, maim, pillage! */
{
long where = (strat & STRAT_STRATMASK);
- xchar tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat);
+ coordxy tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat);
int targ = (int) (strat & STRAT_GOAL);
struct obj *otmp;
/* worm segment structure */
struct wseg {
struct wseg *nseg;
- xchar wx, wy; /* the segment's position */
+ coordxy wx, wy; /* the segment's position */
};
static void toss_wsegs(struct wseg *, boolean);
* that both halves will survive.
*/
void
-cutworm(struct monst *worm, xchar x, xchar y,
+cutworm(struct monst *worm, coordxy x, coordxy y,
boolean cuttier) /* hit is by wielded blade or axe or by thrown axe */
{
struct wseg *curr, *new_tail;
struct wseg *curr = wtails[worm->wormno];
while (curr != wheads[worm->wormno]) {
- xchar x = curr->wx, y = curr->wy;
+ coordxy x = curr->wx, y = curr->wy;
struct monst *mtmp = m_at(x, y);
if (oldworm && mtmp == oldworm)
* be, if somehow the head is disjoint from the tail.
*/
void
-place_worm_tail_randomly(struct monst *worm, xchar x, xchar y)
+place_worm_tail_randomly(struct monst *worm, coordxy x, coordxy y)
{
int wnum = worm->wormno;
struct wseg *curr = wtails[wnum];
#endif
{
place_worm_seg(worm, nx, ny);
- curr->wx = (xchar) (ox = nx);
- curr->wy = (xchar) (oy = ny);
+ curr->wx = (coordxy) (ox = nx);
+ curr->wy = (coordxy) (oy = ny);
wtails[wnum] = curr;
curr = curr->nseg;
wtails[wnum]->nseg = new_tail;
if (worm && worm->wormno && m_at(x, y) == worm) {
struct wseg *curr;
int i, n;
- xchar wx = (xchar) x, wy = (xchar) y;
+ coordxy wx = (coordxy) x, wy = (coordxy) y;
for (i = 0, curr = wtails[worm->wormno]; curr; curr = curr->nseg) {
if (curr->wx == wx && curr->wy == wy)
#define MAGIC_COOKIE 1000
static void probe_objchain(struct obj *);
-static boolean zombie_can_dig(xchar x, xchar y);
+static boolean zombie_can_dig(coordxy x, coordxy y);
static void polyuse(struct obj *, int, int);
static void create_polymon(struct obj *, int);
static int stone_to_flesh_obj(struct obj *);
static boolean zap_updown(struct obj *);
-static void zhitu(int, int, const char *, xchar, xchar);
+static void zhitu(int, int, const char *, coordxy, coordxy);
static void revive_egg(struct obj *);
static boolean zap_steed(struct obj *);
static void skiprange(int, int *, int *);
boolean
get_obj_location(
struct obj *obj,
- xchar *xp, xchar *yp,
+ coordxy *xp, coordxy *yp,
int locflags)
{
switch (obj->where) {
boolean
get_mon_location(
struct monst *mon,
- xchar *xp, xchar *yp,
+ coordxy *xp, coordxy *yp,
int locflags) /* non-zero means get location even if monster is buried */
{
if (mon == &g.youmonst || (u.usteed && mon == u.usteed)) {
/* can zombie dig the location at x,y */
static boolean
-zombie_can_dig(xchar x, xchar y)
+zombie_can_dig(coordxy x, coordxy y)
{
if (isok(x, y)) {
schar typ = levl[x][y].typ;
struct permonst *mptr;
struct obj *container;
coord xy;
- xchar x, y;
+ coordxy x, y;
boolean one_of;
mmflags_nht mmflags = NO_MINVENT | MM_NOWAIT | MM_NOMSG;
int montype, cgend, container_nesting = 0;
poly_obj(struct obj *obj, int id)
{
struct obj *otmp;
- xchar ox = 0, oy = 0;
+ coordxy ox = 0, oy = 0;
long old_wornmask, new_wornmask = 0L;
boolean can_merge = (id == STRANGE_OBJECT);
int obj_location = obj->where;
struct permonst *ptr;
struct monst *mon, *shkp;
struct obj *item;
- xchar oox, ooy;
+ coordxy oox, ooy;
boolean smell = FALSE, golem_xform = FALSE;
if (objects[obj->otyp].oc_material != MINERAL
revive_egg(obj);
} else if (obj->otyp == CORPSE) {
struct monst *mtmp;
- xchar ox, oy;
+ coordxy ox, oy;
unsigned save_norevive;
boolean by_u = !g.context.mon_moving;
int corpsenm = corpse_revive_type(obj);
case WAN_POLYMORPH:
case SPE_POLYMORPH:
del_engr(e);
- make_engr_at(x, y, random_engraving(buf), g.moves, (xchar) 0);
+ make_engr_at(x, y, random_engraving(buf), g.moves, (coordxy) 0);
break;
case WAN_CANCELLATION:
case SPE_CANCELLATION:
if (!ttmp || !otmp)
return;
if (otmp->otyp == WAN_CANCELLATION || otmp->otyp == SPE_CANCELLATION) {
- xchar x = ttmp->tx, y = ttmp->ty;
+ coordxy x = ttmp->tx, y = ttmp->ty;
if (undestroyable_trap(ttmp->ttyp)) {
shieldeff(x, y);
}
static void
-zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy)
+zhitu(int type, int nd, const char *fltxt, coordxy sx, coordxy sy)
{
int dam = 0, abstyp = abs(type);
}
void
-buzz(int type, int nd, xchar sx, xchar sy, int dx, int dy)
+buzz(int type, int nd, coordxy sx, coordxy sy, int dx, int dy)
{
dobuzz(type, nd, sx, sy, dx, dy, TRUE);
}
dobuzz(
int type,
int nd,
- xchar sx, xchar sy,
+ coordxy sx, coordxy sy,
int dx, int dy,
boolean say) /* announce out of sight hit/miss events if true */
{
int range, abstype = abs(type) % 10;
- register xchar lsx, lsy;
+ register coordxy lsx, lsy;
struct monst *mon;
coord save_bhitpos;
boolean shopdamage = FALSE;
}
void
-melt_ice(xchar x, xchar y, const char *msg)
+melt_ice(coordxy x, coordxy y, const char *msg)
{
struct rm *lev = &levl[x][y];
struct obj *otmp;
* permanent instead.
*/
void
-start_melt_ice_timeout(xchar x, xchar y,
+start_melt_ice_timeout(coordxy x, coordxy y,
long min_time) /* <x,y>'s old melt timeout (deleted by
time we get here) */
{
void
melt_ice_away(anything *arg, long timeout UNUSED)
{
- xchar x, y;
+ coordxy x, y;
long where = arg->a_long;
boolean save_mon_moving = g.context.mon_moving; /* will be False */
/* melt_ice -> minliquid -> mondead|xkilled shouldn't credit/blame hero */
g.context.mon_moving = TRUE; /* hero isn't causing this ice to melt */
- y = (xchar) (where & 0xFFFF);
- x = (xchar) ((where >> 16) & 0xFFFF);
+ y = (coordxy) (where & 0xFFFF);
+ x = (coordxy) ((where >> 16) & 0xFFFF);
/* melt_ice does newsym when appropriate */
melt_ice(x, y, "Some ice melts away.");
g.context.mon_moving = save_mon_moving;
*/
int
zap_over_floor(
- xchar x, xchar y, /* location */
+ coordxy x, coordxy y, /* location */
int type, /* damage type plus {wand|spell|breath} info */
boolean *shopdamage, /* extra output if shop door is destroyed */
short exploding_wand_typ) /* supplied when breaking a wand; or POT_OIL
void
fracture_rock(struct obj *obj) /* no texts here! */
{
- xchar x, y;
+ coordxy x, y;
boolean by_you = !g.context.mon_moving;
if (by_you && get_obj_location(obj, &x, &y, 0) && costly_spot(x, y)) {
{
int gfd, lfd, sfd;
int res = 0, lev, savelev, hpid, pltmpsiz, filecmc;
- xchar levc;
+ coordxy levc;
struct version_info version_data;
struct savefile_info sfi;
char plbuf[PL_NSIZ], indicator;
(void) unlink(lock);
for (lev = 1; lev < 256 && res == 0; lev++) {
- /* level numbers are kept in xchars in save.c, so the
+ /* level numbers are kept in coordxys in save.c, so the
* maximum level number (for the endlevel) must be < 256
*/
if (lev != savelev) {
lfd = open_levelfile(lev);
if (lfd >= 0) {
/* any or all of these may not exist */
- levc = (xchar) lev;
+ levc = (coordxy) lev;
if (write(sfd, (genericptr_t) &levc, sizeof levc)
!= sizeof levc)
res = -1;
}
void NetHackQtBind::qt_print_glyph(
- winid wid, xchar x, xchar y,
+ winid wid, coordxy x, coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED)
{
#if 0
void NetHackQtBind::qt_print_glyph_compose(
- winid wid, xchar x, xchar y, int glyph1, int glyph2)
+ winid wid, coordxy x, coordxy y, int glyph1, int glyph2)
{
NetHackQtWindow *window = id_to_window[(int) wid];
window->PrintGlyphCompose(x, y, glyph1, glyph2);
static void qt_cliparound(int x, int y);
static void qt_cliparound_window(winid wid, int x, int y);
- static void qt_print_glyph(winid wid, xchar x, xchar y,
+ static void qt_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphingo,
const glyph_info *bkglyphinfo);
static void qt_raw_print(const char *str);
void
X11_print_glyph(
winid window,
- xchar x, xchar y,
+ coordxy x, coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED)
{
check_cursor_visibility(wp);
highlight_yn(TRUE); /* change fg/bg to match map */
} else if (wp->prevx != wp->cursx || wp->prevy != wp->cursy) {
- register xchar x = wp->prevx, y = wp->prevy;
+ register coordxy x = wp->prevx, y = wp->prevy;
/*
* Previous cursor position is not the same as the current
#ifdef POSITIONBAR
void chainin_update_positionbar(char *);
#endif
-void chainin_print_glyph(winid, xchar, xchar,
+void chainin_print_glyph(winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *);
void
chainin_print_glyph(
winid window,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{
#ifdef POSITIONBAR
void chainout_update_positionbar(void *,char *);
#endif
-void chainout_print_glyph(void *,winid, xchar, xchar,
+void chainout_print_glyph(void *,winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *);
chainout_print_glyph(
void *vp,
winid window,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{
#ifdef POSITIONBAR
void trace_update_positionbar(void *,char *);
#endif
-void trace_print_glyph(void *,winid, xchar, xchar,
+void trace_print_glyph(void *,winid, coordxy, coordxy,
const glyph_info *, const glyph_info *);
void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *);
trace_print_glyph(
void *vp,
winid window,
- xchar x,
- xchar y,
+ coordxy x,
+ coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo)
{
*/
void
-curses_print_glyph(winid wid, xchar x, xchar y,
+curses_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphinfo, const glyph_info *bkglyphinfo UNUSED)
{
int glyph;
blPAD, blPAD, blPAD, blPAD }
};
const enum statusfields (*fieldorder)[15];
- xchar spacing[MAXBLSTATS], valline[MAXBLSTATS];
+ coordxy spacing[MAXBLSTATS], valline[MAXBLSTATS];
enum statusfields fld, prev_fld;
char *text, *p, cbuf[BUFSZ], ebuf[STATVAL_WIDTH];
#ifdef SCORE_ON_BOTL
BL_STR, BL_SCORE, BL_TIME, BL_LEVELDESC, BL_HP,
BL_CONDITION, BL_CAP, BL_HUNGER
};
- xchar spacing[MAXBLSTATS];
+ coordxy spacing[MAXBLSTATS];
int i, fld, cap_and_hunger, time_and_score, cond_count, per_line;
char *text;
#ifdef STATUS_HILITES
void
safe_print_glyph(
winid window UNUSED,
- xchar x UNUSED,
- xchar y UNUSED,
+ coordxy x UNUSED,
+ coordxy y UNUSED,
const glyph_info *glyphinfo UNUSED,
const glyph_info *bkglyphinfo UNUSED)
{
VDECLCB(shim_wait_synch,(void), "v")
VDECLCB(shim_cliparound,(int x, int y), "vii", A2P x, A2P y)
VDECLCB(shim_update_positionbar,(char *posbar), "vp", P2V posbar)
-VDECLCB(shim_print_glyph,(winid w, xchar x, xchar y, const glyph_info *glyphinfo, const glyph_info *bkglyphinfo), "viiipp", A2P w, A2P x, A2P y, P2V glyphinfo, P2V bkglyphinfo)
+VDECLCB(shim_print_glyph,(winid w, coordxy x, coordxy y, const glyph_info *glyphinfo, const glyph_info *bkglyphinfo), "viiipp", A2P w, A2P x, A2P y, P2V glyphinfo, P2V bkglyphinfo)
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str)
DECLCB(int, shim_nhgetch,(void), "i")
}
void
-tty_curs(
- winid window,
+tty_curs(winid window,
register int x, register int y) /* not xchar: perhaps xchar is unsigned
* then curx-x would be unsigned too */
{
cell->refresh = 0;
}
}
+ tty_curs(window, 1, 0);
+ ttyDisplay->curx = 1;
calling_from_update_inventory = FALSE;
break;
default:
void
tty_print_glyph(
winid window,
- xchar x, xchar y,
+ coordxy x, coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED)
{
} MSNHMsgPutstr, *PMSNHMsgPutstr;
typedef struct mswin_nhmsg_print_glyph {
- xchar x;
- xchar y;
+ coordxy x;
+ coordxy y;
glyph_info glyphinfo;
glyph_info bkglyphinfo;
} MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph;
*/
void
-mswin_print_glyph(winid wid, xchar x, xchar y,
+mswin_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyphinfo, const glyph_info *bkglyphinfo)
{
logDebug("mswin_print_glyph(%d, %d, %d, %d, %d, %lu)\n",
void mswin_mark_synch(void);
void mswin_wait_synch(void);
void mswin_cliparound(int x, int y);
-void mswin_print_glyph(winid wid, xchar x, xchar y,
+void mswin_print_glyph(winid wid, coordxy x, coordxy y,
const glyph_info *glyph, const glyph_info *bkglyph);
void mswin_raw_print(const char *str);
void mswin_raw_print_bold(const char *str);