extern kamae kamae_shurui[MAX_KAMAE];
extern kamae kata_shurui[MAX_KATA];
extern cptr exp_level_str[5];
-extern s16b conv_terrain2feat[MAX_WILDERNESS];
extern cptr silly_attacks[MAX_SILLY_ATTACK];
#ifdef JP
extern cptr silly_attacks2[MAX_SILLY_ATTACK];
extern bool character_saved;
extern bool character_icky;
extern bool character_xtra;
+extern bool creating_savefile;
extern u32b seed_flavor;
extern u32b seed_town;
extern s16b command_cmd;
extern s16b monster_level;
extern s16b base_level;
extern s32b turn;
+extern s32b turn_limit;
extern s32b dungeon_turn;
+extern s32b dungeon_turn_limit;
extern s32b old_turn;
extern s32b old_battle;
extern bool use_sound;
extern bool inkey_xtra;
extern bool inkey_scan;
extern bool inkey_flag;
+extern bool get_com_no_macros;
extern s16b coin_type;
extern bool opening_chest;
extern bool shimmer_monsters;
extern s16b hack_m_idx;
extern s16b hack_m_idx_ii;
extern int total_friends;
-extern s32b total_friend_levels;
extern s32b friend_align;
extern int leaving_quest;
extern bool reinit_wilderness;
extern bool abbrev_extra; /* Describe obj's extra resistances by abbreviation */
extern bool abbrev_all; /* Describe obj's all resistances by abbreviation */
extern bool exp_need; /* Show the experience needed for next level */
+extern bool ignore_unview; /* Ignore whenever any monster does */
/*** Game-Play Options ***/
extern s16b autosave_freq;
extern bool autosave_t;
extern bool autosave_l;
-extern byte feeling;
-extern s16b rating;
-extern bool good_item_flag;
extern bool closing_flag;
extern s16b panel_row_min, panel_row_max;
extern s16b panel_col_min, panel_col_max;
extern u32b saved_floor_file_sign;
extern object_type *o_list;
extern monster_type *m_list;
+extern s16b *mproc_list[MAX_MTIMED];
+extern s16b mproc_max[MAX_MTIMED];
extern u16b max_towns;
extern town_type *town;
extern object_type *inventory;
extern int riding_t_m_idx;
extern s16b kubi_r_idx[MAX_KUBI];
extern s16b today_mon;
-extern monster_type party_mon[MAX_PARTY_MON];
extern bool write_level;
extern u32b playtime;
extern u32b start_time;
extern bool ambush_flag;
extern bool generate_encounter;
extern cptr screen_dump;
+
+/*** Terrain feature variables ***/
+extern s16b feat_none;
+extern s16b feat_floor;
+extern s16b feat_glyph;
+extern s16b feat_explosive_rune;
+extern s16b feat_mirror;
+extern door_type feat_door[MAX_DOOR_TYPES];
+extern s16b feat_up_stair;
+extern s16b feat_down_stair;
+extern s16b feat_entrance;
+extern s16b feat_trap_open;
+extern s16b feat_trap_armageddon;
+extern s16b feat_trap_piranha;
+extern s16b feat_rubble;
+extern s16b feat_magma_vein;
+extern s16b feat_quartz_vein;
+extern s16b feat_granite;
+extern s16b feat_permanent;
+extern s16b feat_glass_floor;
+extern s16b feat_glass_wall;
+extern s16b feat_permanent_glass_wall;
+extern s16b feat_pattern_start;
+extern s16b feat_pattern_1;
+extern s16b feat_pattern_2;
+extern s16b feat_pattern_3;
+extern s16b feat_pattern_4;
+extern s16b feat_pattern_end;
+extern s16b feat_pattern_old;
+extern s16b feat_pattern_exit;
+extern s16b feat_pattern_corrupted;
+extern s16b feat_black_market;
+extern s16b feat_town;
+extern s16b feat_deep_water;
+extern s16b feat_shallow_water;
+extern s16b feat_deep_lava;
+extern s16b feat_shallow_lava;
+extern s16b feat_dirt;
+extern s16b feat_grass;
+extern s16b feat_flower;
+extern s16b feat_brake;
+extern s16b feat_tree;
+extern s16b feat_mountain;
+extern s16b feat_swamp;
+extern s16b feat_undetected;
+
extern byte dungeon_type;
extern s16b *max_dlv;
extern s16b feat_wall_outer;
extern void update_local_illumination(int y, int x);
extern bool player_can_see_bold(int y, int x);
extern bool cave_valid_bold(int y, int x);
-extern bool cave_valid_grid(cave_type *c_ptr);
extern bool no_lite(void);
extern void apply_default_feat_lighting(byte f_attr[F_LIT_MAX], byte f_char[F_LIT_MAX]);
extern void map_info(int y, int x, byte *ap, char *cp, byte *tap, char *tcp);
extern bool trap_can_be_ignored(int feat);
extern void move_player(int dir, bool do_pickup, bool break_trap);
extern void run_step(int dir);
+#ifdef TRAVEL
+extern void travel_step(void);
+#endif
/* cmd2.c */
+extern bool confirm_leave_level(bool down_stair);
extern void do_cmd_go_up(void);
extern void do_cmd_go_down(void);
extern void do_cmd_search(void);
extern void do_cmd_fire_aux(int item, object_type *j_ptr);
extern void do_cmd_throw(void);
extern bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken);
+#ifdef TRAVEL
+extern void do_cmd_travel(void);
+#endif
/* cmd3.c */
extern void do_cmd_inven(void);
extern cptr spell_category_name(int tval);
extern void do_cmd_browse(void);
extern void do_cmd_study(void);
-extern void stop_singing(void);
extern void do_cmd_cast(void);
-extern void do_cmd_pray(void);
extern bool rakuba(int dam, bool force);
extern bool do_riding(bool force);
+extern void check_pets_num_and_align(monster_type *m_ptr, bool inc);
extern int calculate_upkeep(void);
extern void do_cmd_pet_dismiss(void);
extern void do_cmd_pet(void);
extern void do_cmd_use(void);
extern void do_cmd_magic_eater(bool only_browse);
+/* do-spell.c */
+extern void stop_singing(void);
+extern cptr do_spell(int realm, int spell, int mode);
+
/* dungeon.c */
extern void leave_quest_check(void);
+extern void leave_tower_check(void);
extern void extract_option_vars(void);
extern void determine_bounty_uniques(void);
extern void determine_today_mon(bool conv_old);
extern void leave_level(int level);
extern void enter_level(int level);
extern s32b turn_real(s32b hoge);
+extern void prevent_turn_overflow(void);
/* files.c */
extern errr make_character_dump(FILE *fff);
extern errr file_character(cptr name);
extern errr process_pref_file_command(char *buf);
-extern cptr process_pref_file_expr(cptr *sp, char *fp);
+extern cptr process_pref_file_expr(char **sp, char *fp);
extern errr process_pref_file(cptr name);
extern errr process_autopick_file(cptr name);
extern errr process_histpref_file(cptr name);
extern u32b counts_read(int where);
/* flavor.c */
+extern void get_table_name_aux(char *out_string);
extern void get_table_name(char *out_string);
+extern void get_table_sindarin_aux(char *out_string);
+extern void get_table_sindarin(char *out_string);
extern void flavor_init(void);
extern char *object_desc_kosuu(char *t, object_type *o_ptr);
extern void object_desc(char *buf, object_type *o_ptr, u32b mode);
extern void stair_creation(void);
/* generate.c */
-extern void place_closed_door(int y, int x);
-extern void place_quest_monsters(void);
+extern bool place_quest_monsters(void);
+extern void wipe_generate_cave_flags(void);
extern void clear_cave(void);
extern void generate_cave(void);
/* init1.c */
extern byte color_char_to_attr(char c);
+extern s16b f_tag_to_index(cptr str);
extern errr process_dungeon_file(cptr name, int ymin, int xmin, int ymax, int xmax);
/* init2.c */
extern cptr err_str[PARSE_ERROR_MAX];
extern errr init_v_info(void);
extern errr init_buildings(void);
+extern s16b f_tag_to_index_in_init(cptr str);
extern void init_angband(void);
extern cptr get_check_sum(void);
/* melee1.c */
/* melee2.c */
extern bool make_attack_normal(int m_idx);
-extern bool make_attack_spell(int m_idx);
extern void process_monsters(void);
+extern int get_mproc_idx(int m_idx, int mproc_type);
+extern void mproc_init(void);
+extern bool set_monster_csleep(int m_idx, int v);
+extern bool set_monster_fast(int m_idx, int v);
+extern bool set_monster_slow(int m_idx, int v);
+extern bool set_monster_stunned(int m_idx, int v);
+extern bool set_monster_confused(int m_idx, int v);
+extern bool set_monster_monfear(int m_idx, int v);
+extern bool set_monster_invulner(int m_idx, int v, bool energy_need);
+extern void process_monsters_mtimed(int mtimed_idx);
+extern void dispel_monster_status(int m_idx);
extern u32b get_curse(int power, object_type *o_ptr);
extern void curse_equipment(int chance, int heavy_chance);
extern void mon_take_hit_mon(int m_idx, int dam, bool *fear, cptr note, int who);
extern bool place_monster_aux(int who, int y, int x, int r_idx, u32b mode);
extern bool place_monster(int y, int x, u32b mode);
extern bool alloc_horde(int y, int x);
-extern bool alloc_guardian(void);
+extern bool alloc_guardian(bool def_val);
extern bool alloc_monster(int dis, u32b mode);
extern bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode);
extern bool summon_named_creature (int who, int oy, int ox, int r_idx, u32b mode);
extern void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE]);
extern void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE]);
extern cptr item_activation(object_type *o_ptr);
-extern bool screen_object(object_type *o_ptr, bool real);
+extern bool screen_object(object_type *o_ptr, u32b mode);
extern char index_to_label(int i);
extern s16b label_to_inven(int c);
extern s16b label_to_equip(int c);
extern bool can_player_destroy_object(object_type *o_ptr);
extern void distribute_charges(object_type *o_ptr, object_type *q_ptr, int amt);
extern void reduce_charges(object_type *o_ptr, int amt);
+extern int object_similar_part(object_type *o_ptr, object_type *j_ptr);
extern bool object_similar(object_type *o_ptr, object_type *j_ptr);
extern void object_absorb(object_type *o_ptr, object_type *j_ptr);
extern s16b lookup_kind(int tval, int sval);
extern void place_gold(int y, int x);
extern s16b drop_near(object_type *o_ptr, int chance, int y, int x);
extern void acquirement(int y1, int x1, int num, bool great, bool known);
+extern void init_normal_traps(void);
extern s16b choose_random_trap(void);
extern void disclose_grid(int y, int x);
extern void place_trap(int y, int x);
extern void floor_item_increase(int item, int num);
extern void floor_item_optimize(int item);
extern bool inven_carry_okay(object_type *o_ptr);
+extern bool object_sort_comp(object_type *o_ptr, s32b o_value, object_type *j_ptr);
extern s16b inven_carry(object_type *o_ptr);
extern s16b inven_takeoff(int item, int amt);
extern void inven_drop(int item, int amt);
extern bool slow_monsters(void);
extern bool sleep_monsters(void);
extern void aggravate_monsters(int who);
-extern bool symbol_genocide(int power, int player_cast);
-extern bool mass_genocide(int power, int player_cast);
-extern bool mass_genocide_undead(int power, int player_cast);
+extern bool genocide_aux(int m_idx, int power, bool player_cast, int dam_side, cptr spell_name);
+extern bool symbol_genocide(int power, bool player_cast);
+extern bool mass_genocide(int power, bool player_cast);
+extern bool mass_genocide_undead(int power, bool player_cast);
extern bool probing(void);
extern bool banish_evil(int dist);
extern bool dispel_evil(int dam);
extern bool crusade(void);
extern bool turn_undead(void);
extern bool destroy_area(int y1, int x1, int r, bool in_generate);
+extern bool earthquake_aux(int cy, int cx, int r, int m_idx);
extern bool earthquake(int cy, int cx, int r);
extern void lite_room(int y1, int x1);
extern void unlite_room(int y1, int x1);
extern bool project_hack(int typ, int dam);
extern bool eat_magic(int power);
extern void discharge_minion(void);
-extern void kawarimi(bool success);
+extern bool kawarimi(bool success);
extern bool rush_attack(bool *mdeath);
extern void remove_all_mirrors(bool explode);
/* spells3.c */
-extern bool teleport_away(int m_idx, int dis, bool dec_valour);
-extern void teleport_monster_to(int m_idx, int ty, int tx, int power);
-extern bool cave_teleportable_bold(int y, int x, bool passive);
-extern void teleport_player(int dis, bool passive);
-extern void teleport_player_to(int ny, int nx, bool no_tele, bool passive);
+extern bool teleport_away(int m_idx, int dis, u32b mode);
+extern void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode);
+extern bool cave_player_teleportable_bold(int y, int x, u32b mode);
+extern bool teleport_player_aux(int dis, u32b mode);
+extern void teleport_player(int dis, u32b mode);
+extern void teleport_player_away(int m_idx, int dis);
+extern void teleport_player_to(int ny, int nx, u32b mode);
+extern void teleport_away_followable(int m_idx);
extern void teleport_level(int m_idx);
extern int choose_dungeon(cptr note, int y, int x);
extern bool recall_player(int turns);
extern bool summon_kin_player(int level, int y, int x, u32b mode);
/* store.c */
+extern bool combine_and_reorder_home(int store_num);
extern void do_cmd_store(void);
extern void store_shuffle(int which);
extern void store_maint(int town_num, int store_num);
extern sint macro_find_exact(cptr pat);
extern char inkey(void);
extern cptr quark_str(s16b num);
+extern void quark_init(void);
extern s16b quark_add(cptr str);
extern s16b message_num(void);
extern cptr message_str(int age);
extern void extract_day_hour_min(int *day, int *hour, int *min);
extern void prt_time(void);
extern cptr map_name(void);
+extern u32b weight_limit(void);
extern bool buki_motteruka(int i);
extern void calc_bonuses(void);
extern void notice_stuff(void);
extern void redraw_stuff(void);
extern void window_stuff(void);
extern void handle_stuff(void);
-extern s16b empty_hands(bool is_monk);
+extern s16b empty_hands(bool riding_control);
extern bool heavy_armor(void);
+extern void print_monster_list(int x, int y, int max_lines);
/* effects.c */
extern void set_action(int typ);
extern void reset_tim_flags(void);
+extern void dispel_player(void);
extern bool set_mimic(int v, int p, bool do_dec);
extern bool set_blind(int v);
extern bool set_confused(int v);
extern bool target_able(int m_idx);
extern bool target_okay(void);
extern bool target_set(int mode);
+extern void target_set_prepare_look();
extern bool get_aim_dir(int *dp);
extern bool get_hack_dir(int *dp);
extern bool get_rep_dir(int *dp, bool under);
extern int weapon_exp_level(int weapon_exp);
extern int riding_exp_level(int riding_exp);
extern int spell_exp_level(int spell_exp);
+extern void display_rumor(bool ex);
/* mspells1.c */
extern bool clean_shot(int y1, int x1, int y2, int x2, bool friend);
extern bool summon_possible(int y1, int x1);
extern bool raise_possible(monster_type *m_ptr);
+extern bool dispel_check(int m_idx);
extern bool spell_is_inate(u16b spell);
+extern bool make_attack_spell(int m_idx);
/* mspells2.c */
extern void get_project_point(int sy, int sx, int *ty, int *tx, int flg);
extern void one_ability(object_type *o_ptr);
extern bool create_artifact(object_type *o_ptr, bool a_scroll);
extern bool activate_random_artifact(object_type * o_ptr);
+extern void get_bloody_moon_flags(object_type *o_ptr);
extern void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr);
-extern void create_named_art(int a_idx, int y, int x);
+extern bool create_named_art(int a_idx, int y, int x);
/* scores.c */
extern void display_scores_aux(int from, int to, int note, high_score *score);
/* extern void main(void); */
#endif
-#if defined(MAC_MPW)
+#if defined(MAC_MPW) || defined(MACH_O_CARBON)
/* Globals needed */
extern u32b _ftype;
extern u32b _fcreator;
#endif
+#if defined(MAC_MPW) && defined(CARBON)
+extern void convert_pathname(char *path);
+#endif
+
+#if defined(MACH_O_CARBON)
+extern void fsetfileinfo(cptr path, u32b fcreator, u32b ftype);
+#endif
+
#ifdef WINDOWS
/* main-win.c */
/* extern int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, ...); */
extern bool object_is_ammo(object_type *o_ptr);
extern bool object_is_armour(object_type *o_ptr);
extern bool object_is_weapon_armour_ammo(object_type *o_ptr);
-extern bool object_is_weapon_armour_ammo(object_type *o_ptr);
extern bool object_is_melee_weapon(object_type *o_ptr);
extern bool object_is_wearable(object_type *o_ptr);
extern bool object_is_equipment(object_type *o_ptr);
extern bool object_is_smith(object_type *o_ptr);
extern bool object_is_artifact(object_type *o_ptr);
extern bool object_is_nameless(object_type *o_ptr);
+extern bool object_allow_two_hands_wielding(object_type *o_ptr);
/* wild.c */
extern void set_floor_and_wall(byte type);
extern void wilderness_gen(void);
extern void wilderness_gen_small(void);
extern errr init_wilderness(void);
+extern void init_wilderness_terrains(void);
extern void seed_wilderness(void);
extern errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x);
extern bool change_wild_mode(void);
#ifdef JP
/* japanese.c */
+extern void sindarin_to_kana(char *kana, const char *sindarin);
extern void jverb1( const char *in , char *out);
extern void jverb2( const char *in , char *out);
extern void jverb3( const char *in , char *out);
extern void prepare_chuukei_hooks(void);
#endif
+extern void prepare_movie_hooks(void);
+extern void prepare_browse_movie_aux(cptr filename);
+extern void prepare_browse_movie(cptr filename);
+extern void browse_movie(void);
+extern bool browsing_movie;
+
+#ifdef TRAVEL
+/* for travel */
+extern travel_type travel;
+#endif
+
+/* variable.c (for snipers) */
+extern int snipe_type;
+extern bool reset_concent; /* Concentration reset flag */
+extern bool is_fired;
+
+/* snipe.c */
+extern void reset_concentration(bool msg);
+extern void display_snipe_list(void);
+extern int tot_dam_aux_snipe (int mult, monster_type *m_ptr);
+extern void do_cmd_snipe(void);
+extern void do_cmd_snipe_browse(void);
+extern int boost_concentration_damage(int tdam);
+
+/* hex.c */
+extern bool stop_hex_spell_all(void);
+extern bool stop_hex_spell(void);
+extern void check_hex(void);
+extern bool hex_spell_fully(void);
+extern void revenge_spell();
+extern void revenge_store(int dam);
+extern bool teleport_barrier(int m_idx);
+extern bool magic_barrier(int m_idx);
+extern bool multiply_barrier(int m_idx);
+