From: deskull Date: Mon, 11 Jan 2021 01:43:34 +0000 (+0900) Subject: [Refactor] #40514 player_type の resist_lite 変数を廃止. / Abolished the resist_lite variab... X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d9562cceb6e5a9f9359b4c37f86f4931902f7358;hp=36ec77a9c58186621804d676fc7369d4dd10cda7;p=hengband%2Fhengband.git [Refactor] #40514 player_type の resist_lite 変数を廃止. / Abolished the resist_lite variable in player_type. --- diff --git a/src/core/hp-mp-processor.c b/src/core/hp-mp-processor.c index 7be0ab435..bdc37e2ef 100644 --- a/src/core/hp-mp-processor.c +++ b/src/core/hp-mp-processor.c @@ -70,7 +70,7 @@ void process_player_hp_mp(player_type *creature_ptr) } if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE)) { - if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !is_invuln(creature_ptr) && is_daytime()) { + if (!creature_ptr->current_floor_ptr->dun_level && !has_resist_lite(creature_ptr) && !is_invuln(creature_ptr) && is_daytime()) { if ((creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!")); take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1); @@ -83,7 +83,7 @@ void process_player_hp_mp(player_type *creature_ptr) BIT_FLAGS flgs[TR_FLAG_SIZE]; object_flags(creature_ptr, o_ptr, flgs); - if (creature_ptr->inventory_list[INVEN_LITE].tval && !has_flag(flgs, TR_DARK_SOURCE) && !creature_ptr->resist_lite) { + if (creature_ptr->inventory_list[INVEN_LITE].tval && !has_flag(flgs, TR_DARK_SOURCE) && !has_resist_lite(creature_ptr)) { GAME_TEXT o_name[MAX_NLEN]; char ouch[MAX_NLEN + 40]; describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); diff --git a/src/effect/effect-player-resist-hurt.c b/src/effect/effect-player-resist-hurt.c index 5b54a404f..ac96b1c13 100644 --- a/src/effect/effect-player-resist-hurt.c +++ b/src/effect/effect-player-resist-hurt.c @@ -346,7 +346,7 @@ void effect_player_lite(player_type *target_ptr, effect_player_type *ep_ptr) { if (target_ptr->blind) msg_print(_("何かで攻撃された!", "You are hit by something!")); - if (!target_ptr->blind && !target_ptr->resist_lite && !target_ptr->resist_blind && !check_multishadow(target_ptr)) { + if (!target_ptr->blind && !has_resist_lite(target_ptr) && !target_ptr->resist_blind && !check_multishadow(target_ptr)) { (void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2); } diff --git a/src/monster/monster-update.c b/src/monster/monster-update.c index 37be3f400..fb31030be 100644 --- a/src/monster/monster-update.c +++ b/src/monster/monster-update.c @@ -596,7 +596,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) break; case DRS_LITE: - if (player_ptr->resist_lite) + if (has_resist_lite(player_ptr)) m_ptr->smart |= SM_RES_LITE; break; diff --git a/src/mspell/high-resistance-checker.c b/src/mspell/high-resistance-checker.c index b6e362f55..e6b7fbfcb 100644 --- a/src/mspell/high-resistance-checker.c +++ b/src/mspell/high-resistance-checker.c @@ -12,7 +12,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr) if (target_ptr->resist_neth) msr_ptr->smart |= SM_RES_NETH; - if (target_ptr->resist_lite) + if (has_resist_lite(target_ptr)) msr_ptr->smart |= SM_RES_LITE; if (target_ptr->resist_dark) diff --git a/src/player-info/resistance-info.c b/src/player-info/resistance-info.c index f3836b6ed..ef159d88f 100644 --- a/src/player-info/resistance-info.c +++ b/src/player-info/resistance-info.c @@ -54,7 +54,7 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* self void set_high_resistance_info(player_type *creature_ptr, self_info_type *self_ptr) { - if (creature_ptr->resist_lite) + if (has_resist_lite(creature_ptr)) self_ptr->info[self_ptr->line++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light."); if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || is_specific_player_race(creature_ptr, RACE_S_FAIRY) diff --git a/src/player/player-status-resist.c b/src/player/player-status-resist.c index 18bff5583..1c986fb9c 100644 --- a/src/player/player-status-resist.c +++ b/src/player/player-status-resist.c @@ -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); } diff --git a/src/player/player-status.c b/src/player/player-status.c index 5e784ef00..b1aea2aba 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_lite = has_resist_lite(creature_ptr); creature_ptr->resist_dark = has_resist_dark(creature_ptr); creature_ptr->resist_chaos = has_resist_chaos(creature_ptr); creature_ptr->resist_disen = has_resist_disen(creature_ptr); diff --git a/src/player/player-status.h b/src/player/player-status.h index 1c4635097..941e99b20 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_lite; /* Resist light */ BIT_FLAGS resist_dark; /* Resist darkness */ BIT_FLAGS resist_chaos; /* Resist chaos */ BIT_FLAGS resist_disen; /* Resist disenchant */ diff --git a/src/realm/realm-nature.c b/src/realm/realm-nature.c index eee8b5d97..26ad0b2e4 100644 --- a/src/realm/realm-nature.c +++ b/src/realm/realm-nature.c @@ -14,6 +14,7 @@ #include "player/player-damage.h" #include "player/player-race-types.h" #include "player/player-race.h" +#include "player/player-status-flags.h" #include "spell-kind/earthquake.h" #include "spell-kind/spells-beam.h" #include "spell-kind/spells-charm.h" @@ -157,7 +158,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mod if (cast) { lite_area(caster_ptr, damroll(dice, sides), rad); - if ((is_specific_player_race(caster_ptr, RACE_VAMPIRE) || (caster_ptr->mimic_form == MIMIC_VAMPIRE)) && !caster_ptr->resist_lite) { + if ((is_specific_player_race(caster_ptr, RACE_VAMPIRE) || (caster_ptr->mimic_form == MIMIC_VAMPIRE)) && !has_resist_lite(caster_ptr)) { msg_print(_("日の光があなたの肉体を焦がした!", "The daylight scorches your flesh!")); take_hit(caster_ptr, DAMAGE_NOESCAPE, damroll(2, 2), _("日の光", "daylight"), -1); } @@ -622,7 +623,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mod chg_virtue(caster_ptr, V_ENLIGHTEN, 1); wiz_lite(caster_ptr, FALSE); - if ((is_specific_player_race(caster_ptr, RACE_VAMPIRE) || (caster_ptr->mimic_form == MIMIC_VAMPIRE)) && !caster_ptr->resist_lite) { + if ((is_specific_player_race(caster_ptr, RACE_VAMPIRE) || (caster_ptr->mimic_form == MIMIC_VAMPIRE)) && !has_resist_lite(caster_ptr)) { msg_print(_("日光があなたの肉体を焦がした!", "The sunlight scorches your flesh!")); take_hit(caster_ptr, DAMAGE_NOESCAPE, 50, _("日光", "sunlight"), -1); } diff --git a/src/spell-kind/spells-floor.c b/src/spell-kind/spells-floor.c index c904b3a82..7c3e9acfc 100644 --- a/src/spell-kind/spells-floor.c +++ b/src/spell-kind/spells-floor.c @@ -41,6 +41,7 @@ #include "object/object-mark-types.h" #include "perception/object-perception.h" #include "player/special-defense-types.h" +#include "player/player-status-flags.h" #include "spell-kind/spells-teleport.h" #include "spell/spell-types.h" #include "status/bad-status-setter.h" @@ -453,7 +454,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r, msg_print(_("燃えるような閃光が発生した!", "There is a searing blast of light!")); /* Blind the player */ - if (!caster_ptr->resist_blind && !caster_ptr->resist_lite) { + if (!caster_ptr->resist_blind && !has_resist_lite(caster_ptr)) { /* Become blind */ (void)set_blind(caster_ptr, caster_ptr->blind + 10 + randint1(10)); }