OSDN Git Service

[Refactor] #40514 #40652 have_mighty_throw() を BIT_FLAGS 返り値持ちに仕様変更. / have_mighty_th...
authordeskull <deskull@users.sourceforge.jp>
Mon, 24 Aug 2020 16:22:06 +0000 (01:22 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 24 Aug 2020 16:22:06 +0000 (01:22 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c
src/player/player-status.h

index 4b8ea52..b161b4b 100644 (file)
@@ -313,20 +313,11 @@ void have_no_flowed(player_type *creature_ptr)
     }
 }
 
-void have_mighty_throw(player_type *creature_ptr)
+BIT_FLAGS have_mighty_throw(player_type *creature_ptr)
 {
-    object_type *o_ptr;
-
-    creature_ptr->mighty_throw = 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;
-
-        if (o_ptr->name2 == EGO_RING_THROW)
-            creature_ptr->mighty_throw = TRUE;
-    }
+    BIT_FLAGS result = 0L;
+    result |= check_equipment_flags(creature_ptr, TR_MIGHTY_THROW);
+    return result;
 }
 
 BIT_FLAGS have_dec_mana(player_type *creature_ptr)
index 0f76396..85c2772 100644 (file)
@@ -42,7 +42,7 @@ void have_easy2_weapon(player_type *creature_ptr);
 void have_down_saving(player_type *creature_ptr);
 void have_no_ac(player_type *creature_ptr);
 void have_no_flowed(player_type *creature_ptr);
-void have_mighty_throw(player_type *creature_ptr);
+BIT_FLAGS have_mighty_throw(player_type *creature_ptr);
 BIT_FLAGS have_dec_mana(player_type *creature_ptr);
 BIT_FLAGS have_reflect(player_type *creature_ptr);
 void have_see_nocto(player_type *creature_ptr);
index 1f6eab2..ce169ec 100644 (file)
@@ -313,7 +313,7 @@ void calc_bonuses(player_type *creature_ptr)
     BIT_FLAGS old_esp_nonliving = creature_ptr->esp_nonliving;
     BIT_FLAGS old_esp_unique = creature_ptr->esp_unique;
     bool old_see_inv = creature_ptr->see_inv;
-    bool old_mighty_throw = creature_ptr->mighty_throw;
+    BIT_FLAGS old_mighty_throw = creature_ptr->mighty_throw;
     s16b old_speed = creature_ptr->pspeed;
 
     ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
@@ -339,7 +339,7 @@ void calc_bonuses(player_type *creature_ptr)
     have_easy2_weapon(creature_ptr);
     have_down_saving(creature_ptr);
     have_no_ac(creature_ptr);
-    have_mighty_throw(creature_ptr);
+    creature_ptr->mighty_throw = have_mighty_throw(creature_ptr);
     creature_ptr->dec_mana = have_dec_mana(creature_ptr);
     creature_ptr->reflect = have_reflect(creature_ptr);
     have_see_nocto(creature_ptr);
index d2c7016..e4ee668 100644 (file)
@@ -440,7 +440,7 @@ typedef struct player_type {
     BIT_FLAGS easy_spell;
     bool heavy_spell;
     bool warning;
-    bool mighty_throw;
+    BIT_FLAGS mighty_throw;
     bool see_nocto; /* Noctovision */
     bool invoking_midnight_curse;