From 16844897978bdced4436100617b3780c82226740 Mon Sep 17 00:00:00 2001 From: nothere Date: Sun, 21 Dec 2003 07:06:59 +0000 Subject: [PATCH] =?utf8?q?project=5Fm()=E3=81=AE=E5=A4=89=E6=9B=B4?= =?utf8?q?=E3=81=A8=E4=BF=AE=E6=AD=A3.=20*=20ignore=5Funview=E3=81=AE?= =?utf8?q?=E5=A4=89=E6=9B=B4=E3=81=AE=E5=89=AF=E4=BD=9C=E7=94=A8=E3=81=A7,?= =?utf8?q?=20=E7=9B=AE=E3=81=AE=E5=89=8D=E3=81=A7=E3=83=86=E3=83=AC?= =?utf8?q?=E3=83=9D=E3=83=BC=E3=83=88=E3=81=95=E3=81=9B=E3=81=9F=E3=83=A2?= =?utf8?q?=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AB=20=20=20=E3=81=A4?= =?utf8?q?=E3=81=84=E3=81=A6=20"=E4=BD=95=E3=81=8B=E3=81=AF=E3=83=80?= =?utf8?q?=E3=83=A1=E3=83=BC=E3=82=B8=E3=82=92=E5=8F=97=E3=81=91=E3=81=A6?= =?utf8?q?=E3=81=84=E3=81=AA=E3=81=84"=20=E3=81=A8=E8=A1=A8=E7=A4=BA?= =?utf8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AA=E3=83=90?= =?utf8?q?=E3=82=B0=E3=81=8C=E3=81=82=E3=81=A3=20=20=20=E3=81=9F=E3=81=AE?= =?utf8?q?=E3=81=A7=E4=BF=AE=E6=AD=A3.=20=E5=86=85=E9=83=A8=E3=83=95?= =?utf8?q?=E3=83=A9=E3=82=B0=E3=82=92=E4=BA=8B=E5=AE=9F=E7=A2=BA=E8=AA=8D?= =?utf8?q?=E7=94=A8=E3=81=A8=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?utf8?q?=E8=A1=A8=E7=A4=BA=E7=94=A8=E3=81=AB=E5=88=86=E3=81=91=E3=81=9F.?= =?utf8?q?=20*=20=E9=87=8D=E5=8A=9B=E5=B1=9E=E6=80=A7=E3=82=84=E3=83=86?= =?utf8?q?=E3=83=AC=E3=82=AD=E3=83=8D=E3=82=B7=E3=82=B9=E5=B1=9E=E6=80=A7?= =?utf8?q?=E3=81=A7=E3=83=86=E3=83=AC=E3=83=9D=E3=83=BC=E3=83=88=E3=81=A8?= =?utf8?q?=E6=9C=A6=E6=9C=A7=E3=81=8C=E5=90=8C=E6=99=82=E3=81=AB=E6=8C=87?= =?utf8?q?=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=82=82=E3=83=86=20=20=20?= =?utf8?q?=E3=83=AC=E3=83=9D=E3=83=BC=E3=83=88=E3=81=A0=E3=81=91=E3=81=8C?= =?utf8?q?=E5=87=A6=E7=90=86=E3=81=95=E3=82=8C,=20=E6=9C=A6=E6=9C=A7?= =?utf8?q?=E5=BA=A6=E3=81=8C=E7=84=A1=E8=A6=96=E3=81=95=E3=82=8C=E3=82=8B?= =?utf8?q?=E3=83=90=E3=82=B0=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE?= =?utf8?q?=E3=81=A7=E4=BF=AE=E6=AD=A3.=20*=20project=5Fm()=E3=81=A7?= =?utf8?q?=E3=81=AF=E6=81=90=E6=80=96=E4=BB=A5=E5=A4=96=E3=81=AE=E7=89=B9?= =?utf8?q?=E6=AE=8A=E5=8A=B9=E6=9E=9C=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?utf8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AF1=E3=81=A4?= =?utf8?q?=E3=81=97=E3=81=8B=E5=87=A6=E7=90=86=E3=81=A7=20=20=20=E3=81=8D?= =?utf8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7,=20=E3=83=86=E3=83=AC?= =?utf8?q?=E3=83=9D=E3=83=BC=E3=83=88,=20=E5=A4=89=E8=BA=AB,=20=E6=9C=80?= =?utf8?q?=E5=A4=A7HP=E3=83=80=E3=83=A1=E3=83=BC=E3=82=B8,=20=E6=B7=B7?= =?utf8?q?=E4=B9=B1,=20=E6=9C=A6=E6=9C=A7=E3=81=AE=E5=84=AA=E5=85=88?= =?utf8?q?=E9=A0=86=E4=BD=8D=20=20=20=E3=81=A7=E8=A1=A8=E7=A4=BA=E3=81=95?= =?utf8?q?=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4.?= =?utf8?q?=20*=20=E8=96=AC=E3=81=8C=E5=89=B2=E3=82=8C=E3=81=9F=E3=82=8A?= =?utf8?q?=E3=81=97=E3=81=9F=E3=82=88=E3=81=86=E3=81=AA=E5=A0=B4=E5=90=88?= =?utf8?q?=E3=81=A7=E3=83=97=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC=E4=BB=A5?= =?utf8?q?=E5=A4=96=E3=81=8C=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC?= =?utf8?q?=E3=82=92=E5=9B=9E=E5=BE=A9=E3=81=95=E3=81=9B=E3=81=9F=20=20=20?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AA=E5=A0=B4=E5=90=88=E3=81=AA=E3=81=A9?= =?utf8?q?=E3=81=A7=E3=82=82=E3=83=97=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC?= =?utf8?q?=E3=81=AE=E5=BE=B3=E3=81=8C=E5=A4=89=E5=8C=96=E3=81=97=E3=81=A6?= =?utf8?q?=E3=81=84=E3=81=9F=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/spells1.c | 323 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 164 insertions(+), 159 deletions(-) diff --git a/src/spells1.c b/src/spells1.c index 215f469f8..54448a796 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -1663,6 +1663,7 @@ static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg) /* Is the monster "seen"? */ bool seen = m_ptr->ml; + bool seen_msg = is_seen(m_ptr); bool slept = (bool)(m_ptr->csleep > 0); @@ -1673,7 +1674,7 @@ static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg) bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle); /* Can the player see the source of this effect? */ - bool see_s = ((who <= 0) || is_seen(caster_ptr)); + bool see_s_msg = ((who <= 0) || is_seen(caster_ptr)); /* Were the effects "irrelevant"? */ bool skipped = FALSE; @@ -2718,9 +2719,9 @@ note_dies = " if (!(los(m_ptr->fy, m_ptr->fx, py, px))) { #ifdef JP - if (is_seen(m_ptr)) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name); + if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name); #else - if (is_seen(m_ptr)) msg_format("%^s can't see you, and isn't affected!", m_name); + if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name); #endif skipped = TRUE; break; @@ -3395,9 +3396,9 @@ note = " if (m_ptr->maxhp < m_ptr->max_maxhp) { #ifdef JP -msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name); + if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name); #else - msg_format("%^s recovers %s vitality.", m_name, m_poss); + if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss); #endif m_ptr->maxhp = m_ptr->max_maxhp; } @@ -3415,27 +3416,27 @@ msg_format("%^s if (m_ptr->stunned) { #ifdef JP -msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name); + if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name); #else - msg_format("%^s is no longer stunned.", m_name); + if (seen_msg) msg_format("%^s is no longer stunned.", m_name); #endif m_ptr->stunned = 0; } if (m_ptr->confused) { #ifdef JP -msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name); + if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name); #else - msg_format("%^s is no longer confused.", m_name); + if (seen_msg) msg_format("%^s is no longer confused.", m_name); #endif m_ptr->confused = 0; } if (m_ptr->monfear) { #ifdef JP -msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name); + if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name); #else - msg_format("%^s recovers %s courage.", m_name, m_poss); + if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss); #endif m_ptr->monfear = 0; } @@ -3446,29 +3447,32 @@ msg_format("%^s /* No overflow */ if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp; - chg_virtue(V_VITALITY, 1); - - if (r_ptr->flags1 & RF1_UNIQUE) - chg_virtue(V_INDIVIDUALISM, 1); - - if (is_friendly(m_ptr)) - chg_virtue(V_HONOUR, 1); - else if (!(r_ptr->flags3 & RF3_EVIL)) - { - if (r_ptr->flags3 & RF3_GOOD) - chg_virtue(V_COMPASSION, 2); - else - chg_virtue(V_COMPASSION, 1); + if (!who) + { + chg_virtue(V_VITALITY, 1); + + if (r_ptr->flags1 & RF1_UNIQUE) + chg_virtue(V_INDIVIDUALISM, 1); + + if (is_friendly(m_ptr)) + chg_virtue(V_HONOUR, 1); + else if (!(r_ptr->flags3 & RF3_EVIL)) + { + if (r_ptr->flags3 & RF3_GOOD) + chg_virtue(V_COMPASSION, 2); + else + chg_virtue(V_COMPASSION, 1); + } + + if (r_ptr->flags3 & RF3_ANIMAL) + chg_virtue(V_NATURE, 1); } if (m_ptr->r_idx == MON_LEPER) { heal_leper = TRUE; - chg_virtue(V_COMPASSION, 5); + if (!who) chg_virtue(V_COMPASSION, 5); } - - if (r_ptr->flags3 & RF3_ANIMAL) - chg_virtue(V_NATURE, 1); /* Redraw (later) if needed */ if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH); @@ -3507,10 +3511,13 @@ note = " if (c_ptr->m_idx == p_ptr->riding) p_ptr->update |= (PU_BONUS); - if (r_ptr->flags1 & RF1_UNIQUE) - chg_virtue(V_INDIVIDUALISM, 1); - if (is_friendly(m_ptr)) - chg_virtue(V_HONOUR, 1); + if (!who) + { + if (r_ptr->flags1 & RF1_UNIQUE) + chg_virtue(V_INDIVIDUALISM, 1); + if (is_friendly(m_ptr)) + chg_virtue(V_HONOUR, 1); + } /* No "real" damage */ dam = 0; @@ -4927,7 +4934,7 @@ note_dies = " if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH); /* Special message */ - if (is_seen(caster_ptr)) + if (see_s_msg) { /* Get the monster name */ monster_desc(killer, caster_ptr, 0); @@ -4954,9 +4961,9 @@ note_dies = " else { #ifdef JP - msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name); + if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name); #else - msg_format("%s is unaffected.", m_name); + if (see_s_msg) msg_format("%s is unaffected.", m_name); #endif } dam = 0; @@ -5827,181 +5834,179 @@ note = " /* Extract method of death */ note = note_dies; } - - /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */ - else if (do_poly && (randint1(90) > r_ptr->level)) + else { - if (polymorph_monster(y, x)) + /* Sound and Impact resisters never stun */ + if (do_stun && + !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) && + !(r_ptr->flags3 & RF3_NO_STUN)) { /* Obvious */ if (seen) obvious = TRUE; - /* Monster polymorphs */ + /* Get stunned */ + if (m_ptr->stunned) + { #ifdef JP - note = "¤¬ÊѿȤ·¤¿¡ª"; + note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£"; #else - note = " changes!"; + note = " is more dazed."; #endif + tmp = m_ptr->stunned + (do_stun / 2); + } + else + { +#ifdef JP + note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£"; +#else + note = " is dazed."; +#endif - /* Turn off the damage */ - dam = 0; + tmp = do_stun; + } - /* Hack -- Get new monster */ - m_ptr = &m_list[c_ptr->m_idx]; + /* Apply stun */ + m_ptr->stunned = (tmp < 200) ? tmp : 200; - /* Hack -- Get new race */ - r_ptr = &r_info[m_ptr->r_idx]; + /* Get angry */ + get_angry = TRUE; } - else + + /* Confusion and Chaos resisters (and sleepers) never confuse */ + if (do_conf && + !(r_ptr->flags3 & RF3_NO_CONF) && + !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK)) { - /* No polymorph */ + /* Obvious */ + if (seen) obvious = TRUE; + + /* Already partially confused */ + if (m_ptr->confused) + { #ifdef JP -note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª"; + note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£"; #else - note = " is unaffected!"; + note = " looks more confused."; #endif - } - } - - /* Handle "teleport" */ - else if (do_dist) - { - /* Obvious */ - if (seen) obvious = TRUE; + tmp = m_ptr->confused + (do_conf / 2); + } - /* Message */ + /* Was not confused */ + else + { #ifdef JP - note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª"; + note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£"; #else - note = " disappears!"; + note = " looks confused."; #endif - chg_virtue(V_VALOUR, -1); + tmp = do_conf; + } - /* Teleport */ - teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE); + /* Apply confusion */ + m_ptr->confused = (tmp < 200) ? tmp : 200; - /* Hack -- get new location */ - y = m_ptr->fy; - x = m_ptr->fx; + /* Get angry */ + get_angry = TRUE; + } - /* Hack -- get new grid */ - c_ptr = &cave[y][x]; - } + if (do_time) + { + /* Obvious */ + if (seen) obvious = TRUE; - /* Sound and Impact resisters never stun */ - else if (do_stun && - !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) && - !(r_ptr->flags3 & RF3_NO_STUN)) - { - /* Obvious */ - if (seen) obvious = TRUE; + if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1; - /* Get stunned */ - if (m_ptr->stunned) - { + if (do_time) + { #ifdef JP - note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£"; + note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£"; #else - note = " is more dazed."; + note = " seems weakened."; #endif - - tmp = m_ptr->stunned + (do_stun / 2); + m_ptr->maxhp -= do_time; + if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp; + } + get_angry = TRUE; } - else + + /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */ + if (do_poly && (randint1(90) > r_ptr->level)) { + if (polymorph_monster(y, x)) + { + /* Obvious */ + if (seen) obvious = TRUE; + + /* Monster polymorphs */ #ifdef JP - note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£"; + note = "¤¬ÊѿȤ·¤¿¡ª"; #else - note = " is dazed."; + note = " changes!"; #endif - tmp = do_stun; - } - - /* Apply stun */ - m_ptr->stunned = (tmp < 200) ? tmp : 200; - - /* Get angry */ - get_angry = TRUE; - } + /* Turn off the damage */ + dam = 0; - /* Confusion and Chaos resisters (and sleepers) never confuse */ - else if (do_conf && - !(r_ptr->flags3 & RF3_NO_CONF) && - !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK)) - { - /* Obvious */ - if (seen) obvious = TRUE; + /* Hack -- Get new monster */ + m_ptr = &m_list[c_ptr->m_idx]; - /* Already partially confused */ - if (m_ptr->confused) - { + /* Hack -- Get new race */ + r_ptr = &r_info[m_ptr->r_idx]; + } + else + { + /* No polymorph */ #ifdef JP - note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£"; + note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª"; #else - note = " looks more confused."; + note = " is unaffected!"; #endif - - tmp = m_ptr->confused + (do_conf / 2); + } } - /* Was not confused */ - else + /* Handle "teleport" */ + if (do_dist) { + /* Obvious */ + if (seen) obvious = TRUE; + + /* Message */ #ifdef JP - note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£"; + note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª"; #else - note = " looks confused."; + note = " disappears!"; #endif - tmp = do_conf; - } - - /* Apply confusion */ - m_ptr->confused = (tmp < 200) ? tmp : 200; + if (!who) chg_virtue(V_VALOUR, -1); - /* Get angry */ - get_angry = TRUE; - } - - else if (do_time) - { - /* Obvious */ - if (seen) obvious = TRUE; + /* Teleport */ + teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE); - if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1; + /* Hack -- get new location */ + y = m_ptr->fy; + x = m_ptr->fx; - if (do_time) - { -#ifdef JP - note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£"; -#else - note = " seems weakened."; -#endif - m_ptr->maxhp -= do_time; - if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp; + /* Hack -- get new grid */ + c_ptr = &cave[y][x]; } - get_angry = TRUE; - } + /* Fear */ + if (do_fear) + { + /* Increase fear */ + tmp = m_ptr->monfear + do_fear; - /* Fear */ - if (do_fear) - { - /* Increase fear */ - tmp = m_ptr->monfear + do_fear; - - /* Set fear */ - m_ptr->monfear = (tmp < 200) ? tmp : 200; + /* Set fear */ + m_ptr->monfear = (tmp < 200) ? tmp : 200; - /* Get angry */ - get_angry = TRUE; + /* Get angry */ + get_angry = TRUE; + } } - if (typ == GF_DRAIN_MANA) { /* Drain mana does nothing */ @@ -6034,7 +6039,7 @@ note = " if (known && note) { monster_desc(m_name, m_ptr, MD_TRUE_NAME); - if (see_s) + if (see_s_msg) { msg_format("%^s%s", m_name, note); } @@ -6067,10 +6072,10 @@ msg_print(" else { /* Give detailed messages if visible or destroyed */ - if (note && is_seen(m_ptr)) msg_format("%^s%s", m_name, note); + if (note && seen_msg) msg_format("%^s%s", m_name, note); /* Hack -- Pain message */ - else if (see_s) + else if (see_s_msg) { message_pain(c_ptr->m_idx, dam); } @@ -6087,9 +6092,9 @@ msg_print(" else if (heal_leper) { #ifdef JP - if (is_seen(m_ptr)) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª"); + if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª"); #else - if (is_seen(m_ptr)) msg_print("The Mangy looking leper is healed!"); + if (seen_msg) msg_print("The Mangy looking leper is healed!"); #endif delete_monster_idx(c_ptr->m_idx); @@ -6113,7 +6118,7 @@ msg_print(" if (do_sleep) anger_monster(m_ptr); /* Give detailed messages if visible or destroyed */ - if (note && is_seen(m_ptr)) + if (note && seen_msg) #ifdef JP msg_format("%s%s", m_name, note); #else @@ -6132,7 +6137,7 @@ msg_print(" anger_monster(m_ptr); /* Take note */ - if ((fear || do_fear) && is_seen(m_ptr)) + if ((fear || do_fear) && seen) { /* Sound */ sound(SOUND_FLEE); -- 2.11.0