OSDN Git Service

[Refactor] #40514 calc_vuln_lite_rate() を適用. / Apply calc_vuln_lite_rate().
authordeskull <deskull@users.sourceforge.jp>
Sun, 6 Sep 2020 12:09:45 +0000 (21:09 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 6 Sep 2020 12:09:45 +0000 (21:09 +0900)
src/effect/effect-player-resist-hurt.c
src/object/warning.c

index af4e840..c1feda4 100644 (file)
@@ -365,17 +365,15 @@ void effect_player_lite(player_type *target_ptr, effect_player_type *ep_ptr)
         (void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2);
     }
 
         (void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2);
     }
 
+    ep_ptr->dam = ep_ptr->dam * calc_vuln_fire_rate(target_ptr) / 100;
+
     if (is_specific_player_race(target_ptr, RACE_VAMPIRE) || (target_ptr->mimic_form == MIMIC_VAMPIRE)) {
         if (!check_multishadow(target_ptr))
             msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
     if (is_specific_player_race(target_ptr, RACE_VAMPIRE) || (target_ptr->mimic_form == MIMIC_VAMPIRE)) {
         if (!check_multishadow(target_ptr))
             msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
-        ep_ptr->dam *= 2;
-    } else if (is_specific_player_race(target_ptr, RACE_S_FAIRY)) {
-        ep_ptr->dam = ep_ptr->dam * 4 / 3;
     }
 
     if (target_ptr->wraith_form)
         ep_ptr->dam *= 2;
     }
 
     if (target_ptr->wraith_form)
         ep_ptr->dam *= 2;
-
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell);
 
     if (!target_ptr->wraith_form || check_multishadow(target_ptr))
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell);
 
     if (!target_ptr->wraith_form || check_multishadow(target_ptr))
index 3d6cb8a..901138a 100644 (file)
@@ -164,13 +164,7 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I
     case GF_LITE:
         if (target_ptr->resist_lite)
             dam /= 2; /* Worst case of 4 / (d4 + 7) */
     case GF_LITE:
         if (target_ptr->resist_lite)
             dam /= 2; /* Worst case of 4 / (d4 + 7) */
-        if (is_specific_player_race(target_ptr, RACE_VAMPIRE) || (target_ptr->mimic_form == MIMIC_VAMPIRE))
-            dam *= 2;
-        else if (is_specific_player_race(target_ptr, RACE_S_FAIRY))
-            dam = dam * 4 / 3;
-
-        if (target_ptr->wraith_form)
-            dam *= 2;
+        dam = dam * calc_vuln_lite_rate(target_ptr) / 100;
         break;
 
     case GF_DARK:
         break;
 
     case GF_DARK: