OSDN Git Service

[Refactor] #37481 hit_chance()をmelee1.cに移動。 \ Move hit_change() to melee1.c.
authorDeskull <deskull@users.sourceforge.jp>
Sun, 23 Dec 2018 07:53:47 +0000 (16:53 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sun, 23 Dec 2018 07:53:47 +0000 (16:53 +0900)
src/bldg.c
src/externs.h
src/melee1.c

index 38821dd..7cc9c92 100644 (file)
@@ -2640,28 +2640,6 @@ static void compare_weapon_aux(object_type *o_ptr, int col, int r)
 }
 
 /*!
- * @brief モンスターへの命中率の計算
- * @param to_h 命中値
- * @param ac 敵AC
- * @return 命中確率
- */
-static PERCENTAGE hit_chance(HIT_PROB to_h, ARMOUR_CLASS ac)
-{
-       PERCENTAGE chance = 0;
-       int meichuu = p_ptr->skill_thn + (p_ptr->to_h[0] + to_h) * BTH_PLUS_ADJ;
-
-       if (meichuu <= 0) return 5;
-
-       chance = 100 - ((ac * 75) / meichuu);
-
-       if (chance > 95) chance = 95;
-       if (chance < 5) chance = 5;
-       if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
-               chance = (chance * 19 + 9) / 20;
-       return chance;
-}
-
-/*!
  * @brief 武器匠における武器一つ毎の完全情報を表示する。
  * @param o_ptr オブジェクトの構造体の参照ポインタ。
  * @param row 表示する列の左端
index 910be92..66583b2 100644 (file)
@@ -698,6 +698,8 @@ extern errr rd_savefile_new(void);
 extern bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode);
 
 /* melee1.c */
+PERCENTAGE hit_chance(HIT_PROB to_h, ARMOUR_CLASS ac);
+
 /* monster-process.c */
 extern bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name);
 extern HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode);
index 1406cac..30846f8 100644 (file)
@@ -53,6 +53,29 @@ bool test_hit_norm(int chance, ARMOUR_CLASS ac, int vis)
        return (TRUE);
 }
 
+/*!
+ * @brief モンスターへの命中率の計算
+ * @param to_h 命中値
+ * @param ac 敵AC
+ * @return 命中確率
+ */
+PERCENTAGE hit_chance(HIT_PROB to_h, ARMOUR_CLASS ac)
+{
+       PERCENTAGE chance = 0;
+       int meichuu = p_ptr->skill_thn + (p_ptr->to_h[0] + to_h) * BTH_PLUS_ADJ;
+
+       if (meichuu <= 0) return 5;
+
+       chance = 100 - ((ac * 75) / meichuu);
+
+       if (chance > 95) chance = 95;
+       if (chance < 5) chance = 5;
+       if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
+               chance = (chance * 19 + 9) / 20;
+       return chance;
+}
+
+
 
 /*!
 * @brief プレイヤーからモンスターへの打撃クリティカル判定 /