/* ### bones.c ### */
extern void sanitize_name(char *);
-extern void drop_upon_death(struct monst *, struct obj *, int, int);
+extern void drop_upon_death(struct monst *, struct obj *, coordxy, coordxy);
extern boolean can_make_bones(void);
extern void savebones(int, time_t, struct obj *);
extern int getbones(void);
extern int enter_explore_mode(void);
extern boolean bind_key(uchar, const char *);
extern void dokeylist(void);
-extern int xytod(schar, schar);
+extern coordxy xytod(coordxy, coordxy);
extern void dtoxy(coord *, int);
extern int movecmd(char, int);
extern int dxdy_moveok(void);
extern int getdir(const char *);
extern void confdir(void);
extern const char *directionname(int);
-extern int isok(int, int);
+extern int isok(coordxy, coordxy);
extern int get_adjacent_loc(const char *, const char *, coordxy, coordxy, coord *);
-extern const char *click_to_cmd(int, int, int);
+extern const char *click_to_cmd(coordxy, coordxy, int);
extern char get_count(const char *, char, long, cmdcount_nht *, unsigned);
#ifdef HANGUPHANDLING
extern void hangup(int);
extern void end_of_input(void);
#endif
extern char readchar(void);
-extern char readchar_poskey(int *, int *, int *);
+extern char readchar_poskey(coordxy *, coordxy *, int *);
extern void sanity_check(void);
extern char* key2txt(uchar, char *);
extern char yn_function(const char *, const char *, char);
/* ### dbridge.c ### */
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);
-extern boolean is_ice(int, int);
-extern boolean is_moat(int, int);
+extern boolean is_pool(coordxy, coordxy);
+extern boolean is_lava(coordxy, coordxy);
+extern boolean is_pool_or_lava(coordxy, coordxy);
+extern boolean is_ice(coordxy, coordxy);
+extern boolean is_moat(coordxy, coordxy);
extern schar db_under_typ(int);
-extern int is_drawbridge_wall(int, int);
-extern boolean is_db_wall(int, int);
-extern boolean find_drawbridge(int *, int *);
-extern boolean create_drawbridge(int, int, int, boolean);
-extern void open_drawbridge(int, int);
-extern void close_drawbridge(int, int);
-extern void destroy_drawbridge(int, int);
+extern int is_drawbridge_wall(coordxy, coordxy);
+extern boolean is_db_wall(coordxy, coordxy);
+extern boolean find_drawbridge(coordxy *, coordxy *);
+extern boolean create_drawbridge(coordxy, coordxy, int, boolean);
+extern void open_drawbridge(coordxy, coordxy);
+extern void close_drawbridge(coordxy, coordxy);
+extern void destroy_drawbridge(coordxy, coordxy);
/* ### decl.c ### */
/* ### detect.c ### */
-extern boolean trapped_chest_at(int, int, int);
-extern boolean trapped_door_at(int, int, int);
+extern boolean trapped_chest_at(int, coordxy, coordxy);
+extern boolean trapped_door_at(int, coordxy, coordxy);
extern struct obj *o_in(struct obj *, char);
extern struct obj *o_material(struct obj *, unsigned);
extern int gold_detect(struct obj *);
extern void cvt_sdoor_to_door(struct rm *);
extern int findit(void);
extern int openit(void);
-extern boolean detecting(void(*)(int, int, void *));
+extern boolean detecting(void(*)(coordxy, coordxy, void *));
extern void find_trap(struct trap *);
extern void warnreveal(void);
extern int dosearch0(int);
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 void digactualhole(int, int, struct monst *, int);
+extern boolean dig_check(struct monst *, boolean, coordxy, coordxy);
+extern void digactualhole(coordxy, coordxy, struct monst *, int);
extern boolean dighole(boolean, boolean, coord *);
extern int use_pick_axe(struct obj *);
extern int use_pick_axe2(struct obj *);
extern struct obj *buried_ball(coord *);
extern void buried_ball_to_punishment(void);
extern void buried_ball_to_freedom(void);
-extern schar fillholetyp(int, int, boolean);
+extern schar fillholetyp(coordxy, coordxy, boolean);
extern void liquid_flow(coordxy, coordxy, schar, struct trap *, const char *);
extern boolean conjoined_pits(struct trap *, struct trap *, boolean);
#if 0
extern void map_trap(struct trap *, int);
extern void map_object(struct obj *, int);
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 unmap_invisible(coordxy, coordxy);
+extern void unmap_object(coordxy, coordxy);
+extern void map_location(coordxy, coordxy, int);
extern boolean suppress_map_output(void);
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 newsym(coordxy, coordxy);
+extern void newsym_force(coordxy, coordxy);
extern void shieldeff(coordxy, coordxy);
-extern void tmp_at(int, int);
-extern void flash_glyph_at(int, int, int, int);
+extern void tmp_at(coordxy, coordxy);
+extern void flash_glyph_at(coordxy, coordxy, int, int);
extern void swallowed(int);
extern void under_ground(int);
extern void under_water(int);
extern int doredraw(void);
extern void docrt(void);
extern void redraw_map(void);
-extern void show_glyph(int, int, int);
+extern void show_glyph(coordxy, coordxy, int);
extern void clear_glyph_buffer(void);
-extern void row_refresh(int, int, int);
+extern void row_refresh(coordxy, coordxy, coordxy);
extern void cls(void);
extern void flush_screen(int);
extern int back_to_glyph(coordxy, coordxy);
extern int zapdir_to_glyph(int, int, int);
extern int glyph_at(coordxy, coordxy);
extern void reglyph_darkroom(void);
-extern void xy_set_wall_state(int, int);
+extern void xy_set_wall_state(coordxy, coordxy);
extern void set_wall_state(void);
-extern void unset_seenv(struct rm *, int, int, int, int);
+extern void unset_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
extern int warning_of(struct monst *);
extern void map_glyphinfo(coordxy, coordxy, int, unsigned, glyph_info *);
extern void reset_glyphmap(enum glyphmap_change_triggers trigger);
/* ### do.c ### */
extern int dodrop(void);
-extern boolean boulder_hits_pool(struct obj *, int, int, boolean);
-extern boolean flooreffects(struct obj *, int, int, const char *);
+extern boolean boulder_hits_pool(struct obj *, coordxy, coordxy, boolean);
+extern boolean flooreffects(struct obj *, coordxy, coordxy, const char *);
extern void doaltarobj(struct obj *);
extern void trycall(struct obj *);
extern boolean canletgo(struct obj *, const char *);
/* ### do_name.c ### */
-extern char *dxdy_to_dist_descr(int, int, boolean);
-extern char *coord_desc(int, int, char *, char);
+extern char *dxdy_to_dist_descr(coordxy, coordxy, boolean);
+extern char *coord_desc(coordxy, coordxy, char *, char);
extern boolean getpos_menu(coord *, int);
extern int getpos(coord *, boolean, const char *);
-extern void getpos_sethilite(void(*f)(int), boolean(*d)(int,int));
+extern void getpos_sethilite(void(*f)(int), boolean(*d)(coordxy,coordxy));
extern void new_mgivenname(struct monst *, int);
extern void free_mgivenname(struct monst *);
extern void new_oname(struct obj *, int);
/* ### dogmove.c ### */
-extern boolean cursed_object_at(int, int);
+extern boolean cursed_object_at(coordxy, coordxy);
extern struct obj *droppables(struct monst *);
extern int dog_nutrition(struct monst *, struct obj *);
-extern int dog_eat(struct monst *, struct obj *, int, int, boolean);
+extern int dog_eat(struct monst *, struct obj *, coordxy, coordxy, boolean);
extern int dog_move(struct monst *, int);
extern void finish_meating(struct monst *);
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),
+extern boolean walk_path(coord *, coord *, boolean(*)(void *, coordxy, coordxy),
genericptr_t);
-extern boolean hurtle_jump(genericptr_t, int, int);
-extern boolean hurtle_step(genericptr_t, int, int);
+extern boolean hurtle_jump(genericptr_t, coordxy, coordxy);
+extern boolean hurtle_step(genericptr_t, coordxy, coordxy);
/* ### drawing.c ### */
extern boolean on_level(d_level *, d_level *);
extern void next_level(boolean);
extern void prev_level(boolean);
-extern void u_on_newpos(int, int);
+extern void u_on_newpos(coordxy, coordxy);
extern void u_on_rndspot(int);
-extern void stairway_add(int,int, boolean, boolean, d_level *);
+extern void stairway_add(coordxy, coordxy, boolean, boolean, d_level *);
extern void stairway_print(void);
extern void stairway_free_all(void);
-extern stairway *stairway_at(int, int);
+extern stairway *stairway_at(coordxy, coordxy);
extern stairway *stairway_find(d_level *);
extern stairway *stairway_find_from(d_level *, boolean);
extern stairway *stairway_find_dir(boolean);
extern boolean Is_botlevel(d_level *);
extern boolean Can_fall_thru(d_level *);
extern boolean Can_dig_down(d_level *);
-extern boolean Can_rise_up(int, int, d_level *);
+extern boolean Can_rise_up(coordxy, coordxy, d_level *);
extern boolean has_ceiling(d_level *);
extern boolean In_quest(d_level *);
extern boolean In_mines(d_level *);
extern boolean In_hell(d_level *);
extern boolean In_V_tower(d_level *);
extern boolean On_W_tower_level(d_level *);
-extern boolean In_W_tower(int, int, d_level *);
+extern boolean In_W_tower(coordxy, coordxy, d_level *);
extern void find_hell(d_level *);
extern void goto_hell(boolean, boolean);
extern boolean single_level_branch(d_level *);
extern char *random_engraving(char *);
extern void wipeout_text(char *, int, unsigned);
extern boolean can_reach_floor(boolean);
-extern void cant_reach_floor(int, int, boolean, boolean);
-extern const char *surface(int, int);
-extern const char *ceiling(int, int);
+extern void cant_reach_floor(coordxy, coordxy, boolean, boolean);
+extern const char *surface(coordxy, coordxy);
+extern const char *ceiling(coordxy, coordxy);
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(coordxy, coordxy, coordxy, boolean);
-extern void read_engr_at(int, int);
-extern void make_engr_at(int, int, const char *, long, xint16);
-extern void del_engr_at(int, int);
+extern void read_engr_at(coordxy, coordxy);
+extern void make_engr_at(coordxy, coordxy, const char *, long, xint16);
+extern void del_engr_at(coordxy, coordxy);
extern int freehand(void);
extern int doengrave(void);
extern void sanitize_engravings(void);
extern void engr_stats(const char *, char *, long *, long *);
extern void del_engr(struct engr *);
extern void rloc_engr(struct engr *);
-extern void make_grave(int, int, const char *);
+extern void make_grave(coordxy, coordxy, const char *);
/* ### exper.c ### */
/* ### explode.c ### */
-extern void explode(int, int, int, int, char, int);
-extern long scatter(int, int, int, unsigned int, struct obj *);
-extern void splatter_burning_oil(int, int, boolean);
-extern void explode_oil(struct obj *, int, int);
+extern void explode(coordxy, coordxy, int, int, char, int);
+extern long scatter(coordxy, coordxy, int, unsigned int, struct obj *);
+extern void splatter_burning_oil(coordxy, coordxy, boolean);
+extern void explode_oil(struct obj *, coordxy, coordxy);
extern int adtyp_to_expltype(const int);
extern void mon_explodes(struct monst *, struct attack *);
/* ### extralev.c ### */
extern void makeroguerooms(void);
-extern void corr(int, int);
+extern void corr(coordxy, coordxy);
extern void makerogueghost(void);
/* ### files.c ### */
extern void dryup(coordxy, coordxy, boolean);
extern void drinkfountain(void);
extern void dipfountain(struct obj *);
-extern void breaksink(int, int);
+extern void breaksink(coordxy, coordxy);
extern void drinksink(void);
/* ### hack.c ### */
-extern boolean is_valid_travelpt(int,int);
+extern boolean is_valid_travelpt(coordxy, coordxy);
extern anything *uint_to_any(unsigned);
extern anything *long_to_any(long);
extern anything *monst_to_any(struct monst *);
extern anything *obj_to_any(struct obj *);
-extern boolean revive_nasty(int, int, const char *);
+extern boolean revive_nasty(coordxy, coordxy, const char *);
extern int still_chewing(coordxy, coordxy);
extern void movobj(struct obj *, coordxy, coordxy);
extern boolean may_dig(coordxy, coordxy);
extern boolean bad_rock(struct permonst *, coordxy, coordxy);
extern int cant_squeeze_thru(struct monst *);
extern boolean invocation_pos(coordxy, coordxy);
-extern boolean test_move(int, int, int, int, int);
+extern boolean test_move(coordxy, coordxy, coordxy, coordxy, int);
#ifdef DEBUG
extern int wiz_debug_cmd_traveldisplay(void);
#endif
extern boolean pooleffects(boolean);
extern void spoteffects(boolean);
extern char *in_rooms(coordxy, coordxy, int);
-extern boolean in_town(int, int);
+extern boolean in_town(coordxy, coordxy);
extern void check_special_room(boolean);
extern int dopickup(void);
extern void lookaround(void);
-extern boolean crawl_destination(int, int);
+extern boolean crawl_destination(coordxy, coordxy);
extern int monster_nearby(void);
extern void end_running(boolean);
extern void nomul(int);
extern char *sitoa(int);
extern int sgn(int);
extern int rounddiv(long, int);
-extern int dist2(int, int, int, int);
+extern int dist2(coordxy, coordxy, coordxy, coordxy);
extern int isqrt(int);
-extern int distmin(int, int, int, int);
+extern int distmin(coordxy, coordxy, coordxy, coordxy);
extern boolean online2(int, int, int, int);
extern boolean pmatch(const char *, const char *);
extern boolean pmatchi(const char *, const char *);
extern void consume_obj_charge(struct obj *, boolean);
extern void freeinv_core(struct obj *);
extern void freeinv(struct obj *);
-extern void delallobj(int, int);
+extern void delallobj(coordxy, coordxy);
extern void delobj(struct obj *);
extern void delobj_core(struct obj *, boolean);
-extern struct obj *sobj_at(int, int, int);
+extern struct obj *sobj_at(int, coordxy, coordxy);
extern struct obj *nxtobj(struct obj *, int, boolean);
extern struct obj *carrying(int);
extern boolean have_lizard(void);
extern struct obj *u_carried_gloves(void);
extern struct obj *u_have_novel(void);
extern struct obj *o_on(unsigned int, struct obj *);
-extern boolean obj_here(struct obj *, int, int);
+extern boolean obj_here(struct obj *, coordxy, coordxy);
extern boolean wearing_armor(void);
extern boolean is_worn(struct obj *);
-extern struct obj *g_at(int, int);
+extern struct obj *g_at(coordxy, coordxy);
extern boolean splittable(struct obj *);
extern int any_obj_ok(struct obj *);
extern struct obj *getobj(const char *, int(*)(struct obj *), unsigned int);
extern char *xprname(struct obj *, const char *, char, boolean, long, long);
extern int ddoinv(void);
extern char display_inventory(const char *, boolean);
-extern int display_binventory(int, int, boolean);
+extern int display_binventory(coordxy, coordxy, boolean);
extern struct obj *display_cinventory(struct obj *);
extern struct obj *display_minventory(struct monst *, int, char *);
extern int dotypeinv(void);
-extern const char *dfeature_at(int, int, char *);
+extern const char *dfeature_at(coordxy, coordxy, char *);
extern int look_here(int, unsigned);
extern int dolook(void);
extern boolean will_feel_cockatrice(struct obj *, boolean);
extern void new_light_source(coordxy, coordxy, int, int, union any *);
extern void del_light_source(int, union any *);
extern void do_light_sources(coordxy **);
-extern void show_transient_light(struct obj *, int, int);
+extern void show_transient_light(struct obj *, coordxy, coordxy);
extern void transient_light_cleanup(void);
extern struct monst *find_mid(unsigned, unsigned);
extern void save_light_sources(NHFILE *, int);
extern void light_sources_sanity_check(void);
extern void obj_move_light_source(struct obj *, struct obj *);
extern boolean any_light_source(void);
-extern void snuff_light_source(int, int);
+extern void snuff_light_source(coordxy, coordxy);
extern boolean obj_sheds_light(struct obj *);
extern boolean obj_is_burning(struct obj *);
extern void obj_split_light_source(struct obj *, struct obj *);
/* ### lock.c ### */
-extern boolean picking_lock(int *, int *);
-extern boolean picking_at(int, int);
+extern boolean picking_lock(coordxy *, coordxy *);
+extern boolean picking_at(coordxy, coordxy);
extern void breakchestlock(struct obj *, boolean);
extern void reset_pick(void);
extern void maybe_reset_pick(struct obj *);
extern boolean u_have_forceable_weapon(void);
extern int doforce(void);
extern boolean boxlock(struct obj *, struct obj *);
-extern boolean doorlock(struct obj *, int, int);
+extern boolean doorlock(struct obj *, coordxy, coordxy);
extern int doopen(void);
-extern boolean stumble_on_door_mimic(int, int);
-extern int doopen_indir(int, int);
+extern boolean stumble_on_door_mimic(coordxy, coordxy);
+extern int doopen_indir(coordxy, coordxy);
extern int doclose(void);
#ifdef MAC
extern struct mextra *newmextra(void);
extern void copy_mextra(struct monst *, struct monst *);
extern void dealloc_mextra(struct monst *);
-extern struct monst *makemon(struct permonst *, int, int, mmflags_nht);
+extern struct monst *makemon(struct permonst *, coordxy, coordxy, mmflags_nht);
extern struct monst *unmakemon(struct monst *, mmflags_nht);
extern boolean create_critters(int, struct permonst *, boolean);
extern struct permonst *rndmonst(void);
boolean);
extern void free_luathemes(boolean);
extern void makecorridors(void);
-extern void add_door(int, int, struct mkroom *);
+extern void add_door(coordxy, coordxy, struct mkroom *);
extern void clear_level_structures(void);
extern void level_finalize_topology(void);
extern void mklev(void);
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 dodoor(coordxy, coordxy, struct mkroom *);
extern void mktrap(int, int, struct mkroom *, coord *);
extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean);
extern void mkinvokearea(void);
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 walkfrom(int, int, schar);
+extern void wallification(coordxy, coordxy, coordxy, coordxy);
+extern void fix_wall_spines(coordxy, coordxy, coordxy, coordxy);
+extern void walkfrom(coordxy, coordxy, schar);
extern void makemaz(const char *);
extern void mazexy(coord *);
-extern void get_level_extends(int *, int *, int *, int *);
+extern void get_level_extends(coordxy *, coordxy *, coordxy *, coordxy *);
extern void bound_digging(void);
extern void mkportal(coordxy, coordxy, coordxy, coordxy);
extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
extern void free_olong(struct obj *);
extern void new_omailcmd(struct obj *, const char *);
extern void free_omailcmd(struct obj *);
-extern struct obj *mkobj_at(char, int, int, boolean);
-extern struct obj *mksobj_at(int, int, int, boolean, boolean);
+extern struct obj *mkobj_at(char, coordxy, coordxy, boolean);
+extern struct obj *mksobj_at(int, coordxy, coordxy, boolean, boolean);
extern struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean);
extern struct obj *mkobj(int, boolean);
extern int rndmonnum(void);
extern struct obj *mksobj(int, boolean, boolean);
extern int bcsign(struct obj *);
extern int weight(struct obj *);
-extern struct obj *mkgold(long, int, int);
-extern struct obj *mkcorpstat(int, struct monst *, struct permonst *, int,
- int, unsigned);
+extern struct obj *mkgold(long, coordxy, coordxy);
+extern struct obj *mkcorpstat(int, struct monst *, struct permonst *,
+ coordxy, coordxy, unsigned);
extern int corpse_revive_type(struct obj *);
extern struct obj *obj_attach_mid(struct obj *, unsigned);
extern struct monst *get_mtraits(struct obj *, boolean);
-extern struct obj *mk_tt_object(int, int, int);
-extern struct obj *mk_named_object(int, struct permonst *, int, int,
+extern struct obj *mk_tt_object(int, coordxy, coordxy);
+extern struct obj *mk_named_object(int, struct permonst *,
+ coordxy, coordxy,
const char *);
-extern struct obj *rnd_treefruit_at(int, int);
+extern struct obj *rnd_treefruit_at(coordxy, coordxy);
extern void set_corpsenm(struct obj *, int);
extern long rider_revival_time(struct obj *, boolean);
extern void start_corpse_timeout(struct obj *);
extern void set_bknown(struct obj *, unsigned);
extern boolean is_flammable(struct obj *);
extern boolean is_rottable(struct obj *);
-extern void place_object(struct obj *, int, int);
+extern void place_object(struct obj *, coordxy, coordxy);
extern void remove_object(struct obj *);
extern void discard_minvent(struct monst *, boolean);
extern void obj_extract_self(struct obj *);
extern void add_to_migration(struct obj *);
extern void add_to_buried(struct obj *);
extern void dealloc_obj(struct obj *);
-extern void obj_ice_effects(int, int, boolean);
+extern void obj_ice_effects(coordxy, coordxy, boolean);
extern long peek_at_iced_corpse_age(struct obj *);
extern int hornoplenty(struct obj *, boolean);
extern void obj_sanity_check(void);
extern struct obj *obj_nexto(struct obj *);
-extern struct obj *obj_nexto_xy(struct obj *, int, int, boolean);
+extern struct obj *obj_nexto_xy(struct obj *, coordxy, coordxy, boolean);
extern struct obj *obj_absorb(struct obj **, struct obj **);
extern struct obj *obj_meld(struct obj **, struct obj **);
extern void pudding_merge_message(struct obj *, struct obj *);
extern int can_carry(struct monst *, struct obj *);
extern long mon_allowflags(struct monst *);
extern int mfndpos(struct monst *, coord *, long *, long);
-extern boolean monnear(struct monst *, int, int);
+extern boolean monnear(struct monst *, coordxy, coordxy);
extern void dmonsfree(void);
extern void elemental_clog(struct monst *);
extern int mcalcmove(struct monst *, boolean);
extern void wake_msg(struct monst *, boolean);
extern void wakeup(struct monst *, boolean);
extern void wake_nearby(void);
-extern void wake_nearto(int, int, int);
+extern void wake_nearto(coordxy, coordxy, int);
extern void seemimic(struct monst *);
extern void normal_shape(struct monst *);
extern void iter_mons(void (*)(struct monst *));
extern boolean monhaskey(struct monst *, boolean);
extern void mon_regen(struct monst *, boolean);
extern int dochugw(struct monst *, boolean);
-extern boolean onscary(int, int, struct monst *);
+extern boolean onscary(coordxy, coordxy, struct monst *);
extern struct monst *find_pmmonst(int);
extern int bee_eat_jelly(struct monst *, struct obj *);
extern void monflee(struct monst *, int, boolean, boolean);
extern boolean m_digweapon_check(struct monst *, coordxy, coordxy);
extern int m_move(struct monst *, int);
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 dissolve_bars(coordxy, coordxy);
+extern boolean closed_door(coordxy, coordxy);
+extern boolean accessible(coordxy, coordxy);
extern void set_apparxy(struct monst *);
extern boolean can_ooze(struct monst *);
extern boolean can_fog(struct monst *);
extern int spitmu(struct monst *, struct attack *);
extern int breamu(struct monst *, struct attack *);
extern boolean linedup_callback(coordxy, coordxy, coordxy, coordxy,
- boolean(*)(int,int));
+ boolean(*)(coordxy, coordxy));
extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int);
extern boolean lined_up(struct monst *);
extern struct obj *m_carrying(struct monst *, int);
extern int breamm(struct monst *, struct attack *, struct monst *);
extern void m_useupall(struct monst *, struct obj *);
extern void m_useup(struct monst *, struct obj *);
-extern void m_throw(struct monst *, int, int, int, int, int, struct obj *);
-extern void hit_bars(struct obj **, int, int, int, int, unsigned);
-extern boolean hits_bars(struct obj **, int, int, int, int, int, int);
+extern void m_throw(struct monst *, coordxy, coordxy, coordxy, coordxy, int, struct obj *);
+extern void hit_bars(struct obj **, coordxy, coordxy, coordxy, coordxy, unsigned);
+extern boolean hits_bars(struct obj **, coordxy, coordxy, coordxy, coordxy, int, int);
/* ### muse.c ### */
extern schar get_table_mapchr(lua_State *, const char *);
extern schar get_table_mapchr_opt(lua_State *, const char *, schar);
extern short nhl_get_timertype(lua_State *, int);
-extern boolean nhl_get_xy_params(lua_State *, int *, int *);
+extern boolean nhl_get_xy_params(lua_State *, lua_Integer *, lua_Integer *);
extern void nhl_add_table_entry_int(lua_State *, const char *, lua_Integer);
extern void nhl_add_table_entry_char(lua_State *, const char *, char);
extern void nhl_add_table_entry_str(lua_State *, const char *, const char *);
extern void consoletty_open(int);
extern void consoletty_rubout(void);
extern int tgetch(void);
-extern int console_poskey(int *, int *, int *);
+extern int console_poskey(coordxy *, coordxy *, int *);
extern void set_output_mode(int);
extern void synch_cursor(void);
extern void nethack_enter_consoletty(void);
extern char *self_lookat(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 boolean object_from_map(int, coordxy, coordxy, struct obj **);
extern const char *waterbody_name(coordxy, coordxy);
extern int do_screen_description(coord, boolean, int, char *, const char **,
struct permonst **);
boolean(*)(struct obj *));
extern struct obj *pick_obj(struct obj *);
extern int encumber_msg(void);
-extern int container_at(int, int, boolean);
+extern int container_at(coordxy, coordxy, boolean);
extern int doloot(void);
extern void observe_quantum_cat(struct obj *, boolean, boolean);
extern boolean container_gone(int(*)(struct obj *));
extern int dopray(void);
extern const char *u_gname(void);
extern int doturn(void);
-extern int altarmask_at(int, int);
+extern int altarmask_at(coordxy, coordxy);
extern const char *a_gname(void);
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);
-extern void altar_wrath(int, int);
+extern void altar_wrath(coordxy, coordxy);
/* ### priest.c ### */
extern int doread(void);
extern int charge_ok(struct obj *);
extern void recharge(struct obj *, int);
-extern boolean valid_cloud_pos(int, int);
+extern boolean valid_cloud_pos(coordxy, coordxy);
extern int seffects(struct obj *);
extern void drop_boulder_on_player(boolean, boolean, boolean, boolean);
-extern boolean drop_boulder_on_monster(int, int, boolean, boolean);
+extern boolean drop_boulder_on_monster(coordxy, coordxy, boolean, boolean);
extern void wand_explode(struct obj *, int);
extern void litroom(boolean, struct obj *);
extern void do_genocide(int);
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 void wallify_map(coordxy, coordxy, coordxy, coordxy);
extern boolean load_special(const char *);
-extern coordxy selection_getpoint(int, int, struct selectionvar *);
+extern coordxy selection_getpoint(coordxy, coordxy, 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 set_selection_floodfillchk(int(*)(coordxy, coordxy));
+extern void selection_floodfill(struct selectionvar *, coordxy, coordxy, boolean);
+extern boolean pm_good_location(coordxy, coordxy, struct permonst *);
extern void get_location_coord(coordxy *, coordxy *, int, struct mkroom *, long);
-extern void selection_setpoint(int, int, struct selectionvar *, coordxy);
+extern void selection_setpoint(coordxy, coordxy, struct selectionvar *, coordxy);
extern struct selectionvar * selection_not(struct selectionvar *);
extern void selection_filter_percent(struct selectionvar *, int);
extern int selection_rndcoord(struct selectionvar *, coordxy *, coordxy *,
/* ### teleport.c ### */
extern boolean noteleport_level(struct monst *);
-extern boolean goodpos(int, int, struct monst *, mmflags_nht);
+extern boolean goodpos(coordxy, coordxy, struct monst *, mmflags_nht);
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 void teleds(coordxy, coordxy, int);
extern boolean safe_teleds(int);
extern boolean teleport_pet(struct monst *, boolean);
extern void tele(void);
extern void domagicportal(struct trap *);
extern void tele_trap(struct trap *);
extern void level_tele_trap(struct trap *, unsigned);
-extern void rloc_to(struct monst *, int, int);
-extern void rloc_to_flag(struct monst *, int, int, unsigned);
+extern void rloc_to(struct monst *, coordxy, coordxy);
+extern void rloc_to_flag(struct monst *, coordxy, coordxy, unsigned);
extern boolean rloc(struct monst *, unsigned);
extern boolean tele_restrict(struct monst *);
extern void mtele_trap(struct monst *, struct trap *, int);
extern boolean burnarmor(struct monst *);
extern int erode_obj(struct obj *, const char *, int, int);
extern boolean grease_protect(struct obj *, const char *, struct monst *);
-extern struct trap *maketrap(int, int, int);
+extern struct trap *maketrap(coordxy, coordxy, int);
extern void fall_through(boolean, unsigned);
extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *);
extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
extern void selftouch(const char *);
extern void mselftouch(struct monst *, const char *, boolean);
extern void float_up(void);
-extern void fill_pit(int, int);
+extern void fill_pit(coordxy, coordxy);
extern int float_down(long, long);
extern void climb_pit(void);
extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy);
extern int dountrap(void);
extern int could_untrap(boolean, boolean);
extern void cnv_trap_obj(int, int, struct trap *, boolean);
-extern int untrap(boolean, int, int, struct obj *);
+extern int untrap(boolean, coordxy, coordxy, struct obj *);
extern boolean openholdingtrap(struct monst *, boolean *);
extern boolean closeholdingtrap(struct monst *, boolean *);
extern boolean openfallingtrap(struct monst *, boolean, boolean *);
extern boolean chest_trap(struct obj *, int, boolean);
extern void deltrap(struct trap *);
extern boolean delfloortrap(struct trap *);
-extern struct trap *t_at(int, int);
+extern struct trap *t_at(coordxy, coordxy);
extern int count_traps(int);
extern void b_trapped(const char *, int);
extern boolean unconscious(void);
extern void blow_up_landmine(struct trap *);
-extern int launch_obj(short, int, int, int, int, int);
+extern int launch_obj(short, coordxy, coordxy, coordxy, coordxy, int);
extern boolean launch_in_progress(void);
extern void force_launch_placement(void);
extern boolean uteetering_at_seen_pit(struct trap *);
extern void block_point(int, int);
extern void unblock_point(int, int);
extern boolean clear_path(int, int, int, int);
-extern void do_clear_area(int, int, int, void(*)(int, int, void *),
- genericptr_t);
+extern void do_clear_area(coordxy, coordxy, int,
+ void(*)(coordxy, coordxy, void *), genericptr_t);
extern unsigned howmonseen(struct monst *);
#ifdef VMS
extern boolean obj_shudders(struct obj *);
extern void do_osshock(struct obj *);
extern int bhito(struct obj *, struct obj *);
-extern int bhitpile(struct obj *, int(*)(struct obj *, struct obj *), int,
- int, schar);
+extern int bhitpile(struct obj *, int(*)(struct obj *, struct obj *),
+ coordxy, coordxy, schar);
extern int zappable(struct obj *);
extern void do_enlightenment_effect(void);
extern void zapnodir(struct obj *);
extern const char *exclam(int force);
extern void hit(const char *, struct monst *, const char *);
extern void miss(const char *, struct monst *);
-extern struct monst *bhit(int, int, int, enum bhit_call_types,
+extern struct monst *bhit(coordxy, coordxy, int, enum bhit_call_types,
int(*)(struct monst *, struct obj *),
int(*)(struct obj *, struct obj *), struct obj **);
-extern struct monst *boomhit(struct obj *, int, int);
+extern struct monst *boomhit(struct obj *, coordxy, coordxy);
extern int zhitm(struct monst *, int, int, struct obj **);
-extern int burn_floor_objects(int, int, boolean, boolean);
+extern int burn_floor_objects(coordxy, coordxy, boolean, boolean);
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 X11_raw_print(const char *);
extern void X11_raw_print_bold(const char *);
extern int X11_nhgetch(void);
-extern int X11_nh_poskey(int *, int *, int *);
+extern int X11_nh_poskey(coordxy *, coordxy *, int *);
extern void X11_nhbell(void);
extern int X11_doprev_message(void);
extern char X11_yn_function_core(const char *, const char *, char, unsigned);
extern void curses_raw_print(const char *str);
extern void curses_raw_print_bold(const char *str);
extern int curses_nhgetch(void);
-extern int curses_nh_poskey(int *x, int *y, int *mod);
+extern int curses_nh_poskey(coordxy *x, coordxy *y, int *mod);
extern void curses_nhbell(void);
extern int curses_doprev_message(void);
extern char curses_yn_function(const char *question, const char *choices,
extern int curses_read_attrs(const char *attrs);
extern char *curses_fmt_attrs(char *);
extern int curses_convert_keys(int key);
-extern int curses_get_mouse(int *mousex, int *mousey, int *mod);
+extern int curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod);
extern void curses_mouse_support(int);
/* cursdial.c */
void (*win_raw_print)(const char *);
void (*win_raw_print_bold)(const char *);
int (*win_nhgetch)(void);
- int (*win_nh_poskey)(int *, int *, int *);
+ int (*win_nh_poskey)(coordxy *, coordxy *, int *);
void (*win_nhbell)(void);
int (*win_doprev_message)(void);
char (*win_yn_function)(const char *, const char *, char);
void (*win_raw_print)(CARGS, const char *);
void (*win_raw_print_bold)(CARGS, const char *);
int (*win_nhgetch)(CARGS);
- int (*win_nh_poskey)(CARGS, int *, int *, int *);
+ int (*win_nh_poskey)(CARGS, coordxy *, coordxy *, int *);
void (*win_nhbell)(CARGS);
int (*win_doprev_message)(CARGS);
char (*win_yn_function)
extern void safe_raw_print(const char *);
extern void safe_raw_print_bold(const char *);
extern int safe_nhgetch(void);
-extern int safe_nh_poskey(int *, int *, int *);
+extern int safe_nh_poskey(coordxy *, coordxy *, int *);
extern void safe_nhbell(void);
extern int safe_doprev_message(void);
extern char safe_yn_function(const char *, const char *, char);
E void tty_raw_print(const char *);
E void tty_raw_print_bold(const char *);
E int tty_nhgetch(void);
-E int tty_nh_poskey(int *, int *, int *);
+E int tty_nh_poskey(coordxy *, coordxy *, int *);
E void tty_nhbell(void);
E int tty_doprev_message(void);
E char tty_yn_function(const char *, const char *, char);
struct obj *a_obj;
struct monst *a_monst;
int a_int;
+ int a_xint16;
+ int a_xint8;
char a_char;
schar a_schar;
uchar a_uchar;
unsigned int a_uint;
long a_long;
unsigned long a_ulong;
+ coordxy a_coordxy;
int *a_iptr;
+ xint16 *a_xint16ptr;
+ xint8 *a_xint8ptr;
long *a_lptr;
+ coordxy *a_coordxyptr;
unsigned long *a_ulptr;
unsigned *a_uptr;
const char *a_string;
static int use_camera(struct obj *);
static int use_towel(struct obj *);
-static boolean its_dead(int, int, int *);
+static boolean its_dead(coordxy, coordxy, int *);
static int use_stethoscope(struct obj *);
static void use_whistle(struct obj *);
static void use_magic_whistle(struct obj *);
static int apply_ok(struct obj *);
static int flip_through_book(struct obj *);
static boolean figurine_location_checks(struct obj *, coord *, boolean);
-static boolean check_jump(genericptr_t, int, int);
-static boolean is_valid_jump_pos(int, int, int, boolean);
-static boolean get_valid_jump_position(int, int);
-static boolean get_valid_polearm_position(int, int);
+static boolean check_jump(genericptr_t, coordxy, coordxy);
+static boolean is_valid_jump_pos(coordxy, coordxy, int, boolean);
+static boolean get_valid_jump_position(coordxy, coordxy);
+static boolean get_valid_polearm_position(coordxy, coordxy);
static boolean find_poleable_mon(coord *, int, int);
static const char no_elbow_room[] =
/* maybe give a stethoscope message based on floor objects */
static boolean
-its_dead(int rx, int ry, int *resp)
+its_dead(coordxy rx, coordxy ry, int *resp)
{
char buf[BUFSZ];
boolean more_corpses;
{
struct monst *mtmp;
struct rm *lev;
- int rx, ry, res;
+ int res;
+ coordxy rx, ry;
boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
&& !rn2(Role_if(PM_HEALER) ? 10 : 3));
/* callback routine for walk_path() */
static boolean
-check_jump(genericptr arg, int x, int y)
+check_jump(genericptr arg, coordxy x, coordxy y)
{
int traj = *(int *) arg;
struct rm *lev = &levl[x][y];
}
static boolean
-is_valid_jump_pos(int x, int y, int magic, boolean showmsg)
+is_valid_jump_pos(coordxy x, coordxy y, int magic, boolean showmsg)
{
if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
/* The Knight jumping restriction still applies when riding a
passage through doorways: horizonal, vertical, or diagonal;
since knight's jump and other irregular directions are
possible, we flatten those out to simplify door checks */
- int diag, traj,
- dx = x - u.ux, dy = y - u.uy,
- ax = abs(dx), ay = abs(dy);
+ int diag, traj;
+ coordxy dx = x - u.ux, dy = y - u.uy,
+ ax = abs(dx), ay = abs(dy);
/* diag: any non-orthogonal destination classifed as diagonal */
diag = (magic || Passes_walls || (!dx && !dy)) ? jAny
}
static boolean
-get_valid_jump_position(int x, int y)
+get_valid_jump_position(coordxy x, coordxy y)
{
return (isok(x, y)
&& (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) {
- int x, y, dx, dy;
+ coordxy x, y, dx, dy;
for (dx = -4; dx <= 4; dx++)
for (dy = -4; dy <= 4; dy++) {
- x = dx + (int) u.ux;
- y = dy + (int) u.uy;
+ x = dx + (coordxy) u.ux;
+ y = dy + (coordxy) u.uy;
if (get_valid_jump_position(x, y))
tmp_at(x, y);
}
struct monst *mtmp;
coord mpos;
boolean impaired;
- int x, y, lo_x, hi_x, lo_y, hi_y, rt, glyph;
+ coordxy x, y, lo_x, hi_x, lo_y, hi_y, rt;
+ int glyph;
impaired = (Confusion || Stunned || Hallucination);
mpos.x = mpos.y = 0; /* no candidate location yet */
}
static boolean
-get_valid_polearm_position(int x, int y)
+get_valid_polearm_position(coordxy x, coordxy y)
{
int glyph;
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) {
- int x, y, dx, dy;
+ coordxy x, y, dx, dy;
for (dx = -4; dx <= 4; dx++)
for (dy = -4; dy <= 4; dy++) {
do_break_wand(struct obj *obj)
{
static const char nothing_else_happens[] = "But nothing else happens...";
- register int i, x, y;
+ register int i;
+ coordxy x, y;
register struct monst *mon;
int dmg, damage;
boolean affects_objects;
static uchar abil_to_adtyp(long *);
static int glow_strength(int);
static boolean untouchable(struct obj *, boolean);
-static int count_surround_traps(int, int);
+static int count_surround_traps(coordxy, coordxy);
/* The amount added to the victim's total hit points to insure that the
victim will be killed even after damage bonus/penalty adjustments.
}
static int
-count_surround_traps(int x, int y)
+count_surround_traps(coordxy x, coordxy y)
{
struct rm *levp;
struct obj *otmp;
struct trap *ttmp;
- int dx, dy, glyph, ret = 0;
+ coordxy dx, dy;
+ int glyph, ret = 0;
for (dx = x - 1; dx < x + 2; ++dx)
for (dy = y - 1; dy < y + 2; ++dy) {
static boolean no_bones_level(d_level *);
static void goodfruit(int);
static void resetobjs(struct obj *, boolean);
-static void give_to_nearby_mon(struct obj *, int, int);
+static void give_to_nearby_mon(struct obj *, coordxy, coordxy);
static boolean fixuporacle(struct monst *);
static void remove_mon_from_bones(struct monst *);
but skipping hero's location.
If no such monster, place object on floor at x,y. */
static void
-give_to_nearby_mon(struct obj *otmp, int x, int y)
+give_to_nearby_mon(struct obj *otmp, coordxy x, coordxy y)
{
struct monst *mtmp;
struct monst *selected = (struct monst *) 0;
drop_upon_death(
struct monst *mtmp, /* monster if hero rises as one (non ghost) */
struct obj *cont, /* container if hero is turned into a statue */
- int x, int y)
+ coordxy x, coordxy y)
{
struct obj *otmp;
void
savebones(int how, time_t when, struct obj *corpse)
{
- int x, y;
+ coordxy x, y;
struct trap *ttmp;
struct monst *mtmp;
struct fruit *f;
static void reset_cmd_vars(boolean);
static void mcmd_addmenu(winid, int, const char *);
static char here_cmd_menu(void);
-static char there_cmd_menu(int, int, int);
-static void act_on_act(int, int, int);
-static char readchar_core(int *, int *, int *);
+static char there_cmd_menu(coordxy, coordxy, int);
+static void act_on_act(int, coordxy, coordxy);
+static char readchar_core(coordxy *, coordxy *, int *);
static char *parse(void);
static void show_direction_keys(winid, char, boolean);
static boolean help_dir(char, uchar, const char *);
wiz_show_seenv(void)
{
winid win;
- int x, y, v, startx, stopx, curx;
+ coordxy x, y, startx, stopx, curx;
+ int v;
char row[COLNO + 1];
win = create_nhwindow(NHW_TEXT);
wiz_show_vision(void)
{
winid win;
- int x, y, v;
+ coordxy x, y;
+ int v;
char row[COLNO + 1];
win = create_nhwindow(NHW_TEXT);
wiz_show_wmodes(void)
{
winid win;
- int x, y;
+ coordxy x, y;
char row[COLNO + 1];
struct rm *lev;
boolean istty = WINDOWPORT(tty);
wiz_map_levltyp(void)
{
winid win;
- int x, y, terrain;
+ coordxy x, y;
+ int terrain;
char row[COLNO + 1];
boolean istty = !strcmp(windowprocs.name, "tty");
}
/* convert an x,y pair into a direction code */
-int
-xytod(schar x, schar y)
+coordxy
+xytod(coordxy x, coordxy y)
{
register int dd;
void
confdir(void)
{
- register int x = NODIAG(u.umonnum) ? dirs_ord[rn2(4)] : rn2(N_DIRS);
+ register coordxy x = NODIAG(u.umonnum) ? dirs_ord[rn2(4)] : rn2(N_DIRS);
u.dx = xdir[x];
u.dy = ydir[x];
}
int
-isok(register int x, register int y)
+isok(register coordxy x, register coordxy y)
{
/* x corresponds to curx, so x==1 is the first column. Ach. %% */
return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1;
/* command menu entries when targeting self */
static int
-there_cmd_menu_self(winid win, int x, int y, int *act UNUSED)
+there_cmd_menu_self(winid win, coordxy x, coordxy y, int *act UNUSED)
{
int K = 0;
char buf[BUFSZ];
static int
there_cmd_menu_next2u(
winid win,
- int x, int y,
+ coordxy x, coordxy y,
int mod,
int *act)
{
static void
act_on_act(
int act, /* action */
- int dx, int dy) /* delta to adjacent spot (farther for couple of cases) */
+ coordxy dx, coordxy dy) /* delta to adjacent spot (farther for couple of cases) */
{
struct obj *otmp;
int dir;
/* offer choice of actions to perform at adjacent location <x,y> */
static char
-there_cmd_menu(int x, int y, int mod)
+there_cmd_menu(coordxy x, coordxy y, int mod)
{
winid win;
char ch = '\0';
int npick = 0, K = 0;
menu_item *picks = (menu_item *) 0;
/*int dx = sgn(x - u.ux), dy = sgn(y - u.uy);*/
- int dx = x - u.ux, dy = y - u.uy;
+ coordxy dx = x - u.ux, dy = y - u.uy;
int act = MCMD_NOTHING;
win = create_nhwindow(NHW_MENU);
* convert a MAP window position into a movement key usable with movecmd()
*/
const char *
-click_to_cmd(int x, int y, int mod)
+click_to_cmd(coordxy x, coordxy y, int mod)
{
static char cmd[4];
struct obj *o;
#endif /* HANGUPHANDLING */
static char
-readchar_core(int *x, int *y, int *mod)
+readchar_core(coordxy *x, coordxy *y, int *mod)
{
register int sym;
readchar(void)
{
char ch;
- int x = u.ux, y = u.uy, mod = 0;
+ coordxy x = u.ux, y = u.uy;
+ int mod = 0;
ch = readchar_core(&x, &y, &mod);
return ch;
}
char
-readchar_poskey(int *x, int *y, int *mod)
+readchar_poskey(coordxy *x, coordxy *y, int *mod)
{
char ch;
#include "hack.h"
-static void get_wall_for_db(int *, int *);
-static struct entity *e_at(int, int);
-static void m_to_e(struct monst *, int, int, struct entity *);
+static void get_wall_for_db(coordxy *, coordxy *);
+static struct entity *e_at(coordxy, coordxy);
+static void m_to_e(struct monst *, coordxy, coordxy, struct entity *);
static void u_to_e(struct entity *);
-static void set_entity(int, int, struct entity *);
+static void set_entity(coordxy, coordxy, struct entity *);
static const char *e_nam(struct entity *);
static const char *E_phrase(struct entity *, const char *);
-static boolean e_survives_at(struct entity *, int, int);
+static boolean e_survives_at(struct entity *, coordxy, coordxy);
static void e_died(struct entity *, int, int);
static boolean automiss(struct entity *);
static boolean e_missed(struct entity *, boolean);
}
boolean
-is_pool(int x, int y)
+is_pool(coordxy x, coordxy y)
{
schar ltyp;
}
boolean
-is_lava(int x, int y)
+is_lava(coordxy x, coordxy y)
{
schar ltyp;
}
boolean
-is_pool_or_lava(int x, int y)
+is_pool_or_lava(coordxy x, coordxy y)
{
if (is_pool(x, y) || is_lava(x, y))
return TRUE;
}
boolean
-is_ice(int x, int y)
+is_ice(coordxy x, coordxy y)
{
schar ltyp;
}
boolean
-is_moat(int x, int y)
+is_moat(coordxy x, coordxy y)
{
schar ltyp;
*/
int
-is_drawbridge_wall(int x, int y)
+is_drawbridge_wall(coordxy x, coordxy y)
{
struct rm *lev;
* (instead of UP or DOWN, as with is_drawbridge_wall).
*/
boolean
-is_db_wall(int x, int y)
+is_db_wall(coordxy x, coordxy y)
{
return (boolean) (levl[x][y].typ == DBWALL);
}
* a drawbridge or drawbridge wall.
*/
boolean
-find_drawbridge(int *x, int *y)
+find_drawbridge(coordxy *x, coordxy *y)
{
int dir;
* Find the drawbridge wall associated with a drawbridge.
*/
static void
-get_wall_for_db(int *x, int *y)
+get_wall_for_db(coordxy *x, coordxy *y)
{
switch (levl[*x][*y].drawbridgemask & DB_DIR) {
case DB_NORTH:
* flag must be put to TRUE if we want the drawbridge to be opened.
*/
boolean
-create_drawbridge(int x, int y, int dir, boolean flag)
+create_drawbridge(coordxy x, coordxy y, int dir, boolean flag)
{
- int x2, y2;
+ coordxy x2, y2;
boolean horiz;
boolean lava = levl[x][y].typ == LAVAPOOL; /* assume initialized map */
}
static struct entity *
-e_at(int x, int y)
+e_at(coordxy x, coordxy y)
{
int entitycnt;
}
static void
-m_to_e(struct monst *mtmp, int x, int y, struct entity *etmp)
+m_to_e(struct monst *mtmp, coordxy x, coordxy y, struct entity *etmp)
{
etmp->emon = mtmp;
if (mtmp) {
}
static void
-set_entity(int x, int y, struct entity *etmp)
+set_entity(coordxy x, coordxy y, struct entity *etmp)
{
if (u_at(x, y))
u_to_e(etmp);
* Simple-minded "can it be here?" routine
*/
static boolean
-e_survives_at(struct entity *etmp, int x, int y)
+e_survives_at(struct entity *etmp, coordxy x, coordxy y)
{
if (noncorporeal(etmp->edata))
return TRUE;
static void
do_entity(struct entity *etmp)
{
- int newx, newy, at_portcullis, oldx, oldy;
+ coordxy newx, newy, oldx, oldy;
+ int at_portcullis;
boolean must_jump = FALSE, relocates = FALSE, e_inview;
struct rm *crm;
* Close the drawbridge located at x,y
*/
void
-close_drawbridge(int x, int y)
+close_drawbridge(coordxy x, coordxy y)
{
register struct rm *lev1, *lev2;
struct trap *t;
- int x2, y2;
+ coordxy x2, y2;
lev1 = &levl[x][y];
if (lev1->typ != DRAWBRIDGE_DOWN)
* Open the drawbridge located at x,y
*/
void
-open_drawbridge(int x, int y)
+open_drawbridge(coordxy x, coordxy y)
{
register struct rm *lev1, *lev2;
struct trap *t;
- int x2, y2;
+ coordxy x2, y2;
lev1 = &levl[x][y];
if (lev1->typ != DRAWBRIDGE_UP)
* Let's destroy the drawbridge located at x,y
*/
void
-destroy_drawbridge(int x, int y)
+destroy_drawbridge(coordxy x, coordxy y)
{
register struct rm *lev1, *lev2;
struct trap *t;
struct obj *otmp;
- int x2, y2, i;
+ coordxy x2, y2;
+ int i;
boolean e_inview;
struct entity *etmp1 = &(g.occupants[0]), *etmp2 = &(g.occupants[1]);
static void browse_map(int, const char *);
static void map_monst(struct monst *, boolean);
static void do_dknown_of(struct obj *);
-static boolean check_map_spot(int, int, char, unsigned);
+static boolean check_map_spot(coordxy, coordxy, char, unsigned);
static boolean clear_stale_map(char, unsigned);
static void sense_trap(struct trap *, coordxy, coordxy, int);
static int detect_obj_traps(struct obj *, boolean, int);
static void display_trap_map(struct trap *, int);
static int furniture_detect(void);
-static void show_map_spot(int, int);
-static void findone(int, int, genericptr_t);
-static void openone(int, int, genericptr_t);
+static void show_map_spot(coordxy, coordxy);
+static void findone(coordxy, coordxy, genericptr_t);
+static void openone(coordxy, coordxy, genericptr_t);
static int mfind0(struct monst *, boolean);
-static int reveal_terrain_getglyph(int, int, int, unsigned, int, int);
+static int reveal_terrain_getglyph(coordxy, coordxy, int, unsigned, int, int);
/* dummytrap: used when detecting traps finds a door or chest trap; the
couple of fields that matter are always re-initialized during use so
/* this is checking whether a trap symbol represents a trapped chest,
not whether a trapped chest is actually present */
boolean
-trapped_chest_at(int ttyp, int x, int y)
+trapped_chest_at(int ttyp, coordxy x, coordxy y)
{
struct monst *mtmp;
struct obj *otmp;
/* this is checking whether a trap symbol represents a trapped door,
not whether the door here is actually trapped */
boolean
-trapped_door_at(int ttyp, int x, int y)
+trapped_door_at(int ttyp, coordxy x, coordxy y)
{
struct rm *lev;
/* Check whether the location has an outdated object displayed on it. */
static boolean
-check_map_spot(int x, int y, char oclass, unsigned material)
+check_map_spot(coordxy x, coordxy y, char oclass, unsigned material)
{
int glyph;
register struct obj *otmp;
static boolean
clear_stale_map(char oclass, unsigned material)
{
- register int zx, zy;
+ register coordxy zx, zy;
boolean change_made = FALSE;
for (zx = 1; zx < COLNO; zx++)
object_detect(struct obj *detector, /* object doing the detecting */
int class) /* an object class, 0 for all */
{
- register int x, y;
+ register coordxy x, y;
char stuff[BUFSZ];
int is_cursed = (detector && detector->cursed);
int do_dknown = (detector && (detector->oclass == POTION_CLASS
furniture_detect(void)
{
struct monst *mon;
- int x, y, glyph, sym, found = 0, revealed = 0;
+ coordxy x, y;
+ int glyph, sym, found = 0, revealed = 0;
(void) unconstrain_map();
}
static void
-show_map_spot(int x, int y)
+show_map_spot(coordxy x, coordxy y)
{
struct rm *lev;
struct trap *t;
/* find something at one location; it should find all somethings there
since it is used for magical detection rather than physical searching */
static void
-findone(int zx, int zy, genericptr_t num)
+findone(coordxy zx, coordxy zy, genericptr_t num)
{
register struct trap *ttmp;
register struct monst *mtmp;
}
static void
-openone(int zx, int zy, genericptr_t num)
+openone(coordxy zx, coordxy zy, genericptr_t num)
{
register struct trap *ttmp;
register struct obj *otmp;
/* callback hack for overriding vision in do_clear_area() */
boolean
-detecting(void (*func)(int, int, genericptr_t))
+detecting(void (*func)(coordxy, coordxy, genericptr_t))
{
return (func == findone || func == openone);
}
static int
mfind0(struct monst *mtmp, boolean via_warning)
{
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
boolean found_something = FALSE;
if (via_warning && !warning_of(mtmp))
void
warnreveal(void)
{
- int x, y;
+ coordxy x, y;
struct monst *mtmp;
for (x = u.ux - 1; x <= u.ux + 1; x++)
void
sokoban_detect(void)
{
- register int x, y;
+ register coordxy x, y;
register struct trap *ttmp;
register struct obj *obj;
}
static int
-reveal_terrain_getglyph(int x, int y, int full, unsigned swallowed,
+reveal_terrain_getglyph(coordxy x, coordxy y, int full, unsigned swallowed,
int default_glyph, int which_subset)
{
int glyph, levl_glyph;
void
dump_map(void)
{
- int x, y, glyph, skippedrows, lastnonblank;
+ coordxy x, y;
+ int glyph, skippedrows, lastnonblank;
int subset = TER_MAP | TER_TRP | TER_OBJ | TER_MON;
int default_glyph = cmap_to_glyph(g.level.flags.arboreal ? S_tree
: S_stone);
if ((Hallucination || Stunned || Confusion) && !full) {
You("are too disoriented for this.");
} else {
- int x, y, glyph, default_glyph;
+ coordxy x, y;
+ int glyph, default_glyph;
char buf[BUFSZ];
/* there is a TER_MAP bit too; we always show map regardless of it */
boolean keep_traps = (which_subset & TER_TRP) !=0,
static boolean watchman_canseeu(struct monst *);
static int adj_pit_checks(coord *, char *);
static void pit_flow(struct trap *, schar);
-static boolean furniture_handled(int, int, boolean);
+static boolean furniture_handled(coordxy, coordxy, boolean);
/* Indices returned by dig_typ() */
enum dig_types {
#define BY_OBJECT ((struct monst *) 0)
boolean
-dig_check(struct monst *madeby, boolean verbose, int x, int y)
+dig_check(struct monst *madeby, boolean verbose, coordxy x, coordxy y)
{
struct trap *ttmp = t_at(x, y);
const char *verb =
}
static boolean
-furniture_handled(int x, int y, boolean madeby_u)
+furniture_handled(coordxy x, coordxy y, boolean madeby_u)
{
struct rm *lev = &levl[x][y];
breaksink(x, y);
} else if (lev->typ == DRAWBRIDGE_DOWN
|| (is_drawbridge_wall(x, y) >= 0)) {
- int bx = x, by = y;
+ coordxy bx = x, by = y;
/* if under the portcullis, the bridge is adjacent */
(void) find_drawbridge(&bx, &by);
/* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */
schar
-fillholetyp(int x, int y,
+fillholetyp(coordxy x, coordxy y,
boolean fill_if_any) /* force filling if it exists at all */
{
- register int x1, y1;
- int lo_x = max(1, x - 1), hi_x = min(x + 1, COLNO - 1),
- lo_y = max(0, y - 1), hi_y = min(y + 1, ROWNO - 1);
+ coordxy x1, y1;
+ coordxy lo_x = max(1, x - 1), hi_x = min(x + 1, COLNO - 1),
+ lo_y = max(0, y - 1), hi_y = min(y + 1, ROWNO - 1);
int pool_cnt = 0, moat_cnt = 0, lava_cnt = 0;
for (x1 = lo_x; x1 <= hi_x; x1++)
}
void
-digactualhole(int x, int y, struct monst *madeby, int ttyp)
+digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
{
struct obj *oldobjs, *newobjs;
register struct trap *ttmp;
if (pit_only) {
pline_The("drawbridge seems too hard to dig through.");
} else {
- int x = dig_x, y = dig_y;
+ coordxy x = dig_x, y = dig_y;
/* if under the portcullis, the bridge is adjacent */
(void) find_drawbridge(&x, &y);
destroy_drawbridge(x, y);
int
use_pick_axe2(struct obj *obj)
{
- register int rx, ry;
+ coordxy rx, ry;
register struct rm *lev;
struct trap *trap, *trap_with_u;
int dig_target;
struct monst *mtmp;
struct obj *otmp;
struct trap *trap_with_u = (struct trap *) 0;
- int zx, zy, diridx = 8, digdepth, flow_x = -1, flow_y = -1;
+ coordxy zx, zy, flow_x = -1, flow_y = -1;
+ int diridx = 8, digdepth;
boolean shopdoor, shopwall, maze_dig, pitdig = FALSE, pitflow = FALSE;
/*
: (char *) 0);
for (idx = 0; idx < N_DIRS; ++idx) {
if (t.conjoined & (1 << idx)) {
- int x, y;
+ coordxy x, y;
struct trap *t2;
x = t.tx + xdir[idx];
*/
#include "hack.h"
-static void show_mon_or_warn(int, int, int);
+static void show_mon_or_warn(coordxy, coordxy, int);
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 check_pos(coordxy, coordxy, int);
static int get_bk_glyph(coordxy x, coordxy y);
-static int tether_glyph(int, int);
+static int tether_glyph(coordxy, coordxy);
static void mimic_light_blocking(struct monst *);
#ifdef UNBUFFERED_GLYPHINFO
static glyph_info *glyphinfo_at(coordxy, coordxy, int);
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
#ifdef WA_VERBOSE
-static boolean more_than_one(int, int, int, int, int);
+static boolean more_than_one(coordxy, coordxy, coordxy, coordxy, coordxy);
#endif
-static int set_twall(int, int, int, int, int, int, int, int);
-static int set_wall(int, int, int);
-static int set_corn(int, int, int, int, int, int, int, int);
-static int set_crosswall(int, int);
-static void set_seenv(struct rm *, int, int, int, int);
+static int set_twall(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
+static int set_wall(coordxy, coordxy, int);
+static int set_corn(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
+static int set_crosswall(coordxy, coordxy);
+static void set_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
static void t_warn(struct rm *);
static int wall_angle(struct rm *);
* having to create fake objects and traps. However, I am reluctant to
* make this change.
*/
-/* FIXME: some of these use coordxys for x and y, and some use ints. Make
- * this consistent.
- */
/*
* map_background()
void
map_trap(register struct trap *trap, register int show)
{
- register int x = trap->tx, y = trap->ty;
+ register coordxy x = trap->tx, y = trap->ty;
register int glyph = trap_to_glyph(trap);
if (g.level.flags.hero_memory)
void
map_object(register struct obj *obj, register int show)
{
- register int x = obj->ox, y = obj->oy;
+ register coordxy x = obj->ox, y = obj->oy;
register int glyph = obj_to_glyph(obj, newsym_rn2);
if (g.level.flags.hero_memory) {
}
boolean
-unmap_invisible(int x, int y)
+unmap_invisible(coordxy x, coordxy y)
{
if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
* to call newsym().
*/
void
-unmap_object(register int x, register int y)
+unmap_object(register coordxy x, register coordxy y)
{
register struct trap *trap;
}
void
-map_location(int x, int y, int show)
+map_location(coordxy x, coordxy y, int show)
{
_map_location(x, y, show);
}
/* display something on monster layer; may need to fixup object layer */
static void
-show_mon_or_warn(int x, int y, int monglyph)
+show_mon_or_warn(coordxy x, coordxy y, int monglyph)
{
struct obj *o;
static void
display_warning(struct monst *mon)
{
- int x = mon->mx, y = mon->my;
+ coordxy x = mon->mx, y = mon->my;
int glyph;
if (mon_warning(mon)) {
* Possibly put a new glyph at the given location.
*/
void
-newsym(register int x, register int y)
+newsym(coordxy x, coordxy y)
{
struct monst *mon;
int see_it;
}
static int
-tether_glyph(int x, int y)
+tether_glyph(coordxy x, coordxy y)
{
int tdx, tdy;
tdx = u.ux - x;
} tgfirst;
void
-tmp_at(int x, int y)
+tmp_at(coordxy x, coordxy y)
{
static struct tmp_glyph *tglyph = (struct tmp_glyph *) 0;
struct tmp_glyph *tmp;
* meant to be at the location.
*/
void
-flash_glyph_at(int x, int y, int tg, int rpt)
+flash_glyph_at(coordxy x, coordxy y, int tg, int rpt)
{
int i, glyph[2];
cls();
bot();
} else {
- register int x, y;
+ coordxy x, y;
/* Clear old location */
for (y = lasty - 1; y <= lasty + 1; y++)
{
static coordxy lastx, lasty;
static boolean dela;
- register int x, y;
+ coordxy x, y;
/* swallowing has a higher precedence than under water */
if (Is_waterlevel(&u.uz) || u.uswallow)
void
docrt(void)
{
- register int x, y;
+ coordxy x, y;
register struct rm *lev;
if (!u.ux || g.program_state.in_docrt)
void
redraw_map(void)
{
- int x, y, glyph;
+ coordxy x, y;
+ int glyph;
glyph_info bkglyphinfo = nul_glyphinfo;
/*
* between object piles and single objects, it doesn't mark the location
* for update. */
void
-newsym_force(int x, int y)
+newsym_force(coordxy x, coordxy y)
{
newsym(x, y);
g.gbuf[y][x].gnew = 1;
* Store the glyph in the 3rd screen for later flushing.
*/
void
-show_glyph(int x, int y, int glyph)
+show_glyph(coordxy x, coordxy y, int glyph)
{
#ifndef UNBUFFERED_GLYPHINFO
glyph_info glyphinfo;
void
clear_glyph_buffer(void)
{
- register int x, y;
+ register coordxy x, y;
gbuf_entry *gptr = &g.gbuf[0][0];
glyph_info *giptr =
#ifndef UNBUFFERED_GLYPHINFO
/* used by tty after menu or text popup has temporarily overwritten the map
and it has been erased so shows spaces, not necessarily S_unexplored */
void
-row_refresh(int start, int stop, int y)
+row_refresh(coordxy start, coordxy stop, coordxy y)
{
- register int x, glyph;
+ register coordxy x;
+ int glyph;
register boolean force;
gbuf_entry *gptr = &g.gbuf[0][0];
glyph_info bkglyphinfo = nul_glyphinfo;
*/
static int flushing = 0;
static int delay_flushing = 0;
- register int x, y;
+ register coordxy x, y;
glyph_info bkglyphinfo = nul_glyphinfo;
/* 3.7: don't update map, status, or perm_invent during save/restore */
#ifdef WA_VERBOSE
static const char *type_to_name(int);
-static void error4(int, int, int, int, int, int);
+static void error4(coordxy, coordxy, int, int, int, int);
static int bad_count[MAX_TYPE]; /* count of positions flagged as bad */
static const char *const type_names[MAX_TYPE] = {
}
static void
-error4(int x, int y, int a, int b, int c, int dd)
+error4(coordxy x, coordxy y, int a, int b, int c, int dd)
{
pline("set_wall_state: %s @ (%d,%d) %s%s%s%s",
type_to_name(levl[x][y].typ), x, y,
* Things that are ambiguous: lava
*/
static int
-check_pos(int x, int y, int which)
+check_pos(coordxy x, coordxy y, int which)
{
int type;
/*ARGSUSED*/
#ifdef WA_VERBOSE
static boolean
-more_than_one(int x, int y, int a, int b, int c)
+more_than_one(coordxy x, coordxy y, coordxy a, coordxy b, coordxy c)
{
if ((a && (b | c)) || (b && (a | c)) || (c && (a | b))) {
error4(x, y, a, b, c, 0);
static int
set_twall(
#ifdef WA_VERBOSE
- int x0, int y0, /* used #if WA_VERBOSE */
+ coordxy x0, coordxy y0, /* used #if WA_VERBOSE */
#else
- int x0 UNUSED, int y0 UNUSED,
+ coordxy x0 UNUSED, coordxy y0 UNUSED,
#endif
- int x1, int y1, int x2, int y2, int x3, int y3)
+ coordxy x1, coordxy y1, coordxy x2, coordxy y2, coordxy x3, coordxy y3)
{
int wmode, is_1, is_2, is_3;
/* Return wall mode for a horizontal or vertical wall. */
static int
-set_wall(int x, int y, int horiz)
+set_wall(coordxy x, coordxy y, int horiz)
{
int wmode, is_1, is_2;
/* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */
static int
-set_corn(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
+set_corn(coordxy x1, coordxy y1, coordxy x2, coordxy y2, coordxy x3, coordxy y3, coordxy x4, coordxy y4)
{
- int wmode, is_1, is_2, is_3, is_4;
+ coordxy wmode, is_1, is_2, is_3, is_4;
is_1 = check_pos(x1, y1, 1);
is_2 = check_pos(x2, y2, 1);
/* Return mode for a crosswall. */
static int
-set_crosswall(int x, int y)
+set_crosswall(coordxy x, coordxy y)
{
- int wmode, is_1, is_2, is_3, is_4;
+ coordxy wmode, is_1, is_2, is_3, is_4;
is_1 = check_pos(x - 1, y - 1, 1);
is_2 = check_pos(x + 1, y - 1, 1);
/* called for every <x,y> by set_wall_state() and for specific <x,y> during
vault wall repair */
void
-xy_set_wall_state(int x, int y)
+xy_set_wall_state(coordxy x, coordxy y)
{
- int wmode;
+ coordxy wmode;
struct rm *lev = &levl[x][y];
switch (lev->typ) {
case SDOOR:
- wmode = set_wall(x, y, (int) lev->horizontal);
+ wmode = set_wall(x, y, (coordxy) lev->horizontal);
break;
case VWALL:
wmode = set_wall(x, y, 0);
void
set_wall_state(void)
{
- int x, y;
+ coordxy x, y;
#ifdef WA_VERBOSE
for (x = 0; x < MAX_TYPE; x++)
for (x = y = 0; x < MAX_TYPE; x++)
if (bad_count[x]) {
if (y == 0) {
- y = 1; /* only print once */
+ y = 1; /* only prcoordxy once */
pline("set_wall_type: wall mode problems with: ");
}
pline("%s %d;", type_names[x], bad_count[x]);
/* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */
static void
set_seenv(struct rm *lev,
- int x0, int y0, int x, int y) /* from, to */
+ coordxy x0, coordxy y0, coordxy x, coordxy y) /* from, to */
{
- int dx = x - x0, dy = y0 - y;
+ coordxy dx = x - x0, dy = y0 - y;
lev->seenv |= seenv_matrix[sign(dy) + 1][sign(dx) + 1];
}
/* Called by blackout(vault.c) when vault guard removes temporary corridor,
- turning spot <x0,y0> back into stone; <x1,y1> is an adjacent spot. */
+ turning spot <x0,y0> back coordxyo stone; <x1,y1> is an adjacent spot. */
void
unset_seenv(struct rm *lev, /* &levl[x1][y1] */
- int x0, int y0, int x1, int y1) /* from, to; abs(x1-x0)==1
+ coordxy x0, coordxy y0,
+ coordxy x1, coordxy y1) /* from, to; abs(x1-x0)==1
&& abs(y0-y1)==1 */
{
- int dx = x1 - x0, dy = y0 - y1;
+ coordxy dx = x1 - x0, dy = y0 - y1;
lev->seenv &= ~seenv_matrix[dy + 1][dx + 1];
}
* it's gone for good... If the destination is not a pool, returns FALSE.
*/
boolean
-boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing)
+boulder_hits_pool(struct obj *otmp, coordxy rx, coordxy ry, boolean pushing)
{
if (!otmp || otmp->otyp != BOULDER) {
impossible("Not a boulder?");
* away.
*/
boolean
-flooreffects(struct obj *obj, int x, int y, const char *verb)
+flooreffects(struct obj *obj, coordxy x, coordxy y, const char *verb)
{
struct trap *t;
struct monst *mtmp;
static boolean
teleport_sink(void)
{
- int cx, cy;
+ coordxy cx, cy;
int cnt = 0;
struct trap *trp;
struct engr *eng;
static void getpos_help(boolean, const char *);
static int QSORTCALLBACK cmp_coord_distu(const void *, const void *);
static int gloc_filter_classify_glyph(int);
-static int gloc_filter_floodfill_matcharea(int, int);
-static void gloc_filter_floodfill(int, int);
+static int gloc_filter_floodfill_matcharea(coordxy, coordxy);
+static void gloc_filter_floodfill(coordxy, coordxy);
static void gloc_filter_init(void);
static void gloc_filter_done(void);
-static boolean gather_locs_interesting(int, int, int);
+static boolean gather_locs_interesting(coordxy, coordxy, int);
static void gather_locs(coord **, int *, int);
static void auto_describe(int, int);
static void truncate_to_map(int *, int *, schar, schar);
* parameter value 0 = initialize, 1 = highlight, 2 = done
*/
static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0;
-static boolean (*getpos_getvalid)(int, int) = (boolean (*)(int, int)) 0;
+static boolean (*getpos_getvalid)(coordxy, coordxy) = (boolean (*)(coordxy, coordxy)) 0;
void
-getpos_sethilite(void (*gp_hilitef)(int), boolean (*gp_getvalidf)(int, int))
+getpos_sethilite(void (*gp_hilitef)(int), boolean (*gp_getvalidf)(coordxy, coordxy))
{
getpos_hilitefunc = gp_hilitef;
getpos_getvalid = gp_getvalidf;
}
static int
-gloc_filter_floodfill_matcharea(int x, int y)
+gloc_filter_floodfill_matcharea(coordxy x, coordxy y)
{
int glyph = back_to_glyph(x, y);
}
static void
-gloc_filter_floodfill(int x, int y)
+gloc_filter_floodfill(coordxy x, coordxy y)
{
g.gloc_filter_floodfill_match_glyph = back_to_glyph(x, y);
DISABLE_WARNING_UNREACHABLE_CODE
static boolean
-gather_locs_interesting(int x, int y, int gloc)
+gather_locs_interesting(coordxy x, coordxy y, int gloc)
{
int glyph, sym;
static void
gather_locs(coord **arr_p, int *cnt_p, int gloc)
{
- int x, y, pass, idx;
+ int pass, idx;
+ coordxy x, y;
/*
* We always include the hero's location even if there is no monster
}
char *
-dxdy_to_dist_descr(int dx, int dy, boolean fulldir)
+dxdy_to_dist_descr(coordxy dx, coordxy dy, boolean fulldir)
{
static char buf[30];
int dst;
/* coordinate formatting for 'whatis_coord' option */
char *
-coord_desc(int x, int y, char *outbuf, char cmode)
+coord_desc(coordxy x, coordxy y, char *outbuf, char cmode)
{
static char screen_fmt[16]; /* [12] suffices: "[%02d,%02d]" */
int dx, dy;
char mMoOdDxX[13];
int result = 0;
int cx, cy, i, c;
- int sidx, tx = u.ux, ty = u.uy;
+ int sidx;
+ coordxy tx = u.ux, ty = u.uy;
boolean msg_given = TRUE; /* clear message window by default */
boolean show_goal_msg = FALSE;
boolean hilite_state = FALSE;
if (garr[i])
free((genericptr_t) garr[i]);
getpos_hilitefunc = (void (*)(int)) 0;
- getpos_getvalid = (boolean (*)(int, int)) 0;
+ getpos_getvalid = (boolean (*)(coordxy, coordxy)) 0;
u.dx = udx, u.dy = udy, u.dz = udz;
return result;
}
0 };
-static void wantdoor(int, int, genericptr_t);
+static void wantdoor(coordxy, coordxy, genericptr_t);
boolean
-cursed_object_at(int x, int y)
+cursed_object_at(coordxy x, coordxy y)
{
struct obj *otmp;
int
dog_eat(struct monst *mtmp,
struct obj *obj, /* if unpaid, then thrown or kicked by hero */
- int x, /* dog's starting location, */
- int y, /* might be different from current */
+ coordxy x, /* dog's starting location, */
+ coordxy y, /* might be different from current */
boolean devour)
{
register struct edog *edog = EDOG(mtmp);
dog_goal(register struct monst *mtmp, struct edog *edog,
int after, int udist, int whappr)
{
- register int omx, omy;
+ register coordxy omx, omy;
boolean in_masters_sight, dog_has_minvent;
register struct obj *obj;
xint16 otyp;
#define DDIST(x, y) (dist2(x, y, omx, omy))
#define SQSRCHRADIUS 5
int min_x, max_x, min_y, max_y;
- register int nx, ny;
+ coordxy nx, ny;
g.gtyp = UNDEF; /* no goal as yet */
g.gx = g.gy = 0; /* suppress 'used before set' message */
boolean has_edog, cursemsg[9], do_eat = FALSE;
boolean better_with_displacing = FALSE;
coordxy nix, niy; /* position mtmp is (considering) moving to */
- register int nx, ny; /* temporary coordinates */
+ coordxy nx, ny; /* temporary coordinates */
xint16 cnt, uncursedcnt, chcnt;
int chi = -1, nidist, ndist;
coord poss[9];
/* do_clear_area client */
static void
-wantdoor(int x, int y, genericptr_t distance)
+wantdoor(coordxy x, coordxy y, genericptr_t distance)
{
int ndist, *dist_ptr = (int *) distance;
static char *kickstr(char *, const char *);
static boolean watchman_thief_arrest(struct monst *);
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 kick_dumb(coordxy, coordxy);
+static void kick_ouch(coordxy, coordxy, const char *);
static void otransit_msg(struct obj *, boolean, boolean, long);
static void drop_to(coord *, schar, coordxy, coordxy);
}
static void
-kick_dumb(int x, int y)
+kick_dumb(coordxy x, coordxy y)
{
exercise(A_DEX, FALSE);
if (martial() || ACURR(A_DEX) >= 16 || rn2(3)) {
}
static void
-kick_ouch(int x, int y, const char *kickobjnam)
+kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
{
int dmg;
char buf[BUFSZ];
int
dokick(void)
{
- int x, y;
+ coordxy x, y;
int avrg_attrib;
int glyph, oldglyph = -1;
register struct monst *mtmp;
return ECMD_TIME;
}
if (Levitation) {
- int xx, yy;
+ coordxy xx, yy;
xx = u.ux - u.dx;
yy = u.uy - u.dy;
static void breakmsg(struct obj *, boolean);
static boolean toss_up(struct obj *, boolean);
static void sho_obj_return_to_u(struct obj * obj);
-static boolean mhurtle_step(genericptr_t, int, int);
+static boolean mhurtle_step(genericptr_t, coordxy, coordxy);
/* uwep might already be removed from inventory so test for W_WEP instead;
for Valk+Mjollnir, caller needs to validate the strength requirement */
*/
boolean
walk_path(coord *src_cc, coord *dest_cc,
- boolean (*check_proc)(genericptr_t, int, int),
+ boolean (*check_proc)(genericptr_t, coordxy, coordxy),
genericptr_t arg)
{
- int x, y, dx, dy, x_change, y_change, err, i, prev_x, prev_y;
+ int err;
+ coordxy x, y, dx, dy, x_change, y_change, i, prev_x, prev_y;
boolean keep_going = TRUE;
/* Use Bresenham's Line Algorithm to walk from src to dest.
vs drag-to-dest; original callers use first mode, jumping wants second,
grappling hook backfire and thrown chained ball need third */
boolean
-hurtle_jump(genericptr_t arg, int x, int y)
+hurtle_jump(genericptr_t arg, coordxy x, coordxy y)
{
boolean res;
long save_EWwalking = EWwalking;
* o let jumps go over boulders
*/
boolean
-hurtle_step(genericptr_t arg, int x, int y)
+hurtle_step(genericptr_t arg, coordxy x, coordxy y)
{
- int ox, oy, *range = (int *) arg;
+ coordxy ox, oy;
+ int *range = (int *) arg;
struct obj *obj;
struct monst *mon;
boolean may_pass = TRUE, via_jumping, stopping_short;
}
static boolean
-mhurtle_step(genericptr_t arg, int x, int y)
+mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
{
struct monst *mon = (struct monst *) arg;
struct monst *mtmp;
}
void
-u_on_newpos(int x, int y)
+u_on_newpos(coordxy x, coordxy y)
{
if (!isok(x, y)) { /* validate location */
void (*func)(const char *, ...);
}
void
-stairway_add(int x, int y, boolean up, boolean isladder, d_level *dest)
+stairway_add(coordxy x, coordxy y, boolean up, boolean isladder, d_level *dest)
{
stairway *tmp = (stairway *) alloc(sizeof (stairway));
}
stairway *
-stairway_at(int x, int y)
+stairway_at(coordxy x, coordxy y)
{
stairway *tmp = g.stairs;
* Checks for amulets and such must be done elsewhere.
*/
boolean
-Can_rise_up(int x, int y, d_level *lev)
+Can_rise_up(coordxy x, coordxy y, d_level *lev)
{
stairway *stway = stairway_find_special_dir(FALSE);
/* is <x,y> of `lev' inside the Wizard's tower? */
boolean
-In_W_tower(int x, int y, d_level *lev)
+In_W_tower(coordxy x, coordxy y, d_level *lev)
{
if (!On_W_tower_level(lev))
return FALSE;
struct cemetery *bp, **bonesaddr;
struct trap *t;
unsigned i, ridx, atmp;
- int x, y, ltyp, count;
+ int ltyp, count;
+ coordxy x, y;
char uroom;
/* Should not happen in general, but possible if in the process
/* give a message after caller has determined that hero can't reach */
void
-cant_reach_floor(int x, int y, boolean up, boolean check_pit)
+cant_reach_floor(coordxy x, coordxy y, boolean up, boolean check_pit)
{
You("can't reach the %s.",
up ? ceiling(x, y)
}
const char *
-surface(int x, int y)
+surface(coordxy x, coordxy y)
{
struct rm *lev = &levl[x][y];
}
const char *
-ceiling(int x, int y)
+ceiling(coordxy x, coordxy y)
{
struct rm *lev = &levl[x][y];
const char *what;
}
void
-read_engr_at(int x, int y)
+read_engr_at(coordxy x, coordxy y)
{
struct engr *ep = engr_at(x, y);
int sensed = 0;
}
void
-make_engr_at(int x, int y, const char *s, long e_time, xint16 e_type)
+make_engr_at(coordxy x, coordxy y, const char *s, long e_time, xint16 e_type)
{
struct engr *ep;
unsigned smem = Strlen(s) + 1;
/* delete any engraving at location <x,y> */
void
-del_engr_at(int x, int y)
+del_engr_at(coordxy x, coordxy y)
{
struct engr *ep = engr_at(x, y);
* The caller is responsible for newsym(x, y).
*/
void
-make_grave(int x, int y, const char *str)
+make_grave(coordxy x, coordxy y, const char *str)
{
char buf[BUFSZ];
*/
void
explode(
- int x, int y, /* explosion's location; adjacent spots are also affected */
+ coordxy x, coordxy y, /* explosion's location; adjacent spots are also affected */
int type, /* same as in zap.c; -(wand typ) for some WAND_CLASS */
int dam, /* damage amount */
char olet, /* object class or BURNING_OIL or MON_EXPLODE */
/* returns number of scattered objects */
long
-scatter(int sx, int sy, /* location of objects to scatter */
+scatter(coordxy sx, coordxy sy, /* location of objects to scatter */
int blastforce, /* force behind the scattering */
unsigned int scflags,
struct obj *obj) /* only scatter this obj */
}
}
for (stmp = schain; stmp; stmp = stmp2) {
- int x, y;
+ coordxy x, y;
boolean obj_left_shop = FALSE;
stmp2 = stmp->next;
* For now, just perform a "regular" explosion.
*/
void
-splatter_burning_oil(int x, int y, boolean diluted_oil)
+splatter_burning_oil(coordxy x, coordxy y, boolean diluted_oil)
{
int dmg = d(diluted_oil ? 3 : 4, 4);
/* lit potion of oil is exploding; extinguish it as a light source before
possibly killing the hero and attempting to save bones */
void
-explode_oil(struct obj *obj, int x, int y)
+explode_oil(struct obj *obj, coordxy x, coordxy y)
{
boolean diluted_oil = obj->odiluted;
#define LEFT 4
#define RIGHT 8
-static void roguejoin(int, int, int, int, int);
-static void roguecorr(int, int, int);
-static void miniwalk(int, int);
+static void roguejoin(coordxy, coordxy, coordxy, coordxy, int);
+static void roguecorr(coordxy, coordxy, int);
+static void miniwalk(coordxy, coordxy);
static
void
-roguejoin(int x1, int y1, int x2, int y2, int horiz)
+roguejoin(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int horiz)
{
- register int x, y, middle;
+ register coordxy x, y, middle;
if (horiz) {
middle = x1 + rn2(x2 - x1 + 1);
for (x = min(x1, middle); x <= max(x1, middle); x++)
static
void
-roguecorr(int x, int y, int dir)
+roguecorr(coordxy x, coordxy y, int dir)
{
- register int fromx, fromy, tox, toy;
+ register coordxy fromx, fromy, tox, toy;
if (dir == DOWN) {
g.r[x][y].doortable &= ~DOWN;
/* Modified walkfrom() from mkmaze.c */
static
void
-miniwalk(int x, int y)
+miniwalk(coordxy x, coordxy y)
{
register int q, dir;
int dirs[4];
void
makeroguerooms(void)
{
- register int x, y;
+ register coordxy x, y;
/* Rogue levels are structured 3 by 3, with each section containing
* a room or an intersection. The minimum width is 2 each way.
* One difference between these and "real" Rogue levels: real Rogue
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++) {
if (here.real) { /* Make a room */
- int lowx, lowy, hix, hiy;
+ coordxy lowx, lowy, hix, hiy;
g.r[x][y].nroom = g.nroom;
g.smeq[g.nroom] = g.nroom;
}
void
-corr(int x, int y)
+corr(coordxy x, coordxy y)
{
if (rn2(50)) {
levl[x][y].typ = CORR;
register struct monst *ghost;
struct obj *ghostobj;
struct mkroom *croom;
- int x, y;
+ coordxy x, y;
if (!g.nroom)
return; /* Should never happen */
static void dowatersnakes(void);
static void dowaterdemon(void);
static void dowaternymph(void);
-static void gush(int, int, genericptr_t);
+static void gush(coordxy, coordxy, genericptr_t);
static void dofindgem(void);
static boolean watchman_warn_fountain(struct monst *);
}
static void
-gush(int x, int y, genericptr_t poolcnt)
+gush(coordxy x, coordxy y, genericptr_t poolcnt)
{
register struct monst *mtmp;
register struct trap *ttmp;
}
void
-breaksink(int x, int y)
+breaksink(coordxy x, coordxy y)
{
if (cansee(x, y) || u_at(x, y))
pline_The("pipes break! Water spurts out!");
/* #define DEBUG */ /* uncomment for debugging */
-static boolean could_move_onto_boulder(int, int);
+static boolean could_move_onto_boulder(coordxy, coordxy);
static int moverock(void);
static void dosinkfall(void);
static boolean findtravelpath(int);
-static boolean trapmove(int, int, struct trap *);
+static boolean trapmove(coordxy, coordxy, struct trap *);
static void check_buried_zombies(coordxy, coordxy);
static schar u_simple_floortyp(coordxy, coordxy);
static boolean swim_move_danger(coordxy, coordxy);
static boolean carrying_too_much(void);
static boolean escape_from_sticky_mon(coordxy, coordxy);
static void domove_core(void);
-static void maybe_smudge_engr(int, int, int, int);
+static void maybe_smudge_engr(coordxy, coordxy, coordxy, coordxy);
static struct monst *monstinroom(struct permonst *, int);
static void move_update(boolean);
static int pickup_checks(void);
-static boolean doorless_door(int, int);
+static boolean doorless_door(coordxy, coordxy);
static void maybe_wail(void);
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
}
boolean
-revive_nasty(int x, int y, const char *msg)
+revive_nasty(coordxy x, coordxy y, const char *msg)
{
register struct obj *otmp, *otmp2;
struct monst *mtmp;
/* can hero move onto a spot containing one or more boulders?
used for m<dir> and travel and during boulder push failure */
static boolean
-could_move_onto_boulder(int sx, int sy)
+could_move_onto_boulder(coordxy sx, coordxy sy)
{
/* can if able to phaze through rock (must be poly'd, so not riding) */
if (Passes_walls)
* mode is one of DO_MOVE, TEST_MOVE, TEST_TRAV, or TEST_TRAP
*/
boolean
-test_move(int ux, int uy, int dx, int dy, int mode)
+test_move(coordxy ux, coordxy uy, coordxy dx, coordxy dy, int mode)
{
- int x = ux + dx;
- int y = uy + dy;
+ coordxy x = ux + dx;
+ coordxy y = uy + dy;
register struct rm *tmpr = &levl[x][y];
struct rm *ust;
for (i = 0; i < n; i++) {
int dir;
- int x = travelstepx[set][i];
- int y = travelstepy[set][i];
+ coordxy x = travelstepx[set][i];
+ coordxy y = travelstepy[set][i];
/* no diagonal movement for grid bugs */
int dirmax = NODIAG(u.umonnum) ? 4 : N_DIRS;
boolean alreadyrepeated = FALSE;
for (dir = 0; dir < dirmax; ++dir) {
- int nx = x + xdir[dirs_ord[dir]];
- int ny = y + ydir[dirs_ord[dir]];
+ coordxy nx = x + xdir[dirs_ord[dir]];
+ coordxy ny = y + ydir[dirs_ord[dir]];
/*
* When guessing and trying to travel as close as possible
}
boolean
-is_valid_travelpt(int x, int y)
+is_valid_travelpt(coordxy x, coordxy y)
{
int tx = u.tx;
int ty = u.ty;
(all failures and most successful escapes leave hero at original spot) */
static boolean
trapmove(
- int x, int y, /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
+ coordxy x, coordxy y, /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
struct trap *desttrap) /* nonnull if another trap at <x,y> */
{
boolean anchored = FALSE;
return domove_fight_empty(x, y);
if (flags.mention_walls) {
- int dx = u.dx, dy = u.dy;
+ coordxy dx = u.dx, dy = u.dy;
if (dx && dy) { /* diagonal */
/* only as far as possible diagonally if in very
void
domove(void)
{
- int ux1 = u.ux, uy1 = u.uy;
+ coordxy ux1 = u.ux, uy1 = u.uy;
g.domove_succeeded = 0L;
domove_core();
}
static void
-maybe_smudge_engr(int x1, int y1, int x2, int y2)
+maybe_smudge_engr(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
struct engr *ep;
/* is (x,y) in a town? */
boolean
-in_town(register int x, register int y)
+in_town(coordxy x, coordxy y)
{
s_level *slev = Is_special(&u.uz);
register struct mkroom *sroom;
void
lookaround(void)
{
- register int x, y;
- int i, x0 = 0, y0 = 0, m0 = 1, i0 = 9;
+ register coordxy x, y;
+ coordxy i, x0 = 0, y0 = 0, m0 = 1, i0 = 9;
int corrct = 0, noturn = 0;
struct monst *mtmp;
/* check for a doorway which lacks its door (NODOOR or BROKEN) */
static boolean
-doorless_door(int x, int y)
+doorless_door(coordxy x, coordxy y)
{
struct rm *lev_p = &levl[x][y];
/* used by drown() to check whether hero can crawl from water to <x,y>;
also used by findtravelpath() when destination is one step away */
boolean
-crawl_destination(int x, int y)
+crawl_destination(coordxy x, coordxy y)
{
/* is location ok in general? */
if (!goodpos(x, y, &g.youmonst, 0))
int
monster_nearby(void)
{
- register int x, y;
+ register coordxy x, y;
register struct monst *mtmp;
/* Also see the similar check in dochugw() in monmove.c */
/* distance between two points, in moves */
int
-distmin(int x0, int y0, int x1, int y1)
+distmin(coordxy x0, coordxy y0, coordxy x1, coordxy y1)
{
- register int dx = x0 - x1, dy = y0 - y1;
+ coordxy dx = x0 - x1, dy = y0 - y1;
if (dx < 0)
dx = -dx;
/* square of euclidean distance between pair of pts */
int
-dist2(int x0, int y0, int x1, int y1)
+dist2(coordxy x0, coordxy y0, coordxy x1, coordxy y1)
{
- register int dx = x0 - x1, dy = y0 - y1;
+ coordxy dx = x0 - x1, dy = y0 - y1;
return dx * dx + dy * dy;
}
/* drawbridge is destroying all objects at <x,y> */
void
-delallobj(int x, int y)
+delallobj(coordxy x, coordxy y)
{
struct obj *otmp, *otmp2;
/* try to find a particular type of object at designated map location */
struct obj *
-sobj_at(int otyp, int x, int y)
+sobj_at(int otyp, coordxy x, coordxy y)
{
register struct obj *otmp;
}
boolean
-obj_here(struct obj *obj, int x, int y)
+obj_here(struct obj *obj, coordxy x, coordxy y)
{
register struct obj *otmp;
}
struct obj *
-g_at(int x, int y)
+g_at(coordxy x, coordxy y)
{
register struct obj *obj = g.level.objects[x][y];
/* return a string describing the dungeon feature at <x,y> if there
is one worth mentioning at that location; otherwise null */
const char *
-dfeature_at(int x, int y, char *buf)
+dfeature_at(coordxy x, coordxy y, char *buf)
{
struct rm *lev = &levl[x][y];
int ltyp = lev->typ, cmap = -1;
* Currently, this is only used with a wand of probing zapped downwards.
*/
int
-display_binventory(int x, int y, boolean as_if_seen)
+display_binventory(coordxy x, coordxy y, boolean as_if_seen)
{
struct obj *obj;
menu_item *selected = 0;
void
do_light_sources(coordxy **cs_rows)
{
- int x, y, min_x, max_x, max_y, offset;
+ coordxy x, y, min_x, max_x, max_y;
+ int offset;
coordxy *limits;
short at_hero_range = 0;
light_source *ls;
remember terrain, objects, and monsters being revealed;
if 'obj' is Null, <x,y> is being hit by a camera's light flash */
void
-show_transient_light(struct obj *obj, int x, int y)
+show_transient_light(struct obj *obj, coordxy x, coordxy y)
{
light_source *ls = 0;
anything cameraflash;
* only for burning light sources.
*/
void
-snuff_light_source(int x, int y)
+snuff_light_source(coordxy x, coordxy y)
{
light_source *ls;
struct obj *obj;
static int forcelock(void);
static const char *lock_action(void);
-static boolean obstructed(int, int, boolean);
+static boolean obstructed(coordxy, coordxy, boolean);
static void chest_shatter_msg(struct obj *);
boolean
-picking_lock(int *x, int *y)
+picking_lock(coordxy *x, coordxy *y)
{
if (g.occupation == picklock) {
*x = u.ux + u.dx;
}
boolean
-picking_at(int x, int y)
+picking_at(coordxy x, coordxy y)
{
return (boolean) (g.occupation == picklock && g.xlock.door == &levl[x][y]);
}
}
boolean
-stumble_on_door_mimic(int x, int y)
+stumble_on_door_mimic(coordxy x, coordxy y)
{
struct monst *mtmp;
/* try to open a door in direction u.dx/u.dy */
int
-doopen_indir(int x, int y)
+doopen_indir(coordxy x, coordxy y)
{
coord cc;
register struct rm *door;
}
static boolean
-obstructed(int x, int y, boolean quietly)
+obstructed(coordxy x, coordxy y, boolean quietly)
{
struct monst *mtmp = m_at(x, y);
int
doclose(void)
{
- register int x, y;
+ register coordxy x, y;
register struct rm *door;
boolean portcullis;
int res = ECMD_OK;
/* Door/secret door was hit with spell or wand effect otmp;
returns true if something happened */
boolean
-doorlock(struct obj *otmp, int x, int y)
+doorlock(struct obj *otmp, coordxy x, coordxy y)
{
register struct rm *door = &levl[x][y];
boolean res = TRUE;
md_stop(coord *stopp, /* stopping position (we fill it in) */
coord *startp) /* starting position (read only) */
{
- int x, y, distance, min_distance = -1;
+ coordxy x, y, distance, min_distance = -1;
for (x = u.ux - 1; x <= u.ux + 1; x++)
for (y = u.uy - 1; y <= u.uy + 1; y++) {
static int align_shift(struct permonst *);
static boolean mk_gen_ok(int, unsigned, unsigned);
static boolean wrong_elem_type(struct permonst *);
-static void m_initgrp(struct monst *, int, int, int, mmflags_nht);
+static void m_initgrp(struct monst *, coordxy, coordxy, int, mmflags_nht);
static void m_initthrow(struct monst *, int, int);
static void m_initweap(struct monst *);
static void m_initinv(struct monst *);
/* make a group just like mtmp */
static void
-m_initgrp(struct monst *mtmp, int x, int y, int n, mmflags_nht mmflags)
+m_initgrp(struct monst *mtmp, coordxy x, coordxy y, int n, mmflags_nht mmflags)
{
coord mm;
register int cnt = rnd(n);
coord *cc) /* output */
{
int tryct = 0;
- int nx, ny;
+ coordxy nx, ny;
boolean good;
do {
/* else go through all map positions, twice, first round
ignoring positions in sight, and pick first good one.
skip first round if we're in special level loader or blind */
- int xofs = nx;
- int yofs = ny;
- int dx,dy;
+ coordxy xofs = nx;
+ coordxy yofs = ny;
+ coordxy dx,dy;
int bl = (g.in_mklev || Blind) ? 1 : 0;
for ( ; bl < 2; bl++) {
struct monst *
makemon(
struct permonst *ptr,
- int x, int y,
+ coordxy x, coordxy y,
mmflags_nht mmflags)
{
register struct monst *mtmp;
boolean neverask)
{
coord c;
- int x, y;
+ coordxy x, y;
struct monst *mon;
boolean known = FALSE;
boolean ask = (wizard && !neverask);
static boolean bydoor(coordxy, coordxy);
static struct mkroom *find_branch_room(coord *);
static struct mkroom *pos_to_room(coordxy, coordxy);
-static boolean place_niche(struct mkroom *, int *, int *, int *);
+static boolean place_niche(struct mkroom *, coordxy *, coordxy *, coordxy *);
static void makeniche(int);
static void make_niches(void);
static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
static void dosdoor(coordxy, coordxy, struct mkroom *, int);
static void join(int, int, boolean);
-static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean,
- schar, boolean, boolean);
+static void do_room_or_subroom(struct mkroom *,
+ coordxy, coordxy, coordxy, coordxy,
+ boolean, schar, boolean, boolean);
static void makerooms(void);
static boolean door_into_nonjoined(coordxy, coordxy);
static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
void
sort_rooms(void)
{
- int x, y;
+ coordxy x, y;
unsigned i, ri[MAXNROFROOMS + 1], n = (unsigned) g.nroom;
qsort((genericptr_t) g.rooms, n, sizeof (struct mkroom), mkroom_cmp);
static void
do_room_or_subroom(register struct mkroom *croom,
- int lowx, int lowy, register int hix, register int hiy,
+ coordxy lowx, coordxy lowy, coordxy hix, coordxy hiy,
boolean lit, schar rtype, boolean special, boolean is_room)
{
- register int x, y;
+ coordxy x, y;
struct rm *lev;
/* locations might bump level edges in wall-less rooms */
}
void
-add_door(register int x, register int y, register struct mkroom *aroom)
+add_door(coordxy x, coordxy y, register struct mkroom *aroom)
{
register struct mkroom *broom;
register int tmp;
}
static boolean
-place_niche(register struct mkroom *aroom, int *dy, int *xx, int *yy)
+place_niche(register struct mkroom *aroom, coordxy *dy, coordxy *xx, coordxy *yy)
{
coord dd;
register struct mkroom *aroom;
struct rm *rm;
int vct = 8;
- int dy, xx, yy;
+ coordxy dy, xx, yy;
struct trap *ttmp;
if (g.doorindex < DOORMAX) {
{
static struct rm zerorm = { GLYPH_UNEXPLORED,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
- register int x, y;
+ coordxy x, y;
register struct rm *lev;
/* note: normally we'd start at x=1 because map column #0 isn't used
int trycnt = 0;
coord pos;
struct monst *tmonst; /* always put a web with a spider */
- int x, y;
+ coordxy x, y;
if (croom->rtype != OROOM && croom->rtype != THEMEROOM)
return;
{
s_level *sp;
struct obj *otmp;
- int x, y, cnt;
+ coordxy x, y;
+ int cnt;
if (kelp_pool < 0)
kelp_pool = 10;
topologize(struct mkroom *croom)
#endif
{
- register int x, y, roomno = (int) ((croom - g.rooms) + ROOMOFFSET);
- int lowx = croom->lx, lowy = croom->ly;
- int hix = croom->hx, hiy = croom->hy;
+ coordxy x, y;
+ register int roomno = (int) ((croom - g.rooms) + ROOMOFFSET);
+ coordxy lowx = croom->lx, lowy = croom->ly;
+ coordxy hix = croom->hx, hiy = croom->hy;
#ifdef SPECIALIZATION
schar rtype = croom->rtype;
#endif
}
void
-dodoor(int x, int y, struct mkroom *aroom)
+dodoor(coordxy x, coordxy y, struct mkroom *aroom)
{
if (g.doorindex >= DOORMAX) {
impossible("DOORMAX exceeded?");
#include "hack.h"
#include "sp_lev.h"
-static int iswall(int, int);
-static int iswall_or_stone(int, int);
-static boolean is_solid(int, int);
+static int iswall(coordxy, coordxy);
+static int iswall_or_stone(coordxy, coordxy);
+static boolean is_solid(coordxy, coordxy);
static int extend_spine(int[3][3], int, int, int);
-static void wall_cleanup(int, int, int, int);
-static boolean okay(int, int, int);
+static void wall_cleanup(coordxy, coordxy, coordxy, coordxy);
+static boolean okay(coordxy, coordxy, coordxy);
static void maze0xy(coord *);
static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
coordxy, coordxy, boolean, d_level *);
static void migrate_orc(struct monst *, unsigned long);
static void shiny_orc_stuff(struct monst *);
static void stolen_booty(void);
-static boolean maze_inbounds(int, int);
+static boolean maze_inbounds(coordxy, coordxy);
static void maze_remove_deadends(xint16);
/* adjust a coordinate one step in the specified direction */
} while (0)
static int
-iswall(int x, int y)
+iswall(coordxy x, coordxy y)
{
int type;
}
static int
-iswall_or_stone(int x, int y)
+iswall_or_stone(coordxy x, coordxy y)
{
/* out of bounds = stone */
if (!isok(x, y))
/* return TRUE if out of bounds, wall or rock */
static boolean
-is_solid(int x, int y)
+is_solid(coordxy x, coordxy y)
{
return (boolean) (!isok(x, y) || IS_STWALL(levl[x][y].typ));
}
/* Remove walls totally surrounded by stone */
static void
-wall_cleanup(int x1, int y1, int x2, int y2)
+wall_cleanup(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
uchar type;
- int x, y;
+ coordxy x, y;
struct rm *lev;
/* sanity check on incoming variables */
/* Correct wall types so they extend and connect to each other */
void
-fix_wall_spines(int x1, int y1, int x2, int y2)
+fix_wall_spines(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
uchar type;
- int x, y;
+ coordxy x, y;
struct rm *lev;
- int (*loc_f)(int, int);
+ int (*loc_f)(coordxy, coordxy);
int bits;
int locale[3][3]; /* rock or wall status surrounding positions */
}
void
-wallification(int x1, int y1, int x2, int y2)
+wallification(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
wall_cleanup(x1, y1, x2, y2);
fix_wall_spines(x1, y1, x2, y2);
}
static boolean
-okay(int x, int y, int dir)
+okay(coordxy x, coordxy y, coordxy dir)
{
mz_move(x, y, dir);
mz_move(x, y, dir);
#undef ORC_LEADER
static boolean
-maze_inbounds(int x, int y)
+maze_inbounds(coordxy x, coordxy y)
{
return (x >= 2 && y >= 2
&& x < g.x_maze_max && y < g.y_maze_max
maze_remove_deadends(xint16 typ)
{
char dirok[4];
- int x, y, dir, idx, idx2, dx, dy, dx2, dy2;
+ coordxy x, y, dir, idx, idx2, dx, dy, dx2, dy2;
dirok[0] = 0; /* lint suppression */
for (x = 2; x < g.x_maze_max; x++)
void
create_maze(int corrwid, int wallthick, boolean rmdeadends)
{
- int x,y;
+ coordxy x,y;
coord mm;
int tmp_xmax = g.x_maze_max;
int tmp_ymax = g.y_maze_max;
void
makemaz(const char *s)
{
- int x, y;
+ coordxy x, y;
char protofile[20];
s_level *sp = Is_special(&u.uz);
coord mm;
* that is totally safe.
*/
void
-walkfrom(int x, int y, schar typ)
+walkfrom(coordxy x, coordxy y, schar typ)
{
#define CELLS (ROWNO * COLNO) / 4 /* a maze cell is 4 squares */
char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */
#else /* !MICRO */
void
-walkfrom(int x, int y, schar typ)
+walkfrom(coordxy x, coordxy y, schar typ)
{
int q, a, dir;
int dirs[4];
void
mazexy(coord *cc)
{
- int x, y, allowedtyp = (g.level.flags.corrmaze ? CORR : ROOM);
+ coordxy x, y;
+ int allowedtyp = (g.level.flags.corrmaze ? CORR : ROOM);
int cpt = 0;
do {
}
void
-get_level_extends(int * left, int * top, int * right, int * bottom)
+get_level_extends(coordxy *left, coordxy *top, coordxy *right, coordxy *bottom)
{
- int x, y;
+ coordxy x, y;
unsigned typ;
struct rm *lev;
boolean found, nonwall;
- int xmin, xmax, ymin, ymax;
+ coordxy xmin, xmax, ymin, ymax;
found = nonwall = FALSE;
for (xmin = 0; !found && xmin <= COLNO; xmin++) {
void
bound_digging(void)
{
- int x, y;
- int xmin, xmax, ymin, ymax;
+ coordxy x, y;
+ coordxy xmin, xmax, ymin, ymax;
if (Is_earthlevel(&u.uz))
return; /* everything diggable here */
#define gbymax (g.ymax - 1)
static void set_wportal(void);
-static void mk_bubble(int, int, int);
-static void mv_bubble(struct bubble *, int, int, boolean);
+static void mk_bubble(coordxy, coordxy, int);
+static void mv_bubble(struct bubble *, coordxy, coordxy, boolean);
void
movebubbles(void)
struct bubble *b;
struct container *cons;
struct trap *btrap;
- int x, y, i, j, bcpin = 0;
+ coordxy x, y;
+ int i, j, bcpin = 0;
/* set up the portal the first time bubbles are moved */
if (!g.wportal)
void
water_friction(void)
{
- int x, y, dx, dy;
+ coordxy x, y, dx, dy;
boolean eff = FALSE;
if (Swimming && rn2(4))
static void
setup_waterlevel(void)
{
- int x, y, xskip, yskip, typ, glyph;
+ int typ, glyph;
+ coordxy x, y, xskip, yskip;
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
panic("setup_waterlevel(): [%d:%d] neither 'Water' nor 'Air'",
}
static void
-mk_bubble(int x, int y, int n)
+mk_bubble(coordxy x, coordxy y, int n)
{
/*
* These bit masks make visually pleasing bubbles on a normal aspect
* This property also makes leaving a bubble slightly difficult.
*/
static void
-mv_bubble(struct bubble* b, int dx, int dy, boolean ini)
+mv_bubble(struct bubble* b, coordxy dx, coordxy dy, boolean ini)
{
- int x, y, i, j, colli = 0;
+ int i, j, colli = 0;
+ coordxy x, y;
struct container *cons, *ctemp;
/* clouds move slowly */
}
struct obj *
-mkobj_at(char let, int x, int y, boolean artif)
+mkobj_at(char let, coordxy x, coordxy y, boolean artif)
{
struct obj *otmp;
}
struct obj *
-mksobj_at(int otyp, int x, int y, boolean init, boolean artif)
+mksobj_at(int otyp, coordxy x, coordxy y, boolean init, boolean artif)
{
struct obj *otmp;
/* called when a tree is kicked; never returns Null */
struct obj *
-rnd_treefruit_at(int x, int y)
+rnd_treefruit_at(coordxy x, coordxy y)
{
return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE);
}
/* create a stack of N gold pieces; never returns Null */
struct obj *
-mkgold(long amount, int x, int y)
+mkgold(long amount, coordxy x, coordxy y)
{
struct obj *gold = g_at(x, y);
int objtype, /* CORPSE or STATUE */
struct monst *mtmp, /* dead monster, might be Null */
struct permonst *ptr, /* if non-Null, overrides mtmp->mndx */
- int x, int y, /* where to place corpse; <0,0> => random */
+ coordxy x, coordxy y, /* where to place corpse; <0,0> => random */
unsigned corpstatflags)
{
struct obj *otmp;
struct obj *
mk_tt_object(
int objtype, /* CORPSE or STATUE */
- int x, int y)
+ coordxy x, coordxy y)
{
struct obj *otmp;
boolean initialize_it;
mk_named_object(
int objtype, /* CORPSE or STATUE */
struct permonst *ptr,
- int x, int y,
+ coordxy x, coordxy y,
const char *nm)
{
struct obj *otmp;
/* put the object at the given location */
void
-place_object(struct obj *otmp, int x, int y)
+place_object(struct obj *otmp, coordxy x, coordxy y)
{
register struct obj *otmp2;
* Also used for starting ice effects too. [zap.c]
*/
void
-obj_ice_effects(int x, int y, boolean do_buried)
+obj_ice_effects(coordxy x, coordxy y, boolean do_buried)
{
struct obj *otmp;
void
obj_sanity_check(void)
{
- int x, y;
+ coordxy x, y;
struct obj *obj, *otop, *prevo;
objlist_sanity(fobj, OBJ_FLOOR, "floor sanity");
* reliably predict which one we want to 'find' first
*/
struct obj *
-obj_nexto_xy(struct obj *obj, int x, int y, boolean recurs)
+obj_nexto_xy(struct obj *obj, coordxy x, coordxy y, boolean recurs)
{
struct obj *otmp;
int fx, fy, ex, ey, otyp = obj->otyp;
static boolean isbig(struct mkroom *);
static struct mkroom *pick_room(boolean);
static void mkshop(void), mkzoo(int), mkswamp(void);
-static void mk_zoo_thronemon(int, int);
+static void mk_zoo_thronemon(coordxy, coordxy);
static void mktemple(void);
static coord *shrine_pos(int);
static struct permonst *morguemon(void);
break;
}
if (!sroom->rlit) {
- int x, y;
+ coordxy x, y;
for (x = sroom->lx - 1; x <= sroom->hx + 1; x++)
for (y = sroom->ly - 1; y <= sroom->hy + 1; y++)
}
static void
-mk_zoo_thronemon(int x,int y)
+mk_zoo_thronemon(coordxy x, coordxy y)
{
int i = rnd(level_difficulty());
int pm = (i > 9) ? PM_OGRE_TYRANT
{
struct monst *mon;
register int sx, sy, i;
- int sh, tx = 0, ty = 0, goldlim = 0, type = sroom->rtype;
+ int sh, goldlim = 0, type = sroom->rtype;
+ coordxy tx = 0, ty = 0;
int rmno = (int) ((sroom - g.rooms) + ROOMOFFSET);
coord mm;
mkswamp(void) /* Michiel Huisjes & Fred de Wilde */
{
register struct mkroom *sroom;
- register int sx, sy, i, eelct = 0;
+ register int i, eelct = 0;
+ coordxy sx, sy;
int rmno;
for (i = 0; i < 5; i++) { /* turn up to 5 rooms swampy */
const char *msg)
{
struct permonst *mptr = mtmp->data;
- int mx = mtmp->mx, my = mtmp->my;
+ coordxy mx = mtmp->mx, my = mtmp->my;
if (!mptr || mptr < &mons[LOW_PM] || mptr >= &mons[NUMMONS]) {
/* most sanity checks issue warnings if they detect a problem,
void
mon_sanity_check(void)
{
- int x, y;
+ coordxy x, y;
struct monst *mtmp, *m;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
int num;
struct obj *obj = (struct obj *) 0;
struct obj *otmp = (struct obj *) 0;
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
int mndx = monsndx(mdat);
unsigned corpstatflags = corpseflags;
boolean burythem = ((corpstatflags & CORPSTAT_BURIED) != 0);
struct obj *otmp;
struct permonst *ptr, *original_ptr = mtmp->data, *corpsepm;
boolean poly, grow, heal, eyes = FALSE, vis = canseemon(mtmp);
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
/* if a pet, eating is handled separately, in dog.c */
if (mtmp->mtame)
/* Is the square close enough for the monster to move or attack into? */
boolean
-monnear(struct monst *mon, int x, int y)
+monnear(struct monst *mon, coordxy x, coordxy y)
{
int distance = dist2(mon->mx, mon->my, x, y);
static void
mon_leaving_level(struct monst *mon)
{
- int mx = mon->mx, my = mon->my;
+ coordxy mx = mon->mx, my = mon->my;
boolean onmap = (isok(mx, my) && g.level.monsters[mx][my] == mon);
/* to prevent an infinite relobj-flooreffects-hmon-killed loop */
spec_death = (g.disintegested /* disintegrated/digested */
|| noncorporeal(mtmp->data)
|| amorphous(mtmp->data));
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
/* construct a format string before transformation;
will be capitalized when used, expects one %s arg */
struct monst *mtmp,
int xkill_flags) /* 1: suppress message, 2: suppress corpse, 4: pacifist */
{
- int tmp, mndx, x = mtmp->mx, y = mtmp->my;
+ int tmp, mndx;
+ coordxy x = mtmp->mx, y = mtmp->my;
struct permonst *mdat;
struct obj *otmp;
struct trap *t;
{
if (is_vampshifter(mtmp)) {
int mndx = mtmp->cham;
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
/* this only happens if shapeshifted */
if (mndx >= LOW_PM && mndx != monsndx(mtmp->data)
/* Wake up monsters near some particular location. */
void
-wake_nearto(int x, int y, int distance)
+wake_nearto(coordxy x, coordxy y, int distance)
{
struct monst *mtmp;
static void
watch_on_duty(register struct monst* mtmp)
{
- int x, y;
+ coordxy x, y;
if (mtmp->mpeaceful && in_town(u.ux + u.dx, u.uy + u.dy)
&& mtmp->mcansee && m_canseeu(mtmp) && !rn2(3)) {
* so perform stop-what-you're-doing-if-close-enough-
* to-be-a-threat check but don't move mtmp */
{
- int x = mtmp->mx, y = mtmp->my; /* 'mtmp's location before dochug() */
+ coordxy x = mtmp->mx, y = mtmp->my; /* 'mtmp's location before dochug() */
/* skip canspotmon() if occupation is Null */
boolean already_saw_mon = (chug && g.occupation) ? canspotmon(mtmp) : 0;
int rd = chug ? dochug(mtmp) : 0;
}
boolean
-onscary(int x, int y, struct monst* mtmp)
+onscary(coordxy x, coordxy y, struct monst* mtmp)
{
/* creatures who are directly resistant to magical scaring:
* humans aren't monsters
{
register int minr = SQSRCHRADIUS; /* not too far away */
register struct obj *otmp;
- register int xx, yy;
- int oomx, oomy, lmx, lmy;
+ register coordxy xx, yy;
+ coordxy oomx, oomy, lmx, lmy;
/* cut down the search radius if it thinks character is closer. */
if (distmin(mtmp->mux, mtmp->muy, omx, omy) < SQSRCHRADIUS
}
void
-dissolve_bars(register int x, register int y)
+dissolve_bars(coordxy x, coordxy y)
{
levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR;
levl[x][y].flags = 0;
}
boolean
-closed_door(register int x, register int y)
+closed_door(coordxy x, coordxy y)
{
return (boolean) (IS_DOOR(levl[x][y].typ)
&& (levl[x][y].doormask & (D_LOCKED | D_CLOSED)));
}
boolean
-accessible(register int x, register int y)
+accessible(coordxy x, coordxy y)
{
int levtyp = levl[x][y].typ;
set_apparxy(register struct monst* mtmp)
{
boolean notseen, notthere, gotu;
- int disp, mx = mtmp->mux, my = mtmp->muy;
+ int disp;
+ coordxy mx = mtmp->mux, my = mtmp->muy;
long umoney = money_cnt(g.invent);
/*
static void monshoot(struct monst *, struct obj *, struct obj *);
static boolean ucatchgem(struct obj *, struct monst *);
static const char* breathwep_name(int);
-static int drop_throw(struct obj *, boolean, int, int);
+static int drop_throw(struct obj *, boolean, coordxy, coordxy);
static int m_lined_up(struct monst *, struct monst *);
#define URETREATING(x, y) \
drop_throw(
register struct obj *obj,
boolean ohit,
- int x,
- int y)
+ coordxy x,
+ coordxy y)
{
int retvalu = 1;
int create;
void
m_throw(
struct monst *mon, /* launching monster */
- int x, int y, /* launch point */
- int dx, int dy, /* direction */
+ coordxy x, coordxy y, /* launch point */
+ coordxy dx, coordxy dy, /* direction */
int range, /* maximum distance */
struct obj *obj) /* missile (or stack providing it) */
{
coordxy ay,
coordxy bx,
coordxy by,
- boolean (*fnc)(int, int))
+ boolean (*fnc)(coordxy, coordxy))
{
int dx, dy;
void
hit_bars(
struct obj **objp, /* *objp will be set to NULL if object breaks */
- int objx, int objy, /* hero's spot (when wielded) or missile's spot */
- int barsx, int barsy, /* adjacent spot where bars are located */
+ coordxy objx, coordxy objy, /* hero's spot (when wielded) or missile's spot */
+ coordxy barsx, coordxy barsy, /* adjacent spot where bars are located */
unsigned breakflags) /* breakage control */
{
struct obj *otmp = *objp;
boolean
hits_bars(
struct obj **obj_p, /* *obj_p will be set to NULL if object breaks */
- int x, int y,
- int barsx, int barsy,
+ coordxy x, coordxy y,
+ coordxy barsx, coordxy barsy,
int always_hit, /* caller can force a hit for items which would
* fit through */
int whodidit) /* 1==hero, 0=other, -1==just check whether it
static void mreadmsg(struct monst *, struct obj *);
static void mquaffmsg(struct monst *, struct obj *);
static boolean m_use_healing(struct monst *);
-static boolean linedup_chk_corpse(int, int);
+static boolean linedup_chk_corpse(coordxy, coordxy);
static void m_use_undead_turning(struct monst *, struct obj *);
static int mbhitm(struct monst *, struct obj *);
static void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P),
{
struct obj *obj;
struct trap *t;
- int fraction, x = mtmp->mx, y = mtmp->my;
+ int fraction;
+ coordxy x = mtmp->mx, y = mtmp->my;
boolean stuck = (mtmp == u.ustuck),
immobile = (mtmp->data->mmove == 0);
stairway *stway;
}
} else {
/* Note: trap doors take precedence over teleport traps. */
- int xx, yy, i, locs[10][2];
+ coordxy xx, yy, i, locs[10][2];
boolean ignore_boulders = (verysmall(mtmp->data)
|| throws_rocks(mtmp->data)
|| passes_walls(mtmp->data)),
goto botm;
if (is_mercenary(mtmp->data) && (obj = m_carrying(mtmp, BUGLE)) != 0) {
- int xx, yy;
+ coordxy xx, yy;
struct monst *mon;
/* Distance is arbitrary. What we really want to do is
* redefine; nonconsecutive value is ok */
static boolean
-linedup_chk_corpse(int x, int y)
+linedup_chk_corpse(coordxy x, coordxy y)
{
return (sobj_at(CORPSE, x, y) != 0);
}
static void
m_use_undead_turning(struct monst* mtmp, struct obj* obj)
{
- int ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3,
- ay = u.uy + sgn(mtmp->muy - mtmp->my) * 3;
- int bx = mtmp->mx, by = mtmp->my;
+ coordxy ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3,
+ ay = u.uy + sgn(mtmp->muy - mtmp->my) * 3;
+ coordxy bx = mtmp->mx, by = mtmp->my;
if (!(obj->otyp == WAN_UNDEAD_TURNING && obj->spe > 0))
return;
ddy = sgn(mon->muy - mon->my);
while (range-- > 0) {
- int x, y;
+ coordxy x, y;
g.bhitpos.x += ddx;
g.bhitpos.y += ddy;
return 2;
case MUSE_SCR_EARTH: {
/* TODO: handle steeds */
- register int x, y;
+ coordxy x, y;
/* don't use monster fields after killing it */
boolean confused = (mtmp->mconf ? TRUE : FALSE);
int mmx = mtmp->mx, mmy = mtmp->my;
{
register struct obj *obj;
struct permonst *mdat = mtmp->data;
- int x = mtmp->mx, y = mtmp->my;
+ coordxy x = mtmp->mx, y = mtmp->my;
struct trap *t;
- int xx, yy, pmidx = NON_PM;
+ coordxy xx, yy;
+ int pmidx = NON_PM;
boolean immobile = (mdat->mmove == 0);
boolean stuck = (mtmp == u.ustuck);
if (((t = t_at(mon->mx, mon->my)) == 0 || t->ttyp != FIRE_TRAP)
&& mptr->mmove && !mon->mtrapped) {
- int xy[2][8], x, y, idx, ridx, nxy = 0;
+ coordxy xy[2][8], x, y, idx, ridx, nxy = 0;
for (x = mon->mx - 1; x <= mon->mx + 1; ++x)
for (y = mon->my - 1; y <= mon->my + 1; ++y)
do_earthquake(int force)
{
static const char into_a_chasm[] = " into a chasm";
- register int x, y;
+ register coordxy x, y;
struct monst *mtmp;
struct obj *otmp;
struct trap *chasm, *trap_at_u = t_at(u.ux, u.uy);
{
char buf[BUFSZ] = DUMMY, c = 'y';
char *s;
- int x, y;
+ coordxy x, y;
boolean ok;
if (Underwater) {
int argc = lua_gettop(L);
if (argc == 2) {
- int x, y;
+ coordxy x, y;
- x = (int) luaL_checkinteger(L, 1);
- y = (int) luaL_checkinteger(L, 2);
+ x = (coordxy) luaL_checkinteger(L, 1);
+ y = (coordxy) luaL_checkinteger(L, 2);
lua_pop(L, 2);
(void) l_obj_push(L, g.level.objects[x][y]);
return 1;
{
int argc = lua_gettop(L);
struct _lua_obj *lo = l_obj_check(L, 1);
- int x, y;
+ coordxy x, y;
if (argc != 3)
nhl_error(L, "l_obj_placeobj: Wrong args");
- x = (int) luaL_checkinteger(L, 2);
- y = (int) luaL_checkinteger(L, 3);
+ x = (coordxy) luaL_checkinteger(L, 2);
+ y = (coordxy) luaL_checkinteger(L, 3);
lua_pop(L, 3);
if (lobj_is_ok(lo)) {
{
struct selectionvar *sel = l_selection_check(L, 1);
coordxy x, y;
- int ix, iy;
+ lua_Integer ix, iy;
int val;
long crd;
static int
nhl_gettrap(lua_State *L)
{
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "Incorrect arguments");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
if (isok(x, y)) {
struct trap *ttmp = t_at(x,y);
static int
nhl_deltrap(lua_State *L)
{
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "Incorrect arguments");
return 0;
}
-
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (isok(x, y)) {
struct trap *ttmp = t_at(x,y);
return TRUE if there are such params in the stack.
*/
boolean
-nhl_get_xy_params(lua_State *L, int *x, int *y)
+nhl_get_xy_params(lua_State *L, lua_Integer *x, lua_Integer *y)
{
int argc = lua_gettop(L);
boolean ret = FALSE;
if (argc == 2) {
- *x = (int) lua_tointeger(L, 1);
- *y = (int) lua_tointeger(L, 2);
+ *x = lua_tointeger(L, 1);
+ *y = lua_tointeger(L, 2);
ret = TRUE;
} else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
lua_Integer ax, ay;
ret = get_coord(L, 1, &ax, &ay);
- *x = (int) ax;
- *y = (int) ay;
+ *x = ax;
+ *y = ay;
}
return ret;
}
static int
nhl_getmap(lua_State *L)
{
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "Incorrect arguments");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (isok(x, y)) {
char buf[BUFSZ];
lua_newtable(L);
static int
nhl_test(lua_State *L)
{
- int x, y;
+ coordxy x, y;
char *name, Player[] = "Player";
/* discard any extra arguments passed in */
luaL_checktype(L, 1, LUA_TTABLE);
- x = get_table_int(L, "x");
- y = get_table_int(L, "y");
+ x = (coordxy) get_table_int(L, "x");
+ y = (coordxy) get_table_int(L, "y");
name = get_table_str_opt(L, "name", Player);
- pline("TEST:{ x=%i, y=%i, name=\"%s\" }", x,y, name);
+ pline("TEST:{ x=%i, y=%i, name=\"%s\" }", (int) x, (int) y, name);
free(name);
{
boolean ret = FALSE;
short timertype = nhl_get_timertype(L, -1);
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
long when;
lua_pop(L, 1); /* remove timertype */
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "nhl_timer_has_at: Wrong args");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (isok(x, y)) {
when = spot_time_expires(x, y, timertype);
ret = (when > 0L);
{
long when = 0L;
short timertype = nhl_get_timertype(L, -1);
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
lua_pop(L, 1); /* remove timertype */
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "nhl_timer_peek_at: Wrong args");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (timer_is_pos(timertype) && isok(x, y))
when = spot_time_expires(x, y, timertype);
lua_pushinteger(L, when);
nhl_timer_stop_at(lua_State *L)
{
short timertype = nhl_get_timertype(L, -1);
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
lua_pop(L, 1); /* remove timertype */
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "nhl_timer_stop_at: Wrong args");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (timer_is_pos(timertype) && isok(x, y))
spot_stop_timers(x, y, timertype);
return 0;
{
short timertype = nhl_get_timertype(L, -2);
long when = lua_tointeger(L, -1);
- int x, y;
+ lua_Integer lx, ly;
+ coordxy x, y;
lua_pop(L, 2); /* remove when and timertype */
- if (!nhl_get_xy_params(L, &x, &y)) {
+ if (!nhl_get_xy_params(L, &lx, &ly)) {
nhl_error(L, "nhl_timer_start_at: Wrong args");
return 0;
}
+ x = (coordxy) lx;
+ y = (coordxy) ly;
+
if (timer_is_pos(timertype) && isok(x, y)) {
long where = ((long) x << 16) | (long) y;
{
struct rm *lev;
boolean madeterrain = FALSE, badterrain = FALSE, didblock;
- int trap, oldtyp, x = u.ux, y = u.uy;
+ int trap, oldtyp;
+ coordxy x = u.ux, y = u.uy;
char *bp = d->bp, *p = d->p;
for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) {
static boolean is_swallow_sym(int);
static int append_str(char *, const char *);
-static void trap_description(char *, int, int, int);
-static void look_at_object(char *, int, int, int);
-static void look_at_monster(char *, char *, struct monst *, int, int);
-static struct permonst *lookat(int, int, char *, char *);
+static void trap_description(char *, int, coordxy, coordxy);
+static void look_at_object(char *, coordxy, coordxy, int);
+static void look_at_monster(char *, char *, struct monst *, coordxy, coordxy);
+static struct permonst *lookat(coordxy, coordxy, char *, char *);
static void checkfile(char *, struct permonst *, boolean, boolean, char *);
static int add_cmap_descr(int, int, int, int, coord,
const char *, const char *,
boolean *, const char **, char *);
-static void look_region_nearby(int *, int *, int *, int *, boolean);
+static void look_region_nearby(coordxy *, coordxy *, coordxy *, coordxy *, boolean);
static void look_all(boolean, boolean);
static void look_traps(boolean);
static void do_supplemental_info(char *, struct permonst *, boolean);
/* copy a trap's description into outbuf[] */
static void
-trap_description(char *outbuf, int tnum, int x, int y)
+trap_description(char *outbuf, int tnum, coordxy x, coordxy y)
{
/*
* Trap detection used to display a bear trap at locations having
{
struct obj *otmp;
boolean fakeobj, isyou = (mon == &g.youmonst);
- int x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my,
- glyph = (g.level.flags.hero_memory && !isyou) ? levl[x][y].glyph
+ coordxy x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my;
+ int glyph = (g.level.flags.hero_memory && !isyou) ? levl[x][y].glyph
: glyph_at(x, y);
*outbuf = '\0';
/* extracted from lookat(); also used by namefloorobj() */
boolean
-object_from_map(int glyph, int x, int y, struct obj **obj_p)
+object_from_map(int glyph, coordxy x, coordxy y, struct obj **obj_p)
{
boolean fakeobj = FALSE, mimic_obj = FALSE;
struct monst *mtmp;
static void
look_at_object(char *buf, /* output buffer */
- int x, int y, int glyph)
+ coordxy x, coordxy y, int glyph)
{
struct obj *otmp = 0;
boolean fakeobj = object_from_map(glyph, x, y, &otmp);
look_at_monster(char *buf,
char *monbuf, /* buf: output, monbuf: optional output */
struct monst *mtmp,
- int x, int y)
+ coordxy x, coordxy y)
{
char *name, monnambuf[BUFSZ], healthbuf[BUFSZ];
boolean accurate = !Hallucination;
* If not hallucinating and the glyph is a monster, also monster data.
*/
static struct permonst *
-lookat(int x, int y, char *buf, char *monbuf)
+lookat(coordxy x, coordxy y, char *buf, char *monbuf)
{
struct monst *mtmp = (struct monst *) 0;
struct permonst *pm = (struct permonst *) 0;
}
static void
-look_region_nearby(int *lo_x, int *lo_y, int *hi_x, int *hi_y, boolean nearby)
+look_region_nearby(
+ coordxy *lo_x, coordxy *lo_y,
+ coordxy *hi_x, coordxy *hi_y, boolean nearby)
{
*lo_y = nearby ? max(u.uy - BOLT_LIM, 0) : 0;
*lo_x = nearby ? max(u.ux - BOLT_LIM, 1) : 1;
boolean do_mons) /* True => monsters, False => objects */
{
winid win;
- int x, y, lo_x, lo_y, hi_x, hi_y, glyph, count = 0;
+ int glyph, count = 0;
+ coordxy x, y, lo_x, lo_y, hi_x, hi_y;
char lookbuf[BUFSZ], outbuf[BUFSZ];
win = create_nhwindow(NHW_TEXT);
{
winid win;
struct trap *t;
- int x, y, lo_x, lo_y, hi_x, hi_y, glyph, tnum, count = 0;
+ int glyph, tnum, count = 0;
+ coordxy x, y, lo_x, lo_y, hi_x, hi_y;
char lookbuf[BUFSZ], outbuf[BUFSZ];
win = create_nhwindow(NHW_TEXT);
doidtrap(void)
{
register struct trap *trap;
- int x, y, tt, glyph;
+ int tt, glyph;
+ coordxy x, y;
if (!getdir("^"))
return ECMD_CANCEL;
static int tipcontainer_checks(struct obj *, boolean);
static char in_or_out_menu(const char *, struct obj *, boolean, boolean,
boolean, boolean);
-static boolean able_to_loot(int, int, boolean);
+static boolean able_to_loot(coordxy, coordxy, boolean);
static boolean reverse_loot(void);
-static boolean mon_beside(int, int);
+static boolean mon_beside(coordxy, coordxy);
static int do_loot_cont(struct obj **, int, int);
static int doloot_core(void);
static void tipcontainer(struct obj *);
/* Is there a container at x,y. Optional: return count of containers at x,y */
int
-container_at(int x, int y, boolean countem)
+container_at(coordxy x, coordxy y, boolean countem)
{
struct obj *cobj, *nobj;
int container_count = 0;
static boolean
able_to_loot(
- int x, int y,
+ coordxy x, coordxy y,
boolean looting) /* loot vs tip */
{
const char *verb = looting ? "loot" : "tip";
}
static boolean
-mon_beside(int x, int y)
+mon_beside(coordxy x, coordxy y)
{
- int i, j, nx, ny;
+ int i, j;
+ coordxy nx, ny;
for (i = -1; i <= 1; i++)
for (j = -1; j <= 1; j++) {
}
int
-altarmask_at(int x, int y)
+altarmask_at(coordxy x, coordxy y)
{
int res = 0;
}
void
-altar_wrath(int x, int y)
+altar_wrath(coordxy x, coordxy y)
{
aligntyp altaralign = a_align(x, y);
void
ghod_hitsu(struct monst *priest)
{
- int x, y, ax, ay, roomno = (int) temple_occupied(u.urooms);
+ coordxy x, y, ax, ay;
+ int roomno = (int) temple_occupied(u.urooms);
struct mkroom *troom;
if (!roomno || !has_shrine(priest))
static void p_glow2(struct obj *, const char *);
static void forget(int);
static int maybe_tame(struct monst *, struct obj *);
-static boolean can_center_cloud(int, int);
+static boolean can_center_cloud(coordxy, coordxy);
static void display_stinking_cloud_positions(int);
static void seffect_enchant_armor(struct obj **);
static void seffect_destroy_armor(struct obj **);
#ifdef MAIL_STRUCTURES
static void seffect_mail(struct obj **);
#endif /* MAIL_STRUCTURES */
-static void set_lit(int, int, genericptr);
+static void set_lit(coordxy, coordxy, genericptr);
static void do_class_genocide(void);
static void do_stinking_cloud(struct obj *, boolean);
static boolean create_particular_parse(char *,
* NOT the same thing as can_center_cloud.
*/
boolean
-valid_cloud_pos(int x, int y)
+valid_cloud_pos(coordxy x, coordxy y)
{
if (!isok(x,y))
return FALSE;
* should have its regular effects, or not because it was out of range.
*/
static boolean
-can_center_cloud(int x, int y)
+can_center_cloud(coordxy x, coordxy y)
{
if (!valid_cloud_pos(x, y))
return FALSE;
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) {
- int x, y, dx, dy;
+ coordxy x, y, dx, dy;
int dist = 6;
for (dx = -dist; dx <= dist; dx++)
/* TODO: handle steeds */
if (!Is_rogue_level(&u.uz) && has_ceiling(&u.uz)
&& (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) {
- register int x, y;
+ coordxy x, y;
int nboulders = 0;
/* Identify the scroll */
return;
}
if (sblessed) {
- register int x, y;
+ coordxy x, y;
for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++)
}
boolean
-drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
+drop_boulder_on_monster(coordxy x, coordxy y, boolean confused, boolean byu)
{
register struct obj *otmp2;
register struct monst *mtmp;
* Low-level lit-field update routine.
*/
static void
-set_lit(int x, int y, genericptr_t val)
+set_lit(coordxy x, coordxy y, genericptr_t val)
{
struct monst *mtmp;
struct litmon *gremlin;
#include "hack.h"
#include "sp_lev.h"
-typedef void (*select_iter_func)(int, int, genericptr);
+typedef void (*select_iter_func)(coordxy, coordxy, genericptr);
extern void mkmap(lev_init *);
static void flip_drawbridge_vertical(struct rm *);
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 sel_set_wall_property(coordxy, coordxy, genericptr_t);
static void set_wall_property(coordxy, coordxy, coordxy, coordxy, int);
static void count_features(void);
static void remove_boundary_syms(void);
static void create_door(room_door *, struct mkroom *);
static void create_trap(spltrap *, struct mkroom *);
static int noncoalignment(aligntyp);
-static boolean m_bad_boulder_spot(int, int);
+static boolean m_bad_boulder_spot(coordxy, coordxy);
static int pm_to_humidity(struct permonst *);
static unsigned int sp_amask_to_amask(unsigned int sp_amask);
static void create_monster(monster *, struct mkroom *);
static void maze1xy(coord *, int);
static void fill_empty_maze(void);
static void splev_initlev(lev_init *);
+static boolean generate_way_out_method(coordxy nx, coordxy ny,
+ struct selectionvar *ov);
#if 0
/* macosx complains that these are unused */
static long sp_code_jmpaddr(long, long);
static void spo_wall_property(struct sp_coder *);
static void spo_room_door(struct sp_coder *);
static void spo_wallify(struct sp_coder *);
-static void sel_set_wallify(int, int, genericptr_t);
+static void sel_set_wallify(coordxy, coordxy, genericptr_t);
#endif
static void spo_end_moninvent(void);
static void spo_pop_container(void);
static void l_table_getset_feature_flag(lua_State *, int, int, const char *,
int);
static void l_get_lregion(lua_State *, lev_region *);
-static void sel_set_lit(int, int, genericptr_t);
+static void sel_set_lit(coordxy, coordxy, genericptr_t);
static void add_doors_to_room(struct mkroom *);
static void selection_iterate(struct selectionvar *, select_iter_func,
genericptr_t);
-static void sel_set_ter(int, int, genericptr_t);
-static void sel_set_door(int, int, genericptr_t);
-static void sel_set_feature(int, int, genericptr_t);
+static void sel_set_ter(coordxy, coordxy, genericptr_t);
+static void sel_set_door(coordxy, coordxy, genericptr_t);
+static void sel_set_feature(coordxy, coordxy, genericptr_t);
static void levregion_add(lev_region *);
static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *);
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 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, coordxy *, coordxy *, int);
+static int floodfillchk_match_under(coordxy, coordxy);
+static int floodfillchk_match_accessible(coordxy, coordxy);
+static boolean sel_flood_havepoint(coordxy, coordxy, 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 *);
flip_level(int flp, boolean extras)
{
int x, y, i, itmp;
- int minx, miny, maxx, maxy;
+ coordxy minx, miny, maxx, maxy;
struct rm trm;
struct trap *ttmp;
struct obj *otmp;
static void
-sel_set_wall_property(int x, int y, genericptr_t arg)
+sel_set_wall_property(coordxy x, coordxy y, genericptr_t arg)
{
int prop = *(int *)arg;
}
boolean
-pm_good_location(int x, int y, struct permonst* pm)
+pm_good_location(coordxy x, coordxy y, struct permonst* pm)
{
return is_ok_location(x, y, pm_to_humidity(pm));
}
*y = c.y;
get_location(x, y, c.getloc_flags | (c.is_random ? NO_LOC_WARN : 0),
croom);
+
if (*x == -1 && *y == -1 && c.is_random)
get_location(x, y, humidity, croom);
}
/* attempt to screen out locations where a mimic-as-boulder shouldn't occur */
static boolean
-m_bad_boulder_spot(int x, int y)
+m_bad_boulder_spot(coordxy x, coordxy y)
{
struct rm *lev;
}
void
-wallify_map(int x1, int y1, int x2, int y2)
+wallify_map(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
- int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy;
+ coordxy x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy;
y1 = max(y1, 0);
x1 = max(x1, 1);
lcheck_param_table(L);
get_table_xy_or_coord(L, &ax, &ay);
up = stairdirs2i[get_table_option(L, "dir", "down", stairdirs)];
- x = ax;
- y = ay;
+ x = (coordxy) ax;
+ y = (coordxy) ay;
} else {
- int ix = -1, iy = -1;
+ lua_Integer ix = -1, iy = -1;
if (argc > 0 && ltype == LUA_TSTRING) {
up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)];
lua_remove(L, 1);
}
nhl_get_xy_params(L, &ix, &iy);
- x = ix;
- y = iy;
+ x = (coordxy) ix;
+ y = (coordxy) iy;
}
if (x == -1 && y == -1) {
}
coordxy
-selection_getpoint(int x, int y, struct selectionvar* sel)
+selection_getpoint(coordxy x, coordxy y, struct selectionvar* sel)
{
if (!sel || !sel->map)
return 0;
}
void
-selection_setpoint(int x, int y, struct selectionvar* sel, coordxy c)
+selection_setpoint(coordxy x, coordxy y, struct selectionvar* sel, coordxy c)
{
if (!sel || !sel->map)
return;
void
selection_do_grow(struct selectionvar* ov, int dir)
{
- int x, y;
+ coordxy x, y;
struct selectionvar *tmp;
if (!ov)
selection_free(tmp, TRUE);
}
-static int (*selection_flood_check_func)(int, int);
+static int (*selection_flood_check_func)(coordxy, coordxy);
static schar floodfillchk_match_under_typ;
void
-set_selection_floodfillchk(int (*f)(int, int))
+set_selection_floodfillchk(int (*f)(coordxy, coordxy))
{
selection_flood_check_func = f;
}
static int
-floodfillchk_match_under(int x, int y)
+floodfillchk_match_under(coordxy x, coordxy y)
{
return (floodfillchk_match_under_typ == levl[x][y].typ);
}
}
static int
-floodfillchk_match_accessible(int x, int y)
+floodfillchk_match_accessible(coordxy x, coordxy y)
{
return (ACCESSIBLE(levl[x][y].typ)
|| levl[x][y].typ == SDOOR
/* check whethere <x,y> is already in xs[],ys[] */
static boolean
-sel_flood_havepoint(int x, int y, coordxy xs[], coordxy ys[], int n)
+sel_flood_havepoint(coordxy x, coordxy y, coordxy xs[], coordxy ys[], int n)
{
- coordxy xx = (coordxy) x, yy = (coordxy) y;
+ coordxy xx = x, yy = y;
while (n > 0) {
--n;
}
void
-selection_floodfill(struct selectionvar* ov, int x, int y, boolean diagonals)
+selection_floodfill(struct selectionvar* ov, coordxy x, coordxy y, boolean diagonals)
{
struct selectionvar *tmp = selection_new();
#define SEL_FLOOD_STACK (COLNO * ROWNO)
coordxy dx[SEL_FLOOD_STACK];
coordxy dy[SEL_FLOOD_STACK];
- if (selection_flood_check_func == (int (*)(int, int)) 0) {
+ if (selection_flood_check_func == (int (*)(coordxy, coordxy)) 0) {
selection_free(tmp, TRUE);
return;
}
select_iter_func func,
genericptr_t arg)
{
- int x, y;
+ coordxy x, y;
if (!ov)
return;
}
static void
-sel_set_ter(int x, int y, genericptr_t arg)
+sel_set_ter(coordxy x, coordxy y, genericptr_t arg)
{
terrain terr;
}
static void
-sel_set_feature(int x, int y, genericptr_t arg)
+sel_set_feature(coordxy x, coordxy y, genericptr_t arg)
{
if (IS_FURNITURE(levl[x][y].typ))
return;
}
static void
-sel_set_door(int dx, int dy, genericptr_t arg)
+sel_set_door(coordxy dx, coordxy dy, genericptr_t arg)
{
coordxy typ = *(coordxy *) arg;
coordxy x = dx, y = dy;
struct mapfragment *mf = NULL;
struct selectionvar *sel = NULL;
boolean freesel = FALSE;
- int x, y;
+ coordxy x, y;
lua_Integer x1, y1, x2, y2;
int chance;
int tolit;
static boolean
generate_way_out_method(
- int nx, int ny,
+ coordxy nx, coordxy ny,
struct selectionvar *ov)
{
static const int escapeitems[] = {
{
struct selectionvar *ov = selection_new();
struct trap *ttmp = g.ftrap;
- int x, y;
+ coordxy x, y;
boolean ret = TRUE;
stairway *stway = g.stairs;
}
static void
-sel_set_lit(int x, int y, genericptr_t arg)
+sel_set_lit(coordxy x, coordxy y, genericptr_t arg)
{
int lit = *(int *)arg;
static void
add_doors_to_room(struct mkroom *croom)
{
- int x, y;
+ coordxy x, y;
for (x = croom->lx - 1; x <= croom->hx + 1; x++)
for (y = croom->ly - 1; y <= croom->hy + 1; y++)
#if 0
/*ARGSUSED*/
static void
-sel_set_wallify(int x, int y, genericptr_t arg UNUSED)
+sel_set_wallify(coordxy x, coordxy y, genericptr_t arg UNUSED)
{
wallify_map(x, y, x, y);
}
static void cast_protection(void);
static void spell_backfire(int);
static const char *spelltypemnemonic(int);
-static boolean spell_aim_step(genericptr_t, int, int);
+static boolean spell_aim_step(genericptr_t, coordxy, coordxy);
/* The roles[] table lists the role-specific values for tuning
* percent_success().
/*ARGSUSED*/
static boolean
-spell_aim_step(genericptr_t arg UNUSED, int x, int y)
+spell_aim_step(genericptr_t arg UNUSED, coordxy x, coordxy y)
{
if (!isok(x,y))
return FALSE;
struct obj *obj,
boolean verbosely)
{
- int omx = mon->mx, omy = mon->my;
+ coordxy omx = mon->mx, omy = mon->my;
long unwornmask = obj->owornmask;
/* call distant_name() for its possible side-effects even if the result
might not be printed, and do it before extracing obj from minvent */
int reason,
int forceit)
{
- int i = 0, x, y, distance, min_distance = -1;
+ int i = 0, distance, min_distance = -1;
+ coordxy x, y;
boolean found = FALSE;
struct trap *t;
#include "hack.h"
-static boolean goodpos_onscary(int, int, struct permonst *);
-static boolean tele_jump_ok(int, int, int, int);
-static boolean teleok(int, int, boolean);
+static boolean goodpos_onscary(coordxy, coordxy, struct permonst *);
+static boolean tele_jump_ok(coordxy, coordxy, coordxy, coordxy);
+static boolean teleok(coordxy, coordxy, boolean);
static void vault_tele(void);
-static boolean rloc_pos_ok(int, int, struct monst *);
-static void rloc_to_core(struct monst *, int, int, unsigned);
+static boolean rloc_pos_ok(coordxy, coordxy, struct monst *);
+static void rloc_to_core(struct monst *, coordxy, coordxy, unsigned);
static void mvault_tele(struct monst *);
static boolean m_blocks_teleporting(struct monst *);
fields aside from 'monst->data' */
static boolean
goodpos_onscary(
- int x, int y,
+ coordxy x, coordxy y,
struct permonst *mptr)
{
/* onscary() checks Angels and lawful minions; this oversimplifies */
*/
boolean
goodpos(
- int x, int y,
+ coordxy x, coordxy y,
struct monst *mtmp,
mmflags_nht gpflags)
{
{
#define MAX_GOOD 15
coord good[MAX_GOOD], *good_ptr;
- int x, y, range, i;
- int xmin, xmax, ymin, ymax, rangemax;
+ coordxy x, y, range, i;
+ coordxy xmin, xmax, ymin, ymax, rangemax;
struct monst fakemon; /* dummy monster */
boolean allow_xx_yy = (boolean) ((entflags & GP_ALLOW_XY) != 0);
full:
/* we've got between 1 and SIZE(good) candidates; choose one */
- i = rn2((int) (good_ptr - good));
+ i = (coordxy) rn2((int) (good_ptr - good));
cc->x = good[i].x;
cc->y = good[i].y;
return TRUE;
* only for explicitly chosen destinations.)
*/
static boolean
-tele_jump_ok(int x1, int y1, int x2, int y2)
+tele_jump_ok(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{
if (!isok(x2, y2))
return FALSE;
}
static boolean
-teleok(register int x, register int y, boolean trapok)
+teleok(coordxy x, coordxy y, boolean trapok)
{
if (!trapok) {
/* allow teleportation onto vibrating square, it's not a real trap;
}
void
-teleds(int nux, int nuy, int teleds_flags)
+teleds(coordxy nux, coordxy nuy, int teleds_flags)
{
boolean ball_active, ball_still_in_range = FALSE,
allow_drag = (teleds_flags & TELEDS_ALLOW_DRAG) != 0,
boolean
safe_teleds(int teleds_flags)
{
- register int nux, nuy, tcnt = 0;
+ coordxy nux, nuy;
+ int tcnt = 0;
do {
nux = rnd(COLNO - 1);
/* check whether monster can arrive at location <x,y> via Tport (or fall) */
static boolean
rloc_pos_ok(
- int x, int y, /* coordinates of candidate location */
+ coordxy x, coordxy y, /* coordinates of candidate location */
struct monst *mtmp)
{
- register int xx, yy;
+ coordxy xx, yy;
if (!goodpos(x, y, mtmp, GP_CHECKSCARY))
return FALSE;
static void
rloc_to_core(
struct monst* mtmp,
- int x, int y,
+ coordxy x, coordxy y,
unsigned rlocflags)
{
- register int oldx = mtmp->mx, oldy = mtmp->my;
+ coordxy oldx = mtmp->mx, oldy = mtmp->my;
boolean resident_shk = mtmp->isshk && inhishop(mtmp);
boolean preventmsg = (rlocflags & RLOC_NOMSG) != 0;
boolean vanishmsg = (rlocflags & RLOC_MSG) != 0;
}
void
-rloc_to(struct monst *mtmp, int x, int y)
+rloc_to(struct monst *mtmp, coordxy x, coordxy y)
{
rloc_to_core(mtmp, x, y, RLOC_NOMSG);
}
void
-rloc_to_flag(struct monst *mtmp, int x, int y, unsigned int rlocflags)
+rloc_to_flag(struct monst *mtmp, coordxy x, coordxy y, unsigned int rlocflags)
{
rloc_to_core(mtmp, x, y, rlocflags);
}
struct monst *mtmp, /* mx==0 implies migrating monster arrival */
unsigned int rlocflags)
{
- register int x, y, trycount;
+ coordxy x, y;
+ int trycount;
if (mtmp == u.usteed) {
tele();
boolean
rloco(register struct obj* obj)
{
- register coordxy tx, ty, otx, oty;
+ coordxy tx, ty, otx, oty;
boolean restricted_fall;
int try_limit = 4000;
}
struct trap *
-maketrap(int x, int y, int typ)
+maketrap(coordxy x, coordxy y, int typ)
{
static union vlaunchinfo zero_vl;
boolean oldplace;
void
blow_up_landmine(struct trap* trap)
{
- int x = trap->tx, y = trap->ty, dbx, dby;
+ coordxy x = trap->tx, y = trap->ty, dbx, dby;
struct rm *lev = &levl[x][y];
schar old_typ, typ;
int
launch_obj(
short otyp,
- int x1, int y1,
- int x2, int y2,
+ coordxy x1, coordxy y1,
+ coordxy x2, coordxy y2,
int style)
{
struct monst *mtmp;
}
void
-fill_pit(int x, int y)
+fill_pit(coordxy x, coordxy y)
{
struct obj *otmp;
struct trap *t;
int
untrap(
boolean force,
- int rx, int ry,
+ coordxy rx, coordxy ry,
struct obj *container)
{
register struct obj *otmp;
- register int x, y;
+ coordxy x, y;
int ch;
struct trap *ttmp;
struct monst *mtmp;
}
struct trap *
-t_at(register int x, register int y)
+t_at(coordxy x, coordxy y)
{
register struct trap *trap = g.ftrap;
struct trap *trap1,
boolean u_entering_trap2)
{
- int dx, dy, diridx, adjidx;
+ coordxy dx, dy, diridx, adjidx;
if (!trap1 || !trap2)
return FALSE;
static void
clear_conjoined_pits(struct trap* trap)
{
- int diridx, adjidx, x, y;
+ int diridx, adjidx;
+ coordxy x, y;
struct trap *t;
if (trap && is_pit(trap->ttyp)) {
join_adjacent_pits(struct trap* trap)
{
struct trap *t;
- int diridx, x, y;
+ int diridx;
+ coordxy x, y;
if (!trap)
return;
#include "hack.h"
static boolean clear_fcorr(struct monst *, boolean);
-static void blackout(int, int);
+static void blackout(coordxy, coordxy);
static void restfakecorr(struct monst *);
static void parkguard(struct monst *);
-static boolean in_fcorridor(struct monst *, int, int);
+static boolean in_fcorridor(struct monst *, coordxy, coordxy);
static boolean find_guard_dest(struct monst *, coordxy *, coordxy *);
static void move_gold(struct obj *, int);
static void wallify_vault(struct monst *);
static boolean
clear_fcorr(struct monst *grd, boolean forceshow)
{
- register int fcx, fcy, fcbeg;
+ coordxy fcx, fcy, fcbeg;
struct monst *mtmp;
boolean sawcorridor = FALSE,
silently = g.program_state.stopprint ? TRUE : FALSE;
the corridor, we don't want the light to reappear if/when a new tunnel
goes through the same area */
static void
-blackout(int x, int y)
+blackout(coordxy x, coordxy y)
{
struct rm *lev;
int i, j;
}
static boolean
-in_fcorridor(struct monst *grd, int x, int y)
+in_fcorridor(struct monst *grd, coordxy x, coordxy y)
{
register int fci;
struct egd *egrd = EGD(grd);
static boolean
find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry)
{
- register int x, y, dd, lx, ly;
+ coordxy x, y, dd, lx, ly;
for (dd = 2; (dd < ROWNO || dd < COLNO); dd++) {
for (y = u.uy - dd; y <= u.uy + dd; y++) {
static void
wallify_vault(struct monst *grd)
{
- int x, y, typ;
+ int typ;
+ coordxy x, y;
int vlt = EGD(grd)->vroom;
char tmp_viz;
coordxy lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
int
gd_move(struct monst *grd)
{
- int x, y, nx, ny, m, n;
- int dx, dy, gx = 0, gy = 0, fci;
+ coordxy x, y, nx, ny, m, n;
+ coordxy dx, dy, gx = 0, gy = 0, fci;
uchar typ;
struct rm *crm;
struct fakecorridor *fcp;
static void fill_point(int, int);
static void dig_point(int, int);
static void view_init(void);
-static void view_from(int, int, coordxy **, coordxy *, coordxy *, int,
- void (*)(int, int, genericptr_t),
+static void view_from(coordxy, coordxy, coordxy **, coordxy *, coordxy *, int,
+ void (*)(coordxy, coordxy, genericptr_t),
genericptr_t);
static void get_unused_cs(coordxy ***, coordxy **, coordxy **);
static void rogue_vision(coordxy **, coordxy *, coordxy *);
* + Monsters can see you even when you're in a pit.
*/
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0,
- (void (*)(int, int, genericptr_t)) 0,
+ (void (*)(coordxy, coordxy, genericptr_t)) 0,
(genericptr_t) 0);
/*
}
} else
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0,
- (void (*)(int, int, genericptr_t)) 0,
+ (void (*)(coordxy, coordxy, genericptr_t)) 0,
(genericptr_t) 0);
/*
static coordxy *cs_left;
static coordxy *cs_right;
-static void (*vis_func)(int, int, genericptr_t);
+static void (*vis_func)(coordxy, coordxy, genericptr_t);
static genericptr_t varg;
/*
* arg argument for func
*/
static void
-view_from(int srow, int scol, coordxy **loc_cs_rows,
+view_from(coordxy srow, coordxy scol, coordxy **loc_cs_rows,
coordxy *left_most, coordxy *right_most, int range,
- void (*func)(int, int, genericptr_t), genericptr_t arg)
+ void (*func)(coordxy, coordxy, genericptr_t), genericptr_t arg)
{
register int i; /* loop counter */
coordxy *rowp; /* optimization for setting could_see */
* vision matrix and reduce extra work.
*/
void
-do_clear_area(int scol, int srow, int range,
- void (*func)(int, int, genericptr_t), genericptr_t arg)
+do_clear_area(coordxy scol, coordxy srow, int range,
+ void (*func)(coordxy, coordxy, genericptr_t), genericptr_t arg)
{
/* If not centered on hero, do the hard work of figuring the area */
if (scol != u.ux || srow != u.uy) {
static int hup_nhgetch(void);
static char hup_yn_function(const char *, const char *, char);
-static int hup_nh_poskey(int *, int *, int *);
+static int hup_nh_poskey(coordxy *, coordxy *, int *);
static void hup_getlin(const char *, char *);
static void hup_init_nhwindows(int *, char **);
static void hup_exit_nhwindows(const char *);
/*ARGSUSED*/
static int
-hup_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED)
+hup_nh_poskey(coordxy *x UNUSED, coordxy *y UNUSED, int *mod UNUSED)
{
return '\033';
}
bhitpile(
struct obj *obj, /* wand or fake spellbook for type of zap */
int (*fhito)(OBJ_P, OBJ_P), /* callback for each object being hit */
- int tx, int ty, /* target location */
+ coordxy tx, coordxy ty, /* target location */
schar zz) /* direction for up/down zaps */
{
int hitanything = 0;
zap_updown(struct obj *obj) /* wand or spell */
{
boolean striking = FALSE, disclose = FALSE;
- int x, y, xx, yy, ptmp;
+ coordxy x, y, xx, yy;
+ int ptmp;
struct obj *otmp;
struct engr *e;
struct trap *ttmp;
* one is revealed for a weapon, but if not a weapon is left up to fhitm().
*/
struct monst *
-bhit(int ddx, int ddy, int range, /* direction and range */
+bhit(coordxy ddx, coordxy ddy, int range, /* direction and range */
enum bhit_call_types weapon, /* defined in hack.h */
int (*fhitm)(MONST_P, OBJ_P), /* fns called when mon/obj hit */
int (*fhito)(OBJ_P, OBJ_P),
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
while (range-- > 0) {
- int x, y;
+ coordxy x, y;
g.bhitpos.x += ddx;
g.bhitpos.y += ddy;
* is too obviously silly.
*/
struct monst *
-boomhit(struct obj *obj, int dx, int dy)
+boomhit(struct obj *obj, coordxy dx, coordxy dy)
{
register int i, ct;
int boom; /* showsym[] index */
g.bhitpos.x = u.ux;
g.bhitpos.y = u.uy;
boom = counterclockwise ? S_boomleft : S_boomright;
- i = xytod(dx, dy);
+ i = (int) xytod(dx, dy);
tmp_at(DISP_FLASH, cmap_to_glyph(boom));
for (ct = 0; ct < 10; ct++) {
i = DIR_CLAMP(i);
* at position x,y; return the number of objects burned
*/
int
-burn_floor_objects(int x, int y,
+burn_floor_objects(coordxy x, coordxy y,
boolean give_feedback, /* caller needs to decide about
visibility checks */
boolean u_caused)
}
int
-console_poskey(int *x, int *y, int *mod)
+console_poskey(coordxy *x, coordxy *y, int *mod)
{
int ch;
coord cc = { 0, 0 };
return keybuffer.GetAscii();
}
-int NetHackQtBind::qt_nh_poskey(int *x, int *y, int *mod)
+int NetHackQtBind::qt_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
if (main)
main->fadeHighlighting(true);
static void qt_raw_print(const char *str);
static void qt_raw_print_bold(const char *str);
static int qt_nhgetch();
- static int qt_nh_poskey(int *x, int *y, int *mod);
+ static int qt_nh_poskey(coordxy *x, coordxy *y, int *mod);
static void qt_nhbell();
static int qt_doprev_message();
static char qt_more();
}
int
-X11_nh_poskey(int *x, int *y, int *mod)
+X11_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
int val = input_event(EXIT_ON_KEY_OR_BUTTON_PRESS);
void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *);
int chainin_nhgetch(void);
-int chainin_nh_poskey(int *, int *, int *);
+int chainin_nh_poskey(coordxy *, coordxy *, int *);
void chainin_nhbell(void);
int chainin_doprev_message(void);
char chainin_yn_function(const char *, const char *, char);
int
chainin_nh_poskey(
- int *x,
- int *y,
+ coordxy *x,
+ coordxy *y,
int *mod)
{
int rv;
void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *);
int chainout_nhgetch(void *);
-int chainout_nh_poskey(void *,int *, int *, int *);
+int chainout_nh_poskey(void *,coordxy *, coordxy *, int *);
void chainout_nhbell(void *);
int chainout_doprev_message(void *);
char chainout_yn_function(void *,const char *, const char *, char);
int
chainout_nh_poskey(
void *vp,
- int *x,
- int *y,
+ coordxy *x,
+ coordxy *y,
int *mod)
{
struct chainout_data *tdp = vp;
void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *);
int trace_nhgetch(void *);
-int trace_nh_poskey(void *,int *, int *, int *);
+int trace_nh_poskey(void *,coordxy *, coordxy *, int *);
void trace_nhbell(void *);
int trace_doprev_message(void *);
char trace_yn_function(void *,const char *, const char *, char);
int
trace_nh_poskey(
void *vp,
- int *x,
- int *y,
+ coordxy *x,
+ coordxy *y,
int *mod)
{
struct trace_data *tdp = vp;
} else {
sprintf(buf, "(%d)", rv);
}
- fprintf(wc_tracelogf, "%s=> %s (%d, %d, %d)\n", INDENT, buf, *x, *y,
+ fprintf(wc_tracelogf, "%s=> %s (%d, %d, %d)\n", INDENT, buf,
+ (int) *x, (int) *y,
*mod);
return rv;
}
/*
-int nh_poskey(int *x, int *y, int *mod)
+int nh_poskey(coordxy *x, coordxy *y, int *mod)
-- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else,
routine always returns a non-zero character.
*/
int
-curses_nh_poskey(int *x, int *y, int *mod)
+curses_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
int key = curses_nhgetch();
movement. */
int
-curses_get_mouse(int *mousex, int *mousey, int *mod)
+curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod)
{
int key = '\033';
int curses_read_attrs(const char *attrs);
char *curses_fmt_attrs(char *);
int curses_convert_keys(int key);
-int curses_get_mouse(int *mousex, int *mousey, int *mod);
+int curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod);
void curses_mouse_support(int);
#endif /* CURSMISC_H */
*/
/*ARGSUSED*/
int
-safe_nh_poskey(int *x, int *y, int *mod)
+safe_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
return '\033';
}
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")
-DECLCB(int, shim_nh_poskey,(int *x, int *y, int *mod), "iooo", P2V x, P2V y, P2V mod)
+DECLCB(int, shim_nh_poskey,(coordxy *x, coordxy *y, int *mod), "iooo", P2V x, P2V y, P2V mod)
VDECLCB(shim_nhbell,(void), "v")
DECLCB(int, shim_doprev_message,(void),"iv")
DECLCB(char, shim_yn_function,(const char *query, const char *resp, char def), "cssi", P2V query, P2V resp, A2P def)
/*ARGSUSED*/
int
#if defined(WIN32CON)
-tty_nh_poskey(int *x, int *y, int *mod)
+tty_nh_poskey(coordxy *x, coordxy *y, int *mod)
#else
-tty_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED)
+tty_nh_poskey(coordxy *x UNUSED, coordxy *y UNUSED, int *mod UNUSED)
#endif
{
int i;
}
/*
-int nh_poskey(int *x, int *y, int *mod)
+int nh_poskey(coordxy *x, coordxy *y, int *mod)
-- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else,
routine always returns a non-zero character.
*/
int
-mswin_nh_poskey(int *x, int *y, int *mod)
+mswin_nh_poskey(coordxy *x, coordxy *y, int *mod)
{
PMSNHEvent event;
int key;
if (event->type == NHEVENT_MOUSE) {
if (iflags.wc_mouse_support) {
*mod = event->ei.ms.mod;
- *x = event->ei.ms.x;
- *y = event->ei.ms.y;
+ *x = (coordxy) event->ei.ms.x;
+ *y = (coordxy) event->ei.ms.y;
}
key = 0;
} else {
void mswin_raw_print_bold(const char *str);
void mswin_raw_print_flush();
int mswin_nhgetch(void);
-int mswin_nh_poskey(int *x, int *y, int *mod);
+int mswin_nh_poskey(coordxy *x, coordxy *y, int *mod);
void mswin_nhbell(void);
int mswin_doprev_message(void);
char mswin_yn_function(const char *question, const char *choices, char def);