OSDN Git Service

[Refactor] #40514 player_type の sustain_str 変数を廃止. / Abolished sustain_str variable...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:18:25 +0000 (14:18 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:18:25 +0000 (14:18 +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/base-status.c

index 857da6e..5c583a9 100644 (file)
@@ -320,7 +320,7 @@ void process_world_aux_mutation(player_type *creature_ptr)
 
         switch (which_stat) {
         case A_STR:
-            if (creature_ptr->sustain_str)
+            if (has_sustain_str(creature_ptr))
                 sustained = TRUE;
             break;
         case A_INT:
index 080d183..de0502e 100644 (file)
@@ -1,6 +1,7 @@
 #include "player-info/base-status-info.h"
 #include "inventory/inventory-slot-types.h"
 #include "player-info/self-info-util.h"
+#include "player/player-status-flags.h"
 #include "object/object-flags.h"
 #include "object-enchant/tr-types.h"
 #include "util/bit-flags-calculator.h"
@@ -57,7 +58,7 @@ void set_equipment_influence(player_type *creature_ptr, self_info_type *self_ptr
 
 void set_status_sustain_info(player_type *creature_ptr, self_info_type *self_ptr)
 {
-    if (creature_ptr->sustain_str) {
+    if (has_sustain_str(creature_ptr)) {
         self_ptr->info[self_ptr->line++] = _("あなたの腕力は維持されている。", "Your strength is sustained.");
     }
     if (creature_ptr->sustain_int) {
index 3cc0ad9..393d5ec 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_str = has_sustain_str(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);
index ed1410e..3b6a19c 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_str; /* Keep strength */
     BIT_FLAGS sustain_int; /* Keep intelligence */
     BIT_FLAGS sustain_wis; /* Keep wisdom */
     BIT_FLAGS sustain_dex; /* Keep dexterity */
index ba889ed..ae6f1fb 100644 (file)
@@ -7,6 +7,7 @@
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/special-object-flags.h"
 #include "perception/object-perception.h"
+#include "player/player-status-flags.h"
 #include "player-info/avatar.h"
 #include "spell-kind/spells-floor.h"
 #include "system/object-type-definition.h"
@@ -178,7 +179,7 @@ bool do_dec_stat(player_type *creature_ptr, int stat)
     bool sust = FALSE;
     switch (stat) {
     case A_STR:
-        if (creature_ptr->sustain_str)
+        if (has_sustain_str(creature_ptr))
             sust = TRUE;
         break;
     case A_INT: