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 static bool effect_monster_psi_empty_mind(player_type *caster_ptr, effect_monster_type *em_ptr)
27 if ((em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND) == 0) return FALSE;
30 em_ptr->note = _("には完全な耐性がある!", " is immune.");
31 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
32 em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
38 static bool effect_monster_psi_weird_mind(effect_monster_type *em_ptr)
40 bool has_resistance = ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) != 0) ||
41 ((em_ptr->r_ptr->flags3 & RF3_ANIMAL) != 0) ||
42 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam));
43 if (!has_resistance) return FALSE;
45 em_ptr->note = _("には耐性がある!", " resists!");
51 static bool effect_monster_psi_demon(player_type *caster_ptr, effect_monster_type *em_ptr)
53 bool is_powerful = ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) != 0) &&
54 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
56 if (!is_powerful) return FALSE;
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);
66 static void effect_monster_psi_resist_addition(player_type *caster_ptr, effect_monster_type *em_ptr)
71 set_confused(caster_ptr, caster_ptr->confused + 3 + randint1(em_ptr->dam));
74 set_stun(caster_ptr, caster_ptr->stun + randint1(em_ptr->dam));
78 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
79 em_ptr->note = _("には効果がなかった。", " is unaffected.");
81 set_afraid(caster_ptr, caster_ptr->afraid + 3 + randint1(em_ptr->dam));
86 if (!caster_ptr->free_act)
87 (void)set_paralyzed(caster_ptr, caster_ptr->paralyzed + randint1(em_ptr->dam));
94 // Powerful demons & undead can turn a mindcrafter's attacks back on them.
95 static void effect_monster_psi_resist(player_type *caster_ptr, effect_monster_type *em_ptr)
97 if (effect_monster_psi_empty_mind(caster_ptr, em_ptr)) return;
98 if (effect_monster_psi_weird_mind(em_ptr)) return;
99 if (!effect_monster_psi_demon(caster_ptr, em_ptr)) return;
101 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
103 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
108 /* Injure +/- confusion */
109 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
110 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1);
111 if (!one_in_(4) || CHECK_MULTISHADOW(caster_ptr))
117 effect_monster_psi_resist_addition(caster_ptr, em_ptr);
122 static void effect_monster_psi_addition(effect_monster_type *em_ptr)
124 if ((em_ptr->dam <= 0) || !one_in_(4)) return;
129 em_ptr->do_conf = 3 + randint1(em_ptr->dam);
132 em_ptr->do_stun = 3 + randint1(em_ptr->dam);
135 em_ptr->do_fear = 3 + randint1(em_ptr->dam);
138 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
139 em_ptr->do_sleep = 3 + randint1(em_ptr->dam);
145 gf_switch_result effect_monster_psi(player_type *caster_ptr, effect_monster_type *em_ptr)
147 if (em_ptr->seen) em_ptr->obvious = TRUE;
148 if (!(los(caster_ptr, em_ptr->m_ptr->fy, em_ptr->m_ptr->fx, caster_ptr->y, caster_ptr->x)))
150 if (em_ptr->seen_msg)
151 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), em_ptr->m_name);
153 em_ptr->skipped = TRUE;
154 return GF_SWITCH_CONTINUE;
157 effect_monster_psi_resist(caster_ptr, em_ptr);
158 effect_monster_psi_addition(em_ptr);
159 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
160 return GF_SWITCH_CONTINUE;
164 // Powerful demons & undead can turn a mindcrafter's attacks back on them.
165 static void effect_monster_psi_drain_resist(player_type *caster_ptr, effect_monster_type *em_ptr)
167 em_ptr->note = _("には耐性がある!", " resists!");
169 bool is_corrupted = ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) != 0) &&
170 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
172 if (!is_corrupted) return;
175 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
176 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
177 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
178 if ((randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav) && !CHECK_MULTISHADOW(caster_ptr))
180 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
185 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_ptr, MD_WRONGDOER_NAME);
186 if (CHECK_MULTISHADOW(caster_ptr))
188 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
193 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
194 caster_ptr->csp -= damroll(5, em_ptr->dam) / 2;
195 if (caster_ptr->csp < 0) caster_ptr->csp = 0;
197 caster_ptr->redraw |= PR_MANA;
198 caster_ptr->window |= (PW_SPELL);
199 take_hit(caster_ptr, DAMAGE_ATTACK, em_ptr->dam, em_ptr->killer, -1); /* has already been /3 */
204 static void effect_monster_psi_drain_change_power(player_type *caster_ptr, effect_monster_type *em_ptr)
206 int b = damroll(5, em_ptr->dam) / 4;
207 concptr str = (caster_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
208 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
209 (em_ptr->seen ? "You convert %s's pain into %s!" : "You convert %ss pain into %s!"));
210 msg_format(msg, em_ptr->m_name, str);
212 b = MIN(caster_ptr->msp, caster_ptr->csp + b);
214 caster_ptr->redraw |= PR_MANA;
215 caster_ptr->window |= (PW_SPELL);
219 gf_switch_result effect_monster_psi_drain(player_type *caster_ptr, effect_monster_type *em_ptr)
221 if (em_ptr->seen) em_ptr->obvious = TRUE;
223 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
226 em_ptr->note = _("には完全な耐性がある!", " is immune.");
228 else if ((em_ptr->r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
229 (em_ptr->r_ptr->flags3 & RF3_ANIMAL) ||
230 (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam)))
232 effect_monster_psi_drain_resist(caster_ptr, em_ptr);
234 else if (em_ptr->dam > 0)
236 effect_monster_psi_drain_change_power(caster_ptr, em_ptr);
239 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
244 * @brief 魔法の効果によって様々なメッセーを出力したり与えるダメージの増減を行ったりする
245 * @param em_ptr モンスター効果構造体への参照ポインタ
246 * @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE
248 gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr)
250 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
251 switch (em_ptr->effect_type)
261 return effect_monster_void(em_ptr);
263 return effect_monster_acid(caster_ptr, em_ptr);
265 return effect_monster_elec(caster_ptr, em_ptr);
267 return effect_monster_fire(caster_ptr, em_ptr);
269 return effect_monster_cold(caster_ptr, em_ptr);
271 return effect_monster_pois(caster_ptr, em_ptr);
273 return effect_monster_nuke(caster_ptr, em_ptr);
275 return effect_monster_hell_fire(caster_ptr, em_ptr);
277 return effect_monster_holy_fire(caster_ptr, em_ptr);
279 return effect_monster_plasma(caster_ptr, em_ptr);
281 return effect_monster_nether(caster_ptr, em_ptr);
283 return effect_monster_water(caster_ptr, em_ptr);
285 return effect_monster_chaos(caster_ptr, em_ptr);
287 return effect_monster_shards(caster_ptr, em_ptr);
289 return effect_monster_rocket(caster_ptr, em_ptr);
291 return effect_monster_sound(caster_ptr, em_ptr);
293 return effect_monster_confusion(caster_ptr, em_ptr);
295 return effect_monster_disenchant(caster_ptr, em_ptr);
297 return effect_monster_nexus(caster_ptr, em_ptr);
299 return effect_monster_force(caster_ptr, em_ptr);
301 return effect_monster_inertial(caster_ptr, em_ptr);
303 return effect_monster_time(caster_ptr, em_ptr);
305 return effect_monster_gravity(caster_ptr, em_ptr);
306 case GF_DISINTEGRATE:
307 return effect_monster_disintegration(caster_ptr, em_ptr);
309 return effect_monster_psi(caster_ptr, em_ptr);
311 return effect_monster_psi_drain(caster_ptr, em_ptr);
314 if (em_ptr->seen) em_ptr->obvious = TRUE;
317 if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) em_ptr->do_dist = 0;
318 else em_ptr->do_dist = 7;
321 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, em_ptr->dam) + 1;
322 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
323 (em_ptr->r_ptr->level > 5 + randint1(em_ptr->dam)))
326 em_ptr->obvious = FALSE;
333 if (!is_hostile(em_ptr->m_ptr)) break;
334 if (em_ptr->seen) em_ptr->obvious = TRUE;
335 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
336 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
337 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
339 if (em_ptr->r_ptr->flags3 & RF3_NO_CONF)
341 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
347 * Powerful demons & undead can turn a mindcrafter's
348 * attacks back on them
350 if ((em_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
351 (em_ptr->r_ptr->level > caster_ptr->lev / 2) &&
355 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
356 (em_ptr->seen ? "%^s's corrupted mind backlashes your attack!" :
357 "%^ss corrupted mind backlashes your attack!")), em_ptr->m_name);
360 if (randint0(100 + em_ptr->r_ptr->level / 2) < caster_ptr->skill_sav)
362 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
366 /* Confuse, stun, terrify */
370 set_stun(caster_ptr, caster_ptr->stun + em_ptr->dam / 2);
373 set_confused(caster_ptr, caster_ptr->confused + em_ptr->dam / 2);
377 if (em_ptr->r_ptr->flags3 & RF3_NO_FEAR)
378 em_ptr->note = _("には効果がなかった。", " is unaffected.");
380 set_afraid(caster_ptr, caster_ptr->afraid + em_ptr->dam);
387 em_ptr->note = _("には効果がなかった。", " is unaffected.");
388 em_ptr->obvious = FALSE;
393 if (!common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
395 em_ptr->note = _("があなたに隷属した。", " is in your thrall!");
396 set_pet(caster_ptr, em_ptr->m_ptr);
403 em_ptr->do_stun = em_ptr->dam / 2;
406 em_ptr->do_conf = em_ptr->dam / 2;
409 em_ptr->do_fear = em_ptr->dam;
419 if (em_ptr->seen) em_ptr->obvious = TRUE;
420 em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1);
421 if (em_ptr->r_ptr->flagsr & RFR_IM_COLD)
423 em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
425 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
427 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD))
429 em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
431 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
438 if (em_ptr->seen) em_ptr->obvious = TRUE;
439 if (!monster_living(em_ptr->m_ptr->r_idx))
441 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
443 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
444 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
445 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
447 em_ptr->note = _("には効果がなかった。", " is unaffected.");
448 em_ptr->obvious = FALSE;
452 em_ptr->do_time = (em_ptr->dam + 7) / 8;
458 if (em_ptr->seen) em_ptr->obvious = TRUE;
459 if (!monster_living(em_ptr->m_ptr->r_idx))
461 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
463 if (em_ptr->r_ptr->flags3 & RF3_DEMON) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
464 if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
465 if (em_ptr->r_ptr->flags3 & RF3_NONLIVING) em_ptr->r_ptr->r_flags3 |= (RF3_NONLIVING);
467 em_ptr->note = _("には完全な耐性がある!", " is immune.");
468 em_ptr->obvious = FALSE;
471 else if (((em_ptr->r_ptr->flags1 & RF1_UNIQUE) &&
472 (randint1(888) != 666)) ||
473 (((em_ptr->r_ptr->level + randint1(20)) > randint1((em_ptr->caster_lev / 2) + randint1(10))) &&
474 randint1(100) != 66))
476 em_ptr->note = _("には耐性がある!", " resists!");
477 em_ptr->obvious = FALSE;
485 if (em_ptr->seen) em_ptr->obvious = TRUE;
486 em_ptr->do_polymorph = TRUE;
488 /* Powerful monsters can resist */
489 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
490 (em_ptr->r_ptr->flags1 & RF1_QUESTOR) ||
491 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
493 em_ptr->note = _("には効果がなかった。", " is unaffected.");
494 em_ptr->do_polymorph = FALSE;
495 em_ptr->obvious = FALSE;
503 if (em_ptr->seen) em_ptr->obvious = TRUE;
505 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)))
507 em_ptr->note = _("には効果がなかった。", " is unaffected.");
511 em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
512 if (multiply_monster(caster_ptr, em_ptr->g_ptr->m_idx, TRUE, 0L))
514 em_ptr->note = _("が分裂した!", " spawns!");
523 if (em_ptr->seen) em_ptr->obvious = TRUE;
525 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
527 if (em_ptr->m_ptr->maxhp < em_ptr->m_ptr->max_maxhp)
529 if (em_ptr->seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), em_ptr->m_name, em_ptr->m_poss);
530 em_ptr->m_ptr->maxhp = em_ptr->m_ptr->max_maxhp;
535 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
536 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
543 if (em_ptr->seen) em_ptr->obvious = TRUE;
546 (void)set_monster_csleep(caster_ptr, em_ptr->g_ptr->m_idx, 0);
547 if (MON_STUNNED(em_ptr->m_ptr))
549 if (em_ptr->seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), em_ptr->m_name);
550 (void)set_monster_stunned(caster_ptr, em_ptr->g_ptr->m_idx, 0);
552 if (MON_CONFUSED(em_ptr->m_ptr))
554 if (em_ptr->seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), em_ptr->m_name);
555 (void)set_monster_confused(caster_ptr, em_ptr->g_ptr->m_idx, 0);
557 if (MON_MONFEAR(em_ptr->m_ptr))
559 if (em_ptr->seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), em_ptr->m_name, em_ptr->m_poss);
560 (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, 0);
563 if (em_ptr->m_ptr->hp < 30000) em_ptr->m_ptr->hp += em_ptr->dam;
564 if (em_ptr->m_ptr->hp > em_ptr->m_ptr->maxhp) em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
568 chg_virtue(caster_ptr, V_VITALITY, 1);
570 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
571 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
573 if (is_friendly(em_ptr->m_ptr))
574 chg_virtue(caster_ptr, V_HONOUR, 1);
575 else if (!(em_ptr->r_ptr->flags3 & RF3_EVIL))
577 if (em_ptr->r_ptr->flags3 & RF3_GOOD)
578 chg_virtue(caster_ptr, V_COMPASSION, 2);
580 chg_virtue(caster_ptr, V_COMPASSION, 1);
583 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
584 chg_virtue(caster_ptr, V_NATURE, 1);
587 if (em_ptr->m_ptr->r_idx == MON_LEPER)
589 em_ptr->heal_leper = TRUE;
590 if (!em_ptr->who) chg_virtue(caster_ptr, V_COMPASSION, 5);
593 if (caster_ptr->health_who == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_HEALTH);
594 if (caster_ptr->riding == em_ptr->g_ptr->m_idx) caster_ptr->redraw |= (PR_UHEALTH);
596 em_ptr->note = _("は体力を回復したようだ。", " looks healthier.");
603 if (em_ptr->seen) em_ptr->obvious = TRUE;
605 if (set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100))
607 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
612 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
613 chg_virtue(caster_ptr, V_INDIVIDUALISM, 1);
614 if (is_friendly(em_ptr->m_ptr))
615 chg_virtue(caster_ptr, V_HONOUR, 1);
623 if (em_ptr->seen) em_ptr->obvious = TRUE;
625 /* Powerful monsters can resist */
626 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
627 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
629 em_ptr->note = _("には効果がなかった。", " is unaffected.");
630 em_ptr->obvious = FALSE;
634 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
636 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
645 if (em_ptr->seen) em_ptr->obvious = TRUE;
647 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
648 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
649 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
651 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
653 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
656 em_ptr->note = _("には効果がなかった。", " is unaffected.");
657 em_ptr->obvious = FALSE;
661 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
662 em_ptr->do_sleep = 500;
670 if (em_ptr->seen) em_ptr->obvious = TRUE;
672 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
673 !(em_ptr->r_ptr->flags3 & RF3_EVIL) ||
674 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
676 em_ptr->note = _("には効果がなかった。", " is unaffected.");
677 em_ptr->obvious = FALSE;
681 em_ptr->note = _("は動けなくなった!", " is suspended!");
682 em_ptr->do_sleep = 500;
690 if (em_ptr->seen) em_ptr->obvious = TRUE;
692 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
693 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
695 em_ptr->note = _("には効果がなかった。", " is unaffected.");
696 em_ptr->obvious = FALSE;
700 em_ptr->note = _("は動けなくなった!", " is suspended!");
701 em_ptr->do_sleep = 500;
709 int vir = virtue_number(caster_ptr, V_HARMONY);
712 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
715 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
718 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
721 if (em_ptr->seen) em_ptr->obvious = TRUE;
723 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr))
725 em_ptr->note = _("には効果がなかった。", " is unaffected.");
726 em_ptr->obvious = FALSE;
728 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
730 else if (caster_ptr->cursed & TRC_AGGRAVATE)
732 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
733 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
737 em_ptr->note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
738 set_pet(caster_ptr, em_ptr->m_ptr);
740 chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
741 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
742 chg_virtue(caster_ptr, V_NATURE, 1);
748 case GF_CONTROL_UNDEAD:
750 if (em_ptr->seen) em_ptr->obvious = TRUE;
752 int vir = virtue_number(caster_ptr, V_UNLIFE);
755 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
758 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
761 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
764 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
765 !(em_ptr->r_ptr->flags3 & RF3_UNDEAD))
767 em_ptr->note = _("には効果がなかった。", " is unaffected.");
768 em_ptr->obvious = FALSE;
769 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
771 else if (caster_ptr->cursed & TRC_AGGRAVATE)
773 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
774 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
778 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
779 set_pet(caster_ptr, em_ptr->m_ptr);
785 case GF_CONTROL_DEMON:
788 if (em_ptr->seen) em_ptr->obvious = TRUE;
790 vir = virtue_number(caster_ptr, V_UNLIFE);
793 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
796 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
799 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
802 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
803 !(em_ptr->r_ptr->flags3 & RF3_DEMON))
805 em_ptr->note = _("には効果がなかった。", " is unaffected.");
806 em_ptr->obvious = FALSE;
807 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
809 else if (caster_ptr->cursed & TRC_AGGRAVATE)
811 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
812 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
816 em_ptr->note = _("は既にあなたの奴隷だ!", " is in your thrall!");
817 set_pet(caster_ptr, em_ptr->m_ptr);
823 case GF_CONTROL_ANIMAL:
825 if (em_ptr->seen) em_ptr->obvious = TRUE;
827 int vir = virtue_number(caster_ptr, V_NATURE);
830 em_ptr->dam += caster_ptr->virtues[vir - 1] / 10;
833 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
836 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
839 if (common_saving_throw_control(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
840 !(em_ptr->r_ptr->flags3 & RF3_ANIMAL))
842 em_ptr->note = _("には効果がなかった。", " is unaffected.");
843 em_ptr->obvious = FALSE;
844 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
846 else if (caster_ptr->cursed & TRC_AGGRAVATE)
848 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
849 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
853 em_ptr->note = _("はなついた。", " is tamed!");
854 set_pet(caster_ptr, em_ptr->m_ptr);
855 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
856 chg_virtue(caster_ptr, V_NATURE, 1);
862 case GF_CHARM_LIVING:
864 int vir = virtue_number(caster_ptr, V_UNLIFE);
865 if (em_ptr->seen) em_ptr->obvious = TRUE;
867 vir = virtue_number(caster_ptr, V_UNLIFE);
870 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 10;
873 vir = virtue_number(caster_ptr, V_INDIVIDUALISM);
876 em_ptr->dam -= caster_ptr->virtues[vir - 1] / 20;
879 msg_format(_("%sを見つめた。", "You stare into %s."), em_ptr->m_name);
881 if (common_saving_throw_charm(caster_ptr, em_ptr->dam, em_ptr->m_ptr) ||
882 !monster_living(em_ptr->m_ptr->r_idx))
884 em_ptr->note = _("には効果がなかった。", " is unaffected.");
885 em_ptr->obvious = FALSE;
886 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
888 else if (caster_ptr->cursed & TRC_AGGRAVATE)
890 em_ptr->note = _("はあなたに敵意を抱いている!", " hates you too much!");
891 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
895 em_ptr->note = _("を支配した。", " is tamed!");
896 set_pet(caster_ptr, em_ptr->m_ptr);
897 if (em_ptr->r_ptr->flags3 & RF3_ANIMAL)
898 chg_virtue(caster_ptr, V_NATURE, 1);
906 if (em_ptr->seen) em_ptr->obvious = TRUE;
908 em_ptr->do_conf = damroll(3, (em_ptr->dam / 2)) + 1;
909 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
910 (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) ||
911 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
913 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
915 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
919 em_ptr->note = _("には効果がなかった。", " is unaffected.");
920 em_ptr->obvious = FALSE;
928 if (em_ptr->seen) em_ptr->obvious = TRUE;
930 em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1;
931 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
932 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
935 em_ptr->note = _("には効果がなかった。", " is unaffected.");
936 em_ptr->obvious = FALSE;
946 em_ptr->skipped = TRUE;
950 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
952 if (em_ptr->seen) em_ptr->obvious = TRUE;
954 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
956 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
957 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
968 if (em_ptr->seen) em_ptr->obvious = TRUE;
970 if (em_ptr->r_ptr->flagsr & RFR_RES_LITE)
972 em_ptr->note = _("には耐性がある!", " resists!");
973 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
974 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_LITE);
976 else if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
978 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
979 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
980 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
987 if (em_ptr->seen) em_ptr->obvious = TRUE;
989 if (em_ptr->r_ptr->flagsr & RFR_RES_DARK)
991 em_ptr->note = _("には耐性がある!", " resists!");
992 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
993 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_DARK);
1000 if (em_ptr->r_ptr->flags3 & (RF3_HURT_ROCK))
1002 if (em_ptr->seen) em_ptr->obvious = TRUE;
1004 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1006 em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
1007 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1016 case GF_AWAY_UNDEAD:
1018 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1020 bool resists_tele = FALSE;
1022 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1024 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1026 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1027 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1028 resists_tele = TRUE;
1030 else if (em_ptr->r_ptr->level > randint1(100))
1032 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1033 em_ptr->note = _("には耐性がある!", " resists!");
1034 resists_tele = TRUE;
1040 if (em_ptr->seen) em_ptr->obvious = TRUE;
1041 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1042 em_ptr->do_dist = em_ptr->dam;
1047 em_ptr->skipped = TRUE;
1055 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1057 bool resists_tele = FALSE;
1059 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1061 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1063 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1064 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1065 resists_tele = TRUE;
1067 else if (em_ptr->r_ptr->level > randint1(100))
1069 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1070 em_ptr->note = _("には耐性がある!", " resists!");
1071 resists_tele = TRUE;
1077 if (em_ptr->seen) em_ptr->obvious = TRUE;
1078 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1079 em_ptr->do_dist = em_ptr->dam;
1084 em_ptr->skipped = TRUE;
1092 bool resists_tele = FALSE;
1093 if (em_ptr->r_ptr->flagsr & RFR_RES_TELE)
1095 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flagsr & RFR_RES_ALL))
1097 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1098 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1099 resists_tele = TRUE;
1101 else if (em_ptr->r_ptr->level > randint1(100))
1103 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
1104 em_ptr->note = _("には耐性がある!", " resists!");
1105 resists_tele = TRUE;
1111 if (em_ptr->seen) em_ptr->obvious = TRUE;
1113 em_ptr->do_dist = em_ptr->dam;
1119 case GF_TURN_UNDEAD:
1121 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1123 if (em_ptr->seen) em_ptr->obvious = TRUE;
1125 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1127 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1128 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1130 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1131 em_ptr->obvious = FALSE;
1132 em_ptr->do_fear = 0;
1137 em_ptr->skipped = TRUE;
1145 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1147 if (em_ptr->seen) em_ptr->obvious = TRUE;
1149 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1151 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1152 if (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)
1154 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1155 em_ptr->obvious = FALSE;
1156 em_ptr->do_fear = 0;
1161 em_ptr->skipped = TRUE;
1169 if (em_ptr->seen) em_ptr->obvious = TRUE;
1171 em_ptr->do_fear = damroll(3, (em_ptr->dam / 2)) + 1;
1172 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1173 (em_ptr->r_ptr->flags3 & (RF3_NO_FEAR)) ||
1174 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1176 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1177 em_ptr->obvious = FALSE;
1178 em_ptr->do_fear = 0;
1184 case GF_DISP_UNDEAD:
1186 if (em_ptr->r_ptr->flags3 & (RF3_UNDEAD))
1188 if (em_ptr->seen) em_ptr->obvious = TRUE;
1190 /* Learn about em_ptr->effect_type */
1191 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
1193 em_ptr->note = _("は身震いした。", " shudders.");
1194 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1198 em_ptr->skipped = TRUE;
1206 if (em_ptr->r_ptr->flags3 & (RF3_EVIL))
1208 if (em_ptr->seen) em_ptr->obvious = TRUE;
1210 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
1212 em_ptr->note = _("は身震いした。", " shudders.");
1213 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1217 em_ptr->skipped = TRUE;
1225 if (em_ptr->r_ptr->flags3 & (RF3_GOOD))
1227 if (em_ptr->seen) em_ptr->obvious = TRUE;
1229 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
1231 em_ptr->note = _("は身震いした。", " shudders.");
1232 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1236 em_ptr->skipped = TRUE;
1242 case GF_DISP_LIVING:
1244 if (monster_living(em_ptr->m_ptr->r_idx))
1246 if (em_ptr->seen) em_ptr->obvious = TRUE;
1248 em_ptr->note = _("は身震いした。", " shudders.");
1249 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1253 em_ptr->skipped = TRUE;
1261 if (em_ptr->r_ptr->flags3 & (RF3_DEMON))
1263 if (em_ptr->seen) em_ptr->obvious = TRUE;
1265 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
1267 em_ptr->note = _("は身震いした。", " shudders.");
1268 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1272 em_ptr->skipped = TRUE;
1280 if (em_ptr->seen) em_ptr->obvious = TRUE;
1281 em_ptr->note = _("は身震いした。", " shudders.");
1282 em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
1287 if (em_ptr->seen) em_ptr->obvious = TRUE;
1288 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)))
1290 if (em_ptr->who > 0)
1292 if (em_ptr->m_caster_ptr->hp < em_ptr->m_caster_ptr->maxhp)
1294 em_ptr->m_caster_ptr->hp += em_ptr->dam;
1295 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;
1296 if (caster_ptr->health_who == em_ptr->who) caster_ptr->redraw |= (PR_HEALTH);
1297 if (caster_ptr->riding == em_ptr->who) caster_ptr->redraw |= (PR_UHEALTH);
1299 if (em_ptr->see_s_msg)
1301 monster_desc(caster_ptr, em_ptr->killer, em_ptr->m_caster_ptr, 0);
1302 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), em_ptr->killer);
1308 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), em_ptr->m_name);
1309 (void)hp_player(caster_ptr, em_ptr->dam);
1314 if (em_ptr->see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1322 if (em_ptr->seen) em_ptr->obvious = TRUE;
1323 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1325 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1326 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1327 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1329 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1331 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1334 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1337 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1339 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1340 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1343 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1345 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1346 em_ptr->note = _("には耐性がある。", " resists.");
1351 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1352 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1354 if (em_ptr->who > 0) em_ptr->do_conf = randint0(4) + 4;
1355 else em_ptr->do_conf = randint0(8) + 8;
1360 case GF_BRAIN_SMASH:
1362 if (em_ptr->seen) em_ptr->obvious = TRUE;
1363 if (!em_ptr->who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
1365 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1366 (em_ptr->r_ptr->flags3 & RF3_NO_CONF) ||
1367 (em_ptr->r_ptr->level > randint1((em_ptr->caster_lev - 10) < 1 ? 1 : (em_ptr->caster_lev - 10)) + 10))
1369 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF))
1371 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
1374 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1377 else if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1379 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1380 em_ptr->note = _("には完全な耐性がある!", " is immune.");
1383 else if (em_ptr->r_ptr->flags2 & RF2_WEIRD_MIND)
1385 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
1386 em_ptr->note = _("には耐性がある!", " resists!");
1391 em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
1392 em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1393 if (em_ptr->who > 0)
1395 em_ptr->do_conf = randint0(4) + 4;
1396 em_ptr->do_stun = randint0(4) + 4;
1400 em_ptr->do_conf = randint0(8) + 8;
1401 em_ptr->do_stun = randint0(8) + 8;
1403 (void)set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 10);
1410 if (em_ptr->seen) em_ptr->obvious = TRUE;
1411 if (!em_ptr->who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), em_ptr->m_name);
1412 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1414 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1422 if (em_ptr->seen) em_ptr->obvious = TRUE;
1423 if (!em_ptr->who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), em_ptr->m_name);
1425 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1427 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1435 if (em_ptr->seen) em_ptr->obvious = TRUE;
1436 if (!em_ptr->who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), em_ptr->m_name);
1438 if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
1440 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1448 if (em_ptr->seen) em_ptr->obvious = TRUE;
1450 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
1451 "You point at %s, screaming the word, 'DIE!'."), em_ptr->m_name);
1453 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)))
1455 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1462 if (em_ptr->seen) em_ptr->obvious = TRUE;
1463 if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
1465 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1470 if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20))) :
1471 (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200))))
1473 em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
1475 if (em_ptr->m_ptr->hp < em_ptr->dam) em_ptr->dam = em_ptr->m_ptr->hp - 1;
1479 /* todo 乱数で破滅のを弾いた結果が「耐性を持っている」ことになるのはおかしい */
1480 em_ptr->note = _("は耐性を持っている!", "resists!");
1490 if ((floor_ptr->inside_quest && (quest[floor_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(em_ptr->m_ptr)) ||
1491 (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)
1493 msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
1494 em_ptr->skipped = TRUE;
1498 if (is_pet(em_ptr->m_ptr)) nokori_hp = em_ptr->m_ptr->maxhp * 4L;
1499 else if ((caster_ptr->pclass == CLASS_BEASTMASTER) && monster_living(em_ptr->m_ptr->r_idx))
1500 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 10;
1502 nokori_hp = em_ptr->m_ptr->maxhp * 3 / 20;
1504 if (em_ptr->m_ptr->hp >= nokori_hp)
1506 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), em_ptr->m_name);
1507 em_ptr->skipped = TRUE;
1509 else if (em_ptr->m_ptr->hp < randint0(nokori_hp))
1511 if (em_ptr->m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(caster_ptr, em_ptr->g_ptr->m_idx, FALSE, MON_CHAMELEON);
1512 msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
1513 cap_mon = em_ptr->m_ptr->r_idx;
1514 cap_mspeed = em_ptr->m_ptr->mspeed;
1515 cap_hp = em_ptr->m_ptr->hp;
1516 cap_maxhp = em_ptr->m_ptr->max_maxhp;
1517 cap_nickname = em_ptr->m_ptr->nickname;
1518 if (em_ptr->g_ptr->m_idx == caster_ptr->riding)
1520 if (rakuba(caster_ptr, -1, FALSE))
1522 msg_format(_("地面に落とされた。", "You have fallen from %s."), em_ptr->m_name);
1526 delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
1528 return GF_SWITCH_TRUE;
1532 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), em_ptr->m_name);
1533 em_ptr->skipped = TRUE;
1540 return (gf_switch_result)py_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
1547 if (em_ptr->seen) em_ptr->obvious = TRUE;
1548 if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
1550 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1552 em_ptr->skipped = TRUE;
1553 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1556 if (MON_CSLEEP(em_ptr->m_ptr))
1558 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1560 em_ptr->skipped = TRUE;
1564 if (one_in_(5)) effect = 1;
1565 else if (one_in_(4)) effect = 2;
1566 else if (one_in_(3)) effect = 3;
1571 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1572 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1574 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1575 em_ptr->obvious = FALSE;
1579 if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
1581 em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
1585 else if (effect == 2)
1587 em_ptr->do_stun = damroll((caster_ptr->lev / 10) + 3, (em_ptr->dam)) + 1;
1588 if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1589 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1591 em_ptr->do_stun = 0;
1592 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1593 em_ptr->obvious = FALSE;
1596 else if (effect == 3)
1598 if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
1599 (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
1600 (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
1602 if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
1604 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
1607 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1608 em_ptr->obvious = FALSE;
1612 /* Go to sleep (much) later */
1613 em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
1614 em_ptr->do_sleep = 500;
1620 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1628 if (em_ptr->seen) em_ptr->obvious = TRUE;
1629 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")))
1631 if (em_ptr->seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), em_ptr->m_name);
1632 chg_virtue(caster_ptr, V_VITALITY, -1);
1633 return GF_SWITCH_TRUE;
1636 em_ptr->skipped = TRUE;
1642 msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
1644 if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
1646 if (em_ptr->seen) em_ptr->obvious = TRUE;
1648 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
1650 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
1651 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
1658 em_ptr->photo = em_ptr->m_ptr->r_idx;
1663 bool success = FALSE;
1664 if (em_ptr->seen) em_ptr->obvious = TRUE;
1666 if ((em_ptr->r_ptr->flags3 & (RF3_GOOD)) && !floor_ptr->inside_arena)
1668 if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) em_ptr->dam -= 50;
1669 if (em_ptr->dam < 1) em_ptr->dam = 1;
1671 if (is_pet(em_ptr->m_ptr))
1673 em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
1674 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
1677 else if ((em_ptr->r_ptr->flags1 & (RF1_QUESTOR)) ||
1678 (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
1679 (em_ptr->m_ptr->mflag2 & MFLAG2_NOPET) ||
1680 (caster_ptr->cursed & TRC_AGGRAVATE) ||
1681 ((em_ptr->r_ptr->level + 10) > randint1(em_ptr->dam)))
1683 if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
1687 em_ptr->note = _("を支配した。", " is tamed!");
1688 set_pet(caster_ptr, em_ptr->m_ptr);
1689 (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
1691 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
1698 if (!(em_ptr->r_ptr->flags3 & RF3_NO_FEAR))
1700 em_ptr->do_fear = randint1(90) + 10;
1702 else if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
1703 em_ptr->r_ptr->r_flags3 |= (RF3_NO_FEAR);
1711 if (em_ptr->seen) em_ptr->obvious = TRUE;
1713 if (randint0(100 + em_ptr->dam) < (em_ptr->r_ptr->level + 50))
1715 em_ptr->note = _("には効果がなかった。", " is unaffected.");
1722 em_ptr->skipped = TRUE;
1728 return GF_SWITCH_CONTINUE;