{
if (target_ptr->blind)
msg_print(_("何かで攻撃された!", "You are hit by something!"));
- if (target_ptr->resist_lite) {
- ep_ptr->dam *= 4;
- ep_ptr->dam /= (randint1(4) + 7);
- } else if (!target_ptr->blind && !target_ptr->resist_blind && !check_multishadow(target_ptr)) {
+ if (!target_ptr->blind && !target_ptr->resist_blind && !check_multishadow(target_ptr)) {
(void)set_blind(target_ptr, target_ptr->blind + randint1(5) + 2);
}
- ep_ptr->dam = ep_ptr->dam * calc_vuln_lite_rate(target_ptr) / 100;
+ ep_ptr->dam = ep_ptr->dam * calc_lite_damage_rate(target_ptr, CALC_RAND) / 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 (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))
break;
case GF_LITE:
- if (target_ptr->resist_lite)
- dam /= 2; /* Worst case of 4 / (d4 + 7) */
- dam = dam * calc_vuln_lite_rate(target_ptr) / 100;
+ dam = dam * calc_lite_damage_rate(target_ptr, RAND_MAX) / 100;
break;
case GF_DARK:
return per;
}
-PERCENTAGE calc_vuln_lite_rate(player_type *creature_ptr)
+PERCENTAGE calc_lite_damage_rate(player_type *creature_ptr, rate_calc_type_mode mode)
{
PERCENTAGE per = 100;
if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE)) {
per = per * 4 / 3;
}
+ if (creature_ptr->resist_lite) {
+ per *= 400;
+ per /= randrate(4, 7, mode);
+ }
+
if (creature_ptr->wraith_form)
per *= 2;
PERCENTAGE calc_elec_damage_rate(player_type *creature_ptr);
PERCENTAGE calc_fire_damage_rate(player_type *creature_ptr);
PERCENTAGE calc_cold_damage_rate(player_type *creature_ptr);
-PERCENTAGE calc_vuln_lite_rate(player_type *creature_ptr);
+PERCENTAGE calc_lite_damage_rate(player_type *creature_ptr, rate_calc_type_mode mode);