OSDN Git Service

[Refactor] #40514 player_type の resist_cold 変数を廃止. / Abolished the resist_cold variab...
authordeskull <deskull@users.sourceforge.jp>
Sun, 10 Jan 2021 16:27:33 +0000 (01:27 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 10 Jan 2021 16:27:33 +0000 (01:27 +0900)
src/core/hp-mp-processor.c
src/effect/effect-player-resist-hurt.c
src/monster/monster-update.c
src/mspell/element-resistance-checker.c
src/object-use/read-execution.c
src/player-info/resistance-info.c
src/player/player-damage.c
src/player/player-status-resist.c
src/player/player-status.c
src/player/player-status.h
src/specific-object/death-scythe.c

index 137e46f..361f6bd 100644 (file)
@@ -147,7 +147,7 @@ void process_player_hp_mp(player_type *creature_ptr)
         }
 
         if (damage) {
-            if (creature_ptr->resist_cold)
+            if (has_resist_cold(creature_ptr))
                 damage = damage / 3;
             if (is_oppose_cold(creature_ptr))
                 damage = damage / 3;
@@ -313,7 +313,7 @@ void process_player_hp_mp(player_type *creature_ptr)
         }
         if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !has_immune_cold(creature_ptr)) {
             damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
-            if (creature_ptr->resist_cold)
+            if (has_resist_cold(creature_ptr))
                 damage = damage / 3;
             if (is_oppose_cold(creature_ptr))
                 damage = damage / 3;
index 5e8b387..41dc2cc 100644 (file)
@@ -567,7 +567,7 @@ void effect_player_icee(player_type *target_ptr, effect_player_type *ep_ptr)
         (void)set_stun(target_ptr, target_ptr->stun + randint1(15));
     }
 
-    if ((!(target_ptr->resist_cold || is_oppose_cold(target_ptr))) || one_in_(12)) {
+    if ((!(has_resist_cold(target_ptr) || is_oppose_cold(target_ptr))) || one_in_(12)) {
         if (!has_immune_cold(target_ptr))
             inventory_damage(target_ptr, set_cold_destroy, 3);
     }
index 894502e..04cd139 100644 (file)
@@ -572,7 +572,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_COLD:
-        if (player_ptr->resist_cold)
+        if (has_resist_cold(player_ptr))
             m_ptr->smart |= SM_RES_COLD;
 
         if (is_oppose_cold(player_ptr))
index 902f96b..e01547a 100644 (file)
@@ -36,7 +36,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr)
     if (has_immune_fire(target_ptr))
         msr_ptr->smart |= SM_IMM_FIRE;
 
-    if (target_ptr->resist_cold)
+    if (has_resist_cold(target_ptr))
         msr_ptr->smart |= SM_RES_COLD;
 
     if (is_oppose_cold(target_ptr))
index a9c9417..1bf2348 100644 (file)
@@ -421,7 +421,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
         }
         case SV_SCROLL_ICE: {
             fire_ball(creature_ptr, GF_ICE, 0, 777, 4);
-            if (!(is_oppose_cold(creature_ptr) || creature_ptr->resist_cold || has_immune_cold(creature_ptr)))
+            if (!(is_oppose_cold(creature_ptr) || has_resist_cold(creature_ptr) || has_immune_cold(creature_ptr)))
                 take_hit(creature_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("氷の巻物", "a Scroll of Ice"), -1);
 
             ident = TRUE;
index 143b1d9..79ae3a5 100644 (file)
@@ -39,9 +39,9 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* self
 
     if (has_immune_cold(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは冷気に対する完全なる免疫を持っている。", "You are completely immune to cold.");
-    } else if (creature_ptr->resist_cold && is_oppose_cold(creature_ptr)) {
+    } else if (has_resist_cold(creature_ptr) && is_oppose_cold(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは冷気への強力な耐性を持っている。", "You resist cold exceptionally well.");
-    } else if (creature_ptr->resist_cold || is_oppose_cold(creature_ptr)) {
+    } else if (has_resist_cold(creature_ptr) || is_oppose_cold(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは冷気への耐性を持っている。", "You are resistant to cold.");
     }
 
index 39efcef..6bd05fe 100644 (file)
@@ -248,12 +248,12 @@ HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int
 
     dam = dam * calc_cold_damage_rate(creature_ptr) / 100;
     if (aura || !check_multishadow(creature_ptr)) {
-        if ((!(double_resist || creature_ptr->resist_cold)) && one_in_(HURT_CHANCE))
+        if ((!(double_resist || has_resist_cold(creature_ptr))) && one_in_(HURT_CHANCE))
             (void)do_dec_stat(creature_ptr, A_STR);
     }
 
     HIT_POINT get_damage = take_hit(creature_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
-    if (!aura && !(double_resist && creature_ptr->resist_cold))
+    if (!aura && !(double_resist && has_resist_cold(creature_ptr)))
         inventory_damage(creature_ptr, set_cold_destroy, inv);
 
     return get_damage;
index e073e39..a20c047 100644 (file)
@@ -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;
index 5a93095..a6f28e1 100644 (file)
@@ -394,7 +394,6 @@ void calc_bonuses(player_type *creature_ptr)
     has_curses(creature_ptr);
     creature_ptr->impact = has_impact(creature_ptr);
     has_extra_blow(creature_ptr);
-    creature_ptr->resist_cold = has_resist_cold(creature_ptr);
     creature_ptr->resist_pois = has_resist_pois(creature_ptr);
     creature_ptr->resist_conf = has_resist_conf(creature_ptr);
     creature_ptr->resist_sound = has_resist_sound(creature_ptr);
index 6a337db..4a4bb66 100644 (file)
@@ -366,7 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS resist_cold; /* Resist cold */
     BIT_FLAGS resist_pois; /* Resist poison */
 
     BIT_FLAGS resist_conf; /* Resist confusion */
index 524e54f..5be4dc9 100644 (file)
@@ -96,7 +96,7 @@ static void compensate_death_scythe_reflection_magnification(player_type *attack
     if (!(has_resist_fire(attacker_ptr) || is_oppose_fire(attacker_ptr) || has_immune_fire(attacker_ptr)) && (*magnification < 25))
         *magnification = 25;
 
-    if (!(attacker_ptr->resist_cold || is_oppose_cold(attacker_ptr) || has_immune_cold(attacker_ptr)) && (*magnification < 25))
+    if (!(has_resist_cold(attacker_ptr) || is_oppose_cold(attacker_ptr) || has_immune_cold(attacker_ptr)) && (*magnification < 25))
         *magnification = 25;
 
     if (!(attacker_ptr->resist_pois || is_oppose_pois(attacker_ptr)) && (*magnification < 25))