OSDN Git Service

[Refactor] #40514 player_type の resist_fire 変数を廃止. / Abolished the resist_fire variab...
authordeskull <deskull@users.sourceforge.jp>
Sun, 10 Jan 2021 16:01:09 +0000 (01:01 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 10 Jan 2021 16:21:45 +0000 (01:21 +0900)
12 files changed:
src/cmd-action/cmd-travel.c
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 d419067..79a1b8a 100644 (file)
@@ -31,7 +31,7 @@ static int travel_flow_cost(player_type *creature_ptr, POSITION y, POSITION x)
 
     if (has_flag(f_ptr->flags, FF_LAVA)) {
         int lava = 2;
-        if (!creature_ptr->resist_fire)
+        if (!has_resist_fire(creature_ptr))
             lava *= 2;
 
         if (!creature_ptr->levitation)
index c8154ff..f1675ee 100644 (file)
@@ -110,7 +110,7 @@ void process_player_hp_mp(player_type *creature_ptr)
         if (damage) {
             if (is_specific_player_race(creature_ptr, RACE_ENT))
                 damage += damage / 3;
-            if (creature_ptr->resist_fire)
+            if (has_resist_fire(creature_ptr))
                 damage = damage / 3;
             if (is_oppose_fire(creature_ptr))
                 damage = damage / 3;
@@ -293,7 +293,7 @@ void process_player_hp_mp(player_type *creature_ptr)
             damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
             if (is_specific_player_race(creature_ptr, RACE_ENT))
                 damage += damage / 3;
-            if (creature_ptr->resist_fire)
+            if (has_resist_fire(creature_ptr))
                 damage = damage / 3;
             if (is_oppose_fire(creature_ptr))
                 damage = damage / 3;
index 334b951..5e8b387 100644 (file)
@@ -139,7 +139,7 @@ void effect_player_plasma(player_type *target_ptr, effect_player_type *ep_ptr)
         (void)set_stun(target_ptr, target_ptr->stun + plus_stun);
     }
 
-    if (!(target_ptr->resist_fire || is_oppose_fire(target_ptr) || has_immune_fire(target_ptr)))
+    if (!(has_resist_fire(target_ptr) || is_oppose_fire(target_ptr) || has_immune_fire(target_ptr)))
         inventory_damage(target_ptr, set_acid_destroy, 3);
 }
 
index 4da0716..4ba1b55 100644 (file)
@@ -561,7 +561,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_FIRE:
-        if (player_ptr->resist_fire)
+        if (has_resist_fire(player_ptr))
             m_ptr->smart |= SM_RES_FIRE;
 
         if (is_oppose_fire(player_ptr))
index 69627f1..fc67e3d 100644 (file)
@@ -27,7 +27,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr)
     if (has_immune_elec(target_ptr))
         msr_ptr->smart |= SM_IMM_ELEC;
 
-    if (target_ptr->resist_fire)
+    if (has_resist_fire(target_ptr))
         msr_ptr->smart |= SM_RES_FIRE;
 
     if (is_oppose_fire(target_ptr))
index ef93be3..a9c9417 100644 (file)
@@ -413,7 +413,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
         }
         case SV_SCROLL_FIRE: {
             fire_ball(creature_ptr, GF_FIRE, 0, 666, 4);
-            if (!(is_oppose_fire(creature_ptr) || creature_ptr->resist_fire || has_immune_fire(creature_ptr)))
+            if (!(is_oppose_fire(creature_ptr) || has_resist_fire(creature_ptr) || has_immune_fire(creature_ptr)))
                 take_hit(creature_ptr, DAMAGE_NOESCAPE, 50 + randint1(50), _("炎の巻物", "a Scroll of Fire"), -1);
 
             ident = TRUE;
index 5d03308..5ddbc0e 100644 (file)
@@ -27,9 +27,9 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* self
 
     if (has_immune_fire(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは火に対する完全なる免疫を持っている。", "You are completely immune to fire.");
-    } else if (creature_ptr->resist_fire && is_oppose_fire(creature_ptr)) {
+    } else if (has_resist_fire(creature_ptr) &&is_oppose_fire(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは火への強力な耐性を持っている。", "You resist fire exceptionally well.");
-    } else if (creature_ptr->resist_fire || is_oppose_fire(creature_ptr)) {
+    } else if (has_resist_fire(creature_ptr) || is_oppose_fire(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
     }
 
index 112f699..d201cfc 100644 (file)
@@ -216,12 +216,12 @@ HIT_POINT fire_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int
 
     dam = dam * calc_fire_damage_rate(creature_ptr) / 100;
     if (aura || !check_multishadow(creature_ptr)) {
-        if ((!(double_resist || creature_ptr->resist_fire)) && one_in_(HURT_CHANCE))
+        if ((!(double_resist || has_resist_fire(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_fire))
+    if (!aura && !(double_resist && has_resist_fire(creature_ptr)))
         inventory_damage(creature_ptr, set_fire_destroy, inv);
 
     return get_damage;
index dadbf15..93a3bc7 100644 (file)
@@ -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;
index 4e863f3..5c496ab 100644 (file)
@@ -396,7 +396,6 @@ void calc_bonuses(player_type *creature_ptr)
     has_extra_blow(creature_ptr);
     creature_ptr->resist_acid = has_resist_acid(creature_ptr);
     creature_ptr->resist_elec = has_resist_elec(creature_ptr);
-    creature_ptr->resist_fire = has_resist_fire(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);
index 4de7bd2..b008e7c 100644 (file)
@@ -368,7 +368,6 @@ typedef struct player_type {
 
     BIT_FLAGS resist_acid; /* Resist acid */
     BIT_FLAGS resist_elec; /* Resist lightning */
-    BIT_FLAGS resist_fire; /* Resist fire */
     BIT_FLAGS resist_cold; /* Resist cold */
     BIT_FLAGS resist_pois; /* Resist poison */
 
index e7ece76..ac9b414 100644 (file)
@@ -93,7 +93,7 @@ static void compensate_death_scythe_reflection_magnification(player_type *attack
     if (!(attacker_ptr->resist_elec || is_oppose_elec(attacker_ptr) || has_immune_elec(attacker_ptr)) && (*magnification < 25))
         *magnification = 25;
 
-    if (!(attacker_ptr->resist_fire || is_oppose_fire(attacker_ptr) || has_immune_fire(attacker_ptr)) && (*magnification < 25))
+    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))