From 5d96c28aed224dafeeb0c4a01180dff40d33c0d3 Mon Sep 17 00:00:00 2001 From: nothere Date: Fri, 6 Jun 2003 22:25:26 +0000 Subject: [PATCH] =?utf8?q?=E5=8F=8D=E9=AD=94=E6=B3=95=E3=83=80=E3=83=B3?= =?utf8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=A7=E3=81=AFSTUPID=E3=81=AA?= =?utf8?q?=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AF=E5=8F=8D?= =?utf8?q?=E9=AD=94=E6=B3=95=E7=8A=B6=E6=85=8B=E3=81=AB=E6=B0=97=E3=81=A5?= =?utf8?q?=E3=81=8B=E3=81=9A=E3=81=AB=E9=AD=94=E6=B3=95=E3=82=92=20?= =?utf8?q?=E4=BD=BF=E3=81=A3=E3=81=A6=E5=A4=B1=E6=95=97=E3=81=99=E3=82=8B?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/mspells1.c | 8 ++++++-- src/mspells2.c | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mspells1.c b/src/mspells1.c index 4a44a28c1..b5800d394 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -1268,6 +1268,9 @@ bool make_attack_spell(int m_idx) /* Check "projectable" */ bool direct; + bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level + && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + /* Cannot cast spells when confused */ if (m_ptr->confused) { @@ -1401,7 +1404,7 @@ bool make_attack_spell(int m_idx) f6 &= ~(RF6_DARKNESS); } - if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC)) + if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID)) { f4 &= (RF4_NOMAGIC_MASK); f5 &= (RF5_NOMAGIC_MASK); @@ -1522,7 +1525,8 @@ bool make_attack_spell(int m_idx) if (r_ptr->flags2 & RF2_STUPID) failrate = 0; /* Check for spell failure (inate attacks never fail) */ - if (!spell_is_inate(thrown_spell) && ((m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate))) + if (!spell_is_inate(thrown_spell) + && (in_no_magic_dungeon || (m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate))) { disturb(1, 0); /* Message */ diff --git a/src/mspells2.c b/src/mspells2.c index 754acaeb7..eab08f4a2 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -208,6 +208,9 @@ bool monst_spell_monst(int m_idx) bool pet = is_pet(m_ptr); + bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level + && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + /* Prepare flags for summoning */ if (pet) p_mode |= PM_FORCE_PET; if (!pet) u_mode |= PM_ALLOW_UNIQUE; @@ -310,7 +313,7 @@ bool monst_spell_monst(int m_idx) /* Extract the monster level */ rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1); - if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC)) + if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID)) { f4 &= (RF4_NOMAGIC_MASK); f5 &= (RF5_NOMAGIC_MASK); @@ -468,7 +471,6 @@ bool monst_spell_monst(int m_idx) f4 &= (RF4_INT_MASK); f5 &= (RF5_INT_MASK); f6 &= (RF6_INT_MASK); - } /* No spells left */ @@ -526,7 +528,7 @@ bool monst_spell_monst(int m_idx) if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 0); /* Check for spell failure (inate attacks never fail) */ - if (!spell_is_inate(thrown_spell) && m_ptr->stunned && one_in_(2)) + if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (m_ptr->stunned && one_in_(2)))) { disturb(1, 0); /* Message */ -- 2.11.0