OSDN Git Service

[Refactor] #939 Removed HIT_RELIABILITY alias
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Sun, 1 Aug 2021 06:26:36 +0000 (15:26 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Sat, 7 Aug 2021 02:28:34 +0000 (11:28 +0900)
src/combat/attack-accuracy.cpp
src/combat/attack-accuracy.h
src/market/building-craft-weapon.cpp
src/system/h-type.h

index b58c5db..13af627 100644 (file)
@@ -25,7 +25,7 @@
  * @return 命中と判定された場合TRUEを返す
  * @note Always miss 5%, always hit 5%, otherwise random.
  */
-bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible)
+bool test_hit_norm(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac, bool visible)
 {
     if (!visible)
         chance = (chance + 1) / 2;
@@ -39,7 +39,7 @@ bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLA
  * @param ac 敵AC
  * @return 命中確率
  */
-PERCENTAGE hit_chance(player_type *attacker_ptr, HIT_RELIABILITY reli, ARMOUR_CLASS ac)
+PERCENTAGE hit_chance(player_type *attacker_ptr, int reli, ARMOUR_CLASS ac)
 {
     PERCENTAGE chance = 5, chance_left = 90;
     if (reli <= 0)
index 14aca0d..75533fd 100644 (file)
@@ -4,8 +4,8 @@
 
 typedef struct player_attack_type player_attack_type;
 typedef struct player_type player_type;
-bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible);
-PERCENTAGE hit_chance(player_type *attacker_ptr, HIT_RELIABILITY chance, ARMOUR_CLASS ac);
+bool test_hit_norm(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac, bool visible);
+PERCENTAGE hit_chance(player_type *attacker_ptr, int chance, ARMOUR_CLASS ac);
 bool check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH level, int stun);
 bool check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun);
 bool process_attack_hit(player_type *attacker_ptr, player_attack_type *pa_ptr, int chance);
index 3f23c34..3766540 100644 (file)
@@ -314,7 +314,7 @@ static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN ro
 
     DICE_NUMBER eff_dd = o_ptr->dd + player_ptr->to_dd[0];
     DICE_SID eff_ds = o_ptr->ds + player_ptr->to_ds[0];
-    HIT_RELIABILITY reli = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ;
+    auto hit_reliability = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ;
 
     describe_flavor(player_ptr, o_name, o_ptr, OD_NAME_ONLY);
     c_put_str(TERM_YELLOW, o_name, row, col);
@@ -323,8 +323,8 @@ static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN ro
 
     sprintf(tmp_str, _("命中率:  0  50 100 150 200 (敵のAC)", "To Hit:  0  50 100 150 200 (AC)"));
     put_str(tmp_str, row + 2, col);
-    sprintf(tmp_str, "        %2d  %2d  %2d  %2d  %2d (%%)", (int)hit_chance(player_ptr, reli, 0), (int)hit_chance(player_ptr, reli, 50),
-        (int)hit_chance(player_ptr, reli, 100), (int)hit_chance(player_ptr, reli, 150), (int)hit_chance(player_ptr, reli, 200));
+    sprintf(tmp_str, "        %2d  %2d  %2d  %2d  %2d (%%)", (int)hit_chance(player_ptr, hit_reliability, 0), (int)hit_chance(player_ptr, hit_reliability, 50),
+        (int)hit_chance(player_ptr, hit_reliability, 100), (int)hit_chance(player_ptr, hit_reliability, 150), (int)hit_chance(player_ptr, hit_reliability, 200));
     put_str(tmp_str, row + 3, col);
     c_put_str(TERM_YELLOW, _("可能なダメージ:", "Possible Damage:"), row + 5, col);
 
index 727d00c..2b17a54 100644 (file)
@@ -140,7 +140,6 @@ typedef s32b HIT_POINT;
 typedef s32b MANA_POINT; /*!< ゲーム中のMP型を定義 */
 
 typedef s16b HIT_PROB; /*!< ゲーム中の装備命中修正値を定義 */
-typedef int HIT_RELIABILITY; /*!< 最終算出命中力を定義 */
 typedef s16b BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */
 
 typedef s32b MONSTER_NUMBER; /*!< ゲーム中のモンスター数型を定義 */