OSDN Git Service

[Refactor] #40514 player_type の resist_blind 変数を廃止. / Abolished resist_blind variable...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:44:55 +0000 (13:44 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:44:55 +0000 (13:44 +0900)
17 files changed:
src/cmd-item/cmd-eat.c
src/cmd-item/cmd-usestaff.c
src/effect/effect-player-resist-hurt.c
src/effect/effect-player-spirit.c
src/grid/trap.c
src/monster-attack/monster-attack-status.c
src/monster/monster-update.c
src/mspell/high-resistance-checker.c
src/mspell/mspell-floor.c
src/mspell/mspell-status.c
src/object-use/quaff-execution.c
src/object-use/read-execution.c
src/player-info/body-improvement-info.c
src/player/player-move.c
src/player/player-status.c
src/player/player-status.h
src/spell-kind/spells-floor.c

index 701dd75..91e3bdf 100644 (file)
@@ -85,7 +85,7 @@ void exe_eat_food(player_type *creature_ptr, INVENTORY_IDX item)
         }
 
         case SV_FOOD_BLINDNESS: {
-            if (!creature_ptr->resist_blind) {
+            if (!has_resist_blind(creature_ptr)) {
                 if (set_blind(creature_ptr, creature_ptr->blind + randint0(200) + 200)) {
                     ident = TRUE;
                 }
index 4a2728f..3ec10d8 100644 (file)
@@ -70,7 +70,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
     /* Analyze the staff */
     switch (sval) {
     case SV_STAFF_DARKNESS: {
-        if (!(creature_ptr->resist_blind) && !has_resist_dark(creature_ptr)) {
+        if (!has_resist_blind(creature_ptr) && !has_resist_dark(creature_ptr)) {
             if (set_blind(creature_ptr, creature_ptr->blind + 3 + randint1(5)))
                 ident = TRUE;
         }
index d65a0f9..21e020a 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 && !has_resist_lite(target_ptr) && !target_ptr->resist_blind && !check_multishadow(target_ptr)) {
+    if (!target_ptr->blind && !has_resist_lite(target_ptr) && !has_resist_blind(target_ptr) && !check_multishadow(target_ptr)) {
         (void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2);
     }
 
@@ -377,7 +377,7 @@ void effect_player_dark(player_type *target_ptr, effect_player_type *ep_ptr)
 
     ep_ptr->dam = ep_ptr->dam * calc_dark_damage_rate(target_ptr, CALC_RAND) / 100;
 
-    if (!target_ptr->blind && !has_resist_dark(target_ptr) && !target_ptr->resist_blind && !check_multishadow(target_ptr)) {
+    if (!target_ptr->blind && !has_resist_dark(target_ptr) && !has_resist_blind(target_ptr) && !check_multishadow(target_ptr)) {
         (void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2);
     }
 
index bfc75c5..b47e42f 100644 (file)
@@ -116,7 +116,7 @@ void effect_player_brain_smash(player_type *target_ptr, effect_player_type *ep_p
     if (check_multishadow(target_ptr))
         return;
 
-    if (!target_ptr->resist_blind) {
+    if (!has_resist_blind(target_ptr)) {
         (void)set_blind(target_ptr, target_ptr->blind + 8 + randint0(8));
     }
 
index 7e66a6d..2931e74 100644 (file)
@@ -512,7 +512,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
     }
 
     case TRAP_BLIND: {
-        hit_trap_set_abnormal_status_p(trapped_ptr, _("黒いガスに包み込まれた!", "A black gas surrounds you!"), (bool)trapped_ptr->resist_blind, set_blind,
+        hit_trap_set_abnormal_status_p(trapped_ptr, _("黒いガスに包み込まれた!", "A black gas surrounds you!"), (bool)has_resist_blind(trapped_ptr), set_blind,
             trapped_ptr->blind + (TIME_EFFECT)randint0(50) + 25);
         break;
     }
index f0f9a69..e93a82a 100644 (file)
@@ -17,7 +17,7 @@
 
 void process_blind_attack(player_type *target_ptr, monap_type *monap_ptr)
 {
-    if (target_ptr->resist_blind || check_multishadow(target_ptr))
+    if (has_resist_blind(target_ptr) || check_multishadow(target_ptr))
         return;
 
     if (!set_blind(target_ptr, target_ptr->blind + 10 + randint1(monap_ptr->rlev)))
index 2f9b86b..ef16e49 100644 (file)
@@ -626,7 +626,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_BLIND:
-        if (player_ptr->resist_blind)
+        if (has_resist_blind(player_ptr))
             m_ptr->smart |= SM_RES_BLIND;
 
         break;
index 9354831..710b671 100644 (file)
@@ -30,7 +30,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr)
     if (has_resist_disen(target_ptr))
         msr_ptr->smart |= SM_RES_DISEN;
 
-    if (target_ptr->resist_blind)
+    if (has_resist_blind(target_ptr))
         msr_ptr->smart |= SM_RES_BLIND;
 
     if (has_resist_nexus(target_ptr))
index bb288ca..9dd1893 100644 (file)
@@ -25,6 +25,7 @@
 #include "mspell/mspell-type.h"
 #include "mspell/mspell-util.h"
 #include "player/player-personalities-types.h"
+#include "player/player-status-flags.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
 #include "spell-kind/spells-sight.h"
index db57a57..2e6e54a 100644 (file)
@@ -256,7 +256,7 @@ void spell_RF5_BLIND(MONSTER_IDX m_idx, player_type *target_ptr, MONSTER_IDX t_i
     bool resist, saving_throw;
 
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
-        resist = (target_ptr->resist_blind != 0);
+        resist = (has_resist_blind(target_ptr) != 0);
         saving_throw = (randint0(100 + rlev / 2) < target_ptr->skill_sav);
         spell_badstatus_message(target_ptr, m_idx, t_idx, _("%^sが何かをつぶやいた。", "%^s mumbles."),
             _("%^sが呪文を唱えてあなたの目をくらました!", "%^s casts a spell, burning your eyes!"), _("しかし効果がなかった!", "You are unaffected!"),
index cfc3865..a9cc2d1 100644 (file)
@@ -191,7 +191,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
             break;
 
         case SV_POTION_BLINDNESS:
-            if (!creature_ptr->resist_blind) {
+            if (!has_resist_blind(creature_ptr)) {
                 if (set_blind(creature_ptr, creature_ptr->blind + randint0(100) + 100)) {
                     ident = TRUE;
                 }
index 3d826ab..7686fdc 100644 (file)
@@ -101,7 +101,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
     if (o_ptr->tval == TV_SCROLL) {
         switch (o_ptr->sval) {
         case SV_SCROLL_DARKNESS: {
-            if (!(creature_ptr->resist_blind) && !has_resist_dark(creature_ptr))
+            if (!has_resist_blind(creature_ptr) && !has_resist_dark(creature_ptr))
                 (void)set_blind(creature_ptr, creature_ptr->blind + 3 + randint1(5));
 
             if (unlite_area(creature_ptr, 10, 3))
index 9e70856..d665eb9 100644 (file)
@@ -1,5 +1,6 @@
 #include "player-info/body-improvement-info.h"
 #include "player-info/self-info-util.h"
+#include "player/player-status-flags.h"
 
 /* todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */
 void set_body_improvement_info_1(player_type *creature_ptr, self_info_type *self_ptr)
@@ -112,7 +113,7 @@ void set_body_improvement_info_4(player_type *creature_ptr, self_info_type *self
     if (creature_ptr->resist_fear)
         self_ptr->info[self_ptr->line++] = _("あなたは全く恐怖を感じない。", "You are completely fearless.");
     
-    if (creature_ptr->resist_blind)
+    if (has_resist_blind(creature_ptr))
         self_ptr->info[self_ptr->line++] = _("あなたの目は盲目への耐性を持っている。", "Your eyes are resistant to blindness.");
     
     if (creature_ptr->resist_time)
index e690899..655cf60 100644 (file)
@@ -286,7 +286,7 @@ bool trap_can_be_ignored(player_type *creature_ptr, FEAT_IDX feat)
             return TRUE;
         break;
     case TRAP_BLIND:
-        if (creature_ptr->resist_blind)
+        if (has_resist_blind(creature_ptr))
             return TRUE;
         break;
     case TRAP_CONFUSE:
index 7608bec..f98bb98 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_blind = has_resist_blind(creature_ptr);
     creature_ptr->resist_neth = has_resist_neth(creature_ptr);
     creature_ptr->resist_time = has_resist_time(creature_ptr);
     creature_ptr->resist_fear = has_resist_fear(creature_ptr);
index c1c1881..5cf51a2 100644 (file)
@@ -366,7 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS resist_blind; /* Resist blindness */
     BIT_FLAGS resist_neth; /* Resist nether */
     BIT_FLAGS resist_fear; /* Resist fear */
     BIT_FLAGS resist_time; /* Resist time */
index 7c3e9ac..573f108 100644 (file)
@@ -454,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 && !has_resist_lite(caster_ptr)) {
+        if (!has_resist_blind(caster_ptr) && !has_resist_lite(caster_ptr)) {
             /* Become blind */
             (void)set_blind(caster_ptr, caster_ptr->blind + 10 + randint1(10));
         }