OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / cmd2.c
index ed99c21..465386f 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "angband.h"
 #include "chest.h"
-
+#include "object-hook.h"
 
 /*!
  * @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
@@ -2375,9 +2375,9 @@ void do_cmd_rest(void)
  * @details
  * Note that artifacts never break, see the "drop_near()" function.
  */
-static int breakage_chance(object_type *o_ptr)
+static PERCENTAGE breakage_chance(object_type *o_ptr)
 {
-       int archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (p_ptr->lev-1)/7 + 4: 0);
+       PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev-1)/7 + 4: 0);
 
        /* Examine the snipe type */
        if (snipe_type)
@@ -2837,10 +2837,11 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
 void do_cmd_fire_aux(int item, object_type *j_ptr)
 {
        int dir;
-       int i, j, y, x, ny, nx, ty, tx, prev_y, prev_x;
+       int i, y, x, ny, nx, ty, tx, prev_y, prev_x;
        int tdam_base, tdis, thits, tmul;
        int bonus, chance;
        int cur_dis, visible;
+       PERCENTAGE j;
 
        object_type forge;
        object_type *q_ptr;
@@ -3478,19 +3479,6 @@ void do_cmd_fire(void)
        }
 }
 
-/*!
- * @brief オブジェクトが投射可能な武器かどうかを返す。
- * @param o_ptr 判定するオブジェクトの構造体参照ポインタ
- * @return 投射可能な武器ならばTRUE
- */
-static bool item_tester_hook_boomerang(object_type *o_ptr)
-{
-       if ((o_ptr->tval==TV_DIGGING) || (o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM) || (o_ptr->tval == TV_HAFTED)) return (TRUE);
-
-       /* Assume not */
-       return (FALSE);
-}
-
 
 /*!
  * @brief 投射処理メインルーチン /
@@ -3512,11 +3500,12 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
 {
        DIRECTION dir;
        OBJECT_IDX item;
-       int i, j, y, x, ty, tx, prev_y, prev_x;
+       int i, y, x, ty, tx, prev_y, prev_x;
        int ny[19], nx[19];
        int chance, tdam, tdis;
        int mul, div, dd, ds;
        int cur_dis, visible;
+       PERCENTAGE j;
 
        object_type forge;
        object_type *q_ptr;