OSDN Git Service

[Refactor] #40514 have_mighty_throw() を calc_bonuses() から分離. / Separated have_mighty_...
authordeskull <deskull@users.sourceforge.jp>
Tue, 28 Jul 2020 16:35:01 +0000 (01:35 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 28 Jul 2020 16:35:01 +0000 (01:35 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c

index 80b7757..8158a56 100644 (file)
@@ -473,3 +473,19 @@ void have_no_flowed(player_type *creature_ptr)
             creature_ptr->no_flowed = TRUE;
     }
 }
+
+void have_mighty_throw(player_type *creature_ptr)
+{
+    object_type *o_ptr;
+
+    creature_ptr->mighty_throw = FALSE;
+
+    for (int 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;
+    }
+}
index 96688a1..e30812e 100644 (file)
@@ -21,5 +21,6 @@ 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);
 
 
index 486093e..06190a1 100644 (file)
@@ -608,7 +608,6 @@ static void clear_creature_bonuses(player_type *creature_ptr)
     creature_ptr->anti_magic = FALSE;
     creature_ptr->anti_tele = FALSE;
     creature_ptr->warning = FALSE;
-    creature_ptr->mighty_throw = FALSE;
     creature_ptr->see_nocto = FALSE;
     creature_ptr->immune_acid = FALSE;
     creature_ptr->immune_elec = FALSE;
@@ -707,6 +706,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);
 
     calc_race_status(creature_ptr);
 
@@ -4759,8 +4759,6 @@ void calc_equipment_status(player_type *creature_ptr)
 
         if (o_ptr->name2 == EGO_RING_RES_TIME)
             creature_ptr->resist_time = TRUE;
-        if (o_ptr->name2 == EGO_RING_THROW)
-            creature_ptr->mighty_throw = TRUE;
         if (have_flag(flgs, TR_EASY_SPELL))
             creature_ptr->easy_spell = TRUE;
         if (o_ptr->name2 == EGO_AMU_FOOL)