OSDN Git Service

自動破壊を簡単に設定する機能を破壊コマンド(k/^D)に追加した。
[hengband/hengband.git] / src / variable.c
index de92cef..ff8efb7 100644 (file)
@@ -1,15 +1,15 @@
 /* File: variable.c */
 
-/* Purpose: Angband variables */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: Angband variables */
+
 #include "angband.h"
 
 
@@ -27,35 +27,31 @@ cptr copyright[5] =
 
 
 int max_macrotrigger = 0;
-char *macro_template = NULL;
-char *macro_modifier_chr;
-char *macro_modifier_name[MAX_MACRO_MOD];
-char *macro_trigger_name[MAX_MACRO_TRIG];
-char *macro_trigger_keycode[2][MAX_MACRO_TRIG];
+cptr macro_template = NULL;
+cptr macro_modifier_chr;
+cptr macro_modifier_name[MAX_MACRO_MOD];
+cptr macro_trigger_name[MAX_MACRO_TRIG];
+cptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
 
 /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ë¾å¾ºÎ̤òɽ¼¨¤¹¤ë¤Î¤Ë»È¤¦ */
 int level_up = 0;
-int max_autopick=0;
-cptr autopick_name[MAX_AUTOPICK];
-cptr autopick_insc[MAX_AUTOPICK];
-byte autopick_action[MAX_AUTOPICK];
 
-/*
- * Executable version
+/* 
+ *  List for auto-picker/destroyer entries
  */
-byte version_major = VERSION_MAJOR;
-byte version_minor = VERSION_MINOR;
-byte version_patch = VERSION_PATCH;
-byte version_extra = VERSION_EXTRA;
+int max_autopick = 0;
+int max_max_autopick = 0;
+autopick_type *autopick_list = NULL;
 
 /*
  * Savefile version
  */
-byte sf_major;                 /* Savefile's "version_major" */
-byte sf_minor;                 /* Savefile's "version_minor" */
-byte sf_patch;                 /* Savefile's "version_patch" */
-byte sf_extra;                 /* Savefile's "version_extra" */
-u32b sf_version;               /* Savefile's "version" */
+byte h_ver_major;       /* Savefile version for Hengband 1.1.1 and later */
+byte h_ver_minor;
+byte h_ver_patch;
+byte h_ver_extra;
+
+byte sf_extra;         /* Savefile's encoding key */
 
 byte z_major;           /* Savefile version for Hengband */
 byte z_minor;
@@ -64,7 +60,7 @@ byte z_patch;
 /*
  * Savefile information
  */
-u32b sf_xtra;                  /* Operating system info */
+u32b sf_system;                        /* Operating system info */
 u32b sf_when;                  /* Time when savefile created */
 u16b sf_lives;                 /* Number of past "lives" with this file */
 u16b sf_saves;                 /* Number of "saves" during this life */
@@ -79,6 +75,7 @@ byte arg_graphics;                    /* Command arg -- Request graphics mode */
 bool arg_monochrome;           /* Command arg -- Request monochrome mode */
 bool arg_force_original;       /* Command arg -- Request original keyset */
 bool arg_force_roguelike;      /* Command arg -- Request roguelike keyset */
+bool arg_bigtile = FALSE;      /* Command arg -- Request big tile mode */
 
 /*
  * Various things
@@ -100,24 +97,17 @@ s16b command_arg;          /* Gives argument of current command */
 s16b command_rep;              /* Gives repetition of current command */
 s16b command_dir;              /* Gives direction of current command */
 
-s16b command_see;              /* See "cmd1.c" */
-s16b command_wrk;              /* See "cmd1.c" */
+s16b command_see;              /* See "object1.c" */
+s16b command_wrk;              /* See "object1.c" */
 
-s16b command_gap = 50; /* See "cmd1.c" */
+s16b command_gap = 999;         /* See "object1.c" */
 
 s16b command_new;              /* Command chaining from inven/equip view */
 
 s16b energy_use;               /* Energy use this turn */
 
-byte create_up_stair;  /* Auto-create "up stairs" */
-byte create_down_stair;        /* Auto-create "down stairs" */
-
 bool msg_flag;                 /* Used in msg_print() for "buffering" */
 
-bool alive;                            /* True if game is running */
-
-bool death;                            /* True if player has died */
-
 s16b running;                  /* Current counter for running, if any */
 s16b resting;                  /* Current counter for resting, if any */
 
@@ -134,16 +124,9 @@ s32b dungeon_turn;                 /* Game turn in dungeon */
 s32b old_turn;                 /* Turn when level began (feelings) */
 s32b old_battle;
 
-bool wizard;                   /* Is the player currently in Wizard mode? */
-
 bool use_sound;                        /* The "sound" mode is enabled */
 bool use_graphics;             /* The "graphics" mode is enabled */
-
-u16b total_winner;             /* Semi-Hack -- Game has been won */
-
-u16b panic_save;               /* Track some special "conditions" */
-u16b noscore;                  /* Track various "cheating" conditions */
-bool wait_report_score;         /* Waiting to report score */
+bool use_bigtile = FALSE;
 
 s16b signal_count;             /* Hack -- Count interupts */
 
@@ -151,6 +134,7 @@ bool inkey_base;            /* See the "inkey()" function */
 bool inkey_xtra;               /* See the "inkey()" function */
 bool inkey_scan;               /* See the "inkey()" function */
 bool inkey_flag;               /* See the "inkey()" function */
+char inkey_macro_trigger_string[1024];
 
 s16b coin_type;                        /* Hack -- force coin type */
 
@@ -185,6 +169,7 @@ s32b total_friend_levels = 0;
 s32b friend_align = 0;
 
 int leaving_quest = 0;
+bool reinit_wilderness = FALSE;
 
 
 /*
@@ -210,7 +195,6 @@ bool stack_force_costs;             /* Merge discounts when stacking */
 
 bool show_labels;                      /* Show labels in object listings */
 bool show_weights;                     /* Show weights in object listings */
-bool show_choices;                     /* Show choices in certain sub-windows */
 
 bool ring_bell;                                /* Ring the bell (on errors, etc) */
 
@@ -222,28 +206,28 @@ bool show_item_graph;
 bool find_ignore_stairs;       /* Run past stairs */
 bool find_ignore_doors;                /* Run through open doors */
 bool find_cut;                         /* Run past known corners */
-bool find_examine;                     /* Run into potential corners */
 
 bool disturb_move;                     /* Disturb whenever any monster moves */
 bool disturb_near;                     /* Disturb whenever viewable monster moves */
+bool disturb_high;                      /* Disturb whenever high-level monster moves */
 bool disturb_panel;                    /* Disturb whenever map panel changes */
 bool disturb_state;                    /* Disturn whenever player state changes */
 bool disturb_minor;                    /* Disturb whenever boring things happen */
 
-bool alert_hitpoint;           /* Alert user to critical hitpoints */
+bool disturb_trap_detect;       /* Disturb when leaving trap detected area */
+bool alert_trap_detect;         /* Alert when leaving trap detected area */
 bool last_words;               /* Get last words upon dying */
 bool over_exert;
 bool small_levels;             /* Allow unusually small dungeon levels */
 bool always_small_levels;              /* Use always unusually small dungeon levels */
 bool empty_levels;             /* Allow empty 'arena' levels */
-bool player_symbols;           /* Use varying symbols for the player char */
+bool bound_walls_perm;         /* Boundary walls are created by permanent wall */
 bool equippy_chars;            /* Back by popular demand... */
-bool skip_mutations;           /* Skip mutations screen even if we have it */
+bool display_mutations;                /* Skip mutations screen even if we have it */
 bool plain_descriptions;       /* Plain object descriptions */
-bool stupid_monsters;          /* Monsters use old AI */
 bool confirm_destroy;          /* Known worthless items are destroyed without confirmation */
-bool confirm_stairs;           /* Prompt before staircases... */
-bool wear_confirm;             /* Confirm before putting on known cursed items */
+bool confirm_quest;            /* Prompt before staircases... */
+bool confirm_wear;             /* Confirm before putting on known cursed items */
 bool disturb_pets;             /* Pets moving nearby disturb us */
 
 
@@ -254,17 +238,13 @@ bool manual_haggle;                       /* Auto-haggle in stores */
 
 bool auto_scum;                                /* Auto-scum for good levels */
 
-bool stack_allow_items;                /* Allow weapons and armor to stack */
-bool stack_allow_wands;                /* Allow wands/staffs/rods to stack */
-
-bool expand_look;                      /* Expand the power of the look command */
 bool expand_list;                      /* Expand the power of the list commands */
 
 bool view_perma_grids;         /* Map remembers all perma-lit grids */
 bool view_torch_grids;         /* Map remembers all torch-lit grids */
+bool view_unsafe_grids;                /* Map marked by detect traps */
 
 bool dungeon_align;                    /* Generate dungeons with aligned rooms */
-bool dungeon_stair;                    /* Generate dungeons with connected stairs */
 
 bool track_follow;                     /* Monsters follow the player */
 bool track_target;                     /* Monsters target the player */
@@ -275,10 +255,9 @@ bool smart_cheat;                  /* Monsters exploit player weaknesses */
 
 /* Option Set 4 -- Efficiency */
 
-bool view_reduce_lite;         /* Reduce lite-radius when running */
 bool view_reduce_view;         /* Reduce view-radius in town */
 
-bool avoid_abort;                      /* Avoid checking for user abort */
+bool check_abort;                      /* Avoid checking for user abort */
 
 bool flush_failure;                    /* Flush input on any failure */
 bool flush_disturb;                    /* Flush input on disturbance */
@@ -303,8 +282,8 @@ bool plain_pickup;
 
 bool always_show_list;
 bool powerup_home;
-bool old_way_of_kaz;
 bool send_score;
+bool allow_debug_opts;   /* Allow use of debug/cheat options */
 
 /* Cheating options */
 
@@ -314,11 +293,13 @@ bool cheat_room;          /* Peek into dungeon creation */
 bool cheat_xtra;               /* Peek into something else */
 bool cheat_know;               /* Know complete monster info */
 bool cheat_live;               /* Allow player to avoid death */
+bool cheat_save;               /* Ask for saving death */
 
 
 /* Special options */
 
 byte hitpoint_warn;            /* Hitpoint warning (0 to 9) */
+byte mana_warn;                        /* Mana color (0 to 9) */
 
 byte delay_factor;             /* Delay factor (0 to 9) */
 
@@ -343,8 +324,6 @@ bool closing_flag;          /* Dungeon is closing */
  * Dungeon size info
  */
 
-s16b max_panel_rows, max_panel_cols;
-s16b panel_row, panel_col;
 s16b panel_row_min, panel_row_max;
 s16b panel_col_min, panel_col_max;
 s16b panel_col_prt, panel_row_prt;
@@ -380,15 +359,6 @@ char player_name[32];
  */
 char player_base[32];
 
-/*
- * What killed the player
- */
-char died_from[80];
-
-/*
- * Hack -- Textual "history" for the Player
- */
-char history[4][60];
 
 /*
  * Buffer to hold the current savefile name
@@ -408,8 +378,8 @@ s16b lite_x[LITE_MAX];
  * Array of grids lit by player lite (see "cave.c")
  */
 s16b mon_lite_n;
-s16b mon_lite_y[LITE_MAX];
-s16b mon_lite_x[LITE_MAX];
+s16b mon_lite_y[MON_LITE_MAX];
+s16b mon_lite_x[MON_LITE_MAX];
 
 /*
  * Array of grids viewable to the player (see "cave.c")
@@ -425,6 +395,13 @@ s16b temp_n;
 byte temp_y[TEMP_MAX];
 byte temp_x[TEMP_MAX];
 
+/*
+ * Array of grids for delayed visual updating (see "cave.c")
+ */
+s16b redraw_n = 0;
+byte redraw_y[REDRAW_MAX];
+byte redraw_x[REDRAW_MAX];
+
 
 /*
  * Number of active macros.
@@ -634,6 +611,26 @@ char angband_sound_name[SOUND_MAX][16] =
  */
 cave_type *cave[MAX_HGT];
 
+
+/*
+ * The array of saved floors
+ */
+saved_floor_type saved_floors[MAX_SAVED_FLOORS];
+
+
+/*
+ * Number of floor_id used from birth
+ */
+s16b max_floor_id;
+
+
+/*
+ * Sign for current process used in temporal files.
+ * Actually it is the start time of current process.
+ */
+u32b saved_floor_file_sign;
+
+
 /*
  * The array of dungeon items [max_o_idx]
  */
@@ -731,24 +728,10 @@ player_magic *mp_ptr;
 
 
 /*
- * More spell info
+ * The last character rolled,
+ * holded for quick start
  */
-u32b spell_learned1;   /* bit mask of spells learned */
-u32b spell_learned2;   /* bit mask of spells learned */
-u32b spell_worked1;    /* bit mask of spells tried and worked */
-u32b spell_worked2;    /* bit mask of spells tried and worked */
-u32b spell_forgotten1; /* bit mask of spells learned but forgotten */
-u32b spell_forgotten2; /* bit mask of spells learned but forgotten */
-byte spell_order[64];  /* order spells learned/remembered/forgotten */
-
-
-/*
- * Calculated base hp values for player at each level,
- * store them so that drain life + restore life does not
- * affect hit points.  Also prevents shameless use of backup
- * savefiles for hitpoint acquirement.
- */
-s16b player_hp[PY_MAX_LEVEL];
+birther previous_char;
 
 
 /*
@@ -762,22 +745,17 @@ char *v_text;
  * The skill table
  */
 skill_table *s_info;
-char *s_name;
-char *s_text;
 
 /*
  * The magic info
  */
 player_magic *m_info;
-char *m_name;
-char *m_text;
 
 /*
  * The terrain feature arrays
  */
 feature_type *f_info;
 char *f_name;
-char *f_text;
 
 /*
  * The object kind arrays
@@ -989,12 +967,15 @@ bool center_running;
 
 /* Auto-destruction options */
 bool destroy_items;
+bool destroy_feeling;
+bool destroy_identify;
 bool leave_worth;
 bool leave_equip;
 bool leave_wanted;
 bool leave_corpse;
 bool leave_junk;
 bool leave_chest;
+bool leave_special;
 
 /* Nikki */
 bool record_fix_art;
@@ -1112,15 +1093,10 @@ int init_flags;
  */
 int highscore_fd = -1;
 
-/*
- * Should the monster allocation fail with inappropriate terrain?
- */
-bool monster_terrain_sensitive = TRUE;
-
 int mutant_regenerate_mod = 100;
 
 /*
- * Startup options
+ * Birth options
  */
 bool easy_band;
 bool vanilla_town;            /* Use "vanilla" town without set quests */
@@ -1130,8 +1106,6 @@ bool ironman_downward;        /* Don't allow climbing upwards/recalling */
 bool ironman_autoscum;        /* Permanently enable the autoscummer */
 bool lite_town;               /* Use "lite" town without wilderness */
 bool ironman_empty_levels;    /* Always create empty 'arena' levels */
-bool terrain_streams;         /* Create terrain 'streamers' in the dungeon */
-bool munchkin_death;          /* Ask for saving death */
 bool ironman_rooms;           /* Always generate very unusual rooms */
 bool ironman_nightmare;                        /* Play the game in Nightmare mode */
 bool left_hander;
@@ -1142,19 +1116,9 @@ bool autochara;
 
 bool can_save = FALSE;        /* Game can be saved */
 
-s16b spell_exp[64];           /* mahou keikenchi */
-
-s16b weapon_exp[5][64];       /* weapon keikenchi */
-
-s16b skill_exp[10];           /* ginou keikenchi */
-
 bool world_monster;
 bool world_player;
 
-s16b mane_spell[MAX_MANE];
-s16b mane_dam[MAX_MANE];
-s16b mane_num;
-
 int cap_mon;
 int cap_mspeed;
 int cap_hp;
@@ -1173,7 +1137,7 @@ int riding_t_m_idx;
 s16b kubi_r_idx[MAX_KUBI];
 s16b today_mon;
 
-monster_type party_mon[21];
+monster_type party_mon[MAX_PARTY_MON];
 
 bool write_level;