be more consistent with coordinates

This commit is contained in:
nhmall
2022-07-02 09:10:03 -04:00
parent 0bd5b3d39e
commit 3004cf2d34
74 changed files with 831 additions and 746 deletions
+141 -140
View File
@@ -165,7 +165,7 @@ extern void bc_sanity_check(void);
/* ### bones.c ### */ /* ### bones.c ### */
extern void sanitize_name(char *); 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 boolean can_make_bones(void);
extern void savebones(int, time_t, struct obj *); extern void savebones(int, time_t, struct obj *);
extern int getbones(void); extern int getbones(void);
@@ -276,23 +276,23 @@ extern int extcmd_via_menu(void);
extern int enter_explore_mode(void); extern int enter_explore_mode(void);
extern boolean bind_key(uchar, const char *); extern boolean bind_key(uchar, const char *);
extern void dokeylist(void); extern void dokeylist(void);
extern int xytod(schar, schar); extern coordxy xytod(coordxy, coordxy);
extern void dtoxy(coord *, int); extern void dtoxy(coord *, int);
extern int movecmd(char, int); extern int movecmd(char, int);
extern int dxdy_moveok(void); extern int dxdy_moveok(void);
extern int getdir(const char *); extern int getdir(const char *);
extern void confdir(void); extern void confdir(void);
extern const char *directionname(int); 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 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); extern char get_count(const char *, char, long, cmdcount_nht *, unsigned);
#ifdef HANGUPHANDLING #ifdef HANGUPHANDLING
extern void hangup(int); extern void hangup(int);
extern void end_of_input(void); extern void end_of_input(void);
#endif #endif
extern char readchar(void); extern char readchar(void);
extern char readchar_poskey(int *, int *, int *); extern char readchar_poskey(coordxy *, coordxy *, int *);
extern void sanity_check(void); extern void sanity_check(void);
extern char* key2txt(uchar, char *); extern char* key2txt(uchar, char *);
extern char yn_function(const char *, const char *, char); extern char yn_function(const char *, const char *, char);
@@ -307,19 +307,19 @@ extern void free_nomakedefs(void);
/* ### dbridge.c ### */ /* ### dbridge.c ### */
extern boolean is_waterwall(coordxy, coordxy); extern boolean is_waterwall(coordxy, coordxy);
extern boolean is_pool(int, int); extern boolean is_pool(coordxy, coordxy);
extern boolean is_lava(int, int); extern boolean is_lava(coordxy, coordxy);
extern boolean is_pool_or_lava(int, int); extern boolean is_pool_or_lava(coordxy, coordxy);
extern boolean is_ice(int, int); extern boolean is_ice(coordxy, coordxy);
extern boolean is_moat(int, int); extern boolean is_moat(coordxy, coordxy);
extern schar db_under_typ(int); extern schar db_under_typ(int);
extern int is_drawbridge_wall(int, int); extern int is_drawbridge_wall(coordxy, coordxy);
extern boolean is_db_wall(int, int); extern boolean is_db_wall(coordxy, coordxy);
extern boolean find_drawbridge(int *, int *); extern boolean find_drawbridge(coordxy *, coordxy *);
extern boolean create_drawbridge(int, int, int, boolean); extern boolean create_drawbridge(coordxy, coordxy, int, boolean);
extern void open_drawbridge(int, int); extern void open_drawbridge(coordxy, coordxy);
extern void close_drawbridge(int, int); extern void close_drawbridge(coordxy, coordxy);
extern void destroy_drawbridge(int, int); extern void destroy_drawbridge(coordxy, coordxy);
/* ### decl.c ### */ /* ### decl.c ### */
@@ -327,8 +327,8 @@ extern void decl_globals_init(void);
/* ### detect.c ### */ /* ### detect.c ### */
extern boolean trapped_chest_at(int, int, int); extern boolean trapped_chest_at(int, coordxy, coordxy);
extern boolean trapped_door_at(int, int, int); extern boolean trapped_door_at(int, coordxy, coordxy);
extern struct obj *o_in(struct obj *, char); extern struct obj *o_in(struct obj *, char);
extern struct obj *o_material(struct obj *, unsigned); extern struct obj *o_material(struct obj *, unsigned);
extern int gold_detect(struct obj *); extern int gold_detect(struct obj *);
@@ -343,7 +343,7 @@ extern void do_vicinity_map(struct obj *);
extern void cvt_sdoor_to_door(struct rm *); extern void cvt_sdoor_to_door(struct rm *);
extern int findit(void); extern int findit(void);
extern int openit(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 find_trap(struct trap *);
extern void warnreveal(void); extern void warnreveal(void);
extern int dosearch0(int); extern int dosearch0(int);
@@ -360,8 +360,8 @@ extern int wiz_mgender(void);
extern int dig_typ(struct obj *, coordxy, coordxy); extern int dig_typ(struct obj *, coordxy, coordxy);
extern boolean is_digging(void); extern boolean is_digging(void);
extern int holetime(void); extern int holetime(void);
extern boolean dig_check(struct monst *, boolean, int, int); extern boolean dig_check(struct monst *, boolean, coordxy, coordxy);
extern void digactualhole(int, int, struct monst *, int); extern void digactualhole(coordxy, coordxy, struct monst *, int);
extern boolean dighole(boolean, boolean, coord *); extern boolean dighole(boolean, boolean, coord *);
extern int use_pick_axe(struct obj *); extern int use_pick_axe(struct obj *);
extern int use_pick_axe2(struct obj *); extern int use_pick_axe2(struct obj *);
@@ -377,7 +377,7 @@ extern void rot_corpse(union any *, long);
extern struct obj *buried_ball(coord *); extern struct obj *buried_ball(coord *);
extern void buried_ball_to_punishment(void); extern void buried_ball_to_punishment(void);
extern void buried_ball_to_freedom(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 void liquid_flow(coordxy, coordxy, schar, struct trap *, const char *);
extern boolean conjoined_pits(struct trap *, struct trap *, boolean); extern boolean conjoined_pits(struct trap *, struct trap *, boolean);
#if 0 #if 0
@@ -406,17 +406,17 @@ extern void map_background(coordxy, coordxy, int);
extern void map_trap(struct trap *, int); extern void map_trap(struct trap *, int);
extern void map_object(struct obj *, int); extern void map_object(struct obj *, int);
extern void map_invisible(coordxy, coordxy); extern void map_invisible(coordxy, coordxy);
extern boolean unmap_invisible(int, int); extern boolean unmap_invisible(coordxy, coordxy);
extern void unmap_object(int, int); extern void unmap_object(coordxy, coordxy);
extern void map_location(int, int, int); extern void map_location(coordxy, coordxy, int);
extern boolean suppress_map_output(void); extern boolean suppress_map_output(void);
extern void feel_newsym(coordxy, coordxy); extern void feel_newsym(coordxy, coordxy);
extern void feel_location(coordxy, coordxy); extern void feel_location(coordxy, coordxy);
extern void newsym(int, int); extern void newsym(coordxy, coordxy);
extern void newsym_force(int, int); extern void newsym_force(coordxy, coordxy);
extern void shieldeff(coordxy, coordxy); extern void shieldeff(coordxy, coordxy);
extern void tmp_at(int, int); extern void tmp_at(coordxy, coordxy);
extern void flash_glyph_at(int, int, int, int); extern void flash_glyph_at(coordxy, coordxy, int, int);
extern void swallowed(int); extern void swallowed(int);
extern void under_ground(int); extern void under_ground(int);
extern void under_water(int); extern void under_water(int);
@@ -428,18 +428,18 @@ extern void curs_on_u(void);
extern int doredraw(void); extern int doredraw(void);
extern void docrt(void); extern void docrt(void);
extern void redraw_map(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 clear_glyph_buffer(void);
extern void row_refresh(int, int, int); extern void row_refresh(coordxy, coordxy, coordxy);
extern void cls(void); extern void cls(void);
extern void flush_screen(int); extern void flush_screen(int);
extern int back_to_glyph(coordxy, coordxy); extern int back_to_glyph(coordxy, coordxy);
extern int zapdir_to_glyph(int, int, int); extern int zapdir_to_glyph(int, int, int);
extern int glyph_at(coordxy, coordxy); extern int glyph_at(coordxy, coordxy);
extern void reglyph_darkroom(void); 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 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 int warning_of(struct monst *);
extern void map_glyphinfo(coordxy, coordxy, int, unsigned, glyph_info *); extern void map_glyphinfo(coordxy, coordxy, int, unsigned, glyph_info *);
extern void reset_glyphmap(enum glyphmap_change_triggers trigger); extern void reset_glyphmap(enum glyphmap_change_triggers trigger);
@@ -448,8 +448,8 @@ extern int fn_cmap_to_glyph(int);
/* ### do.c ### */ /* ### do.c ### */
extern int dodrop(void); extern int dodrop(void);
extern boolean boulder_hits_pool(struct obj *, int, int, boolean); extern boolean boulder_hits_pool(struct obj *, coordxy, coordxy, boolean);
extern boolean flooreffects(struct obj *, int, int, const char *); extern boolean flooreffects(struct obj *, coordxy, coordxy, const char *);
extern void doaltarobj(struct obj *); extern void doaltarobj(struct obj *);
extern void trycall(struct obj *); extern void trycall(struct obj *);
extern boolean canletgo(struct obj *, const char *); extern boolean canletgo(struct obj *, const char *);
@@ -481,11 +481,11 @@ extern void heal_legs(int);
/* ### do_name.c ### */ /* ### do_name.c ### */
extern char *dxdy_to_dist_descr(int, int, boolean); extern char *dxdy_to_dist_descr(coordxy, coordxy, boolean);
extern char *coord_desc(int, int, char *, char); extern char *coord_desc(coordxy, coordxy, char *, char);
extern boolean getpos_menu(coord *, int); extern boolean getpos_menu(coord *, int);
extern int getpos(coord *, boolean, const char *); 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 new_mgivenname(struct monst *, int);
extern void free_mgivenname(struct monst *); extern void free_mgivenname(struct monst *);
extern void new_oname(struct obj *, int); extern void new_oname(struct obj *, int);
@@ -603,10 +603,10 @@ extern void wary_dog(struct monst *, boolean);
/* ### dogmove.c ### */ /* ### dogmove.c ### */
extern boolean cursed_object_at(int, int); extern boolean cursed_object_at(coordxy, coordxy);
extern struct obj *droppables(struct monst *); extern struct obj *droppables(struct monst *);
extern int dog_nutrition(struct monst *, struct obj *); 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 int dog_move(struct monst *, int);
extern void finish_meating(struct monst *); extern void finish_meating(struct monst *);
@@ -639,10 +639,10 @@ extern int breaks(struct obj *, coordxy, coordxy);
extern void release_camera_demon(struct obj *, coordxy, coordxy); extern void release_camera_demon(struct obj *, coordxy, coordxy);
extern void breakobj(struct obj *, coordxy, coordxy, boolean, boolean); extern void breakobj(struct obj *, coordxy, coordxy, boolean, boolean);
extern boolean breaktest(struct obj *); 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); genericptr_t);
extern boolean hurtle_jump(genericptr_t, int, int); extern boolean hurtle_jump(genericptr_t, coordxy, coordxy);
extern boolean hurtle_step(genericptr_t, int, int); extern boolean hurtle_step(genericptr_t, coordxy, coordxy);
/* ### drawing.c ### */ /* ### drawing.c ### */
@@ -671,12 +671,12 @@ extern xint16 deepest_lev_reached(boolean);
extern boolean on_level(d_level *, d_level *); extern boolean on_level(d_level *, d_level *);
extern void next_level(boolean); extern void next_level(boolean);
extern void prev_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 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_print(void);
extern void stairway_free_all(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(d_level *);
extern stairway *stairway_find_from(d_level *, boolean); extern stairway *stairway_find_from(d_level *, boolean);
extern stairway *stairway_find_dir(boolean); extern stairway *stairway_find_dir(boolean);
@@ -693,7 +693,7 @@ extern void get_level(d_level *, int);
extern boolean Is_botlevel(d_level *); extern boolean Is_botlevel(d_level *);
extern boolean Can_fall_thru(d_level *); extern boolean Can_fall_thru(d_level *);
extern boolean Can_dig_down(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 has_ceiling(d_level *);
extern boolean In_quest(d_level *); extern boolean In_quest(d_level *);
extern boolean In_mines(d_level *); extern boolean In_mines(d_level *);
@@ -702,7 +702,7 @@ extern boolean at_dgn_entrance(const char *);
extern boolean In_hell(d_level *); extern boolean In_hell(d_level *);
extern boolean In_V_tower(d_level *); extern boolean In_V_tower(d_level *);
extern boolean On_W_tower_level(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 find_hell(d_level *);
extern void goto_hell(boolean, boolean); extern void goto_hell(boolean, boolean);
extern boolean single_level_branch(d_level *); extern boolean single_level_branch(d_level *);
@@ -793,16 +793,16 @@ extern void panictrace_setsignals(boolean);
extern char *random_engraving(char *); extern char *random_engraving(char *);
extern void wipeout_text(char *, int, unsigned); extern void wipeout_text(char *, int, unsigned);
extern boolean can_reach_floor(boolean); extern boolean can_reach_floor(boolean);
extern void cant_reach_floor(int, int, boolean, boolean); extern void cant_reach_floor(coordxy, coordxy, boolean, boolean);
extern const char *surface(int, int); extern const char *surface(coordxy, coordxy);
extern const char *ceiling(int, int); extern const char *ceiling(coordxy, coordxy);
extern struct engr *engr_at(coordxy, coordxy); extern struct engr *engr_at(coordxy, coordxy);
extern boolean sengr_at(const char *, coordxy, coordxy, boolean); extern boolean sengr_at(const char *, coordxy, coordxy, boolean);
extern void u_wipe_engr(int); extern void u_wipe_engr(int);
extern void wipe_engr_at(coordxy, coordxy, coordxy, boolean); extern void wipe_engr_at(coordxy, coordxy, coordxy, boolean);
extern void read_engr_at(int, int); extern void read_engr_at(coordxy, coordxy);
extern void make_engr_at(int, int, const char *, long, xint16); extern void make_engr_at(coordxy, coordxy, const char *, long, xint16);
extern void del_engr_at(int, int); extern void del_engr_at(coordxy, coordxy);
extern int freehand(void); extern int freehand(void);
extern int doengrave(void); extern int doengrave(void);
extern void sanitize_engravings(void); extern void sanitize_engravings(void);
@@ -811,7 +811,7 @@ extern void rest_engravings(NHFILE *);
extern void engr_stats(const char *, char *, long *, long *); extern void engr_stats(const char *, char *, long *, long *);
extern void del_engr(struct engr *); extern void del_engr(struct engr *);
extern void rloc_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 ### */ /* ### exper.c ### */
@@ -826,17 +826,17 @@ extern long rndexp(boolean);
/* ### explode.c ### */ /* ### explode.c ### */
extern void explode(int, int, int, int, char, int); extern void explode(coordxy, coordxy, int, int, char, int);
extern long scatter(int, int, int, unsigned int, struct obj *); extern long scatter(coordxy, coordxy, int, unsigned int, struct obj *);
extern void splatter_burning_oil(int, int, boolean); extern void splatter_burning_oil(coordxy, coordxy, boolean);
extern void explode_oil(struct obj *, int, int); extern void explode_oil(struct obj *, coordxy, coordxy);
extern int adtyp_to_expltype(const int); extern int adtyp_to_expltype(const int);
extern void mon_explodes(struct monst *, struct attack *); extern void mon_explodes(struct monst *, struct attack *);
/* ### extralev.c ### */ /* ### extralev.c ### */
extern void makeroguerooms(void); extern void makeroguerooms(void);
extern void corr(int, int); extern void corr(coordxy, coordxy);
extern void makerogueghost(void); extern void makerogueghost(void);
/* ### files.c ### */ /* ### files.c ### */
@@ -921,17 +921,17 @@ extern void dogushforth(int);
extern void dryup(coordxy, coordxy, boolean); extern void dryup(coordxy, coordxy, boolean);
extern void drinkfountain(void); extern void drinkfountain(void);
extern void dipfountain(struct obj *); extern void dipfountain(struct obj *);
extern void breaksink(int, int); extern void breaksink(coordxy, coordxy);
extern void drinksink(void); extern void drinksink(void);
/* ### hack.c ### */ /* ### hack.c ### */
extern boolean is_valid_travelpt(int,int); extern boolean is_valid_travelpt(coordxy, coordxy);
extern anything *uint_to_any(unsigned); extern anything *uint_to_any(unsigned);
extern anything *long_to_any(long); extern anything *long_to_any(long);
extern anything *monst_to_any(struct monst *); extern anything *monst_to_any(struct monst *);
extern anything *obj_to_any(struct obj *); 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 int still_chewing(coordxy, coordxy);
extern void movobj(struct obj *, coordxy, coordxy); extern void movobj(struct obj *, coordxy, coordxy);
extern boolean may_dig(coordxy, coordxy); extern boolean may_dig(coordxy, coordxy);
@@ -939,7 +939,7 @@ extern boolean may_passwall(coordxy, coordxy);
extern boolean bad_rock(struct permonst *, coordxy, coordxy); extern boolean bad_rock(struct permonst *, coordxy, coordxy);
extern int cant_squeeze_thru(struct monst *); extern int cant_squeeze_thru(struct monst *);
extern boolean invocation_pos(coordxy, coordxy); 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 #ifdef DEBUG
extern int wiz_debug_cmd_traveldisplay(void); extern int wiz_debug_cmd_traveldisplay(void);
#endif #endif
@@ -955,11 +955,11 @@ extern void set_uinwater(int);
extern boolean pooleffects(boolean); extern boolean pooleffects(boolean);
extern void spoteffects(boolean); extern void spoteffects(boolean);
extern char *in_rooms(coordxy, coordxy, int); 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 void check_special_room(boolean);
extern int dopickup(void); extern int dopickup(void);
extern void lookaround(void); extern void lookaround(void);
extern boolean crawl_destination(int, int); extern boolean crawl_destination(coordxy, coordxy);
extern int monster_nearby(void); extern int monster_nearby(void);
extern void end_running(boolean); extern void end_running(boolean);
extern void nomul(int); extern void nomul(int);
@@ -1011,9 +1011,9 @@ extern const char *ordin(int);
extern char *sitoa(int); extern char *sitoa(int);
extern int sgn(int); extern int sgn(int);
extern int rounddiv(long, 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 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 online2(int, int, int, int);
extern boolean pmatch(const char *, const char *); extern boolean pmatch(const char *, const char *);
extern boolean pmatchi(const char *, const char *); extern boolean pmatchi(const char *, const char *);
@@ -1107,20 +1107,20 @@ extern void useup(struct obj *);
extern void consume_obj_charge(struct obj *, boolean); extern void consume_obj_charge(struct obj *, boolean);
extern void freeinv_core(struct obj *); extern void freeinv_core(struct obj *);
extern void freeinv(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(struct obj *);
extern void delobj_core(struct obj *, boolean); 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 *nxtobj(struct obj *, int, boolean);
extern struct obj *carrying(int); extern struct obj *carrying(int);
extern boolean have_lizard(void); extern boolean have_lizard(void);
extern struct obj *u_carried_gloves(void); extern struct obj *u_carried_gloves(void);
extern struct obj *u_have_novel(void); extern struct obj *u_have_novel(void);
extern struct obj *o_on(unsigned int, struct obj *); 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 wearing_armor(void);
extern boolean is_worn(struct obj *); 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 boolean splittable(struct obj *);
extern int any_obj_ok(struct obj *); extern int any_obj_ok(struct obj *);
extern struct obj *getobj(const char *, int(*)(struct obj *), unsigned int); extern struct obj *getobj(const char *, int(*)(struct obj *), unsigned int);
@@ -1140,11 +1140,11 @@ extern void prinv(const char *, struct obj *, long);
extern char *xprname(struct obj *, const char *, char, boolean, long, long); extern char *xprname(struct obj *, const char *, char, boolean, long, long);
extern int ddoinv(void); extern int ddoinv(void);
extern char display_inventory(const char *, boolean); 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_cinventory(struct obj *);
extern struct obj *display_minventory(struct monst *, int, char *); extern struct obj *display_minventory(struct monst *, int, char *);
extern int dotypeinv(void); 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 look_here(int, unsigned);
extern int dolook(void); extern int dolook(void);
extern boolean will_feel_cockatrice(struct obj *, boolean); extern boolean will_feel_cockatrice(struct obj *, boolean);
@@ -1193,7 +1193,7 @@ extern int dosuspend(void);
extern void new_light_source(coordxy, coordxy, int, int, union any *); extern void new_light_source(coordxy, coordxy, int, int, union any *);
extern void del_light_source(int, union any *); extern void del_light_source(int, union any *);
extern void do_light_sources(coordxy **); 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 void transient_light_cleanup(void);
extern struct monst *find_mid(unsigned, unsigned); extern struct monst *find_mid(unsigned, unsigned);
extern void save_light_sources(NHFILE *, int); extern void save_light_sources(NHFILE *, int);
@@ -1203,7 +1203,7 @@ extern void relink_light_sources(boolean);
extern void light_sources_sanity_check(void); extern void light_sources_sanity_check(void);
extern void obj_move_light_source(struct obj *, struct obj *); extern void obj_move_light_source(struct obj *, struct obj *);
extern boolean any_light_source(void); 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_sheds_light(struct obj *);
extern boolean obj_is_burning(struct obj *); extern boolean obj_is_burning(struct obj *);
extern void obj_split_light_source(struct obj *, struct obj *); extern void obj_split_light_source(struct obj *, struct obj *);
@@ -1216,8 +1216,8 @@ extern int wiz_light_sources(void);
/* ### lock.c ### */ /* ### lock.c ### */
extern boolean picking_lock(int *, int *); extern boolean picking_lock(coordxy *, coordxy *);
extern boolean picking_at(int, int); extern boolean picking_at(coordxy, coordxy);
extern void breakchestlock(struct obj *, boolean); extern void breakchestlock(struct obj *, boolean);
extern void reset_pick(void); extern void reset_pick(void);
extern void maybe_reset_pick(struct obj *); extern void maybe_reset_pick(struct obj *);
@@ -1226,10 +1226,10 @@ extern int pick_lock(struct obj *, coordxy, coordxy, struct obj *);
extern boolean u_have_forceable_weapon(void); extern boolean u_have_forceable_weapon(void);
extern int doforce(void); extern int doforce(void);
extern boolean boxlock(struct obj *, struct obj *); 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 int doopen(void);
extern boolean stumble_on_door_mimic(int, int); extern boolean stumble_on_door_mimic(coordxy, coordxy);
extern int doopen_indir(int, int); extern int doopen_indir(coordxy, coordxy);
extern int doclose(void); extern int doclose(void);
#ifdef MAC #ifdef MAC
@@ -1263,7 +1263,7 @@ extern void newmonhp(struct monst *, int);
extern struct mextra *newmextra(void); extern struct mextra *newmextra(void);
extern void copy_mextra(struct monst *, struct monst *); extern void copy_mextra(struct monst *, struct monst *);
extern void dealloc_mextra(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 struct monst *unmakemon(struct monst *, mmflags_nht);
extern boolean create_critters(int, struct permonst *, boolean); extern boolean create_critters(int, struct permonst *, boolean);
extern struct permonst *rndmonst(void); extern struct permonst *rndmonst(void);
@@ -1360,7 +1360,7 @@ extern void add_subroom(struct mkroom *, int, int, int, int, boolean, schar,
boolean); boolean);
extern void free_luathemes(boolean); extern void free_luathemes(boolean);
extern void makecorridors(void); 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 clear_level_structures(void);
extern void level_finalize_topology(void); extern void level_finalize_topology(void);
extern void mklev(void); extern void mklev(void);
@@ -1372,7 +1372,7 @@ extern void topologize(struct mkroom *);
extern void place_branch(branch *, coordxy, coordxy); extern void place_branch(branch *, coordxy, coordxy);
extern boolean occupied(coordxy, coordxy); extern boolean occupied(coordxy, coordxy);
extern int okdoor(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 mktrap(int, int, struct mkroom *, coord *);
extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean); extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean);
extern void mkinvokearea(void); extern void mkinvokearea(void);
@@ -1389,12 +1389,12 @@ extern boolean litstate_rnd(int);
extern boolean set_levltyp(coordxy, coordxy, schar); extern boolean set_levltyp(coordxy, coordxy, schar);
extern boolean set_levltyp_lit(coordxy, coordxy, schar, schar); extern boolean set_levltyp_lit(coordxy, coordxy, schar, schar);
extern void create_maze(int, int, boolean); extern void create_maze(int, int, boolean);
extern void wallification(int, int, int, int); extern void wallification(coordxy, coordxy, coordxy, coordxy);
extern void fix_wall_spines(int, int, int, int); extern void fix_wall_spines(coordxy, coordxy, coordxy, coordxy);
extern void walkfrom(int, int, schar); extern void walkfrom(coordxy, coordxy, schar);
extern void makemaz(const char *); extern void makemaz(const char *);
extern void mazexy(coord *); 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 bound_digging(void);
extern void mkportal(coordxy, coordxy, coordxy, coordxy); extern void mkportal(coordxy, coordxy, coordxy, coordxy);
extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy); extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
@@ -1420,8 +1420,8 @@ extern void newolong(struct obj *);
extern void free_olong(struct obj *); extern void free_olong(struct obj *);
extern void new_omailcmd(struct obj *, const char *); extern void new_omailcmd(struct obj *, const char *);
extern void free_omailcmd(struct obj *); extern void free_omailcmd(struct obj *);
extern struct obj *mkobj_at(char, int, int, boolean); extern struct obj *mkobj_at(char, coordxy, coordxy, boolean);
extern struct obj *mksobj_at(int, int, int, boolean, 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 *mksobj_migr_to_species(int, unsigned, boolean, boolean);
extern struct obj *mkobj(int, boolean); extern struct obj *mkobj(int, boolean);
extern int rndmonnum(void); extern int rndmonnum(void);
@@ -1439,16 +1439,17 @@ extern void unknow_object(struct obj *);
extern struct obj *mksobj(int, boolean, boolean); extern struct obj *mksobj(int, boolean, boolean);
extern int bcsign(struct obj *); extern int bcsign(struct obj *);
extern int weight(struct obj *); extern int weight(struct obj *);
extern struct obj *mkgold(long, int, int); extern struct obj *mkgold(long, coordxy, coordxy);
extern struct obj *mkcorpstat(int, struct monst *, struct permonst *, int, extern struct obj *mkcorpstat(int, struct monst *, struct permonst *,
int, unsigned); coordxy, coordxy, unsigned);
extern int corpse_revive_type(struct obj *); extern int corpse_revive_type(struct obj *);
extern struct obj *obj_attach_mid(struct obj *, unsigned); extern struct obj *obj_attach_mid(struct obj *, unsigned);
extern struct monst *get_mtraits(struct obj *, boolean); extern struct monst *get_mtraits(struct obj *, boolean);
extern struct obj *mk_tt_object(int, int, int); extern struct obj *mk_tt_object(int, coordxy, coordxy);
extern struct obj *mk_named_object(int, struct permonst *, int, int, extern struct obj *mk_named_object(int, struct permonst *,
coordxy, coordxy,
const char *); 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 void set_corpsenm(struct obj *, int);
extern long rider_revival_time(struct obj *, boolean); extern long rider_revival_time(struct obj *, boolean);
extern void start_corpse_timeout(struct obj *); extern void start_corpse_timeout(struct obj *);
@@ -1463,7 +1464,7 @@ extern void blessorcurse(struct obj *, int);
extern void set_bknown(struct obj *, unsigned); extern void set_bknown(struct obj *, unsigned);
extern boolean is_flammable(struct obj *); extern boolean is_flammable(struct obj *);
extern boolean is_rottable(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 remove_object(struct obj *);
extern void discard_minvent(struct monst *, boolean); extern void discard_minvent(struct monst *, boolean);
extern void obj_extract_self(struct obj *); extern void obj_extract_self(struct obj *);
@@ -1474,12 +1475,12 @@ extern struct obj *add_to_container(struct obj *, struct obj *);
extern void add_to_migration(struct obj *); extern void add_to_migration(struct obj *);
extern void add_to_buried(struct obj *); extern void add_to_buried(struct obj *);
extern void dealloc_obj(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 long peek_at_iced_corpse_age(struct obj *);
extern int hornoplenty(struct obj *, boolean); extern int hornoplenty(struct obj *, boolean);
extern void obj_sanity_check(void); extern void obj_sanity_check(void);
extern struct obj *obj_nexto(struct obj *); 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_absorb(struct obj **, struct obj **);
extern struct obj *obj_meld(struct obj **, struct obj **); extern struct obj *obj_meld(struct obj **, struct obj **);
extern void pudding_merge_message(struct obj *, struct obj *); extern void pudding_merge_message(struct obj *, struct obj *);
@@ -1527,7 +1528,7 @@ extern int max_mon_load(struct monst *);
extern int can_carry(struct monst *, struct obj *); extern int can_carry(struct monst *, struct obj *);
extern long mon_allowflags(struct monst *); extern long mon_allowflags(struct monst *);
extern int mfndpos(struct monst *, coord *, long *, long); 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 dmonsfree(void);
extern void elemental_clog(struct monst *); extern void elemental_clog(struct monst *);
extern int mcalcmove(struct monst *, boolean); extern int mcalcmove(struct monst *, boolean);
@@ -1555,7 +1556,7 @@ extern void setmangry(struct monst *, boolean);
extern void wake_msg(struct monst *, boolean); extern void wake_msg(struct monst *, boolean);
extern void wakeup(struct monst *, boolean); extern void wakeup(struct monst *, boolean);
extern void wake_nearby(void); 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 seemimic(struct monst *);
extern void normal_shape(struct monst *); extern void normal_shape(struct monst *);
extern void iter_mons(void (*)(struct monst *)); extern void iter_mons(void (*)(struct monst *));
@@ -1642,7 +1643,7 @@ extern boolean mb_trapped(struct monst *, boolean);
extern boolean monhaskey(struct monst *, boolean); extern boolean monhaskey(struct monst *, boolean);
extern void mon_regen(struct monst *, boolean); extern void mon_regen(struct monst *, boolean);
extern int dochugw(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 struct monst *find_pmmonst(int);
extern int bee_eat_jelly(struct monst *, struct obj *); extern int bee_eat_jelly(struct monst *, struct obj *);
extern void monflee(struct monst *, int, boolean, boolean); extern void monflee(struct monst *, int, boolean, boolean);
@@ -1651,9 +1652,9 @@ extern int dochug(struct monst *);
extern boolean m_digweapon_check(struct monst *, coordxy, coordxy); extern boolean m_digweapon_check(struct monst *, coordxy, coordxy);
extern int m_move(struct monst *, int); extern int m_move(struct monst *, int);
extern int m_move_aggress(struct monst *, coordxy, coordxy); extern int m_move_aggress(struct monst *, coordxy, coordxy);
extern void dissolve_bars(int, int); extern void dissolve_bars(coordxy, coordxy);
extern boolean closed_door(int, int); extern boolean closed_door(coordxy, coordxy);
extern boolean accessible(int, int); extern boolean accessible(coordxy, coordxy);
extern void set_apparxy(struct monst *); extern void set_apparxy(struct monst *);
extern boolean can_ooze(struct monst *); extern boolean can_ooze(struct monst *);
extern boolean can_fog(struct monst *); extern boolean can_fog(struct monst *);
@@ -1732,7 +1733,7 @@ extern void thrwmu(struct monst *);
extern int spitmu(struct monst *, struct attack *); extern int spitmu(struct monst *, struct attack *);
extern int breamu(struct monst *, struct attack *); extern int breamu(struct monst *, struct attack *);
extern boolean linedup_callback(coordxy, coordxy, coordxy, coordxy, extern boolean linedup_callback(coordxy, coordxy, coordxy, coordxy,
boolean(*)(int,int)); boolean(*)(coordxy, coordxy));
extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int); extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int);
extern boolean lined_up(struct monst *); extern boolean lined_up(struct monst *);
extern struct obj *m_carrying(struct monst *, int); extern struct obj *m_carrying(struct monst *, int);
@@ -1741,9 +1742,9 @@ extern int spitmm(struct monst *, struct attack *, struct monst *);
extern int breamm(struct monst *, struct attack *, struct monst *); extern int breamm(struct monst *, struct attack *, struct monst *);
extern void m_useupall(struct monst *, struct obj *); extern void m_useupall(struct monst *, struct obj *);
extern void m_useup(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 m_throw(struct monst *, coordxy, coordxy, coordxy, coordxy, int, struct obj *);
extern void hit_bars(struct obj **, int, int, int, int, unsigned); extern void hit_bars(struct obj **, coordxy, coordxy, coordxy, coordxy, unsigned);
extern boolean hits_bars(struct obj **, int, int, int, int, int, int); extern boolean hits_bars(struct obj **, coordxy, coordxy, coordxy, coordxy, int, int);
/* ### muse.c ### */ /* ### muse.c ### */
@@ -1802,7 +1803,7 @@ extern void lcheck_param_table(lua_State *);
extern schar get_table_mapchr(lua_State *, const char *); extern schar get_table_mapchr(lua_State *, const char *);
extern schar get_table_mapchr_opt(lua_State *, const char *, schar); extern schar get_table_mapchr_opt(lua_State *, const char *, schar);
extern short nhl_get_timertype(lua_State *, int); 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_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_char(lua_State *, const char *, char);
extern void nhl_add_table_entry_str(lua_State *, const char *, const char *); extern void nhl_add_table_entry_str(lua_State *, const char *, const char *);
@@ -1841,7 +1842,7 @@ extern int consoletty_kbhit(void);
extern void consoletty_open(int); extern void consoletty_open(int);
extern void consoletty_rubout(void); extern void consoletty_rubout(void);
extern int tgetch(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 set_output_mode(int);
extern void synch_cursor(void); extern void synch_cursor(void);
extern void nethack_enter_consoletty(void); extern void nethack_enter_consoletty(void);
@@ -1990,7 +1991,7 @@ extern void msgtype_free(void);
extern char *self_lookat(char *); extern char *self_lookat(char *);
extern char *monhealthdescr(struct monst *mon, boolean, char *); extern char *monhealthdescr(struct monst *mon, boolean, char *);
extern void mhidden_description(struct monst *, 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 const char *waterbody_name(coordxy, coordxy);
extern int do_screen_description(coord, boolean, int, char *, const char **, extern int do_screen_description(coord, boolean, int, char *, const char **,
struct permonst **); struct permonst **);
@@ -2072,7 +2073,7 @@ extern int query_objlist(const char *, struct obj **, int, menu_item **, int,
boolean(*)(struct obj *)); boolean(*)(struct obj *));
extern struct obj *pick_obj(struct obj *); extern struct obj *pick_obj(struct obj *);
extern int encumber_msg(void); extern int encumber_msg(void);
extern int container_at(int, int, boolean); extern int container_at(coordxy, coordxy, boolean);
extern int doloot(void); extern int doloot(void);
extern void observe_quantum_cat(struct obj *, boolean, boolean); extern void observe_quantum_cat(struct obj *, boolean, boolean);
extern boolean container_gone(int(*)(struct obj *)); extern boolean container_gone(int(*)(struct obj *));
@@ -2177,13 +2178,13 @@ extern boolean can_pray(boolean);
extern int dopray(void); extern int dopray(void);
extern const char *u_gname(void); extern const char *u_gname(void);
extern int doturn(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(void);
extern const char *a_gname_at(coordxy x, coordxy y); extern const char *a_gname_at(coordxy x, coordxy y);
extern const char *align_gname(aligntyp); extern const char *align_gname(aligntyp);
extern const char *halu_gname(aligntyp); extern const char *halu_gname(aligntyp);
extern const char *align_gtitle(aligntyp); extern const char *align_gtitle(aligntyp);
extern void altar_wrath(int, int); extern void altar_wrath(coordxy, coordxy);
/* ### priest.c ### */ /* ### priest.c ### */
@@ -2260,10 +2261,10 @@ extern void assign_candy_wrapper(struct obj *);
extern int doread(void); extern int doread(void);
extern int charge_ok(struct obj *); extern int charge_ok(struct obj *);
extern void recharge(struct obj *, int); 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 int seffects(struct obj *);
extern void drop_boulder_on_player(boolean, boolean, boolean, boolean); 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 wand_explode(struct obj *, int);
extern void litroom(boolean, struct obj *); extern void litroom(boolean, struct obj *);
extern void do_genocide(int); extern void do_genocide(int);
@@ -2546,17 +2547,17 @@ extern boolean create_room(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy,
xint16); xint16);
extern boolean dig_corridor(coord *, coord *, boolean, schar, schar); extern boolean dig_corridor(coord *, coord *, boolean, schar, schar);
extern void fill_special_room(struct mkroom *); 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 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 struct selectionvar *selection_new(void);
extern void selection_free(struct selectionvar *, boolean); extern void selection_free(struct selectionvar *, boolean);
extern struct selectionvar *selection_clone(struct selectionvar *); extern struct selectionvar *selection_clone(struct selectionvar *);
extern void set_selection_floodfillchk(int(*)(int,int)); extern void set_selection_floodfillchk(int(*)(coordxy, coordxy));
extern void selection_floodfill(struct selectionvar *, int, int, boolean); extern void selection_floodfill(struct selectionvar *, coordxy, coordxy, boolean);
extern boolean pm_good_location(int, int, struct permonst *); extern boolean pm_good_location(coordxy, coordxy, struct permonst *);
extern void get_location_coord(coordxy *, coordxy *, int, struct mkroom *, long); 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 struct selectionvar * selection_not(struct selectionvar *);
extern void selection_filter_percent(struct selectionvar *, int); extern void selection_filter_percent(struct selectionvar *, int);
extern int selection_rndcoord(struct selectionvar *, coordxy *, coordxy *, extern int selection_rndcoord(struct selectionvar *, coordxy *, coordxy *,
@@ -2671,11 +2672,11 @@ extern void sysopt_seduce_set(int);
/* ### teleport.c ### */ /* ### teleport.c ### */
extern boolean noteleport_level(struct monst *); 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(coord *, coordxy, coordxy, struct permonst *);
extern boolean enexto_core(coord *, coordxy, coordxy, struct permonst *, extern boolean enexto_core(coord *, coordxy, coordxy, struct permonst *,
mmflags_nht); mmflags_nht);
extern void teleds(int, int, int); extern void teleds(coordxy, coordxy, int);
extern boolean safe_teleds(int); extern boolean safe_teleds(int);
extern boolean teleport_pet(struct monst *, boolean); extern boolean teleport_pet(struct monst *, boolean);
extern void tele(void); extern void tele(void);
@@ -2686,8 +2687,8 @@ extern void level_tele(void);
extern void domagicportal(struct trap *); extern void domagicportal(struct trap *);
extern void tele_trap(struct trap *); extern void tele_trap(struct trap *);
extern void level_tele_trap(struct trap *, unsigned); extern void level_tele_trap(struct trap *, unsigned);
extern void rloc_to(struct monst *, int, int); extern void rloc_to(struct monst *, coordxy, coordxy);
extern void rloc_to_flag(struct monst *, int, int, unsigned); extern void rloc_to_flag(struct monst *, coordxy, coordxy, unsigned);
extern boolean rloc(struct monst *, unsigned); extern boolean rloc(struct monst *, unsigned);
extern boolean tele_restrict(struct monst *); extern boolean tele_restrict(struct monst *);
extern void mtele_trap(struct monst *, struct trap *, int); extern void mtele_trap(struct monst *, struct trap *, int);
@@ -2755,7 +2756,7 @@ extern coord *gettrack(int, int);
extern boolean burnarmor(struct monst *); extern boolean burnarmor(struct monst *);
extern int erode_obj(struct obj *, const char *, int, int); extern int erode_obj(struct obj *, const char *, int, int);
extern boolean grease_protect(struct obj *, const char *, struct monst *); 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 void fall_through(boolean, unsigned);
extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *); extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *);
extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy, extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
@@ -2771,7 +2772,7 @@ extern void minstapetrify(struct monst *, boolean);
extern void selftouch(const char *); extern void selftouch(const char *);
extern void mselftouch(struct monst *, const char *, boolean); extern void mselftouch(struct monst *, const char *, boolean);
extern void float_up(void); extern void float_up(void);
extern void fill_pit(int, int); extern void fill_pit(coordxy, coordxy);
extern int float_down(long, long); extern int float_down(long, long);
extern void climb_pit(void); extern void climb_pit(void);
extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy); extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy);
@@ -2785,19 +2786,19 @@ extern void drain_en(int);
extern int dountrap(void); extern int dountrap(void);
extern int could_untrap(boolean, boolean); extern int could_untrap(boolean, boolean);
extern void cnv_trap_obj(int, int, struct trap *, 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 openholdingtrap(struct monst *, boolean *);
extern boolean closeholdingtrap(struct monst *, boolean *); extern boolean closeholdingtrap(struct monst *, boolean *);
extern boolean openfallingtrap(struct monst *, boolean, boolean *); extern boolean openfallingtrap(struct monst *, boolean, boolean *);
extern boolean chest_trap(struct obj *, int, boolean); extern boolean chest_trap(struct obj *, int, boolean);
extern void deltrap(struct trap *); extern void deltrap(struct trap *);
extern boolean delfloortrap(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 int count_traps(int);
extern void b_trapped(const char *, int); extern void b_trapped(const char *, int);
extern boolean unconscious(void); extern boolean unconscious(void);
extern void blow_up_landmine(struct trap *); 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 boolean launch_in_progress(void);
extern void force_launch_placement(void); extern void force_launch_placement(void);
extern boolean uteetering_at_seen_pit(struct trap *); extern boolean uteetering_at_seen_pit(struct trap *);
@@ -3058,8 +3059,8 @@ extern void vision_recalc(int);
extern void block_point(int, int); extern void block_point(int, int);
extern void unblock_point(int, int); extern void unblock_point(int, int);
extern boolean clear_path(int, int, int, int); extern boolean clear_path(int, int, int, int);
extern void do_clear_area(int, int, int, void(*)(int, int, void *), extern void do_clear_area(coordxy, coordxy, int,
genericptr_t); void(*)(coordxy, coordxy, void *), genericptr_t);
extern unsigned howmonseen(struct monst *); extern unsigned howmonseen(struct monst *);
#ifdef VMS #ifdef VMS
@@ -3348,8 +3349,8 @@ extern boolean obj_resists(struct obj *, int, int);
extern boolean obj_shudders(struct obj *); extern boolean obj_shudders(struct obj *);
extern void do_osshock(struct obj *); extern void do_osshock(struct obj *);
extern int bhito(struct obj *, struct obj *); extern int bhito(struct obj *, struct obj *);
extern int bhitpile(struct obj *, int(*)(struct obj *, struct obj *), int, extern int bhitpile(struct obj *, int(*)(struct obj *, struct obj *),
int, schar); coordxy, coordxy, schar);
extern int zappable(struct obj *); extern int zappable(struct obj *);
extern void do_enlightenment_effect(void); extern void do_enlightenment_effect(void);
extern void zapnodir(struct obj *); extern void zapnodir(struct obj *);
@@ -3367,12 +3368,12 @@ extern int spell_damage_bonus(int);
extern const char *exclam(int force); extern const char *exclam(int force);
extern void hit(const char *, struct monst *, const char *); extern void hit(const char *, struct monst *, const char *);
extern void miss(const char *, struct monst *); 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 monst *, struct obj *),
int(*)(struct obj *, struct obj *), 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 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 buzz(int, int, coordxy, coordxy, int, int);
extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean); extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean);
extern void melt_ice(coordxy, coordxy, const char *); extern void melt_ice(coordxy, coordxy, const char *);
+1 -1
View File
@@ -460,7 +460,7 @@ extern void X11_print_glyph(winid, coordxy, coordxy, const glyph_info *,
extern void X11_raw_print(const char *); extern void X11_raw_print(const char *);
extern void X11_raw_print_bold(const char *); extern void X11_raw_print_bold(const char *);
extern int X11_nhgetch(void); 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 void X11_nhbell(void);
extern int X11_doprev_message(void); extern int X11_doprev_message(void);
extern char X11_yn_function_core(const char *, const char *, char, unsigned); extern char X11_yn_function_core(const char *, const char *, char, unsigned);
+2 -2
View File
@@ -97,7 +97,7 @@ extern void curses_print_glyph(winid wid, coordxy x, coordxy y,
extern void curses_raw_print(const char *str); extern void curses_raw_print(const char *str);
extern void curses_raw_print_bold(const char *str); extern void curses_raw_print_bold(const char *str);
extern int curses_nhgetch(void); 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 void curses_nhbell(void);
extern int curses_doprev_message(void); extern int curses_doprev_message(void);
extern char curses_yn_function(const char *question, const char *choices, extern char curses_yn_function(const char *question, const char *choices,
@@ -174,7 +174,7 @@ extern int curses_convert_attr(int attr);
extern int curses_read_attrs(const char *attrs); extern int curses_read_attrs(const char *attrs);
extern char *curses_fmt_attrs(char *); extern char *curses_fmt_attrs(char *);
extern int curses_convert_keys(int key); 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); extern void curses_mouse_support(int);
/* cursdial.c */ /* cursdial.c */
+3 -3
View File
@@ -59,7 +59,7 @@ struct window_procs {
void (*win_raw_print)(const char *); void (*win_raw_print)(const char *);
void (*win_raw_print_bold)(const char *); void (*win_raw_print_bold)(const char *);
int (*win_nhgetch)(void); int (*win_nhgetch)(void);
int (*win_nh_poskey)(int *, int *, int *); int (*win_nh_poskey)(coordxy *, coordxy *, int *);
void (*win_nhbell)(void); void (*win_nhbell)(void);
int (*win_doprev_message)(void); int (*win_doprev_message)(void);
char (*win_yn_function)(const char *, const char *, char); char (*win_yn_function)(const char *, const char *, char);
@@ -381,7 +381,7 @@ struct chain_procs {
void (*win_raw_print)(CARGS, const char *); void (*win_raw_print)(CARGS, const char *);
void (*win_raw_print_bold)(CARGS, const char *); void (*win_raw_print_bold)(CARGS, const char *);
int (*win_nhgetch)(CARGS); int (*win_nhgetch)(CARGS);
int (*win_nh_poskey)(CARGS, int *, int *, int *); int (*win_nh_poskey)(CARGS, coordxy *, coordxy *, int *);
void (*win_nhbell)(CARGS); void (*win_nhbell)(CARGS);
int (*win_doprev_message)(CARGS); int (*win_doprev_message)(CARGS);
char (*win_yn_function) char (*win_yn_function)
@@ -457,7 +457,7 @@ extern void safe_print_glyph(winid, coordxy, coordxy,
extern void safe_raw_print(const char *); extern void safe_raw_print(const char *);
extern void safe_raw_print_bold(const char *); extern void safe_raw_print_bold(const char *);
extern int safe_nhgetch(void); 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 void safe_nhbell(void);
extern int safe_doprev_message(void); extern int safe_doprev_message(void);
extern char safe_yn_function(const char *, const char *, char); extern char safe_yn_function(const char *, const char *, char);
+1 -1
View File
@@ -254,7 +254,7 @@ E void tty_print_glyph(winid, coordxy, coordxy, const glyph_info *,
E void tty_raw_print(const char *); E void tty_raw_print(const char *);
E void tty_raw_print_bold(const char *); E void tty_raw_print_bold(const char *);
E int tty_nhgetch(void); 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 void tty_nhbell(void);
E int tty_doprev_message(void); E int tty_doprev_message(void);
E char tty_yn_function(const char *, const char *, char); E char tty_yn_function(const char *, const char *, char);
+6
View File
@@ -15,14 +15,20 @@ typedef union any {
struct obj *a_obj; struct obj *a_obj;
struct monst *a_monst; struct monst *a_monst;
int a_int; int a_int;
int a_xint16;
int a_xint8;
char a_char; char a_char;
schar a_schar; schar a_schar;
uchar a_uchar; uchar a_uchar;
unsigned int a_uint; unsigned int a_uint;
long a_long; long a_long;
unsigned long a_ulong; unsigned long a_ulong;
coordxy a_coordxy;
int *a_iptr; int *a_iptr;
xint16 *a_xint16ptr;
xint8 *a_xint8ptr;
long *a_lptr; long *a_lptr;
coordxy *a_coordxyptr;
unsigned long *a_ulptr; unsigned long *a_ulptr;
unsigned *a_uptr; unsigned *a_uptr;
const char *a_string; const char *a_string;
+23 -20
View File
@@ -7,7 +7,7 @@
static int use_camera(struct obj *); static int use_camera(struct obj *);
static int use_towel(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 int use_stethoscope(struct obj *);
static void use_whistle(struct obj *); static void use_whistle(struct obj *);
static void use_magic_whistle(struct obj *); static void use_magic_whistle(struct obj *);
@@ -39,10 +39,10 @@ static int do_break_wand(struct obj *);
static int apply_ok(struct obj *); static int apply_ok(struct obj *);
static int flip_through_book(struct obj *); static int flip_through_book(struct obj *);
static boolean figurine_location_checks(struct obj *, coord *, boolean); static boolean figurine_location_checks(struct obj *, coord *, boolean);
static boolean check_jump(genericptr_t, int, int); static boolean check_jump(genericptr_t, coordxy, coordxy);
static boolean is_valid_jump_pos(int, int, int, boolean); static boolean is_valid_jump_pos(coordxy, coordxy, int, boolean);
static boolean get_valid_jump_position(int, int); static boolean get_valid_jump_position(coordxy, coordxy);
static boolean get_valid_polearm_position(int, int); static boolean get_valid_polearm_position(coordxy, coordxy);
static boolean find_poleable_mon(coord *, int, int); static boolean find_poleable_mon(coord *, int, int);
static const char no_elbow_room[] = static const char no_elbow_room[] =
@@ -177,7 +177,7 @@ use_towel(struct obj *obj)
/* maybe give a stethoscope message based on floor objects */ /* maybe give a stethoscope message based on floor objects */
static boolean static boolean
its_dead(int rx, int ry, int *resp) its_dead(coordxy rx, coordxy ry, int *resp)
{ {
char buf[BUFSZ]; char buf[BUFSZ];
boolean more_corpses; boolean more_corpses;
@@ -302,7 +302,8 @@ use_stethoscope(struct obj *obj)
{ {
struct monst *mtmp; struct monst *mtmp;
struct rm *lev; struct rm *lev;
int rx, ry, res; int res;
coordxy rx, ry;
boolean interference = (u.uswallow && is_whirly(u.ustuck->data) boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
&& !rn2(Role_if(PM_HEALER) ? 10 : 3)); && !rn2(Role_if(PM_HEALER) ? 10 : 3));
@@ -1769,7 +1770,7 @@ enum jump_trajectory {
/* callback routine for walk_path() */ /* callback routine for walk_path() */
static boolean static boolean
check_jump(genericptr arg, int x, int y) check_jump(genericptr arg, coordxy x, coordxy y)
{ {
int traj = *(int *) arg; int traj = *(int *) arg;
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -1800,7 +1801,7 @@ check_jump(genericptr arg, int x, int y)
} }
static boolean 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) { if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
/* The Knight jumping restriction still applies when riding a /* The Knight jumping restriction still applies when riding a
@@ -1828,9 +1829,9 @@ is_valid_jump_pos(int x, int y, int magic, boolean showmsg)
passage through doorways: horizonal, vertical, or diagonal; passage through doorways: horizonal, vertical, or diagonal;
since knight's jump and other irregular directions are since knight's jump and other irregular directions are
possible, we flatten those out to simplify door checks */ possible, we flatten those out to simplify door checks */
int diag, traj, int diag, traj;
dx = x - u.ux, dy = y - u.uy, coordxy dx = x - u.ux, dy = y - u.uy,
ax = abs(dx), ay = abs(dy); ax = abs(dx), ay = abs(dy);
/* diag: any non-orthogonal destination classifed as diagonal */ /* diag: any non-orthogonal destination classifed as diagonal */
diag = (magic || Passes_walls || (!dx && !dy)) ? jAny diag = (magic || Passes_walls || (!dx && !dy)) ? jAny
@@ -1866,7 +1867,7 @@ is_valid_jump_pos(int x, int y, int magic, boolean showmsg)
} }
static boolean static boolean
get_valid_jump_position(int x, int y) get_valid_jump_position(coordxy x, coordxy y)
{ {
return (isok(x, y) return (isok(x, y)
&& (ACCESSIBLE(levl[x][y].typ) || Passes_walls) && (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
@@ -1879,12 +1880,12 @@ display_jump_positions(int state)
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x, y, dx, dy; coordxy x, y, dx, dy;
for (dx = -4; dx <= 4; dx++) for (dx = -4; dx <= 4; dx++)
for (dy = -4; dy <= 4; dy++) { for (dy = -4; dy <= 4; dy++) {
x = dx + (int) u.ux; x = dx + (coordxy) u.ux;
y = dy + (int) u.uy; y = dy + (coordxy) u.uy;
if (get_valid_jump_position(x, y)) if (get_valid_jump_position(x, y))
tmp_at(x, y); tmp_at(x, y);
} }
@@ -3143,7 +3144,8 @@ find_poleable_mon(coord *pos, int min_range, int max_range)
struct monst *mtmp; struct monst *mtmp;
coord mpos; coord mpos;
boolean impaired; 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); impaired = (Confusion || Stunned || Hallucination);
mpos.x = mpos.y = 0; /* no candidate location yet */ mpos.x = mpos.y = 0; /* no candidate location yet */
@@ -3176,7 +3178,7 @@ find_poleable_mon(coord *pos, int min_range, int max_range)
} }
static boolean static boolean
get_valid_polearm_position(int x, int y) get_valid_polearm_position(coordxy x, coordxy y)
{ {
int glyph; int glyph;
@@ -3194,7 +3196,7 @@ display_polearm_positions(int state)
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x, y, dx, dy; coordxy x, y, dx, dy;
for (dx = -4; dx <= 4; dx++) for (dx = -4; dx <= 4; dx++)
for (dy = -4; dy <= 4; dy++) { for (dy = -4; dy <= 4; dy++) {
@@ -3622,7 +3624,8 @@ static int
do_break_wand(struct obj *obj) do_break_wand(struct obj *obj)
{ {
static const char nothing_else_happens[] = "But nothing else happens..."; 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; register struct monst *mon;
int dmg, damage; int dmg, damage;
boolean affects_objects; boolean affects_objects;
+4 -3
View File
@@ -27,7 +27,7 @@ static unsigned long abil_to_spfx(long *);
static uchar abil_to_adtyp(long *); static uchar abil_to_adtyp(long *);
static int glow_strength(int); static int glow_strength(int);
static boolean untouchable(struct obj *, boolean); 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 /* The amount added to the victim's total hit points to insure that the
victim will be killed even after damage bonus/penalty adjustments. victim will be killed even after damage bonus/penalty adjustments.
@@ -2347,12 +2347,13 @@ retouch_equipment(int dropflag) /* 0==don't drop, 1==drop all, 2==drop weapon */
} }
static int static int
count_surround_traps(int x, int y) count_surround_traps(coordxy x, coordxy y)
{ {
struct rm *levp; struct rm *levp;
struct obj *otmp; struct obj *otmp;
struct trap *ttmp; 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 (dx = x - 1; dx < x + 2; ++dx)
for (dy = y - 1; dy < y + 2; ++dy) { for (dy = y - 1; dy < y + 2; ++dy) {
+4 -4
View File
@@ -8,7 +8,7 @@
static boolean no_bones_level(d_level *); static boolean no_bones_level(d_level *);
static void goodfruit(int); static void goodfruit(int);
static void resetobjs(struct obj *, boolean); 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 boolean fixuporacle(struct monst *);
static void remove_mon_from_bones(struct monst *); static void remove_mon_from_bones(struct monst *);
@@ -220,7 +220,7 @@ sanitize_name(char *namebuf)
but skipping hero's location. but skipping hero's location.
If no such monster, place object on floor at x,y. */ If no such monster, place object on floor at x,y. */
static void 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 *mtmp;
struct monst *selected = (struct monst *) 0; struct monst *selected = (struct monst *) 0;
@@ -256,7 +256,7 @@ void
drop_upon_death( drop_upon_death(
struct monst *mtmp, /* monster if hero rises as one (non ghost) */ struct monst *mtmp, /* monster if hero rises as one (non ghost) */
struct obj *cont, /* container if hero is turned into a statue */ struct obj *cont, /* container if hero is turned into a statue */
int x, int y) coordxy x, coordxy y)
{ {
struct obj *otmp; struct obj *otmp;
@@ -399,7 +399,7 @@ remove_mon_from_bones(struct monst *mtmp)
void void
savebones(int how, time_t when, struct obj *corpse) savebones(int how, time_t when, struct obj *corpse)
{ {
int x, y; coordxy x, y;
struct trap *ttmp; struct trap *ttmp;
struct monst *mtmp; struct monst *mtmp;
struct fruit *f; struct fruit *f;
+24 -20
View File
@@ -151,9 +151,9 @@ static boolean accept_menu_prefix(const struct ext_func_tab *);
static void reset_cmd_vars(boolean); static void reset_cmd_vars(boolean);
static void mcmd_addmenu(winid, int, const char *); static void mcmd_addmenu(winid, int, const char *);
static char here_cmd_menu(void); static char here_cmd_menu(void);
static char there_cmd_menu(int, int, int); static char there_cmd_menu(coordxy, coordxy, int);
static void act_on_act(int, int, int); static void act_on_act(int, coordxy, coordxy);
static char readchar_core(int *, int *, int *); static char readchar_core(coordxy *, coordxy *, int *);
static char *parse(void); static char *parse(void);
static void show_direction_keys(winid, char, boolean); static void show_direction_keys(winid, char, boolean);
static boolean help_dir(char, uchar, const char *); static boolean help_dir(char, uchar, const char *);
@@ -1450,7 +1450,8 @@ static int
wiz_show_seenv(void) wiz_show_seenv(void)
{ {
winid win; winid win;
int x, y, v, startx, stopx, curx; coordxy x, y, startx, stopx, curx;
int v;
char row[COLNO + 1]; char row[COLNO + 1];
win = create_nhwindow(NHW_TEXT); win = create_nhwindow(NHW_TEXT);
@@ -1494,7 +1495,8 @@ static int
wiz_show_vision(void) wiz_show_vision(void)
{ {
winid win; winid win;
int x, y, v; coordxy x, y;
int v;
char row[COLNO + 1]; char row[COLNO + 1];
win = create_nhwindow(NHW_TEXT); win = create_nhwindow(NHW_TEXT);
@@ -1529,7 +1531,7 @@ static int
wiz_show_wmodes(void) wiz_show_wmodes(void)
{ {
winid win; winid win;
int x, y; coordxy x, y;
char row[COLNO + 1]; char row[COLNO + 1];
struct rm *lev; struct rm *lev;
boolean istty = WINDOWPORT(tty); boolean istty = WINDOWPORT(tty);
@@ -1565,7 +1567,8 @@ static void
wiz_map_levltyp(void) wiz_map_levltyp(void)
{ {
winid win; winid win;
int x, y, terrain; coordxy x, y;
int terrain;
char row[COLNO + 1]; char row[COLNO + 1];
boolean istty = !strcmp(windowprocs.name, "tty"); boolean istty = !strcmp(windowprocs.name, "tty");
@@ -4299,8 +4302,8 @@ rhack(char *cmd)
} }
/* convert an x,y pair into a direction code */ /* convert an x,y pair into a direction code */
int coordxy
xytod(schar x, schar y) xytod(coordxy x, coordxy y)
{ {
register int dd; register int dd;
@@ -4718,7 +4721,7 @@ help_dir(
void void
confdir(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.dx = xdir[x];
u.dy = ydir[x]; u.dy = ydir[x];
@@ -4739,7 +4742,7 @@ directionname(int dir)
} }
int 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. %% */ /* x corresponds to curx, so x==1 is the first column. Ach. %% */
return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1; return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1;
@@ -4828,7 +4831,7 @@ mcmd_addmenu(winid win, int act, const char *txt)
/* command menu entries when targeting self */ /* command menu entries when targeting self */
static int 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; int K = 0;
char buf[BUFSZ]; char buf[BUFSZ];
@@ -4916,7 +4919,7 @@ there_cmd_menu_self(winid win, int x, int y, int *act UNUSED)
static int static int
there_cmd_menu_next2u( there_cmd_menu_next2u(
winid win, winid win,
int x, int y, coordxy x, coordxy y,
int mod, int mod,
int *act) int *act)
{ {
@@ -5041,7 +5044,7 @@ there_cmd_menu_common(
static void static void
act_on_act( act_on_act(
int act, /* action */ 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; struct obj *otmp;
int dir; int dir;
@@ -5205,14 +5208,14 @@ act_on_act(
/* offer choice of actions to perform at adjacent location <x,y> */ /* offer choice of actions to perform at adjacent location <x,y> */
static char static char
there_cmd_menu(int x, int y, int mod) there_cmd_menu(coordxy x, coordxy y, int mod)
{ {
winid win; winid win;
char ch = '\0'; char ch = '\0';
int npick = 0, K = 0; int npick = 0, K = 0;
menu_item *picks = (menu_item *) 0; menu_item *picks = (menu_item *) 0;
/*int dx = sgn(x - u.ux), dy = sgn(y - u.uy);*/ /*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; int act = MCMD_NOTHING;
win = create_nhwindow(NHW_MENU); win = create_nhwindow(NHW_MENU);
@@ -5271,7 +5274,7 @@ here_cmd_menu(void)
* convert a MAP window position into a movement key usable with movecmd() * convert a MAP window position into a movement key usable with movecmd()
*/ */
const char * const char *
click_to_cmd(int x, int y, int mod) click_to_cmd(coordxy x, coordxy y, int mod)
{ {
static char cmd[4]; static char cmd[4];
struct obj *o; struct obj *o;
@@ -5573,7 +5576,7 @@ end_of_input(void)
#endif /* HANGUPHANDLING */ #endif /* HANGUPHANDLING */
static char static char
readchar_core(int *x, int *y, int *mod) readchar_core(coordxy *x, coordxy *y, int *mod)
{ {
register int sym; register int sym;
@@ -5632,14 +5635,15 @@ char
readchar(void) readchar(void)
{ {
char ch; 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); ch = readchar_core(&x, &y, &mod);
return ch; return ch;
} }
char char
readchar_poskey(int *x, int *y, int *mod) readchar_poskey(coordxy *x, coordxy *y, int *mod)
{ {
char ch; char ch;
+29 -27
View File
@@ -19,14 +19,14 @@
#include "hack.h" #include "hack.h"
static void get_wall_for_db(int *, int *); static void get_wall_for_db(coordxy *, coordxy *);
static struct entity *e_at(int, int); static struct entity *e_at(coordxy, coordxy);
static void m_to_e(struct monst *, int, int, struct entity *); static void m_to_e(struct monst *, coordxy, coordxy, struct entity *);
static void u_to_e(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_nam(struct entity *);
static const char *E_phrase(struct entity *, const char *); 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 void e_died(struct entity *, int, int);
static boolean automiss(struct entity *); static boolean automiss(struct entity *);
static boolean e_missed(struct entity *, boolean); static boolean e_missed(struct entity *, boolean);
@@ -42,7 +42,7 @@ is_waterwall(coordxy x, coordxy y)
} }
boolean boolean
is_pool(int x, int y) is_pool(coordxy x, coordxy y)
{ {
schar ltyp; schar ltyp;
@@ -58,7 +58,7 @@ is_pool(int x, int y)
} }
boolean boolean
is_lava(int x, int y) is_lava(coordxy x, coordxy y)
{ {
schar ltyp; schar ltyp;
@@ -73,7 +73,7 @@ is_lava(int x, int y)
} }
boolean 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)) if (is_pool(x, y) || is_lava(x, y))
return TRUE; return TRUE;
@@ -82,7 +82,7 @@ is_pool_or_lava(int x, int y)
} }
boolean boolean
is_ice(int x, int y) is_ice(coordxy x, coordxy y)
{ {
schar ltyp; schar ltyp;
@@ -96,7 +96,7 @@ is_ice(int x, int y)
} }
boolean boolean
is_moat(int x, int y) is_moat(coordxy x, coordxy y)
{ {
schar ltyp; schar ltyp;
@@ -134,7 +134,7 @@ db_under_typ(int mask)
*/ */
int int
is_drawbridge_wall(int x, int y) is_drawbridge_wall(coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
@@ -164,7 +164,7 @@ is_drawbridge_wall(int x, int y)
* (instead of UP or DOWN, as with is_drawbridge_wall). * (instead of UP or DOWN, as with is_drawbridge_wall).
*/ */
boolean boolean
is_db_wall(int x, int y) is_db_wall(coordxy x, coordxy y)
{ {
return (boolean) (levl[x][y].typ == DBWALL); return (boolean) (levl[x][y].typ == DBWALL);
} }
@@ -174,7 +174,7 @@ is_db_wall(int x, int y)
* a drawbridge or drawbridge wall. * a drawbridge or drawbridge wall.
*/ */
boolean boolean
find_drawbridge(int *x, int *y) find_drawbridge(coordxy *x, coordxy *y)
{ {
int dir; int dir;
@@ -205,7 +205,7 @@ find_drawbridge(int *x, int *y)
* Find the drawbridge wall associated with a drawbridge. * Find the drawbridge wall associated with a drawbridge.
*/ */
static void 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) { switch (levl[*x][*y].drawbridgemask & DB_DIR) {
case DB_NORTH: case DB_NORTH:
@@ -229,9 +229,9 @@ get_wall_for_db(int *x, int *y)
* flag must be put to TRUE if we want the drawbridge to be opened. * flag must be put to TRUE if we want the drawbridge to be opened.
*/ */
boolean 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 horiz;
boolean lava = levl[x][y].typ == LAVAPOOL; /* assume initialized map */ boolean lava = levl[x][y].typ == LAVAPOOL; /* assume initialized map */
@@ -279,7 +279,7 @@ create_drawbridge(int x, int y, int dir, boolean flag)
} }
static struct entity * static struct entity *
e_at(int x, int y) e_at(coordxy x, coordxy y)
{ {
int entitycnt; int entitycnt;
@@ -296,7 +296,7 @@ e_at(int x, int y)
} }
static void 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; etmp->emon = mtmp;
if (mtmp) { if (mtmp) {
@@ -320,7 +320,7 @@ u_to_e(struct entity *etmp)
} }
static void 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)) if (u_at(x, y))
u_to_e(etmp); u_to_e(etmp);
@@ -371,7 +371,7 @@ E_phrase(struct entity *etmp, const char *verb)
* Simple-minded "can it be here?" routine * Simple-minded "can it be here?" routine
*/ */
static boolean 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)) if (noncorporeal(etmp->edata))
return TRUE; return TRUE;
@@ -525,7 +525,8 @@ e_jumps(struct entity *etmp)
static void static void
do_entity(struct entity *etmp) 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; boolean must_jump = FALSE, relocates = FALSE, e_inview;
struct rm *crm; struct rm *crm;
@@ -732,11 +733,11 @@ do_entity(struct entity *etmp)
* Close the drawbridge located at x,y * Close the drawbridge located at x,y
*/ */
void void
close_drawbridge(int x, int y) close_drawbridge(coordxy x, coordxy y)
{ {
register struct rm *lev1, *lev2; register struct rm *lev1, *lev2;
struct trap *t; struct trap *t;
int x2, y2; coordxy x2, y2;
lev1 = &levl[x][y]; lev1 = &levl[x][y];
if (lev1->typ != DRAWBRIDGE_DOWN) if (lev1->typ != DRAWBRIDGE_DOWN)
@@ -793,11 +794,11 @@ close_drawbridge(int x, int y)
* Open the drawbridge located at x,y * Open the drawbridge located at x,y
*/ */
void void
open_drawbridge(int x, int y) open_drawbridge(coordxy x, coordxy y)
{ {
register struct rm *lev1, *lev2; register struct rm *lev1, *lev2;
struct trap *t; struct trap *t;
int x2, y2; coordxy x2, y2;
lev1 = &levl[x][y]; lev1 = &levl[x][y];
if (lev1->typ != DRAWBRIDGE_UP) if (lev1->typ != DRAWBRIDGE_UP)
@@ -839,12 +840,13 @@ open_drawbridge(int x, int y)
* Let's destroy the drawbridge located at x,y * Let's destroy the drawbridge located at x,y
*/ */
void void
destroy_drawbridge(int x, int y) destroy_drawbridge(coordxy x, coordxy y)
{ {
register struct rm *lev1, *lev2; register struct rm *lev1, *lev2;
struct trap *t; struct trap *t;
struct obj *otmp; struct obj *otmp;
int x2, y2, i; coordxy x2, y2;
int i;
boolean e_inview; boolean e_inview;
struct entity *etmp1 = &(g.occupants[0]), *etmp2 = &(g.occupants[1]); struct entity *etmp1 = &(g.occupants[0]), *etmp2 = &(g.occupants[1]);
+24 -21
View File
@@ -17,17 +17,17 @@ static void map_redisplay(void);
static void browse_map(int, const char *); static void browse_map(int, const char *);
static void map_monst(struct monst *, boolean); static void map_monst(struct monst *, boolean);
static void do_dknown_of(struct obj *); 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 boolean clear_stale_map(char, unsigned);
static void sense_trap(struct trap *, coordxy, coordxy, int); static void sense_trap(struct trap *, coordxy, coordxy, int);
static int detect_obj_traps(struct obj *, boolean, int); static int detect_obj_traps(struct obj *, boolean, int);
static void display_trap_map(struct trap *, int); static void display_trap_map(struct trap *, int);
static int furniture_detect(void); static int furniture_detect(void);
static void show_map_spot(int, int); static void show_map_spot(coordxy, coordxy);
static void findone(int, int, genericptr_t); static void findone(coordxy, coordxy, genericptr_t);
static void openone(int, int, genericptr_t); static void openone(coordxy, coordxy, genericptr_t);
static int mfind0(struct monst *, boolean); 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 /* dummytrap: used when detecting traps finds a door or chest trap; the
couple of fields that matter are always re-initialized during use so couple of fields that matter are always re-initialized during use so
@@ -111,7 +111,7 @@ map_monst(struct monst *mtmp, boolean showtail)
/* this is checking whether a trap symbol represents a trapped chest, /* this is checking whether a trap symbol represents a trapped chest,
not whether a trapped chest is actually present */ not whether a trapped chest is actually present */
boolean boolean
trapped_chest_at(int ttyp, int x, int y) trapped_chest_at(int ttyp, coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
struct obj *otmp; struct obj *otmp;
@@ -154,7 +154,7 @@ trapped_chest_at(int ttyp, int x, int y)
/* this is checking whether a trap symbol represents a trapped door, /* this is checking whether a trap symbol represents a trapped door,
not whether the door here is actually trapped */ not whether the door here is actually trapped */
boolean boolean
trapped_door_at(int ttyp, int x, int y) trapped_door_at(int ttyp, coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
@@ -234,7 +234,7 @@ do_dknown_of(struct obj *obj)
/* Check whether the location has an outdated object displayed on it. */ /* Check whether the location has an outdated object displayed on it. */
static boolean 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; int glyph;
register struct obj *otmp; register struct obj *otmp;
@@ -290,7 +290,7 @@ check_map_spot(int x, int y, char oclass, unsigned material)
static boolean static boolean
clear_stale_map(char oclass, unsigned material) clear_stale_map(char oclass, unsigned material)
{ {
register int zx, zy; register coordxy zx, zy;
boolean change_made = FALSE; boolean change_made = FALSE;
for (zx = 1; zx < COLNO; zx++) for (zx = 1; zx < COLNO; zx++)
@@ -578,7 +578,7 @@ int
object_detect(struct obj *detector, /* object doing the detecting */ object_detect(struct obj *detector, /* object doing the detecting */
int class) /* an object class, 0 for all */ int class) /* an object class, 0 for all */
{ {
register int x, y; register coordxy x, y;
char stuff[BUFSZ]; char stuff[BUFSZ];
int is_cursed = (detector && detector->cursed); int is_cursed = (detector && detector->cursed);
int do_dknown = (detector && (detector->oclass == POTION_CLASS int do_dknown = (detector && (detector->oclass == POTION_CLASS
@@ -1045,7 +1045,8 @@ static int
furniture_detect(void) furniture_detect(void)
{ {
struct monst *mon; 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(); (void) unconstrain_map();
@@ -1312,7 +1313,7 @@ use_crystal_ball(struct obj **optr)
} }
static void static void
show_map_spot(int x, int y) show_map_spot(coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
struct trap *t; struct trap *t;
@@ -1541,7 +1542,7 @@ cvt_sdoor_to_door(struct rm *lev)
/* find something at one location; it should find all somethings there /* find something at one location; it should find all somethings there
since it is used for magical detection rather than physical searching */ since it is used for magical detection rather than physical searching */
static void static void
findone(int zx, int zy, genericptr_t num) findone(coordxy zx, coordxy zy, genericptr_t num)
{ {
register struct trap *ttmp; register struct trap *ttmp;
register struct monst *mtmp; register struct monst *mtmp;
@@ -1595,7 +1596,7 @@ findone(int zx, int zy, genericptr_t num)
} }
static void static void
openone(int zx, int zy, genericptr_t num) openone(coordxy zx, coordxy zy, genericptr_t num)
{ {
register struct trap *ttmp; register struct trap *ttmp;
register struct obj *otmp; register struct obj *otmp;
@@ -1691,7 +1692,7 @@ openit(void)
/* callback hack for overriding vision in do_clear_area() */ /* callback hack for overriding vision in do_clear_area() */
boolean boolean
detecting(void (*func)(int, int, genericptr_t)) detecting(void (*func)(coordxy, coordxy, genericptr_t))
{ {
return (func == findone || func == openone); return (func == findone || func == openone);
} }
@@ -1728,7 +1729,7 @@ find_trap(struct trap *trap)
static int static int
mfind0(struct monst *mtmp, boolean via_warning) 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; boolean found_something = FALSE;
if (via_warning && !warning_of(mtmp)) if (via_warning && !warning_of(mtmp))
@@ -1864,7 +1865,7 @@ dosearch(void)
void void
warnreveal(void) warnreveal(void)
{ {
int x, y; coordxy x, y;
struct monst *mtmp; struct monst *mtmp;
for (x = u.ux - 1; x <= u.ux + 1; x++) for (x = u.ux - 1; x <= u.ux + 1; x++)
@@ -1881,7 +1882,7 @@ warnreveal(void)
void void
sokoban_detect(void) sokoban_detect(void)
{ {
register int x, y; register coordxy x, y;
register struct trap *ttmp; register struct trap *ttmp;
register struct obj *obj; register struct obj *obj;
@@ -1908,7 +1909,7 @@ sokoban_detect(void)
} }
static int 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 default_glyph, int which_subset)
{ {
int glyph, levl_glyph; int glyph, levl_glyph;
@@ -1989,7 +1990,8 @@ reveal_terrain_getglyph(int x, int y, int full, unsigned swallowed,
void void
dump_map(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 subset = TER_MAP | TER_TRP | TER_OBJ | TER_MON;
int default_glyph = cmap_to_glyph(g.level.flags.arboreal ? S_tree int default_glyph = cmap_to_glyph(g.level.flags.arboreal ? S_tree
: S_stone); : S_stone);
@@ -2052,7 +2054,8 @@ reveal_terrain(
if ((Hallucination || Stunned || Confusion) && !full) { if ((Hallucination || Stunned || Confusion) && !full) {
You("are too disoriented for this."); You("are too disoriented for this.");
} else { } else {
int x, y, glyph, default_glyph; coordxy x, y;
int glyph, default_glyph;
char buf[BUFSZ]; char buf[BUFSZ];
/* there is a TER_MAP bit too; we always show map regardless of it */ /* there is a TER_MAP bit too; we always show map regardless of it */
boolean keep_traps = (which_subset & TER_TRP) !=0, boolean keep_traps = (which_subset & TER_TRP) !=0,
+14 -13
View File
@@ -13,7 +13,7 @@ static void dig_up_grave(coord *);
static boolean watchman_canseeu(struct monst *); static boolean watchman_canseeu(struct monst *);
static int adj_pit_checks(coord *, char *); static int adj_pit_checks(coord *, char *);
static void pit_flow(struct trap *, schar); 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() */ /* Indices returned by dig_typ() */
enum dig_types { enum dig_types {
@@ -173,7 +173,7 @@ is_digging(void)
#define BY_OBJECT ((struct monst *) 0) #define BY_OBJECT ((struct monst *) 0)
boolean 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); struct trap *ttmp = t_at(x, y);
const char *verb = const char *verb =
@@ -483,7 +483,7 @@ dig(void)
} }
static boolean 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]; struct rm *lev = &levl[x][y];
@@ -495,7 +495,7 @@ furniture_handled(int x, int y, boolean madeby_u)
breaksink(x, y); breaksink(x, y);
} else if (lev->typ == DRAWBRIDGE_DOWN } else if (lev->typ == DRAWBRIDGE_DOWN
|| (is_drawbridge_wall(x, y) >= 0)) { || (is_drawbridge_wall(x, y) >= 0)) {
int bx = x, by = y; coordxy bx = x, by = y;
/* if under the portcullis, the bridge is adjacent */ /* if under the portcullis, the bridge is adjacent */
(void) find_drawbridge(&bx, &by); (void) find_drawbridge(&bx, &by);
@@ -518,12 +518,12 @@ holetime(void)
/* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */ /* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */
schar schar
fillholetyp(int x, int y, fillholetyp(coordxy x, coordxy y,
boolean fill_if_any) /* force filling if it exists at all */ boolean fill_if_any) /* force filling if it exists at all */
{ {
register int x1, y1; coordxy x1, y1;
int lo_x = max(1, x - 1), hi_x = min(x + 1, COLNO - 1), 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); lo_y = max(0, y - 1), hi_y = min(y + 1, ROWNO - 1);
int pool_cnt = 0, moat_cnt = 0, lava_cnt = 0; int pool_cnt = 0, moat_cnt = 0, lava_cnt = 0;
for (x1 = lo_x; x1 <= hi_x; x1++) for (x1 = lo_x; x1 <= hi_x; x1++)
@@ -552,7 +552,7 @@ fillholetyp(int x, int y,
} }
void 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; struct obj *oldobjs, *newobjs;
register struct trap *ttmp; register struct trap *ttmp;
@@ -810,7 +810,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
if (pit_only) { if (pit_only) {
pline_The("drawbridge seems too hard to dig through."); pline_The("drawbridge seems too hard to dig through.");
} else { } else {
int x = dig_x, y = dig_y; coordxy x = dig_x, y = dig_y;
/* if under the portcullis, the bridge is adjacent */ /* if under the portcullis, the bridge is adjacent */
(void) find_drawbridge(&x, &y); (void) find_drawbridge(&x, &y);
destroy_drawbridge(x, y); destroy_drawbridge(x, y);
@@ -1029,7 +1029,7 @@ use_pick_axe(struct obj *obj)
int int
use_pick_axe2(struct obj *obj) use_pick_axe2(struct obj *obj)
{ {
register int rx, ry; coordxy rx, ry;
register struct rm *lev; register struct rm *lev;
struct trap *trap, *trap_with_u; struct trap *trap, *trap_with_u;
int dig_target; int dig_target;
@@ -1394,7 +1394,8 @@ zap_dig(void)
struct monst *mtmp; struct monst *mtmp;
struct obj *otmp; struct obj *otmp;
struct trap *trap_with_u = (struct trap *) 0; 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; boolean shopdoor, shopwall, maze_dig, pitdig = FALSE, pitflow = FALSE;
/* /*
@@ -1702,7 +1703,7 @@ pit_flow(struct trap *trap, schar filltyp)
: (char *) 0); : (char *) 0);
for (idx = 0; idx < N_DIRS; ++idx) { for (idx = 0; idx < N_DIRS; ++idx) {
if (t.conjoined & (1 << idx)) { if (t.conjoined & (1 << idx)) {
int x, y; coordxy x, y;
struct trap *t2; struct trap *t2;
x = t.tx + xdir[idx]; x = t.tx + xdir[idx];
+55 -55
View File
@@ -123,14 +123,14 @@
*/ */
#include "hack.h" #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 void display_monster(coordxy, coordxy, struct monst *, int, boolean);
static int swallow_to_glyph(int, int); static int swallow_to_glyph(int, int);
static void display_warning(struct monst *); 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 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 *); static void mimic_light_blocking(struct monst *);
#ifdef UNBUFFERED_GLYPHINFO #ifdef UNBUFFERED_GLYPHINFO
static glyph_info *glyphinfo_at(coordxy, coordxy, int); static glyph_info *glyphinfo_at(coordxy, coordxy, int);
@@ -138,14 +138,14 @@ static glyph_info *glyphinfo_at(coordxy, coordxy, int);
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */ /*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
static boolean more_than_one(int, int, int, int, int); static boolean more_than_one(coordxy, coordxy, coordxy, coordxy, coordxy);
#endif #endif
static int set_twall(int, int, int, int, int, int, int, int); static int set_twall(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
static int set_wall(int, int, int); static int set_wall(coordxy, coordxy, int);
static int set_corn(int, int, int, int, int, int, int, int); static int set_corn(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
static int set_crosswall(int, int); static int set_crosswall(coordxy, coordxy);
static void set_seenv(struct rm *, int, int, int, int); static void set_seenv(struct rm *, coordxy, coordxy, coordxy, coordxy);
static void t_warn(struct rm *); static void t_warn(struct rm *);
static int wall_angle(struct rm *); static int wall_angle(struct rm *);
@@ -266,9 +266,6 @@ magic_map_background(coordxy x, coordxy y, int show)
* having to create fake objects and traps. However, I am reluctant to * having to create fake objects and traps. However, I am reluctant to
* make this change. * make this change.
*/ */
/* FIXME: some of these use coordxys for x and y, and some use ints. Make
* this consistent.
*/
/* /*
* map_background() * map_background()
@@ -296,7 +293,7 @@ map_background(register coordxy x, register coordxy y, register int show)
void void
map_trap(register struct trap *trap, register int show) 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); register int glyph = trap_to_glyph(trap);
if (g.level.flags.hero_memory) if (g.level.flags.hero_memory)
@@ -314,7 +311,7 @@ map_trap(register struct trap *trap, register int show)
void void
map_object(register struct obj *obj, register int show) 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); register int glyph = obj_to_glyph(obj, newsym_rn2);
if (g.level.flags.hero_memory) { if (g.level.flags.hero_memory) {
@@ -351,7 +348,7 @@ map_invisible(register coordxy x, register coordxy y)
} }
boolean boolean
unmap_invisible(int x, int y) unmap_invisible(coordxy x, coordxy y)
{ {
if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) { if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y); unmap_object(x, y);
@@ -372,7 +369,7 @@ unmap_invisible(int x, int y)
* to call newsym(). * to call newsym().
*/ */
void void
unmap_object(register int x, register int y) unmap_object(register coordxy x, register coordxy y)
{ {
register struct trap *trap; register struct trap *trap;
@@ -419,14 +416,14 @@ unmap_object(register int x, register int y)
} }
void void
map_location(int x, int y, int show) map_location(coordxy x, coordxy y, int show)
{ {
_map_location(x, y, show); _map_location(x, y, show);
} }
/* display something on monster layer; may need to fixup object layer */ /* display something on monster layer; may need to fixup object layer */
static void 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; struct obj *o;
@@ -577,7 +574,7 @@ display_monster(coordxy x, coordxy y, /* display position */
static void static void
display_warning(struct monst *mon) display_warning(struct monst *mon)
{ {
int x = mon->mx, y = mon->my; coordxy x = mon->mx, y = mon->my;
int glyph; int glyph;
if (mon_warning(mon)) { if (mon_warning(mon)) {
@@ -814,7 +811,7 @@ feel_location(coordxy x, coordxy y)
* Possibly put a new glyph at the given location. * Possibly put a new glyph at the given location.
*/ */
void void
newsym(register int x, register int y) newsym(coordxy x, coordxy y)
{ {
struct monst *mon; struct monst *mon;
int see_it; int see_it;
@@ -995,7 +992,7 @@ shieldeff(coordxy x, coordxy y)
} }
static int static int
tether_glyph(int x, int y) tether_glyph(coordxy x, coordxy y)
{ {
int tdx, tdy; int tdx, tdy;
tdx = u.ux - x; tdx = u.ux - x;
@@ -1040,7 +1037,7 @@ static struct tmp_glyph {
} tgfirst; } tgfirst;
void void
tmp_at(int x, int y) tmp_at(coordxy x, coordxy y)
{ {
static struct tmp_glyph *tglyph = (struct tmp_glyph *) 0; static struct tmp_glyph *tglyph = (struct tmp_glyph *) 0;
struct tmp_glyph *tmp; struct tmp_glyph *tmp;
@@ -1169,7 +1166,7 @@ tmp_at(int x, int y)
* meant to be at the location. * meant to be at the location.
*/ */
void 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]; int i, glyph[2];
@@ -1205,7 +1202,7 @@ swallowed(int first)
cls(); cls();
bot(); bot();
} else { } else {
register int x, y; coordxy x, y;
/* Clear old location */ /* Clear old location */
for (y = lasty - 1; y <= lasty + 1; y++) for (y = lasty - 1; y <= lasty + 1; y++)
@@ -1263,7 +1260,7 @@ under_water(int mode)
{ {
static coordxy lastx, lasty; static coordxy lastx, lasty;
static boolean dela; static boolean dela;
register int x, y; coordxy x, y;
/* swallowing has a higher precedence than under water */ /* swallowing has a higher precedence than under water */
if (Is_waterlevel(&u.uz) || u.uswallow) if (Is_waterlevel(&u.uz) || u.uswallow)
@@ -1504,7 +1501,7 @@ doredraw(void)
void void
docrt(void) docrt(void)
{ {
register int x, y; coordxy x, y;
register struct rm *lev; register struct rm *lev;
if (!u.ux || g.program_state.in_docrt) if (!u.ux || g.program_state.in_docrt)
@@ -1562,7 +1559,8 @@ docrt(void)
void void
redraw_map(void) redraw_map(void)
{ {
int x, y, glyph; coordxy x, y;
int glyph;
glyph_info bkglyphinfo = nul_glyphinfo; glyph_info bkglyphinfo = nul_glyphinfo;
/* /*
@@ -1633,7 +1631,7 @@ reglyph_darkroom(void)
* between object piles and single objects, it doesn't mark the location * between object piles and single objects, it doesn't mark the location
* for update. */ * for update. */
void void
newsym_force(int x, int y) newsym_force(coordxy x, coordxy y)
{ {
newsym(x, y); newsym(x, y);
g.gbuf[y][x].gnew = 1; g.gbuf[y][x].gnew = 1;
@@ -1647,7 +1645,7 @@ newsym_force(int x, int y)
* Store the glyph in the 3rd screen for later flushing. * Store the glyph in the 3rd screen for later flushing.
*/ */
void void
show_glyph(int x, int y, int glyph) show_glyph(coordxy x, coordxy y, int glyph)
{ {
#ifndef UNBUFFERED_GLYPHINFO #ifndef UNBUFFERED_GLYPHINFO
glyph_info glyphinfo; glyph_info glyphinfo;
@@ -1826,7 +1824,7 @@ static gbuf_entry nul_gbuf = {
void void
clear_glyph_buffer(void) clear_glyph_buffer(void)
{ {
register int x, y; register coordxy x, y;
gbuf_entry *gptr = &g.gbuf[0][0]; gbuf_entry *gptr = &g.gbuf[0][0];
glyph_info *giptr = glyph_info *giptr =
#ifndef UNBUFFERED_GLYPHINFO #ifndef UNBUFFERED_GLYPHINFO
@@ -1861,9 +1859,10 @@ clear_glyph_buffer(void)
/* used by tty after menu or text popup has temporarily overwritten the map /* 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 */ and it has been erased so shows spaces, not necessarily S_unexplored */
void 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; register boolean force;
gbuf_entry *gptr = &g.gbuf[0][0]; gbuf_entry *gptr = &g.gbuf[0][0];
glyph_info bkglyphinfo = nul_glyphinfo; glyph_info bkglyphinfo = nul_glyphinfo;
@@ -1924,7 +1923,7 @@ flush_screen(int cursor_on_u)
*/ */
static int flushing = 0; static int flushing = 0;
static int delay_flushing = 0; static int delay_flushing = 0;
register int x, y; register coordxy x, y;
glyph_info bkglyphinfo = nul_glyphinfo; glyph_info bkglyphinfo = nul_glyphinfo;
/* 3.7: don't update map, status, or perm_invent during save/restore */ /* 3.7: don't update map, status, or perm_invent during save/restore */
@@ -2784,7 +2783,7 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
static const char *type_to_name(int); 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 int bad_count[MAX_TYPE]; /* count of positions flagged as bad */
static const char *const type_names[MAX_TYPE] = { static const char *const type_names[MAX_TYPE] = {
@@ -2803,7 +2802,7 @@ type_to_name(int type)
} }
static void 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", pline("set_wall_state: %s @ (%d,%d) %s%s%s%s",
type_to_name(levl[x][y].typ), x, y, type_to_name(levl[x][y].typ), x, y,
@@ -2819,7 +2818,7 @@ error4(int x, int y, int a, int b, int c, int dd)
* Things that are ambiguous: lava * Things that are ambiguous: lava
*/ */
static int static int
check_pos(int x, int y, int which) check_pos(coordxy x, coordxy y, int which)
{ {
int type; int type;
@@ -2835,7 +2834,7 @@ check_pos(int x, int y, int which)
/*ARGSUSED*/ /*ARGSUSED*/
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
static boolean 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))) { if ((a && (b | c)) || (b && (a | c)) || (c && (a | b))) {
error4(x, y, a, b, c, 0); error4(x, y, a, b, c, 0);
@@ -2852,11 +2851,11 @@ more_than_one(int x, int y, int a, int b, int c)
static int static int
set_twall( set_twall(
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
int x0, int y0, /* used #if WA_VERBOSE */ coordxy x0, coordxy y0, /* used #if WA_VERBOSE */
#else #else
int x0 UNUSED, int y0 UNUSED, coordxy x0 UNUSED, coordxy y0 UNUSED,
#endif #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; int wmode, is_1, is_2, is_3;
@@ -2873,7 +2872,7 @@ set_twall(
/* Return wall mode for a horizontal or vertical wall. */ /* Return wall mode for a horizontal or vertical wall. */
static int static int
set_wall(int x, int y, int horiz) set_wall(coordxy x, coordxy y, int horiz)
{ {
int wmode, is_1, is_2; int wmode, is_1, is_2;
@@ -2894,9 +2893,9 @@ set_wall(int x, int y, int horiz)
/* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */ /* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */
static int 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_1 = check_pos(x1, y1, 1);
is_2 = check_pos(x2, y2, 1); is_2 = check_pos(x2, y2, 1);
@@ -2922,9 +2921,9 @@ set_corn(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
/* Return mode for a crosswall. */ /* Return mode for a crosswall. */
static int 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_1 = check_pos(x - 1, y - 1, 1);
is_2 = check_pos(x + 1, y - 1, 1); is_2 = check_pos(x + 1, y - 1, 1);
@@ -2958,14 +2957,14 @@ set_crosswall(int x, int y)
/* called for every <x,y> by set_wall_state() and for specific <x,y> during /* called for every <x,y> by set_wall_state() and for specific <x,y> during
vault wall repair */ vault wall repair */
void 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]; struct rm *lev = &levl[x][y];
switch (lev->typ) { switch (lev->typ) {
case SDOOR: case SDOOR:
wmode = set_wall(x, y, (int) lev->horizontal); wmode = set_wall(x, y, (coordxy) lev->horizontal);
break; break;
case VWALL: case VWALL:
wmode = set_wall(x, y, 0); wmode = set_wall(x, y, 0);
@@ -3014,7 +3013,7 @@ xy_set_wall_state(int x, int y)
void void
set_wall_state(void) set_wall_state(void)
{ {
int x, y; coordxy x, y;
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
for (x = 0; x < MAX_TYPE; x++) for (x = 0; x < MAX_TYPE; x++)
@@ -3030,7 +3029,7 @@ set_wall_state(void)
for (x = y = 0; x < MAX_TYPE; x++) for (x = y = 0; x < MAX_TYPE; x++)
if (bad_count[x]) { if (bad_count[x]) {
if (y == 0) { if (y == 0) {
y = 1; /* only print once */ y = 1; /* only prcoordxy once */
pline("set_wall_type: wall mode problems with: "); pline("set_wall_type: wall mode problems with: ");
} }
pline("%s %d;", type_names[x], bad_count[x]); pline("%s %d;", type_names[x], bad_count[x]);
@@ -3049,21 +3048,22 @@ unsigned char seenv_matrix[3][3] = { { SV2, SV1, SV0 },
/* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */ /* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */
static void static void
set_seenv(struct rm *lev, 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]; lev->seenv |= seenv_matrix[sign(dy) + 1][sign(dx) + 1];
} }
/* Called by blackout(vault.c) when vault guard removes temporary corridor, /* 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 void
unset_seenv(struct rm *lev, /* &levl[x1][y1] */ 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 */ && 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]; lev->seenv &= ~seenv_matrix[dy + 1][dx + 1];
} }
+3 -3
View File
@@ -43,7 +43,7 @@ dodrop(void)
* it's gone for good... If the destination is not a pool, returns FALSE. * it's gone for good... If the destination is not a pool, returns FALSE.
*/ */
boolean 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) { if (!otmp || otmp->otyp != BOULDER) {
impossible("Not a boulder?"); impossible("Not a boulder?");
@@ -138,7 +138,7 @@ boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing)
* away. * away.
*/ */
boolean 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 trap *t;
struct monst *mtmp; struct monst *mtmp;
@@ -385,7 +385,7 @@ polymorph_sink(void)
static boolean static boolean
teleport_sink(void) teleport_sink(void)
{ {
int cx, cy; coordxy cx, cy;
int cnt = 0; int cnt = 0;
struct trap *trp; struct trap *trp;
struct engr *eng; struct engr *eng;
+15 -13
View File
@@ -10,11 +10,11 @@ static void getpos_help_keyxhelp(winid, const char *, const char *, int);
static void getpos_help(boolean, const char *); static void getpos_help(boolean, const char *);
static int QSORTCALLBACK cmp_coord_distu(const void *, const void *); static int QSORTCALLBACK cmp_coord_distu(const void *, const void *);
static int gloc_filter_classify_glyph(int); static int gloc_filter_classify_glyph(int);
static int gloc_filter_floodfill_matcharea(int, int); static int gloc_filter_floodfill_matcharea(coordxy, coordxy);
static void gloc_filter_floodfill(int, int); static void gloc_filter_floodfill(coordxy, coordxy);
static void gloc_filter_init(void); static void gloc_filter_init(void);
static void gloc_filter_done(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 gather_locs(coord **, int *, int);
static void auto_describe(int, int); static void auto_describe(int, int);
static void truncate_to_map(int *, int *, schar, schar); static void truncate_to_map(int *, int *, schar, schar);
@@ -43,10 +43,10 @@ nextmbuf(void)
* parameter value 0 = initialize, 1 = highlight, 2 = done * parameter value 0 = initialize, 1 = highlight, 2 = done
*/ */
static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0; 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 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_hilitefunc = gp_hilitef;
getpos_getvalid = gp_getvalidf; getpos_getvalid = gp_getvalidf;
@@ -295,7 +295,7 @@ gloc_filter_classify_glyph(int glyph)
} }
static int 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); int glyph = back_to_glyph(x, y);
@@ -313,7 +313,7 @@ gloc_filter_floodfill_matcharea(int x, int y)
} }
static void 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); g.gloc_filter_floodfill_match_glyph = back_to_glyph(x, y);
@@ -355,7 +355,7 @@ gloc_filter_done(void)
DISABLE_WARNING_UNREACHABLE_CODE DISABLE_WARNING_UNREACHABLE_CODE
static boolean static boolean
gather_locs_interesting(int x, int y, int gloc) gather_locs_interesting(coordxy x, coordxy y, int gloc)
{ {
int glyph, sym; int glyph, sym;
@@ -428,7 +428,8 @@ RESTORE_WARNINGS
static void static void
gather_locs(coord **arr_p, int *cnt_p, int gloc) 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 * We always include the hero's location even if there is no monster
@@ -469,7 +470,7 @@ gather_locs(coord **arr_p, int *cnt_p, int gloc)
} }
char * 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]; static char buf[30];
int dst; int dst;
@@ -507,7 +508,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
/* coordinate formatting for 'whatis_coord' option */ /* coordinate formatting for 'whatis_coord' option */
char * 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]" */ static char screen_fmt[16]; /* [12] suffices: "[%02d,%02d]" */
int dx, dy; int dx, dy;
@@ -693,7 +694,8 @@ getpos(coord *ccp, boolean force, const char *goal)
char mMoOdDxX[13]; char mMoOdDxX[13];
int result = 0; int result = 0;
int cx, cy, i, c; 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 msg_given = TRUE; /* clear message window by default */
boolean show_goal_msg = FALSE; boolean show_goal_msg = FALSE;
boolean hilite_state = FALSE; boolean hilite_state = FALSE;
@@ -1031,7 +1033,7 @@ getpos(coord *ccp, boolean force, const char *goal)
if (garr[i]) if (garr[i])
free((genericptr_t) garr[i]); free((genericptr_t) garr[i]);
getpos_hilitefunc = (void (*)(int)) 0; 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; u.dx = udx, u.dy = udy, u.dz = udz;
return result; return result;
} }
+8 -8
View File
@@ -136,10 +136,10 @@ static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS,
0 }; 0 };
static void wantdoor(int, int, genericptr_t); static void wantdoor(coordxy, coordxy, genericptr_t);
boolean boolean
cursed_object_at(int x, int y) cursed_object_at(coordxy x, coordxy y)
{ {
struct obj *otmp; struct obj *otmp;
@@ -214,8 +214,8 @@ dog_nutrition(struct monst *mtmp, struct obj *obj)
int int
dog_eat(struct monst *mtmp, dog_eat(struct monst *mtmp,
struct obj *obj, /* if unpaid, then thrown or kicked by hero */ struct obj *obj, /* if unpaid, then thrown or kicked by hero */
int x, /* dog's starting location, */ coordxy x, /* dog's starting location, */
int y, /* might be different from current */ coordxy y, /* might be different from current */
boolean devour) boolean devour)
{ {
register struct edog *edog = EDOG(mtmp); register struct edog *edog = EDOG(mtmp);
@@ -506,7 +506,7 @@ static int
dog_goal(register struct monst *mtmp, struct edog *edog, dog_goal(register struct monst *mtmp, struct edog *edog,
int after, int udist, int whappr) int after, int udist, int whappr)
{ {
register int omx, omy; register coordxy omx, omy;
boolean in_masters_sight, dog_has_minvent; boolean in_masters_sight, dog_has_minvent;
register struct obj *obj; register struct obj *obj;
xint16 otyp; xint16 otyp;
@@ -530,7 +530,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog,
#define DDIST(x, y) (dist2(x, y, omx, omy)) #define DDIST(x, y) (dist2(x, y, omx, omy))
#define SQSRCHRADIUS 5 #define SQSRCHRADIUS 5
int min_x, max_x, min_y, max_y; int min_x, max_x, min_y, max_y;
register int nx, ny; coordxy nx, ny;
g.gtyp = UNDEF; /* no goal as yet */ g.gtyp = UNDEF; /* no goal as yet */
g.gx = g.gy = 0; /* suppress 'used before set' message */ g.gx = g.gy = 0; /* suppress 'used before set' message */
@@ -917,7 +917,7 @@ dog_move(register struct monst *mtmp,
boolean has_edog, cursemsg[9], do_eat = FALSE; boolean has_edog, cursemsg[9], do_eat = FALSE;
boolean better_with_displacing = FALSE; boolean better_with_displacing = FALSE;
coordxy nix, niy; /* position mtmp is (considering) moving to */ coordxy nix, niy; /* position mtmp is (considering) moving to */
register int nx, ny; /* temporary coordinates */ coordxy nx, ny; /* temporary coordinates */
xint16 cnt, uncursedcnt, chcnt; xint16 cnt, uncursedcnt, chcnt;
int chi = -1, nidist, ndist; int chi = -1, nidist, ndist;
coord poss[9]; coord poss[9];
@@ -1379,7 +1379,7 @@ can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordx
/* do_clear_area client */ /* do_clear_area client */
static void static void
wantdoor(int x, int y, genericptr_t distance) wantdoor(coordxy x, coordxy y, genericptr_t distance)
{ {
int ndist, *dist_ptr = (int *) distance; int ndist, *dist_ptr = (int *) distance;
+6 -6
View File
@@ -19,8 +19,8 @@ static int really_kick_object(coordxy, coordxy);
static char *kickstr(char *, const char *); static char *kickstr(char *, const char *);
static boolean watchman_thief_arrest(struct monst *); static boolean watchman_thief_arrest(struct monst *);
static boolean watchman_door_damage(struct monst *, coordxy, coordxy); static boolean watchman_door_damage(struct monst *, coordxy, coordxy);
static void kick_dumb(int, int); static void kick_dumb(coordxy, coordxy);
static void kick_ouch(int, int, const char *); static void kick_ouch(coordxy, coordxy, const char *);
static void otransit_msg(struct obj *, boolean, boolean, long); static void otransit_msg(struct obj *, boolean, boolean, long);
static void drop_to(coord *, schar, coordxy, coordxy); static void drop_to(coord *, schar, coordxy, coordxy);
@@ -803,7 +803,7 @@ watchman_door_damage(struct monst *mtmp, coordxy x, coordxy y)
} }
static void static void
kick_dumb(int x, int y) kick_dumb(coordxy x, coordxy y)
{ {
exercise(A_DEX, FALSE); exercise(A_DEX, FALSE);
if (martial() || ACURR(A_DEX) >= 16 || rn2(3)) { if (martial() || ACURR(A_DEX) >= 16 || rn2(3)) {
@@ -820,7 +820,7 @@ kick_dumb(int x, int y)
} }
static void static void
kick_ouch(int x, int y, const char *kickobjnam) kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
{ {
int dmg; int dmg;
char buf[BUFSZ]; char buf[BUFSZ];
@@ -850,7 +850,7 @@ kick_ouch(int x, int y, const char *kickobjnam)
int int
dokick(void) dokick(void)
{ {
int x, y; coordxy x, y;
int avrg_attrib; int avrg_attrib;
int glyph, oldglyph = -1; int glyph, oldglyph = -1;
register struct monst *mtmp; register struct monst *mtmp;
@@ -943,7 +943,7 @@ dokick(void)
return ECMD_TIME; return ECMD_TIME;
} }
if (Levitation) { if (Levitation) {
int xx, yy; coordxy xx, yy;
xx = u.ux - u.dx; xx = u.ux - u.dx;
yy = u.uy - u.dy; yy = u.uy - u.dy;
+9 -7
View File
@@ -20,7 +20,7 @@ static boolean harmless_missile(struct obj *);
static void breakmsg(struct obj *, boolean); static void breakmsg(struct obj *, boolean);
static boolean toss_up(struct obj *, boolean); static boolean toss_up(struct obj *, boolean);
static void sho_obj_return_to_u(struct obj * obj); 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; /* uwep might already be removed from inventory so test for W_WEP instead;
for Valk+Mjollnir, caller needs to validate the strength requirement */ for Valk+Mjollnir, caller needs to validate the strength requirement */
@@ -610,10 +610,11 @@ hitfloor(
*/ */
boolean boolean
walk_path(coord *src_cc, coord *dest_cc, 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) 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; boolean keep_going = TRUE;
/* Use Bresenham's Line Algorithm to walk from src to dest. /* Use Bresenham's Line Algorithm to walk from src to dest.
@@ -692,7 +693,7 @@ walk_path(coord *src_cc, coord *dest_cc,
vs drag-to-dest; original callers use first mode, jumping wants second, vs drag-to-dest; original callers use first mode, jumping wants second,
grappling hook backfire and thrown chained ball need third */ grappling hook backfire and thrown chained ball need third */
boolean boolean
hurtle_jump(genericptr_t arg, int x, int y) hurtle_jump(genericptr_t arg, coordxy x, coordxy y)
{ {
boolean res; boolean res;
long save_EWwalking = EWwalking; long save_EWwalking = EWwalking;
@@ -723,9 +724,10 @@ hurtle_jump(genericptr_t arg, int x, int y)
* o let jumps go over boulders * o let jumps go over boulders
*/ */
boolean 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 obj *obj;
struct monst *mon; struct monst *mon;
boolean may_pass = TRUE, via_jumping, stopping_short; boolean may_pass = TRUE, via_jumping, stopping_short;
@@ -938,7 +940,7 @@ hurtle_step(genericptr_t arg, int x, int y)
} }
static boolean 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 *mon = (struct monst *) arg;
struct monst *mtmp; struct monst *mtmp;
+7 -6
View File
@@ -1406,7 +1406,7 @@ prev_level(boolean at_stairs)
} }
void void
u_on_newpos(int x, int y) u_on_newpos(coordxy x, coordxy y)
{ {
if (!isok(x, y)) { /* validate location */ if (!isok(x, y)) { /* validate location */
void (*func)(const char *, ...); void (*func)(const char *, ...);
@@ -1463,7 +1463,7 @@ u_on_rndspot(int upflag)
} }
void 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 *tmp = (stairway *) alloc(sizeof (stairway));
@@ -1491,7 +1491,7 @@ stairway_free_all(void)
} }
stairway * stairway *
stairway_at(int x, int y) stairway_at(coordxy x, coordxy y)
{ {
stairway *tmp = g.stairs; stairway *tmp = g.stairs;
@@ -1660,7 +1660,7 @@ Can_fall_thru(d_level *lev)
* Checks for amulets and such must be done elsewhere. * Checks for amulets and such must be done elsewhere.
*/ */
boolean 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); stairway *stway = stairway_find_special_dir(FALSE);
@@ -1815,7 +1815,7 @@ On_W_tower_level(d_level *lev)
/* is <x,y> of `lev' inside the Wizard's tower? */ /* is <x,y> of `lev' inside the Wizard's tower? */
boolean 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)) if (!On_W_tower_level(lev))
return FALSE; return FALSE;
@@ -2766,7 +2766,8 @@ recalc_mapseen(void)
struct cemetery *bp, **bonesaddr; struct cemetery *bp, **bonesaddr;
struct trap *t; struct trap *t;
unsigned i, ridx, atmp; unsigned i, ridx, atmp;
int x, y, ltyp, count; int ltyp, count;
coordxy x, y;
char uroom; char uroom;
/* Should not happen in general, but possible if in the process /* Should not happen in general, but possible if in the process
+7 -7
View File
@@ -177,7 +177,7 @@ can_reach_floor(boolean check_pit)
/* give a message after caller has determined that hero can't reach */ /* give a message after caller has determined that hero can't reach */
void 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.", You("can't reach the %s.",
up ? ceiling(x, y) up ? ceiling(x, y)
@@ -187,7 +187,7 @@ cant_reach_floor(int x, int y, boolean up, boolean check_pit)
} }
const char * const char *
surface(int x, int y) surface(coordxy x, coordxy y)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
@@ -218,7 +218,7 @@ surface(int x, int y)
} }
const char * const char *
ceiling(int x, int y) ceiling(coordxy x, coordxy y)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
const char *what; const char *what;
@@ -310,7 +310,7 @@ wipe_engr_at(coordxy x, coordxy y, xint16 cnt, boolean magical)
} }
void void
read_engr_at(int x, int y) read_engr_at(coordxy x, coordxy y)
{ {
struct engr *ep = engr_at(x, y); struct engr *ep = engr_at(x, y);
int sensed = 0; int sensed = 0;
@@ -384,7 +384,7 @@ read_engr_at(int x, int y)
} }
void 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; struct engr *ep;
unsigned smem = Strlen(s) + 1; unsigned smem = Strlen(s) + 1;
@@ -409,7 +409,7 @@ make_engr_at(int x, int y, const char *s, long e_time, xint16 e_type)
/* delete any engraving at location <x,y> */ /* delete any engraving at location <x,y> */
void void
del_engr_at(int x, int y) del_engr_at(coordxy x, coordxy y)
{ {
struct engr *ep = engr_at(x, y); struct engr *ep = engr_at(x, y);
@@ -1437,7 +1437,7 @@ rloc_engr(struct engr *ep)
* The caller is responsible for newsym(x, y). * The caller is responsible for newsym(x, y).
*/ */
void void
make_grave(int x, int y, const char *str) make_grave(coordxy x, coordxy y, const char *str)
{ {
char buf[BUFSZ]; char buf[BUFSZ];
+5 -5
View File
@@ -29,7 +29,7 @@ static const int explosion[3][3] = {
*/ */
void void
explode( 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 type, /* same as in zap.c; -(wand typ) for some WAND_CLASS */
int dam, /* damage amount */ int dam, /* damage amount */
char olet, /* object class or BURNING_OIL or MON_EXPLODE */ char olet, /* object class or BURNING_OIL or MON_EXPLODE */
@@ -639,7 +639,7 @@ struct scatter_chain {
/* returns number of scattered objects */ /* returns number of scattered objects */
long 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 */ int blastforce, /* force behind the scattering */
unsigned int scflags, unsigned int scflags,
struct obj *obj) /* only scatter this obj */ struct obj *obj) /* only scatter this obj */
@@ -806,7 +806,7 @@ scatter(int sx, int sy, /* location of objects to scatter */
} }
} }
for (stmp = schain; stmp; stmp = stmp2) { for (stmp = schain; stmp; stmp = stmp2) {
int x, y; coordxy x, y;
boolean obj_left_shop = FALSE; boolean obj_left_shop = FALSE;
stmp2 = stmp->next; stmp2 = stmp->next;
@@ -867,7 +867,7 @@ scatter(int sx, int sy, /* location of objects to scatter */
* For now, just perform a "regular" explosion. * For now, just perform a "regular" explosion.
*/ */
void 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); int dmg = d(diluted_oil ? 3 : 4, 4);
@@ -879,7 +879,7 @@ splatter_burning_oil(int x, int y, boolean diluted_oil)
/* lit potion of oil is exploding; extinguish it as a light source before /* lit potion of oil is exploding; extinguish it as a light source before
possibly killing the hero and attempting to save bones */ possibly killing the hero and attempting to save bones */
void void
explode_oil(struct obj *obj, int x, int y) explode_oil(struct obj *obj, coordxy x, coordxy y)
{ {
boolean diluted_oil = obj->odiluted; boolean diluted_oil = obj->odiluted;
+12 -12
View File
@@ -13,15 +13,15 @@
#define LEFT 4 #define LEFT 4
#define RIGHT 8 #define RIGHT 8
static void roguejoin(int, int, int, int, int); static void roguejoin(coordxy, coordxy, coordxy, coordxy, int);
static void roguecorr(int, int, int); static void roguecorr(coordxy, coordxy, int);
static void miniwalk(int, int); static void miniwalk(coordxy, coordxy);
static static
void 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) { if (horiz) {
middle = x1 + rn2(x2 - x1 + 1); middle = x1 + rn2(x2 - x1 + 1);
for (x = min(x1, middle); x <= max(x1, middle); x++) for (x = min(x1, middle); x <= max(x1, middle); x++)
@@ -43,9 +43,9 @@ roguejoin(int x1, int y1, int x2, int y2, int horiz)
static static
void 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) { if (dir == DOWN) {
g.r[x][y].doortable &= ~DOWN; g.r[x][y].doortable &= ~DOWN;
@@ -138,7 +138,7 @@ roguecorr(int x, int y, int dir)
/* Modified walkfrom() from mkmaze.c */ /* Modified walkfrom() from mkmaze.c */
static static
void void
miniwalk(int x, int y) miniwalk(coordxy x, coordxy y)
{ {
register int q, dir; register int q, dir;
int dirs[4]; int dirs[4];
@@ -193,7 +193,7 @@ miniwalk(int x, int y)
void void
makeroguerooms(void) makeroguerooms(void)
{ {
register int x, y; register coordxy x, y;
/* Rogue levels are structured 3 by 3, with each section containing /* Rogue levels are structured 3 by 3, with each section containing
* a room or an intersection. The minimum width is 2 each way. * a room or an intersection. The minimum width is 2 each way.
* One difference between these and "real" Rogue levels: real Rogue * One difference between these and "real" Rogue levels: real Rogue
@@ -242,7 +242,7 @@ makeroguerooms(void)
for (y = 0; y < 3; y++) for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++) { for (x = 0; x < 3; x++) {
if (here.real) { /* Make a room */ if (here.real) { /* Make a room */
int lowx, lowy, hix, hiy; coordxy lowx, lowy, hix, hiy;
g.r[x][y].nroom = g.nroom; g.r[x][y].nroom = g.nroom;
g.smeq[g.nroom] = g.nroom; g.smeq[g.nroom] = g.nroom;
@@ -275,7 +275,7 @@ makeroguerooms(void)
} }
void void
corr(int x, int y) corr(coordxy x, coordxy y)
{ {
if (rn2(50)) { if (rn2(50)) {
levl[x][y].typ = CORR; levl[x][y].typ = CORR;
@@ -290,7 +290,7 @@ makerogueghost(void)
register struct monst *ghost; register struct monst *ghost;
struct obj *ghostobj; struct obj *ghostobj;
struct mkroom *croom; struct mkroom *croom;
int x, y; coordxy x, y;
if (!g.nroom) if (!g.nroom)
return; /* Should never happen */ return; /* Should never happen */
+3 -3
View File
@@ -9,7 +9,7 @@
static void dowatersnakes(void); static void dowatersnakes(void);
static void dowaterdemon(void); static void dowaterdemon(void);
static void dowaternymph(void); static void dowaternymph(void);
static void gush(int, int, genericptr_t); static void gush(coordxy, coordxy, genericptr_t);
static void dofindgem(void); static void dofindgem(void);
static boolean watchman_warn_fountain(struct monst *); static boolean watchman_warn_fountain(struct monst *);
@@ -121,7 +121,7 @@ dogushforth(int drinking)
} }
static void static void
gush(int x, int y, genericptr_t poolcnt) gush(coordxy x, coordxy y, genericptr_t poolcnt)
{ {
register struct monst *mtmp; register struct monst *mtmp;
register struct trap *ttmp; register struct trap *ttmp;
@@ -527,7 +527,7 @@ dipfountain(register struct obj *obj)
} }
void void
breaksink(int x, int y) breaksink(coordxy x, coordxy y)
{ {
if (cansee(x, y) || u_at(x, y)) if (cansee(x, y) || u_at(x, y))
pline_The("pipes break! Water spurts out!"); pline_The("pipes break! Water spurts out!");
+24 -24
View File
@@ -7,11 +7,11 @@
/* #define DEBUG */ /* uncomment for debugging */ /* #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 int moverock(void);
static void dosinkfall(void); static void dosinkfall(void);
static boolean findtravelpath(int); 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 void check_buried_zombies(coordxy, coordxy);
static schar u_simple_floortyp(coordxy, coordxy); static schar u_simple_floortyp(coordxy, coordxy);
static boolean swim_move_danger(coordxy, coordxy); static boolean swim_move_danger(coordxy, coordxy);
@@ -30,11 +30,11 @@ static boolean move_out_of_bounds(coordxy, coordxy);
static boolean carrying_too_much(void); static boolean carrying_too_much(void);
static boolean escape_from_sticky_mon(coordxy, coordxy); static boolean escape_from_sticky_mon(coordxy, coordxy);
static void domove_core(void); 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 struct monst *monstinroom(struct permonst *, int);
static void move_update(boolean); static void move_update(boolean);
static int pickup_checks(void); static int pickup_checks(void);
static boolean doorless_door(int, int); static boolean doorless_door(coordxy, coordxy);
static void maybe_wail(void); static void maybe_wail(void);
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE) #define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
@@ -77,7 +77,7 @@ obj_to_any(struct obj *obj)
} }
boolean boolean
revive_nasty(int x, int y, const char *msg) revive_nasty(coordxy x, coordxy y, const char *msg)
{ {
register struct obj *otmp, *otmp2; register struct obj *otmp, *otmp2;
struct monst *mtmp; struct monst *mtmp;
@@ -116,7 +116,7 @@ revive_nasty(int x, int y, const char *msg)
/* can hero move onto a spot containing one or more boulders? /* can hero move onto a spot containing one or more boulders?
used for m<dir> and travel and during boulder push failure */ used for m<dir> and travel and during boulder push failure */
static boolean 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) */ /* can if able to phaze through rock (must be poly'd, so not riding) */
if (Passes_walls) if (Passes_walls)
@@ -853,10 +853,10 @@ invocation_pos(coordxy x, coordxy y)
* mode is one of DO_MOVE, TEST_MOVE, TEST_TRAV, or TEST_TRAP * mode is one of DO_MOVE, TEST_MOVE, TEST_TRAV, or TEST_TRAP
*/ */
boolean 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; coordxy x = ux + dx;
int y = uy + dy; coordxy y = uy + dy;
register struct rm *tmpr = &levl[x][y]; register struct rm *tmpr = &levl[x][y];
struct rm *ust; struct rm *ust;
@@ -1156,15 +1156,15 @@ findtravelpath(int mode)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
int dir; int dir;
int x = travelstepx[set][i]; coordxy x = travelstepx[set][i];
int y = travelstepy[set][i]; coordxy y = travelstepy[set][i];
/* no diagonal movement for grid bugs */ /* no diagonal movement for grid bugs */
int dirmax = NODIAG(u.umonnum) ? 4 : N_DIRS; int dirmax = NODIAG(u.umonnum) ? 4 : N_DIRS;
boolean alreadyrepeated = FALSE; boolean alreadyrepeated = FALSE;
for (dir = 0; dir < dirmax; ++dir) { for (dir = 0; dir < dirmax; ++dir) {
int nx = x + xdir[dirs_ord[dir]]; coordxy nx = x + xdir[dirs_ord[dir]];
int ny = y + ydir[dirs_ord[dir]]; coordxy ny = y + ydir[dirs_ord[dir]];
/* /*
* When guessing and trying to travel as close as possible * When guessing and trying to travel as close as possible
@@ -1355,7 +1355,7 @@ findtravelpath(int mode)
} }
boolean boolean
is_valid_travelpt(int x, int y) is_valid_travelpt(coordxy x, coordxy y)
{ {
int tx = u.tx; int tx = u.tx;
int ty = u.ty; int ty = u.ty;
@@ -1380,7 +1380,7 @@ is_valid_travelpt(int x, int y)
(all failures and most successful escapes leave hero at original spot) */ (all failures and most successful escapes leave hero at original spot) */
static boolean static boolean
trapmove( 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> */ struct trap *desttrap) /* nonnull if another trap at <x,y> */
{ {
boolean anchored = FALSE; boolean anchored = FALSE;
@@ -2103,7 +2103,7 @@ move_out_of_bounds(coordxy x, coordxy y)
return domove_fight_empty(x, y); return domove_fight_empty(x, y);
if (flags.mention_walls) { if (flags.mention_walls) {
int dx = u.dx, dy = u.dy; coordxy dx = u.dx, dy = u.dy;
if (dx && dy) { /* diagonal */ if (dx && dy) { /* diagonal */
/* only as far as possible diagonally if in very /* only as far as possible diagonally if in very
@@ -2205,7 +2205,7 @@ escape_from_sticky_mon(coordxy x, coordxy y)
void void
domove(void) domove(void)
{ {
int ux1 = u.ux, uy1 = u.uy; coordxy ux1 = u.ux, uy1 = u.uy;
g.domove_succeeded = 0L; g.domove_succeeded = 0L;
domove_core(); domove_core();
@@ -2493,7 +2493,7 @@ runmode_delay_output(void)
} }
static void 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; struct engr *ep;
@@ -2918,7 +2918,7 @@ in_rooms(register coordxy x, register coordxy y, register int typewanted)
/* is (x,y) in a town? */ /* is (x,y) in a town? */
boolean boolean
in_town(register int x, register int y) in_town(coordxy x, coordxy y)
{ {
s_level *slev = Is_special(&u.uz); s_level *slev = Is_special(&u.uz);
register struct mkroom *sroom; register struct mkroom *sroom;
@@ -3240,8 +3240,8 @@ dopickup(void)
void void
lookaround(void) lookaround(void)
{ {
register int x, y; register coordxy x, y;
int i, x0 = 0, y0 = 0, m0 = 1, i0 = 9; coordxy i, x0 = 0, y0 = 0, m0 = 1, i0 = 9;
int corrct = 0, noturn = 0; int corrct = 0, noturn = 0;
struct monst *mtmp; struct monst *mtmp;
@@ -3398,7 +3398,7 @@ lookaround(void)
/* check for a doorway which lacks its door (NODOOR or BROKEN) */ /* check for a doorway which lacks its door (NODOOR or BROKEN) */
static boolean static boolean
doorless_door(int x, int y) doorless_door(coordxy x, coordxy y)
{ {
struct rm *lev_p = &levl[x][y]; struct rm *lev_p = &levl[x][y];
@@ -3414,7 +3414,7 @@ doorless_door(int x, int y)
/* used by drown() to check whether hero can crawl from water to <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 */ also used by findtravelpath() when destination is one step away */
boolean boolean
crawl_destination(int x, int y) crawl_destination(coordxy x, coordxy y)
{ {
/* is location ok in general? */ /* is location ok in general? */
if (!goodpos(x, y, &g.youmonst, 0)) if (!goodpos(x, y, &g.youmonst, 0))
@@ -3443,7 +3443,7 @@ crawl_destination(int x, int y)
int int
monster_nearby(void) monster_nearby(void)
{ {
register int x, y; register coordxy x, y;
register struct monst *mtmp; register struct monst *mtmp;
/* Also see the similar check in dochugw() in monmove.c */ /* Also see the similar check in dochugw() in monmove.c */
+4 -4
View File
@@ -681,9 +681,9 @@ rounddiv(long x, int y)
/* distance between two points, in moves */ /* distance between two points, in moves */
int 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) if (dx < 0)
dx = -dx; dx = -dx;
@@ -697,9 +697,9 @@ distmin(int x0, int y0, int x1, int y1)
/* square of euclidean distance between pair of pts */ /* square of euclidean distance between pair of pts */
int 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; return dx * dx + dy * dy;
} }
+6 -6
View File
@@ -1199,7 +1199,7 @@ freeinv(struct obj *obj)
/* drawbridge is destroying all objects at <x,y> */ /* drawbridge is destroying all objects at <x,y> */
void void
delallobj(int x, int y) delallobj(coordxy x, coordxy y)
{ {
struct obj *otmp, *otmp2; struct obj *otmp, *otmp2;
@@ -1252,7 +1252,7 @@ delobj_core(
/* try to find a particular type of object at designated map location */ /* try to find a particular type of object at designated map location */
struct obj * struct obj *
sobj_at(int otyp, int x, int y) sobj_at(int otyp, coordxy x, coordxy y)
{ {
register struct obj *otmp; register struct obj *otmp;
@@ -1384,7 +1384,7 @@ o_on(unsigned int id, struct obj *objchn)
} }
boolean boolean
obj_here(struct obj *obj, int x, int y) obj_here(struct obj *obj, coordxy x, coordxy y)
{ {
register struct obj *otmp; register struct obj *otmp;
@@ -1395,7 +1395,7 @@ obj_here(struct obj *obj, int x, int y)
} }
struct obj * struct obj *
g_at(int x, int y) g_at(coordxy x, coordxy y)
{ {
register struct obj *obj = g.level.objects[x][y]; register struct obj *obj = g.level.objects[x][y];
@@ -3997,7 +3997,7 @@ dotypeinv(void)
/* return a string describing the dungeon feature at <x,y> if there /* return a string describing the dungeon feature at <x,y> if there
is one worth mentioning at that location; otherwise null */ is one worth mentioning at that location; otherwise null */
const char * const char *
dfeature_at(int x, int y, char *buf) dfeature_at(coordxy x, coordxy y, char *buf)
{ {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
int ltyp = lev->typ, cmap = -1; int ltyp = lev->typ, cmap = -1;
@@ -5335,7 +5335,7 @@ only_here(struct obj *obj)
* Currently, this is only used with a wand of probing zapped downwards. * Currently, this is only used with a wand of probing zapped downwards.
*/ */
int int
display_binventory(int x, int y, boolean as_if_seen) display_binventory(coordxy x, coordxy y, boolean as_if_seen)
{ {
struct obj *obj; struct obj *obj;
menu_item *selected = 0; menu_item *selected = 0;
+4 -3
View File
@@ -136,7 +136,8 @@ del_light_source(int type, anything *id)
void void
do_light_sources(coordxy **cs_rows) 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; coordxy *limits;
short at_hero_range = 0; short at_hero_range = 0;
light_source *ls; light_source *ls;
@@ -221,7 +222,7 @@ do_light_sources(coordxy **cs_rows)
remember terrain, objects, and monsters being revealed; remember terrain, objects, and monsters being revealed;
if 'obj' is Null, <x,y> is being hit by a camera's light flash */ if 'obj' is Null, <x,y> is being hit by a camera's light flash */
void 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; light_source *ls = 0;
anything cameraflash; anything cameraflash;
@@ -621,7 +622,7 @@ any_light_source(void)
* only for burning light sources. * only for burning light sources.
*/ */
void void
snuff_light_source(int x, int y) snuff_light_source(coordxy x, coordxy y)
{ {
light_source *ls; light_source *ls;
struct obj *obj; struct obj *obj;
+8 -8
View File
@@ -10,11 +10,11 @@ static int picklock(void);
static int forcelock(void); static int forcelock(void);
static const char *lock_action(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 *); static void chest_shatter_msg(struct obj *);
boolean boolean
picking_lock(int *x, int *y) picking_lock(coordxy *x, coordxy *y)
{ {
if (g.occupation == picklock) { if (g.occupation == picklock) {
*x = u.ux + u.dx; *x = u.ux + u.dx;
@@ -27,7 +27,7 @@ picking_lock(int *x, int *y)
} }
boolean boolean
picking_at(int x, int y) picking_at(coordxy x, coordxy y)
{ {
return (boolean) (g.occupation == picklock && g.xlock.door == &levl[x][y]); return (boolean) (g.occupation == picklock && g.xlock.door == &levl[x][y]);
} }
@@ -730,7 +730,7 @@ doforce(void)
} }
boolean boolean
stumble_on_door_mimic(int x, int y) stumble_on_door_mimic(coordxy x, coordxy y)
{ {
struct monst *mtmp; struct monst *mtmp;
@@ -751,7 +751,7 @@ doopen(void)
/* try to open a door in direction u.dx/u.dy */ /* try to open a door in direction u.dx/u.dy */
int int
doopen_indir(int x, int y) doopen_indir(coordxy x, coordxy y)
{ {
coord cc; coord cc;
register struct rm *door; register struct rm *door;
@@ -877,7 +877,7 @@ doopen_indir(int x, int y)
} }
static boolean static boolean
obstructed(int x, int y, boolean quietly) obstructed(coordxy x, coordxy y, boolean quietly)
{ {
struct monst *mtmp = m_at(x, y); struct monst *mtmp = m_at(x, y);
@@ -910,7 +910,7 @@ obstructed(int x, int y, boolean quietly)
int int
doclose(void) doclose(void)
{ {
register int x, y; register coordxy x, y;
register struct rm *door; register struct rm *door;
boolean portcullis; boolean portcullis;
int res = ECMD_OK; int res = ECMD_OK;
@@ -1051,7 +1051,7 @@ boxlock(struct obj *obj, struct obj *otmp) /* obj *is* a box */
/* Door/secret door was hit with spell or wand effect otmp; /* Door/secret door was hit with spell or wand effect otmp;
returns true if something happened */ returns true if something happened */
boolean boolean
doorlock(struct obj *otmp, int x, int y) doorlock(struct obj *otmp, coordxy x, coordxy y)
{ {
register struct rm *door = &levl[x][y]; register struct rm *door = &levl[x][y];
boolean res = TRUE; boolean res = TRUE;
+1 -1
View File
@@ -247,7 +247,7 @@ static boolean
md_stop(coord *stopp, /* stopping position (we fill it in) */ md_stop(coord *stopp, /* stopping position (we fill it in) */
coord *startp) /* starting position (read only) */ 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 (x = u.ux - 1; x <= u.ux + 1; x++)
for (y = u.uy - 1; y <= u.uy + 1; y++) { for (y = u.uy - 1; y <= u.uy + 1; y++) {
+8 -8
View File
@@ -18,7 +18,7 @@ static boolean uncommon(int);
static int align_shift(struct permonst *); static int align_shift(struct permonst *);
static boolean mk_gen_ok(int, unsigned, unsigned); static boolean mk_gen_ok(int, unsigned, unsigned);
static boolean wrong_elem_type(struct permonst *); 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_initthrow(struct monst *, int, int);
static void m_initweap(struct monst *); static void m_initweap(struct monst *);
static void m_initinv(struct monst *); static void m_initinv(struct monst *);
@@ -71,7 +71,7 @@ wrong_elem_type(struct permonst *ptr)
/* make a group just like mtmp */ /* make a group just like mtmp */
static void 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; coord mm;
register int cnt = rnd(n); register int cnt = rnd(n);
@@ -1054,7 +1054,7 @@ makemon_rnd_goodpos(
coord *cc) /* output */ coord *cc) /* output */
{ {
int tryct = 0; int tryct = 0;
int nx, ny; coordxy nx, ny;
boolean good; boolean good;
do { do {
@@ -1068,9 +1068,9 @@ makemon_rnd_goodpos(
/* else go through all map positions, twice, first round /* else go through all map positions, twice, first round
ignoring positions in sight, and pick first good one. ignoring positions in sight, and pick first good one.
skip first round if we're in special level loader or blind */ skip first round if we're in special level loader or blind */
int xofs = nx; coordxy xofs = nx;
int yofs = ny; coordxy yofs = ny;
int dx,dy; coordxy dx,dy;
int bl = (g.in_mklev || Blind) ? 1 : 0; int bl = (g.in_mklev || Blind) ? 1 : 0;
for ( ; bl < 2; bl++) { for ( ; bl < 2; bl++) {
@@ -1120,7 +1120,7 @@ makemon_rnd_goodpos(
struct monst * struct monst *
makemon( makemon(
struct permonst *ptr, struct permonst *ptr,
int x, int y, coordxy x, coordxy y,
mmflags_nht mmflags) mmflags_nht mmflags)
{ {
register struct monst *mtmp; register struct monst *mtmp;
@@ -1514,7 +1514,7 @@ create_critters(int cnt,
boolean neverask) boolean neverask)
{ {
coord c; coord c;
int x, y; coordxy x, y;
struct monst *mon; struct monst *mon;
boolean known = FALSE; boolean known = FALSE;
boolean ask = (wizard && !neverask); boolean ask = (wizard && !neverask);
+19 -16
View File
@@ -24,14 +24,15 @@ static void makelevel(void);
static boolean bydoor(coordxy, coordxy); static boolean bydoor(coordxy, coordxy);
static struct mkroom *find_branch_room(coord *); static struct mkroom *find_branch_room(coord *);
static struct mkroom *pos_to_room(coordxy, coordxy); 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 makeniche(int);
static void make_niches(void); static void make_niches(void);
static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr); static int QSORTCALLBACK mkroom_cmp(const genericptr, const genericptr);
static void dosdoor(coordxy, coordxy, struct mkroom *, int); static void dosdoor(coordxy, coordxy, struct mkroom *, int);
static void join(int, int, boolean); static void join(int, int, boolean);
static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean, static void do_room_or_subroom(struct mkroom *,
schar, boolean, boolean); coordxy, coordxy, coordxy, coordxy,
boolean, schar, boolean, boolean);
static void makerooms(void); static void makerooms(void);
static boolean door_into_nonjoined(coordxy, coordxy); static boolean door_into_nonjoined(coordxy, coordxy);
static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy); static boolean finddpos(coord *, coordxy, coordxy, coordxy, coordxy);
@@ -124,7 +125,7 @@ finddpos(coord *cc, coordxy xl, coordxy yl, coordxy xh, coordxy yh)
void void
sort_rooms(void) sort_rooms(void)
{ {
int x, y; coordxy x, y;
unsigned i, ri[MAXNROFROOMS + 1], n = (unsigned) g.nroom; unsigned i, ri[MAXNROFROOMS + 1], n = (unsigned) g.nroom;
qsort((genericptr_t) g.rooms, n, sizeof (struct mkroom), mkroom_cmp); qsort((genericptr_t) g.rooms, n, sizeof (struct mkroom), mkroom_cmp);
@@ -144,10 +145,10 @@ sort_rooms(void)
static void static void
do_room_or_subroom(register struct mkroom *croom, 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) boolean lit, schar rtype, boolean special, boolean is_room)
{ {
register int x, y; coordxy x, y;
struct rm *lev; struct rm *lev;
/* locations might bump level edges in wall-less rooms */ /* locations might bump level edges in wall-less rooms */
@@ -442,7 +443,7 @@ makecorridors(void)
} }
void 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 struct mkroom *broom;
register int tmp; register int tmp;
@@ -545,7 +546,7 @@ dosdoor(register coordxy x, register coordxy y, struct mkroom *aroom, int type)
} }
static boolean 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; coord dd;
@@ -585,7 +586,7 @@ makeniche(int trap_type)
register struct mkroom *aroom; register struct mkroom *aroom;
struct rm *rm; struct rm *rm;
int vct = 8; int vct = 8;
int dy, xx, yy; coordxy dy, xx, yy;
struct trap *ttmp; struct trap *ttmp;
if (g.doorindex < DOORMAX) { if (g.doorindex < DOORMAX) {
@@ -678,7 +679,7 @@ clear_level_structures(void)
{ {
static struct rm zerorm = { GLYPH_UNEXPLORED, static struct rm zerorm = { GLYPH_UNEXPLORED,
0, 0, 0, 0, 0, 0, 0, 0, 0 }; 0, 0, 0, 0, 0, 0, 0, 0, 0 };
register int x, y; coordxy x, y;
register struct rm *lev; register struct rm *lev;
/* note: normally we'd start at x=1 because map column #0 isn't used /* note: normally we'd start at x=1 because map column #0 isn't used
@@ -751,7 +752,7 @@ fill_ordinary_room(struct mkroom *croom)
int trycnt = 0; int trycnt = 0;
coord pos; coord pos;
struct monst *tmonst; /* always put a web with a spider */ struct monst *tmonst; /* always put a web with a spider */
int x, y; coordxy x, y;
if (croom->rtype != OROOM && croom->rtype != THEMEROOM) if (croom->rtype != OROOM && croom->rtype != THEMEROOM)
return; return;
@@ -1000,7 +1001,8 @@ mineralize(int kelp_pool, int kelp_moat, int goldprob, int gemprob,
{ {
s_level *sp; s_level *sp;
struct obj *otmp; struct obj *otmp;
int x, y, cnt; coordxy x, y;
int cnt;
if (kelp_pool < 0) if (kelp_pool < 0)
kelp_pool = 10; kelp_pool = 10;
@@ -1148,9 +1150,10 @@ topologize(struct mkroom *croom, boolean do_ordinary)
topologize(struct mkroom *croom) topologize(struct mkroom *croom)
#endif #endif
{ {
register int x, y, roomno = (int) ((croom - g.rooms) + ROOMOFFSET); coordxy x, y;
int lowx = croom->lx, lowy = croom->ly; register int roomno = (int) ((croom - g.rooms) + ROOMOFFSET);
int hix = croom->hx, hiy = croom->hy; coordxy lowx = croom->lx, lowy = croom->ly;
coordxy hix = croom->hx, hiy = croom->hy;
#ifdef SPECIALIZATION #ifdef SPECIALIZATION
schar rtype = croom->rtype; schar rtype = croom->rtype;
#endif #endif
@@ -1336,7 +1339,7 @@ okdoor(coordxy x, coordxy y)
} }
void void
dodoor(int x, int y, struct mkroom *aroom) dodoor(coordxy x, coordxy y, struct mkroom *aroom)
{ {
if (g.doorindex >= DOORMAX) { if (g.doorindex >= DOORMAX) {
impossible("DOORMAX exceeded?"); impossible("DOORMAX exceeded?");
+40 -36
View File
@@ -6,12 +6,12 @@
#include "hack.h" #include "hack.h"
#include "sp_lev.h" #include "sp_lev.h"
static int iswall(int, int); static int iswall(coordxy, coordxy);
static int iswall_or_stone(int, int); static int iswall_or_stone(coordxy, coordxy);
static boolean is_solid(int, int); static boolean is_solid(coordxy, coordxy);
static int extend_spine(int[3][3], int, int, int); static int extend_spine(int[3][3], int, int, int);
static void wall_cleanup(int, int, int, int); static void wall_cleanup(coordxy, coordxy, coordxy, coordxy);
static boolean okay(int, int, int); static boolean okay(coordxy, coordxy, coordxy);
static void maze0xy(coord *); static void maze0xy(coord *);
static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy, static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
coordxy, coordxy, boolean, d_level *); coordxy, coordxy, boolean, d_level *);
@@ -23,7 +23,7 @@ static void migr_booty_item(int, const char *);
static void migrate_orc(struct monst *, unsigned long); static void migrate_orc(struct monst *, unsigned long);
static void shiny_orc_stuff(struct monst *); static void shiny_orc_stuff(struct monst *);
static void stolen_booty(void); static void stolen_booty(void);
static boolean maze_inbounds(int, int); static boolean maze_inbounds(coordxy, coordxy);
static void maze_remove_deadends(xint16); static void maze_remove_deadends(xint16);
/* adjust a coordinate one step in the specified direction */ /* adjust a coordinate one step in the specified direction */
@@ -39,7 +39,7 @@ static void maze_remove_deadends(xint16);
} while (0) } while (0)
static int static int
iswall(int x, int y) iswall(coordxy x, coordxy y)
{ {
int type; int type;
@@ -51,7 +51,7 @@ iswall(int x, int y)
} }
static int static int
iswall_or_stone(int x, int y) iswall_or_stone(coordxy x, coordxy y)
{ {
/* out of bounds = stone */ /* out of bounds = stone */
if (!isok(x, y)) if (!isok(x, y))
@@ -62,7 +62,7 @@ iswall_or_stone(int x, int y)
/* return TRUE if out of bounds, wall or rock */ /* return TRUE if out of bounds, wall or rock */
static boolean 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)); return (boolean) (!isok(x, y) || IS_STWALL(levl[x][y].typ));
} }
@@ -164,10 +164,10 @@ extend_spine(int locale[3][3], int wall_there, int dx, int dy)
/* Remove walls totally surrounded by stone */ /* Remove walls totally surrounded by stone */
static void static void
wall_cleanup(int x1, int y1, int x2, int y2) wall_cleanup(coordxy x1, coordxy y1, coordxy x2, coordxy y2)
{ {
uchar type; uchar type;
int x, y; coordxy x, y;
struct rm *lev; struct rm *lev;
/* sanity check on incoming variables */ /* sanity check on incoming variables */
@@ -195,12 +195,12 @@ wall_cleanup(int x1, int y1, int x2, int y2)
/* Correct wall types so they extend and connect to each other */ /* Correct wall types so they extend and connect to each other */
void 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; uchar type;
int x, y; coordxy x, y;
struct rm *lev; struct rm *lev;
int (*loc_f)(int, int); int (*loc_f)(coordxy, coordxy);
int bits; int bits;
int locale[3][3]; /* rock or wall status surrounding positions */ int locale[3][3]; /* rock or wall status surrounding positions */
@@ -256,14 +256,14 @@ fix_wall_spines(int x1, int y1, int x2, int y2)
} }
void 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); wall_cleanup(x1, y1, x2, y2);
fix_wall_spines(x1, y1, x2, y2); fix_wall_spines(x1, y1, x2, y2);
} }
static boolean 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);
mz_move(x, y, dir); mz_move(x, y, dir);
@@ -813,7 +813,7 @@ stolen_booty(void)
#undef ORC_LEADER #undef ORC_LEADER
static boolean static boolean
maze_inbounds(int x, int y) maze_inbounds(coordxy x, coordxy y)
{ {
return (x >= 2 && y >= 2 return (x >= 2 && y >= 2
&& x < g.x_maze_max && y < g.y_maze_max && x < g.x_maze_max && y < g.y_maze_max
@@ -826,7 +826,7 @@ static void
maze_remove_deadends(xint16 typ) maze_remove_deadends(xint16 typ)
{ {
char dirok[4]; 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 */ dirok[0] = 0; /* lint suppression */
for (x = 2; x < g.x_maze_max; x++) for (x = 2; x < g.x_maze_max; x++)
@@ -871,7 +871,7 @@ maze_remove_deadends(xint16 typ)
void void
create_maze(int corrwid, int wallthick, boolean rmdeadends) create_maze(int corrwid, int wallthick, boolean rmdeadends)
{ {
int x,y; coordxy x,y;
coord mm; coord mm;
int tmp_xmax = g.x_maze_max; int tmp_xmax = g.x_maze_max;
int tmp_ymax = g.y_maze_max; int tmp_ymax = g.y_maze_max;
@@ -967,7 +967,7 @@ create_maze(int corrwid, int wallthick, boolean rmdeadends)
void void
makemaz(const char *s) makemaz(const char *s)
{ {
int x, y; coordxy x, y;
char protofile[20]; char protofile[20];
s_level *sp = Is_special(&u.uz); s_level *sp = Is_special(&u.uz);
coord mm; coord mm;
@@ -1134,7 +1134,7 @@ makemaz(const char *s)
* that is totally safe. * that is totally safe.
*/ */
void 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 */ #define CELLS (ROWNO * COLNO) / 4 /* a maze cell is 4 squares */
char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */ char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */
@@ -1181,7 +1181,7 @@ walkfrom(int x, int y, schar typ)
#else /* !MICRO */ #else /* !MICRO */
void void
walkfrom(int x, int y, schar typ) walkfrom(coordxy x, coordxy y, schar typ)
{ {
int q, a, dir; int q, a, dir;
int dirs[4]; int dirs[4];
@@ -1220,7 +1220,8 @@ walkfrom(int x, int y, schar typ)
void void
mazexy(coord *cc) 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; int cpt = 0;
do { do {
@@ -1254,13 +1255,13 @@ mazexy(coord *cc)
} }
void 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; unsigned typ;
struct rm *lev; struct rm *lev;
boolean found, nonwall; boolean found, nonwall;
int xmin, xmax, ymin, ymax; coordxy xmin, xmax, ymin, ymax;
found = nonwall = FALSE; found = nonwall = FALSE;
for (xmin = 0; !found && xmin <= COLNO; xmin++) { for (xmin = 0; !found && xmin <= COLNO; xmin++) {
@@ -1341,8 +1342,8 @@ get_level_extends(int * left, int * top, int * right, int * bottom)
void void
bound_digging(void) bound_digging(void)
{ {
int x, y; coordxy x, y;
int xmin, xmax, ymin, ymax; coordxy xmin, xmax, ymin, ymax;
if (Is_earthlevel(&u.uz)) if (Is_earthlevel(&u.uz))
return; /* everything diggable here */ return; /* everything diggable here */
@@ -1410,8 +1411,8 @@ fumaroles(void)
#define gbymax (g.ymax - 1) #define gbymax (g.ymax - 1)
static void set_wportal(void); static void set_wportal(void);
static void mk_bubble(int, int, int); static void mk_bubble(coordxy, coordxy, int);
static void mv_bubble(struct bubble *, int, int, boolean); static void mv_bubble(struct bubble *, coordxy, coordxy, boolean);
void void
movebubbles(void) movebubbles(void)
@@ -1424,7 +1425,8 @@ movebubbles(void)
struct bubble *b; struct bubble *b;
struct container *cons; struct container *cons;
struct trap *btrap; 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 */ /* set up the portal the first time bubbles are moved */
if (!g.wportal) if (!g.wportal)
@@ -1560,7 +1562,7 @@ movebubbles(void)
void void
water_friction(void) water_friction(void)
{ {
int x, y, dx, dy; coordxy x, y, dx, dy;
boolean eff = FALSE; boolean eff = FALSE;
if (Swimming && rn2(4)) if (Swimming && rn2(4))
@@ -1678,7 +1680,8 @@ set_wportal(void)
static void static void
setup_waterlevel(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)) if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
panic("setup_waterlevel(): [%d:%d] neither 'Water' nor 'Air'", panic("setup_waterlevel(): [%d:%d] neither 'Water' nor 'Air'",
@@ -1736,7 +1739,7 @@ unsetup_waterlevel(void)
} }
static void 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 * These bit masks make visually pleasing bubbles on a normal aspect
@@ -1799,9 +1802,10 @@ mk_bubble(int x, int y, int n)
* This property also makes leaving a bubble slightly difficult. * This property also makes leaving a bubble slightly difficult.
*/ */
static void 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; struct container *cons, *ctemp;
/* clouds move slowly */ /* clouds move slowly */
+11 -11
View File
@@ -168,7 +168,7 @@ free_omailcmd(struct obj *otmp)
} }
struct obj * 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 *otmp;
@@ -178,7 +178,7 @@ mkobj_at(char let, int x, int y, boolean artif)
} }
struct obj * 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; struct obj *otmp;
@@ -1815,14 +1815,14 @@ static const int treefruits[] = {
/* called when a tree is kicked; never returns Null */ /* called when a tree is kicked; never returns Null */
struct obj * 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); return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE);
} }
/* create a stack of N gold pieces; never returns Null */ /* create a stack of N gold pieces; never returns Null */
struct obj * struct obj *
mkgold(long amount, int x, int y) mkgold(long amount, coordxy x, coordxy y)
{ {
struct obj *gold = g_at(x, y); struct obj *gold = g_at(x, y);
@@ -1862,7 +1862,7 @@ mkcorpstat(
int objtype, /* CORPSE or STATUE */ int objtype, /* CORPSE or STATUE */
struct monst *mtmp, /* dead monster, might be Null */ struct monst *mtmp, /* dead monster, might be Null */
struct permonst *ptr, /* if non-Null, overrides mtmp->mndx */ 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) unsigned corpstatflags)
{ {
struct obj *otmp; struct obj *otmp;
@@ -2018,7 +2018,7 @@ get_mtraits(struct obj *obj, boolean copyof)
struct obj * struct obj *
mk_tt_object( mk_tt_object(
int objtype, /* CORPSE or STATUE */ int objtype, /* CORPSE or STATUE */
int x, int y) coordxy x, coordxy y)
{ {
struct obj *otmp; struct obj *otmp;
boolean initialize_it; boolean initialize_it;
@@ -2045,7 +2045,7 @@ struct obj *
mk_named_object( mk_named_object(
int objtype, /* CORPSE or STATUE */ int objtype, /* CORPSE or STATUE */
struct permonst *ptr, struct permonst *ptr,
int x, int y, coordxy x, coordxy y,
const char *nm) const char *nm)
{ {
struct obj *otmp; struct obj *otmp;
@@ -2093,7 +2093,7 @@ is_rottable(struct obj *otmp)
/* put the object at the given location */ /* put the object at the given location */
void void
place_object(struct obj *otmp, int x, int y) place_object(struct obj *otmp, coordxy x, coordxy y)
{ {
register struct obj *otmp2; register struct obj *otmp2;
@@ -2153,7 +2153,7 @@ place_object(struct obj *otmp, int x, int y)
* Also used for starting ice effects too. [zap.c] * Also used for starting ice effects too. [zap.c]
*/ */
void void
obj_ice_effects(int x, int y, boolean do_buried) obj_ice_effects(coordxy x, coordxy y, boolean do_buried)
{ {
struct obj *otmp; struct obj *otmp;
@@ -2621,7 +2621,7 @@ static const char NEARDATA /* pline formats for insane_object() */
void void
obj_sanity_check(void) obj_sanity_check(void)
{ {
int x, y; coordxy x, y;
struct obj *obj, *otop, *prevo; struct obj *obj, *otop, *prevo;
objlist_sanity(fobj, OBJ_FLOOR, "floor sanity"); objlist_sanity(fobj, OBJ_FLOOR, "floor sanity");
@@ -3185,7 +3185,7 @@ obj_nexto(struct obj *otmp)
* reliably predict which one we want to 'find' first * reliably predict which one we want to 'find' first
*/ */
struct obj * 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; struct obj *otmp;
int fx, fy, ex, ey, otyp = obj->otyp; int fx, fy, ex, ey, otyp = obj->otyp;
+7 -5
View File
@@ -20,7 +20,7 @@
static boolean isbig(struct mkroom *); static boolean isbig(struct mkroom *);
static struct mkroom *pick_room(boolean); static struct mkroom *pick_room(boolean);
static void mkshop(void), mkzoo(int), mkswamp(void); 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 void mktemple(void);
static coord *shrine_pos(int); static coord *shrine_pos(int);
static struct permonst *morguemon(void); static struct permonst *morguemon(void);
@@ -164,7 +164,7 @@ mkshop(void)
break; break;
} }
if (!sroom->rlit) { if (!sroom->rlit) {
int x, y; coordxy x, y;
for (x = sroom->lx - 1; x <= sroom->hx + 1; x++) for (x = sroom->lx - 1; x <= sroom->hx + 1; x++)
for (y = sroom->ly - 1; y <= sroom->hy + 1; y++) for (y = sroom->ly - 1; y <= sroom->hy + 1; y++)
@@ -240,7 +240,7 @@ mkzoo(int type)
} }
static void static void
mk_zoo_thronemon(int x,int y) mk_zoo_thronemon(coordxy x, coordxy y)
{ {
int i = rnd(level_difficulty()); int i = rnd(level_difficulty());
int pm = (i > 9) ? PM_OGRE_TYRANT int pm = (i > 9) ? PM_OGRE_TYRANT
@@ -263,7 +263,8 @@ fill_zoo(struct mkroom* sroom)
{ {
struct monst *mon; struct monst *mon;
register int sx, sy, i; 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); int rmno = (int) ((sroom - g.rooms) + ROOMOFFSET);
coord mm; coord mm;
@@ -511,7 +512,8 @@ static void
mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ mkswamp(void) /* Michiel Huisjes & Fred de Wilde */
{ {
register struct mkroom *sroom; register struct mkroom *sroom;
register int sx, sy, i, eelct = 0; register int i, eelct = 0;
coordxy sx, sy;
int rmno; int rmno;
for (i = 0; i < 5; i++) { /* turn up to 5 rooms swampy */ for (i = 0; i < 5; i++) { /* turn up to 5 rooms swampy */
+11 -10
View File
@@ -59,7 +59,7 @@ sanity_check_single_mon(
const char *msg) const char *msg)
{ {
struct permonst *mptr = mtmp->data; 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]) { if (!mptr || mptr < &mons[LOW_PM] || mptr >= &mons[NUMMONS]) {
/* most sanity checks issue warnings if they detect a problem, /* most sanity checks issue warnings if they detect a problem,
@@ -201,7 +201,7 @@ sanity_check_single_mon(
void void
mon_sanity_check(void) mon_sanity_check(void)
{ {
int x, y; coordxy x, y;
struct monst *mtmp, *m; struct monst *mtmp, *m;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
@@ -498,7 +498,7 @@ make_corpse(struct monst *mtmp, unsigned int corpseflags)
int num; int num;
struct obj *obj = (struct obj *) 0; struct obj *obj = (struct obj *) 0;
struct obj *otmp = (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); int mndx = monsndx(mdat);
unsigned corpstatflags = corpseflags; unsigned corpstatflags = corpseflags;
boolean burythem = ((corpstatflags & CORPSTAT_BURIED) != 0); boolean burythem = ((corpstatflags & CORPSTAT_BURIED) != 0);
@@ -1377,7 +1377,7 @@ meatcorpse(struct monst* mtmp) /* for purple worms and other voracious monsters
struct obj *otmp; struct obj *otmp;
struct permonst *ptr, *original_ptr = mtmp->data, *corpsepm; struct permonst *ptr, *original_ptr = mtmp->data, *corpsepm;
boolean poly, grow, heal, eyes = FALSE, vis = canseemon(mtmp); 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 a pet, eating is handled separately, in dog.c */
if (mtmp->mtame) if (mtmp->mtame)
@@ -2111,7 +2111,7 @@ mm_displacement(
/* Is the square close enough for the monster to move or attack into? */ /* Is the square close enough for the monster to move or attack into? */
boolean 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); int distance = dist2(mon->mx, mon->my, x, y);
@@ -2317,7 +2317,7 @@ dealloc_monst(struct monst *mon)
static void static void
mon_leaving_level(struct monst *mon) 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); boolean onmap = (isok(mx, my) && g.level.monsters[mx][my] == mon);
/* to prevent an infinite relobj-flooreffects-hmon-killed loop */ /* to prevent an infinite relobj-flooreffects-hmon-killed loop */
@@ -2518,7 +2518,7 @@ mondead(struct monst *mtmp)
spec_death = (g.disintegested /* disintegrated/digested */ spec_death = (g.disintegested /* disintegrated/digested */
|| noncorporeal(mtmp->data) || noncorporeal(mtmp->data)
|| amorphous(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; /* construct a format string before transformation;
will be capitalized when used, expects one %s arg */ will be capitalized when used, expects one %s arg */
@@ -2977,7 +2977,8 @@ xkilled(
struct monst *mtmp, struct monst *mtmp,
int xkill_flags) /* 1: suppress message, 2: suppress corpse, 4: pacifist */ 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 permonst *mdat;
struct obj *otmp; struct obj *otmp;
struct trap *t; struct trap *t;
@@ -3219,7 +3220,7 @@ vamp_stone(struct monst *mtmp)
{ {
if (is_vampshifter(mtmp)) { if (is_vampshifter(mtmp)) {
int mndx = mtmp->cham; int mndx = mtmp->cham;
int x = mtmp->mx, y = mtmp->my; coordxy x = mtmp->mx, y = mtmp->my;
/* this only happens if shapeshifted */ /* this only happens if shapeshifted */
if (mndx >= LOW_PM && mndx != monsndx(mtmp->data) if (mndx >= LOW_PM && mndx != monsndx(mtmp->data)
@@ -3756,7 +3757,7 @@ wake_nearby(void)
/* Wake up monsters near some particular location. */ /* Wake up monsters near some particular location. */
void void
wake_nearto(int x, int y, int distance) wake_nearto(coordxy x, coordxy y, int distance)
{ {
struct monst *mtmp; struct monst *mtmp;
+10 -9
View File
@@ -85,7 +85,7 @@ mon_yells(struct monst* mon, const char* shout)
static void static void
watch_on_duty(register struct monst* mtmp) 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) if (mtmp->mpeaceful && in_town(u.ux + u.dx, u.uy + u.dy)
&& mtmp->mcansee && m_canseeu(mtmp) && !rn2(3)) { && mtmp->mcansee && m_canseeu(mtmp) && !rn2(3)) {
@@ -118,7 +118,7 @@ dochugw(
* so perform stop-what-you're-doing-if-close-enough- * so perform stop-what-you're-doing-if-close-enough-
* to-be-a-threat check but don't move mtmp */ * 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 */ /* skip canspotmon() if occupation is Null */
boolean already_saw_mon = (chug && g.occupation) ? canspotmon(mtmp) : 0; boolean already_saw_mon = (chug && g.occupation) ? canspotmon(mtmp) : 0;
int rd = chug ? dochug(mtmp) : 0; int rd = chug ? dochug(mtmp) : 0;
@@ -148,7 +148,7 @@ dochugw(
} }
boolean 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: /* creatures who are directly resistant to magical scaring:
* humans aren't monsters * humans aren't monsters
@@ -1200,8 +1200,8 @@ m_move(register struct monst* mtmp, register int after)
{ {
register int minr = SQSRCHRADIUS; /* not too far away */ register int minr = SQSRCHRADIUS; /* not too far away */
register struct obj *otmp; register struct obj *otmp;
register int xx, yy; register coordxy xx, yy;
int oomx, oomy, lmx, lmy; coordxy oomx, oomy, lmx, lmy;
/* cut down the search radius if it thinks character is closer. */ /* cut down the search radius if it thinks character is closer. */
if (distmin(mtmp->mux, mtmp->muy, omx, omy) < SQSRCHRADIUS if (distmin(mtmp->mux, mtmp->muy, omx, omy) < SQSRCHRADIUS
@@ -1750,7 +1750,7 @@ m_move_aggress(struct monst* mtmp, coordxy x, coordxy y)
} }
void 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].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR;
levl[x][y].flags = 0; levl[x][y].flags = 0;
@@ -1760,14 +1760,14 @@ dissolve_bars(register int x, register int y)
} }
boolean boolean
closed_door(register int x, register int y) closed_door(coordxy x, coordxy y)
{ {
return (boolean) (IS_DOOR(levl[x][y].typ) return (boolean) (IS_DOOR(levl[x][y].typ)
&& (levl[x][y].doormask & (D_LOCKED | D_CLOSED))); && (levl[x][y].doormask & (D_LOCKED | D_CLOSED)));
} }
boolean boolean
accessible(register int x, register int y) accessible(coordxy x, coordxy y)
{ {
int levtyp = levl[x][y].typ; int levtyp = levl[x][y].typ;
@@ -1783,7 +1783,8 @@ void
set_apparxy(register struct monst* mtmp) set_apparxy(register struct monst* mtmp)
{ {
boolean notseen, notthere, gotu; 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); long umoney = money_cnt(g.invent);
/* /*
+10 -10
View File
@@ -9,7 +9,7 @@ static int monmulti(struct monst *, struct obj *, struct obj *);
static void monshoot(struct monst *, struct obj *, struct obj *); static void monshoot(struct monst *, struct obj *, struct obj *);
static boolean ucatchgem(struct obj *, struct monst *); static boolean ucatchgem(struct obj *, struct monst *);
static const char* breathwep_name(int); 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 *); static int m_lined_up(struct monst *, struct monst *);
#define URETREATING(x, y) \ #define URETREATING(x, y) \
@@ -156,8 +156,8 @@ static int
drop_throw( drop_throw(
register struct obj *obj, register struct obj *obj,
boolean ohit, boolean ohit,
int x, coordxy x,
int y) coordxy y)
{ {
int retvalu = 1; int retvalu = 1;
int create; int create;
@@ -544,8 +544,8 @@ ucatchgem(
void void
m_throw( m_throw(
struct monst *mon, /* launching monster */ struct monst *mon, /* launching monster */
int x, int y, /* launch point */ coordxy x, coordxy y, /* launch point */
int dx, int dy, /* direction */ coordxy dx, coordxy dy, /* direction */
int range, /* maximum distance */ int range, /* maximum distance */
struct obj *obj) /* missile (or stack providing it) */ struct obj *obj) /* missile (or stack providing it) */
{ {
@@ -1076,7 +1076,7 @@ linedup_callback(
coordxy ay, coordxy ay,
coordxy bx, coordxy bx,
coordxy by, coordxy by,
boolean (*fnc)(int, int)) boolean (*fnc)(coordxy, coordxy))
{ {
int dx, dy; int dx, dy;
@@ -1198,8 +1198,8 @@ m_carrying(struct monst* mtmp, int type)
void void
hit_bars( hit_bars(
struct obj **objp, /* *objp will be set to NULL if object breaks */ 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 */ coordxy objx, coordxy objy, /* hero's spot (when wielded) or missile's spot */
int barsx, int barsy, /* adjacent spot where bars are located */ coordxy barsx, coordxy barsy, /* adjacent spot where bars are located */
unsigned breakflags) /* breakage control */ unsigned breakflags) /* breakage control */
{ {
struct obj *otmp = *objp; struct obj *otmp = *objp;
@@ -1237,8 +1237,8 @@ hit_bars(
boolean boolean
hits_bars( hits_bars(
struct obj **obj_p, /* *obj_p will be set to NULL if object breaks */ struct obj **obj_p, /* *obj_p will be set to NULL if object breaks */
int x, int y, coordxy x, coordxy y,
int barsx, int barsy, coordxy barsx, coordxy barsy,
int always_hit, /* caller can force a hit for items which would int always_hit, /* caller can force a hit for items which would
* fit through */ * fit through */
int whodidit) /* 1==hero, 0=other, -1==just check whether it int whodidit) /* 1==hero, 0=other, -1==just check whether it
+15 -13
View File
@@ -20,7 +20,7 @@ static void mplayhorn(struct monst *, struct obj *, boolean);
static void mreadmsg(struct monst *, struct obj *); static void mreadmsg(struct monst *, struct obj *);
static void mquaffmsg(struct monst *, struct obj *); static void mquaffmsg(struct monst *, struct obj *);
static boolean m_use_healing(struct monst *); 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 void m_use_undead_turning(struct monst *, struct obj *);
static int mbhitm(struct monst *, struct obj *); static int mbhitm(struct monst *, struct obj *);
static void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P), static void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P),
@@ -327,7 +327,8 @@ find_defensive(struct monst* mtmp)
{ {
struct obj *obj; struct obj *obj;
struct trap *t; 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), boolean stuck = (mtmp == u.ustuck),
immobile = (mtmp->data->mmove == 0); immobile = (mtmp->data->mmove == 0);
stairway *stway; stairway *stway;
@@ -459,7 +460,7 @@ find_defensive(struct monst* mtmp)
} }
} else { } else {
/* Note: trap doors take precedence over teleport traps. */ /* 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) boolean ignore_boulders = (verysmall(mtmp->data)
|| throws_rocks(mtmp->data) || throws_rocks(mtmp->data)
|| passes_walls(mtmp->data)), || passes_walls(mtmp->data)),
@@ -514,7 +515,7 @@ find_defensive(struct monst* mtmp)
goto botm; goto botm;
if (is_mercenary(mtmp->data) && (obj = m_carrying(mtmp, BUGLE)) != 0) { if (is_mercenary(mtmp->data) && (obj = m_carrying(mtmp, BUGLE)) != 0) {
int xx, yy; coordxy xx, yy;
struct monst *mon; struct monst *mon;
/* Distance is arbitrary. What we really want to do is /* Distance is arbitrary. What we really want to do is
@@ -1129,7 +1130,7 @@ rnd_defensive_item(struct monst* mtmp)
* redefine; nonconsecutive value is ok */ * redefine; nonconsecutive value is ok */
static boolean static boolean
linedup_chk_corpse(int x, int y) linedup_chk_corpse(coordxy x, coordxy y)
{ {
return (sobj_at(CORPSE, x, y) != 0); return (sobj_at(CORPSE, x, y) != 0);
} }
@@ -1137,9 +1138,9 @@ linedup_chk_corpse(int x, int y)
static void static void
m_use_undead_turning(struct monst* mtmp, struct obj* obj) m_use_undead_turning(struct monst* mtmp, struct obj* obj)
{ {
int ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3, coordxy ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3,
ay = u.uy + sgn(mtmp->muy - mtmp->my) * 3; ay = u.uy + sgn(mtmp->muy - mtmp->my) * 3;
int bx = mtmp->mx, by = mtmp->my; coordxy bx = mtmp->mx, by = mtmp->my;
if (!(obj->otyp == WAN_UNDEAD_TURNING && obj->spe > 0)) if (!(obj->otyp == WAN_UNDEAD_TURNING && obj->spe > 0))
return; return;
@@ -1468,7 +1469,7 @@ mbhit(
ddy = sgn(mon->muy - mon->my); ddy = sgn(mon->muy - mon->my);
while (range-- > 0) { while (range-- > 0) {
int x, y; coordxy x, y;
g.bhitpos.x += ddx; g.bhitpos.x += ddx;
g.bhitpos.y += ddy; g.bhitpos.y += ddy;
@@ -1589,7 +1590,7 @@ use_offensive(struct monst* mtmp)
return 2; return 2;
case MUSE_SCR_EARTH: { case MUSE_SCR_EARTH: {
/* TODO: handle steeds */ /* TODO: handle steeds */
register int x, y; coordxy x, y;
/* don't use monster fields after killing it */ /* don't use monster fields after killing it */
boolean confused = (mtmp->mconf ? TRUE : FALSE); boolean confused = (mtmp->mconf ? TRUE : FALSE);
int mmx = mtmp->mx, mmy = mtmp->my; int mmx = mtmp->mx, mmy = mtmp->my;
@@ -1774,9 +1775,10 @@ find_misc(struct monst* mtmp)
{ {
register struct obj *obj; register struct obj *obj;
struct permonst *mdat = mtmp->data; struct permonst *mdat = mtmp->data;
int x = mtmp->mx, y = mtmp->my; coordxy x = mtmp->mx, y = mtmp->my;
struct trap *t; struct trap *t;
int xx, yy, pmidx = NON_PM; coordxy xx, yy;
int pmidx = NON_PM;
boolean immobile = (mdat->mmove == 0); boolean immobile = (mdat->mmove == 0);
boolean stuck = (mtmp == u.ustuck); boolean stuck = (mtmp == u.ustuck);
@@ -2704,7 +2706,7 @@ munslime(struct monst* mon, boolean by_you)
if (((t = t_at(mon->mx, mon->my)) == 0 || t->ttyp != FIRE_TRAP) if (((t = t_at(mon->mx, mon->my)) == 0 || t->ttyp != FIRE_TRAP)
&& mptr->mmove && !mon->mtrapped) { && 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 (x = mon->mx - 1; x <= mon->mx + 1; ++x)
for (y = mon->my - 1; y <= mon->my + 1; ++y) for (y = mon->my - 1; y <= mon->my + 1; ++y)
+2 -2
View File
@@ -221,7 +221,7 @@ static void
do_earthquake(int force) do_earthquake(int force)
{ {
static const char into_a_chasm[] = " into a chasm"; static const char into_a_chasm[] = " into a chasm";
register int x, y; register coordxy x, y;
struct monst *mtmp; struct monst *mtmp;
struct obj *otmp; struct obj *otmp;
struct trap *chasm, *trap_at_u = t_at(u.ux, u.uy); struct trap *chasm, *trap_at_u = t_at(u.ux, u.uy);
@@ -689,7 +689,7 @@ do_play_instrument(struct obj* instr)
{ {
char buf[BUFSZ] = DUMMY, c = 'y'; char buf[BUFSZ] = DUMMY, c = 'y';
char *s; char *s;
int x, y; coordxy x, y;
boolean ok; boolean ok;
if (Underwater) { if (Underwater) {
+6 -6
View File
@@ -359,10 +359,10 @@ l_obj_at(lua_State *L)
int argc = lua_gettop(L); int argc = lua_gettop(L);
if (argc == 2) { if (argc == 2) {
int x, y; coordxy x, y;
x = (int) luaL_checkinteger(L, 1); x = (coordxy) luaL_checkinteger(L, 1);
y = (int) luaL_checkinteger(L, 2); y = (coordxy) luaL_checkinteger(L, 2);
lua_pop(L, 2); lua_pop(L, 2);
(void) l_obj_push(L, g.level.objects[x][y]); (void) l_obj_push(L, g.level.objects[x][y]);
return 1; return 1;
@@ -379,13 +379,13 @@ l_obj_placeobj(lua_State *L)
{ {
int argc = lua_gettop(L); int argc = lua_gettop(L);
struct _lua_obj *lo = l_obj_check(L, 1); struct _lua_obj *lo = l_obj_check(L, 1);
int x, y; coordxy x, y;
if (argc != 3) if (argc != 3)
nhl_error(L, "l_obj_placeobj: Wrong args"); nhl_error(L, "l_obj_placeobj: Wrong args");
x = (int) luaL_checkinteger(L, 2); x = (coordxy) luaL_checkinteger(L, 2);
y = (int) luaL_checkinteger(L, 3); y = (coordxy) luaL_checkinteger(L, 3);
lua_pop(L, 3); lua_pop(L, 3);
if (lobj_is_ok(lo)) { if (lobj_is_ok(lo)) {
+1 -1
View File
@@ -181,7 +181,7 @@ l_selection_getpoint(lua_State *L)
{ {
struct selectionvar *sel = l_selection_check(L, 1); struct selectionvar *sel = l_selection_check(L, 1);
coordxy x, y; coordxy x, y;
int ix, iy; lua_Integer ix, iy;
int val; int val;
long crd; long crd;
+49 -23
View File
@@ -380,12 +380,15 @@ splev_typ2chr(schar typ)
static int static int
nhl_gettrap(lua_State *L) 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"); nhl_error(L, "Incorrect arguments");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (isok(x, y)) { if (isok(x, y)) {
struct trap *ttmp = t_at(x,y); struct trap *ttmp = t_at(x,y);
@@ -427,12 +430,15 @@ nhl_gettrap(lua_State *L)
static int static int
nhl_deltrap(lua_State *L) 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"); nhl_error(L, "Incorrect arguments");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (isok(x, y)) { if (isok(x, y)) {
struct trap *ttmp = t_at(x,y); struct trap *ttmp = t_at(x,y);
@@ -448,21 +454,21 @@ nhl_deltrap(lua_State *L)
return TRUE if there are such params in the stack. return TRUE if there are such params in the stack.
*/ */
boolean 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); int argc = lua_gettop(L);
boolean ret = FALSE; boolean ret = FALSE;
if (argc == 2) { if (argc == 2) {
*x = (int) lua_tointeger(L, 1); *x = lua_tointeger(L, 1);
*y = (int) lua_tointeger(L, 2); *y = lua_tointeger(L, 2);
ret = TRUE; ret = TRUE;
} else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) { } else if (argc == 1 && lua_type(L, 1) == LUA_TTABLE) {
lua_Integer ax, ay; lua_Integer ax, ay;
ret = get_coord(L, 1, &ax, &ay); ret = get_coord(L, 1, &ax, &ay);
*x = (int) ax; *x = ax;
*y = (int) ay; *y = ay;
} }
return ret; return ret;
} }
@@ -474,13 +480,17 @@ DISABLE_WARNING_UNREACHABLE_CODE
static int static int
nhl_getmap(lua_State *L) 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"); nhl_error(L, "Incorrect arguments");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (isok(x, y)) { if (isok(x, y)) {
char buf[BUFSZ]; char buf[BUFSZ];
lua_newtable(L); lua_newtable(L);
@@ -1038,7 +1048,7 @@ nhl_stairways(lua_State *L)
static int static int
nhl_test(lua_State *L) nhl_test(lua_State *L)
{ {
int x, y; coordxy x, y;
char *name, Player[] = "Player"; char *name, Player[] = "Player";
/* discard any extra arguments passed in */ /* discard any extra arguments passed in */
@@ -1046,11 +1056,11 @@ nhl_test(lua_State *L)
luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 1, LUA_TTABLE);
x = get_table_int(L, "x"); x = (coordxy) get_table_int(L, "x");
y = get_table_int(L, "y"); y = (coordxy) get_table_int(L, "y");
name = get_table_str_opt(L, "name", Player); 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); free(name);
@@ -1141,15 +1151,19 @@ nhl_timer_has_at(lua_State *L)
{ {
boolean ret = FALSE; boolean ret = FALSE;
short timertype = nhl_get_timertype(L, -1); short timertype = nhl_get_timertype(L, -1);
int x, y; lua_Integer lx, ly;
coordxy x, y;
long when; long when;
lua_pop(L, 1); /* remove timertype */ 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"); nhl_error(L, "nhl_timer_has_at: Wrong args");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (isok(x, y)) { if (isok(x, y)) {
when = spot_time_expires(x, y, timertype); when = spot_time_expires(x, y, timertype);
ret = (when > 0L); ret = (when > 0L);
@@ -1166,14 +1180,18 @@ nhl_timer_peek_at(lua_State *L)
{ {
long when = 0L; long when = 0L;
short timertype = nhl_get_timertype(L, -1); short timertype = nhl_get_timertype(L, -1);
int x, y; lua_Integer lx, ly;
coordxy x, y;
lua_pop(L, 1); /* remove timertype */ 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"); nhl_error(L, "nhl_timer_peek_at: Wrong args");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (timer_is_pos(timertype) && isok(x, y)) if (timer_is_pos(timertype) && isok(x, y))
when = spot_time_expires(x, y, timertype); when = spot_time_expires(x, y, timertype);
lua_pushinteger(L, when); lua_pushinteger(L, when);
@@ -1187,14 +1205,18 @@ static int
nhl_timer_stop_at(lua_State *L) nhl_timer_stop_at(lua_State *L)
{ {
short timertype = nhl_get_timertype(L, -1); short timertype = nhl_get_timertype(L, -1);
int x, y; lua_Integer lx, ly;
coordxy x, y;
lua_pop(L, 1); /* remove timertype */ 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"); nhl_error(L, "nhl_timer_stop_at: Wrong args");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (timer_is_pos(timertype) && isok(x, y)) if (timer_is_pos(timertype) && isok(x, y))
spot_stop_timers(x, y, timertype); spot_stop_timers(x, y, timertype);
return 0; return 0;
@@ -1207,14 +1229,18 @@ nhl_timer_start_at(lua_State *L)
{ {
short timertype = nhl_get_timertype(L, -2); short timertype = nhl_get_timertype(L, -2);
long when = lua_tointeger(L, -1); long when = lua_tointeger(L, -1);
int x, y; lua_Integer lx, ly;
coordxy x, y;
lua_pop(L, 2); /* remove when and timertype */ 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"); nhl_error(L, "nhl_timer_start_at: Wrong args");
return 0; return 0;
} }
x = (coordxy) lx;
y = (coordxy) ly;
if (timer_is_pos(timertype) && isok(x, y)) { if (timer_is_pos(timertype) && isok(x, y)) {
long where = ((long) x << 16) | (long) y; long where = ((long) x << 16) | (long) y;
+2 -1
View File
@@ -3199,7 +3199,8 @@ wizterrainwish(struct _readobjnam_data *d)
{ {
struct rm *lev; struct rm *lev;
boolean madeterrain = FALSE, badterrain = FALSE, didblock; 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; char *bp = d->bp, *p = d->p;
for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) { for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) {
+21 -16
View File
@@ -11,15 +11,15 @@
static boolean is_swallow_sym(int); static boolean is_swallow_sym(int);
static int append_str(char *, const char *); static int append_str(char *, const char *);
static void trap_description(char *, int, int, int); static void trap_description(char *, int, coordxy, coordxy);
static void look_at_object(char *, int, int, int); static void look_at_object(char *, coordxy, coordxy, int);
static void look_at_monster(char *, char *, struct monst *, int, int); static void look_at_monster(char *, char *, struct monst *, coordxy, coordxy);
static struct permonst *lookat(int, int, char *, char *); static struct permonst *lookat(coordxy, coordxy, char *, char *);
static void checkfile(char *, struct permonst *, boolean, boolean, char *); static void checkfile(char *, struct permonst *, boolean, boolean, char *);
static int add_cmap_descr(int, int, int, int, coord, static int add_cmap_descr(int, int, int, int, coord,
const char *, const char *, const char *, const char *,
boolean *, const char **, 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_all(boolean, boolean);
static void look_traps(boolean); static void look_traps(boolean);
static void do_supplemental_info(char *, struct permonst *, boolean); static void do_supplemental_info(char *, struct permonst *, boolean);
@@ -143,7 +143,7 @@ monhealthdescr(struct monst *mon, boolean addspace, char *outbuf)
/* copy a trap's description into outbuf[] */ /* copy a trap's description into outbuf[] */
static void 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 * Trap detection used to display a bear trap at locations having
@@ -169,8 +169,8 @@ mhidden_description(
{ {
struct obj *otmp; struct obj *otmp;
boolean fakeobj, isyou = (mon == &g.youmonst); boolean fakeobj, isyou = (mon == &g.youmonst);
int x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my, coordxy x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my;
glyph = (g.level.flags.hero_memory && !isyou) ? levl[x][y].glyph int glyph = (g.level.flags.hero_memory && !isyou) ? levl[x][y].glyph
: glyph_at(x, y); : glyph_at(x, y);
*outbuf = '\0'; *outbuf = '\0';
@@ -220,7 +220,7 @@ mhidden_description(
/* extracted from lookat(); also used by namefloorobj() */ /* extracted from lookat(); also used by namefloorobj() */
boolean 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; boolean fakeobj = FALSE, mimic_obj = FALSE;
struct monst *mtmp; struct monst *mtmp;
@@ -295,7 +295,7 @@ object_from_map(int glyph, int x, int y, struct obj **obj_p)
static void static void
look_at_object(char *buf, /* output buffer */ look_at_object(char *buf, /* output buffer */
int x, int y, int glyph) coordxy x, coordxy y, int glyph)
{ {
struct obj *otmp = 0; struct obj *otmp = 0;
boolean fakeobj = object_from_map(glyph, x, y, &otmp); boolean fakeobj = object_from_map(glyph, x, y, &otmp);
@@ -331,7 +331,7 @@ static void
look_at_monster(char *buf, look_at_monster(char *buf,
char *monbuf, /* buf: output, monbuf: optional output */ char *monbuf, /* buf: output, monbuf: optional output */
struct monst *mtmp, struct monst *mtmp,
int x, int y) coordxy x, coordxy y)
{ {
char *name, monnambuf[BUFSZ], healthbuf[BUFSZ]; char *name, monnambuf[BUFSZ], healthbuf[BUFSZ];
boolean accurate = !Hallucination; boolean accurate = !Hallucination;
@@ -524,7 +524,7 @@ waterbody_name(coordxy x, coordxy y)
* If not hallucinating and the glyph is a monster, also monster data. * If not hallucinating and the glyph is a monster, also monster data.
*/ */
static struct permonst * 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 monst *mtmp = (struct monst *) 0;
struct permonst *pm = (struct permonst *) 0; struct permonst *pm = (struct permonst *) 0;
@@ -1632,7 +1632,9 @@ do_look(int mode, coord *click_cc)
} }
static void 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_y = nearby ? max(u.uy - BOLT_LIM, 0) : 0;
*lo_x = nearby ? max(u.ux - BOLT_LIM, 1) : 1; *lo_x = nearby ? max(u.ux - BOLT_LIM, 1) : 1;
@@ -1648,7 +1650,8 @@ look_all(
boolean do_mons) /* True => monsters, False => objects */ boolean do_mons) /* True => monsters, False => objects */
{ {
winid win; 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]; char lookbuf[BUFSZ], outbuf[BUFSZ];
win = create_nhwindow(NHW_TEXT); win = create_nhwindow(NHW_TEXT);
@@ -1736,7 +1739,8 @@ look_traps(boolean nearby)
{ {
winid win; winid win;
struct trap *t; 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]; char lookbuf[BUFSZ], outbuf[BUFSZ];
win = create_nhwindow(NHW_TEXT); win = create_nhwindow(NHW_TEXT);
@@ -1900,7 +1904,8 @@ int
doidtrap(void) doidtrap(void)
{ {
register struct trap *trap; register struct trap *trap;
int x, y, tt, glyph; int tt, glyph;
coordxy x, y;
if (!getdir("^")) if (!getdir("^"))
return ECMD_CANCEL; return ECMD_CANCEL;
+7 -6
View File
@@ -45,9 +45,9 @@ static struct obj *tipcontainer_gettarget(struct obj *, boolean *);
static int tipcontainer_checks(struct obj *, boolean); static int tipcontainer_checks(struct obj *, boolean);
static char in_or_out_menu(const char *, struct obj *, boolean, boolean, static char in_or_out_menu(const char *, struct obj *, boolean, boolean,
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 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 do_loot_cont(struct obj **, int, int);
static int doloot_core(void); static int doloot_core(void);
static void tipcontainer(struct obj *); static void tipcontainer(struct obj *);
@@ -1821,7 +1821,7 @@ encumber_msg(void)
/* Is there a container at x,y. Optional: return count of containers at x,y */ /* Is there a container at x,y. Optional: return count of containers at x,y */
int int
container_at(int x, int y, boolean countem) container_at(coordxy x, coordxy y, boolean countem)
{ {
struct obj *cobj, *nobj; struct obj *cobj, *nobj;
int container_count = 0; int container_count = 0;
@@ -1839,7 +1839,7 @@ container_at(int x, int y, boolean countem)
static boolean static boolean
able_to_loot( able_to_loot(
int x, int y, coordxy x, coordxy y,
boolean looting) /* loot vs tip */ boolean looting) /* loot vs tip */
{ {
const char *verb = looting ? "loot" : "tip"; const char *verb = looting ? "loot" : "tip";
@@ -1869,9 +1869,10 @@ able_to_loot(
} }
static boolean 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 (i = -1; i <= 1; i++)
for (j = -1; j <= 1; j++) { for (j = -1; j <= 1; j++) {
+2 -2
View File
@@ -2244,7 +2244,7 @@ doturn(void)
} }
int int
altarmask_at(int x, int y) altarmask_at(coordxy x, coordxy y)
{ {
int res = 0; int res = 0;
@@ -2406,7 +2406,7 @@ align_gtitle(aligntyp alignment)
} }
void void
altar_wrath(int x, int y) altar_wrath(coordxy x, coordxy y)
{ {
aligntyp altaralign = a_align(x, y); aligntyp altaralign = a_align(x, y);
+2 -1
View File
@@ -744,7 +744,8 @@ in_your_sanctuary(
void void
ghod_hitsu(struct monst *priest) 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; struct mkroom *troom;
if (!roomno || !has_shrine(priest)) if (!roomno || !has_shrine(priest))
+9 -9
View File
@@ -18,7 +18,7 @@ static void p_glow1(struct obj *);
static void p_glow2(struct obj *, const char *); static void p_glow2(struct obj *, const char *);
static void forget(int); static void forget(int);
static int maybe_tame(struct monst *, struct obj *); 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 display_stinking_cloud_positions(int);
static void seffect_enchant_armor(struct obj **); static void seffect_enchant_armor(struct obj **);
static void seffect_destroy_armor(struct obj **); static void seffect_destroy_armor(struct obj **);
@@ -45,7 +45,7 @@ static void seffect_magic_mapping(struct obj **);
#ifdef MAIL_STRUCTURES #ifdef MAIL_STRUCTURES
static void seffect_mail(struct obj **); static void seffect_mail(struct obj **);
#endif /* MAIL_STRUCTURES */ #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_class_genocide(void);
static void do_stinking_cloud(struct obj *, boolean); static void do_stinking_cloud(struct obj *, boolean);
static boolean create_particular_parse(char *, static boolean create_particular_parse(char *,
@@ -1032,7 +1032,7 @@ maybe_tame(struct monst* mtmp, struct obj* sobj)
* NOT the same thing as can_center_cloud. * NOT the same thing as can_center_cloud.
*/ */
boolean boolean
valid_cloud_pos(int x, int y) valid_cloud_pos(coordxy x, coordxy y)
{ {
if (!isok(x,y)) if (!isok(x,y))
return FALSE; return FALSE;
@@ -1043,7 +1043,7 @@ valid_cloud_pos(int x, int y)
* should have its regular effects, or not because it was out of range. * should have its regular effects, or not because it was out of range.
*/ */
static boolean static boolean
can_center_cloud(int x, int y) can_center_cloud(coordxy x, coordxy y)
{ {
if (!valid_cloud_pos(x, y)) if (!valid_cloud_pos(x, y))
return FALSE; return FALSE;
@@ -1056,7 +1056,7 @@ display_stinking_cloud_positions(int state)
if (state == 0) { if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) { } else if (state == 1) {
int x, y, dx, dy; coordxy x, y, dx, dy;
int dist = 6; int dist = 6;
for (dx = -dist; dx <= dist; dx++) for (dx = -dist; dx <= dist; dx++)
@@ -1780,7 +1780,7 @@ seffect_earth(struct obj **sobjp)
/* TODO: handle steeds */ /* TODO: handle steeds */
if (!Is_rogue_level(&u.uz) && has_ceiling(&u.uz) if (!Is_rogue_level(&u.uz) && has_ceiling(&u.uz)
&& (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) {
register int x, y; coordxy x, y;
int nboulders = 0; int nboulders = 0;
/* Identify the scroll */ /* Identify the scroll */
@@ -1961,7 +1961,7 @@ seffect_magic_mapping(struct obj **sobjp)
return; return;
} }
if (sblessed) { if (sblessed) {
register int x, y; coordxy x, y;
for (x = 1; x < COLNO; x++) for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) for (y = 0; y < ROWNO; y++)
@@ -2170,7 +2170,7 @@ drop_boulder_on_player(boolean confused, boolean helmet_protects, boolean byu, b
} }
boolean 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 obj *otmp2;
register struct monst *mtmp; register struct monst *mtmp;
@@ -2300,7 +2300,7 @@ static struct litmon *gremlins = 0;
* Low-level lit-field update routine. * Low-level lit-field update routine.
*/ */
static void static void
set_lit(int x, int y, genericptr_t val) set_lit(coordxy x, coordxy y, genericptr_t val)
{ {
struct monst *mtmp; struct monst *mtmp;
struct litmon *gremlin; struct litmon *gremlin;
+46 -43
View File
@@ -14,7 +14,7 @@
#include "hack.h" #include "hack.h"
#include "sp_lev.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 *); extern void mkmap(lev_init *);
@@ -27,7 +27,7 @@ static void flip_drawbridge_horizontal(struct rm *);
static void flip_drawbridge_vertical(struct rm *); static void flip_drawbridge_vertical(struct rm *);
static void flip_visuals(int, int, int, int, int); static void flip_visuals(int, int, int, int, int);
static int flip_encoded_direction_bits(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 set_wall_property(coordxy, coordxy, coordxy, coordxy, int);
static void count_features(void); static void count_features(void);
static void remove_boundary_syms(void); static void remove_boundary_syms(void);
@@ -49,7 +49,7 @@ static boolean create_subroom(struct mkroom *, coordxy, coordxy, coordxy,
static void create_door(room_door *, struct mkroom *); static void create_door(room_door *, struct mkroom *);
static void create_trap(spltrap *, struct mkroom *); static void create_trap(spltrap *, struct mkroom *);
static int noncoalignment(aligntyp); 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 int pm_to_humidity(struct permonst *);
static unsigned int sp_amask_to_amask(unsigned int sp_amask); static unsigned int sp_amask_to_amask(unsigned int sp_amask);
static void create_monster(monster *, struct mkroom *); static void create_monster(monster *, struct mkroom *);
@@ -62,6 +62,8 @@ static void light_region(region *);
static void maze1xy(coord *, int); static void maze1xy(coord *, int);
static void fill_empty_maze(void); static void fill_empty_maze(void);
static void splev_initlev(lev_init *); static void splev_initlev(lev_init *);
static boolean generate_way_out_method(coordxy nx, coordxy ny,
struct selectionvar *ov);
#if 0 #if 0
/* macosx complains that these are unused */ /* macosx complains that these are unused */
static long sp_code_jmpaddr(long, long); static long sp_code_jmpaddr(long, long);
@@ -79,7 +81,7 @@ static void spo_mazewalk(struct sp_coder *);
static void spo_wall_property(struct sp_coder *); static void spo_wall_property(struct sp_coder *);
static void spo_room_door(struct sp_coder *); static void spo_room_door(struct sp_coder *);
static void spo_wallify(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 #endif
static void spo_end_moninvent(void); static void spo_end_moninvent(void);
static void spo_pop_container(void); static void spo_pop_container(void);
@@ -88,22 +90,22 @@ static void spo_endroom(struct sp_coder *);
static void l_table_getset_feature_flag(lua_State *, int, int, const char *, static void l_table_getset_feature_flag(lua_State *, int, int, const char *,
int); int);
static void l_get_lregion(lua_State *, lev_region *); 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 add_doors_to_room(struct mkroom *);
static void selection_iterate(struct selectionvar *, select_iter_func, static void selection_iterate(struct selectionvar *, select_iter_func,
genericptr_t); genericptr_t);
static void sel_set_ter(int, int, genericptr_t); static void sel_set_ter(coordxy, coordxy, genericptr_t);
static void sel_set_door(int, int, genericptr_t); static void sel_set_door(coordxy, coordxy, genericptr_t);
static void sel_set_feature(int, int, genericptr_t); static void sel_set_feature(coordxy, coordxy, genericptr_t);
static void levregion_add(lev_region *); static void levregion_add(lev_region *);
static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *); static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *);
static int get_table_region(lua_State *, const char *, lua_Integer *, static int get_table_region(lua_State *, const char *, lua_Integer *,
lua_Integer *, lua_Integer *, lua_Integer *, boolean); lua_Integer *, lua_Integer *, lua_Integer *, boolean);
static void set_wallprop_in_selection(lua_State *, int); static void set_wallprop_in_selection(lua_State *, int);
static coordxy random_wdir(void); static coordxy random_wdir(void);
static int floodfillchk_match_under(int, int); static int floodfillchk_match_under(coordxy, coordxy);
static int floodfillchk_match_accessible(int, int); static int floodfillchk_match_accessible(coordxy, coordxy);
static boolean sel_flood_havepoint(int, int, coordxy *, coordxy *, int); static boolean sel_flood_havepoint(coordxy, coordxy, coordxy *, coordxy *, int);
static long line_dist_coord(long, long, long, long, long, long); static long line_dist_coord(long, long, long, long, long, long);
static void l_push_mkroom_table(lua_State *, struct mkroom *); static void l_push_mkroom_table(lua_State *, struct mkroom *);
static int get_table_align(lua_State *); static int get_table_align(lua_State *);
@@ -485,7 +487,7 @@ void
flip_level(int flp, boolean extras) flip_level(int flp, boolean extras)
{ {
int x, y, i, itmp; int x, y, i, itmp;
int minx, miny, maxx, maxy; coordxy minx, miny, maxx, maxy;
struct rm trm; struct rm trm;
struct trap *ttmp; struct trap *ttmp;
struct obj *otmp; struct obj *otmp;
@@ -855,7 +857,7 @@ flip_level_rnd(int flp, boolean extras)
static void 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; int prop = *(int *)arg;
@@ -1195,7 +1197,7 @@ is_ok_location(coordxy x, coordxy y, getloc_flags_t humidity)
} }
boolean 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)); return is_ok_location(x, y, pm_to_humidity(pm));
} }
@@ -1234,6 +1236,7 @@ get_location_coord(
*y = c.y; *y = c.y;
get_location(x, y, c.getloc_flags | (c.is_random ? NO_LOC_WARN : 0), get_location(x, y, c.getloc_flags | (c.is_random ? NO_LOC_WARN : 0),
croom); croom);
if (*x == -1 && *y == -1 && c.is_random) if (*x == -1 && *y == -1 && c.is_random)
get_location(x, y, humidity, croom); get_location(x, y, humidity, croom);
} }
@@ -1740,7 +1743,7 @@ noncoalignment(aligntyp alignment)
/* attempt to screen out locations where a mimic-as-boulder shouldn't occur */ /* attempt to screen out locations where a mimic-as-boulder shouldn't occur */
static boolean static boolean
m_bad_boulder_spot(int x, int y) m_bad_boulder_spot(coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
@@ -2707,9 +2710,9 @@ light_region(region* tmpregion)
} }
void 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); y1 = max(y1, 0);
x1 = max(x1, 1); x1 = max(x1, 1);
@@ -3901,17 +3904,17 @@ l_create_stairway(lua_State *L, boolean using_ladder)
lcheck_param_table(L); lcheck_param_table(L);
get_table_xy_or_coord(L, &ax, &ay); get_table_xy_or_coord(L, &ax, &ay);
up = stairdirs2i[get_table_option(L, "dir", "down", stairdirs)]; up = stairdirs2i[get_table_option(L, "dir", "down", stairdirs)];
x = ax; x = (coordxy) ax;
y = ay; y = (coordxy) ay;
} else { } else {
int ix = -1, iy = -1; lua_Integer ix = -1, iy = -1;
if (argc > 0 && ltype == LUA_TSTRING) { if (argc > 0 && ltype == LUA_TSTRING) {
up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)]; up = stairdirs2i[luaL_checkoption(L, 1, "down", stairdirs)];
lua_remove(L, 1); lua_remove(L, 1);
} }
nhl_get_xy_params(L, &ix, &iy); nhl_get_xy_params(L, &ix, &iy);
x = ix; x = (coordxy) ix;
y = iy; y = (coordxy) iy;
} }
if (x == -1 && y == -1) { if (x == -1 && y == -1) {
@@ -4331,7 +4334,7 @@ selection_clone(struct selectionvar* sel)
} }
coordxy coordxy
selection_getpoint(int x, int y, struct selectionvar* sel) selection_getpoint(coordxy x, coordxy y, struct selectionvar* sel)
{ {
if (!sel || !sel->map) if (!sel || !sel->map)
return 0; return 0;
@@ -4342,7 +4345,7 @@ selection_getpoint(int x, int y, struct selectionvar* sel)
} }
void 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) if (!sel || !sel->map)
return; return;
@@ -4453,7 +4456,7 @@ random_wdir(void)
void void
selection_do_grow(struct selectionvar* ov, int dir) selection_do_grow(struct selectionvar* ov, int dir)
{ {
int x, y; coordxy x, y;
struct selectionvar *tmp; struct selectionvar *tmp;
if (!ov) if (!ov)
@@ -4494,17 +4497,17 @@ selection_do_grow(struct selectionvar* ov, int dir)
selection_free(tmp, TRUE); 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; static schar floodfillchk_match_under_typ;
void void
set_selection_floodfillchk(int (*f)(int, int)) set_selection_floodfillchk(int (*f)(coordxy, coordxy))
{ {
selection_flood_check_func = f; selection_flood_check_func = f;
} }
static int 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); return (floodfillchk_match_under_typ == levl[x][y].typ);
} }
@@ -4517,7 +4520,7 @@ set_floodfillchk_match_under(coordxy typ)
} }
static int static int
floodfillchk_match_accessible(int x, int y) floodfillchk_match_accessible(coordxy x, coordxy y)
{ {
return (ACCESSIBLE(levl[x][y].typ) return (ACCESSIBLE(levl[x][y].typ)
|| levl[x][y].typ == SDOOR || levl[x][y].typ == SDOOR
@@ -4526,9 +4529,9 @@ floodfillchk_match_accessible(int x, int y)
/* check whethere <x,y> is already in xs[],ys[] */ /* check whethere <x,y> is already in xs[],ys[] */
static boolean 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) { while (n > 0) {
--n; --n;
@@ -4539,7 +4542,7 @@ sel_flood_havepoint(int x, int y, coordxy xs[], coordxy ys[], int n)
} }
void 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(); struct selectionvar *tmp = selection_new();
#define SEL_FLOOD_STACK (COLNO * ROWNO) #define SEL_FLOOD_STACK (COLNO * ROWNO)
@@ -4565,7 +4568,7 @@ selection_floodfill(struct selectionvar* ov, int x, int y, boolean diagonals)
coordxy dx[SEL_FLOOD_STACK]; coordxy dx[SEL_FLOOD_STACK];
coordxy dy[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); selection_free(tmp, TRUE);
return; return;
} }
@@ -4871,7 +4874,7 @@ selection_iterate(
select_iter_func func, select_iter_func func,
genericptr_t arg) genericptr_t arg)
{ {
int x, y; coordxy x, y;
if (!ov) if (!ov)
return; return;
@@ -4884,7 +4887,7 @@ selection_iterate(
} }
static void static void
sel_set_ter(int x, int y, genericptr_t arg) sel_set_ter(coordxy x, coordxy y, genericptr_t arg)
{ {
terrain terr; terrain terr;
@@ -4902,7 +4905,7 @@ sel_set_ter(int x, int y, genericptr_t arg)
} }
static void 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)) if (IS_FURNITURE(levl[x][y].typ))
return; return;
@@ -4910,7 +4913,7 @@ sel_set_feature(int x, int y, genericptr_t arg)
} }
static void 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 typ = *(coordxy *) arg;
coordxy x = dx, y = dy; coordxy x = dx, y = dy;
@@ -5203,7 +5206,7 @@ lspo_replace_terrain(lua_State *L)
struct mapfragment *mf = NULL; struct mapfragment *mf = NULL;
struct selectionvar *sel = NULL; struct selectionvar *sel = NULL;
boolean freesel = FALSE; boolean freesel = FALSE;
int x, y; coordxy x, y;
lua_Integer x1, y1, x2, y2; lua_Integer x1, y1, x2, y2;
int chance; int chance;
int tolit; int tolit;
@@ -5288,7 +5291,7 @@ lspo_replace_terrain(lua_State *L)
static boolean static boolean
generate_way_out_method( generate_way_out_method(
int nx, int ny, coordxy nx, coordxy ny,
struct selectionvar *ov) struct selectionvar *ov)
{ {
static const int escapeitems[] = { static const int escapeitems[] = {
@@ -5362,7 +5365,7 @@ ensure_way_out(void)
{ {
struct selectionvar *ov = selection_new(); struct selectionvar *ov = selection_new();
struct trap *ttmp = g.ftrap; struct trap *ttmp = g.ftrap;
int x, y; coordxy x, y;
boolean ret = TRUE; boolean ret = TRUE;
stairway *stway = g.stairs; stairway *stway = g.stairs;
@@ -5622,7 +5625,7 @@ lspo_levregion(lua_State *L)
} }
static void 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; int lit = *(int *)arg;
@@ -5633,7 +5636,7 @@ sel_set_lit(int x, int y, genericptr_t arg)
static void static void
add_doors_to_room(struct mkroom *croom) add_doors_to_room(struct mkroom *croom)
{ {
int x, y; coordxy x, y;
for (x = croom->lx - 1; x <= croom->hx + 1; x++) for (x = croom->lx - 1; x <= croom->hx + 1; x++)
for (y = croom->ly - 1; y <= croom->hy + 1; y++) for (y = croom->ly - 1; y <= croom->hy + 1; y++)
@@ -6019,7 +6022,7 @@ lspo_non_passwall(lua_State *L)
#if 0 #if 0
/*ARGSUSED*/ /*ARGSUSED*/
static void 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); wallify_map(x, y, x, y);
} }
+2 -2
View File
@@ -42,7 +42,7 @@ static int throwspell(void);
static void cast_protection(void); static void cast_protection(void);
static void spell_backfire(int); static void spell_backfire(int);
static const char *spelltypemnemonic(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 /* The roles[] table lists the role-specific values for tuning
* percent_success(). * percent_success().
@@ -1246,7 +1246,7 @@ spelleffects(int spell_otyp, boolean atme)
/*ARGSUSED*/ /*ARGSUSED*/
static boolean 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)) if (!isok(x,y))
return FALSE; return FALSE;
+1 -1
View File
@@ -677,7 +677,7 @@ mdrop_obj(
struct obj *obj, struct obj *obj,
boolean verbosely) boolean verbosely)
{ {
int omx = mon->mx, omy = mon->my; coordxy omx = mon->mx, omy = mon->my;
long unwornmask = obj->owornmask; long unwornmask = obj->owornmask;
/* call distant_name() for its possible side-effects even if the result /* call distant_name() for its possible side-effects even if the result
might not be printed, and do it before extracing obj from minvent */ might not be printed, and do it before extracing obj from minvent */
+2 -1
View File
@@ -439,7 +439,8 @@ landing_spot(
int reason, int reason,
int forceit) int forceit)
{ {
int i = 0, x, y, distance, min_distance = -1; int i = 0, distance, min_distance = -1;
coordxy x, y;
boolean found = FALSE; boolean found = FALSE;
struct trap *t; struct trap *t;
+24 -22
View File
@@ -5,12 +5,12 @@
#include "hack.h" #include "hack.h"
static boolean goodpos_onscary(int, int, struct permonst *); static boolean goodpos_onscary(coordxy, coordxy, struct permonst *);
static boolean tele_jump_ok(int, int, int, int); static boolean tele_jump_ok(coordxy, coordxy, coordxy, coordxy);
static boolean teleok(int, int, boolean); static boolean teleok(coordxy, coordxy, boolean);
static void vault_tele(void); static void vault_tele(void);
static boolean rloc_pos_ok(int, int, struct monst *); static boolean rloc_pos_ok(coordxy, coordxy, struct monst *);
static void rloc_to_core(struct monst *, int, int, unsigned); static void rloc_to_core(struct monst *, coordxy, coordxy, unsigned);
static void mvault_tele(struct monst *); static void mvault_tele(struct monst *);
static boolean m_blocks_teleporting(struct monst *); static boolean m_blocks_teleporting(struct monst *);
@@ -43,7 +43,7 @@ noteleport_level(struct monst* mon)
fields aside from 'monst->data' */ fields aside from 'monst->data' */
static boolean static boolean
goodpos_onscary( goodpos_onscary(
int x, int y, coordxy x, coordxy y,
struct permonst *mptr) struct permonst *mptr)
{ {
/* onscary() checks Angels and lawful minions; this oversimplifies */ /* onscary() checks Angels and lawful minions; this oversimplifies */
@@ -75,7 +75,7 @@ goodpos_onscary(
*/ */
boolean boolean
goodpos( goodpos(
int x, int y, coordxy x, coordxy y,
struct monst *mtmp, struct monst *mtmp,
mmflags_nht gpflags) mmflags_nht gpflags)
{ {
@@ -196,8 +196,8 @@ enexto_core(
{ {
#define MAX_GOOD 15 #define MAX_GOOD 15
coord good[MAX_GOOD], *good_ptr; coord good[MAX_GOOD], *good_ptr;
int x, y, range, i; coordxy x, y, range, i;
int xmin, xmax, ymin, ymax, rangemax; coordxy xmin, xmax, ymin, ymax, rangemax;
struct monst fakemon; /* dummy monster */ struct monst fakemon; /* dummy monster */
boolean allow_xx_yy = (boolean) ((entflags & GP_ALLOW_XY) != 0); boolean allow_xx_yy = (boolean) ((entflags & GP_ALLOW_XY) != 0);
@@ -278,7 +278,7 @@ enexto_core(
full: full:
/* we've got between 1 and SIZE(good) candidates; choose one */ /* 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->x = good[i].x;
cc->y = good[i].y; cc->y = good[i].y;
return TRUE; return TRUE;
@@ -290,7 +290,7 @@ enexto_core(
* only for explicitly chosen destinations.) * only for explicitly chosen destinations.)
*/ */
static boolean 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)) if (!isok(x2, y2))
return FALSE; return FALSE;
@@ -324,7 +324,7 @@ tele_jump_ok(int x1, int y1, int x2, int y2)
} }
static boolean static boolean
teleok(register int x, register int y, boolean trapok) teleok(coordxy x, coordxy y, boolean trapok)
{ {
if (!trapok) { if (!trapok) {
/* allow teleportation onto vibrating square, it's not a real trap; /* allow teleportation onto vibrating square, it's not a real trap;
@@ -352,7 +352,7 @@ teleok(register int x, register int y, boolean trapok)
} }
void 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, boolean ball_active, ball_still_in_range = FALSE,
allow_drag = (teleds_flags & TELEDS_ALLOW_DRAG) != 0, allow_drag = (teleds_flags & TELEDS_ALLOW_DRAG) != 0,
@@ -479,7 +479,8 @@ teleds(int nux, int nuy, int teleds_flags)
boolean boolean
safe_teleds(int teleds_flags) safe_teleds(int teleds_flags)
{ {
register int nux, nuy, tcnt = 0; coordxy nux, nuy;
int tcnt = 0;
do { do {
nux = rnd(COLNO - 1); nux = rnd(COLNO - 1);
@@ -1208,10 +1209,10 @@ level_tele_trap(struct trap* trap, unsigned int trflags)
/* check whether monster can arrive at location <x,y> via Tport (or fall) */ /* check whether monster can arrive at location <x,y> via Tport (or fall) */
static boolean static boolean
rloc_pos_ok( rloc_pos_ok(
int x, int y, /* coordinates of candidate location */ coordxy x, coordxy y, /* coordinates of candidate location */
struct monst *mtmp) struct monst *mtmp)
{ {
register int xx, yy; coordxy xx, yy;
if (!goodpos(x, y, mtmp, GP_CHECKSCARY)) if (!goodpos(x, y, mtmp, GP_CHECKSCARY))
return FALSE; return FALSE;
@@ -1276,10 +1277,10 @@ rloc_pos_ok(
static void static void
rloc_to_core( rloc_to_core(
struct monst* mtmp, struct monst* mtmp,
int x, int y, coordxy x, coordxy y,
unsigned rlocflags) 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 resident_shk = mtmp->isshk && inhishop(mtmp);
boolean preventmsg = (rlocflags & RLOC_NOMSG) != 0; boolean preventmsg = (rlocflags & RLOC_NOMSG) != 0;
boolean vanishmsg = (rlocflags & RLOC_MSG) != 0; boolean vanishmsg = (rlocflags & RLOC_MSG) != 0;
@@ -1370,13 +1371,13 @@ rloc_to_core(
} }
void 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); rloc_to_core(mtmp, x, y, RLOC_NOMSG);
} }
void 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); rloc_to_core(mtmp, x, y, rlocflags);
} }
@@ -1400,7 +1401,8 @@ rloc(
struct monst *mtmp, /* mx==0 implies migrating monster arrival */ struct monst *mtmp, /* mx==0 implies migrating monster arrival */
unsigned int rlocflags) unsigned int rlocflags)
{ {
register int x, y, trycount; coordxy x, y;
int trycount;
if (mtmp == u.usteed) { if (mtmp == u.usteed) {
tele(); tele();
@@ -1600,7 +1602,7 @@ mlevel_tele_trap(
boolean boolean
rloco(register struct obj* obj) rloco(register struct obj* obj)
{ {
register coordxy tx, ty, otx, oty; coordxy tx, ty, otx, oty;
boolean restricted_fall; boolean restricted_fall;
int try_limit = 4000; int try_limit = 4000;
+13 -11
View File
@@ -374,7 +374,7 @@ mk_trap_statue(coordxy x, coordxy y)
} }
struct trap * struct trap *
maketrap(int x, int y, int typ) maketrap(coordxy x, coordxy y, int typ)
{ {
static union vlaunchinfo zero_vl; static union vlaunchinfo zero_vl;
boolean oldplace; boolean oldplace;
@@ -2647,7 +2647,7 @@ steedintrap(struct trap* trap, struct obj* otmp)
void void
blow_up_landmine(struct trap* trap) 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]; struct rm *lev = &levl[x][y];
schar old_typ, typ; schar old_typ, typ;
@@ -2731,8 +2731,8 @@ force_launch_placement(void)
int int
launch_obj( launch_obj(
short otyp, short otyp,
int x1, int y1, coordxy x1, coordxy y1,
int x2, int y2, coordxy x2, coordxy y2,
int style) int style)
{ {
struct monst *mtmp; struct monst *mtmp;
@@ -3406,7 +3406,7 @@ float_up(void)
} }
void void
fill_pit(int x, int y) fill_pit(coordxy x, coordxy y)
{ {
struct obj *otmp; struct obj *otmp;
struct trap *t; struct trap *t;
@@ -5024,11 +5024,11 @@ untrap_box(
int int
untrap( untrap(
boolean force, boolean force,
int rx, int ry, coordxy rx, coordxy ry,
struct obj *container) struct obj *container)
{ {
register struct obj *otmp; register struct obj *otmp;
register int x, y; coordxy x, y;
int ch; int ch;
struct trap *ttmp; struct trap *ttmp;
struct monst *mtmp; struct monst *mtmp;
@@ -5637,7 +5637,7 @@ chest_trap(
} }
struct trap * struct trap *
t_at(register int x, register int y) t_at(coordxy x, coordxy y)
{ {
register struct trap *trap = g.ftrap; register struct trap *trap = g.ftrap;
@@ -5692,7 +5692,7 @@ conjoined_pits(
struct trap *trap1, struct trap *trap1,
boolean u_entering_trap2) boolean u_entering_trap2)
{ {
int dx, dy, diridx, adjidx; coordxy dx, dy, diridx, adjidx;
if (!trap1 || !trap2) if (!trap1 || !trap2)
return FALSE; return FALSE;
@@ -5716,7 +5716,8 @@ conjoined_pits(
static void static void
clear_conjoined_pits(struct trap* trap) clear_conjoined_pits(struct trap* trap)
{ {
int diridx, adjidx, x, y; int diridx, adjidx;
coordxy x, y;
struct trap *t; struct trap *t;
if (trap && is_pit(trap->ttyp)) { if (trap && is_pit(trap->ttyp)) {
@@ -5758,7 +5759,8 @@ static void
join_adjacent_pits(struct trap* trap) join_adjacent_pits(struct trap* trap)
{ {
struct trap *t; struct trap *t;
int diridx, x, y; int diridx;
coordxy x, y;
if (!trap) if (!trap)
return; return;
+10 -9
View File
@@ -6,10 +6,10 @@
#include "hack.h" #include "hack.h"
static boolean clear_fcorr(struct monst *, boolean); static boolean clear_fcorr(struct monst *, boolean);
static void blackout(int, int); static void blackout(coordxy, coordxy);
static void restfakecorr(struct monst *); static void restfakecorr(struct monst *);
static void parkguard(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 boolean find_guard_dest(struct monst *, coordxy *, coordxy *);
static void move_gold(struct obj *, int); static void move_gold(struct obj *, int);
static void wallify_vault(struct monst *); static void wallify_vault(struct monst *);
@@ -44,7 +44,7 @@ free_egd(struct monst *mtmp)
static boolean static boolean
clear_fcorr(struct monst *grd, boolean forceshow) clear_fcorr(struct monst *grd, boolean forceshow)
{ {
register int fcx, fcy, fcbeg; coordxy fcx, fcy, fcbeg;
struct monst *mtmp; struct monst *mtmp;
boolean sawcorridor = FALSE, boolean sawcorridor = FALSE,
silently = g.program_state.stopprint ? TRUE : FALSE; silently = g.program_state.stopprint ? TRUE : FALSE;
@@ -117,7 +117,7 @@ clear_fcorr(struct monst *grd, boolean forceshow)
the corridor, we don't want the light to reappear if/when a new tunnel the corridor, we don't want the light to reappear if/when a new tunnel
goes through the same area */ goes through the same area */
static void static void
blackout(int x, int y) blackout(coordxy x, coordxy y)
{ {
struct rm *lev; struct rm *lev;
int i, j; int i, j;
@@ -185,7 +185,7 @@ grddead(struct monst *grd)
} }
static boolean static boolean
in_fcorridor(struct monst *grd, int x, int y) in_fcorridor(struct monst *grd, coordxy x, coordxy y)
{ {
register int fci; register int fci;
struct egd *egrd = EGD(grd); struct egd *egrd = EGD(grd);
@@ -257,7 +257,7 @@ uleftvault(struct monst *grd)
static boolean static boolean
find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry) 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 (dd = 2; (dd < ROWNO || dd < COLNO); dd++) {
for (y = u.uy - dd; y <= u.uy + dd; y++) { for (y = u.uy - dd; y <= u.uy + dd; y++) {
@@ -585,7 +585,8 @@ move_gold(struct obj *gold, int vroom)
static void static void
wallify_vault(struct monst *grd) wallify_vault(struct monst *grd)
{ {
int x, y, typ; int typ;
coordxy x, y;
int vlt = EGD(grd)->vroom; int vlt = EGD(grd)->vroom;
char tmp_viz; char tmp_viz;
coordxy lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1, coordxy lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
@@ -804,8 +805,8 @@ gd_move_cleanup(
int int
gd_move(struct monst *grd) gd_move(struct monst *grd)
{ {
int x, y, nx, ny, m, n; coordxy x, y, nx, ny, m, n;
int dx, dy, gx = 0, gy = 0, fci; coordxy dx, dy, gx = 0, gy = 0, fci;
uchar typ; uchar typ;
struct rm *crm; struct rm *crm;
struct fakecorridor *fcp; struct fakecorridor *fcp;
+9 -9
View File
@@ -89,8 +89,8 @@ static coordxy right_ptrs[ROWNO][COLNO];
static void fill_point(int, int); static void fill_point(int, int);
static void dig_point(int, int); static void dig_point(int, int);
static void view_init(void); static void view_init(void);
static void view_from(int, int, coordxy **, coordxy *, coordxy *, int, static void view_from(coordxy, coordxy, coordxy **, coordxy *, coordxy *, int,
void (*)(int, int, genericptr_t), void (*)(coordxy, coordxy, genericptr_t),
genericptr_t); genericptr_t);
static void get_unused_cs(coordxy ***, coordxy **, coordxy **); static void get_unused_cs(coordxy ***, coordxy **, coordxy **);
static void rogue_vision(coordxy **, coordxy *, coordxy *); static void rogue_vision(coordxy **, coordxy *, coordxy *);
@@ -549,7 +549,7 @@ vision_recalc(int control)
* + Monsters can see you even when you're in a pit. * + Monsters can see you even when you're in a pit.
*/ */
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0, 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); (genericptr_t) 0);
/* /*
@@ -615,7 +615,7 @@ vision_recalc(int control)
} }
} else } else
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0, 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); (genericptr_t) 0);
/* /*
@@ -1113,7 +1113,7 @@ static coordxy **cs_rows;
static coordxy *cs_left; static coordxy *cs_left;
static coordxy *cs_right; static coordxy *cs_right;
static void (*vis_func)(int, int, genericptr_t); static void (*vis_func)(coordxy, coordxy, genericptr_t);
static genericptr_t varg; static genericptr_t varg;
/* /*
@@ -1954,9 +1954,9 @@ left_side(int row, int left_mark, int right, const coordxy *limits)
* arg argument for func * arg argument for func
*/ */
static void 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, 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 */ register int i; /* loop counter */
coordxy *rowp; /* optimization for setting could_see */ coordxy *rowp; /* optimization for setting could_see */
@@ -2055,8 +2055,8 @@ view_from(int srow, int scol, coordxy **loc_cs_rows,
* vision matrix and reduce extra work. * vision matrix and reduce extra work.
*/ */
void void
do_clear_area(int scol, int srow, int range, do_clear_area(coordxy scol, coordxy srow, int range,
void (*func)(int, int, genericptr_t), genericptr_t arg) void (*func)(coordxy, coordxy, genericptr_t), genericptr_t arg)
{ {
/* If not centered on hero, do the hard work of figuring the area */ /* If not centered on hero, do the hard work of figuring the area */
if (scol != u.ux || srow != u.uy) { if (scol != u.ux || srow != u.uy) {
+2 -2
View File
@@ -501,7 +501,7 @@ genl_putmsghistory(const char *msg, boolean is_restoring)
static int hup_nhgetch(void); static int hup_nhgetch(void);
static char hup_yn_function(const char *, const char *, char); 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_getlin(const char *, char *);
static void hup_init_nhwindows(int *, char **); static void hup_init_nhwindows(int *, char **);
static void hup_exit_nhwindows(const char *); static void hup_exit_nhwindows(const char *);
@@ -652,7 +652,7 @@ hup_yn_function(const char *prompt UNUSED,
/*ARGSUSED*/ /*ARGSUSED*/
static int 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'; return '\033';
} }
+8 -7
View File
@@ -2264,7 +2264,7 @@ int
bhitpile( bhitpile(
struct obj *obj, /* wand or fake spellbook for type of zap */ struct obj *obj, /* wand or fake spellbook for type of zap */
int (*fhito)(OBJ_P, OBJ_P), /* callback for each object being hit */ 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 */ schar zz) /* direction for up/down zaps */
{ {
int hitanything = 0; int hitanything = 0;
@@ -2977,7 +2977,8 @@ static boolean
zap_updown(struct obj *obj) /* wand or spell */ zap_updown(struct obj *obj) /* wand or spell */
{ {
boolean striking = FALSE, disclose = FALSE; boolean striking = FALSE, disclose = FALSE;
int x, y, xx, yy, ptmp; coordxy x, y, xx, yy;
int ptmp;
struct obj *otmp; struct obj *otmp;
struct engr *e; struct engr *e;
struct trap *ttmp; struct trap *ttmp;
@@ -3415,7 +3416,7 @@ maybe_explode_trap(struct trap *ttmp, struct obj *otmp)
* one is revealed for a weapon, but if not a weapon is left up to fhitm(). * one is revealed for a weapon, but if not a weapon is left up to fhitm().
*/ */
struct monst * 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 */ enum bhit_call_types weapon, /* defined in hack.h */
int (*fhitm)(MONST_P, OBJ_P), /* fns called when mon/obj hit */ int (*fhitm)(MONST_P, OBJ_P), /* fns called when mon/obj hit */
int (*fhito)(OBJ_P, OBJ_P), int (*fhito)(OBJ_P, OBJ_P),
@@ -3456,7 +3457,7 @@ bhit(int ddx, int ddy, int range, /* direction and range */
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng)); tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
while (range-- > 0) { while (range-- > 0) {
int x, y; coordxy x, y;
g.bhitpos.x += ddx; g.bhitpos.x += ddx;
g.bhitpos.y += ddy; g.bhitpos.y += ddy;
@@ -3747,7 +3748,7 @@ bhit(int ddx, int ddy, int range, /* direction and range */
* is too obviously silly. * is too obviously silly.
*/ */
struct monst * struct monst *
boomhit(struct obj *obj, int dx, int dy) boomhit(struct obj *obj, coordxy dx, coordxy dy)
{ {
register int i, ct; register int i, ct;
int boom; /* showsym[] index */ int boom; /* showsym[] index */
@@ -3770,7 +3771,7 @@ boomhit(struct obj *obj, int dx, int dy)
g.bhitpos.x = u.ux; g.bhitpos.x = u.ux;
g.bhitpos.y = u.uy; g.bhitpos.y = u.uy;
boom = counterclockwise ? S_boomleft : S_boomright; boom = counterclockwise ? S_boomleft : S_boomright;
i = xytod(dx, dy); i = (int) xytod(dx, dy);
tmp_at(DISP_FLASH, cmap_to_glyph(boom)); tmp_at(DISP_FLASH, cmap_to_glyph(boom));
for (ct = 0; ct < 10; ct++) { for (ct = 0; ct < 10; ct++) {
i = DIR_CLAMP(i); i = DIR_CLAMP(i);
@@ -4141,7 +4142,7 @@ zhitu(int type, int nd, const char *fltxt, coordxy sx, coordxy sy)
* at position x,y; return the number of objects burned * at position x,y; return the number of objects burned
*/ */
int int
burn_floor_objects(int x, int y, burn_floor_objects(coordxy x, coordxy y,
boolean give_feedback, /* caller needs to decide about boolean give_feedback, /* caller needs to decide about
visibility checks */ visibility checks */
boolean u_caused) boolean u_caused)
+1 -1
View File
@@ -1112,7 +1112,7 @@ tgetch()
} }
int int
console_poskey(int *x, int *y, int *mod) console_poskey(coordxy *x, coordxy *y, int *mod)
{ {
int ch; int ch;
coord cc = { 0, 0 }; coord cc = { 0, 0 };
+1 -1
View File
@@ -586,7 +586,7 @@ QCoreApplication::exec: The event loop is already running
return keybuffer.GetAscii(); 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) if (main)
main->fadeHighlighting(true); main->fadeHighlighting(true);
+1 -1
View File
@@ -69,7 +69,7 @@ public:
static void qt_raw_print(const char *str); static void qt_raw_print(const char *str);
static void qt_raw_print_bold(const char *str); static void qt_raw_print_bold(const char *str);
static int qt_nhgetch(); 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 void qt_nhbell();
static int qt_doprev_message(); static int qt_doprev_message();
static char qt_more(); static char qt_more();
+1 -1
View File
@@ -989,7 +989,7 @@ X11_nhgetch(void)
} }
int 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); int val = input_event(EXIT_ON_KEY_OR_BUTTON_PRESS);
+3 -3
View File
@@ -42,7 +42,7 @@ void chainin_print_glyph(winid, coordxy, coordxy,
void chainin_raw_print(const char *); void chainin_raw_print(const char *);
void chainin_raw_print_bold(const char *); void chainin_raw_print_bold(const char *);
int chainin_nhgetch(void); int chainin_nhgetch(void);
int chainin_nh_poskey(int *, int *, int *); int chainin_nh_poskey(coordxy *, coordxy *, int *);
void chainin_nhbell(void); void chainin_nhbell(void);
int chainin_doprev_message(void); int chainin_doprev_message(void);
char chainin_yn_function(const char *, const char *, char); char chainin_yn_function(const char *, const char *, char);
@@ -377,8 +377,8 @@ chainin_nhgetch(void)
int int
chainin_nh_poskey( chainin_nh_poskey(
int *x, coordxy *x,
int *y, coordxy *y,
int *mod) int *mod)
{ {
int rv; int rv;
+3 -3
View File
@@ -42,7 +42,7 @@ void chainout_print_glyph(void *,winid, coordxy, coordxy,
void chainout_raw_print(void *,const char *); void chainout_raw_print(void *,const char *);
void chainout_raw_print_bold(void *,const char *); void chainout_raw_print_bold(void *,const char *);
int chainout_nhgetch(void *); int chainout_nhgetch(void *);
int chainout_nh_poskey(void *,int *, int *, int *); int chainout_nh_poskey(void *,coordxy *, coordxy *, int *);
void chainout_nhbell(void *); void chainout_nhbell(void *);
int chainout_doprev_message(void *); int chainout_doprev_message(void *);
char chainout_yn_function(void *,const char *, const char *, char); char chainout_yn_function(void *,const char *, const char *, char);
@@ -446,8 +446,8 @@ chainout_nhgetch(void *vp)
int int
chainout_nh_poskey( chainout_nh_poskey(
void *vp, void *vp,
int *x, coordxy *x,
int *y, coordxy *y,
int *mod) int *mod)
{ {
struct chainout_data *tdp = vp; struct chainout_data *tdp = vp;
+5 -4
View File
@@ -69,7 +69,7 @@ void trace_print_glyph(void *,winid, coordxy, coordxy,
void trace_raw_print(void *,const char *); void trace_raw_print(void *,const char *);
void trace_raw_print_bold(void *,const char *); void trace_raw_print_bold(void *,const char *);
int trace_nhgetch(void *); int trace_nhgetch(void *);
int trace_nh_poskey(void *,int *, int *, int *); int trace_nh_poskey(void *,coordxy *, coordxy *, int *);
void trace_nhbell(void *); void trace_nhbell(void *);
int trace_doprev_message(void *); int trace_doprev_message(void *);
char trace_yn_function(void *,const char *, const char *, char); char trace_yn_function(void *,const char *, const char *, char);
@@ -724,8 +724,8 @@ trace_nhgetch(void *vp)
int int
trace_nh_poskey( trace_nh_poskey(
void *vp, void *vp,
int *x, coordxy *x,
int *y, coordxy *y,
int *mod) int *mod)
{ {
struct trace_data *tdp = vp; struct trace_data *tdp = vp;
@@ -742,7 +742,8 @@ trace_nh_poskey(
} else { } else {
sprintf(buf, "(%d)", rv); 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); *mod);
return rv; return rv;
+2 -2
View File
@@ -881,7 +881,7 @@ curses_nhgetch(void)
} }
/* /*
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 -- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else, return value is non-zero, a character was typed, else,
@@ -896,7 +896,7 @@ int nh_poskey(int *x, int *y, int *mod)
routine always returns a non-zero character. routine always returns a non-zero character.
*/ */
int int
curses_nh_poskey(int *x, int *y, int *mod) curses_nh_poskey(coordxy *x, coordxy *y, int *mod)
{ {
int key = curses_nhgetch(); int key = curses_nhgetch();
+1 -1
View File
@@ -974,7 +974,7 @@ event, or the first non-mouse key event in the case of mouse
movement. */ movement. */
int int
curses_get_mouse(int *mousex, int *mousey, int *mod) curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod)
{ {
int key = '\033'; int key = '\033';
+1 -1
View File
@@ -30,7 +30,7 @@ int curses_convert_attr(int attr);
int curses_read_attrs(const char *attrs); int curses_read_attrs(const char *attrs);
char *curses_fmt_attrs(char *); char *curses_fmt_attrs(char *);
int curses_convert_keys(int key); 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); void curses_mouse_support(int);
#endif /* CURSMISC_H */ #endif /* CURSMISC_H */
+1 -1
View File
@@ -331,7 +331,7 @@ safe_nhgetch(void)
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
int int
safe_nh_poskey(int *x, int *y, int *mod) safe_nh_poskey(coordxy *x, coordxy *y, int *mod)
{ {
return '\033'; return '\033';
} }
+1 -1
View File
@@ -145,7 +145,7 @@ VDECLCB(shim_print_glyph,(winid w, coordxy x, coordxy y, const glyph_info *glyph
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str) VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
VDECLCB(shim_raw_print_bold,(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_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") VDECLCB(shim_nhbell,(void), "v")
DECLCB(int, shim_doprev_message,(void),"iv") 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) DECLCB(char, shim_yn_function,(const char *query, const char *resp, char def), "cssi", P2V query, P2V resp, A2P def)
+2 -2
View File
@@ -4376,9 +4376,9 @@ tty_nhgetch(void)
/*ARGSUSED*/ /*ARGSUSED*/
int int
#if defined(WIN32CON) #if defined(WIN32CON)
tty_nh_poskey(int *x, int *y, int *mod) tty_nh_poskey(coordxy *x, coordxy *y, int *mod)
#else #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 #endif
{ {
int i; int i;
+4 -4
View File
@@ -1440,7 +1440,7 @@ mswin_nhgetch(void)
} }
/* /*
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 -- Returns a single character input from the user or a
a positioning event (perhaps from a mouse). If the a positioning event (perhaps from a mouse). If the
return value is non-zero, a character was typed, else, return value is non-zero, a character was typed, else,
@@ -1455,7 +1455,7 @@ int nh_poskey(int *x, int *y, int *mod)
routine always returns a non-zero character. routine always returns a non-zero character.
*/ */
int int
mswin_nh_poskey(int *x, int *y, int *mod) mswin_nh_poskey(coordxy *x, coordxy *y, int *mod)
{ {
PMSNHEvent event; PMSNHEvent event;
int key; int key;
@@ -1468,8 +1468,8 @@ mswin_nh_poskey(int *x, int *y, int *mod)
if (event->type == NHEVENT_MOUSE) { if (event->type == NHEVENT_MOUSE) {
if (iflags.wc_mouse_support) { if (iflags.wc_mouse_support) {
*mod = event->ei.ms.mod; *mod = event->ei.ms.mod;
*x = event->ei.ms.x; *x = (coordxy) event->ei.ms.x;
*y = event->ei.ms.y; *y = (coordxy) event->ei.ms.y;
} }
key = 0; key = 0;
} else { } else {
+1 -1
View File
@@ -170,7 +170,7 @@ void mswin_raw_print(const char *str);
void mswin_raw_print_bold(const char *str); void mswin_raw_print_bold(const char *str);
void mswin_raw_print_flush(); void mswin_raw_print_flush();
int mswin_nhgetch(void); 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); void mswin_nhbell(void);
int mswin_doprev_message(void); int mswin_doprev_message(void);
char mswin_yn_function(const char *question, const char *choices, char def); char mswin_yn_function(const char *question, const char *choices, char def);