OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement. (shoot.c, snipe.c)
authordeskull <deskull@users.sourceforge.jp>
Wed, 6 Mar 2019 16:36:16 +0000 (01:36 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 6 Mar 2019 16:36:16 +0000 (01:36 +0900)
src/externs.h
src/shoot.c
src/snipe.c

index c17aa6a..68185bf 100644 (file)
@@ -1370,7 +1370,7 @@ 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 MULTIPLY tot_dam_aux_snipe (MULTIPLY 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);
index 1edb19c..0139e93 100644 (file)
@@ -6,6 +6,7 @@
 #include "player-status.h"
 
 #include "shoot.h"
+
 /*!
  * @brief 矢弾を射撃した際のスレイ倍率をかけた結果を返す /
  * Determines the odds of an object breaking when thrown at a monster
@@ -14,9 +15,9 @@
  * @param m_ptr 目標モンスターの構造体参照ポインタ
  * @return スレイ倍率をかけたダメージ量
  */
-static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
+static MULTIPLY tot_dam_aux_shot(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr)
 {
-       int mult = 10;
+       MULTIPLY mult = 10;
 
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
index 26dbfec..623263e 100644 (file)
@@ -391,7 +391,7 @@ static int get_snipe_power(COMMAND_CODE *sn, bool only_browse)
  * @param m_ptr 目標となるモンスターの構造体参照ポインタ
  * @return スレイの倍率(/10倍)
  */
-int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
+MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr)
 {
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
        bool seen = is_seen(m_ptr);
@@ -401,7 +401,7 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
        case SP_LITE:
                if (r_ptr->flags3 & (RF3_HURT_LITE))
                {
-                       int n = 20 + p_ptr->concent;
+                       MULTIPLY n = 20 + p_ptr->concent;
                        if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
                        if (mult < n) mult = n;
                }
@@ -413,7 +413,7 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
                }
                else
                {
-                       int n = 15 + (p_ptr->concent * 3);
+                       MULTIPLY n = 15 + (p_ptr->concent * 3);
                        if (mult < n) mult = n;
                }
                break;
@@ -424,7 +424,7 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
                }
                else
                {
-                       int n = 15 + (p_ptr->concent * 3);
+                       MULTIPLY n = 15 + (p_ptr->concent * 3);
                        if (mult < n) mult = n;
                }
                break;
@@ -435,20 +435,20 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
                }
                else
                {
-                       int n = 18 + (p_ptr->concent * 4);
+                       MULTIPLY n = 18 + (p_ptr->concent * 4);
                        if (mult < n) mult = n;
                }
                break;
        case SP_KILL_WALL:
                if (r_ptr->flags3 & RF3_HURT_ROCK)
                {
-                       int n = 15 + (p_ptr->concent * 2);
+                       MULTIPLY n = 15 + (p_ptr->concent * 2);
                        if (seen) r_ptr->r_flags3 |= RF3_HURT_ROCK;
                        if (mult < n) mult = n;
                }
                else if (r_ptr->flags3 & RF3_NONLIVING)
                {
-                       int n = 15 + (p_ptr->concent * 2);
+                       MULTIPLY n = 15 + (p_ptr->concent * 2);
                        if (seen) r_ptr->r_flags3 |= RF3_NONLIVING;
                        if (mult < n) mult = n;
                }
@@ -456,7 +456,7 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
        case SP_EVILNESS:
                if (r_ptr->flags3 & RF3_GOOD)
                {
-                       int n = 15 + (p_ptr->concent * 4);
+                       MULTIPLY n = 15 + (p_ptr->concent * 4);
                        if (seen) r_ptr->r_flags3 |= RF3_GOOD;
                        if (mult < n) mult = n;
                }
@@ -464,7 +464,7 @@ int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
        case SP_HOLYNESS:
                if (r_ptr->flags3 & RF3_EVIL)
                {
-                       int n = 12 + (p_ptr->concent * 3);
+                       MULTIPLY n = 12 + (p_ptr->concent * 3);
                        if (seen) r_ptr->r_flags3 |= RF3_EVIL;
                        if (r_ptr->flags3 & (RF3_HURT_LITE))
                        {