3 * @brief Angband(変愚蛮怒)基本関数、グローバル変数ヘッダファイル /
4 * extern declarations (variables and functions)
7 * Copyright (c) 1997 Ben Harrison
9 * This software may be copied and distributed for educational, research,
10 * and not for profit purposes provided that this copyright and statement
11 * are included in all such copies.
12 * Note that some files have their own header files
13 * (z-virt.h, z-util.h, z-form.h, term.h, random.h)
18 * Automatically generated "variable" declarations
20 extern int max_macrotrigger;
21 extern concptr macro_template;
22 extern concptr macro_modifier_chr;
23 extern concptr macro_modifier_name[MAX_MACRO_MOD];
24 extern concptr macro_trigger_name[MAX_MACRO_TRIG];
25 extern concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
30 * List for auto-picker/destroyer entries
32 extern int max_autopick;
33 extern int max_max_autopick;
34 extern autopick_type *autopick_list;
37 extern const POSITION ddd[9];
38 extern const POSITION ddx[10];
39 extern const POSITION ddy[10];
40 extern const POSITION ddx_ddd[9];
41 extern const POSITION ddy_ddd[9];
42 extern const POSITION cdd[8];
43 extern const POSITION ddx_cdd[8];
44 extern const POSITION ddy_cdd[8];
45 extern const char hexsym[16];
46 extern const char listsym[];
47 extern const concptr color_char;
48 extern const byte adj_mag_study[];
49 extern const byte adj_mag_mana[];
50 extern const byte adj_mag_fail[];
51 extern const byte adj_mag_stat[];
52 extern const byte adj_chr_gold[];
53 extern const byte adj_int_dev[];
54 extern const byte adj_wis_sav[];
55 extern const byte adj_dex_dis[];
56 extern const byte adj_int_dis[];
57 extern const byte adj_dex_ta[];
58 extern const byte adj_str_td[];
59 extern const byte adj_dex_th[];
60 extern const byte adj_str_th[];
61 extern const byte adj_str_wgt[];
62 extern const byte adj_str_hold[];
63 extern const byte adj_str_dig[];
64 extern const byte adj_str_blow[];
65 extern const byte adj_dex_blow[];
66 extern const byte adj_dex_safe[];
67 extern const byte adj_con_fix[];
68 extern const byte adj_con_mhp[];
69 extern const byte adj_chr_chm[];
70 extern const byte blows_table[12][12];
71 extern const arena_type arena_info[MAX_ARENA_MONS + 2];
72 extern const byte extract_energy[200];
73 extern const s32b player_exp[PY_MAX_LEVEL];
74 extern const s32b player_exp_a[PY_MAX_LEVEL];
75 extern const player_sex sex_info[MAX_SEXES];
76 extern const player_race race_info[MAX_RACES];
77 extern const player_class class_info[MAX_CLASS];
78 extern const magic_type technic_info[NUM_TECHNIC][32];
79 extern const player_seikaku seikaku_info[MAX_SEIKAKU];
80 extern const player_race mimic_info[];
81 extern const u32b fake_spell_flags[4];
82 extern const s32b realm_choices1[];
83 extern const s32b realm_choices2[];
84 extern const concptr realm_names[];
86 extern const concptr E_realm_names[];
88 extern const concptr spell_names[VALID_REALM][32];
89 extern const int chest_traps[64];
90 extern const concptr player_title[MAX_CLASS][PY_MAX_LEVEL/5];
91 extern const concptr color_names[16];
92 extern const concptr stat_names[6];
93 extern const concptr stat_names_reduced[6];
94 extern const concptr window_flag_desc[32];
95 extern const martial_arts ma_blows[MAX_MA];
96 extern const int monk_ave_damage[PY_MAX_LEVEL+1][3];
97 extern const concptr game_inscriptions[];
98 extern const kamae kamae_shurui[MAX_KAMAE];
99 extern const kamae kata_shurui[MAX_KATA];
100 extern const concptr exp_level_str[5];
101 extern const concptr silly_attacks[MAX_SILLY_ATTACK];
103 extern const concptr silly_attacks2[MAX_SILLY_ATTACK];
105 extern const monster_power monster_powers[MAX_MONSPELLS];
106 extern const concptr monster_powers_short[MAX_MONSPELLS];
107 extern const concptr ident_info[];
108 extern const mbe_info_type mbe_info[];
109 extern const byte feature_action_flags[FF_FLAG_MAX];
110 extern const dragonbreath_type dragonbreath_info[];
112 extern const option_type option_info[];
113 extern const option_type cheat_info[CHEAT_MAX];
114 extern const option_type autosave_info[2];
117 extern const concptr copyright[5];
118 extern byte h_ver_major;
119 extern byte h_ver_minor;
120 extern byte h_ver_patch;
121 extern byte h_ver_extra;
122 extern byte sf_extra;
123 extern u32b sf_system;
128 extern u16b sf_lives;
129 extern u16b sf_saves;
130 extern bool arg_fiddle;
131 extern bool arg_wizard;
132 extern bool arg_music;
133 extern bool arg_sound;
134 extern byte arg_graphics;
135 extern bool arg_monochrome;
136 extern bool arg_force_original;
137 extern bool arg_force_roguelike;
138 extern bool arg_bigtile;
139 extern bool character_generated;
140 extern bool character_dungeon;
141 extern bool character_loaded;
142 extern bool character_saved;
143 extern bool character_icky;
144 extern bool character_xtra;
145 extern bool creating_savefile;
146 extern u32b seed_flavor;
147 extern u32b seed_town;
148 extern COMMAND_CODE command_cmd;
149 extern COMMAND_ARG command_arg;
150 extern s16b command_rep;
151 extern DIRECTION command_dir;
152 extern s16b command_see;
153 extern TERM_LEN command_gap;
154 extern s16b command_wrk;
155 extern s16b command_new;
156 extern bool msg_flag;
158 extern bool invoking_midnight_curse;
159 extern GAME_TURN old_battle;
160 extern bool use_sound;
161 extern bool use_music;
162 extern bool use_graphics;
163 extern bool use_bigtile;
164 extern s16b signal_count;
165 extern bool inkey_base;
166 extern bool inkey_xtra;
167 extern bool inkey_scan;
168 extern bool inkey_flag;
169 extern bool get_com_no_macros;
170 extern OBJECT_SUBTYPE_VALUE coin_type;
171 extern bool opening_chest;
172 extern bool shimmer_monsters;
173 extern bool shimmer_objects;
174 extern bool repair_monsters;
175 extern bool repair_objects;
176 extern s16b inven_cnt;
177 extern s16b equip_cnt;
178 extern OBJECT_IDX o_max;
179 extern OBJECT_IDX o_cnt;
180 extern MONSTER_IDX m_max;
181 extern MONSTER_IDX m_cnt;
182 extern MONSTER_IDX hack_m_idx;
183 extern MONSTER_IDX hack_m_idx_ii;
184 extern int total_friends;
185 extern s32b friend_align;
186 extern int leaving_quest;
187 extern bool reinit_wilderness;
188 extern bool multi_rew;
189 extern char summon_kin_type;
190 extern bool is_loading_now;
191 extern bool hack_mutation;
195 * Software options (set via the '=' command). See "tables.c"
199 extern char record_o_name[MAX_NLEN];
200 extern GAME_TURN record_turn;
201 extern bool closing_flag;
202 extern POSITION panel_row_min, panel_row_max;
203 extern POSITION panel_col_min, panel_col_max;
204 extern POSITION panel_col_prt, panel_row_prt;
205 extern MONSTER_IDX target_who;
206 extern POSITION target_col;
207 extern POSITION target_row;
208 extern int player_uid;
209 extern int player_euid;
210 extern int player_egid;
211 extern char player_base[32];
212 extern char savefile[1024];
213 extern char savefile_base[40];
214 extern pos_list tmp_pos;
215 extern s16b macro__num;
216 extern concptr *macro__pat;
217 extern concptr *macro__act;
218 extern bool *macro__cmd;
219 extern char *macro__buf;
220 extern STR_OFFSET quark__num;
221 extern concptr *quark__str;
222 extern u32b message__next;
223 extern u32b message__last;
224 extern u32b message__head;
225 extern u32b message__tail;
226 extern u32b *message__ptr;
227 extern char *message__buf;
228 extern BIT_FLAGS option_flag[8];
229 extern BIT_FLAGS option_mask[8];
230 extern BIT_FLAGS window_flag[8];
231 extern BIT_FLAGS window_mask[8];
232 extern term *angband_term[8];
233 extern const char angband_term_name[8][16];
234 extern byte angband_color_table[256][4];
235 extern const concptr angband_sound_name[SOUND_MAX];
236 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
237 extern floor_type *current_floor_ptr;
238 extern world_type *current_world_ptr;
239 extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
240 extern FLOOR_IDX max_floor_id;
241 extern u32b saved_floor_file_sign;
242 extern TOWN_IDX max_towns;
243 extern town_type *town_info;
244 extern object_type *inventory;
245 extern s16b alloc_kind_size;
246 extern alloc_entry *alloc_kind_table;
247 extern s16b alloc_race_size;
248 extern alloc_entry *alloc_race_table;
249 extern TERM_COLOR misc_to_attr[256];
250 extern SYMBOL_CODE misc_to_char[256];
251 extern TERM_COLOR tval_to_attr[128];
252 extern SYMBOL_CODE tval_to_char[128];
253 extern concptr keymap_act[KEYMAP_MODES][256];
254 extern player_type *p_ptr;
255 extern const player_sex *sp_ptr;
256 extern const player_race *rp_ptr;
257 extern const player_class *cp_ptr;
258 extern const player_seikaku *ap_ptr;
259 extern const player_magic *mp_ptr;
260 extern birther previous_char;
261 extern vault_type *v_info;
264 extern skill_table *s_info;
265 extern player_magic *m_info;
266 extern feature_type *f_info;
269 extern object_kind *k_info;
272 extern artifact_type *a_info;
275 extern ego_item_type *e_info;
278 extern monster_race *r_info;
281 extern dungeon_type *d_info;
284 extern concptr ANGBAND_SYS;
285 extern concptr ANGBAND_KEYBOARD;
286 extern concptr ANGBAND_GRAF;
287 extern concptr ANGBAND_DIR;
288 extern concptr ANGBAND_DIR_APEX;
289 extern concptr ANGBAND_DIR_BONE;
290 extern concptr ANGBAND_DIR_DATA;
291 extern concptr ANGBAND_DIR_EDIT;
292 extern concptr ANGBAND_DIR_SCRIPT;
293 extern concptr ANGBAND_DIR_FILE;
294 extern concptr ANGBAND_DIR_HELP;
295 extern concptr ANGBAND_DIR_INFO;
296 extern concptr ANGBAND_DIR_PREF;
297 extern concptr ANGBAND_DIR_SAVE;
298 extern concptr ANGBAND_DIR_USER;
299 extern concptr ANGBAND_DIR_XTRA;
300 extern OBJECT_TYPE_VALUE item_tester_tval;
301 extern bool (*item_tester_hook)(object_type *o_ptr);
302 extern bool (*ang_sort_comp)(vptr u, vptr v, int a, int b);
303 extern void (*ang_sort_swap)(vptr u, vptr v, int a, int b);
304 extern monsterrace_hook_type get_mon_num_hook;
305 extern monsterrace_hook_type get_mon_num2_hook;
306 extern bool (*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
307 extern building_type building[MAX_BLDG];
308 extern QUEST_IDX max_q_idx;
309 extern MONRACE_IDX max_r_idx;
310 extern KIND_OBJECT_IDX max_k_idx;
311 extern VAULT_IDX max_v_idx;
312 extern FEAT_IDX max_f_idx;
313 extern ARTIFACT_IDX max_a_idx;
314 extern EGO_IDX max_e_idx;
315 extern DUNGEON_IDX max_d_idx;
316 extern quest_type *quest;
317 extern char quest_text[10][80];
318 extern int quest_text_line;
319 extern TERM_COLOR gf_color[MAX_GF];
320 extern int init_flags;
321 extern int highscore_fd;
322 extern bool can_save;
324 extern int cap_mspeed;
325 extern HIT_POINT cap_hp;
326 extern HIT_POINT cap_maxhp;
327 extern STR_OFFSET cap_nickname;
328 extern MONRACE_IDX battle_mon[4];
329 extern int sel_monster;
330 extern int battle_odds;
331 extern PRICE kakekin;
332 extern u32b mon_odds[4];
333 extern MONSTER_IDX pet_t_m_idx;
334 extern MONSTER_IDX riding_t_m_idx;
335 extern MONRACE_IDX today_mon;
336 extern bool write_level;
337 extern u32b start_time;
338 extern bool sukekaku;
339 extern bool new_mane;
340 extern bool mon_fight;
341 extern bool generate_encounter;
342 extern concptr screen_dump;
344 /*** Terrain feature variables ***/
345 extern FEAT_IDX feat_none;
346 extern FEAT_IDX feat_floor;
347 extern FEAT_IDX feat_glyph;
348 extern FEAT_IDX feat_explosive_rune;
349 extern FEAT_IDX feat_mirror;
350 extern FEAT_IDX feat_up_stair;
351 extern FEAT_IDX feat_down_stair;
352 extern FEAT_IDX feat_entrance;
353 extern FEAT_IDX feat_trap_open;
354 extern FEAT_IDX feat_trap_armageddon;
355 extern FEAT_IDX feat_trap_piranha;
356 extern FEAT_IDX feat_rubble;
357 extern FEAT_IDX feat_magma_vein;
358 extern FEAT_IDX feat_quartz_vein;
359 extern FEAT_IDX feat_granite;
360 extern FEAT_IDX feat_permanent;
361 extern FEAT_IDX feat_glass_floor;
362 extern FEAT_IDX feat_glass_wall;
363 extern FEAT_IDX feat_permanent_glass_wall;
364 extern FEAT_IDX feat_pattern_start;
365 extern FEAT_IDX feat_pattern_1;
366 extern FEAT_IDX feat_pattern_2;
367 extern FEAT_IDX feat_pattern_3;
368 extern FEAT_IDX feat_pattern_4;
369 extern FEAT_IDX feat_pattern_end;
370 extern FEAT_IDX feat_pattern_old;
371 extern FEAT_IDX feat_pattern_exit;
372 extern FEAT_IDX feat_pattern_corrupted;
373 extern FEAT_IDX feat_black_market;
374 extern FEAT_IDX feat_town;
375 extern FEAT_IDX feat_deep_water;
376 extern FEAT_IDX feat_shallow_water;
377 extern FEAT_IDX feat_deep_lava;
378 extern FEAT_IDX feat_shallow_lava;
379 extern FEAT_IDX feat_heavy_cold_zone;
380 extern FEAT_IDX feat_cold_zone;
381 extern FEAT_IDX feat_heavy_electrical_zone;
382 extern FEAT_IDX feat_electrical_zone;
383 extern FEAT_IDX feat_deep_acid_puddle;
384 extern FEAT_IDX feat_shallow_acid_puddle;
385 extern FEAT_IDX feat_deep_poisonous_puddle;
386 extern FEAT_IDX feat_shallow_poisonous_puddle;
387 extern FEAT_IDX feat_dirt;
388 extern FEAT_IDX feat_grass;
389 extern FEAT_IDX feat_flower;
390 extern FEAT_IDX feat_brake;
391 extern FEAT_IDX feat_tree;
392 extern FEAT_IDX feat_mountain;
393 extern FEAT_IDX feat_swamp;
394 extern FEAT_IDX feat_undetected;
396 extern DEPTH *max_dlv;
397 extern FEAT_IDX feat_wall_outer;
398 extern FEAT_IDX feat_wall_inner;
399 extern FEAT_IDX feat_wall_solid;
400 extern FEAT_IDX feat_ground_type[100], feat_wall_type[100];
401 extern COMMAND_CODE now_message;
402 extern bool use_menu;
405 extern void autopick_load_pref(bool disp_mes);
406 extern errr process_autopick_file_command(char *buf);
407 extern concptr autopick_line_from_entry(autopick_type *entry);
408 extern int is_autopick(object_type *o_ptr);
409 extern void autopick_alter_item(INVENTORY_IDX item, bool destroy);
410 extern void autopick_delayed_alter(void);
411 extern void autopick_pickup_items(grid_type *g_ptr);
412 extern bool autopick_autoregister(object_type *o_ptr);
413 extern void do_cmd_edit_autopick(void);
416 extern void add_history_from_pref_line(concptr t);
417 extern void player_birth(void);
418 extern void get_max_stats(void);
419 extern void get_height_weight(void);
420 extern void player_outfit(void);
421 extern void dump_yourself(FILE *fff);
425 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
426 extern bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
427 extern void update_local_illumination(POSITION y, POSITION x);
428 extern bool player_can_see_bold(POSITION y, POSITION x);
429 extern bool cave_valid_bold(POSITION y, POSITION x);
430 extern bool no_lite(void);
431 extern void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], SYMBOL_CODE f_char[F_LIT_MAX]);
432 extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp);
433 extern void move_cursor_relative(int row, int col);
434 extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
435 extern void note_spot(POSITION y, POSITION x);
436 extern void display_dungeon(void);
437 extern void lite_spot(POSITION y, POSITION x);
438 extern void prt_map(void);
439 extern void prt_path(POSITION y, POSITION x);
440 extern void display_map(int *cy, int *cx);
441 extern void do_cmd_view_map(void);
442 extern void forget_lite(void);
443 extern void update_lite(void);
444 extern void forget_view(void);
445 extern void update_view(void);
446 extern void update_mon_lite(void);
447 extern void clear_mon_lite(void);
448 extern void delayed_visual_update(void);
449 extern void forget_flow(void);
450 extern void update_flow(void);
451 extern void update_smell(void);
452 extern void map_area(POSITION range);
453 extern void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat);
454 extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat);
455 extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
456 extern void cave_alter_feat(POSITION y, POSITION x, int action);
457 extern void remove_mirror(POSITION y, POSITION x);
459 extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
460 extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
461 extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
462 extern void health_track(MONSTER_IDX m_idx);
463 extern void monster_race_track(MONRACE_IDX r_idx);
464 extern void object_kind_track(KIND_OBJECT_IDX k_idx);
465 extern void glow_deep_lava_and_bldg(void);
466 extern bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
467 extern bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode);
468 extern bool is_open(FEAT_IDX feat);
471 extern HIT_POINT critical_shot(WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam);
472 extern void search(void);
473 extern void py_pickup_aux(OBJECT_IDX o_idx);
474 extern void carry(bool pickup);
475 extern bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x);
476 extern bool player_can_enter(FEAT_IDX feature, BIT_FLAGS16 mode);
477 extern bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode);
478 extern bool trap_can_be_ignored(FEAT_IDX feat);
479 extern void move_player(DIRECTION dir, bool do_pickup, bool break_trap);
480 extern void run_step(DIRECTION dir);
482 extern void travel_step(void);
486 extern bool cmd_limit_cast(player_type *creature_ptr);
487 extern bool cmd_limit_arena(player_type *creature_ptr);
488 extern bool cmd_limit_time_walk(player_type *creature_ptr);
489 extern bool cmd_limit_blind(player_type *creature_ptr);
490 extern bool cmd_limit_confused(player_type *creature_ptr);
491 extern bool cmd_limit_image(player_type *creature_ptr);
492 extern bool cmd_limit_stun(player_type *creature_ptr);
493 extern void forget_travel_flow(void);
494 extern void do_cmd_go_up(void);
495 extern void do_cmd_go_down(void);
496 extern void do_cmd_search(void);
497 extern void do_cmd_open(void);
498 extern void do_cmd_close(void);
499 extern void do_cmd_tunnel(void);
500 extern void do_cmd_disarm(void);
501 extern void do_cmd_bash(void);
502 extern void do_cmd_alter(void);
503 extern void do_cmd_spike(void);
504 extern void do_cmd_walk(bool pickup);
505 extern void do_cmd_stay(bool pickup);
506 extern void do_cmd_run(void);
507 extern void do_cmd_rest(void);
508 extern void do_cmd_fire(SPELL_IDX snipe_type);
509 extern void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type);
510 extern bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken);
512 extern void do_cmd_travel(void);
514 extern bool easy_open_door(POSITION y, POSITION x);
515 extern bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir);
519 extern concptr get_ordinal_number_suffix(int num);
521 extern errr do_cmd_write_nikki(int type, int num, concptr note);
522 extern void do_cmd_nikki(void);
523 extern void do_cmd_redraw(void);
524 extern void do_cmd_change_name(void);
525 extern void do_cmd_message_one(void);
526 extern void do_cmd_messages(int num_now);
527 extern void do_cmd_options_aux(int page, concptr info);
528 extern void do_cmd_options(void);
529 extern void do_cmd_pref(void);
530 extern void do_cmd_reload_autopick(void);
531 extern void do_cmd_macros(void);
532 extern void do_cmd_visuals(void);
533 extern void do_cmd_colors(void);
534 extern void do_cmd_note(void);
535 extern void do_cmd_version(void);
536 extern void do_cmd_feeling(void);
537 extern void do_cmd_load_screen(void);
538 extern void do_cmd_save_screen_html_aux(char *filename, int message);
539 extern void do_cmd_save_screen(void);
540 extern void do_cmd_knowledge_quests_completed(FILE *fff, QUEST_IDX quest_num[]);
541 extern void do_cmd_knowledge_quests_failed(FILE *fff, QUEST_IDX quest_num[]);
542 extern bool ang_sort_comp_quest_num(vptr u, vptr v, int a, int b);
543 extern void ang_sort_swap_quest_num(vptr u, vptr v, int a, int b);
544 extern void do_cmd_knowledge(void);
545 extern void plural_aux(char * Name);
546 extern void do_cmd_checkquest(void);
547 extern void do_cmd_time(void);
548 extern void do_cmd_suicide(void);
551 extern concptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
552 extern bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode);
555 extern void extract_option_vars(void);
556 extern void determine_bounty_uniques(void);
557 extern void determine_today_mon(bool conv_old);
558 extern void play_game(bool new_game);
559 extern s32b turn_real(s32b hoge);
560 extern void prevent_turn_overflow(void);
561 extern void close_game(void);
565 extern void safe_setuid_drop(void);
566 extern void safe_setuid_grab(void);
567 extern s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode);
568 extern void display_player(int mode);
569 extern errr make_character_dump(FILE *fff);
570 extern errr file_character(concptr name);
571 extern errr process_pref_file_command(char *buf);
572 extern concptr process_pref_file_expr(char **sp, char *fp);
573 extern errr process_pref_file(concptr name);
574 extern errr process_autopick_file(concptr name);
575 extern errr process_histpref_file(concptr name);
576 extern void print_equippy(void);
577 extern void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode);
578 extern errr check_time_init(void);
579 extern errr check_load_init(void);
580 extern errr check_time(void);
581 extern errr check_load(void);
582 extern bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode);
583 extern void do_cmd_help(void);
584 extern void process_player_name(bool sf);
585 extern void get_name(void);
586 extern void do_cmd_save_game(int is_autosave);
587 extern void do_cmd_save_and_exit(void);
588 extern long total_points(void);
589 extern void exit_game_panic(void);
590 extern void signals_ignore_tstp(void);
591 extern void signals_handle_tstp(void);
592 extern void signals_init(void);
593 extern errr get_rnd_line(concptr file_name, int entry, char *output);
594 extern void print_tomb(void);
595 extern void show_info(void);
596 extern bool check_score(void);
599 extern errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count);
601 extern errr counts_write(int where, u32b count);
602 extern u32b counts_read(int where);
605 extern void get_table_name_aux(char *out_string);
606 extern void get_table_name(char *out_string);
607 extern void get_table_sindarin_aux(char *out_string);
608 extern void get_table_sindarin(char *out_string);
609 extern void flavor_init(void);
610 extern char *object_desc_kosuu(char *t, object_type *o_ptr);
611 extern void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode);
614 extern void clear_saved_floor_files(void);
615 extern saved_floor_type *get_sf_ptr(FLOOR_IDX floor_id);
616 extern FLOOR_IDX get_new_floor_id(void);
617 extern void prepare_change_floor_mode(BIT_FLAGS mode);
618 extern void precalc_cur_num_of_pet(void);
619 extern void stair_creation(void);
622 extern TERM_COLOR color_char_to_attr(SYMBOL_CODE c);
623 extern s16b f_tag_to_index(concptr str);
624 extern errr process_dungeon_file(concptr name, int ymin, int xmin, int ymax, int xmax);
627 extern void init_file_paths(char *path);
628 extern concptr err_str[PARSE_ERROR_MAX];
629 extern errr init_v_info(void);
630 extern errr init_buildings(void);
631 extern s16b f_tag_to_index_in_init(concptr str);
632 extern void init_angband(void);
633 extern concptr get_check_sum(void);
636 extern errr rd_savefile_new(void);
637 extern bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode);
639 /* monster-process.c */
640 extern bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name);
641 extern void process_monsters(void);
642 extern void process_monster(MONSTER_IDX m_idx);
643 extern int get_mproc_idx(MONSTER_IDX m_idx, int mproc_type);
644 extern void mproc_init(void);
645 extern bool set_monster_csleep(MONSTER_IDX m_idx, int v);
646 extern bool set_monster_fast(MONSTER_IDX m_idx, int v);
647 extern bool set_monster_slow(MONSTER_IDX m_idx, int v);
648 extern bool set_monster_stunned(MONSTER_IDX m_idx, int v);
649 extern bool set_monster_confused(MONSTER_IDX m_idx, int v);
650 extern bool set_monster_monfear(MONSTER_IDX m_idx, int v);
651 extern bool set_monster_invulner(MONSTER_IDX m_idx, int v, bool energy_need);
652 extern void process_monsters_mtimed(int mtimed_idx);
653 extern void dispel_monster_status(MONSTER_IDX m_idx);
654 extern void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, IDX who);
655 extern bool process_the_world(int num, MONSTER_IDX who, bool vs_player);
656 extern void monster_gain_exp(MONSTER_IDX m_idx, IDX s_idx);
659 extern void roff_top(MONRACE_IDX r_idx);
660 extern void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode);
661 extern void display_roff(MONRACE_IDX r_idx);
662 extern void output_monster_spoiler(MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr, concptr str));
663 extern void create_name(int type, char *name);
664 extern concptr extract_note_dies(MONRACE_IDX r_idx);
665 extern void monster_death(MONSTER_IDX m_idx, bool drop_item);
667 extern monsterrace_hook_type get_monster_hook(void);
668 extern monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x);
669 extern void set_friendly(monster_type *m_ptr);
670 extern void set_pet(monster_type *m_ptr);
671 extern void set_hostile(monster_type *m_ptr);
672 extern void anger_monster(monster_type *m_ptr);
673 extern bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode);
674 extern bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode);
675 extern bool are_enemies(monster_type *m_ptr1, monster_type *m_ptr2);
676 extern bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr);
677 extern void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg);
681 extern concptr horror_desc[MAX_SAN_HORROR];
682 extern concptr funny_desc[MAX_SAN_FUNNY];
683 extern concptr funny_comments[MAX_SAN_COMMENT];
684 extern void set_target(monster_type *m_ptr, POSITION y, POSITION x);
685 extern void reset_target(monster_type *m_ptr);
686 extern monster_race *real_r_ptr(monster_type *m_ptr);
687 extern MONRACE_IDX real_r_idx(monster_type *m_ptr);
688 extern void delete_monster_idx(MONSTER_IDX i);
689 extern void delete_monster(POSITION y, POSITION x);
690 extern void compact_monsters(int size);
691 extern void wipe_m_list(void);
692 extern MONSTER_IDX m_pop(void);
693 extern errr get_mon_num_prep(monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
694 extern MONRACE_IDX get_mon_num(DEPTH level);
695 extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
696 extern int lore_do_probe(MONRACE_IDX r_idx);
697 extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
698 extern void update_monster(MONSTER_IDX m_idx, bool full);
699 extern void update_monsters(bool full);
700 extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
701 extern void update_smart_learn(MONSTER_IDX m_idx, int what);
702 extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
703 extern byte get_mspeed(monster_race *r_ptr);
704 extern void monster_drop_carried_objects(monster_type *m_ptr);
707 extern void reset_visuals(void);
708 extern void object_flags(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
709 extern void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
710 extern concptr item_activation(object_type *o_ptr);
711 extern bool screen_object(object_type *o_ptr, BIT_FLAGS mode);
712 extern char index_to_label(int i);
713 extern INVENTORY_IDX label_to_inven(int c);
714 extern INVENTORY_IDX label_to_equip(int c);
715 extern s16b wield_slot(object_type *o_ptr);
716 extern concptr mention_use(int i);
717 extern concptr describe_use(int i);
718 extern bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VALUE book_sval);
719 extern bool item_tester_okay(object_type *o_ptr);
720 extern void display_inven(void);
721 extern void display_equip(void);
722 extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode);
723 extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode);
724 extern void toggle_inven_equip(void);
725 extern bool can_get_item(void);
726 extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode);
727 extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
728 PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
731 extern void excise_object_idx(OBJECT_IDX o_idx);
732 extern void delete_object_idx(OBJECT_IDX o_idx);
733 extern void delete_object(POSITION y, POSITION x);
734 extern void compact_objects(int size);
735 extern void wipe_o_list(void);
736 extern OBJECT_IDX o_pop(void);
737 extern OBJECT_IDX get_obj_num(DEPTH level);
738 extern void object_known(object_type *o_ptr);
739 extern void object_aware(object_type *o_ptr);
740 extern void object_tried(object_type *o_ptr);
741 extern byte value_check_aux1(object_type *o_ptr);
742 extern byte value_check_aux2(object_type *o_ptr);
743 extern PRICE object_value(object_type *o_ptr);
744 extern PRICE object_value_real(object_type *o_ptr);
745 extern void distribute_charges(object_type *o_ptr, object_type *q_ptr, int amt);
746 extern void reduce_charges(object_type *o_ptr, int amt);
747 extern int object_similar_part(object_type *o_ptr, object_type *j_ptr);
748 extern bool object_similar(object_type *o_ptr, object_type *j_ptr);
749 extern void object_absorb(object_type *o_ptr, object_type *j_ptr);
750 extern IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval);
751 extern void object_wipe(object_type *o_ptr);
752 extern void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx);
753 extern void object_copy(object_type *o_ptr, object_type *j_ptr);
754 extern void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
755 extern bool make_object(object_type *j_ptr, BIT_FLAGS mode);
756 extern void place_object(POSITION y, POSITION x, BIT_FLAGS mode);
757 extern bool make_gold(object_type *j_ptr);
758 extern void place_gold(POSITION y, POSITION x);
759 extern OBJECT_IDX drop_near(object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
760 extern void inven_item_charges(INVENTORY_IDX item);
761 extern void inven_item_describe(INVENTORY_IDX item);
762 extern void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num);
763 extern void inven_item_optimize(INVENTORY_IDX item);
764 extern void floor_item_charges(INVENTORY_IDX item);
765 extern void floor_item_describe(INVENTORY_IDX item);
766 extern void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num);
767 extern void floor_item_optimize(INVENTORY_IDX item);
768 extern bool inven_carry_okay(object_type *o_ptr);
769 extern bool object_sort_comp(object_type *o_ptr, s32b o_value, object_type *j_ptr);
770 extern s16b inven_carry(object_type *o_ptr);
771 extern INVENTORY_IDX inven_takeoff(INVENTORY_IDX item, ITEM_NUMBER amt);
772 extern void inven_drop(INVENTORY_IDX item, ITEM_NUMBER amt);
773 extern void combine_pack(void);
774 extern void reorder_pack(void);
775 extern void display_koff(KIND_OBJECT_IDX k_idx);
776 extern void torch_flags(object_type *o_ptr, BIT_FLAGS *flgs);
777 extern void torch_dice(object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds);
778 extern void torch_lost_fuel(object_type *o_ptr);
779 extern concptr essence_name[];
782 extern void do_cmd_racial_power(void);
785 extern bool save_player(void);
786 extern bool load_player(void);
787 extern void remove_loc(void);
788 extern bool save_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode);
791 extern PERCENTAGE beam_chance(void);
792 extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
793 extern void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
794 extern int take_hit(int damage_type, HIT_POINT damage, concptr kb_str, int monspell);
795 extern u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ);
796 extern POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
797 extern bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell);
798 extern int project_length;
799 extern bool binding_field(HIT_POINT dam);
800 extern void seal_of_mirror(HIT_POINT dam);
801 extern concptr spell_category_name(OBJECT_TYPE_VALUE tval);
804 extern void message_pain(MONSTER_IDX m_idx, HIT_POINT dam);
805 extern bool detect_traps(POSITION range, bool known);
806 extern bool detect_doors(POSITION range);
807 extern bool detect_stairs(POSITION range);
808 extern bool detect_treasure(POSITION range);
809 extern bool detect_objects_gold(POSITION range);
810 extern bool detect_objects_normal(POSITION range);
811 extern bool detect_objects_magic(POSITION range);
812 extern bool detect_monsters_normal(POSITION range);
813 extern bool detect_monsters_invis(POSITION range);
814 extern bool detect_monsters_evil(POSITION range);
815 extern bool detect_monsters_xxx(POSITION range, u32b match_flag);
816 extern bool detect_monsters_string(POSITION range, concptr);
817 extern bool detect_monsters_nonliving(POSITION range);
818 extern bool detect_monsters_mind(POSITION range);
819 extern bool detect_all(POSITION range);
820 extern bool wall_stone(void);
821 extern bool speed_monsters(void);
822 extern bool slow_monsters(int power);
823 extern bool sleep_monsters(int power);
824 extern void aggravate_monsters(MONSTER_IDX who);
825 extern bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name);
826 extern bool symbol_genocide(int power, bool player_cast);
827 extern bool mass_genocide(int power, bool player_cast);
828 extern bool mass_genocide_undead(int power, bool player_cast);
829 extern bool probing(void);
830 extern bool banish_evil(int dist);
831 extern bool dispel_evil(HIT_POINT dam);
832 extern bool dispel_good(HIT_POINT dam);
833 extern bool dispel_undead(HIT_POINT dam);
834 extern bool dispel_monsters(HIT_POINT dam);
835 extern bool dispel_living(HIT_POINT dam);
836 extern bool dispel_demons(HIT_POINT dam);
837 extern bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful);
838 extern bool unleash_mana_storm(player_type *creature_ptr, bool powerful);
839 extern bool crusade(void);
840 extern bool turn_undead(void);
841 extern bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate);
842 extern bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
843 extern bool earthquake(POSITION cy, POSITION cx, POSITION r);
844 extern void lite_room(POSITION y1, POSITION x1);
845 extern bool starlight(bool magic);
846 extern void unlite_room(POSITION y1, POSITION x1);
847 extern bool lite_area(HIT_POINT dam, POSITION rad);
848 extern bool unlite_area(HIT_POINT dam, POSITION rad);
849 extern bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
850 extern bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
851 extern bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
852 extern bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
853 extern bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad);
854 extern bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam);
855 extern bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev);
856 extern void call_chaos(void);
857 extern bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam);
858 extern bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam);
859 extern bool lite_line(DIRECTION dir, HIT_POINT dam);
860 extern bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam);
861 extern bool death_ray(DIRECTION dir, PLAYER_LEVEL plev);
862 extern bool wall_to_mud(DIRECTION dir, HIT_POINT dam);
863 extern bool destroy_door(DIRECTION dir);
864 extern bool disarm_trap(DIRECTION dir);
865 extern bool wizard_lock(DIRECTION dir);
866 extern bool teleport_monster(DIRECTION dir, int distance);
867 extern bool door_creation(void);
868 extern bool trap_creation(POSITION y, POSITION x);
869 extern bool tree_creation(void);
870 extern bool glyph_creation(void);
871 extern bool destroy_doors_touch(void);
872 extern bool disarm_traps_touch(void);
873 extern bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x);
874 extern bool sleep_monsters_touch(void);
875 extern bool activate_ty_curse(bool stop_ty, int *count);
876 extern int activate_hi_summon(POSITION y, POSITION x, bool can_pet);
877 extern void wall_breaker(void);
878 extern bool confuse_monsters(HIT_POINT dam);
879 extern bool charm_monsters(HIT_POINT dam);
880 extern bool charm_animals(HIT_POINT dam);
881 extern bool stun_monsters(HIT_POINT dam);
882 extern bool stasis_monsters(HIT_POINT dam);
883 extern bool banish_monsters(int dist);
884 extern bool turn_monsters(HIT_POINT dam);
885 extern bool turn_evil(HIT_POINT dam);
886 extern bool deathray_monsters(void);
887 extern bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev);
888 extern bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev);
889 extern bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev);
890 extern bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev);
891 extern bool mindblast_monsters(HIT_POINT dam);
892 extern s32b flag_cost(object_type *o_ptr, int plusses);
893 extern bool teleport_swap(DIRECTION dir);
894 extern bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg);
895 extern bool project_all_los(EFFECT_ID typ, HIT_POINT dam);
896 extern bool eat_magic(int power);
897 extern void discharge_minion(void);
898 extern bool kawarimi(bool success);
899 extern bool rush_attack(bool *mdeath);
900 extern void remove_all_mirrors(bool explode);
901 extern void ring_of_power(DIRECTION dir);
902 extern void wild_magic(int spell);
903 extern void cast_meteor(HIT_POINT dam, POSITION rad);
904 extern bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad);
905 extern void cast_wonder(DIRECTION dir);
906 extern void cast_invoke_spirits(DIRECTION dir);
907 extern void cast_shuffle(void);
908 extern void stop_mouth(void);
909 extern bool_hack vampirism(void);
910 extern bool panic_hit(void);
911 extern bool psychometry(void);
912 extern bool draconian_breath(player_type *creature_ptr);
913 extern bool android_inside_weapon(player_type *creature_ptr);
914 extern bool create_ration(player_type *crature_ptr);
915 extern void hayagake(player_type *creature_ptr);
916 extern bool double_attack(player_type *creature_ptr);
917 extern bool comvert_hp_to_mp(player_type *creature_ptr);
918 extern bool comvert_mp_to_hp(player_type *creature_ptr);
919 extern bool demonic_breath(player_type *creature_ptr);
920 extern bool mirror_concentration(player_type *creature_ptr);
921 extern bool sword_dancing(player_type *creature_ptr);
922 extern bool confusing_light(player_type *creature_ptr);
923 extern bool rodeo(player_type *creature_ptr);
924 extern bool clear_mind(player_type *creature_ptr);
925 extern bool concentration(player_type *creature_ptr);
928 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
929 extern void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode);
930 extern bool teleport_player_aux(POSITION dis, BIT_FLAGS mode);
931 extern void teleport_player(POSITION dis, BIT_FLAGS mode);
932 extern void teleport_player_away(MONSTER_IDX m_idx, POSITION dis);
933 extern void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode);
934 extern void teleport_away_followable(MONSTER_IDX m_idx);
935 extern bool teleport_level_other(player_type *creature_ptr);
936 extern void teleport_level(MONSTER_IDX m_idx);
937 extern DUNGEON_IDX choose_dungeon(concptr note, POSITION y, POSITION x);
938 extern bool recall_player(player_type *creature_ptr, TIME_EFFECT turns);
939 extern bool free_level_recall(player_type *creature_ptr);
940 extern bool reset_recall(void);
941 extern bool apply_disenchant(BIT_FLAGS mode);
942 extern void brand_weapon(int brand_type);
943 extern void call_the_(void);
944 extern void fetch(DIRECTION dir, WEIGHT wgt, bool require_los);
945 extern void alter_reality(void);
946 extern void identify_pack(void);
947 extern int remove_curse(void);
948 extern int remove_all_curse(void);
949 extern bool alchemy(void);
950 extern bool enchant(object_type *o_ptr, int n, int eflag);
951 extern bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
952 extern bool artifact_scroll(void);
953 extern bool ident_spell(bool only_equip);
954 extern bool mundane_spell(bool only_equip);
955 extern bool identify_item(object_type *o_ptr);
956 extern bool identify_fully(bool only_equip);
957 extern bool recharge(int power);
958 extern void display_spell_list(void);
959 extern EXP experience_of_spell(SPELL_IDX spell, REALM_IDX use_realm);
960 extern MANA_POINT mod_need_mana(MANA_POINT need_mana, SPELL_IDX spell, REALM_IDX realm);
961 extern PERCENTAGE mod_spell_chance_1(PERCENTAGE chance);
962 extern PERCENTAGE mod_spell_chance_2(PERCENTAGE chance);
963 extern PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX realm);
964 extern void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, REALM_IDX realm);
965 extern bool polymorph_monster(POSITION y, POSITION x);
966 extern bool dimension_door(void);
967 extern bool mirror_tunnel(void);
968 extern void massacre(void);
969 extern bool eat_lock(void);
970 extern bool shock_power(void);
971 extern bool booze(player_type *creature_ptr);
972 extern bool detonation(player_type *creature_ptr);
973 extern void blood_curse_to_enemy(MONSTER_IDX m_idx);
974 extern bool fire_crimson(void);
978 extern void battle_monsters(void);
979 extern void do_cmd_bldg(void);
980 extern void do_cmd_quest(void);
981 extern void quest_discovery(QUEST_IDX q_idx);
982 extern bool tele_town(void);
983 extern HIT_POINT calc_crit_ratio_shot(HIT_POINT plus_ammo, HIT_POINT plus_bow);
984 extern HIT_POINT calc_expect_crit_shot(WEIGHT weight, int plus_ammo,int plus_bow, HIT_POINT dam);
985 extern HIT_POINT calc_expect_crit(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, bool dokubari);
988 extern errr path_parse(char *buf, int max, concptr file);
989 extern errr path_build(char *buf, int max, concptr path, concptr file);
990 extern FILE *my_fopen(concptr file, concptr mode);
991 extern FILE *my_fopen_temp(char *buf, int max);
992 extern errr my_fgets(FILE *fff, char *buf, huge n);
993 extern errr my_fputs(FILE *fff, concptr buf, huge n);
994 extern errr my_fclose(FILE *fff);
995 extern errr fd_kill(concptr file);
996 extern errr fd_move(concptr file, concptr what);
997 extern errr fd_copy(concptr file, concptr what);
998 extern int fd_make(concptr file, BIT_FLAGS mode);
999 extern int fd_open(concptr file, int flags);
1000 extern errr fd_lock(int fd, int what);
1001 extern errr fd_seek(int fd, huge n);
1002 extern errr fd_chop(int fd, huge n);
1003 extern errr fd_read(int fd, char *buf, huge n);
1004 extern errr fd_write(int fd, concptr buf, huge n);
1005 extern errr fd_close(int fd);
1006 extern void flush(void);
1007 extern void bell(void);
1008 extern errr play_music(int type, int num);
1009 extern void select_floor_music(void);
1010 extern void sound(int num);
1011 extern void move_cursor(int row, int col);
1012 extern void text_to_ascii(char *buf, concptr str);
1013 extern void ascii_to_text(char *buf, concptr str);
1014 extern errr macro_add(concptr pat, concptr act);
1015 extern sint macro_find_exact(concptr pat);
1016 extern char inkey(void);
1017 extern concptr quark_str(STR_OFFSET num);
1018 extern void quark_init(void);
1019 extern u16b quark_add(concptr str);
1020 extern s32b message_num(void);
1021 extern concptr message_str(int age);
1022 extern void message_add(concptr msg);
1023 extern void msg_erase(void);
1024 extern void msg_print(concptr msg);
1025 extern void msg_print_wizard(int cheat_type, concptr msg);
1027 extern void msg_format(concptr fmt, ...);
1028 extern void msg_format_wizard(int cheat_type, concptr fmt, ...);
1030 extern void screen_save(void);
1031 extern void screen_load(void);
1032 extern void c_put_str(TERM_COLOR attr, concptr str, TERM_LEN row, TERM_LEN col);
1033 extern void put_str(concptr str, TERM_LEN row, TERM_LEN col);
1034 extern void c_prt(TERM_COLOR attr, concptr str, TERM_LEN row, TERM_LEN col);
1035 extern void prt(concptr str, TERM_LEN row, TERM_LEN col);
1036 extern void c_roff(TERM_COLOR attr, concptr str);
1037 extern void roff(concptr str);
1038 extern void clear_from(int row);
1039 extern bool askfor_aux(char *buf, int len, bool numpad_cursor);
1040 extern bool askfor(char *buf, int len);
1041 extern bool get_string(concptr prompt, char *buf, int len);
1042 extern bool get_check(concptr prompt);
1043 extern bool get_check_strict(concptr prompt, BIT_FLAGS mode);
1044 extern bool get_com(concptr prompt, char *command, bool z_escape);
1045 extern QUANTITY get_quantity(concptr prompt, QUANTITY max);
1046 extern void pause_line(int row);
1047 extern void request_command(int shopping);
1048 extern bool is_a_vowel(int ch);
1049 extern int get_keymap_dir(char ch);
1050 extern errr type_string(concptr str, uint len);
1051 extern void roff_to_buf(concptr str, int wlen, char *tbuf, size_t bufsize);
1054 extern void tag_sort(tag_type elements[], int number);
1055 #endif /* SORT_R_INFO */
1057 #ifdef SUPPORT_GAMMA
1058 extern byte gamma_table[256];
1059 extern void build_gamma_table(int gamma);
1060 #endif /* SUPPORT_GAMMA */
1062 extern size_t my_strcpy(char *buf, concptr src, size_t bufsize);
1063 extern size_t my_strcat(char *buf, concptr src, size_t bufsize);
1064 extern char *my_strstr(concptr haystack, concptr needle);
1065 extern char *my_strchr(concptr ptr, char ch);
1066 extern void str_tolower(char *str);
1067 extern int inkey_special(bool numpad_cursor);
1071 extern void cnv_stat(int val, char *out_val);
1072 extern s16b modify_stat_value(int value, int amount);
1073 extern void prt_time(void);
1074 extern concptr map_name(void);
1075 extern int bow_tval_ammo(object_type *o_ptr);
1076 extern void handle_stuff(void);
1077 extern void update_output(void);
1078 extern void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);
1079 extern void update_playtime(void);
1083 extern void set_action(ACTION_IDX typ);
1084 extern void reset_tim_flags(void);
1085 extern void dispel_player(void);
1086 extern bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec);
1087 extern bool set_blind(TIME_EFFECT v);
1088 extern bool set_confused(TIME_EFFECT v);
1089 extern bool set_poisoned(TIME_EFFECT v);
1090 extern bool set_afraid(TIME_EFFECT v);
1091 extern bool set_paralyzed(TIME_EFFECT v);
1092 extern bool set_image(TIME_EFFECT v);
1093 extern bool set_fast(TIME_EFFECT v, bool do_dec);
1094 extern bool set_slow(TIME_EFFECT v, bool do_dec);
1095 extern bool set_shield(TIME_EFFECT v, bool do_dec);
1096 extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
1097 extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
1098 extern bool set_blessed(TIME_EFFECT v, bool do_dec);
1099 extern bool set_hero(TIME_EFFECT v, bool do_dec);
1100 extern bool set_shero(TIME_EFFECT v, bool do_dec);
1101 extern bool set_protevil(TIME_EFFECT v, bool do_dec);
1102 extern bool set_invuln(TIME_EFFECT v, bool do_dec);
1103 extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
1104 extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
1105 extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
1106 extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
1107 extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
1108 extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
1109 extern bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec);
1110 extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec);
1111 extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec);
1112 extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec);
1113 extern bool set_resist_magic(TIME_EFFECT v, bool do_dec);
1114 extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
1115 extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
1116 extern bool set_dustrobe(TIME_EFFECT v, bool do_dec);
1117 extern bool set_kabenuke(TIME_EFFECT v, bool do_dec);
1118 extern bool set_tsuyoshi(TIME_EFFECT v, bool do_dec);
1119 extern bool set_ele_attack(u32b attack_type, TIME_EFFECT v);
1120 extern bool set_ele_immune(u32b immune_type, TIME_EFFECT v);
1121 extern bool set_oppose_acid(TIME_EFFECT v, bool do_dec);
1122 extern bool set_oppose_elec(TIME_EFFECT v, bool do_dec);
1123 extern bool set_oppose_fire(TIME_EFFECT v, bool do_dec);
1124 extern bool set_oppose_cold(TIME_EFFECT v, bool do_dec);
1125 extern bool set_oppose_pois(TIME_EFFECT v, bool do_dec);
1126 extern bool set_stun(TIME_EFFECT v);
1127 extern bool set_cut(TIME_EFFECT v);
1128 extern bool set_food(TIME_EFFECT v);
1129 extern bool inc_stat(int stat);
1130 extern bool dec_stat(int stat, int amount, int permanent);
1131 extern bool res_stat(int stat);
1132 extern bool hp_player(int num);
1133 extern bool do_dec_stat(int stat);
1134 extern bool do_res_stat(int stat);
1135 extern bool do_inc_stat(int stat);
1136 extern bool restore_level(void);
1137 extern bool lose_all_info(void);
1138 extern void gain_exp_64(s32b amount, u32b amount_frac);
1139 extern void gain_exp(s32b amount);
1140 extern void calc_android_exp(void);
1141 extern void lose_exp(s32b amount);
1142 extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
1143 extern void do_poly_self(void);
1144 extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
1145 extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
1146 extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
1147 extern bool choose_ele_attack(void);
1148 extern bool choose_ele_immune(TIME_EFFECT turn);
1149 extern bool set_wraith_form(TIME_EFFECT v, bool do_dec);
1150 extern bool set_tim_esp(TIME_EFFECT v, bool do_dec);
1151 extern bool set_superstealth(bool set);
1153 /* view-mainwindow.c */
1154 extern void resize_map(void);
1155 extern void redraw_window(void);
1156 extern bool change_panel(POSITION dy, POSITION dx);
1160 extern void get_screen_size(TERM_LEN *wid_p, TERM_LEN *hgt_p);
1161 extern void panel_bounds_center(void);
1162 extern void verify_panel(void);
1163 extern concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode);
1164 extern bool target_able(MONSTER_IDX m_idx);
1165 extern bool target_okay(void);
1166 extern bool target_set(BIT_FLAGS mode);
1167 extern void target_set_prepare_look(void);
1168 extern bool get_aim_dir(DIRECTION *dp);
1169 extern bool get_hack_dir(DIRECTION *dp);
1170 extern bool get_direction(DIRECTION *dp, bool allow_under, bool with_steed);
1171 extern bool get_rep_dir(DIRECTION *dp, bool under);
1172 extern bool tgt_pt(POSITION *x, POSITION *y);
1173 extern void do_poly_wounds(void);
1174 extern void change_race(CHARACTER_IDX new_race, concptr effect_msg);
1177 extern void display_scores_aux(int from, int to, int note, high_score *score);
1178 extern void display_scores(int from, int to);
1179 extern void kingly(void);
1180 extern bool send_world_score(bool do_send);
1181 extern errr top_twenty(void);
1182 extern errr predict_score(void);
1183 extern void race_legends(void);
1184 extern void race_score(int race_num);
1185 extern void show_highclass(void);
1188 extern mind_power const mind_powers[5];
1189 extern void mindcraft_info(char *p, int use_mind, int power);
1190 extern void do_cmd_mind(void);
1191 extern void do_cmd_mind_browse(void);
1194 extern bool do_cmd_mane(bool baigaesi);
1197 extern bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend);
1198 extern bool summon_possible(POSITION y1, POSITION x1);
1199 extern bool raise_possible(monster_type *m_ptr);
1200 extern bool dispel_check(MONSTER_IDX m_idx);
1201 extern bool spell_is_inate(SPELL_IDX spell);
1202 extern bool make_attack_spell(MONSTER_IDX m_idx);
1203 extern void beam(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
1204 extern void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
1205 extern void breath(POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type);
1208 extern void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
1209 extern bool monst_spell_monst(MONSTER_IDX m_idx);
1212 extern bool do_cmd_cast_learned(void);
1213 extern void learn_spell(int monspell);
1214 extern void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode);
1217 extern bool spell_learnable(MONSTER_IDX m_idx);
1218 extern HIT_POINT monspell_to_player(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx);
1219 extern HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
1220 extern HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE);
1221 extern HIT_POINT monspell_race_damage(int SPELL_NUM, MONRACE_IDX r_idx, int TYPE);
1222 extern HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE);
1225 extern void do_cmd_hissatsu(void);
1226 extern void do_cmd_gain_hissatsu(void);
1230 * Hack -- conditional (or "bizarre") externs
1235 extern void user_name(char *buf, int id);
1241 extern int stricmp(concptr a, concptr b);
1247 extern int usleep(huge usecs);
1252 /* extern void main(void); */
1255 #if defined(MAC_MPW) || defined(MACH_O_CARBON)
1256 /* Globals needed */
1258 extern u32b _fcreator;
1261 #if defined(MAC_MPW) && defined(CARBON)
1262 extern void convert_pathname(char *path);
1265 #if defined(MACH_O_CARBON)
1266 extern void fsetfileinfo(concptr path, u32b fcreator, u32b ftype);
1271 /* extern int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, ...); */
1275 extern void repeat_push(COMMAND_CODE what);
1276 extern bool repeat_pull(COMMAND_CODE *what);
1277 extern void repeat_check(void);
1280 extern bool easy_open;
1284 extern bool easy_disarm;
1288 extern ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode);
1289 extern COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_width);
1290 extern bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode);
1291 extern void py_pickup_floor(bool pickup);
1294 extern bool easy_floor;
1297 extern void spoil_random_artifact(concptr fname);
1300 extern void strip_name(char *buf, KIND_OBJECT_IDX k_idx);
1301 extern void cheat_death(player_type *creature_ptr);
1306 extern void sindarin_to_kana(char *kana, concptr sindarin);
1307 extern void jverb( concptr in , char *out , int flag);
1308 extern void sjis2euc(char *str);
1309 extern void euc2sjis(char *str);
1310 extern byte codeconv(char *str);
1311 extern bool iskanji2(concptr s, int x);
1312 extern void guess_convert_to_system_encoding(char* strbuf, int buflen);
1317 extern errr report_score(void);
1318 extern concptr make_screen_dump(void);
1322 extern int soc_write(int sd, char *buf, size_t sz);
1323 extern int soc_read(int sd, char *buf, size_t sz);
1324 extern void set_proxy(char *default_url, int default_port);
1325 extern int connect_server(int timeout, concptr host, int port);
1326 extern int disconnect_server(int sd);
1327 extern concptr soc_err(void);
1331 extern bool chuukei_server;
1332 extern bool chuukei_client;
1334 extern int connect_chuukei_server(char *server_string);
1335 extern void browse_chuukei(void);
1336 extern void flush_ringbuf(void);
1337 extern void prepare_chuukei_hooks(void);
1340 extern void prepare_movie_hooks(void);
1341 extern void prepare_browse_movie_aux(concptr filename);
1342 extern void prepare_browse_movie(concptr filename);
1343 extern void browse_movie(void);
1344 extern bool browsing_movie;
1348 extern travel_type travel;
1351 /* variable.c (for snipers) */
1352 extern bool reset_concent; /* Concentration reset flag */
1353 extern bool is_fired;
1356 extern void reset_concentration(bool msg);
1357 extern void display_snipe_list(void);
1358 extern MULTIPLY tot_dam_aux_snipe (MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type);
1359 extern void do_cmd_snipe(void);
1360 extern void do_cmd_snipe_browse(void);
1361 extern int boost_concentration_damage(int tdam);
1363 extern void kamaenaoshi(INVENTORY_IDX item);
1365 extern bool ang_sort_comp_hook(vptr u, vptr v, int a, int b);
1366 extern void ang_sort_swap_hook(vptr u, vptr v, int a, int b);