OSDN Git Service

[Refactor] #40514 player_type の resist_lite 変数を廃止. / Abolished the resist_lite variab...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 01:43:34 +0000 (10:43 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 01:44:11 +0000 (10:44 +0900)
src/core/hp-mp-processor.c
src/effect/effect-player-resist-hurt.c
src/monster/monster-update.c
src/mspell/high-resistance-checker.c
src/player-info/resistance-info.c
src/player/player-status-resist.c
src/player/player-status.c
src/player/player-status.h
src/realm/realm-nature.c
src/spell-kind/spells-floor.c

index 7be0ab4..bdc37e2 100644 (file)
@@ -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));
index 5b54a40..ac96b1c 100644 (file)
@@ -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);
     }
 
index 37be3f4..fb31030 100644 (file)
@@ -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;
index b6e362f..e6b7fbf 100644 (file)
@@ -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)
index f3836b6..ef159d8 100644 (file)
@@ -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)
index 18bff55..1c986fb 100644 (file)
@@ -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);
     }
index 5e784ef..b1aea2a 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_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);
index 1c46350..941e99b 100644 (file)
@@ -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 */
index eee8b5d..26ad0b2 100644 (file)
@@ -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);
                 }
index c904b3a..7c3e9ac 100644 (file)
@@ -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));
         }