OSDN Git Service

[Refactor] #40514 player_type の reflect 変数を廃止. / Abolished reflect variable in player...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:04:04 +0000 (14:04 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:04:04 +0000 (14:04 +0900)
src/effect/effect-player.c
src/monster/monster-update.c
src/mspell/high-resistance-checker.c
src/player-info/body-improvement-info.c
src/player/player-status.c
src/player/player-status.h

index 4064d09..2286592 100644 (file)
@@ -18,6 +18,7 @@
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "player/special-defense-types.h"
+#include "player/player-status-flags.h"
 #include "realm/realm-hex-numbers.h"
 #include "spell-realm/spells-crusade.h"
 #include "spell-realm/spells-hex.h"
@@ -187,7 +188,7 @@ static effect_player_type *initialize_effect_player(
  */
 static bool process_bolt_reflection(player_type *target_ptr, effect_player_type *ep_ptr, project_func project)
 {
-    bool can_bolt_hit = target_ptr->reflect || (((target_ptr->special_defense & KATA_FUUJIN) != 0) && !target_ptr->blind);
+    bool can_bolt_hit = has_reflect(target_ptr) || (((target_ptr->special_defense & KATA_FUUJIN) != 0) && !target_ptr->blind);
     can_bolt_hit &= (ep_ptr->flag & PROJECT_REFLECTABLE) != 0;
     can_bolt_hit &= !one_in_(10);
     if (!can_bolt_hit)
index b6345ac..cceba92 100644 (file)
@@ -656,7 +656,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_REFLECT:
-        if (player_ptr->reflect)
+        if (has_reflect(player_ptr))
             m_ptr->smart |= SM_IMM_REFLECT;
 
         break;
index 6fb7bea..75313dc 100644 (file)
@@ -42,7 +42,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr)
     if (has_resist_shard(target_ptr))
         msr_ptr->smart |= SM_RES_SHARD;
 
-    if (target_ptr->reflect)
+    if (has_reflect(target_ptr))
         msr_ptr->smart |= SM_IMM_REFLECT;
 
     if (target_ptr->free_act)
index 0adb185..428dbfb 100644 (file)
@@ -64,7 +64,7 @@ void set_body_improvement_info_3(player_type *creature_ptr, self_info_type *self
     if (creature_ptr->hold_exp)
         self_ptr->info[self_ptr->line++] = _("あなたは自己の経験値をしっかりと維持する。", "You have a firm hold on your experience.");
 
-    if (creature_ptr->reflect)
+    if (has_reflect(creature_ptr))
         self_ptr->info[self_ptr->line++] = _("あなたは矢の呪文を反射する。", "You reflect bolt spells.");
 
     if (creature_ptr->sh_fire)
index ed0dafd..1141c6a 100644 (file)
@@ -368,7 +368,6 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->yoiyami = has_no_ac(creature_ptr);
     creature_ptr->mighty_throw = has_mighty_throw(creature_ptr);
     creature_ptr->dec_mana = has_dec_mana(creature_ptr);
-    creature_ptr->reflect = has_reflect(creature_ptr);
     creature_ptr->see_nocto = has_see_nocto(creature_ptr);
     creature_ptr->warning = has_warning(creature_ptr);
     creature_ptr->anti_magic = has_anti_magic(creature_ptr);
index 50f4c05..dd372fd 100644 (file)
@@ -366,7 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS reflect; /* Reflect 'bolt' attacks */
     BIT_FLAGS sh_fire; /* Fiery 'immolation' effect */
     BIT_FLAGS sh_elec; /* Electric 'immolation' effect */
     BIT_FLAGS sh_cold; /* Cold 'immolation' effect */