From ce6225eb5a309be2dfbeabfa3e6876eb45a85e61 Mon Sep 17 00:00:00 2001 From: taotao54321 Date: Sat, 13 Feb 2021 17:29:17 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20=E5=AE=9F=E8=B3=AA=20bool=20?= =?utf8?q?=E5=9E=8B=E3=81=AE=E9=96=A2=E6=95=B0=E3=81=AE=E6=88=BB=E3=82=8A?= =?utf8?q?=E5=9E=8B=E3=81=8C=20int=20=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE?= =?utf8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/combat/attack-accuracy.c | 4 ++-- src/combat/attack-accuracy.h | 4 ++-- src/monster-attack/monster-attack-player.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/combat/attack-accuracy.c b/src/combat/attack-accuracy.c index 5bc4fdea3..2d0136c65 100644 --- a/src/combat/attack-accuracy.c +++ b/src/combat/attack-accuracy.c @@ -57,7 +57,7 @@ PERCENTAGE hit_chance(player_type *attacker_ptr, HIT_RELIABILITY reli, ARMOUR_CL * Always miss 5% of the time, Always hit 5% of the time. * Otherwise, match monster power against player armor. */ -int check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH level, int stun) +bool check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH level, int stun) { int k = randint0(100); if (stun && one_in_(2)) @@ -83,7 +83,7 @@ int check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH l * @param stun 攻撃側モンスターが朦朧状態ならTRUEを返す * @return 命中ならばTRUEを返す */ -int check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun) +bool check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun) { int k = randint0(100); if (stun && one_in_(2)) diff --git a/src/combat/attack-accuracy.h b/src/combat/attack-accuracy.h index cefc96d43..d7943fd28 100644 --- a/src/combat/attack-accuracy.h +++ b/src/combat/attack-accuracy.h @@ -5,6 +5,6 @@ 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); -int check_hit_from_monster_to_player(player_type *target_ptr, int power, DEPTH level, int stun); -int check_hit_from_monster_to_monster(int power, DEPTH level, ARMOUR_CLASS ac, int stun); +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); diff --git a/src/monster-attack/monster-attack-player.c b/src/monster-attack/monster-attack-player.c index 62ecb4191..bd5f9eeb1 100644 --- a/src/monster-attack/monster-attack-player.c +++ b/src/monster-attack/monster-attack-player.c @@ -418,7 +418,7 @@ static bool process_monster_blows(player_type *target_ptr, monap_type *monap_ptr hit = TRUE; } else { const int power = mbe_info[monap_ptr->effect].power; - hit = (bool)check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, monster_stunned_remaining(monap_ptr->m_ptr)); + hit = check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, monster_stunned_remaining(monap_ptr->m_ptr)); } if (hit) { -- 2.11.0