OSDN Git Service

#37287 #37353 (2.2.0.89) DICE_NUMBER,DICE_SID型を定義し、POSITIONをs32bに再定義、型の置換を継続中。 /...
authorDeskull <desull@users.sourceforge.jp>
Sat, 23 Sep 2017 23:19:39 +0000 (08:19 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sat, 23 Sep 2017 23:19:39 +0000 (08:19 +0900)
src/do-spell.c
src/externs.h
src/h-type.h
src/load.c
src/spells1.c
src/spells2.c
src/xtra2.c

index ef7345a..3df0761 100644 (file)
@@ -782,7 +782,7 @@ static void cast_meteor(int dam, int rad)
 
        for (i = 0; i < b; i++)
        {
-               int y = 0, x = 0;
+               POSITION y = 0, x = 0;
                int count;
 
                for (count = 0; count <= 20; count++)
@@ -8059,7 +8059,7 @@ static cptr do_hissatsu_spell(int spell, int mode)
     
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
                        if (p_ptr->riding)
                        {
@@ -8174,9 +8174,9 @@ static cptr do_hissatsu_spell(int spell, int mode)
                        if (cave[y][x].m_idx)
                        {
                                int i;
-                               int ty = y, tx = x;
-                               int oy = y, ox = x;
-                               int m_idx = cave[y][x].m_idx;
+                               POSITION ty = y, tx = x;
+                               POSITION oy = y, ox = x;
+                               IDX m_idx = cave[y][x].m_idx;
                                monster_type *m_ptr = &m_list[m_idx];
                                char m_name[80];
        
index 7b5becc..72bbfd3 100644 (file)
@@ -1096,7 +1096,7 @@ extern int take_hit(int damage_type, int damage, cptr kb_str, int monspell);
 extern u16b bolt_pict(int y, int x, int ny, int nx, int typ);
 extern sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg);
 extern int dist_to_line(int y, int x, int y1, int x1, int y2, int x2);
-extern bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell);
+extern bool project(int who, int rad, int y, int x, HIT_POINT dam, int typ, int flg, int monspell);
 extern int project_length;
 extern bool binding_field(int dam);
 extern void seal_of_mirror(int dam);
@@ -1508,7 +1508,7 @@ extern bool get_hack_dir(int *dp);
 extern bool get_rep_dir(int *dp, bool under);
 extern bool get_rep_dir2(int *dp);
 extern void gain_level_reward(int chosen_reward);
-extern bool tgt_pt (int *x, int *y);
+extern bool tgt_pt(int *x, int *y);
 extern void do_poly_wounds(void);
 extern void change_race(int new_race, cptr effect_msg);
 extern HIT_POINT mon_damage_mod(monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear);
index 1af2693..8aed951 100644 (file)
@@ -105,7 +105,7 @@ typedef unsigned long u32b;
 
 
 typedef s16b IDX;                      /*!< ゲーム中のID型を定義 */
-typedef byte POSITION;         /*!< ゲーム中の座標型を定義 */
+typedef s32b POSITION;         /*!< ゲーム中の座標型を定義 */
 typedef s16b HIT_POINT;                /*!< ゲーム中のHP/ダメージ型を定義 */
 typedef s16b HIT_PROB;         /*!< ゲーム中の命中修正値を定義 */
 typedef s16b BASE_STATUS;      /*!< ゲーム中の基礎能力値型を定義 */
@@ -125,6 +125,10 @@ typedef byte OBJECT_SUBTYPE_VALUE; /*!< ゲーム中のアイテム副分類の
 typedef s16b PARAMETER_VALUE;      /*!< ゲーム中のアイテム能力値の型定義 */
 typedef s16b WEIGHT;               /*!< ゲーム中の重量の型定義 */
 
+typedef int DICE_NUMBER; /*!< ゲーム中のダイス数の型定義 */
+typedef int DICE_SID;   /*!< ゲーム中のダイス面の型定義 */
+
+
 typedef u32b STR_OFFSET;      /*!< テキストオフセットの型定義 */
 
 /*** Pointers to all the basic types defined above ***/
index bd06158..feaa555 100644 (file)
@@ -338,14 +338,17 @@ static void strip_bytes(int n)
 static void rd_item_old(object_type *o_ptr)
 {
        char buf[128];
+       byte_hack tmp8u;
 
 
        /* Kind */
        rd_s16b(&o_ptr->k_idx);
 
        /* Location */
-       rd_byte(&o_ptr->iy);
-       rd_byte(&o_ptr->ix);
+       rd_byte(&tmp8u);
+       o_ptr->iy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->ix = (POSITION)tmp8u;
 
        /* Type/Subtype */
        rd_byte(&o_ptr->tval);
@@ -593,6 +596,7 @@ static void rd_item(object_type *o_ptr)
        object_kind *k_ptr;
        u32b flags;
        char buf[128];
+       byte_hack tmp8u;
 
        if (h_older_than(1, 5, 0, 0))
        {
@@ -608,8 +612,10 @@ static void rd_item(object_type *o_ptr)
        rd_s16b(&o_ptr->k_idx);
 
        /* Location */
-       rd_byte(&o_ptr->iy);
-       rd_byte(&o_ptr->ix);
+       rd_byte(&tmp8u);
+       o_ptr->iy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->ix = (POSITION)tmp8u;
 
        /* Type/Subtype */
        k_ptr = &k_info[o_ptr->k_idx];
@@ -795,8 +801,11 @@ static void rd_monster_old(monster_type *m_ptr)
                rd_byte(&m_ptr->sub_align);
 
        /* Read the other information */
-       rd_byte(&m_ptr->fy);
-       rd_byte(&m_ptr->fx);
+       rd_byte(&tmp8u);
+       m_ptr->fy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       m_ptr->fx = (POSITION)tmp8u;
+
        rd_s16b(&m_ptr->hp);
        rd_s16b(&m_ptr->maxhp);
        if (z_older_than(11, 0, 5))
@@ -935,8 +944,11 @@ static void rd_monster(monster_type *m_ptr)
        rd_s16b(&m_ptr->r_idx);
 
        /* Read the other information */
-       rd_byte(&m_ptr->fy);
-       rd_byte(&m_ptr->fx);
+       rd_byte(&tmp8u);
+       m_ptr->fy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       m_ptr->fx = (POSITION)tmp8u;
+
        rd_s16b(&m_ptr->hp);
        rd_s16b(&m_ptr->maxhp);
        rd_s16b(&m_ptr->max_maxhp);
index 00686e8..3fbfd5a 100644 (file)
@@ -6773,7 +6773,7 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte
  * and "update_view()" and "update_monsters()" need to be called.
  * </pre>
  */
-bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
+bool project(int who, int rad, int y, int x, HIT_POINT dam, int typ, int flg, int monspell)
 {
        int i, t, dist;
 
index 9af8b83..894087c 100644 (file)
@@ -3630,7 +3630,8 @@ bool earthquake_aux(int cy, int cx, int r, int m_idx)
 {
        int             i, t, y, x, yy, xx, dy, dx;
        int             damage = 0;
-       int             sn = 0, sy = 0, sx = 0;
+       int             sn = 0;
+       POSITION        sy = 0, sx = 0;
        bool            hurt = FALSE;
        cave_type       *c_ptr;
        bool            map[32][32];
index 4552a8d..325133a 100644 (file)
@@ -794,9 +794,9 @@ void monster_death(int m_idx, bool drop_item)
                {
                        int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
                        int typ = mbe_info[r_ptr->blow[i].effect].explode_type;
-                       int d_dice = r_ptr->blow[i].d_dice;
-                       int d_side = r_ptr->blow[i].d_side;
-                       int damage = damroll(d_dice, d_side);
+                       DICE_NUMBER d_dice = r_ptr->blow[i].d_dice;
+                       DICE_SID d_side = r_ptr->blow[i].d_side;
+                       HIT_POINT damage = damroll(d_dice, d_side);
 
                        project(m_idx, 3, y, x, damage, typ, flg, -1);
                        break;