OSDN Git Service

[Refactor] #40514 player_type の resist_lite 変数を廃止. / Abolished the resist_lite variab...
[hengband/hengband.git] / src / player / player-status-resist.c
index dadbf15..1c986fb 100644 (file)
@@ -79,7 +79,7 @@ PERCENTAGE calc_acid_damage_rate(player_type *creature_ptr)
         }
     }
 
-    if (creature_ptr->resist_acid)
+    if (has_resist_acid(creature_ptr))
         per = (per + 2) / 3;
     if (is_oppose_acid(creature_ptr))
         per = (per + 2) / 3;
@@ -109,7 +109,7 @@ PERCENTAGE calc_elec_damage_rate(player_type *creature_ptr)
         }
     }
 
-    if (creature_ptr->resist_elec)
+    if (has_resist_elec(creature_ptr))
         per = (per + 2) / 3;
     if (is_oppose_elec(creature_ptr))
         per = (per + 2) / 3;
@@ -135,7 +135,7 @@ PERCENTAGE calc_fire_damage_rate(player_type *creature_ptr)
     }
 
     /* Resist the damage */
-    if (creature_ptr->resist_fire)
+    if (has_resist_fire(creature_ptr))
         per = (per + 2) / 3;
     if (is_oppose_fire(creature_ptr))
         per = (per + 2) / 3;
@@ -160,7 +160,7 @@ PERCENTAGE calc_cold_damage_rate(player_type *creature_ptr)
         }
     }
 
-    if (creature_ptr->resist_cold)
+    if (has_resist_cold(creature_ptr))
         per = (per + 2) / 3;
     if (is_oppose_cold(creature_ptr))
         per = (per + 2) / 3;
@@ -174,7 +174,7 @@ PERCENTAGE calc_cold_damage_rate(player_type *creature_ptr)
 PERCENTAGE calc_pois_damage_rate(player_type *creature_ptr)
 {
     PERCENTAGE per = 100;
-    if (creature_ptr->resist_pois)
+    if (has_resist_pois(creature_ptr))
         per = (per + 2) / 3;
     if (is_oppose_pois(creature_ptr))
         per = (per + 2) / 3;
@@ -189,7 +189,7 @@ PERCENTAGE calc_nuke_damage_rate(player_type *creature_ptr)
 {
 
     PERCENTAGE per = 100;
-    if (creature_ptr->resist_pois)
+    if (has_resist_pois(creature_ptr))
         per = (2 * per + 2) / 5;
     if (is_oppose_pois(creature_ptr))
         per = (2 * per + 2) / 5;
@@ -235,7 +235,7 @@ PERCENTAGE calc_lite_damage_rate(player_type *creature_ptr, rate_calc_type_mode
         per = per * 4 / 3;
     }
 
-    if (creature_ptr->resist_lite) {
+    if (has_resist_lite(creature_ptr)) {
         per *= 400;
         per /= randrate(4, 7, mode);
     }
@@ -287,7 +287,7 @@ PERCENTAGE calc_sound_damage_rate(player_type *creature_ptr, rate_calc_type_mode
 {
     PERCENTAGE per = 100;
 
-    if (creature_ptr->resist_sound) {
+    if (has_resist_sound(creature_ptr)) {
         per *= 500;
         per /= randrate(4, 7, mode);
     }
@@ -302,7 +302,7 @@ PERCENTAGE calc_conf_damage_rate(player_type *creature_ptr, rate_calc_type_mode
 {
     PERCENTAGE per = 100;
 
-    if (creature_ptr->resist_conf) {
+    if (has_resist_conf(creature_ptr)) {
         per *= 500;
         per /= randrate(4, 7, mode);
     }