From 1befc1032a98c74dd648069e30c9657fde5aa79e Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 22 Jan 2018 01:39:42 +0900 Subject: [PATCH] =?utf8?q?#37580=20sanity=5Fblast()=E3=81=AE=E4=BB=95?= =?utf8?q?=E6=A7=98=E5=A4=89=E6=9B=B4=E3=80=82=E9=AD=94=E6=B3=95=E9=98=B2?= =?utf8?q?=E5=BE=A1=E3=81=8C=E9=AB=98=E3=81=84=E3=81=BB=E3=81=A9=E8=87=B4?= =?utf8?q?=E5=91=BD=E7=9A=84=E3=81=AA=E5=A4=89=E7=95=B0=E3=82=92=E5=8F=97?= =?utf8?q?=E3=81=91=E3=82=84=E3=81=99=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92?= =?utf8?q?=E7=9B=B4=E3=81=97=E3=81=9F=E3=80=82=E3=80=80/=20Change=20proces?= =?utf8?q?s=20of=20sanity=5Fblast,=20Fix=20that=20more=20player=20has=20hi?= =?utf8?q?gher=20saving-throw,=20the=20more=20he=20gets=20fatal=20penalty?= =?utf8?q?=20mutations.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/monster2.c | 200 +++++++++++++++++++++++---------------------------------- 1 file changed, 79 insertions(+), 121 deletions(-) diff --git a/src/monster2.c b/src/monster2.c index 0d3692a0e..c1ed8e35b 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -1958,7 +1958,6 @@ void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold */ void sanity_blast(monster_type *m_ptr, bool necro) { - bool happened = FALSE; int power = 100; if (p_ptr->inside_battle || !character_dungeon) return; @@ -2135,28 +2134,83 @@ void sanity_blast(monster_type *m_ptr, bool necro) msg_print(_("ネクロノミコンを読んで正気を失った!", "Your sanity is shaken by reading the Necronomicon!")); } - if (!saving_throw(p_ptr->skill_sav - power)) /* Mind blast */ + if (saving_throw(p_ptr->skill_sav - power)) { - if (!p_ptr->resist_conf) - { - (void)set_confused(p_ptr->confused + randint0(4) + 4); - } - if (!p_ptr->resist_chaos && one_in_(3)) - { - (void)set_image(p_ptr->image + randint0(250) + 150); - } return; } - if (!saving_throw(p_ptr->skill_sav - power)) /* Lose int & wis */ - { - do_dec_stat(A_INT); - do_dec_stat(A_WIS); - return; - } + do { + (void)do_dec_stat(A_INT); + } while (randint0(100) > p_ptr->skill_sav && one_in_(2)); - if (!saving_throw(p_ptr->skill_sav - power)) /* Brain smash */ + do { + (void)do_dec_stat(A_WIS); + } while (randint0(100) > p_ptr->skill_sav && one_in_(2)); + + switch (randint1(21)) { + case 1: + if (!(p_ptr->muta3 & MUT3_MORONIC) && one_in_(5)) + { + if ((p_ptr->stat_use[A_INT] < 4) && (p_ptr->stat_use[A_WIS] < 4)) + { + msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You turn into an utter moron!")); + } + else + { + msg_print(_("あなたは完璧な馬鹿になった!", "You turn into an utter moron!")); + } + + if (p_ptr->muta3 & MUT3_HYPER_INT) + { + msg_print(_("あなたの脳は生体コンピュータではなくなった。", "Your brain is no longer a living computer.")); + p_ptr->muta3 &= ~(MUT3_HYPER_INT); + } + p_ptr->muta3 |= MUT3_MORONIC; + } + break; + case 2: + case 3: + case 4: + if (!(p_ptr->muta2 & MUT2_COWARDICE) && !p_ptr->resist_fear) + { + msg_print(_("あなたはパラノイアになった!", "You become paranoid!")); + + /* Duh, the following should never happen, but anyway... */ + if (p_ptr->muta3 & MUT3_FEARLESS) + { + msg_print(_("あなたはもう恐れ知らずではなくなった。", "You are no longer fearless.")); + p_ptr->muta3 &= ~(MUT3_FEARLESS); + } + + p_ptr->muta2 |= MUT2_COWARDICE; + } + break; + case 5: + case 6: + case 7: + if (!(p_ptr->muta2 & MUT2_HALLU) && !p_ptr->resist_chaos) + { + msg_print(_("幻覚をひき起こす精神錯乱に陥った!", "You are afflicted by a hallucinatory insanity!")); + p_ptr->muta2 |= MUT2_HALLU; + } + break; + case 8: + case 9: + case 10: + if (!(p_ptr->muta2 & MUT2_BERS_RAGE)) + { + msg_print(_("激烈な感情の発作におそわれるようになった!", "You become subject to fits of berserk rage!")); + p_ptr->muta2 |= MUT2_BERS_RAGE; + } + break; + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + /* Brain smash */ if (!p_ptr->resist_conf) { (void)set_confused(p_ptr->confused + randint0(4) + 4); @@ -2165,116 +2219,20 @@ void sanity_blast(monster_type *m_ptr, bool necro) { (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4); } - while (randint0(100) > p_ptr->skill_sav) - (void)do_dec_stat(A_INT); - while (randint0(100) > p_ptr->skill_sav) - (void)do_dec_stat(A_WIS); if (!p_ptr->resist_chaos) { (void)set_image(p_ptr->image + randint0(250) + 150); } - return; - } - - if (!saving_throw(p_ptr->skill_sav - power)) /* Amnesia */ - { - + break; + case 17: + case 18: + case 19: + case 20: + case 21: + /* Amnesia */ if (lose_all_info()) msg_print(_("あまりの恐怖に全てのことを忘れてしまった!", "You forget everything in your utmost terror!")); - - return; - } - - if (saving_throw(p_ptr->skill_sav - power)) - { - return; - } - - /* Else gain permanent insanity */ - if ((p_ptr->muta3 & MUT3_MORONIC) && /*(p_ptr->muta2 & MUT2_BERS_RAGE) &&*/ - ((p_ptr->muta2 & MUT2_COWARDICE) || (p_ptr->resist_fear)) && - ((p_ptr->muta2 & MUT2_HALLU) || (p_ptr->resist_chaos))) - { - /* The poor bastard already has all possible insanities! */ - return; - } - - while (!happened) - { - switch (randint1(21)) - { - case 1: - if (!(p_ptr->muta3 & MUT3_MORONIC) && one_in_(5)) - { - if ((p_ptr->stat_use[A_INT] < 4) && (p_ptr->stat_use[A_WIS] < 4)) - { - msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You turn into an utter moron!")); - } - else - { - msg_print(_("あなたは完璧な馬鹿になった!", "You turn into an utter moron!")); - } - - if (p_ptr->muta3 & MUT3_HYPER_INT) - { - msg_print(_("あなたの脳は生体コンピュータではなくなった。", "Your brain is no longer a living computer.")); - p_ptr->muta3 &= ~(MUT3_HYPER_INT); - } - p_ptr->muta3 |= MUT3_MORONIC; - happened = TRUE; - } - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - if (!(p_ptr->muta2 & MUT2_COWARDICE) && !p_ptr->resist_fear) - { - msg_print(_("あなたはパラノイアになった!", "You become paranoid!")); - - /* Duh, the following should never happen, but anyway... */ - if (p_ptr->muta3 & MUT3_FEARLESS) - { - msg_print(_("あなたはもう恐れ知らずではなくなった。", "You are no longer fearless.")); - p_ptr->muta3 &= ~(MUT3_FEARLESS); - } - - p_ptr->muta2 |= MUT2_COWARDICE; - happened = TRUE; - } - break; - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - if (!(p_ptr->muta2 & MUT2_HALLU) && !p_ptr->resist_chaos) - { - msg_print(_("幻覚をひき起こす精神錯乱に陥った!", "You are afflicted by a hallucinatory insanity!")); - p_ptr->muta2 |= MUT2_HALLU; - happened = TRUE; - } - break; - default: - if (!(p_ptr->muta2 & MUT2_BERS_RAGE)) - { - msg_print(_("激烈な感情の発作におそわれるようになった!", "You become subject to fits of berserk rage!")); - p_ptr->muta2 |= MUT2_BERS_RAGE; - happened = TRUE; - } - break; - } + break; } p_ptr->update |= PU_BONUS; -- 2.11.0