OSDN Git Service

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

index fb09067..5f47cca 100644 (file)
@@ -248,17 +248,7 @@ void calc_equipment_status(player_type* creature_ptr) {
 
         if (o_ptr->curse_flags & TRC_LOW_MELEE) {
             int slot = i - INVEN_RARM;
-            if (slot < 2) {
-                if (o_ptr->curse_flags & TRC_HEAVY_CURSE) {
-                    creature_ptr->to_h[slot] -= 15;
-                    if (object_is_fully_known(o_ptr))
-                        creature_ptr->dis_to_h[slot] -= 15;
-                } else {
-                    creature_ptr->to_h[slot] -= 5;
-                    if (object_is_fully_known(o_ptr))
-                        creature_ptr->dis_to_h[slot] -= 5;
-                }
-            } else {
+            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;
index 573d599..68c8a90 100644 (file)
@@ -3553,6 +3553,14 @@ static void calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot)
         }
     }
 
+       if (o_ptr->curse_flags & TRC_LOW_MELEE) {
+        if (o_ptr->curse_flags & TRC_HEAVY_CURSE) {
+            creature_ptr->to_h[id] -= 15;
+        } else {
+            creature_ptr->to_h[id] -= 5;
+        }
+    }
+
     if ((creature_ptr->realm1 == REALM_HEX) && object_is_cursed(o_ptr)) {
         if (o_ptr->curse_flags & (TRC_CURSED)) {
             creature_ptr->to_h[id] += 5;
@@ -3641,6 +3649,14 @@ static void calc_to_hit_display(player_type *creature_ptr, INVENTORY_IDX slot)
         }
     }
 
+       if (object_is_fully_known(o_ptr) && o_ptr->curse_flags & TRC_LOW_MELEE) {
+        if (o_ptr->curse_flags & TRC_HEAVY_CURSE) {
+            creature_ptr->dis_to_h[id] -= 15;
+        } else {
+            creature_ptr->dis_to_h[id] -= 5;
+        }
+    }
+
     if (hold < o_ptr->weight / 10) {
                creature_ptr->dis_to_h[id] += 2 * (hold - o_ptr->weight / 10);
     }