From ee1a7297eb636860acb6382d9693655e3d2958ee Mon Sep 17 00:00:00 2001 From: nothere Date: Tue, 15 Jul 2003 20:48:09 +0000 Subject: [PATCH] =?utf8?q?=E5=A4=89=E6=95=B0check=5Fwraith=5Fform=E3=81=AF?= =?utf8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=81=AE=E3=81=A7,=20ignore=5Fwraith?= =?utf8?q?=5Fform=E3=81=A7=E7=B5=B1=E4=B8=80.=20=E3=81=BE=E3=81=9F,=20?= =?utf8?q?=E5=B9=BD=E4=BD=93=E5=8C=96=E6=99=82=E3=81=AE=E9=96=83=E5=85=89?= =?utf8?q?=E5=B1=9E=E6=80=A7=E3=81=AB=E5=AF=BE=E3=81=97=E3=81=A6=E3=81=AF?= =?utf8?q?=E3=83=80=E3=83=A1=E3=83=BC=E3=82=B80=E3=81=AE=E6=99=82=E3=81=AE?= =?utf8?q?=E3=83=A9=E3=83=B3=E3=83=80=E3=83=A0=E3=81=AA1=E3=83=80=E3=83=A1?= =?utf8?q?=E3=83=BC=E3=82=B8=E3=81=8C=E3=81=82=E3=82=8B=20=E3=81=9F?= =?utf8?q?=E3=82=81,=20ignore=5Fwraith=5Fform=E3=82=92=E4=BD=BF=E3=82=8F?= =?utf8?q?=E3=81=9A=20"=E5=8E=B3=E5=AF=86=E3=81=AA"=20=E8=A8=88=E7=AE=97?= =?utf8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=81=93=E3=81=A8=E3=81=AB=E3=81=97?= =?utf8?q?=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/object2.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/object2.c b/src/object2.c index 1695eedd9..edbb8a97d 100644 --- a/src/object2.c +++ b/src/object2.c @@ -6325,7 +6325,6 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int monster_race *r_ptr = &r_info[m_ptr->r_idx]; int rlev = r_ptr->level; bool ignore_wraith_form = FALSE; - bool complete_immune = FALSE; if (limit) dam = (dam > limit) ? limit : dam; @@ -6336,7 +6335,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->immune_elec) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else { @@ -6358,7 +6357,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->immune_acid) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else { @@ -6374,7 +6373,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->immune_cold) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else { @@ -6389,7 +6388,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->immune_fire) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else { @@ -6411,7 +6410,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int (inventory[INVEN_LARM].k_idx && (inventory[INVEN_LARM].name1 == ART_ZANTETSU)))) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } break; @@ -6419,14 +6418,19 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->resist_lite) dam /= 2; /* Worst case of 4 / (d4 + 7) */ if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) dam *= 2; else if (prace_is_(RACE_S_FAIRY)) dam = dam * 4 / 3; - ignore_wraith_form = TRUE; + + /* + * Cannot use "ignore_wraith_form" strictly (for "random one damage") + * "dam *= 2;" for later "dam /= 2" + */ + if (p_ptr->wraith_form) dam *= 2; break; case GF_DARK: if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else if (p_ptr->resist_dark) dam /= 2; /* Worst case of 4 / (d4 + 7) */ break; @@ -6451,7 +6455,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (prace_is_(RACE_SPECTRE)) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } else if (p_ptr->resist_neth) dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */ break; @@ -6487,7 +6491,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } } else @@ -6501,7 +6505,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int case RACE_DEMON: case RACE_SPECTRE: dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; break; } } @@ -6521,7 +6525,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (100 + rlev / 2 <= MAX(5, p_ptr->skill_sav)) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } break; @@ -6532,7 +6536,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (100 + rlev / 2 <= p_ptr->skill_sav) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } break; @@ -6540,7 +6544,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if ((100 + rlev / 2 <= p_ptr->skill_sav) && (m_ptr->r_idx != MON_KENSHIROU)) { dam = 0; - complete_immune = TRUE; + ignore_wraith_form = TRUE; } break; } @@ -6548,7 +6552,7 @@ static void spell_damcalc(monster_type *m_ptr, int typ, int dam, int limit, int if (p_ptr->wraith_form && !ignore_wraith_form) { dam /= 2; - if (!dam && !complete_immune) dam = 1; + if (!dam) dam = 1; } if (dam > *max) *max = dam; -- 2.11.0