OSDN Git Service

[Refactor] #40514 呪術ハイメイジの呪いによるダメージ修正を移動. / Moved hit damage calculation processing...
authordeskull <deskull@users.sourceforge.jp>
Wed, 15 Jul 2020 16:41:57 +0000 (01:41 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 15 Jul 2020 16:41:57 +0000 (01:41 +0900)
src/player/player-status.c

index a1a4014..facb00c 100644 (file)
@@ -848,15 +848,12 @@ void calc_bonuses(player_type *creature_ptr)
         if ((creature_ptr->realm1 == REALM_HEX) && object_is_cursed(o_ptr)) {
             if (hex_spelling(creature_ptr, HEX_RUNESWORD)) {
                 if (o_ptr->curse_flags & (TRC_CURSED)) {
-                    creature_ptr->to_d[i] += 5;
                     creature_ptr->dis_to_d[i] += 5;
                 }
                 if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) {
-                    creature_ptr->to_d[i] += 7;
                     creature_ptr->dis_to_d[i] += 7;
                 }
                 if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) {
-                    creature_ptr->to_d[i] += 13;
                     creature_ptr->dis_to_d[i] += 13;
                 }
             }
@@ -3462,6 +3459,7 @@ void put_equipment_warning(player_type *creature_ptr)
 }
 
 static void calc_to_damage(player_type* creature_ptr, INVENTORY_IDX slot) {
+    object_type *o_ptr = &creature_ptr->inventory_list[slot];
     int id = slot - INVEN_RARM;
        creature_ptr->to_d[id] = 0;
 
@@ -3476,6 +3474,20 @@ static void calc_to_damage(player_type* creature_ptr, INVENTORY_IDX slot) {
     } else if (creature_ptr->stun) {
         creature_ptr->to_d[id] -= 5;
     }
+
+       if ((creature_ptr->realm1 == REALM_HEX) && object_is_cursed(o_ptr)) {
+        if (hex_spelling(creature_ptr, HEX_RUNESWORD)) {
+            if (o_ptr->curse_flags & (TRC_CURSED)) {
+                creature_ptr->to_d[id] += 5;
+            }
+            if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) {
+                creature_ptr->to_d[id] += 7;
+            }
+            if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) {
+                creature_ptr->to_d[id] += 13;
+            }
+        }
+    }
 }
 
 static void calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot)