2 * @brief 魔法種別による各種処理切り替え
8 #include "effect-monster-util.h"
9 #include "effect/effect-monster-switcher.h"
10 #include "player-damage.h"
13 #include "monster-spell.h"
15 #include "monster-status.h"
16 #include "effect/spells-effect-util.h"
17 #include "player-effects.h"
18 #include "spells-diceroll.h"
19 #include "monsterrace-hook.h"
20 #include "combat/melee.h"
21 #include "cmd/cmd-pet.h" // 暫定、後で消すかも.
22 #include "spell/spells-type.h"
23 #include "effect/effect-monster-resist-hurt.h"
25 gf_switch_result effect_monster_psi(player_type *caster_ptr, effect_monster_type *em_ptr)
27 if (em_ptr->seen) em_ptr->obvious = TRUE;
28 if (!(los(caster_ptr, em_ptr->m_ptr->fy, em_ptr->m_ptr->fx, caster_ptr->y, caster_ptr->x)))
31 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), em_ptr->m_name);
32 em_ptr->skipped = TRUE;
33 return GF_SWITCH_CONTINUE;
36 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
39 em_ptr->note = _("には完全な耐性がある!", " is immune.");
40 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
43 else if ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
44 (em_ptr->r_ptr->flags3 & RF3_ANIMAL) ||
45 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam)))
47 em_ptr->note = _("には耐性がある!", " resists!");
51 * Powerful demons & undead can turn a mindcrafter's
52 * attacks back on them
54 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
55 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
59 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
60 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
61 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
63 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
65 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
69 /* Injure +/- confusion */
70 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
71 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
72 if (one_in_(4) && !CHECK_MULTISHADOW(caster_ptr))
77 set_confused(caster_ptr, caster_ptr->confused + 3 + randint1(em_ptr->dam));
80 set_stun(caster_ptr, caster_ptr->stun + randint1(em_ptr->dam));
84 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
85 em_ptr->note = _("には効果がなかった。", " is unaffected.");
87 set_afraid(caster_ptr, caster_ptr->afraid + 3 + randint1(em_ptr->dam));
91 if (!caster_ptr->free_act)
92 (void)set_paralyzed(caster_ptr, caster_ptr->paralyzed + randint1(em_ptr->dam));
102 if ((em_ptr->dam > 0) && one_in_(4))
107 em_ptr->do_conf = 3 + randint1(em_ptr->dam);
110 em_ptr->do_stun = 3 + randint1(em_ptr->dam);
113 em_ptr->do_fear = 3 + randint1(em_ptr->dam);
116 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
117 em_ptr->do_sleep = 3 + randint1(em_ptr->dam);
122 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
123 return GF_SWITCH_CONTINUE;
127 * @brief 魔法の効果によって様々なメッセーを出力したり与えるダメージの増減を行ったりする
128 * @param em_ptr モンスター効果構造体への参照ポインタ
129 * @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE
131 gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr)
133 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
134 switch (em_ptr->effect_type)
144 return effect_monster_void(em_ptr);
146 return effect_monster_acid(caster_ptr, em_ptr);
148 return effect_monster_elec(caster_ptr, em_ptr);
150 return effect_monster_fire(caster_ptr, em_ptr);
152 return effect_monster_cold(caster_ptr, em_ptr);
154 return effect_monster_pois(caster_ptr, em_ptr);
156 return effect_monster_nuke(caster_ptr, em_ptr);
158 return effect_monster_hell_fire(caster_ptr, em_ptr);
160 return effect_monster_holy_fire(caster_ptr, em_ptr);
162 return effect_monster_plasma(caster_ptr, em_ptr);
164 return effect_monster_nether(caster_ptr, em_ptr);
166 return effect_monster_water(caster_ptr, em_ptr);
168 return effect_monster_chaos(caster_ptr, em_ptr);
170 return effect_monster_shards(caster_ptr, em_ptr);
172 return effect_monster_rocket(caster_ptr, em_ptr);
174 return effect_monster_sound(caster_ptr, em_ptr);
176 return effect_monster_confusion(caster_ptr, em_ptr);
178 return effect_monster_disenchant(caster_ptr, em_ptr);
180 return effect_monster_nexus(caster_ptr, em_ptr);
182 return effect_monster_force(caster_ptr, em_ptr);
184 return effect_monster_inertial(caster_ptr, em_ptr);
186 return effect_monster_time(caster_ptr, em_ptr);
188 return effect_monster_gravity(caster_ptr, em_ptr);
189 case GF_DISINTEGRATE:
190 return effect_monster_disintegration(caster_ptr, em_ptr);
192 return effect_monster_psi(caster_ptr, em_ptr);
195 if (em_ptr->seen) em_ptr->obvious = TRUE;
196 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
199 em_ptr->note = _("には完全な耐性がある!", " is immune.");
201 else if ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
202 (em_ptr->r_ptr->flags3 & RF3_ANIMAL) ||
203 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam)))
205 em_ptr->note = _("には耐性がある!", " resists!");
209 * Powerful demons & undead can turn a mindcrafter's
210 * attacks back on them
212 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
213 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
217 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
218 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
219 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
220 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
222 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
226 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
227 if (!CHECK_MULTISHADOW(caster_ptr))
229 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
230 caster_ptr->csp -= damroll(5, em_ptr->dam) / 2;
231 if (caster_ptr->csp < 0) caster_ptr->csp = 0;
232 caster_ptr->redraw |= PR_MANA;
233 caster_ptr->window |= (PW_SPELL);
235 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
241 else if (em_ptr->dam > 0)
243 int b = damroll(5, em_ptr->dam) / 4;
244 concptr str = (caster_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
245 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
246 (em_ptr->seen ? "You convert %s's pain into %s!" :
247 "You convert %ss pain into %s!"));
248 msg_format(msg, em_ptr->m_name, str);
250 b = MIN(caster_ptr->msp, caster_ptr->csp + b);
252 caster_ptr->redraw |= PR_MANA;
253 caster_ptr->window |= (PW_SPELL);
256 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
261 if (em_ptr->seen) em_ptr->obvious = TRUE;
264 if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) em_ptr->do_dist = 0;
265 else em_ptr->do_dist = 7;
268 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, em_ptr->dam) + 1;
269 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
270 (em_ptr->r_ptr->level > 5 + randint1(em_ptr->dam)))
273 em_ptr->obvious = FALSE;
280 if (!is_hostile(em_ptr->m_ptr)) break;
281 if (em_ptr->seen) em_ptr->obvious = TRUE;
282 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
283 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
284 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
286 if (em_ptr->r_ptr->flags3 & RF3_NO_CONF)
288 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
294 * Powerful demons & undead can turn a mindcrafter's
295 * attacks back on them
297 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
298 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
302 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
303 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
304 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
307 if (randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav)
309 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
313 /* Confuse, stun, terrify */
317 set_stun(caster_ptr, caster_ptr->stun + em_ptr->dam / 2);
320 set_confused(caster_ptr, caster_ptr->confused + em_ptr->dam / 2);
324 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
325 em_ptr->note = _("には効果がなかった。", " is unaffected.");
327 set_afraid(caster_ptr, caster_ptr->afraid + em_ptr->dam);
334 em_ptr->note = _("には効果がなかった。", " is unaffected.");
335 em_ptr->obvious = FALSE;
340 if (!common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
342 em_ptr->note = _("があなたに隷属した。", " is in your thrall!");
343 set_pet(caster_ptr, em_ptr->m_ptr);
350 em_ptr->do_stun = em_ptr->dam / 2;
353 em_ptr->do_conf = em_ptr->dam / 2;
356 em_ptr->do_fear = em_ptr->dam;
366 if (em_ptr->seen) em_ptr->obvious = TRUE;
367 em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1);
368 if (em_ptr->r_ptr->flagsr & RFR_IM_COLD)
370 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
372 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
374 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD))
376 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
378 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
385 if (em_ptr->seen) em_ptr->obvious = TRUE;
386 if (!monster_living(em_ptr->m_ptr->r_idx))
388 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
390 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
391 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
392 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
394 em_ptr->note = _("には効果がなかった。", " is unaffected.");
395 em_ptr->obvious = FALSE;
399 em_ptr->do_time = (em_ptr->dam + 7) / 8;
405 if (em_ptr->seen) em_ptr->obvious = TRUE;
406 if (!monster_living(em_ptr->m_ptr->r_idx))
408 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
410 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
411 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
412 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
414 em_ptr->note = _("には完全な耐性がある!", " is immune.");
415 em_ptr->obvious = FALSE;
418 else if (((em_ptr->r_ptr->flags1 & RF1_UNIQUE) &&
419 (randint1(888) != 666)) ||
420 (((em_ptr->r_ptr->level + randint1(20)) > randint1((em_ptr->caster_lev / 2) + randint1(10))) &&
421 randint1(100) != 66))
423 em_ptr->note = _("には耐性がある!", " resists!");
424 em_ptr->obvious = FALSE;
432 if (em_ptr->seen) em_ptr->obvious = TRUE;
433 em_ptr->do_polymorph = TRUE;
435 /* Powerful monsters can resist */
436 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
437 (em_ptr->r_ptr->flags1 & RF1_QUESTOR) ||
438 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
440 em_ptr->note = _("には効果がなかった。", " is unaffected.");
441 em_ptr->do_polymorph = FALSE;
442 em_ptr->obvious = FALSE;
450 if (em_ptr->seen) em_ptr->obvious = TRUE;
452 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)))
454 em_ptr->note = _("には効果がなかった。", " is unaffected.");
458 em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
459 if (multiply_monster(caster_ptr, em_ptr->g_ptr->m_idx, TRUE, 0L))
461 em_ptr->note = _("が分裂した!", " spawns!");
470 if (em_ptr->seen) em_ptr->obvious = TRUE;
472 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
474 if (em_ptr->m_ptr->maxhp < em_ptr->m_ptr->max_maxhp)
476 if (em_ptr->seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), em_ptr->m_name, em_ptr->m_poss);
477 em_ptr->m_ptr->maxhp = em_ptr->m_ptr->max_maxhp;
482 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
483 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
490 if (em_ptr->seen) em_ptr->obvious = TRUE;
493 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
494 if (MON_STUNNED(em_ptr->m_ptr))
496 if (em_ptr->seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), em_ptr->m_name);
497 (void)set_monster_stunned(caster_ptr, em_ptr->g_ptr->m_idx, 0);
499 if (MON_CONFUSED(em_ptr->m_ptr))
501 if (em_ptr->seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), em_ptr->m_name);
502 (void)set_monster_confused(caster_ptr, em_ptr->g_ptr->m_idx, 0);
504 if (MON_MONFEAR(em_ptr->m_ptr))
506 if (em_ptr->seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), em_ptr->m_name, em_ptr->m_poss);
507 (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, 0);
510 if (em_ptr->m_ptr->hp < 30000) em_ptr->m_ptr->hp += em_ptr->dam;
511 if (em_ptr->m_ptr->hp > em_ptr->m_ptr->maxhp) em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
515 chg_virtue(caster_ptr, V_VITALITY, 1);
517 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
518 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
520 if (is_friendly(em_ptr->m_ptr))
521 chg_virtue(caster_ptr, V_HONOUR, 1);
522 else if (!(em_ptr->r_ptr->flags3 & RF3_EVIL))
524 if (em_ptr->r_ptr->flags3 & RF3_GOOD)
525 chg_virtue(caster_ptr, V_COMPASSION, 2);
527 chg_virtue(caster_ptr, V_COMPASSION, 1);
530 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
531 chg_virtue(caster_ptr, V_NATURE, 1);
534 if (em_ptr->m_ptr->r_idx == MON_LEPER)
536 em_ptr->heal_leper = TRUE;
537 if (!em_ptr->who) chg_virtue(caster_ptr, V_COMPASSION, 5);
540 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
541 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
543 em_ptr->note = _("は体力を回復したようだ。", " looks healthier.");
550 if (em_ptr->seen) em_ptr->obvious = TRUE;
552 if (set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100))
554 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
559 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
560 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
561 if (is_friendly(em_ptr->m_ptr))
562 chg_virtue(caster_ptr, V_HONOUR, 1);
570 if (em_ptr->seen) em_ptr->obvious = TRUE;
572 /* Powerful monsters can resist */
573 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
574 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
576 em_ptr->note = _("には効果がなかった。", " is unaffected.");
577 em_ptr->obvious = FALSE;
581 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
583 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
592 if (em_ptr->seen) em_ptr->obvious = TRUE;
594 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
595 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
596 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
598 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
600 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
603 em_ptr->note = _("には効果がなかった。", " is unaffected.");
604 em_ptr->obvious = FALSE;
608 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
609 em_ptr->do_sleep = 500;
617 if (em_ptr->seen) em_ptr->obvious = TRUE;
619 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
620 !(em_ptr->r_ptr->flags3 & RF3_EVIL) ||
621 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
623 em_ptr->note = _("には効果がなかった。", " is unaffected.");
624 em_ptr->obvious = FALSE;
628 em_ptr->note = _("は動けなくなった!", " is suspended!");
629 em_ptr->do_sleep = 500;
637 if (em_ptr->seen) em_ptr->obvious = TRUE;
639 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
640 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
642 em_ptr->note = _("には効果がなかった。", " is unaffected.");
643 em_ptr->obvious = FALSE;
647 em_ptr->note = _("は動けなくなった!", " is suspended!");
648 em_ptr->do_sleep = 500;
656 int vir = virtue_number(caster_ptr, V_HARMONY);
659 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
662 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
665 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
668 if (em_ptr->seen) em_ptr->obvious = TRUE;
670 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
672 em_ptr->note = _("には効果がなかった。", " is unaffected.");
673 em_ptr->obvious = FALSE;
675 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
677 else if (caster_ptr->cursed & TRC_AGGRAVATE)
679 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
680 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
684 em_ptr->note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
685 set_pet(caster_ptr, em_ptr->m_ptr);
687 chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
688 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
689 chg_virtue(caster_ptr, V_NATURE, 1);
695 case GF_CONTROL_UNDEAD:
697 if (em_ptr->seen) em_ptr->obvious = TRUE;
699 int vir = virtue_number(caster_ptr, V_UNLIFE);
702 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
705 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
708 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
711 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
712 !(em_ptr->r_ptr->flags3 & RF3_UNDEAD))
714 em_ptr->note = _("には効果がなかった。", " is unaffected.");
715 em_ptr->obvious = FALSE;
716 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
718 else if (caster_ptr->cursed & TRC_AGGRAVATE)
720 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
721 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
725 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
726 set_pet(caster_ptr, em_ptr->m_ptr);
732 case GF_CONTROL_DEMON:
735 if (em_ptr->seen) em_ptr->obvious = TRUE;
737 vir = virtue_number(caster_ptr, V_UNLIFE);
740 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
743 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
746 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
749 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
750 !(em_ptr->r_ptr->flags3 & RF3_DEMON))
752 em_ptr->note = _("には効果がなかった。", " is unaffected.");
753 em_ptr->obvious = FALSE;
754 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
756 else if (caster_ptr->cursed & TRC_AGGRAVATE)
758 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
759 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
763 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
764 set_pet(caster_ptr, em_ptr->m_ptr);
770 case GF_CONTROL_ANIMAL:
772 if (em_ptr->seen) em_ptr->obvious = TRUE;
774 int vir = virtue_number(caster_ptr, V_NATURE);
777 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
780 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
783 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
786 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
787 !(em_ptr->r_ptr->flags3 & RF3_ANIMAL))
789 em_ptr->note = _("には効果がなかった。", " is unaffected.");
790 em_ptr->obvious = FALSE;
791 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
793 else if (caster_ptr->cursed & TRC_AGGRAVATE)
795 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
796 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
800 em_ptr->note = _("はなついた。", " is tamed!");
801 set_pet(caster_ptr, em_ptr->m_ptr);
802 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
803 chg_virtue(caster_ptr, V_NATURE, 1);
809 case GF_CHARM_LIVING:
811 int vir = virtue_number(caster_ptr, V_UNLIFE);
812 if (em_ptr->seen) em_ptr->obvious = TRUE;
814 vir = virtue_number(caster_ptr, V_UNLIFE);
817 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 10;
820 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
823 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
826 msg_format(_("%sを見つめた。", "You stare into %s."), em_ptr->m_name);
828 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
829 !monster_living(em_ptr->m_ptr->r_idx))
831 em_ptr->note = _("には効果がなかった。", " is unaffected.");
832 em_ptr->obvious = FALSE;
833 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
835 else if (caster_ptr->cursed & TRC_AGGRAVATE)
837 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
838 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
842 em_ptr->note = _("を支配した。", " is tamed!");
843 set_pet(caster_ptr, em_ptr->m_ptr);
844 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
845 chg_virtue(caster_ptr, V_NATURE, 1);
853 if (em_ptr->seen) em_ptr->obvious = TRUE;
855 em_ptr->do_conf = damroll(3, (em_ptr->dam / 2)) + 1;
856 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
857 (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) ||
858 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
860 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
862 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
866 em_ptr->note = _("には効果がなかった。", " is unaffected.");
867 em_ptr->obvious = FALSE;
875 if (em_ptr->seen) em_ptr->obvious = TRUE;
877 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1;
878 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
879 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
882 em_ptr->note = _("には効果がなかった。", " is unaffected.");
883 em_ptr->obvious = FALSE;
893 em_ptr->skipped = TRUE;
897 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
899 if (em_ptr->seen) em_ptr->obvious = TRUE;
901 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
903 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
904 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
915 if (em_ptr->seen) em_ptr->obvious = TRUE;
917 if (em_ptr->r_ptr->flagsr & RFR_RES_LITE)
919 em_ptr->note = _("には耐性がある!", " resists!");
920 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
921 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_LITE);
923 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
925 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
926 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
927 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
934 if (em_ptr->seen) em_ptr->obvious = TRUE;
936 if (em_ptr->r_ptr->flagsr & RFR_RES_DARK)
938 em_ptr->note = _("には耐性がある!", " resists!");
939 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
940 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_DARK);
947 if (em_ptr->r_ptr->flags3 & (RF3_HURT_ROCK))
949 if (em_ptr->seen) em_ptr->obvious = TRUE;
951 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK);
953 em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
954 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
965 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
967 bool resists_tele = FALSE;
969 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
971 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
973 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
974 em_ptr->note = _("には効果がなかった。", " is unaffected.");
977 else if (em_ptr->r_ptr->level > randint1(100))
979 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
980 em_ptr->note = _("には耐性がある!", " resists!");
987 if (em_ptr->seen) em_ptr->obvious = TRUE;
988 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
989 em_ptr->do_dist = em_ptr->dam;
994 em_ptr->skipped = TRUE;
1002 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1004 bool resists_tele = FALSE;
1006 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1008 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1010 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1011 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1012 resists_tele = TRUE;
1014 else if (em_ptr->r_ptr->level > randint1(100))
1016 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1017 em_ptr->note = _("には耐性がある!", " resists!");
1018 resists_tele = TRUE;
1024 if (em_ptr->seen) em_ptr->obvious = TRUE;
1025 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1026 em_ptr->do_dist = em_ptr->dam;
1031 em_ptr->skipped = TRUE;
1039 bool resists_tele = FALSE;
1040 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1042 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1044 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1045 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1046 resists_tele = TRUE;
1048 else if (em_ptr->r_ptr->level > randint1(100))
1050 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1051 em_ptr->note = _("には耐性がある!", " resists!");
1052 resists_tele = TRUE;
1058 if (em_ptr->seen) em_ptr->obvious = TRUE;
1060 em_ptr->do_dist = em_ptr->dam;
1066 case GF_TURN_UNDEAD:
1068 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1070 if (em_ptr->seen) em_ptr->obvious = TRUE;
1072 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1074 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1075 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1077 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1078 em_ptr->obvious = FALSE;
1079 em_ptr->do_fear = 0;
1084 em_ptr->skipped = TRUE;
1092 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1094 if (em_ptr->seen) em_ptr->obvious = TRUE;
1096 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1098 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1099 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1101 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1102 em_ptr->obvious = FALSE;
1103 em_ptr->do_fear = 0;
1108 em_ptr->skipped = TRUE;
1116 if (em_ptr->seen) em_ptr->obvious = TRUE;
1118 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1119 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1120 (em_ptr->r_ptr->flags3 & (RF3_NO_FEAR)) ||
1121 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1123 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1124 em_ptr->obvious = FALSE;
1125 em_ptr->do_fear = 0;
1131 case GF_DISP_UNDEAD:
1133 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1135 if (em_ptr->seen) em_ptr->obvious = TRUE;
1137 /* Learn about em_ptr->effect_type */
1138 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1140 em_ptr->note = _("は身震いした。", " shudders.");
1141 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1145 em_ptr->skipped = TRUE;
1153 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1155 if (em_ptr->seen) em_ptr->obvious = TRUE;
1157 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1159 em_ptr->note = _("は身震いした。", " shudders.");
1160 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1164 em_ptr->skipped = TRUE;
1172 if (em_ptr->r_ptr->flags3 & (RF3_GOOD))
1174 if (em_ptr->seen) em_ptr->obvious = TRUE;
1176 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
1178 em_ptr->note = _("は身震いした。", " shudders.");
1179 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1183 em_ptr->skipped = TRUE;
1189 case GF_DISP_LIVING:
1191 if (monster_living(em_ptr->m_ptr->r_idx))
1193 if (em_ptr->seen) em_ptr->obvious = TRUE;
1195 em_ptr->note = _("は身震いした。", " shudders.");
1196 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1200 em_ptr->skipped = TRUE;
1208 if (em_ptr->r_ptr->flags3 & (RF3_DEMON))
1210 if (em_ptr->seen) em_ptr->obvious = TRUE;
1212 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
1214 em_ptr->note = _("は身震いした。", " shudders.");
1215 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1219 em_ptr->skipped = TRUE;
1227 if (em_ptr->seen) em_ptr->obvious = TRUE;
1228 em_ptr->note = _("は身震いした。", " shudders.");
1229 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1234 if (em_ptr->seen) em_ptr->obvious = TRUE;
1235 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)))
1237 if (em_ptr->who > 0)
1239 if (em_ptr->m_caster_ptr->hp < em_ptr->m_caster_ptr->maxhp)
1241 em_ptr->m_caster_ptr->hp += em_ptr->dam;
1242 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;
1243 if (caster_ptr->health_who == em_ptr->who) caster_ptr->redraw |= (PR_HEALTH);
1244 if (caster_ptr->riding == em_ptr->who) caster_ptr->redraw |= (PR_UHEALTH);
1246 if (em_ptr->see_s_msg)
1248 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_caster_ptr, 0);
1249 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), em_ptr->killer);
1255 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), em_ptr->m_name);
1256 (void)hp_player(caster_ptr, em_ptr->dam);
1261 if (em_ptr->see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1269 if (em_ptr->seen) em_ptr->obvious = TRUE;
1270 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1272 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1273 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1274 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1276 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1278 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1281 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1284 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1286 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1287 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1290 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1292 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1293 em_ptr->note = _("には耐性がある。", " resists.");
1298 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1299 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1301 if (em_ptr->who > 0) em_ptr->do_conf = randint0(4) + 4;
1302 else em_ptr->do_conf = randint0(8) + 8;
1307 case GF_BRAIN_SMASH:
1309 if (em_ptr->seen) em_ptr->obvious = TRUE;
1310 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1312 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1313 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1314 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1316 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1318 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1321 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1324 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1326 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1327 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1330 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1332 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1333 em_ptr->note = _("には耐性がある!", " resists!");
1338 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1339 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1340 if (em_ptr->who > 0)
1342 em_ptr->do_conf = randint0(4) + 4;
1343 em_ptr->do_stun = randint0(4) + 4;
1347 em_ptr->do_conf = randint0(8) + 8;
1348 em_ptr->do_stun = randint0(8) + 8;
1350 (void)set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 10);
1357 if (em_ptr->seen) em_ptr->obvious = TRUE;
1358 if (!em_ptr->who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), em_ptr->m_name);
1359 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1361 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1369 if (em_ptr->seen) em_ptr->obvious = TRUE;
1370 if (!em_ptr->who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), em_ptr->m_name);
1372 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1374 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1382 if (em_ptr->seen) em_ptr->obvious = TRUE;
1383 if (!em_ptr->who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), em_ptr->m_name);
1385 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1387 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1395 if (em_ptr->seen) em_ptr->obvious = TRUE;
1397 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
1398 "You point at %s, screaming the word, 'DIE!'."), em_ptr->m_name);
1400 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)))
1402 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1409 if (em_ptr->seen) em_ptr->obvious = TRUE;
1410 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
1412 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1417 if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20))) :
1418 (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200))))
1420 em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
1422 if (em_ptr->m_ptr->hp < em_ptr->dam) em_ptr->dam = em_ptr->m_ptr->hp - 1;
1426 /* todo 乱数で破滅のを弾いた結果が「耐性を持っている」ことになるのはおかしい */
1427 em_ptr->note = _("は耐性を持っている!", "resists!");
1437 if ((floor_ptr->inside_quest && (quest[floor_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(em_ptr->m_ptr)) ||
1438 (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)
1440 msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1441 em_ptr->skipped = TRUE;
1445 if (is_pet(em_ptr->m_ptr)) nokori_hp = em_ptr->m_ptr->maxhp * 4L;
1446 else if ((caster_ptr->pclass == CLASS_BEASTMASTER) && monster_living(em_ptr->m_ptr->r_idx))
1447 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 10;
1449 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 20;
1451 if (em_ptr->m_ptr->hp >= nokori_hp)
1453 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), em_ptr->m_name);
1454 em_ptr->skipped = TRUE;
1456 else if (em_ptr->m_ptr->hp < randint0(nokori_hp))
1458 if (em_ptr->m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(caster_ptr, em_ptr->g_ptr->m_idx, FALSE, MON_CHAMELEON);
1459 msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
1460 cap_mon = em_ptr->m_ptr->r_idx;
1461 cap_mspeed = em_ptr->m_ptr->mspeed;
1462 cap_hp = em_ptr->m_ptr->hp;
1463 cap_maxhp = em_ptr->m_ptr->max_maxhp;
1464 cap_nickname = em_ptr->m_ptr->nickname;
1465 if (em_ptr->g_ptr->m_idx == caster_ptr->riding)
1467 if (rakuba(caster_ptr, -1, FALSE))
1469 msg_format(_("地面に落とされた。", "You have fallen from %s."), em_ptr->m_name);
1473 delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
1475 return GF_SWITCH_TRUE;
1479 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), em_ptr->m_name);
1480 em_ptr->skipped = TRUE;
1487 return (gf_switch_result)py_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
1494 if (em_ptr->seen) em_ptr->obvious = TRUE;
1495 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1497 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1499 em_ptr->skipped = TRUE;
1500 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1503 if (MON_CSLEEP(em_ptr->m_ptr))
1505 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1507 em_ptr->skipped = TRUE;
1511 if (one_in_(5)) effect = 1;
1512 else if (one_in_(4)) effect = 2;
1513 else if (one_in_(3)) effect = 3;
1518 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1519 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1521 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1522 em_ptr->obvious = FALSE;
1526 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
1528 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
1532 else if (effect == 2)
1534 em_ptr->do_stun = damroll((caster_ptr->lev / 10) + 3, (em_ptr->dam)) + 1;
1535 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1536 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1538 em_ptr->do_stun = 0;
1539 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1540 em_ptr->obvious = FALSE;
1543 else if (effect == 3)
1545 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1546 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
1547 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1549 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
1551 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
1554 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1555 em_ptr->obvious = FALSE;
1559 /* Go to sleep (much) later */
1560 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
1561 em_ptr->do_sleep = 500;
1567 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1575 if (em_ptr->seen) em_ptr->obvious = TRUE;
1576 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")))
1578 if (em_ptr->seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), em_ptr->m_name);
1579 chg_virtue(caster_ptr, V_VITALITY, -1);
1580 return GF_SWITCH_TRUE;
1583 em_ptr->skipped = TRUE;
1589 msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
1591 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
1593 if (em_ptr->seen) em_ptr->obvious = TRUE;
1595 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
1597 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
1598 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
1605 em_ptr->photo = em_ptr->m_ptr->r_idx;
1610 bool success = FALSE;
1611 if (em_ptr->seen) em_ptr->obvious = TRUE;
1613 if ((em_ptr->r_ptr->flags3 & (RF3_GOOD)) && !floor_ptr->inside_arena)
1615 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) em_ptr->dam -= 50;
1616 if (em_ptr->dam < 1) em_ptr->dam = 1;
1618 if (is_pet(em_ptr->m_ptr))
1620 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
1621 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
1624 else if ((em_ptr->r_ptr->flags1 & (RF1_QUESTOR)) ||
1625 (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1626 (em_ptr->m_ptr->mflag2 & MFLAG2_NOPET) ||
1627 (caster_ptr->cursed & TRC_AGGRAVATE) ||
1628 ((em_ptr->r_ptr->level + 10) > randint1(em_ptr->dam)))
1630 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1634 em_ptr->note = _("を支配した。", " is tamed!");
1635 set_pet(caster_ptr, em_ptr->m_ptr);
1636 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
1638 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
1645 if (!(em_ptr->r_ptr->flags3 & RF3_NO_FEAR))
1647 em_ptr->do_fear = randint1(90) + 10;
1649 else if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
1650 em_ptr->r_ptr->r_flags3 |= (RF3_NO_FEAR);
1658 if (em_ptr->seen) em_ptr->obvious = TRUE;
1660 if (randint0(100 + em_ptr->dam) < (em_ptr->r_ptr->level + 50))
1662 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1669 em_ptr->skipped = TRUE;
1675 return GF_SWITCH_CONTINUE;