OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Fri, 13 Oct 2017 12:18:34 +0000 (21:18 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 13 Oct 2017 12:18:34 +0000 (21:18 +0900)
src/externs.h
src/init1.c
src/load.c
src/monster2.c
src/object1.c
src/racial.c
src/types.h

index 3682c20..cd7b977 100644 (file)
@@ -982,13 +982,13 @@ extern void lore_treasure(MONSTER_IDX m_idx, int num_item, int num_gold);
 extern void sanity_blast(monster_type *m_ptr, bool necro);
 extern void update_mon(MONSTER_IDX m_idx, bool full);
 extern void update_monsters(bool full);
-extern bool place_monster_aux(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
+extern bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
 extern bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode);
 extern bool alloc_horde(POSITION y, POSITION x);
 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, MONRACE_IDX r_idx, u32b mode);
+extern bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
+extern bool summon_named_creature (MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
 extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, u32b mode);
 extern void update_smart_learn(MONSTER_IDX m_idx, int what);
 extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
index 4996e97..4d66693 100644 (file)
@@ -2505,12 +2505,12 @@ errr parse_a_info(char *buf, header *head)
                if (6 != sscanf(buf+2, "%d:%dd%d:%d:%d:%d",
                                &ac, &hd1, &hd2, &th, &td, &ta)) return (1);
 
-               a_ptr->ac = ac;
-               a_ptr->dd = hd1;
-               a_ptr->ds = hd2;
-               a_ptr->to_h = th;
-               a_ptr->to_d = td;
-               a_ptr->to_a =  ta;
+               a_ptr->ac = (ARMOUR_CLASS)ac;
+               a_ptr->dd = (DICE_NUMBER)hd1;
+               a_ptr->ds = (DICE_SID)hd2;
+               a_ptr->to_h = (HIT_PROB)th;
+               a_ptr->to_d = (HIT_POINT)td;
+               a_ptr->to_a = (ARMOUR_CLASS)ta;
        }
 
        /* Hack -- Process 'U' for activation index */
index 106ee4a..85cac20 100644 (file)
@@ -816,6 +816,7 @@ static void rd_monster_old(monster_type *m_ptr)
 {
        byte tmp8u;
        s16b tmp16s;
+       u32b tmp32u;
        char buf[128];
 
        /* Read the monster race */
@@ -925,7 +926,8 @@ static void rd_monster_old(monster_type *m_ptr)
        if (z_older_than(10, 4, 5))
                m_ptr->exp = 0;
        else
-               rd_u32b(&m_ptr->exp);
+               rd_u32b(&tmp32u);
+               m_ptr->exp = tmp32u;
 
        if (z_older_than(10, 2, 2))
        {
@@ -971,6 +973,7 @@ static void rd_monster(monster_type *m_ptr)
        char buf[128];
        byte tmp8u;
        s16b tmp16s;
+       u32b tmp32u;
 
        if (h_older_than(1, 5, 0, 0))
        {
@@ -1076,7 +1079,11 @@ static void rd_monster(monster_type *m_ptr)
        if (flags & SAVE_MON_SMART) rd_u32b(&m_ptr->smart);
        else m_ptr->smart = 0;
 
-       if (flags & SAVE_MON_EXP) rd_u32b(&m_ptr->exp);
+       if (flags & SAVE_MON_EXP)
+       {
+               rd_u32b(&tmp32u);
+               m_ptr->exp = (EXP)tmp32u;
+       }
        else m_ptr->exp = 0;
 
        m_ptr->mflag = 0; /* Not saved */
@@ -1641,6 +1648,7 @@ static void rd_ghost(void)
 static void load_quick_start(void)
 {
        byte tmp8u;
+       s16b tmp16s;
        int i;
 
        if (z_older_than(11, 0, 13))
@@ -1667,7 +1675,11 @@ static void load_quick_start(void)
        for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max[i]);
        for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max_max[i]);
 
-       for (i = 0; i < PY_MAX_LEVEL; i++) rd_s16b(&previous_char.player_hp[i]);
+       for (i = 0; i < PY_MAX_LEVEL; i++)
+       {
+               rd_s16b(&tmp16s);
+               previous_char.player_hp[i] = (HIT_POINT)tmp16s;
+       }
 
        rd_s16b(&previous_char.chaos_patron);
 
@@ -1852,8 +1864,10 @@ static void rd_extra(void)
        {
                for (i = 0; i < MAX_MANE; i++)
                {
-                       rd_s16b(&p_ptr->mane_spell[i]);
-                       rd_s16b(&p_ptr->mane_dam[i]);
+                       rd_s16b(&tmp16s);
+                       p_ptr->mane_spell[i] = (SPELL_IDX)tmp16s;
+                       rd_s16b(&tmp16s);
+                       p_ptr->mane_dam[i] = (SPELL_IDX)tmp16s;
                }
                rd_s16b(&p_ptr->mane_num);
        }
index 63eaa8f..36b038c 100644 (file)
@@ -3678,7 +3678,7 @@ static bool place_monster_can_escort(MONRACE_IDX r_idx)
  * Note the use of the new "monster allocation table" code to restrict
  * the "get_mon_num()" function to "legal" escort types.
  */
-bool place_monster_aux(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        int             i, j, n;
        monster_race    *r_ptr = &r_info[r_idx];
@@ -4048,7 +4048,7 @@ static bool summon_specific_okay(MONRACE_IDX r_idx)
  *
  * Note that this function may not succeed, though this is very rare.
  */
-bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode)
+bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
 {
        POSITION x, y;
        MONRACE_IDX r_idx;
@@ -4102,7 +4102,7 @@ bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode)
  * @param mode 生成オプション 
  * @return 召喚できたらtrueを返す
  */
-bool summon_named_creature (int who, int oy, int ox, MONRACE_IDX r_idx, u32b mode)
+bool summon_named_creature (MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        int x, y;
 
index 4ce6022..4d38b1d 100644 (file)
@@ -1981,7 +1981,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, int mode)
  * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
  * and "x" is the "current" command_cmd code.\n
  */
-static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
+static bool get_tag_floor(COMMAND_CODE *cp, char tag, int floor_list[], int floor_num)
 {
        int i;
        cptr s;
index c92af19..7ce3b7e 100644 (file)
@@ -1714,9 +1714,10 @@ static bool cmd_racial_power_aux(s32b command)
 void do_cmd_racial_power(void)
 {
        power_desc_type power_desc[36];
-       int             num, i = 0;
-       int             ask = TRUE;
-       int             lvl = p_ptr->lev;
+       int num;
+       COMMAND_CODE i = 0;
+       int ask = TRUE;
+       PLAYER_LEVEL lvl = p_ptr->lev;
        bool            flag, redraw, cast = FALSE;
        bool            warrior = ((p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER) ? TRUE : FALSE);
        char            choice;
index 31d15ea..a23fe70 100644 (file)
@@ -607,18 +607,18 @@ struct monster_type
 
        bool ml;                /* Monster is "visible" */
 
-       IDX hold_o_idx; /* Object being held (if any) */
+       OBJECT_IDX hold_o_idx;  /* Object being held (if any) */
 
        POSITION target_y;              /* Can attack !los player */
        POSITION target_x;              /* Can attack !los player */
 
-       u16b nickname;          /* Monster's Nickname */
+       STR_OFFSET nickname;            /* Monster's Nickname */
 
-       u32b exp;
+       EXP exp;
 
-       u32b smart;                     /* Field for "smart_learn" */
+       BIT_FLAGS smart;                        /* Field for "smart_learn" */
 
-       s16b parent_m_idx;
+       MONSTER_IDX parent_m_idx;
 };