OSDN Git Service

[Refactor] #40514 player_type の resist_fear 変数を廃止. / Abolished resist_fear variable...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:54:29 +0000 (13:54 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:54:29 +0000 (13:54 +0900)
src/cmd-item/cmd-eat.c
src/inventory/inventory-curse.c
src/monster-attack/monster-attack-status.c
src/monster/monster-update.c
src/mspell/high-resistance-checker.c
src/mspell/mspell-status.c
src/mutation/mutation-processor.c
src/player-info/body-improvement-info.c
src/player/eldritch-horror.c
src/player/player-status.c
src/player/player-status.h

index 91e3bdf..0dd7654 100644 (file)
@@ -94,7 +94,7 @@ void exe_eat_food(player_type *creature_ptr, INVENTORY_IDX item)
         }
 
         case SV_FOOD_PARANOIA: {
-            if (!creature_ptr->resist_fear) {
+            if (!has_resist_fear(creature_ptr)) {
                 if (set_afraid(creature_ptr, creature_ptr->afraid + randint0(10) + 10)) {
                     ident = TRUE;
                 }
index d267936..53bbf34 100644 (file)
@@ -19,6 +19,7 @@
 #include "perception/object-perception.h"
 #include "player/player-damage.h"
 #include "player/player-race-types.h"
+#include "player/player-status-flags.h"
 #include "spell-kind/spells-random.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/summon-types.h"
@@ -288,7 +289,7 @@ static void curse_cowardice(player_type *creature_ptr)
     if (((creature_ptr->cursed & TRC_COWARDICE) == 0) || !one_in_(1500))
         return;
 
-    if (creature_ptr->resist_fear)
+    if (has_resist_fear(creature_ptr))
         return;
 
     disturb(creature_ptr, FALSE, TRUE);
index e93a82a..6786a1b 100644 (file)
@@ -35,7 +35,7 @@ void process_terrify_attack(player_type *target_ptr, monap_type *monap_ptr)
         return;
 
     monster_race *r_ptr = &r_info[monap_ptr->m_ptr->r_idx];
-    if (target_ptr->resist_fear) {
+    if (has_resist_fear(target_ptr)) {
         msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
         monap_ptr->obvious = TRUE;
         return;
index 7ea2843..b6345ac 100644 (file)
@@ -606,7 +606,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_FEAR:
-        if (player_ptr->resist_fear)
+        if (has_resist_fear(player_ptr))
             m_ptr->smart |= SM_RES_FEAR;
 
         break;
index 76542c5..6fb7bea 100644 (file)
@@ -18,7 +18,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr)
     if (has_resist_dark(target_ptr))
         msr_ptr->smart |= SM_RES_DARK;
 
-    if (target_ptr->resist_fear)
+    if (has_resist_fear(target_ptr))
         msr_ptr->smart |= SM_RES_FEAR;
 
     if (has_resist_conf(target_ptr))
index 2e6e54a..9c36245 100644 (file)
@@ -211,7 +211,7 @@ void spell_RF5_SCARE(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_fear != 0);
+        resist = (has_resist_fear(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, and you hear scary noises."),
             _("%^sが恐ろしげな幻覚を作り出した。", "%^s casts a fearful illusion."), _("しかし恐怖に侵されなかった。", "You refuse to be frightened."),
index 934761f..857da6e 100644 (file)
@@ -120,7 +120,7 @@ void process_world_aux_mutation(player_type *creature_ptr)
     }
 
     if ((creature_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13)) {
-        if (!creature_ptr->resist_fear) {
+        if (!has_resist_fear(creature_ptr)) {
             disturb(creature_ptr, FALSE, TRUE);
             msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
             set_afraid(creature_ptr, creature_ptr->afraid + 13 + randint1(26));
index d665eb9..d22227b 100644 (file)
@@ -110,7 +110,7 @@ void set_body_improvement_info_3(player_type *creature_ptr, self_info_type *self
 /* todo 並び順の都合で連番を付ける。まとめても良いならまとめてしまう予定 */
 void set_body_improvement_info_4(player_type *creature_ptr, self_info_type *self_ptr)
 {
-    if (creature_ptr->resist_fear)
+    if (has_resist_fear(creature_ptr))
         self_ptr->info[self_ptr->line++] = _("あなたは全く恐怖を感じない。", "You are completely fearless.");
     
     if (has_resist_blind(creature_ptr))
index e517b67..6d497fa 100644 (file)
@@ -235,7 +235,7 @@ void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro)
         break;
     }
     case 2: {
-        if (!(creature_ptr->muta2 & MUT2_COWARDICE) && !creature_ptr->resist_fear) {
+        if (!(creature_ptr->muta2 & MUT2_COWARDICE) && !has_resist_fear(creature_ptr)) {
             msg_print(_("あなたはパラノイアになった!", "You become paranoid!"));
             if (creature_ptr->muta3 & MUT3_FEARLESS) {
                 msg_print(_("あなたはもう恐れ知らずではなくなった。", "You are no longer fearless."));
index 93f63b9..f130308 100644 (file)
@@ -395,8 +395,6 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->impact = has_impact(creature_ptr);
     has_extra_blow(creature_ptr);
     creature_ptr->resist_time = has_resist_time(creature_ptr);
-    creature_ptr->resist_fear = has_resist_fear(creature_ptr);
-    creature_ptr->resist_time = has_resist_time(creature_ptr);
     creature_ptr->resist_water = has_resist_water(creature_ptr);
 
     creature_ptr->lite = has_lite(creature_ptr);
index 95f5ded..6f47ed7 100644 (file)
@@ -366,7 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS resist_fear; /* Resist fear */
     BIT_FLAGS resist_time; /* Resist time */
     BIT_FLAGS resist_water; /* Resist water */