OSDN Git Service

[Refactor] #40514 calc_vuln_cold_rate() を適用. / Apply calc_vuln_cold_rate().
authordeskull <deskull@users.sourceforge.jp>
Sun, 6 Sep 2020 05:57:18 +0000 (14:57 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 6 Sep 2020 05:57:18 +0000 (14:57 +0900)
src/object/warning.c
src/player/player-damage.c

index 323be70..3d6cb8a 100644 (file)
@@ -127,11 +127,7 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I
             ignore_wraith_form = TRUE;
             break;
         }
-
-        if (target_ptr->muta3 & MUT3_VULN_ELEM)
-            dam *= 2;
-        if (target_ptr->special_defense & KATA_KOUKIJIN)
-            dam += dam / 3;
+        dam = dam * calc_vuln_cold_rate(target_ptr) / 100;
         if (target_ptr->resist_cold)
             dam = (dam + 2) / 3;
         if (is_oppose_cold(target_ptr))
index 1446dad..e48436e 100644 (file)
@@ -295,10 +295,7 @@ HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int
     }
 
     /* Vulnerability (Ouch!) */
-    if (creature_ptr->muta3 & MUT3_VULN_ELEM)
-        dam *= 2;
-    if (creature_ptr->special_defense & KATA_KOUKIJIN)
-        dam += dam / 3;
+    dam = dam * calc_vuln_acid_rate(creature_ptr) / 100;
 
     /* Resist the damage */
     if (creature_ptr->resist_cold)