OSDN Git Service

[Refactor] #40514 呪い装備による命中修正表示を移動. / Moved displaying hit power calculation processi...
authordeskull <deskull@users.sourceforge.jp>
Thu, 16 Jul 2020 15:59:05 +0000 (00:59 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 16 Jul 2020 15:59:47 +0000 (00:59 +0900)
src/object/object-kind.c
src/player/player-status.c

index 5f47cca..c53e70f 100644 (file)
@@ -246,19 +246,6 @@ void calc_equipment_status(player_type* creature_ptr) {
         if (o_ptr->tval == TV_CAPTURE)
             continue;
 
-        if (o_ptr->curse_flags & TRC_LOW_MELEE) {
-            int slot = i - INVEN_RARM;
-            if (slot >= 2) {
-                if (o_ptr->curse_flags & TRC_HEAVY_CURSE) {
-                    if (object_is_fully_known(o_ptr))
-                        creature_ptr->dis_to_h_b -= 15;
-                } else {
-                    if (object_is_fully_known(o_ptr))
-                        creature_ptr->dis_to_h_b -= 5;
-                }
-            }
-        }
-
         if (i == INVEN_RARM && has_melee_weapon(creature_ptr, i))
             continue;
         if (i == INVEN_LARM && has_melee_weapon(creature_ptr, i))
index 68c8a90..b9eac74 100644 (file)
@@ -3752,6 +3752,25 @@ static void calc_to_hit_bow_display(player_type *creature_ptr) {
     creature_ptr->dis_to_h_b += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
     creature_ptr->dis_to_h_b += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
 
+    for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+        object_type *o_ptr;
+        BIT_FLAGS flgs[TR_FLAG_SIZE];
+        o_ptr = &creature_ptr->inventory_list[i];
+        if (!o_ptr->k_idx)
+            continue;
+        object_flags(o_ptr, flgs);
+
+        if (object_is_fully_known(o_ptr)) {
+            if (o_ptr->curse_flags & TRC_LOW_MELEE) {
+                if (o_ptr->curse_flags & TRC_HEAVY_CURSE) {
+                    creature_ptr->dis_to_h_b -= 15;
+                } else {
+                    creature_ptr->dis_to_h_b -= 5;
+                }
+            }
+        }
+    }
+
        if (creature_ptr->stun > 50) {
         creature_ptr->dis_to_h_b -= 20;
     } else if (creature_ptr->stun) {
@@ -3769,7 +3788,8 @@ static void calc_to_hit_bow_display(player_type *creature_ptr) {
     if (creature_ptr->shero) {
         creature_ptr->dis_to_h_b -= 12;
     }
-      
+
+
 }
 
 static void calc_to_damage_misc(player_type *creature_ptr)