OSDN Git Service

[Refactor] #40514 player_type の sustain_int 変数を廃止. / Abolished sustain_int variable...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:22:30 +0000 (14:22 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:22:30 +0000 (14:22 +0900)
src/mutation/mutation-processor.c
src/player-info/base-status-info.c
src/player/player-status.c
src/player/player-status.h
src/status/bad-status-setter.c
src/status/base-status.c

index 5c583a9..dbc0405 100644 (file)
@@ -324,7 +324,7 @@ void process_world_aux_mutation(player_type *creature_ptr)
                 sustained = TRUE;
             break;
         case A_INT:
-            if (creature_ptr->sustain_int)
+            if (has_sustain_int(creature_ptr))
                 sustained = TRUE;
             break;
         case A_WIS:
index de0502e..7e8710f 100644 (file)
@@ -61,7 +61,7 @@ void set_status_sustain_info(player_type *creature_ptr, self_info_type *self_ptr
     if (has_sustain_str(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたの腕力は維持されている。", "Your strength is sustained.");
     }
-    if (creature_ptr->sustain_int) {
+    if (has_sustain_int(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたの知能は維持されている。", "Your intelligence is sustained.");
     }
     if (creature_ptr->sustain_wis) {
index 393d5ec..be7c2f8 100644 (file)
@@ -377,7 +377,6 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->hold_exp = has_hold_exp(creature_ptr);
     creature_ptr->see_inv = has_see_inv(creature_ptr);
     creature_ptr->free_act = has_free_act(creature_ptr);
-    creature_ptr->sustain_int = has_sustain_int(creature_ptr);
     creature_ptr->sustain_wis = has_sustain_wis(creature_ptr);
     creature_ptr->sustain_dex = has_sustain_dex(creature_ptr);
     creature_ptr->sustain_con = has_sustain_con(creature_ptr);
index 3b6a19c..b04c6bc 100644 (file)
@@ -369,7 +369,6 @@ typedef struct player_type {
     BIT_FLAGS anti_magic; /* Anti-magic */
     BIT_FLAGS anti_tele; /* Prevent teleportation */
 
-    BIT_FLAGS sustain_int; /* Keep intelligence */
     BIT_FLAGS sustain_wis; /* Keep wisdom */
     BIT_FLAGS sustain_dex; /* Keep dexterity */
     BIT_FLAGS sustain_con; /* Keep constitution */
index f94b08a..4081e4e 100644 (file)
@@ -9,6 +9,7 @@
 #include "player/attack-defense-types.h"
 #include "player-info/avatar.h"
 #include "player/player-race.h"
+#include "player/player-status-flags.h"
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
 #include "status/base-status.h"
@@ -419,12 +420,12 @@ bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
             msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
 
             if (one_in_(3)) {
-                if (!creature_ptr->sustain_int)
+                if (!has_sustain_int(creature_ptr))
                     (void)do_dec_stat(creature_ptr, A_INT);
                 if (!creature_ptr->sustain_wis)
                     (void)do_dec_stat(creature_ptr, A_WIS);
             } else if (one_in_(2)) {
-                if (!creature_ptr->sustain_int)
+                if (!has_sustain_int(creature_ptr))
                     (void)do_dec_stat(creature_ptr, A_INT);
             } else {
                 if (!creature_ptr->sustain_wis)
index ae6f1fb..c91e33e 100644 (file)
@@ -183,7 +183,7 @@ bool do_dec_stat(player_type *creature_ptr, int stat)
             sust = TRUE;
         break;
     case A_INT:
-        if (creature_ptr->sustain_int)
+        if (has_sustain_int(creature_ptr))
             sust = TRUE;
         break;
     case A_WIS: