From 6ef5dd154bb29e054179494563ed5ffe0d4710c6 Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 11 Jan 2021 13:22:03 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20player=5Ftype=20=E3=81=AE?= =?utf8?q?=20resist=5Fdisen=20=E5=A4=89=E6=95=B0=E3=82=92=E5=BB=83?= =?utf8?q?=E6=AD=A2.=20/=20Abolished=20the=20resist=5Fdisen=20variable=20i?= =?utf8?q?n=20player=5Ftype.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/effect/effect-player-resist-hurt.c | 2 +- src/monster-attack/monster-attack-switcher.c | 2 +- src/monster/monster-update.c | 2 +- src/mspell/high-resistance-checker.c | 2 +- src/player-info/resistance-info.c | 2 +- src/player/player-status-resist.c | 4 ++-- src/player/player-status.c | 1 - src/player/player-status.h | 1 - 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/effect/effect-player-resist-hurt.c b/src/effect/effect-player-resist-hurt.c index 08aa3ea30..5c8a8de50 100644 --- a/src/effect/effect-player-resist-hurt.c +++ b/src/effect/effect-player-resist-hurt.c @@ -279,7 +279,7 @@ void effect_player_disenchant(player_type *target_ptr, effect_player_type *ep_pt ep_ptr->dam = ep_ptr->dam * calc_disenchant_damage_rate(target_ptr, CALC_RAND) / 100; - if (!target_ptr->resist_disen && !check_multishadow(target_ptr)) { + if (!has_resist_disen(target_ptr) && !check_multishadow(target_ptr)) { (void)apply_disenchant(target_ptr, 0); } diff --git a/src/monster-attack/monster-attack-switcher.c b/src/monster-attack/monster-attack-switcher.c index b597baf00..8bba812d2 100644 --- a/src/monster-attack/monster-attack-switcher.c +++ b/src/monster-attack/monster-attack-switcher.c @@ -58,7 +58,7 @@ static void calc_blow_disenchant(player_type *target_ptr, monap_type *monap_ptr) if (monap_ptr->explode) return; - if (!target_ptr->resist_disen && !check_multishadow(target_ptr) && apply_disenchant(target_ptr, 0)) { + if (!has_resist_disen(target_ptr) && !check_multishadow(target_ptr) && apply_disenchant(target_ptr, 0)) { update_creature(target_ptr); monap_ptr->obvious = TRUE; } diff --git a/src/monster/monster-update.c b/src/monster/monster-update.c index dfc1bba40..bc81d5695 100644 --- a/src/monster/monster-update.c +++ b/src/monster/monster-update.c @@ -621,7 +621,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) break; case DRS_DISEN: - if (player_ptr->resist_disen) + if (has_resist_disen(player_ptr)) m_ptr->smart |= SM_RES_DISEN; break; diff --git a/src/mspell/high-resistance-checker.c b/src/mspell/high-resistance-checker.c index 1ea9696e8..4b8d1f7d5 100644 --- a/src/mspell/high-resistance-checker.c +++ b/src/mspell/high-resistance-checker.c @@ -27,7 +27,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr) if (has_resist_chaos(target_ptr)) msr_ptr->smart |= SM_RES_CHAOS; - if (target_ptr->resist_disen) + if (has_resist_disen(target_ptr)) msr_ptr->smart |= SM_RES_DISEN; if (target_ptr->resist_blind) diff --git a/src/player-info/resistance-info.c b/src/player-info/resistance-info.c index a6593a605..2023df100 100644 --- a/src/player-info/resistance-info.c +++ b/src/player-info/resistance-info.c @@ -72,7 +72,7 @@ void set_high_resistance_info(player_type *creature_ptr, self_info_type *self_pt if (has_resist_sound(creature_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks."); - if (creature_ptr->resist_disen) + if (has_resist_disen(creature_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは劣化への耐性を持っている。", "You are resistant to disenchantment."); if (has_resist_chaos(creature_ptr)) diff --git a/src/player/player-status-resist.c b/src/player/player-status-resist.c index 9028a2467..47f5f5b3a 100644 --- a/src/player/player-status-resist.c +++ b/src/player/player-status-resist.c @@ -332,7 +332,7 @@ PERCENTAGE calc_disenchant_damage_rate(player_type *creature_ptr, rate_calc_type { PERCENTAGE per = 100; - if (creature_ptr->resist_disen) { + if (has_resist_disen(creature_ptr)) { per *= 600; per /= randrate(4, 7, mode); } @@ -347,7 +347,7 @@ PERCENTAGE calc_nexus_damage_rate(player_type *creature_ptr, rate_calc_type_mode { PERCENTAGE per = 100; - if (creature_ptr->resist_disen) { + if (has_resist_disen(creature_ptr)) { per *= 600; per /= randrate(4, 7, mode); } diff --git a/src/player/player-status.c b/src/player/player-status.c index 0c65700a0..1092eebef 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -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_disen = has_resist_disen(creature_ptr); creature_ptr->resist_shard = has_resist_shard(creature_ptr); creature_ptr->resist_nexus = has_resist_nexus(creature_ptr); creature_ptr->resist_blind = has_resist_blind(creature_ptr); diff --git a/src/player/player-status.h b/src/player/player-status.h index bdde76144..541c06bb9 100644 --- a/src/player/player-status.h +++ b/src/player/player-status.h @@ -366,7 +366,6 @@ typedef struct player_type { bool is_fired; bool level_up_message; - BIT_FLAGS resist_disen; /* Resist disenchant */ BIT_FLAGS resist_shard; /* Resist shards */ BIT_FLAGS resist_nexus; /* Resist nexus */ BIT_FLAGS resist_blind; /* Resist blindness */ -- 2.11.0