OSDN Git Service

[Refactor] #40514 装備による採掘能力計算を移動. / Moved digging power calculation processing by...
authordeskull <deskull@users.sourceforge.jp>
Thu, 16 Jul 2020 16:05:55 +0000 (01:05 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 16 Jul 2020 16:05:55 +0000 (01:05 +0900)
src/object/object-kind.c
src/player/player-status.c

index c53e70f..8e8cf23 100644 (file)
@@ -47,8 +47,6 @@ void calc_equipment_status(player_type* creature_ptr) {
 
         if (have_flag(flgs, TR_INFRA))
             creature_ptr->see_infra += o_ptr->pval;
-        if (have_flag(flgs, TR_TUNNEL))
-            creature_ptr->skill_dig += (o_ptr->pval * 20);
         if (have_flag(flgs, TR_BLOWS)) {
             if ((i == INVEN_RARM || i == INVEN_RIGHT) && !creature_ptr->ryoute)
                 creature_ptr->extra_blows[0] += o_ptr->pval;
index b9eac74..7405357 100644 (file)
@@ -2115,13 +2115,24 @@ static void calc_to_hit_throw(player_type *creature_ptr)
 
 static void calc_dig(player_type *creature_ptr)
 {
+    object_type *o_ptr;
+    BIT_FLAGS flgs[TR_FLAG_SIZE];
+
     creature_ptr->skill_dig = 0;
     if (creature_ptr->shero)
         creature_ptr->skill_dig += 30;
     creature_ptr->skill_dig += adj_str_dig[creature_ptr->stat_ind[A_STR]];
 
+       for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+        o_ptr = &creature_ptr->inventory_list[i];
+        if (!o_ptr->k_idx)
+            continue;
+        object_flags(o_ptr, flgs);
+        if (have_flag(flgs, TR_TUNNEL))
+            creature_ptr->skill_dig += (o_ptr->pval * 20);
+    }
+
     for (int i = 0; i < 2; i++) {
-        object_type *o_ptr;
         o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
 
         if (has_melee_weapon(creature_ptr, INVEN_RARM + i) && !creature_ptr->heavy_wield[i]) {