OSDN Git Service

Weaponsmiths can drain lite essence according to lite radius of draining objects
[hengband/hengband.git] / src / types.h
index ed909c9..4e84cc8 100644 (file)
@@ -1,15 +1,15 @@
 /* File: types.h */
 
-/* Purpose: global type declarations */
-
 /*
- * 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: global type declarations */
+
 
 /*
  * This file should ONLY be included by "angband.h"
 
 
 /*
+ * Feature state structure
+ *
+ * - Action (FF_*)
+ * - Result (f_info ID)
+ */
+typedef struct feature_state feature_state;
+
+struct feature_state
+{
+       byte action;
+       s16b result;
+};
+
+
+/*
  * Information about terrain "features"
  */
 
@@ -56,21 +71,27 @@ typedef struct feature_type feature_type;
 
 struct feature_type
 {
-       u32b name;                      /* Name (offset) */
-       u32b text;                      /* Text (offset) */
+       u32b name;                /* Name (offset) */
+       u32b text;                /* Text (offset) */
+       s16b tag;                 /* Tag (offset) */
+
+       s16b mimic;               /* Feature to mimic */
 
-       byte mimic;                     /* Feature to mimic */
+       u32b flags[FF_FLAG_SIZE]; /* Flags */
 
-       byte extra;                     /* Extra byte (unused) */
+       u16b priority;            /* Map priority */
+       s16b destroyed;           /* Default destroyed state */
 
-       s16b unused;            /* Extra bytes (unused) */
+       feature_state state[MAX_FEAT_STATES];
 
-       byte d_attr;            /* Default feature attribute */
-       byte d_char;            /* Default feature character */
+       byte subtype;
+       byte power;
 
+       byte d_attr[F_LIT_MAX];   /* Default feature attribute */
+       byte d_char[F_LIT_MAX];   /* Default feature character */
 
-       byte x_attr;            /* Desired feature attribute */
-       byte x_char;            /* Desired feature character */
+       byte x_attr[F_LIT_MAX];   /* Desired feature attribute */
+       byte x_char[F_LIT_MAX];   /* Desired feature character */
 };
 
 
@@ -86,6 +107,7 @@ struct object_kind
 {
        u32b name;                      /* Name (offset) */
        u32b text;                      /* Text (offset) */
+       u32b flavor_name;               /* Flavor name (offset) */
 
        byte tval;                      /* Object type */
        byte sval;                      /* Object sub type */
@@ -104,9 +126,7 @@ struct object_kind
 
        s32b cost;                      /* Object "base cost" */
 
-       u32b flags1;            /* Flags, set 1 */
-       u32b flags2;            /* Flags, set 2 */
-       u32b flags3;            /* Flags, set 3 */
+       u32b flags[TR_FLAG_SIZE];       /* Flags */
 
        u32b gen_flags;         /* flags for generate */
 
@@ -125,7 +145,7 @@ struct object_kind
        byte x_char;            /* Desired object character */
 
 
-       byte flavor;                    /* Special object flavor (or zero) */
+       s16b flavor;            /* Special object flavor (or zero) */
 
        bool easy_know;         /* This object is always known (if aware) */
 
@@ -133,6 +153,8 @@ struct object_kind
        bool aware;                     /* The player is "aware" of the item's effects */
 
        bool tried;                     /* The player has "tried" one of the items */
+
+       byte act_idx;           /* Activative ability index */
 };
 
 
@@ -169,9 +191,7 @@ struct artifact_type
 
        s32b cost;                      /* Artifact "cost" */
 
-       u32b flags1;            /* Artifact Flags, set 1 */
-       u32b flags2;            /* Artifact Flags, set 2 */
-       u32b flags3;            /* Artifact Flags, set 3 */
+       u32b flags[TR_FLAG_SIZE];       /* Artifact Flags */
 
        u32b gen_flags;         /* flags for generate */
 
@@ -180,6 +200,10 @@ struct artifact_type
 
        byte cur_num;           /* Number created (0 or 1) */
        byte max_num;           /* Unused (should be "1") */
+
+       s16b floor_id;          /* Leaved on this location last time */
+
+       byte act_idx;           /* Activative ability index */
 };
 
 
@@ -208,11 +232,11 @@ struct ego_item_type
 
        s32b cost;                      /* Ego-item "cost" */
 
-       u32b flags1;            /* Ego-Item Flags, set 1 */
-       u32b flags2;            /* Ego-Item Flags, set 2 */
-       u32b flags3;            /* Ego-Item Flags, set 3 */
+       u32b flags[TR_FLAG_SIZE];       /* Ego-Item Flags */
 
        u32b gen_flags;         /* flags for generate */
+
+       byte act_idx;           /* Activative ability index */
 };
 
 
@@ -238,6 +262,14 @@ struct monster_blow
 };
 
 
+typedef struct mbe_info_type mbe_info_type;
+
+struct mbe_info_type
+{
+       int power;        /* The attack "power" */
+       int explode_type; /* Explosion effect */
+};
+
 
 /*
  * Monster "race" information, including racial memories
@@ -266,7 +298,7 @@ struct monster_race
 {
        u32b name;                              /* Name (offset) */
 #ifdef JP
-        u32b E_name;                    /* ±Ñ¸ì̾ (offset) */
+       u32b E_name;                    /* ±Ñ¸ì̾ (offset) */
 #endif
        u32b text;                              /* Text (offset) */
 
@@ -283,8 +315,7 @@ struct monster_race
 
        s16b extra;                             /* Unused (for now) */
 
-       byte freq_inate;                /* Inate spell frequency */
-       byte freq_spell;                /* Other spell frequency */
+       byte freq_spell;                /* Spell frequency */
 
        u32b flags1;                    /* Flags 1 (general) */
        u32b flags2;                    /* Flags 2 (abilities) */
@@ -295,8 +326,12 @@ struct monster_race
        u32b flags7;                    /* Flags 7 (movement related abilities) */
        u32b flags8;                    /* Flags 8 (wilderness info) */
        u32b flags9;                    /* Flags 9 (drops info) */
+       u32b flagsr;                    /* Flags R (resistances info) */
 
        monster_blow blow[4];   /* Up to four blows per round */
+       u16b reinforce_id[6];
+       u16b reinforce_dd[6];
+       u16b reinforce_ds[6];
 
        s16b next_r_idx;
        u32b next_exp;
@@ -317,11 +352,14 @@ struct monster_race
 
        byte cur_num;                   /* Monster population on current level */
 
+       s16b floor_id;                  /* Location of unique monster */
+
 
        s16b r_sights;                  /* Count sightings of this monster */
        s16b r_deaths;                  /* Count deaths from this monster */
 
-       s16b r_pkills;                  /* Count monsters killed in this life */
+       s16b r_pkills;                  /* Count visible monsters killed in this life */
+       s16b r_akills;                  /* Count all monsters killed in this life */
        s16b r_tkills;                  /* Count monsters killed in all lives */
 
        byte r_wake;                    /* Number of times woken up (?) */
@@ -333,7 +371,6 @@ struct monster_race
        byte r_drop_gold;               /* Max number of gold dropped at once */
        byte r_drop_item;               /* Max number of item dropped at once */
 
-       byte r_cast_inate;              /* Max number of inate spells seen */
        byte r_cast_spell;              /* Max number of other spells seen */
 
        byte r_blows[4];                /* Number of times each blow type was seen */
@@ -344,7 +381,8 @@ struct monster_race
        u32b r_flags4;                  /* Observed racial flags */
        u32b r_flags5;                  /* Observed racial flags */
        u32b r_flags6;                  /* Observed racial flags */
-       u32b r_flags7;                  /* Observed racial flags */
+       /* u32b r_flags7; */                    /* Observed racial flags */
+       u32b r_flagsr;                  /* Observed racial resistance flags */
 };
 
 
@@ -416,7 +454,7 @@ struct cave_type
 {
        u16b info;              /* Hack -- cave flags */
 
-       byte feat;              /* Hack -- feature type */
+       s16b feat;              /* Hack -- feature type */
 
        s16b o_idx;             /* Object in this grid */
 
@@ -424,7 +462,7 @@ struct cave_type
 
        s16b special;   /* Special cave info */
 
-       byte mimic;             /* Feature to mimic */
+       s16b mimic;             /* Feature to mimic */
 
        byte cost;              /* Hack -- cost of flowing */
        byte dist;              /* Hack -- distance from player */
@@ -498,10 +536,10 @@ struct object_type
        byte name2;                     /* Ego-Item type, if any */
 
        byte xtra1;                     /* Extra info type (now unused) */
-       byte xtra2;                     /* Extra info index */
-       byte xtra3;                     /* Extra info */
-       s16b xtra4;                     /* Extra info */
-       s16b xtra5;                     /* Extra info */
+       byte xtra2;                     /* Extra info activation index */
+       byte xtra3;                     /* Extra info for weaponsmith */
+       s16b xtra4;                     /* Extra info fuel or captured monster's current HP */
+       s16b xtra5;                     /* Extra info captured monster's max HP */
 
        s16b to_h;                      /* Plusses to hit */
        s16b to_d;                      /* Plusses to damage */
@@ -522,36 +560,13 @@ struct object_type
 
        byte feeling;          /* Game generated inscription number (eg, pseudo-id) */
 
-       u32b art_flags1;        /* Flags, set 1  Alas, these were necessary */
-       u32b art_flags2;        /* Flags, set 2  for the random artifacts of*/
-       u32b art_flags3;        /* Flags, set 3  Zangband */
+       u32b art_flags[TR_FLAG_SIZE];        /* Extra Flags for ego and artifacts */
 
        u32b curse_flags;        /* Flags for curse */
 
        s16b next_o_idx;        /* Next object in stack (if any) */
 
        s16b held_m_idx;        /* Monster holding us (if any) */
-
-#ifdef SCRIPT_OBJ_KIND
-       char *name;
-
-       byte d_attr;            /* Default object attribute */
-       byte d_char;            /* Default object character */
-
-
-       byte x_attr;            /* Desired object attribute */
-       byte x_char;            /* Desired object character */
-
-
-       byte flavor;                    /* Special object flavor (or zero) */
-
-       bool easy_know;         /* This object is always known (if aware) */
-
-
-       bool aware;                     /* The player is "aware" of the item's effects */
-
-       bool tried;                     /* The player has "tried" one of the items */
-#endif /* SCRIPT_OBJ_KIND */
 };
 
 
@@ -579,19 +594,13 @@ struct monster_type
        s16b hp;                /* Current Hit points */
        s16b maxhp;             /* Max Hit points */
        s16b max_maxhp;         /* Max Max Hit points */
+       u32b dealt_damage;              /* Sum of damages dealt by player */
 
-       s16b csleep;            /* Inactive counter */
+       s16b mtimed[MAX_MTIMED];        /* Timed status counter */
 
        byte mspeed;            /* Monster "speed" */
        s16b energy_need;       /* Monster "energy" */
 
-       byte fast;              /* Monster is stunned */
-       byte slow;              /* Monster is stunned */
-       byte stunned;           /* Monster is stunned */
-       byte confused;          /* Monster is confused */
-       byte monfear;           /* Monster is afraid */
-       byte invulner;          /* Monster is temporarily invulnerable */
-
        byte cdis;              /* Current dis from player */
 
        byte mflag;             /* Extra monster flags */
@@ -608,23 +617,9 @@ struct monster_type
 
        u32b exp;
 
-#ifdef WDT_TRACK_OPTIONS
-
-       byte ty;                        /* Y location of target */
-       byte tx;                        /* X location of target */
-
-       byte t_dur;                     /* How long are we tracking */
-
-       byte t_bit;                     /* Up to eight bit flags */
-
-#endif /* WDT_TRACK_OPTIONS */
-
-#ifdef DRS_SMART_OPTIONS
-
        u32b smart;                     /* Field for "smart_learn" */
 
-#endif /* DRS_SMART_OPTIONS */
-
+       s16b parent_m_idx;
 };
 
 
@@ -713,6 +708,7 @@ struct quest_type
        byte dungeon;           /* quest dungeon */
 
        byte complev;           /* player level (complete) */
+       u32b comptime;          /* quest clear time*/
 };
 
 
@@ -986,9 +982,10 @@ struct player_type
 
        s32b au;                        /* Current Gold */
 
+       s32b max_max_exp;       /* Max max experience (only to calculate score) */
        s32b max_exp;           /* Max experience */
        s32b exp;                       /* Cur experience */
-       u16b exp_frac;          /* Cur exp frac (times 2^16) */
+       u32b exp_frac;          /* Cur exp frac (times 2^16) */
 
        s16b lev;                       /* Level */
 
@@ -998,19 +995,17 @@ struct player_type
        s16b inside_quest;              /* Inside quest level */
        bool inside_battle;             /* Is character inside tougijou? */
 
-       s16b rewards[MAX_BACT]; /* Status of rewards in town */
-
        s32b wilderness_x;      /* Coordinates in the wilderness */
        s32b wilderness_y;
        bool wild_mode;
 
-       s16b mhp;                       /* Max hit pts */
-       s16b chp;                       /* Cur hit pts */
-       u16b chp_frac;          /* Cur hit frac (times 2^16) */
+       s32b mhp;                       /* Max hit pts */
+       s32b chp;                       /* Cur hit pts */
+       u32b chp_frac;          /* Cur hit frac (times 2^16) */
 
-       s16b msp;                       /* Max mana pts */
-       s16b csp;                       /* Cur mana pts */
-       u16b csp_frac;          /* Cur mana frac (times 2^16) */
+       s32b msp;                       /* Max mana pts */
+       s32b csp;                       /* Cur mana pts */
+       u32b csp_frac;          /* Cur mana frac (times 2^16) */
 
        s16b max_plv;           /* Max Player Level */
 
@@ -1061,7 +1056,7 @@ struct player_type
        s16b tim_regen;
        s16b kabenuke;
        s16b tim_stealth;
-       s16b tim_ffall;
+       s16b tim_levitation;
        s16b tim_sh_touki;
        s16b lightspeed;
        s16b tsubureru;
@@ -1074,7 +1069,7 @@ struct player_type
        s16b tim_sh_holy;
        s16b tim_eyeeye;
 
-        /* for mirror master */
+       /* for mirror master */
        s16b tim_reflect;       /* Timed -- Reflect */
        s16b multishadow;       /* Timed -- Multi-shadow */
        s16b dustrobe;          /* Timed -- Robe of dust */
@@ -1088,9 +1083,11 @@ struct player_type
        s16b vir_types[8];
 
        s16b word_recall;         /* Word of recall counter */
+       s16b alter_reality;       /* Alter reality counter */
        byte recall_dungeon;      /* Dungeon set to be recalled */
 
        s16b energy_need;         /* Energy needed for next move */
+       s16b enchant_energy_need;         /* Energy needed for next upkeep effect        */
 
        s16b food;                /* Current nutrition */
 
@@ -1117,8 +1114,11 @@ struct player_type
        s16b mane_dam[MAX_MANE];
        s16b mane_num;
 
+       s16b concent;      /* Sniper's concentration level */
+
        s16b player_hp[PY_MAX_LEVEL];
        char died_from[80];       /* What killed the player */
+       cptr last_message;        /* Last message on death or retirement */
        char history[4][60];      /* Textual "history" for the Player */
 
        u16b total_winner;        /* Total winner */
@@ -1146,6 +1146,12 @@ struct player_type
        s16b today_mon;           /* Wanted monster */
 
        bool dtrap;               /* Whether you are on trap-safe grids */
+       s16b floor_id;            /* Current floor location */ 
+
+       bool autopick_autoregister; /* auto register is in-use or not */
+
+       byte feeling;           /* Most recent dungeon feeling */
+       s32b feeling_turn;      /* The turn of the last dungeon feeling */
 
 
        /*** Temporary fields ***/
@@ -1154,10 +1160,10 @@ struct player_type
        bool leaving;                   /* True if player is leaving */
 
        byte exit_bldg;                 /* Goal obtained in arena? -KMW- */
-       byte leftbldg;                  /* did we just leave a special area? -KMW- */
 
        bool leaving_dungeon;   /* True if player is leaving the dungeon */
        bool teleport_town;
+       bool enter_dungeon;     /* Just enter the dungeon */
 
        s16b health_who;        /* Health bar trackee */
 
@@ -1258,13 +1264,27 @@ struct player_type
        u32b cursed;            /* Player is cursed */
 
        bool can_swim;          /* No damage falling */
-       bool ffall;             /* No damage falling */
+       bool levitation;                /* No damage falling */
        bool lite;              /* Permanent light */
        bool free_act;          /* Never paralyzed */
        bool see_inv;           /* Can see invisible */
        bool regenerate;        /* Regenerate hit pts */
        bool hold_life;         /* Resist life draining */
+
        bool telepathy;         /* Telepathy */
+       bool esp_animal;
+       bool esp_undead;
+       bool esp_demon;
+       bool esp_orc;
+       bool esp_troll;
+       bool esp_giant;
+       bool esp_dragon;
+       bool esp_human;
+       bool esp_evil;
+       bool esp_good;
+       bool esp_nonliving;
+       bool esp_unique;
+
        bool slow_digest;       /* Slower digestion */
        bool bless_blade;       /* Blessed blade */
        bool xtra_might;        /* Extra might bow */
@@ -1276,6 +1296,10 @@ struct player_type
        bool heavy_spell;
        bool warning;
        bool mighty_throw;
+       bool see_nocto;         /* Noctovision */
+
+       s16b to_dd[2]; /* Extra dice/sides */
+       s16b to_ds[2];
 
        s16b dis_to_h[2];       /* Known bonus to hit (wield) */
        s16b dis_to_h_b;        /* Known bonus to hit (bow) */
@@ -1320,7 +1344,7 @@ struct player_type
 
        byte tval_ammo;         /* Correct ammo tval */
 
-       s16b pspeed;            /* Current speed */
+       byte pspeed;            /* Current speed */
 };
 
 
@@ -1355,7 +1379,6 @@ struct birther
 
        char history[4][60];
 
-       byte quests;
        bool quick_ok;
 };
 
@@ -1443,14 +1466,14 @@ struct building_type
 typedef struct border_type border_type;
 struct border_type
 {
-       byte    north[MAX_WID];
-       byte    south[MAX_WID];
-       byte    east[MAX_HGT];
-       byte    west[MAX_HGT];
-       byte    north_west;
-       byte    north_east;
-       byte    south_west;
-       byte    south_east;
+       s16b north[MAX_WID];
+       s16b south[MAX_WID];
+       s16b east[MAX_HGT];
+       s16b west[MAX_HGT];
+       s16b north_west;
+       s16b north_east;
+       s16b south_west;
+       s16b south_east;
 };
 
 
@@ -1501,7 +1524,7 @@ typedef struct tag_type tag_type;
 struct tag_type
 {
        int     tag;
-       void    *pointer;
+       int     index;
 };
 
 typedef bool (*monster_hook_type)(int r_idx);
@@ -1555,6 +1578,15 @@ struct high_score
        char how[40];           /* Method of death (string) */
 };
 
+
+typedef struct
+{
+       s16b feat;    /* Feature tile */
+       byte percent; /* Chance of type */
+}
+feat_prob;
+
+
 /* A structure for the != dungeon types */
 typedef struct dungeon_info_type dungeon_info_type;
 struct dungeon_info_type {
@@ -1564,25 +1596,16 @@ struct dungeon_info_type {
        byte dy;
        byte dx;
 
-       byte floor1;            /* Floor tile 1 */
-       byte floor_percent1;    /* Chance of type 1 */
-       byte floor2;            /* Floor tile 2 */
-       byte floor_percent2;    /* Chance of type 2 */
-       byte floor3;            /* Floor tile 3 */
-       byte floor_percent3;    /* Chance of type 3 */
-       byte outer_wall;        /* Outer wall tile */
-       byte inner_wall;        /* Inner wall tile */
-       s16b stream1;           /* stream tile */
-       s16b stream2;           /* stream tile */
-       byte fill_type1;        /* Cave tile 1 */
-       byte fill_percent1;     /* Chance of type 1 */
-       byte fill_type2;        /* Cave tile 2 */
-       byte fill_percent2;     /* Chance of type 2 */
-       byte fill_type3;        /* Cave tile 3 */
-       byte fill_percent3;     /* Chance of type 3 */
-       s16b mindepth;          /* Minimal depth */
-       s16b maxdepth;          /* Maximal depth */
-       byte min_plev;          /* Minimal plev needed to enter -- it's an anti-cheating mesure */
+       feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */
+       feat_prob fill[DUNGEON_FEAT_PROB_NUM];  /* Cave wall probability */
+       s16b outer_wall;                        /* Outer wall tile */
+       s16b inner_wall;                        /* Inner wall tile */
+       s16b stream1;                           /* stream tile */
+       s16b stream2;                           /* stream tile */
+
+       s16b mindepth;         /* Minimal depth */
+       s16b maxdepth;         /* Maximal depth */
+       byte min_plev;         /* Minimal plev needed to enter -- it's an anti-cheating mesure */
        s16b pit;
        s16b nest;
        byte mode;              /* Mode of combinaison of the monster flags */
@@ -1601,6 +1624,7 @@ struct dungeon_info_type {
        u32b mflags7;
        u32b mflags8;
        u32b mflags9;
+       u32b mflagsr;
 
        char r_char[5];         /* Monster race allowed */
        int final_object;       /* The object you'll find at the bottom */
@@ -1626,3 +1650,88 @@ typedef struct {
        byte bonus;         /* Items which have more than 'bonus' magical bonus match */
 } autopick_type;
 
+
+/*
+ *  A structure type for the saved floor
+ */
+typedef struct 
+{
+       s16b floor_id;        /* No recycle until 65536 IDs are all used */
+       byte savefile_id;     /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
+       s16b dun_level;
+       s32b last_visit;      /* Time count of last visit. 0 for new floor. */
+       u32b visit_mark;      /* Older has always smaller mark. */
+       s16b upper_floor_id;  /* a floor connected with level teleportation */
+       s16b lower_floor_id;  /* a floor connected with level tel. and trap door */
+} saved_floor_type;
+
+
+/*
+ *  A structure type for terrain template of saving dungeon floor
+ */
+typedef struct
+{
+       u16b info;
+       s16b feat;
+       s16b mimic;
+       s16b special;
+       u16b occurrence;
+} cave_template_type;
+
+
+/*
+ * A structure type for arena entry
+ */
+typedef struct
+{
+       s16b r_idx; /* Monster (0 means victory prizing) */
+       byte tval;  /* tval of prize (0 means no prize) */
+       byte sval;  /* sval of prize */
+} arena_type;
+
+
+/*
+ * A structure type for doors
+ */
+typedef struct
+{
+       s16b open;
+       s16b broken;
+       s16b closed;
+       s16b locked[MAX_LJ_DOORS];
+       s16b num_locked;
+       s16b jammed[MAX_LJ_DOORS];
+       s16b num_jammed;
+} door_type;
+
+
+#ifdef TRAVEL
+/*
+ *  A structure type for travel command
+ */
+typedef struct {
+       int run; /* Remaining grid number */
+       int cost[MAX_HGT][MAX_WID];
+       int x; /* Target X */
+       int y; /* Target Y */
+       int dir; /* Running direction */
+} travel_type;
+#endif
+
+typedef struct {
+       cptr flag;
+       byte index;
+       byte level;
+       s32b value;
+       struct {
+               int constant;
+               int dice;
+       } timeout;
+       cptr desc;
+} activation_type;
+
+typedef struct {
+       int flag;
+       int type;
+       cptr name;
+} dragonbreath_type;