OSDN Git Service

[Refactor] #40514 #40652 have_heavy_spell() を BIT_FLAGS 返り値持ちに仕様変更. / have_heavy_spel...
authordeskull <deskull@users.sourceforge.jp>
Tue, 25 Aug 2020 14:56:36 +0000 (23:56 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 25 Aug 2020 14:56:36 +0000 (23:56 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c
src/player/player-status.h

index e30e05c..186a0a2 100644 (file)
@@ -471,20 +471,11 @@ BIT_FLAGS have_easy_spell(player_type *creature_ptr)
     return result;
 }
 
-void have_heavy_spell(player_type *creature_ptr)
+BIT_FLAGS have_heavy_spell(player_type *creature_ptr)
 {
-    object_type *o_ptr;
-    BIT_FLAGS flgs[TR_FLAG_SIZE];
-    creature_ptr->heavy_spell = FALSE;
-    for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
-        o_ptr = &creature_ptr->inventory_list[i];
-        if (!o_ptr->k_idx)
-            continue;
-
-        object_flags(creature_ptr, o_ptr, flgs);
-        if (o_ptr->name2 == EGO_AMU_FOOL)
-            creature_ptr->heavy_spell = TRUE;
-    }
+    BIT_FLAGS result = 0L;
+    result |= check_equipment_flags(creature_ptr, TR_HEAVY_SPELL);
+    return result;
 }
 
 void have_hold_exp(player_type *creature_ptr)
index bc7c9a7..52cd50b 100644 (file)
@@ -53,7 +53,7 @@ void have_sh_fire(player_type *creature_ptr);
 void have_sh_elec(player_type *creature_ptr);
 void have_sh_cold(player_type *creature_ptr);
 BIT_FLAGS have_easy_spell(player_type *creature_ptr);
-void have_heavy_spell(player_type *creature_ptr);
+BIT_FLAGS have_heavy_spell(player_type *creature_ptr);
 void have_hold_exp(player_type *creature_ptr);
 void have_see_inv(player_type *creature_ptr);
 void have_free_act(player_type *creature_ptr);
index 833fc99..366196e 100644 (file)
@@ -350,7 +350,7 @@ void calc_bonuses(player_type *creature_ptr)
     have_sh_elec(creature_ptr);
     have_sh_cold(creature_ptr);
     creature_ptr->easy_spell = have_easy_spell(creature_ptr);
-    have_heavy_spell(creature_ptr);
+    creature_ptr->heavy_spell = have_heavy_spell(creature_ptr);
     have_hold_exp(creature_ptr);
     have_see_inv(creature_ptr);
     have_free_act(creature_ptr);
index 6cc8b28..14fde8d 100644 (file)
@@ -438,7 +438,7 @@ typedef struct player_type {
     bool kill_wall;
     BIT_FLAGS dec_mana;
     BIT_FLAGS easy_spell;
-    bool heavy_spell;
+    BIT_FLAGS heavy_spell;
     bool warning;
     BIT_FLAGS mighty_throw;
     bool see_nocto; /* Noctovision */