3 * @brief 魔法によるモンスターへの効果まとめ
9 #include "effect/effect-monster.h"
10 #include "spells-effect-util.h"
11 #include "player-damage.h"
14 #include "monster-spell.h"
16 #include "io/write-diary.h"
17 #include "main/sound-definitions-table.h"
18 #include "player-move.h"
19 #include "monster-status.h"
20 #include "player-effects.h"
21 #include "spells-diceroll.h"
22 #include "monsterrace-hook.h"
23 #include "cmd/cmd-pet.h" // 暫定、後で消すかも.
24 #include "combat/melee.h"
25 #include "core.h" // 暫定、後で消す.
26 #include "effect/effect-monster-util.h"
32 GF_SWITCH_CONTINUE = 2,
36 * @brief ビーム/ボルト/ボール系魔法によるモンスターへの効果があるかないかを判定する
37 * @param caster_ptr プレーヤーへの参照ポインタ
38 * @param em_ptr モンスター効果構造体への参照ポインタ
39 * @return 効果が何もないならFALSE、何かあるならTRUE
41 static bool is_never_effect(player_type *caster_ptr, effect_monster_type *em_ptr)
43 if (!em_ptr->g_ptr->m_idx) return FALSE;
44 if (em_ptr->who && (em_ptr->g_ptr->m_idx == em_ptr->who)) return FALSE;
45 if ((em_ptr->g_ptr->m_idx == caster_ptr->riding) &&
47 !(em_ptr->effect_type == GF_OLD_HEAL) &&
48 !(em_ptr->effect_type == GF_OLD_SPEED) &&
49 !(em_ptr->effect_type == GF_STAR_HEAL))
51 if (sukekaku && ((em_ptr->m_ptr->r_idx == MON_SUKE) || (em_ptr->m_ptr->r_idx == MON_KAKU))) return FALSE;
52 if (em_ptr->m_ptr->hp < 0) return FALSE;
60 * @brief 魔法の効果によって様々なメッセーを出力したり与えるダメージの増減を行ったりする
61 * @param em_ptr モンスター効果構造体への参照ポインタ
62 * @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE
64 static gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr)
66 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
67 switch (em_ptr->effect_type)
71 if (em_ptr->seen) em_ptr->obvious = TRUE;
76 if (em_ptr->seen) em_ptr->obvious = TRUE;
77 if (em_ptr->r_ptr->flagsr & RFR_IM_ACID)
79 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
81 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_ACID);
87 if (em_ptr->seen) em_ptr->obvious = TRUE;
88 if (em_ptr->r_ptr->flagsr & RFR_IM_ELEC)
90 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
92 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_ELEC);
98 if (em_ptr->seen) em_ptr->obvious = TRUE;
99 if (em_ptr->r_ptr->flagsr & RFR_IM_FIRE)
101 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
103 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_FIRE);
105 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_FIRE))
107 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
109 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_FIRE);
115 if (em_ptr->seen) em_ptr->obvious = TRUE;
116 if (em_ptr->r_ptr->flagsr & RFR_IM_COLD)
118 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
120 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
122 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD))
124 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
126 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
132 if (em_ptr->seen) em_ptr->obvious = TRUE;
133 if (em_ptr->r_ptr->flagsr & RFR_IM_POIS)
135 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
137 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS);
143 if (em_ptr->seen) em_ptr->obvious = TRUE;
144 if (em_ptr->r_ptr->flagsr & RFR_IM_POIS)
146 em_ptr->note = _("には耐性がある。", " resists.");
147 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
148 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS);
150 else if (one_in_(3)) em_ptr->do_polymorph = TRUE;
155 if (em_ptr->seen) em_ptr->obvious = TRUE;
156 if (em_ptr->r_ptr->flags3 & RF3_GOOD)
158 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
160 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
166 if (em_ptr->seen) em_ptr->obvious = TRUE;
167 if (em_ptr->r_ptr->flags3 & RF3_EVIL)
170 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
171 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= RF3_EVIL;
175 em_ptr->note = _("には耐性がある。", " resists.");
176 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
182 if (em_ptr->seen) em_ptr->obvious = TRUE;
187 if (em_ptr->seen) em_ptr->obvious = TRUE;
188 if (em_ptr->r_ptr->flagsr & RFR_RES_PLAS)
190 em_ptr->note = _("には耐性がある。", " resists.");
191 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
192 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_PLAS);
199 if (em_ptr->seen) em_ptr->obvious = TRUE;
200 if (em_ptr->r_ptr->flagsr & RFR_RES_NETH)
202 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD)
204 em_ptr->note = _("には完全な耐性がある!", " is immune.");
206 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
210 em_ptr->note = _("には耐性がある。", " resists.");
211 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
213 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_NETH);
215 else if (em_ptr->r_ptr->flags3 & RF3_EVIL)
217 em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
219 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
226 if (em_ptr->seen) em_ptr->obvious = TRUE;
227 if (em_ptr->r_ptr->flagsr & RFR_RES_WATE)
229 if ((em_ptr->m_ptr->r_idx == MON_WATER_ELEM) || (em_ptr->m_ptr->r_idx == MON_UNMAKER))
231 em_ptr->note = _("には完全な耐性がある!", " is immune.");
236 em_ptr->note = _("には耐性がある。", " resists.");
237 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
239 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_WATE);
246 if (em_ptr->seen) em_ptr->obvious = TRUE;
247 if (em_ptr->r_ptr->flagsr & RFR_RES_CHAO)
249 em_ptr->note = _("には耐性がある。", " resists.");
250 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
251 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_CHAO);
253 else if ((em_ptr->r_ptr->flags3 & RF3_DEMON) && one_in_(3))
255 em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
256 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
257 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
261 em_ptr->do_polymorph = TRUE;
262 em_ptr->do_conf = (5 + randint1(11) + em_ptr->r) / (em_ptr->r + 1);
269 if (em_ptr->seen) em_ptr->obvious = TRUE;
270 if (em_ptr->r_ptr->flagsr & RFR_RES_SHAR)
272 em_ptr->note = _("には耐性がある。", " resists.");
273 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
274 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR);
281 if (em_ptr->seen) em_ptr->obvious = TRUE;
282 if (em_ptr->r_ptr->flagsr & RFR_RES_SHAR)
284 em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
286 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR);
293 if (em_ptr->seen) em_ptr->obvious = TRUE;
294 if (em_ptr->r_ptr->flagsr & RFR_RES_SOUN)
296 em_ptr->note = _("には耐性がある。", " resists.");
297 em_ptr->dam *= 2; em_ptr->dam /= randint1(6) + 6;
298 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_SOUN);
301 em_ptr->do_stun = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
307 if (em_ptr->seen) em_ptr->obvious = TRUE;
308 if (em_ptr->r_ptr->flags3 & RF3_NO_CONF)
310 em_ptr->note = _("には耐性がある。", " resists.");
311 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
312 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
315 em_ptr->do_conf = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
321 if (em_ptr->seen) em_ptr->obvious = TRUE;
322 if (em_ptr->r_ptr->flagsr & RFR_RES_DISE)
324 em_ptr->note = _("には耐性がある。", " resists.");
325 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
326 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_DISE);
333 if (em_ptr->seen) em_ptr->obvious = TRUE;
334 if (em_ptr->r_ptr->flagsr & RFR_RES_NEXU)
336 em_ptr->note = _("には耐性がある。", " resists.");
337 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
338 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_NEXU);
345 if (em_ptr->seen) em_ptr->obvious = TRUE;
346 if (em_ptr->r_ptr->flagsr & RFR_RES_WALL)
348 em_ptr->note = _("には耐性がある。", " resists.");
349 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
350 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_WALL);
353 em_ptr->do_stun = (randint1(15) + em_ptr->r) / (em_ptr->r + 1);
359 if (em_ptr->seen) em_ptr->obvious = TRUE;
360 if (em_ptr->r_ptr->flagsr & RFR_RES_INER)
362 em_ptr->note = _("には耐性がある。", " resists.");
363 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
364 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_INER);
368 /* Powerful monsters can resist */
369 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
370 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
372 em_ptr->obvious = FALSE;
374 /* Normal monsters slow down */
377 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
379 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
388 if (em_ptr->seen) em_ptr->obvious = TRUE;
389 if (em_ptr->r_ptr->flagsr & RFR_RES_TIME)
391 em_ptr->note = _("には耐性がある。", " resists.");
392 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
393 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_TIME);
396 em_ptr->do_time = (em_ptr->dam + 1) / 2;
402 bool resist_tele = FALSE;
404 if (em_ptr->seen) em_ptr->obvious = TRUE;
405 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
407 if (em_ptr->r_ptr->flags1 & (RF1_UNIQUE))
409 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
410 em_ptr->note = _("には効果がなかった。", " is unaffected!");
413 else if (em_ptr->r_ptr->level > randint1(100))
415 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
416 em_ptr->note = _("には耐性がある!", " resists!");
421 if (!resist_tele) em_ptr->do_dist = 10;
422 else em_ptr->do_dist = 0;
424 if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) em_ptr->do_dist = 0;
426 if (em_ptr->r_ptr->flagsr & RFR_RES_GRAV)
428 em_ptr->note = _("には耐性がある!", " resists!");
429 em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6;
431 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_GRAV);
436 /* Powerful monsters can resist */
437 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
438 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
440 em_ptr->obvious = FALSE;
442 /* Normal monsters slow down */
445 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
447 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
452 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1;
454 /* Attempt a saving throw */
455 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
456 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
460 /* No em_ptr->obvious effect */
461 em_ptr->note = _("には効果がなかった。", " is unaffected!");
462 em_ptr->obvious = FALSE;
472 if (em_ptr->seen) em_ptr->obvious = TRUE;
475 case GF_DISINTEGRATE:
477 if (em_ptr->seen) em_ptr->obvious = TRUE;
478 if (em_ptr->r_ptr->flags3 & RF3_HURT_ROCK)
480 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK);
481 em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
482 em_ptr->note_dies = _("は蒸発した!", " evaporates!");
490 if (em_ptr->seen) em_ptr->obvious = TRUE;
491 if (!(los(caster_ptr, em_ptr->m_ptr->fy, em_ptr->m_ptr->fx, caster_ptr->y, caster_ptr->x)))
493 if (em_ptr->seen_msg)
494 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), em_ptr->m_name);
495 em_ptr->skipped = TRUE;
499 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
502 em_ptr->note = _("には完全な耐性がある!", " is immune.");
503 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
506 else if ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
507 (em_ptr->r_ptr->flags3 & RF3_ANIMAL) ||
508 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam)))
510 em_ptr->note = _("には耐性がある!", " resists!");
514 * Powerful demons & undead can turn a mindcrafter's
515 * attacks back on them
517 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
518 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
522 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
523 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
524 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
526 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
528 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
532 /* Injure +/- confusion */
533 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
534 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
535 if (one_in_(4) && !CHECK_MULTISHADOW(caster_ptr))
540 set_confused(caster_ptr, caster_ptr->confused + 3 + randint1(em_ptr->dam));
543 set_stun(caster_ptr, caster_ptr->stun + randint1(em_ptr->dam));
547 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
548 em_ptr->note = _("には効果がなかった。", " is unaffected.");
550 set_afraid(caster_ptr, caster_ptr->afraid + 3 + randint1(em_ptr->dam));
554 if (!caster_ptr->free_act)
555 (void)set_paralyzed(caster_ptr, caster_ptr->paralyzed + randint1(em_ptr->dam));
565 if ((em_ptr->dam > 0) && one_in_(4))
570 em_ptr->do_conf = 3 + randint1(em_ptr->dam);
573 em_ptr->do_stun = 3 + randint1(em_ptr->dam);
576 em_ptr->do_fear = 3 + randint1(em_ptr->dam);
579 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
580 em_ptr->do_sleep = 3 + randint1(em_ptr->dam);
585 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
590 if (em_ptr->seen) em_ptr->obvious = TRUE;
591 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
594 em_ptr->note = _("には完全な耐性がある!", " is immune.");
596 else if ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
597 (em_ptr->r_ptr->flags3 & RF3_ANIMAL) ||
598 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam)))
600 em_ptr->note = _("には耐性がある!", " resists!");
604 * Powerful demons & undead can turn a mindcrafter's
605 * attacks back on them
607 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
608 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
612 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
613 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
614 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
615 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
617 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
621 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
622 if (!CHECK_MULTISHADOW(caster_ptr))
624 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
625 caster_ptr->csp -= damroll(5, em_ptr->dam) / 2;
626 if (caster_ptr->csp < 0) caster_ptr->csp = 0;
627 caster_ptr->redraw |= PR_MANA;
628 caster_ptr->window |= (PW_SPELL);
630 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
636 else if (em_ptr->dam > 0)
638 int b = damroll(5, em_ptr->dam) / 4;
639 concptr str = (caster_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
640 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
641 (em_ptr->seen ? "You convert %s's pain into %s!" :
642 "You convert %ss pain into %s!"));
643 msg_format(msg, em_ptr->m_name, str);
645 b = MIN(caster_ptr->msp, caster_ptr->csp + b);
647 caster_ptr->redraw |= PR_MANA;
648 caster_ptr->window |= (PW_SPELL);
651 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
656 if (em_ptr->seen) em_ptr->obvious = TRUE;
659 if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) em_ptr->do_dist = 0;
660 else em_ptr->do_dist = 7;
663 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, em_ptr->dam) + 1;
664 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
665 (em_ptr->r_ptr->level > 5 + randint1(em_ptr->dam)))
668 em_ptr->obvious = FALSE;
675 if (em_ptr->seen) em_ptr->obvious = TRUE;
680 if (em_ptr->seen) em_ptr->obvious = TRUE;
685 if (!is_hostile(em_ptr->m_ptr)) break;
686 if (em_ptr->seen) em_ptr->obvious = TRUE;
687 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
688 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
689 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
691 if (em_ptr->r_ptr->flags3 & RF3_NO_CONF)
693 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
699 * Powerful demons & undead can turn a mindcrafter's
700 * attacks back on them
702 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
703 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
707 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
708 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
709 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
712 if (randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav)
714 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
718 /* Confuse, stun, terrify */
722 set_stun(caster_ptr, caster_ptr->stun + em_ptr->dam / 2);
725 set_confused(caster_ptr, caster_ptr->confused + em_ptr->dam / 2);
729 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
730 em_ptr->note = _("には効果がなかった。", " is unaffected.");
732 set_afraid(caster_ptr, caster_ptr->afraid + em_ptr->dam);
739 em_ptr->note = _("には効果がなかった。", " is unaffected.");
740 em_ptr->obvious = FALSE;
745 if (!common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
747 em_ptr->note = _("があなたに隷属した。", " is in your thrall!");
748 set_pet(caster_ptr, em_ptr->m_ptr);
755 em_ptr->do_stun = em_ptr->dam / 2;
758 em_ptr->do_conf = em_ptr->dam / 2;
761 em_ptr->do_fear = em_ptr->dam;
771 if (em_ptr->seen) em_ptr->obvious = TRUE;
772 em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1);
773 if (em_ptr->r_ptr->flagsr & RFR_IM_COLD)
775 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
777 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
779 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD))
781 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
783 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
790 if (em_ptr->seen) em_ptr->obvious = TRUE;
791 if (!monster_living(em_ptr->m_ptr->r_idx))
793 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
795 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
796 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
797 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
799 em_ptr->note = _("には効果がなかった。", " is unaffected.");
800 em_ptr->obvious = FALSE;
804 em_ptr->do_time = (em_ptr->dam + 7) / 8;
810 if (em_ptr->seen) em_ptr->obvious = TRUE;
811 if (!monster_living(em_ptr->m_ptr->r_idx))
813 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
815 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
816 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
817 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
819 em_ptr->note = _("には完全な耐性がある!", " is immune.");
820 em_ptr->obvious = FALSE;
823 else if (((em_ptr->r_ptr->flags1 & RF1_UNIQUE) &&
824 (randint1(888) != 666)) ||
825 (((em_ptr->r_ptr->level + randint1(20)) > randint1((em_ptr->caster_lev / 2) + randint1(10))) &&
826 randint1(100) != 66))
828 em_ptr->note = _("には耐性がある!", " resists!");
829 em_ptr->obvious = FALSE;
837 if (em_ptr->seen) em_ptr->obvious = TRUE;
838 em_ptr->do_polymorph = TRUE;
840 /* Powerful monsters can resist */
841 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
842 (em_ptr->r_ptr->flags1 & RF1_QUESTOR) ||
843 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
845 em_ptr->note = _("には効果がなかった。", " is unaffected.");
846 em_ptr->do_polymorph = FALSE;
847 em_ptr->obvious = FALSE;
855 if (em_ptr->seen) em_ptr->obvious = TRUE;
857 if ((floor_ptr->inside_arena) || is_pet(em_ptr->m_ptr) || (em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (em_ptr->r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
859 em_ptr->note = _("には効果がなかった。", " is unaffected.");
863 em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
864 if (multiply_monster(caster_ptr, em_ptr->g_ptr->m_idx, TRUE, 0L))
866 em_ptr->note = _("が分裂した!", " spawns!");
875 if (em_ptr->seen) em_ptr->obvious = TRUE;
877 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
879 if (em_ptr->m_ptr->maxhp < em_ptr->m_ptr->max_maxhp)
881 if (em_ptr->seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), em_ptr->m_name, em_ptr->m_poss);
882 em_ptr->m_ptr->maxhp = em_ptr->m_ptr->max_maxhp;
887 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
888 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
895 if (em_ptr->seen) em_ptr->obvious = TRUE;
898 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
899 if (MON_STUNNED(em_ptr->m_ptr))
901 if (em_ptr->seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), em_ptr->m_name);
902 (void)set_monster_stunned(caster_ptr, em_ptr->g_ptr->m_idx, 0);
904 if (MON_CONFUSED(em_ptr->m_ptr))
906 if (em_ptr->seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), em_ptr->m_name);
907 (void)set_monster_confused(caster_ptr, em_ptr->g_ptr->m_idx, 0);
909 if (MON_MONFEAR(em_ptr->m_ptr))
911 if (em_ptr->seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), em_ptr->m_name, em_ptr->m_poss);
912 (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, 0);
915 if (em_ptr->m_ptr->hp < 30000) em_ptr->m_ptr->hp += em_ptr->dam;
916 if (em_ptr->m_ptr->hp > em_ptr->m_ptr->maxhp) em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
920 chg_virtue(caster_ptr, V_VITALITY, 1);
922 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
923 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
925 if (is_friendly(em_ptr->m_ptr))
926 chg_virtue(caster_ptr, V_HONOUR, 1);
927 else if (!(em_ptr->r_ptr->flags3 & RF3_EVIL))
929 if (em_ptr->r_ptr->flags3 & RF3_GOOD)
930 chg_virtue(caster_ptr, V_COMPASSION, 2);
932 chg_virtue(caster_ptr, V_COMPASSION, 1);
935 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
936 chg_virtue(caster_ptr, V_NATURE, 1);
939 if (em_ptr->m_ptr->r_idx == MON_LEPER)
941 em_ptr->heal_leper = TRUE;
942 if (!em_ptr->who) chg_virtue(caster_ptr, V_COMPASSION, 5);
945 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
946 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
948 em_ptr->note = _("は体力を回復したようだ。", " looks healthier.");
955 if (em_ptr->seen) em_ptr->obvious = TRUE;
957 if (set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100))
959 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
964 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
965 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
966 if (is_friendly(em_ptr->m_ptr))
967 chg_virtue(caster_ptr, V_HONOUR, 1);
975 if (em_ptr->seen) em_ptr->obvious = TRUE;
977 /* Powerful monsters can resist */
978 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
979 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
981 em_ptr->note = _("には効果がなかった。", " is unaffected.");
982 em_ptr->obvious = FALSE;
986 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
988 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
997 if (em_ptr->seen) em_ptr->obvious = TRUE;
999 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1000 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
1001 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1003 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
1005 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
1008 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1009 em_ptr->obvious = FALSE;
1013 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
1014 em_ptr->do_sleep = 500;
1020 case GF_STASIS_EVIL:
1022 if (em_ptr->seen) em_ptr->obvious = TRUE;
1024 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1025 !(em_ptr->r_ptr->flags3 & RF3_EVIL) ||
1026 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1028 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1029 em_ptr->obvious = FALSE;
1033 em_ptr->note = _("は動けなくなった!", " is suspended!");
1034 em_ptr->do_sleep = 500;
1042 if (em_ptr->seen) em_ptr->obvious = TRUE;
1044 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1045 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1047 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1048 em_ptr->obvious = FALSE;
1052 em_ptr->note = _("は動けなくなった!", " is suspended!");
1053 em_ptr->do_sleep = 500;
1062 vir = virtue_number(caster_ptr, V_HARMONY);
1065 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
1068 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
1071 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
1074 if (em_ptr->seen) em_ptr->obvious = TRUE;
1076 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
1078 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1079 em_ptr->obvious = FALSE;
1081 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1083 else if (caster_ptr->cursed & TRC_AGGRAVATE)
1085 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
1086 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1090 em_ptr->note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
1091 set_pet(caster_ptr, em_ptr->m_ptr);
1093 chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
1094 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
1095 chg_virtue(caster_ptr, V_NATURE, 1);
1101 case GF_CONTROL_UNDEAD:
1104 if (em_ptr->seen) em_ptr->obvious = TRUE;
1106 vir = virtue_number(caster_ptr, V_UNLIFE);
1109 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
1112 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
1115 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
1118 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
1119 !(em_ptr->r_ptr->flags3 & RF3_UNDEAD))
1121 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1122 em_ptr->obvious = FALSE;
1123 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1125 else if (caster_ptr->cursed & TRC_AGGRAVATE)
1127 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
1128 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1132 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
1133 set_pet(caster_ptr, em_ptr->m_ptr);
1139 case GF_CONTROL_DEMON:
1142 if (em_ptr->seen) em_ptr->obvious = TRUE;
1144 vir = virtue_number(caster_ptr, V_UNLIFE);
1147 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
1150 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
1153 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
1156 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
1157 !(em_ptr->r_ptr->flags3 & RF3_DEMON))
1159 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1160 em_ptr->obvious = FALSE;
1161 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1163 else if (caster_ptr->cursed & TRC_AGGRAVATE)
1165 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
1166 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1170 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
1171 set_pet(caster_ptr, em_ptr->m_ptr);
1177 case GF_CONTROL_ANIMAL:
1180 if (em_ptr->seen) em_ptr->obvious = TRUE;
1182 vir = virtue_number(caster_ptr, V_NATURE);
1185 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
1188 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
1191 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
1194 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
1195 !(em_ptr->r_ptr->flags3 & RF3_ANIMAL))
1197 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1198 em_ptr->obvious = FALSE;
1199 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1201 else if (caster_ptr->cursed & TRC_AGGRAVATE)
1203 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
1204 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1208 em_ptr->note = _("はなついた。", " is tamed!");
1209 set_pet(caster_ptr, em_ptr->m_ptr);
1210 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
1211 chg_virtue(caster_ptr, V_NATURE, 1);
1217 case GF_CHARM_LIVING:
1221 vir = virtue_number(caster_ptr, V_UNLIFE);
1222 if (em_ptr->seen) em_ptr->obvious = TRUE;
1224 vir = virtue_number(caster_ptr, V_UNLIFE);
1227 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 10;
1230 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
1233 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
1236 msg_format(_("%sを見つめた。", "You stare into %s."), em_ptr->m_name);
1238 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
1239 !monster_living(em_ptr->m_ptr->r_idx))
1241 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1242 em_ptr->obvious = FALSE;
1243 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1245 else if (caster_ptr->cursed & TRC_AGGRAVATE)
1247 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
1248 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1252 em_ptr->note = _("を支配した。", " is tamed!");
1253 set_pet(caster_ptr, em_ptr->m_ptr);
1254 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
1255 chg_virtue(caster_ptr, V_NATURE, 1);
1263 if (em_ptr->seen) em_ptr->obvious = TRUE;
1265 em_ptr->do_conf = damroll(3, (em_ptr->dam / 2)) + 1;
1266 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1267 (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) ||
1268 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1270 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1272 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1275 em_ptr->do_conf = 0;
1276 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1277 em_ptr->obvious = FALSE;
1285 if (em_ptr->seen) em_ptr->obvious = TRUE;
1287 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1;
1288 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1289 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1291 em_ptr->do_stun = 0;
1292 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1293 em_ptr->obvious = FALSE;
1303 em_ptr->skipped = TRUE;
1307 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
1309 if (em_ptr->seen) em_ptr->obvious = TRUE;
1311 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
1313 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
1314 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
1325 if (em_ptr->seen) em_ptr->obvious = TRUE;
1327 if (em_ptr->r_ptr->flagsr & RFR_RES_LITE)
1329 em_ptr->note = _("には耐性がある!", " resists!");
1330 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
1331 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_LITE);
1333 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
1335 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
1336 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
1337 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
1344 if (em_ptr->seen) em_ptr->obvious = TRUE;
1346 if (em_ptr->r_ptr->flagsr & RFR_RES_DARK)
1348 em_ptr->note = _("には耐性がある!", " resists!");
1349 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
1350 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_DARK);
1357 if (em_ptr->r_ptr->flags3 & (RF3_HURT_ROCK))
1359 if (em_ptr->seen) em_ptr->obvious = TRUE;
1361 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1363 em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
1364 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1373 case GF_AWAY_UNDEAD:
1375 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1377 bool resists_tele = FALSE;
1379 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1381 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1383 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1384 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1385 resists_tele = TRUE;
1387 else if (em_ptr->r_ptr->level > randint1(100))
1389 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1390 em_ptr->note = _("には耐性がある!", " resists!");
1391 resists_tele = TRUE;
1397 if (em_ptr->seen) em_ptr->obvious = TRUE;
1398 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1399 em_ptr->do_dist = em_ptr->dam;
1404 em_ptr->skipped = TRUE;
1412 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1414 bool resists_tele = FALSE;
1416 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1418 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1420 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1421 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1422 resists_tele = TRUE;
1424 else if (em_ptr->r_ptr->level > randint1(100))
1426 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1427 em_ptr->note = _("には耐性がある!", " resists!");
1428 resists_tele = TRUE;
1434 if (em_ptr->seen) em_ptr->obvious = TRUE;
1435 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1436 em_ptr->do_dist = em_ptr->dam;
1441 em_ptr->skipped = TRUE;
1449 bool resists_tele = FALSE;
1450 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1452 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1454 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1455 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1456 resists_tele = TRUE;
1458 else if (em_ptr->r_ptr->level > randint1(100))
1460 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1461 em_ptr->note = _("には耐性がある!", " resists!");
1462 resists_tele = TRUE;
1468 if (em_ptr->seen) em_ptr->obvious = TRUE;
1470 em_ptr->do_dist = em_ptr->dam;
1476 case GF_TURN_UNDEAD:
1478 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1480 if (em_ptr->seen) em_ptr->obvious = TRUE;
1482 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1484 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1485 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1487 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1488 em_ptr->obvious = FALSE;
1489 em_ptr->do_fear = 0;
1494 em_ptr->skipped = TRUE;
1502 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1504 if (em_ptr->seen) em_ptr->obvious = TRUE;
1506 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1508 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1509 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1511 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1512 em_ptr->obvious = FALSE;
1513 em_ptr->do_fear = 0;
1518 em_ptr->skipped = TRUE;
1526 if (em_ptr->seen) em_ptr->obvious = TRUE;
1528 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1529 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1530 (em_ptr->r_ptr->flags3 & (RF3_NO_FEAR)) ||
1531 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1533 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1534 em_ptr->obvious = FALSE;
1535 em_ptr->do_fear = 0;
1541 case GF_DISP_UNDEAD:
1543 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1545 if (em_ptr->seen) em_ptr->obvious = TRUE;
1547 /* Learn about em_ptr->effect_type */
1548 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1550 em_ptr->note = _("は身震いした。", " shudders.");
1551 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1555 em_ptr->skipped = TRUE;
1563 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1565 if (em_ptr->seen) em_ptr->obvious = TRUE;
1567 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1569 em_ptr->note = _("は身震いした。", " shudders.");
1570 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1574 em_ptr->skipped = TRUE;
1582 if (em_ptr->r_ptr->flags3 & (RF3_GOOD))
1584 if (em_ptr->seen) em_ptr->obvious = TRUE;
1586 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
1588 em_ptr->note = _("は身震いした。", " shudders.");
1589 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1593 em_ptr->skipped = TRUE;
1599 case GF_DISP_LIVING:
1601 if (monster_living(em_ptr->m_ptr->r_idx))
1603 if (em_ptr->seen) em_ptr->obvious = TRUE;
1605 em_ptr->note = _("は身震いした。", " shudders.");
1606 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1610 em_ptr->skipped = TRUE;
1618 if (em_ptr->r_ptr->flags3 & (RF3_DEMON))
1620 if (em_ptr->seen) em_ptr->obvious = TRUE;
1622 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
1624 em_ptr->note = _("は身震いした。", " shudders.");
1625 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1629 em_ptr->skipped = TRUE;
1637 if (em_ptr->seen) em_ptr->obvious = TRUE;
1638 em_ptr->note = _("は身震いした。", " shudders.");
1639 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1644 if (em_ptr->seen) em_ptr->obvious = TRUE;
1645 if ((em_ptr->r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (em_ptr->r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (em_ptr->r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
1647 if (em_ptr->who > 0)
1649 if (em_ptr->m_caster_ptr->hp < em_ptr->m_caster_ptr->maxhp)
1651 em_ptr->m_caster_ptr->hp += em_ptr->dam;
1652 if (em_ptr->m_caster_ptr->hp > em_ptr->m_caster_ptr->maxhp) em_ptr->m_caster_ptr->hp = em_ptr->m_caster_ptr->maxhp;
1653 if (caster_ptr->health_who == em_ptr->who) caster_ptr->redraw |= (PR_HEALTH);
1654 if (caster_ptr->riding == em_ptr->who) caster_ptr->redraw |= (PR_UHEALTH);
1656 if (em_ptr->see_s_msg)
1658 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_caster_ptr, 0);
1659 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), em_ptr->killer);
1665 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), em_ptr->m_name);
1666 (void)hp_player(caster_ptr, em_ptr->dam);
1671 if (em_ptr->see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1679 if (em_ptr->seen) em_ptr->obvious = TRUE;
1680 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1682 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1683 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1684 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1686 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1688 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1691 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1694 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1696 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1697 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1700 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1702 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1703 em_ptr->note = _("には耐性がある。", " resists.");
1708 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1709 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1711 if (em_ptr->who > 0) em_ptr->do_conf = randint0(4) + 4;
1712 else em_ptr->do_conf = randint0(8) + 8;
1717 case GF_BRAIN_SMASH:
1719 if (em_ptr->seen) em_ptr->obvious = TRUE;
1720 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1722 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1723 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1724 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1726 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1728 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1731 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1734 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1736 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1737 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1740 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1742 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1743 em_ptr->note = _("には耐性がある!", " resists!");
1748 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1749 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1750 if (em_ptr->who > 0)
1752 em_ptr->do_conf = randint0(4) + 4;
1753 em_ptr->do_stun = randint0(4) + 4;
1757 em_ptr->do_conf = randint0(8) + 8;
1758 em_ptr->do_stun = randint0(8) + 8;
1760 (void)set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 10);
1767 if (em_ptr->seen) em_ptr->obvious = TRUE;
1768 if (!em_ptr->who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), em_ptr->m_name);
1769 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1771 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1779 if (em_ptr->seen) em_ptr->obvious = TRUE;
1780 if (!em_ptr->who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), em_ptr->m_name);
1782 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1784 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1792 if (em_ptr->seen) em_ptr->obvious = TRUE;
1793 if (!em_ptr->who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), em_ptr->m_name);
1795 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1797 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1805 if (em_ptr->seen) em_ptr->obvious = TRUE;
1807 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
1808 "You point at %s, screaming the word, 'DIE!'."), em_ptr->m_name);
1810 if ((randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35)) && ((em_ptr->who <= 0) || (em_ptr->m_caster_ptr->r_idx != MON_KENSHIROU)))
1812 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1819 if (em_ptr->seen) em_ptr->obvious = TRUE;
1820 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
1822 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1827 if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20))) :
1828 (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200))))
1830 em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
1832 if (em_ptr->m_ptr->hp < em_ptr->dam) em_ptr->dam = em_ptr->m_ptr->hp - 1;
1836 /* todo 乱数で破滅のを弾いた結果が「耐性を持っている」ことになるのはおかしい */
1837 em_ptr->note = _("は耐性を持っている!", "resists!");
1847 if ((floor_ptr->inside_quest && (quest[floor_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(em_ptr->m_ptr)) ||
1848 (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flags7 & (RF7_NAZGUL)) || (em_ptr->r_ptr->flags7 & (RF7_UNIQUE2)) || (em_ptr->r_ptr->flags1 & RF1_QUESTOR) || em_ptr->m_ptr->parent_m_idx)
1850 msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1851 em_ptr->skipped = TRUE;
1855 if (is_pet(em_ptr->m_ptr)) nokori_hp = em_ptr->m_ptr->maxhp * 4L;
1856 else if ((caster_ptr->pclass == CLASS_BEASTMASTER) && monster_living(em_ptr->m_ptr->r_idx))
1857 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 10;
1859 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 20;
1861 if (em_ptr->m_ptr->hp >= nokori_hp)
1863 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), em_ptr->m_name);
1864 em_ptr->skipped = TRUE;
1866 else if (em_ptr->m_ptr->hp < randint0(nokori_hp))
1868 if (em_ptr->m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(caster_ptr, em_ptr->g_ptr->m_idx, FALSE, MON_CHAMELEON);
1869 msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
1870 cap_mon = em_ptr->m_ptr->r_idx;
1871 cap_mspeed = em_ptr->m_ptr->mspeed;
1872 cap_hp = em_ptr->m_ptr->hp;
1873 cap_maxhp = em_ptr->m_ptr->max_maxhp;
1874 cap_nickname = em_ptr->m_ptr->nickname;
1875 if (em_ptr->g_ptr->m_idx == caster_ptr->riding)
1877 if (rakuba(caster_ptr, -1, FALSE))
1879 msg_format(_("地面に落とされた。", "You have fallen from %s."), em_ptr->m_name);
1883 delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
1885 return GF_SWITCH_TRUE;
1889 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), em_ptr->m_name);
1890 em_ptr->skipped = TRUE;
1897 return (gf_switch_result)py_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
1904 if (em_ptr->seen) em_ptr->obvious = TRUE;
1905 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1907 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1909 em_ptr->skipped = TRUE;
1910 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1913 if (MON_CSLEEP(em_ptr->m_ptr))
1915 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1917 em_ptr->skipped = TRUE;
1921 if (one_in_(5)) effect = 1;
1922 else if (one_in_(4)) effect = 2;
1923 else if (one_in_(3)) effect = 3;
1928 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1929 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1931 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1932 em_ptr->obvious = FALSE;
1936 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
1938 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
1942 else if (effect == 2)
1944 em_ptr->do_stun = damroll((caster_ptr->lev / 10) + 3, (em_ptr->dam)) + 1;
1945 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1946 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1948 em_ptr->do_stun = 0;
1949 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1950 em_ptr->obvious = FALSE;
1953 else if (effect == 3)
1955 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1956 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
1957 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1959 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
1961 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
1964 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1965 em_ptr->obvious = FALSE;
1969 /* Go to sleep (much) later */
1970 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
1971 em_ptr->do_sleep = 500;
1977 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1985 if (em_ptr->seen) em_ptr->obvious = TRUE;
1986 if (genocide_aux(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, !em_ptr->who, (em_ptr->r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
1988 if (em_ptr->seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), em_ptr->m_name);
1989 chg_virtue(caster_ptr, V_VITALITY, -1);
1990 return GF_SWITCH_TRUE;
1993 em_ptr->skipped = TRUE;
1999 msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
2001 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
2003 if (em_ptr->seen) em_ptr->obvious = TRUE;
2005 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
2007 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
2008 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2015 em_ptr->photo = em_ptr->m_ptr->r_idx;
2018 case GF_BLOOD_CURSE:
2020 if (em_ptr->seen) em_ptr->obvious = TRUE;
2025 bool success = FALSE;
2026 if (em_ptr->seen) em_ptr->obvious = TRUE;
2028 if ((em_ptr->r_ptr->flags3 & (RF3_GOOD)) && !floor_ptr->inside_arena)
2030 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) em_ptr->dam -= 50;
2031 if (em_ptr->dam < 1) em_ptr->dam = 1;
2033 if (is_pet(em_ptr->m_ptr))
2035 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
2036 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
2039 else if ((em_ptr->r_ptr->flags1 & (RF1_QUESTOR)) ||
2040 (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
2041 (em_ptr->m_ptr->mflag2 & MFLAG2_NOPET) ||
2042 (caster_ptr->cursed & TRC_AGGRAVATE) ||
2043 ((em_ptr->r_ptr->level + 10) > randint1(em_ptr->dam)))
2045 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
2049 em_ptr->note = _("を支配した。", " is tamed!");
2050 set_pet(caster_ptr, em_ptr->m_ptr);
2051 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
2053 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
2060 if (!(em_ptr->r_ptr->flags3 & RF3_NO_FEAR))
2062 em_ptr->do_fear = randint1(90) + 10;
2064 else if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
2065 em_ptr->r_ptr->r_flags3 |= (RF3_NO_FEAR);
2073 if (em_ptr->seen) em_ptr->obvious = TRUE;
2075 if (randint0(100 + em_ptr->dam) < (em_ptr->r_ptr->level + 50))
2077 em_ptr->note = _("には効果がなかった。", " is unaffected.");
2084 em_ptr->skipped = TRUE;
2090 return GF_SWITCH_CONTINUE;
2095 * @brief 完全な耐性を持っていたら、モンスターへの効果処理をスキップする
2096 * @param caster_ptr プレーヤーへの参照ポインタ
2097 * @param em_ptr モンスター効果構造体への参照ポインタ
2098 * @return 完全耐性ならCONTINUE、そうでないなら効果処理の結果
2100 static gf_switch_result process_monster_perfect_resistance(player_type *caster_ptr, effect_monster_type *em_ptr)
2102 if (((em_ptr->r_ptr->flagsr & RFR_RES_ALL) == 0) ||
2103 em_ptr->effect_type == GF_OLD_CLONE ||
2104 em_ptr->effect_type == GF_STAR_HEAL ||
2105 em_ptr->effect_type == GF_OLD_HEAL ||
2106 em_ptr->effect_type == GF_OLD_SPEED ||
2107 em_ptr->effect_type == GF_CAPTURE ||
2108 em_ptr->effect_type == GF_PHOTO)
2109 return switch_effects_monster(caster_ptr, em_ptr);
2111 em_ptr->note = _("には完全な耐性がある!", " is immune.");
2113 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
2114 em_ptr->r_ptr->r_flagsr |= (RFR_RES_ALL);
2116 if (em_ptr->effect_type == GF_LITE_WEAK || em_ptr->effect_type == GF_KILL_WALL)
2117 em_ptr->skipped = TRUE;
2119 return GF_SWITCH_CONTINUE;
2124 * @brief ペットの死亡を処理する
2125 * @param caster_ptr プレーヤーへの参照ポインタ
2126 * @param em_ptr モンスター効果構造体への参照ポインタ
2129 static void process_pet_death(player_type *caster_ptr, effect_monster_type *em_ptr)
2131 bool sad = is_pet(em_ptr->m_ptr) && !(em_ptr->m_ptr->ml);
2132 if (em_ptr->known && em_ptr->note)
2134 monster_desc(caster_ptr, em_ptr->m_name, em_ptr->m_ptr, MD_TRUE_NAME);
2135 if (em_ptr->see_s_msg) msg_format("%^s%s", em_ptr->m_name, em_ptr->note);
2136 else caster_ptr->current_floor_ptr->monster_noise = TRUE;
2139 if (em_ptr->who > 0) monster_gain_exp(caster_ptr, em_ptr->who, em_ptr->m_ptr->r_idx);
2141 monster_death(caster_ptr, em_ptr->g_ptr->m_idx, FALSE);
2142 delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
2143 if (sad) msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
2148 * @brief モンスターの睡眠を処理する
2149 * @param caster_ptr プレーヤーへの参照ポインタ
2150 * @param em_ptr モンスター効果構造体への参照ポインタ
2153 static void process_monster_sleep(player_type *caster_ptr, effect_monster_type *em_ptr)
2155 if (em_ptr->note && em_ptr->seen_msg)
2156 msg_format("%^s%s", em_ptr->m_name, em_ptr->note);
2157 else if (em_ptr->see_s_msg)
2158 message_pain(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam);
2160 caster_ptr->current_floor_ptr->monster_noise = TRUE;
2162 if (em_ptr->do_sleep) (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_sleep);
2167 * @brief モンスターの被ダメージを処理する / If another monster did the damage, hurt the monster by hand
2168 * @param caster_ptr プレーヤーへの参照ポインタ
2169 * @param em_ptr モンスター効果構造体への参照ポインタ
2170 * @return モンスターIDがプレーヤー自身だった場合FALSE、モンスターだった場合TRUE
2172 static bool process_monster_damage(player_type *caster_ptr, effect_monster_type *em_ptr)
2174 if (em_ptr->who <= 0) return FALSE;
2176 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
2177 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
2179 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
2180 em_ptr->m_ptr->hp -= em_ptr->dam;
2181 if (em_ptr->m_ptr->hp < 0) process_pet_death(caster_ptr, em_ptr);
2182 else process_monster_sleep(caster_ptr, em_ptr);
2190 * @param caster_ptr プレーヤーへの参照ポインタ
2191 * @param em_ptr モンスター効果構造体への参照ポインタ
2192 * @return 大賞モンスターが不潔な病人だった場合はTRUE、それ以外はFALSE
2194 static bool heal_leaper(player_type *caster_ptr, effect_monster_type *em_ptr)
2196 if (!em_ptr->heal_leper) return FALSE;
2198 if (em_ptr->seen_msg)
2199 msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
2201 if (record_named_pet && is_pet(em_ptr->m_ptr) && em_ptr->m_ptr->nickname)
2203 char m2_name[MAX_NLEN];
2204 monster_desc(caster_ptr, m2_name, em_ptr->m_ptr, MD_INDEF_VISIBLE);
2205 exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
2208 delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
2214 * @brief モンスターの恐慌処理 / If the player did it, give him experience, check fear
2215 * @param caster_ptr プレーヤーへの参照ポインタ
2216 * @param em_ptr モンスター効果構造体への参照ポインタ
2217 * @return モンスターが死んだらTRUE、生きていたらFALSE
2219 static bool process_monster_fear(player_type *caster_ptr, effect_monster_type *em_ptr)
2222 if (mon_take_hit(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, &fear, em_ptr->note_dies))
2225 if (em_ptr->do_sleep)
2226 anger_monster(caster_ptr, em_ptr->m_ptr);
2228 if (em_ptr->note && em_ptr->seen_msg)
2229 msg_format(_("%s%s", "%^s%s"), em_ptr->m_name, em_ptr->note);
2230 else if (em_ptr->known && (em_ptr->dam || !em_ptr->do_fear))
2231 message_pain(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam);
2233 if (((em_ptr->dam > 0) || em_ptr->get_angry) && !em_ptr->do_sleep)
2234 anger_monster(caster_ptr, em_ptr->m_ptr);
2236 if ((fear || em_ptr->do_fear) && em_ptr->seen)
2239 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), em_ptr->m_name);
2247 * todo 睡眠処理があるので、死に際とは言えない。適切な関数名に要修正
2248 * @brief モンスターの死に際処理 (魔力吸収を除く)
2249 * @param caster_ptr プレーヤーへの参照ポインタ
2250 * @param em_ptr モンスター効果構造体への参照ポインタ
2253 static void process_monster_last_moment(player_type *caster_ptr, effect_monster_type *em_ptr)
2255 if (em_ptr->effect_type == GF_DRAIN_MANA) return;
2257 if (process_monster_damage(caster_ptr, em_ptr)) return;
2258 if (heal_leaper(caster_ptr, em_ptr)) return;
2259 if (process_monster_fear(caster_ptr, em_ptr)) return;
2261 if (em_ptr->do_sleep) (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_sleep);
2266 * @brief 魔法の効果による汎用処理 (変身の有無、現在HPの減算、徳の変化)
2267 * @param caster_ptr プレーヤーへの参照ポインタ
2268 * @param em_ptr モンスター効果構造体への参照ポインタ
2271 static void process_spell_result(player_type *caster_ptr, effect_monster_type *em_ptr)
2273 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
2274 (em_ptr->r_ptr->flags1 & RF1_QUESTOR) ||
2275 (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)))
2276 em_ptr->do_polymorph = FALSE;
2278 if (((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (em_ptr->r_ptr->flags7 & RF7_NAZGUL)) &&
2279 !caster_ptr->phase_out &&
2280 (em_ptr->who > 0) &&
2281 (em_ptr->dam > em_ptr->m_ptr->hp))
2282 em_ptr->dam = em_ptr->m_ptr->hp;
2284 if ((em_ptr->who > 0) || !em_ptr->slept) return;
2286 if (!(em_ptr->r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(caster_ptr, V_COMPASSION, -1);
2287 if (!(em_ptr->r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(caster_ptr, V_HONOUR, -1);
2292 * @brief モンスターの朦朧値を蓄積させる
2293 * @param caster_ptr プレーヤーへの参照ポインタ
2294 * @param em_ptr モンスター効果構造体への参照ポインタ
2295 * @param stun_damage 朦朧値
2298 static void pile_monster_stun(player_type *caster_ptr, effect_monster_type *em_ptr, int *stun_damage)
2300 if ((em_ptr->do_stun == 0) ||
2301 (em_ptr->r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) ||
2302 (em_ptr->r_ptr->flags3 & RF3_NO_STUN))
2305 if (em_ptr->seen) em_ptr->obvious = TRUE;
2307 if (MON_STUNNED(em_ptr->m_ptr))
2309 em_ptr->note = _("はひどくもうろうとした。", " is more dazed.");
2310 *stun_damage = MON_STUNNED(em_ptr->m_ptr) + (em_ptr->do_stun / 2);
2314 em_ptr->note = _("はもうろうとした。", " is dazed.");
2315 *stun_damage = em_ptr->do_stun;
2318 (void)set_monster_stunned(caster_ptr, em_ptr->g_ptr->m_idx, *stun_damage);
2319 em_ptr->get_angry = TRUE;
2324 * @brief モンスターの混乱値を蓄積させる
2325 * @param caster_ptr プレーヤーへの参照ポインタ
2326 * @param em_ptr モンスター効果構造体への参照ポインタ
2327 * @param stun_damage 混乱値
2330 static void pile_monster_conf(player_type *caster_ptr, effect_monster_type *em_ptr, int *conf_damage)
2332 if ((em_ptr->do_conf == 0) ||
2333 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
2334 (em_ptr->r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
2337 if (em_ptr->seen) em_ptr->obvious = TRUE;
2339 if (MON_CONFUSED(em_ptr->m_ptr))
2341 em_ptr->note = _("はさらに混乱したようだ。", " looks more confused.");
2342 *conf_damage = MON_CONFUSED(em_ptr->m_ptr) + (em_ptr->do_conf / 2);
2346 em_ptr->note = _("は混乱したようだ。", " looks confused.");
2347 *conf_damage = em_ptr->do_conf;
2350 (void)set_monster_confused(caster_ptr, em_ptr->g_ptr->m_idx, *conf_damage);
2351 em_ptr->get_angry = TRUE;
2356 * @brief モンスターを衰弱させる
2357 * @param em_ptr モンスター効果構造体への参照ポインタ
2360 static void process_monster_weakening(effect_monster_type *em_ptr)
2362 if (em_ptr->do_time == 0) return;
2364 if (em_ptr->seen) em_ptr->obvious = TRUE;
2366 if (em_ptr->do_time >= em_ptr->m_ptr->maxhp) em_ptr->do_time = em_ptr->m_ptr->maxhp - 1;
2368 if (em_ptr->do_time)
2370 em_ptr->note = _("は弱くなったようだ。", " seems weakened.");
2371 em_ptr->m_ptr->maxhp -= em_ptr->do_time;
2372 if ((em_ptr->m_ptr->hp - em_ptr->dam) > em_ptr->m_ptr->maxhp) em_ptr->dam = em_ptr->m_ptr->hp - em_ptr->m_ptr->maxhp;
2375 em_ptr->get_angry = TRUE;
2380 * @brief モンスターを変身させる
2381 * @param caster_ptr プレーヤーへの参照ポインタ
2382 * @param em_ptr モンスター効果構造体への参照ポインタ
2385 static void process_monster_polymorph(player_type *caster_ptr, effect_monster_type *em_ptr)
2387 if (!em_ptr->do_polymorph || (randint1(90) <= em_ptr->r_ptr->level))
2390 if (polymorph_monster(caster_ptr, em_ptr->y, em_ptr->x))
2392 if (em_ptr->seen) em_ptr->obvious = TRUE;
2394 em_ptr->note = _("が変身した!", " changes!");
2398 em_ptr->m_ptr = &caster_ptr->current_floor_ptr->m_list[em_ptr->g_ptr->m_idx];
2399 em_ptr->r_ptr = &r_info[em_ptr->m_ptr->r_idx];
2404 * @brief モンスターをテレポートさせる
2405 * @param caster_ptr プレーヤーへの参照ポインタ
2406 * @param em_ptr モンスター効果構造体への参照ポインタ
2409 static void process_monster_teleport(player_type *caster_ptr, effect_monster_type *em_ptr)
2411 if (em_ptr->do_dist == 0) return;
2413 if (em_ptr->seen) em_ptr->obvious = TRUE;
2415 em_ptr->note = _("が消え去った!", " disappears!");
2417 if (!em_ptr->who) chg_virtue(caster_ptr, V_VALOUR, -1);
2419 teleport_away(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_dist,
2420 (!em_ptr->who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
2422 em_ptr->y = em_ptr->m_ptr->fy;
2423 em_ptr->x = em_ptr->m_ptr->fx;
2424 em_ptr->g_ptr = &caster_ptr->current_floor_ptr->grid_array[em_ptr->y][em_ptr->x];
2429 * @brief モンスターの異常状態を処理する
2430 * @param caster_ptr プレーヤーへの参照ポインタ
2431 * @param em_ptr モンスター効果構造体への参照ポインタ
2432 * @parama tmp_damage 朦朧/混乱値
2435 static void process_monster_bad_status(player_type *caster_ptr, effect_monster_type *em_ptr, int *tmp_damage)
2437 pile_monster_stun(caster_ptr, em_ptr, tmp_damage);
2438 pile_monster_conf(caster_ptr, em_ptr, tmp_damage);
2439 process_monster_weakening(em_ptr);
2440 process_monster_polymorph(caster_ptr, em_ptr);
2441 process_monster_teleport(caster_ptr, em_ptr);
2442 if (em_ptr->do_fear == 0) return;
2444 (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, MON_MONFEAR(em_ptr->m_ptr) + em_ptr->do_fear);
2445 em_ptr->get_angry = TRUE;
2450 * @brief モンスター闘技場にいる場合の画面更新処理
2451 * @param caster_ptr プレーヤーへの参照ポインタ
2452 * @param em_ptr モンスター効果構造体への参照ポインタ
2455 static void update_phase_out_stat(player_type *caster_ptr, effect_monster_type *em_ptr)
2457 if (!caster_ptr->phase_out) return;
2459 caster_ptr->health_who = em_ptr->g_ptr->m_idx;
2460 caster_ptr->redraw |= (PR_HEALTH);
2461 handle_stuff(caster_ptr);
2466 * @brief 魔法効果がペットに及んだ時の処理
2467 * @param caster_ptr プレーヤーへの参照ポインタ
2468 * @param em_ptr モンスター効果構造体への参照ポインタ
2471 static void process_spell_result_pet(player_type *caster_ptr, effect_monster_type *em_ptr)
2473 if ((em_ptr->dam <= 0) || is_pet(em_ptr->m_ptr) || is_friendly(em_ptr->m_ptr))
2476 if (em_ptr->who == 0)
2478 if (!(em_ptr->flag & PROJECT_NO_HANGEKI))
2479 set_target(em_ptr->m_ptr, monster_target_y, monster_target_x);
2484 if ((em_ptr->who > 0) &&
2485 is_pet(em_ptr->m_caster_ptr) &&
2486 !player_bold(caster_ptr, em_ptr->m_ptr->target_y, em_ptr->m_ptr->target_x))
2487 set_target(em_ptr->m_ptr, em_ptr->m_caster_ptr->fy, em_ptr->m_caster_ptr->fx);
2492 * @brief 魔法効果が騎乗モンスターに及んだ時の処理
2493 * @param caster_ptr プレーヤーへの参照ポインタ
2494 * @param em_ptr モンスター効果構造体への参照ポインタ
2497 static void process_spell_result_riding(player_type *caster_ptr, effect_monster_type *em_ptr)
2499 if (!caster_ptr->riding || (caster_ptr->riding != em_ptr->g_ptr->m_idx) || (em_ptr->dam <= 0))
2502 if (em_ptr->m_ptr->hp > (em_ptr->m_ptr->maxhp / 3))
2503 em_ptr->dam = (em_ptr->dam + 1) / 2;
2505 rakubadam_m = (em_ptr->dam > 200) ? 200 : em_ptr->dam;
2510 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
2511 * @param caster_ptr プレーヤーへの参照ポインタ
2512 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
2513 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
2514 * @param y 目標y座標 / Target y location (or location to travel "towards")
2515 * @param x 目標x座標 / Target x location (or location to travel "towards")
2516 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
2517 * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects)
2519 * @param see_s_msg TRUEならばメッセージを表示する
2520 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
2522 bool affect_monster(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
2524 effect_monster_type tmp_effect;
2525 effect_monster_type *em_ptr = &tmp_effect;
2526 initialize_effect_monster(caster_ptr, em_ptr, who, r, y, x, dam, effect_type, flag, see_s_msg);
2527 if (!is_never_effect(caster_ptr, em_ptr)) return FALSE;
2529 em_ptr->dam = (em_ptr->dam + em_ptr->r) / (em_ptr->r + 1);
2530 monster_desc(caster_ptr, em_ptr->m_name, em_ptr->m_ptr, 0);
2531 monster_desc(caster_ptr, em_ptr->m_poss, em_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
2532 if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding))
2533 disturb(caster_ptr, TRUE, TRUE);
2535 gf_switch_result result = process_monster_perfect_resistance(caster_ptr, em_ptr);
2536 if (result != GF_SWITCH_CONTINUE) return (bool)result;
2538 if (em_ptr->skipped) return FALSE;
2540 process_spell_result(caster_ptr, em_ptr);
2541 int tmp_damage = em_ptr->dam;
2542 em_ptr->dam = mon_damage_mod(caster_ptr, em_ptr->m_ptr, em_ptr->dam, (bool)(em_ptr->effect_type == GF_PSY_SPEAR));
2543 if ((tmp_damage > 0) && (em_ptr->dam == 0)) em_ptr->note = _("はダメージを受けていない。", " is unharmed.");
2545 if (em_ptr->dam > em_ptr->m_ptr->hp)
2546 em_ptr->note = em_ptr->note_dies;
2548 process_monster_bad_status(caster_ptr, em_ptr, &tmp_damage);
2550 process_monster_last_moment(caster_ptr, em_ptr);
2551 if ((em_ptr->effect_type == GF_BLOOD_CURSE) && one_in_(4))
2552 blood_curse_to_enemy(caster_ptr, em_ptr->who);
2554 update_phase_out_stat(caster_ptr, em_ptr);
2555 if (em_ptr->m_ptr->r_idx) update_monster(caster_ptr, em_ptr->g_ptr->m_idx, FALSE);
2557 lite_spot(caster_ptr, em_ptr->y, em_ptr->x);
2558 if ((caster_ptr->monster_race_idx == em_ptr->m_ptr->r_idx) && (em_ptr->seen || !em_ptr->m_ptr->r_idx))
2559 caster_ptr->window |= (PW_MONSTER);
2561 process_spell_result_pet(caster_ptr, em_ptr);
2562 process_spell_result_riding(caster_ptr, em_ptr);
2568 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
2569 q_ptr->pval = em_ptr->photo;
2570 q_ptr->ident |= (IDENT_FULL_KNOWN);
2571 (void)drop_near(caster_ptr, q_ptr, -1, caster_ptr->y, caster_ptr->x);
2575 project_m_x = em_ptr->x;
2576 project_m_y = em_ptr->y;
2577 return (em_ptr->obvious);