3 /* Purpose: Monster spells (attack player) */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
16 #ifdef DRS_SMART_OPTIONS
19 * And now for Intelligent monster attacks (including spells).
21 * Original idea and code by "DRS" (David Reeves Sward).
22 * Major modifications by "BEN" (Ben Harrison).
24 * Give monsters more intelligent attack/spell selection based on
25 * observations of previous attacks on the player, and/or by allowing
26 * the monster to "cheat" and know the player status.
28 * Maintain an idea of the player status, and use that information
29 * to occasionally eliminate "ineffective" spell attacks. We could
30 * also eliminate ineffective normal attacks, but there is no reason
31 * for the monster to do this, since he gains no benefit.
32 * Note that MINDLESS monsters are not allowed to use this code.
33 * And non-INTELLIGENT monsters only use it partially effectively.
35 * Actually learn what the player resists, and use that information
36 * to remove attacks or spells before using them. This will require
37 * much less space, if I am not mistaken. Thus, each monster gets a
38 * set of 32 bit flags, "smart", build from the various "SM_*" flags.
40 * This has the added advantage that attacks and spells are related.
41 * The "smart_learn" option means that the monster "learns" the flags
42 * that should be set, and "smart_cheat" means that he "knows" them.
43 * So "smart_cheat" means that the "smart" field is always up to date,
44 * while "smart_learn" means that the "smart" field is slowly learned.
45 * Both of them have the same effect on the "choose spell" routine.
51 * Internal probability routine
53 static bool int_outof(monster_race *r_ptr, int prob)
55 /* Non-Smart monsters are half as "smart" */
56 if (!(r_ptr->flags2 & RF2_SMART)) prob = prob / 2;
59 return (randint0(100) < prob);
65 * Remove the "bad" spells from a spell list
67 static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
69 monster_type *m_ptr = &m_list[m_idx];
70 monster_race *r_ptr = &r_info[m_ptr->r_idx];
79 /* Too stupid to know anything */
80 if (r_ptr->flags2 & RF2_STUPID) return;
83 /* Must be cheating or learning */
84 if (!smart_cheat && !smart_learn) return;
87 /* Update acquired knowledge */
90 /* Hack -- Occasionally forget player status */
91 if (m_ptr->smart && (randint0(100) < 1)) m_ptr->smart = 0L;
93 /* Use the memorized flags */
98 /* Cheat if requested */
101 /* Know basic info */
102 if (p_ptr->resist_acid) smart |= (SM_RES_ACID);
103 if (p_ptr->oppose_acid) smart |= (SM_OPP_ACID);
104 if (p_ptr->immune_acid) smart |= (SM_IMM_ACID);
105 if (p_ptr->resist_elec) smart |= (SM_RES_ELEC);
106 if (p_ptr->oppose_elec) smart |= (SM_OPP_ELEC);
107 if (p_ptr->immune_elec) smart |= (SM_IMM_ELEC);
108 if (p_ptr->resist_fire) smart |= (SM_RES_FIRE);
109 if (p_ptr->oppose_fire) smart |= (SM_OPP_FIRE);
110 if (p_ptr->immune_fire) smart |= (SM_IMM_FIRE);
111 if (p_ptr->resist_cold) smart |= (SM_RES_COLD);
112 if (p_ptr->oppose_cold) smart |= (SM_OPP_COLD);
113 if (p_ptr->immune_cold) smart |= (SM_IMM_COLD);
115 /* Know poison info */
116 if (p_ptr->resist_pois) smart |= (SM_RES_POIS);
117 if (p_ptr->oppose_pois) smart |= (SM_OPP_POIS);
119 /* Know special resistances */
120 if (p_ptr->resist_neth) smart |= (SM_RES_NETH);
121 if (p_ptr->resist_lite) smart |= (SM_RES_LITE);
122 if (p_ptr->resist_dark) smart |= (SM_RES_DARK);
123 if (p_ptr->resist_fear) smart |= (SM_RES_FEAR);
124 if (p_ptr->resist_conf) smart |= (SM_RES_CONF);
125 if (p_ptr->resist_chaos) smart |= (SM_RES_CHAOS);
126 if (p_ptr->resist_disen) smart |= (SM_RES_DISEN);
127 if (p_ptr->resist_blind) smart |= (SM_RES_BLIND);
128 if (p_ptr->resist_nexus) smart |= (SM_RES_NEXUS);
129 if (p_ptr->resist_sound) smart |= (SM_RES_SOUND);
130 if (p_ptr->resist_shard) smart |= (SM_RES_SHARD);
131 if (p_ptr->reflect) smart |= (SM_IMM_REFLECT);
133 /* Know bizarre "resistances" */
134 if (p_ptr->free_act) smart |= (SM_IMM_FREE);
135 if (!p_ptr->msp) smart |= (SM_IMM_MANA);
143 if (smart & SM_IMM_ACID)
145 f4 &= ~(RF4_BR_ACID);
146 f5 &= ~(RF5_BA_ACID);
147 f5 &= ~(RF5_BO_ACID);
149 else if ((smart & (SM_OPP_ACID)) && (smart & (SM_RES_ACID)))
151 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ACID);
152 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ACID);
153 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ACID);
155 else if ((smart & (SM_OPP_ACID)) || (smart & (SM_RES_ACID)))
157 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ACID);
158 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ACID);
159 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ACID);
163 if (smart & (SM_IMM_ELEC))
165 f4 &= ~(RF4_BR_ELEC);
166 f5 &= ~(RF5_BA_ELEC);
167 f5 &= ~(RF5_BO_ELEC);
169 else if ((smart & (SM_OPP_ELEC)) && (smart & (SM_RES_ELEC)))
171 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ELEC);
172 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ELEC);
173 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ELEC);
175 else if ((smart & (SM_OPP_ELEC)) || (smart & (SM_RES_ELEC)))
177 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ELEC);
178 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ELEC);
179 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ELEC);
183 if (smart & (SM_IMM_FIRE))
185 f4 &= ~(RF4_BR_FIRE);
186 f5 &= ~(RF5_BA_FIRE);
187 f5 &= ~(RF5_BO_FIRE);
189 else if ((smart & (SM_OPP_FIRE)) && (smart & (SM_RES_FIRE)))
191 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_FIRE);
192 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_FIRE);
193 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_FIRE);
195 else if ((smart & (SM_OPP_FIRE)) || (smart & (SM_RES_FIRE)))
197 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_FIRE);
198 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_FIRE);
199 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_FIRE);
203 if (smart & (SM_IMM_COLD))
205 f4 &= ~(RF4_BR_COLD);
206 f5 &= ~(RF5_BA_COLD);
207 f5 &= ~(RF5_BO_COLD);
208 f5 &= ~(RF5_BO_ICEE);
210 else if ((smart & (SM_OPP_COLD)) && (smart & (SM_RES_COLD)))
212 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_COLD);
213 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_COLD);
214 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_COLD);
215 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ICEE);
217 else if ((smart & (SM_OPP_COLD)) || (smart & (SM_RES_COLD)))
219 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_COLD);
220 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_COLD);
221 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_COLD);
222 if (int_outof(r_ptr, 20)) f5 &= ~(RF5_BO_ICEE);
226 if ((smart & (SM_OPP_POIS)) && (smart & (SM_RES_POIS)))
228 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_POIS);
229 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_POIS);
230 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BA_NUKE);
231 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BR_NUKE);
233 else if ((smart & (SM_OPP_POIS)) || (smart & (SM_RES_POIS)))
235 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_POIS);
236 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_POIS);
240 if (smart & (SM_RES_NETH))
242 if (prace_is_(RACE_SPECTRE))
244 f4 &= ~(RF4_BR_NETH);
245 f5 &= ~(RF5_BA_NETH);
246 f5 &= ~(RF5_BO_NETH);
250 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_NETH);
251 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_NETH);
252 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BO_NETH);
256 if (smart & (SM_RES_LITE))
258 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_LITE);
259 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_LITE);
262 if (smart & (SM_RES_DARK))
264 if (prace_is_(RACE_VAMPIRE))
266 f4 &= ~(RF4_BR_DARK);
267 f5 &= ~(RF5_BA_DARK);
271 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_DARK);
272 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_DARK);
276 if (smart & (SM_RES_FEAR))
281 if (smart & (SM_RES_CONF))
284 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_CONF);
287 if (smart & (SM_RES_CHAOS))
289 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_CHAO);
290 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BA_CHAO);
293 if (smart & (SM_RES_DISEN))
295 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_DISE);
298 if (smart & (SM_RES_BLIND))
303 if (smart & (SM_RES_NEXUS))
305 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_NEXU);
306 f6 &= ~(RF6_TELE_LEVEL);
309 if (smart & (SM_RES_SOUND))
311 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_SOUN);
314 if (smart & (SM_RES_SHARD))
316 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_SHAR);
319 if (smart & (SM_IMM_REFLECT))
321 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_COLD);
322 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_FIRE);
323 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ACID);
324 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ELEC);
325 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_NETH);
326 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_WATE);
327 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_MANA);
328 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
329 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
330 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
331 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_SHOOT);
334 if (smart & (SM_IMM_FREE))
340 if (smart & (SM_IMM_MANA))
342 f5 &= ~(RF5_DRAIN_MANA);
345 /* XXX XXX XXX No spells left? */
346 /* if (!f4 && !f5 && !f6) ... */
353 #endif /* DRS_SMART_OPTIONS */
357 * Determine if there is a space near the player in which
358 * a summoned creature can appear
360 bool summon_possible(int y1, int x1)
364 /* Start at the player's location, and check 2 grids in each dir */
365 for (y = y1 - 2; y <= y1 + 2; y++)
367 for (x = x1 - 2; x <= x1 + 2; x++)
369 /* Ignore illegal locations */
370 if (!in_bounds(y, x)) continue;
372 /* Only check a circular area */
373 if (distance(y1, x1, y, x)>2) continue;
376 /* Hack: no summon on glyph of warding */
377 if (cave[y][x].feat == FEAT_GLYPH) continue;
378 if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
381 /* ...nor on the Pattern */
382 if ((cave[y][x].feat >= FEAT_PATTERN_START)
383 && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
385 /* Require empty floor grid in line of sight */
386 if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE);
394 static bool raise_possible(int y, int x)
397 s16b this_o_idx, next_o_idx = 0;
400 for (xx = x - 5; xx <= x + 5; xx++)
402 for (yy = y - 5; yy <= y + 5; yy++)
404 if (distance(y, x, yy, xx) > 5) continue;
405 if (!los(y, x, yy, xx)) continue;
407 c_ptr = &cave[yy][xx];
408 /* Scan the pile of objects */
409 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
412 object_type *o_ptr = &o_list[this_o_idx];
414 /* Acquire next object */
415 next_o_idx = o_ptr->next_o_idx;
417 /* Known to be worthless? */
418 if (o_ptr->tval == TV_CORPSE)
428 * Originally, it was possible for a friendly to shoot another friendly.
429 * Change it so a "clean shot" means no equally friendly monster is
430 * between the attacker and target.
433 * Determine if a bolt spell will hit the player.
435 * This is exactly like "projectable", but it will
436 * return FALSE if a monster is in the way.
437 * no equally friendly monster is
438 * between the attacker and target.
440 bool clean_shot(int y1, int x1, int y2, int x2, bool friend)
442 /* Must be the same as projectable() */
449 /* Check the projection path */
450 grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
452 /* No grid is ever projectable from itself */
453 if (!grid_n) return (FALSE);
456 y = GRID_Y(grid_g[grid_n-1]);
457 x = GRID_X(grid_g[grid_n-1]);
459 /* May not end in an unrequested grid */
460 if ((y != y2) || (x != x2)) return (FALSE);
462 for (i = 0; i < grid_n; i++)
464 y = GRID_Y(grid_g[i]);
465 x = GRID_X(grid_g[i]);
467 if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
469 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
470 if (friend == is_pet(m_ptr))
475 /* Pets may not shoot through the character - TNB */
476 if ((y == py) && (x == px))
478 if (friend) return (FALSE);
486 * Cast a bolt at the player
487 * Stop if we hit a monster
488 * Affect monsters and the player
490 static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
492 int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
494 /* Target the player with a bolt attack */
495 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
498 static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
500 int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER | PROJECT_NO_REF;
502 /* Target the player with a bolt attack */
503 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
508 * Cast a breath (or ball) attack at the player
509 * Pass over any monsters that may be in the way
510 * Affect grids, objects, monsters, and the player
512 static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
514 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
516 monster_type *m_ptr = &m_list[m_idx];
517 monster_race *r_ptr = &r_info[m_ptr->r_idx];
519 /* Determine the radius of the blast */
520 if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
522 /* Handle breath attacks */
523 if (breath) rad = 0 - rad;
525 if (typ == GF_ROCKET) flg |= PROJECT_STOP;
527 /* Target the player with a ball attack */
528 (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
532 void curse_equipment(int chance, int heavy_chance)
534 bool changed = FALSE;
536 object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
538 if (randint1(100) > chance) return;
540 if (!o_ptr->k_idx) return;
542 object_flags(o_ptr, &o1, &o2, &o3);
545 /* Extra, biased saving throw for blessed items */
546 if ((o3 & TR3_BLESSED) && (randint1(888) > chance))
548 char o_name[MAX_NLEN];
549 object_desc(o_name, o_ptr, FALSE, 0);
551 msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
553 msg_format("Your %s resist%s cursing!", o_name,
556 ((o_ptr->number > 1) ? "" : "s"));
557 /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
561 if ((randint1(100) <= heavy_chance) &&
562 (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
564 if (!(o3 & TR3_HEAVY_CURSE))
566 o_ptr->art_flags3 |= TR3_HEAVY_CURSE;
567 o_ptr->art_flags3 |= TR3_CURSED;
568 o_ptr->ident |= IDENT_CURSED;
572 if (!(o_ptr->ident & IDENT_CURSED))
574 o_ptr->art_flags3 |= TR3_CURSED;
575 o_ptr->ident |= IDENT_CURSED;
581 msg_print("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤ò¤È¤ê¤Þ¤¤¤¿...");
583 msg_print("There is a malignant black aura surrounding you...");
586 o_ptr->feeling = FEEL_NONE;
592 * Return TRUE if a spell is good for hurting the player (directly).
594 static bool spell_attack(byte spell)
596 /* All RF4 spells hurt (except for shriek and dispel) */
597 if (spell < 128 && spell > 98) return (TRUE);
599 /* Various "ball" spells */
600 if (spell >= 128 && spell <= 128 + 8) return (TRUE);
602 /* "Cause wounds" and "bolt" spells */
603 if (spell >= 128 + 12 && spell < 128 + 27) return (TRUE);
606 if (spell == 160 + 1) return (TRUE);
609 if (spell == 160 + 11) return (TRUE);
617 * Return TRUE if a spell is good for escaping.
619 static bool spell_escape(byte spell)
621 /* Blink or Teleport */
622 if (spell == 160 + 4 || spell == 160 + 5) return (TRUE);
624 /* Teleport the player away */
625 if (spell == 160 + 9 || spell == 160 + 10) return (TRUE);
627 /* Isn't good for escaping */
632 * Return TRUE if a spell is good for annoying the player.
634 static bool spell_annoy(byte spell)
637 if (spell == 96 + 0) return (TRUE);
639 /* Brain smash, et al (added curses) */
640 if (spell >= 128 + 9 && spell <= 128 + 14) return (TRUE);
642 /* Scare, confuse, blind, slow, paralyze */
643 if (spell >= 128 + 27 && spell <= 128 + 31) return (TRUE);
646 if (spell == 160 + 8) return (TRUE);
649 if (spell == 160 + 10) return (TRUE);
651 /* Darkness, make traps, cause amnesia */
652 if (spell >= 160 + 12 && spell <= 160 + 14) return (TRUE);
659 * Return TRUE if a spell summons help.
661 static bool spell_summon(byte spell)
663 /* All summon spells */
664 if (spell >= 160 + 16) return (TRUE);
672 * Return TRUE if a spell raise-dead.
674 static bool spell_raise(byte spell)
676 /* All raise-dead spells */
677 if (spell == 160 + 15) return (TRUE);
685 * Return TRUE if a spell is good in a tactical situation.
687 static bool spell_tactic(byte spell)
690 if (spell == 160 + 4) return (TRUE);
697 * Return TRUE if a spell makes invulnerable.
699 static bool spell_invulner(byte spell)
701 /* Invulnerability */
702 if (spell == 160 + 3) return (TRUE);
704 /* No invulnerability */
709 * Return TRUE if a spell hastes.
711 static bool spell_haste(byte spell)
714 if (spell == 160 + 0) return (TRUE);
716 /* Not a haste spell */
722 * Return TRUE if a spell world.
724 static bool spell_world(byte spell)
727 if (spell == 160 + 6) return (TRUE);
729 /* Not a haste spell */
735 * Return TRUE if a spell special.
737 static bool spell_special(byte spell)
739 if (p_ptr->inside_battle) return FALSE;
742 if (spell == 160 + 7) return (TRUE);
744 /* Not a haste spell */
750 * Return TRUE if a spell psycho-spear.
752 static bool spell_psy_spe(byte spell)
755 if (spell == 160 + 11) return (TRUE);
757 /* Not a haste spell */
763 * Return TRUE if a spell is good for healing.
765 static bool spell_heal(byte spell)
768 if (spell == 160 + 2) return (TRUE);
776 * Return TRUE if a spell is good for dispel.
778 static bool spell_dispel(byte spell)
781 if (spell == 96 + 2) return (TRUE);
789 * Check should monster cast dispel spell.
791 static bool dispel_check(int m_idx)
793 monster_type *m_ptr = &m_list[m_idx];
794 monster_race *r_ptr = &r_info[m_ptr->r_idx];
797 if (p_ptr->invuln) return (TRUE);
800 if (p_ptr->wraith_form) return (TRUE);
803 if (p_ptr->shield) return (TRUE);
806 if (p_ptr->magicdef) return (TRUE);
809 if (p_ptr->multishadow) return (TRUE);
812 if (p_ptr->dustrobe) return (TRUE);
814 /* Berserk Strength */
815 if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) return (TRUE);
817 /* Invulnability song */
818 if (music_singing(MUSIC_INVULN)) return (TRUE);
821 if (p_ptr->mimic_form == MIMIC_DEMON_LORD) return (TRUE);
823 /* Elemental resistances */
824 if (r_ptr->flags4 & RF4_BR_ACID)
826 if (!p_ptr->immune_acid && p_ptr->oppose_acid) return (TRUE);
828 if (p_ptr->special_defense & DEFENSE_ACID) return (TRUE);
831 if (r_ptr->flags4 & RF4_BR_FIRE)
833 if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44))
835 if(!p_ptr->immune_fire && p_ptr->oppose_fire) return (TRUE);
837 if(p_ptr->special_defense & DEFENSE_FIRE) return(TRUE);
841 if (r_ptr->flags4 & RF4_BR_ELEC)
843 if (!p_ptr->immune_elec && p_ptr->oppose_elec) return (TRUE);
845 if (p_ptr->special_defense & DEFENSE_ELEC) return (TRUE);
848 if (r_ptr->flags4 & RF4_BR_COLD)
850 if (!p_ptr->immune_cold && p_ptr->oppose_cold) return (TRUE);
852 if (p_ptr->special_defense & DEFENSE_COLD) return (TRUE);
855 if (r_ptr->flags4 & (RF4_BR_POIS | RF4_BR_NUKE))
857 if (!((p_ptr->pclass == CLASS_NINJA) && p_ptr->lev > 44))
859 if (p_ptr->oppose_pois) return (TRUE);
861 if (p_ptr->special_defense & DEFENSE_POIS) return (TRUE);
865 /* Elemental resist music */
866 if (music_singing(MUSIC_RESIST))
868 if (r_ptr->flags4 & (RF4_BR_ACID | RF4_BR_FIRE | RF4_BR_ELEC | RF4_BR_COLD | RF4_BR_POIS)) return (TRUE);
871 /* Ultimate resistance */
872 if (p_ptr->ult_res) return (TRUE);
874 /* Potion of Neo Tsuyosi special */
875 if (p_ptr->tsuyoshi) return (TRUE);
877 /* Elemental Brands */
878 if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flags3 & RF3_IM_ACID)) return (TRUE);
879 if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flags3 & RF3_IM_FIRE)) return (TRUE);
880 if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flags3 & RF3_IM_ELEC)) return (TRUE);
881 if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flags3 & RF3_IM_COLD)) return (TRUE);
882 if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flags3 & RF3_IM_POIS)) return (TRUE);
885 if (p_ptr->pspeed < 145)
887 if (p_ptr->fast) return (TRUE);
889 if (music_singing(MUSIC_SPEED)) return (TRUE);
891 if (music_singing(MUSIC_SHERO)) return (TRUE);
895 if (p_ptr->lightspeed && (m_ptr->mspeed < 136)) return (TRUE);
897 if (p_ptr->riding && (m_list[p_ptr->riding].mspeed < 135))
899 if (m_list[p_ptr->riding].fast) return (TRUE);
902 /* No need to cast dispel spell */
908 * Have a monster choose a spell from a list of "useful" spells.
910 * Note that this list does NOT include spells that will just hit
911 * other monsters, and the list is restricted when the monster is
912 * "desperate". Should that be the job of this function instead?
914 * Stupid monsters will just pick a spell randomly. Smart monsters
915 * will choose more "intelligently".
917 * Use the helper functions above to put spells into categories.
919 * This function may well be an efficiency bottleneck.
921 static int choose_attack_spell(int m_idx, byte spells[], byte num)
923 monster_type *m_ptr = &m_list[m_idx];
924 monster_race *r_ptr = &r_info[m_ptr->r_idx];
926 byte escape[96], escape_num = 0;
927 byte attack[96], attack_num = 0;
928 byte summon[96], summon_num = 0;
929 byte tactic[96], tactic_num = 0;
930 byte annoy[96], annoy_num = 0;
931 byte invul[96], invul_num = 0;
932 byte haste[96], haste_num = 0;
933 byte world[96], world_num = 0;
934 byte special[96], special_num = 0;
935 byte psy_spe[96], psy_spe_num = 0;
936 byte raise[96], raise_num = 0;
937 byte heal[96], heal_num = 0;
938 byte dispel[96], dispel_num = 0;
942 /* Stupid monsters choose randomly */
943 if (r_ptr->flags2 & (RF2_STUPID))
946 return (spells[randint0(num)]);
949 /* Categorize spells */
950 for (i = 0; i < num; i++)
953 if (spell_escape(spells[i])) escape[escape_num++] = spells[i];
956 if (spell_attack(spells[i])) attack[attack_num++] = spells[i];
959 if (spell_summon(spells[i])) summon[summon_num++] = spells[i];
961 /* Tactical spell? */
962 if (spell_tactic(spells[i])) tactic[tactic_num++] = spells[i];
964 /* Annoyance spell? */
965 if (spell_annoy(spells[i])) annoy[annoy_num++] = spells[i];
967 /* Invulnerability spell? */
968 if (spell_invulner(spells[i])) invul[invul_num++] = spells[i];
971 if (spell_haste(spells[i])) haste[haste_num++] = spells[i];
974 if (spell_world(spells[i])) world[world_num++] = spells[i];
977 if (spell_special(spells[i])) special[special_num++] = spells[i];
979 /* Psycho-spear spell? */
980 if (spell_psy_spe(spells[i])) psy_spe[psy_spe_num++] = spells[i];
982 /* Raise-dead spell? */
983 if (spell_raise(spells[i])) raise[raise_num++] = spells[i];
986 if (spell_heal(spells[i])) heal[heal_num++] = spells[i];
989 if (spell_dispel(spells[i])) dispel[dispel_num++] = spells[i];
992 /*** Try to pick an appropriate spell type ***/
995 if (world_num && (randint0(100) < 15) && !world_monster)
997 /* Choose haste spell */
998 return (world[randint0(world_num)]);
1004 bool success = FALSE;
1005 switch(m_ptr->r_idx)
1009 if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num) success = TRUE;
1013 if (success) return (special[randint0(special_num)]);
1016 /* Still hurt badly, couldn't flee, attempt to heal */
1017 if (m_ptr->hp < m_ptr->maxhp / 3 && one_in_(2))
1019 /* Choose heal spell if possible */
1020 if (heal_num) return (heal[randint0(heal_num)]);
1023 /* Hurt badly or afraid, attempt to flee */
1024 if (((m_ptr->hp < m_ptr->maxhp / 3) || m_ptr->monfear) && one_in_(2))
1026 /* Choose escape spell if possible */
1027 if (escape_num) return (escape[randint0(escape_num)]);
1033 bool success = FALSE;
1034 switch(m_ptr->r_idx)
1037 if (randint0(100) < 50) success = TRUE;
1039 case MON_BANORLUPART:
1040 if (randint0(100) < 70) success = TRUE;
1044 if (success) return (special[randint0(special_num)]);
1047 /* Player is close and we have attack spells, blink away */
1048 if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
1050 /* Choose tactical spell */
1051 if (tactic_num) return (tactic[randint0(tactic_num)]);
1054 /* Summon if possible (sometimes) */
1055 if (summon_num && (randint0(100) < 40))
1057 /* Choose summon spell */
1058 return (summon[randint0(summon_num)]);
1062 if (dispel_num && one_in_(2))
1064 /* Choose dispel spell if possible */
1065 if (dispel_check(m_idx))
1067 return (dispel[randint0(dispel_num)]);
1071 /* Raise-dead if possible (sometimes) */
1072 if (raise_num && (randint0(100) < 40) && raise_possible(m_ptr->fy, m_ptr->fx))
1074 /* Choose raise-dead spell */
1075 return (raise[randint0(raise_num)]);
1078 /* Attack spell (most of the time) */
1081 if (psy_spe_num && (randint0(100) < 50))
1083 /* Choose attack spell */
1084 return (psy_spe[randint0(psy_spe_num)]);
1086 else if (attack_num && (randint0(100) < 40))
1088 /* Choose attack spell */
1089 return (attack[randint0(attack_num)]);
1092 else if (attack_num && (randint0(100) < 85))
1094 /* Choose attack spell */
1095 return (attack[randint0(attack_num)]);
1098 /* Try another tactical spell (sometimes) */
1099 if (tactic_num && (randint0(100) < 50) && !world_monster)
1101 /* Choose tactic spell */
1102 return (tactic[randint0(tactic_num)]);
1105 /* Cast globe of invulnerability if not already in effect */
1106 if (invul_num && !(m_ptr->invulner) && (randint0(100) < 50))
1108 /* Choose Globe of Invulnerability */
1109 return (invul[randint0(invul_num)]);
1112 /* We're hurt (not badly), try to heal */
1113 if ((m_ptr->hp < m_ptr->maxhp * 3 / 4) && (randint0(100) < 25))
1115 /* Choose heal spell if possible */
1116 if (heal_num) return (heal[randint0(heal_num)]);
1119 /* Haste self if we aren't already somewhat hasted (rarely) */
1120 if (haste_num && (randint0(100) < 20) && !(m_ptr->fast))
1122 /* Choose haste spell */
1123 return (haste[randint0(haste_num)]);
1126 /* Annoy player (most of the time) */
1127 if (annoy_num && (randint0(100) < 80))
1129 /* Choose annoyance spell */
1130 return (annoy[randint0(annoy_num)]);
1133 /* Choose no spell */
1139 * Creatures can cast spells, shoot missiles, and breathe.
1141 * Returns "TRUE" if a spell (or whatever) was (successfully) cast.
1143 * XXX XXX XXX This function could use some work, but remember to
1144 * keep it as optimized as possible, while retaining generic code.
1146 * Verify the various "blind-ness" checks in the code.
1148 * XXX XXX XXX Note that several effects should really not be "seen"
1149 * if the player is blind. See also "effects.c" for other "mistakes".
1151 * Perhaps monsters should breathe at locations *near* the player,
1152 * since this would allow them to inflict "partial" damage.
1154 * Perhaps smart monsters should decline to use "bolt" spells if
1155 * there is a monster in the way, unless they wish to kill it.
1157 * Note that, to allow the use of the "track_target" option at some
1158 * later time, certain non-optimal things are done in the code below,
1159 * including explicit checks against the "direct" variable, which is
1160 * currently always true by the time it is checked, but which should
1161 * really be set according to an explicit "projectable()" test, and
1162 * the use of generic "x,y" locations instead of the player location,
1163 * with those values being initialized with the player location.
1165 * It will not be possible to "correctly" handle the case in which a
1166 * monster attempts to attack a location which is thought to contain
1167 * the player, but which in fact is nowhere near the player, since this
1168 * might induce all sorts of messages about the attack itself, and about
1169 * the effects of the attack, which the player might or might not be in
1170 * a position to observe. Thus, for simplicity, it is probably best to
1171 * only allow "faulty" attacks by a monster if one of the important grids
1172 * (probably the initial or final grid) is in fact in view of the player.
1173 * It may be necessary to actually prevent spell attacks except when the
1174 * monster actually has line of sight to the player. Note that a monster
1175 * could be left in a bizarre situation after the player ducked behind a
1176 * pillar and then teleported away, for example.
1178 * Note that certain spell attacks do not use the "project()" function
1179 * but "simulate" it via the "direct" variable, which is always at least
1180 * as restrictive as the "project()" function. This is necessary to
1181 * prevent "blindness" attacks and such from bending around walls, etc,
1182 * and to allow the use of the "track_target" option in the future.
1184 * Note that this function attempts to optimize the use of spells for the
1185 * cases in which the monster has no spells, or has spells but cannot use
1186 * them, or has spells but they will have no "useful" effect. Note that
1187 * this function has been an efficiency bottleneck in the past.
1189 * Note the special "MFLAG_NICE" flag, which prevents a monster from using
1190 * any spell attacks until the player has had a single chance to move.
1192 bool make_attack_spell(int m_idx)
1194 int k, chance, thrown_spell = 0, rlev, failrate;
1195 byte spell[96], num = 0;
1197 monster_type *m_ptr = &m_list[m_idx];
1198 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1202 bool no_inate = FALSE;
1203 bool do_disi = FALSE;
1205 int s_num_6 = (easy_band ? 2 : 6);
1206 int s_num_4 = (easy_band ? 1 : 4);
1208 /* Target location */
1215 /* Extract the blind-ness */
1216 bool blind = (p_ptr->blind ? TRUE : FALSE);
1218 /* Extract the "see-able-ness" */
1219 bool seen = (!blind && m_ptr->ml);
1221 bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
1222 bool learnable = (seen && maneable && !world_monster);
1224 /* Assume "normal" target */
1227 /* Assume "projectable" */
1230 /* Cannot cast spells when confused */
1231 if (m_ptr->confused)
1233 reset_target(m_ptr);
1237 /* Cannot cast spells when nice */
1238 if (m_ptr->mflag & MFLAG_NICE) return (FALSE);
1239 if (!is_hostile(m_ptr)) return (FALSE);
1241 /* Hack -- Extract the spell probability */
1242 chance = (r_ptr->freq_inate + r_ptr->freq_spell) / 2;
1244 /* Not allowed to cast spells */
1245 if (!chance) return (FALSE);
1248 if (stupid_monsters)
1250 /* Only do spells occasionally */
1251 if (randint0(100) >= chance) return (FALSE);
1255 if (randint0(100) >= chance) return (FALSE);
1257 /* Sometimes forbid inate attacks (breaths) */
1258 if (randint0(100) >= (chance * 2)) no_inate = TRUE;
1261 /* XXX XXX XXX Handle "track_target" option (?) */
1264 /* Extract the racial spell flags */
1269 /* Hack -- require projectable player */
1273 if ((m_ptr->cdis > MAX_RANGE) && !m_ptr->target_y) return (FALSE);
1276 if (projectable(m_ptr->fy, m_ptr->fx, y, x))
1278 /* Breath disintegration to the glyph */
1279 if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
1282 /* Check path to next grid */
1285 bool success = FALSE;
1287 if ((r_ptr->flags4 & RF4_BR_DISI) &&
1288 (m_ptr->cdis < MAX_RANGE/2) &&
1289 in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
1290 (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
1299 int tonari_y[4][8] = {{-1,-1,-1,0,0,1,1,1},
1300 {-1,-1,-1,0,0,1,1,1},
1301 {1,1,1,0,0,-1,-1,-1},
1302 {1,1,1,0,0,-1,-1,-1}};
1303 int tonari_x[4][8] = {{-1,0,1,-1,1,-1,0,1},
1304 {1,0,-1,1,-1,1,0,-1},
1305 {-1,0,1,-1,1,-1,0,1},
1306 {1,0,-1,1,-1,1,0,-1}};
1308 if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
1309 else if (m_ptr->fy < py) tonari = 1;
1310 else if (m_ptr->fx < px) tonari = 2;
1313 for (i = 0; i < 8; i++)
1315 int next_x = x + tonari_x[tonari][i];
1316 int next_y = y + tonari_y[tonari][i];
1319 /* Access the next grid */
1320 c_ptr = &cave[next_y][next_x];
1322 /* Skip door, rubble, wall */
1323 if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue;
1326 if (c_ptr->feat == FEAT_TREES) continue;
1329 if (c_ptr->feat == FEAT_MOUNTAIN) continue;
1331 if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
1343 if (m_ptr->target_y && m_ptr->target_x)
1345 y = m_ptr->target_y;
1346 x = m_ptr->target_x;
1347 f4 &= (RF4_INDIRECT_MASK);
1348 f5 &= (RF5_INDIRECT_MASK);
1349 f6 &= (RF6_INDIRECT_MASK);
1355 if (!success) return FALSE;
1359 reset_target(m_ptr);
1361 /* Extract the monster level */
1362 rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
1364 if (!stupid_monsters)
1366 /* Forbid inate attacks sometimes */
1367 if (no_inate) f4 &= 0x500000FF;
1372 f5 &= ~(RF5_DRAIN_MANA);
1374 if ((p_ptr->pclass == CLASS_NINJA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)))
1376 f6 &= ~(RF6_DARKNESS);
1379 if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
1381 f4 &= (RF4_NOMAGIC_MASK);
1382 f5 &= (RF5_NOMAGIC_MASK);
1383 f6 &= (RF6_NOMAGIC_MASK);
1386 /* Hack -- allow "desperate" spells */
1387 if ((r_ptr->flags2 & (RF2_SMART)) &&
1388 (m_ptr->hp < m_ptr->maxhp / 10) &&
1389 (randint0(100) < 50))
1391 /* Require intelligent spells */
1392 f4 &= (RF4_INT_MASK);
1393 f5 &= (RF5_INT_MASK);
1394 f6 &= (RF6_INT_MASK);
1396 /* No spells left */
1397 if (!f4 && !f5 && !f6) return (FALSE);
1400 /* Remove the "ineffective" spells */
1401 remove_bad_spells(m_idx, &f4, &f5, &f6);
1403 if (p_ptr->inside_arena)
1405 f4 &= ~(RF4_SUMMON_MASK);
1406 f5 &= ~(RF5_SUMMON_MASK);
1407 f6 &= ~(RF6_SUMMON_MASK);
1410 /* No spells left */
1411 if (!f4 && !f5 && !f6) return (FALSE);
1413 if (!stupid_monsters)
1415 /* Check for a clean bolt shot */
1416 if (((f4 & RF4_BOLT_MASK) ||
1417 (f5 & RF5_BOLT_MASK) ||
1418 (f6 & RF6_BOLT_MASK)) &&
1419 !(r_ptr->flags2 & RF2_STUPID) &&
1420 !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
1422 /* Remove spells that will only hurt friends */
1423 f4 &= ~(RF4_BOLT_MASK);
1424 f5 &= ~(RF5_BOLT_MASK);
1425 f6 &= ~(RF6_BOLT_MASK);
1428 /* Check for a possible summon */
1429 if (((f4 & RF4_SUMMON_MASK) ||
1430 (f5 & RF5_SUMMON_MASK) ||
1431 (f6 & RF6_SUMMON_MASK)) &&
1432 !(r_ptr->flags2 & RF2_STUPID) &&
1433 !(summon_possible(y, x)))
1435 /* Remove summoning spells */
1436 f4 &= ~(RF4_SUMMON_MASK);
1437 f5 &= ~(RF5_SUMMON_MASK);
1438 f6 &= ~(RF6_SUMMON_MASK);
1441 /* No spells left */
1442 if (!f4 && !f5 && !f6) return (FALSE);
1445 /* Extract the "inate" spells */
1446 for (k = 0; k < 32; k++)
1448 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
1451 /* Extract the "normal" spells */
1452 for (k = 0; k < 32; k++)
1454 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
1457 /* Extract the "bizarre" spells */
1458 for (k = 0; k < 32; k++)
1460 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
1463 /* No spells left */
1464 if (!num) return (FALSE);
1466 /* Stop if player is dead or gone */
1467 if (!alive || death) return (FALSE);
1469 /* Stop if player is leaving */
1470 if (p_ptr->leaving) return (FALSE);
1472 /* Get the monster name (or "it") */
1473 monster_desc(m_name, m_ptr, 0x00);
1475 /* Get the monster possessive ("his"/"her"/"its") */
1476 monster_desc(m_poss, m_ptr, 0x22);
1478 /* Hack -- Get the "died from" name */
1479 monster_desc(ddesc, m_ptr, 0x88);
1481 if (stupid_monsters)
1483 /* Choose a spell to cast */
1484 thrown_spell = spell[randint0(num)];
1489 if (do_disi) thrown_spell = 96+31;
1494 thrown_spell = choose_attack_spell(m_idx, spell, num);
1495 if (thrown_spell) break;
1499 /* Abort if no spell was chosen */
1500 if (!thrown_spell) return (FALSE);
1502 /* Calculate spell failure rate */
1503 failrate = 25 - (rlev + 3) / 4;
1505 /* Hack -- Stupid monsters will never fail (for jellies and such) */
1506 if (r_ptr->flags2 & RF2_STUPID) failrate = 0;
1508 /* Check for spell failure (inate attacks never fail) */
1509 if ((thrown_spell >= 128) && ((m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate)))
1513 if (thrown_spell != (160+7)) /* Not RF6_SPECIAL */
1516 msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
1518 msg_format("%^s tries to cast a spell, but fails.", m_name);
1526 /* Cast the spell. */
1527 switch (thrown_spell)
1535 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
1537 msg_format("%^s makes a high pitched shriek.", m_name);
1540 aggravate_monsters(m_idx);
1554 if (x!=px || y!=py) return (FALSE);
1557 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1558 else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
1560 if (blind) msg_format("%^s mumbles powerfully.", m_name);
1561 else msg_format("%^s invokes a dispel magic.", m_name);
1564 set_lightspeed(0, TRUE);
1566 set_shield(0, TRUE);
1567 set_blessed(0, TRUE);
1568 set_tsuyoshi(0, TRUE);
1571 set_protevil(0, TRUE);
1572 set_invuln(0, TRUE);
1573 set_wraith_form(0, TRUE);
1574 set_kabenuke(0, TRUE);
1575 set_tim_res_nether(0, TRUE);
1576 set_tim_res_time(0, TRUE);
1578 set_tim_reflect(0,TRUE);
1579 set_multishadow(0,TRUE);
1580 set_dustrobe(0,TRUE);
1582 set_tim_invis(0, TRUE);
1583 set_tim_infra(0, TRUE);
1584 set_tim_esp(0, TRUE);
1585 set_tim_regen(0, TRUE);
1586 set_tim_stealth(0, TRUE);
1587 set_tim_ffall(0, TRUE);
1588 set_tim_sh_touki(0, TRUE);
1589 set_tim_sh_fire(0, TRUE);
1590 set_magicdef(0, TRUE);
1591 set_resist_magic(0, TRUE);
1592 set_oppose_acid(0, TRUE);
1593 set_oppose_elec(0, TRUE);
1594 set_oppose_fire(0, TRUE);
1595 set_oppose_cold(0, TRUE);
1596 set_oppose_pois(0, TRUE);
1597 set_ultimate_res(0, TRUE);
1598 set_mimic(0, 0, TRUE);
1599 set_ele_attack(0, 0);
1600 set_ele_immune(0, 0);
1601 /* Cancel glowing hands */
1602 if (p_ptr->special_attack & ATTACK_CONFUSE)
1604 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1606 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1608 msg_print("Your hands stop glowing.");
1612 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
1614 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
1615 p_ptr->magic_num1[0] = 0;
1617 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
1619 msg_print("Your singing is interrupted.");
1621 p_ptr->action = ACTION_NONE;
1623 /* Recalculate bonuses */
1624 p_ptr->update |= (PU_BONUS | PU_HP);
1627 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1629 /* Update monsters */
1630 p_ptr->update |= (PU_MONSTERS);
1633 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1635 p_ptr->energy -= 100;
1639 m_list[p_ptr->riding].invulner = 0;
1640 m_list[p_ptr->riding].fast = 0;
1641 m_list[p_ptr->riding].slow = 0;
1642 p_ptr->update |= PU_BONUS;
1643 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH;
1644 p_ptr->redraw |= (PR_UHEALTH);
1648 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1649 msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
1651 learn_spell(MS_DISPEL);
1660 if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
1662 if (blind) msg_format("%^s shoots something.", m_name);
1666 else msg_format("%^s¤¬¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name);
1668 else msg_format("%^s fires a rocket.", m_name);
1671 dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
1672 breath(y, x, m_idx, GF_ROCKET,
1673 dam, 2, FALSE, MS_ROCKET, learnable);
1674 update_smart_learn(m_idx, DRS_SHARD);
1681 if (x!=px || y!=py) return (FALSE);
1684 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1686 if (blind) msg_format("%^s makes a strange noise.", m_name);
1690 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1692 else msg_format("%^s fires an arrow.", m_name);
1695 dam = damroll(r_ptr->blow[0].d_dice, r_ptr->blow[0].d_side);
1696 bolt(m_idx, GF_ARROW, dam, MS_SHOOT, learnable);
1697 update_smart_learn(m_idx, DRS_REFLECT);
1727 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1729 if (blind) msg_format("%^s breathes.", m_name);
1733 else msg_format("%^s¤¬»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1735 else msg_format("%^s breathes acid.", m_name);
1738 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1739 breath(y, x, m_idx, GF_ACID, dam, 0, TRUE, MS_BR_ACID, learnable);
1740 update_smart_learn(m_idx, DRS_ACID);
1749 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1751 if (blind) msg_format("%^s breathes.", m_name);
1755 else msg_format("%^s¤¬°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1757 else msg_format("%^s breathes lightning.", m_name);
1760 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1761 breath(y, x, m_idx, GF_ELEC, dam,0, TRUE, MS_BR_ELEC, learnable);
1762 update_smart_learn(m_idx, DRS_ELEC);
1771 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1773 if (blind) msg_format("%^s breathes.", m_name);
1777 else msg_format("%^s¤¬²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1779 else msg_format("%^s breathes fire.", m_name);
1782 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1783 breath(y, x, m_idx, GF_FIRE, dam,0, TRUE, MS_BR_FIRE, learnable);
1784 update_smart_learn(m_idx, DRS_FIRE);
1793 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1795 if (blind) msg_format("%^s breathes.", m_name);
1799 else msg_format("%^s¤¬Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1801 else msg_format("%^s breathes frost.", m_name);
1804 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1805 breath(y, x, m_idx, GF_COLD, dam,0, TRUE, MS_BR_COLD, learnable);
1806 update_smart_learn(m_idx, DRS_COLD);
1815 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1817 if (blind) msg_format("%^s breathes.", m_name);
1821 else msg_format("%^s¤¬¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1823 else msg_format("%^s breathes gas.", m_name);
1826 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1827 breath(y, x, m_idx, GF_POIS, dam, 0, TRUE, MS_BR_POIS, learnable);
1828 update_smart_learn(m_idx, DRS_POIS);
1838 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1840 if (blind) msg_format("%^s breathes.", m_name);
1844 else msg_format("%^s¤¬ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1846 else msg_format("%^s breathes nether.", m_name);
1849 dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1850 breath(y, x, m_idx, GF_NETHER, dam,0, TRUE, MS_BR_NETHER, learnable);
1851 update_smart_learn(m_idx, DRS_NETH);
1860 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1862 if (blind) msg_format("%^s breathes.", m_name);
1866 else msg_format("%^s¤¬Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1868 else msg_format("%^s breathes light.", m_name);
1871 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1872 breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable);
1873 update_smart_learn(m_idx, DRS_LITE);
1882 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1884 if (blind) msg_format("%^s breathes.", m_name);
1888 else msg_format("%^s¤¬°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1890 else msg_format("%^s breathes darkness.", m_name);
1893 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1894 breath(y, x, m_idx, GF_DARK, dam,0, TRUE, MS_BR_DARK, learnable);
1895 update_smart_learn(m_idx, DRS_DARK);
1904 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1906 if (blind) msg_format("%^s breathes.", m_name);
1910 else msg_format("%^s¤¬º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1912 else msg_format("%^s breathes confusion.", m_name);
1915 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1916 breath(y, x, m_idx, GF_CONFUSION, dam,0, TRUE, MS_BR_CONF, learnable);
1917 update_smart_learn(m_idx, DRS_CONF);
1925 if (m_ptr->r_idx == MON_JAIAN)
1927 msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
1929 msg_format("'Booooeeeeee'");
1932 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1934 else if (blind) msg_format("%^s breathes.", m_name);
1938 else msg_format("%^s¤¬¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1940 else msg_format("%^s breathes sound.", m_name);
1943 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1944 breath(y, x, m_idx, GF_SOUND, dam,0, TRUE, MS_BR_SOUND, learnable);
1945 update_smart_learn(m_idx, DRS_SOUND);
1954 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1956 if (blind) msg_format("%^s breathes.", m_name);
1960 else msg_format("%^s¤¬¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1962 else msg_format("%^s breathes chaos.", m_name);
1965 dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
1966 breath(y, x, m_idx, GF_CHAOS, dam,0, TRUE, MS_BR_CHAOS, learnable);
1967 update_smart_learn(m_idx, DRS_CHAOS);
1976 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1978 if (blind) msg_format("%^s breathes.", m_name);
1982 else msg_format("%^s¤¬Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1984 else msg_format("%^s breathes disenchantment.", m_name);
1987 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
1988 breath(y, x, m_idx, GF_DISENCHANT, dam,0, TRUE, MS_BR_DISEN, learnable);
1989 update_smart_learn(m_idx, DRS_DISEN);
1998 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2000 if (blind) msg_format("%^s breathes.", m_name);
2004 else msg_format("%^s¤¬°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2006 else msg_format("%^s breathes nexus.", m_name);
2009 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2010 breath(y, x, m_idx, GF_NEXUS, dam,0, TRUE, MS_BR_NEXUS, learnable);
2011 update_smart_learn(m_idx, DRS_NEXUS);
2020 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2022 if (blind) msg_format("%^s breathes.", m_name);
2026 else msg_format("%^s¤¬»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2028 else msg_format("%^s breathes time.", m_name);
2031 dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
2032 breath(y, x, m_idx, GF_TIME, dam,0, TRUE, MS_BR_TIME, learnable);
2041 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2043 if (blind) msg_format("%^s breathes.", m_name);
2047 else msg_format("%^s¤¬ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2049 else msg_format("%^s breathes inertia.", m_name);
2052 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2053 breath(y, x, m_idx, GF_INERTIA, dam,0, TRUE, MS_BR_INERTIA, learnable);
2062 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2064 if (blind) msg_format("%^s breathes.", m_name);
2068 else msg_format("%^s¤¬½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2070 else msg_format("%^s breathes gravity.", m_name);
2073 dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
2074 breath(y, x, m_idx, GF_GRAVITY, dam,0, TRUE, MS_BR_GRAVITY, learnable);
2082 if (m_ptr->r_idx == MON_BOTEI)
2084 msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
2086 msg_format("'Boty-Build cutter!!!'");
2089 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2091 else if (blind) msg_format("%^s breathes.", m_name);
2095 else msg_format("%^s¤¬ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2097 else msg_format("%^s breathes shards.", m_name);
2100 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2101 breath(y, x, m_idx, GF_SHARDS, dam,0, TRUE, MS_BR_SHARDS, learnable);
2102 update_smart_learn(m_idx, DRS_SHARD);
2111 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2113 if (blind) msg_format("%^s breathes.", m_name);
2117 else msg_format("%^s¤¬¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2119 else msg_format("%^s breathes plasma.", m_name);
2122 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2123 breath(y, x, m_idx, GF_PLASMA, dam,0, TRUE, MS_BR_PLASMA, learnable);
2132 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2134 if (blind) msg_format("%^s breathes.", m_name);
2138 else msg_format("%^s¤¬¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2140 else msg_format("%^s breathes force.", m_name);
2143 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2144 breath(y, x, m_idx, GF_FORCE, dam,0, TRUE, MS_BR_FORCE, learnable);
2153 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2155 if (blind) msg_format("%^s breathes.", m_name);
2159 else msg_format("%^s¤¬ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2161 else msg_format("%^s breathes mana.", m_name);
2163 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2164 breath(y, x, m_idx, GF_MANA, dam,0, TRUE, MS_BR_MANA, learnable);
2173 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2175 if (blind) msg_format("%^s mumbles.", m_name);
2179 else msg_format("%^s¤¬Êü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name);
2181 else msg_format("%^s casts a ball of radiation.", m_name);
2184 dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2185 breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, learnable);
2186 update_smart_learn(m_idx, DRS_POIS);
2195 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2197 if (blind) msg_format("%^s breathes.", m_name);
2201 else msg_format("%^s¤¬Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2203 else msg_format("%^s breathes toxic waste.", m_name);
2206 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
2207 breath(y, x, m_idx, GF_NUKE, dam,0, TRUE, MS_BR_NUKE, learnable);
2208 update_smart_learn(m_idx, DRS_POIS);
2217 if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2219 if (blind) msg_format("%^s mumbles frighteningly.", m_name);
2223 else msg_format("%^s¤¬½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name);/*nuke me*/
2225 else msg_format("%^s invokes a raw Logrus.", m_name);
2228 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2))+ damroll(10, 10);
2229 breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, learnable);
2230 update_smart_learn(m_idx, DRS_CHAOS);
2239 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2241 if (blind) msg_format("%^s breathes.", m_name);
2245 else msg_format("%^s¤¬Ê¬²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2247 else msg_format("%^s breathes disintegration.", m_name);
2250 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2251 breath(y, x, m_idx, GF_DISINTEGRATE, dam,0, TRUE, MS_BR_DISI, learnable);
2262 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2264 if (blind) msg_format("%^s mumbles.", m_name);
2268 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2270 else msg_format("%^s casts an acid ball.", m_name);
2273 dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2274 breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
2275 update_smart_learn(m_idx, DRS_ACID);
2284 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2286 if (blind) msg_format("%^s mumbles.", m_name);
2290 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2292 else msg_format("%^s casts a lightning ball.", m_name);
2295 dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2296 breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
2297 update_smart_learn(m_idx, DRS_ELEC);
2306 if (m_ptr->r_idx == MON_ROLENTO)
2310 msg_format("%s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
2312 msg_format("%s¤Ï¼êÜØÃƤòÅꤲ¤¿¡£", m_name);
2315 msg_format("%^s throws something.", m_name);
2317 msg_format("%^s throws a hand grenade.", m_name);
2323 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2325 if (blind) msg_format("%^s mumbles.", m_name);
2329 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2331 else msg_format("%^s casts a fire ball.", m_name);
2335 dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2336 breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2337 update_smart_learn(m_idx, DRS_FIRE);
2346 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2348 if (blind) msg_format("%^s mumbles.", m_name);
2352 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2354 else msg_format("%^s casts a frost ball.", m_name);
2357 dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2358 breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2359 update_smart_learn(m_idx, DRS_COLD);
2368 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2370 if (blind) msg_format("%^s mumbles.", m_name);
2374 else msg_format("%^s¤¬°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2376 else msg_format("%^s casts a stinking cloud.", m_name);
2379 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2380 breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2381 update_smart_learn(m_idx, DRS_POIS);
2390 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2392 if (blind) msg_format("%^s mumbles.", m_name);
2396 else msg_format("%^s¤¬ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2398 else msg_format("%^s casts a nether ball.", m_name);
2401 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2402 breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2403 update_smart_learn(m_idx, DRS_NETH);
2412 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2414 if (blind) msg_format("%^s mumbles.", m_name);
2418 else msg_format("%^s¤¬Î®¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name);
2420 else msg_format("%^s gestures fluidly.", m_name);
2424 msg_print("¤¢¤Ê¤¿¤Ï±²´¬¤¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£");
2426 msg_print("You are engulfed in a whirlpool.");
2429 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
2430 breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2439 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2441 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2445 else msg_format("%^s¤¬ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2447 else msg_format("%^s invokes a mana storm.", m_name);
2450 dam = (rlev * 4) + 50 + damroll(10, 10);
2451 breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2460 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2462 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2466 else msg_format("%^s¤¬°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2468 else msg_format("%^s invokes a darkness storm.", m_name);
2471 dam = (rlev * 4) + 50 + damroll(10, 10);
2472 breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2473 update_smart_learn(m_idx, DRS_DARK);
2477 /* RF5_DRAIN_MANA */
2480 if (x!=px || y!=py) return (FALSE);
2489 msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2491 msg_format("%^s draws psychic energy from you!", m_name);
2496 r1 = (randint1(rlev) / 2) + 1;
2499 if (r1 >= p_ptr->csp)
2503 p_ptr->csp_frac = 0;
2512 learn_spell(MS_DRAIN_MANA);
2515 p_ptr->redraw |= (PR_MANA);
2518 p_ptr->window |= (PW_PLAYER);
2519 p_ptr->window |= (PW_SPELL);
2521 /* Heal the monster */
2522 if (m_ptr->hp < m_ptr->maxhp)
2525 m_ptr->hp += (6 * r1);
2526 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2528 /* Redraw (later) if needed */
2529 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2530 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2532 /* Special message */
2536 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
2538 msg_format("%^s appears healthier.", m_name);
2544 update_smart_learn(m_idx, DRS_MANA);
2548 /* RF5_MIND_BLAST */
2551 if (x!=px || y!=py) return (FALSE);
2557 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2559 msg_print("You feel something focusing on your mind.");
2566 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¤Ë¤é¤ó¤Ç¤¤¤ë¡£", m_name);
2568 msg_format("%^s gazes deep into your eyes.", m_name);
2573 dam = damroll(7, 7);
2574 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2577 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2579 msg_print("You resist the effects!");
2581 learn_spell(MS_MIND_BLAST);
2586 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2588 msg_print("Your mind is blasted by psyonic energy.");
2591 if (!p_ptr->resist_conf)
2593 (void)set_confused(p_ptr->confused + randint0(4) + 4);
2596 if (!p_ptr->resist_chaos && one_in_(3))
2598 (void)set_image(p_ptr->image + randint0(250) + 150);
2605 p_ptr->csp_frac = 0;
2607 p_ptr->redraw |= PR_MANA;
2609 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_MIND_BLAST);
2614 /* RF5_BRAIN_SMASH */
2617 if (x!=px || y!=py) return (FALSE);
2623 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2625 msg_print("You feel something focusing on your mind.");
2632 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¸«¤Æ¤¤¤ë¡£", m_name);
2634 msg_format("%^s looks deep into your eyes.", m_name);
2639 dam = damroll(12, 12);
2640 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2643 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2645 msg_print("You resist the effects!");
2647 learn_spell(MS_BRAIN_SMASH);
2652 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2654 msg_print("Your mind is blasted by psionic energy.");
2661 p_ptr->csp_frac = 0;
2663 p_ptr->redraw |= PR_MANA;
2665 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_BRAIN_SMASH);
2666 if (!p_ptr->resist_blind)
2668 (void)set_blind(p_ptr->blind + 8 + randint0(8));
2670 if (!p_ptr->resist_conf)
2672 (void)set_confused(p_ptr->confused + randint0(4) + 4);
2674 if (!p_ptr->free_act)
2676 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
2678 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
2680 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2681 (void)do_dec_stat(A_INT);
2682 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2683 (void)do_dec_stat(A_WIS);
2685 if (!p_ptr->resist_chaos)
2687 (void)set_image(p_ptr->image + randint0(250) + 150);
2696 if (x!=px || y!=py) return (FALSE);
2700 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2702 if (blind) msg_format("%^s mumbles.", m_name);
2706 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¼ö¤Ã¤¿¡£", m_name);
2708 else msg_format("%^s points at you and curses.", m_name);
2711 dam = damroll(3, 8);
2712 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2715 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2717 msg_print("You resist the effects!");
2719 learn_spell(MS_CAUSE_1);
2723 curse_equipment(33, 0);
2724 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_1);
2732 if (x!=px || y!=py) return (FALSE);
2736 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2738 if (blind) msg_format("%^s mumbles.", m_name);
2742 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤Ã¤¿¡£", m_name);
2744 else msg_format("%^s points at you and curses horribly.", m_name);
2747 dam = damroll(8, 8);
2748 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2751 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2753 msg_print("You resist the effects!");
2755 learn_spell(MS_CAUSE_2);
2759 curse_equipment(50, 5);
2760 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_2);
2768 if (x!=px || y!=py) return (FALSE);
2772 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
2774 if (blind) msg_format("%^s mumbles loudly.", m_name);
2778 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
2780 else msg_format("%^s points at you, incanting terribly!", m_name);
2783 dam = damroll(10, 15);
2784 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2787 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2789 msg_print("You resist the effects!");
2791 learn_spell(MS_CAUSE_3);
2795 curse_equipment(80, 15);
2796 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_3);
2804 if (x!=px || y!=py) return (FALSE);
2808 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2810 if (blind) msg_format("%^s screams the word 'DIE!'", m_name);
2814 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÈ빦¤òÆͤ¤¤Æ¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2816 else msg_format("%^s points at you, screaming the word DIE!", m_name);
2819 dam = damroll(15, 15);
2820 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
2823 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
2825 msg_print("You resist the effects!");
2827 learn_spell(MS_CAUSE_4);
2831 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_4);
2832 (void)set_cut(p_ptr->cut + damroll(10, 10));
2840 if (x!=px || y!=py) return (FALSE);
2843 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2845 if (blind) msg_format("%^s mumbles.", m_name);
2849 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2851 else msg_format("%^s casts a acid bolt.", m_name);
2854 dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2855 bolt(m_idx, GF_ACID, dam, MS_BOLT_ACID, learnable);
2856 update_smart_learn(m_idx, DRS_ACID);
2857 update_smart_learn(m_idx, DRS_REFLECT);
2864 if (x!=px || y!=py) return (FALSE);
2867 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2869 if (blind) msg_format("%^s mumbles.", m_name);
2873 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2875 else msg_format("%^s casts a lightning bolt.", m_name);
2878 dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2879 bolt(m_idx, GF_ELEC, dam, MS_BOLT_ELEC, learnable);
2880 update_smart_learn(m_idx, DRS_ELEC);
2881 update_smart_learn(m_idx, DRS_REFLECT);
2888 if (x!=px || y!=py) return (FALSE);
2891 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2893 if (blind) msg_format("%^s mumbles.", m_name);
2897 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2899 else msg_format("%^s casts a fire bolt.", m_name);
2902 dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2903 bolt(m_idx, GF_FIRE, dam, MS_BOLT_FIRE, learnable);
2904 update_smart_learn(m_idx, DRS_FIRE);
2905 update_smart_learn(m_idx, DRS_REFLECT);
2912 if (x!=px || y!=py) return (FALSE);
2915 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2917 if (blind) msg_format("%^s mumbles.", m_name);
2921 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2923 else msg_format("%^s casts a frost bolt.", m_name);
2926 dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2927 bolt(m_idx, GF_COLD, dam, MS_BOLT_COLD, learnable);
2928 update_smart_learn(m_idx, DRS_COLD);
2929 update_smart_learn(m_idx, DRS_REFLECT);
2938 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2940 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2944 else msg_format("%^s¤¬¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2946 else msg_format("%^s invokes a starburst.", m_name);
2949 dam = (rlev * 4) + 50 + damroll(10, 10);
2950 breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2951 update_smart_learn(m_idx, DRS_LITE);
2958 if (x!=px || y!=py) return (FALSE);
2961 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2963 if (blind) msg_format("%^s mumbles.", m_name);
2967 else msg_format("%^s¤¬ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2969 else msg_format("%^s casts a nether bolt.", m_name);
2972 dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
2973 bolt(m_idx, GF_NETHER, dam, MS_BOLT_NETHER, learnable);
2974 update_smart_learn(m_idx, DRS_NETH);
2975 update_smart_learn(m_idx, DRS_REFLECT);
2982 if (x!=px || y!=py) return (FALSE);
2985 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2987 if (blind) msg_format("%^s mumbles.", m_name);
2991 else msg_format("%^s¤¬¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2993 else msg_format("%^s casts a water bolt.", m_name);
2996 dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2997 bolt(m_idx, GF_WATER, dam, MS_BOLT_WATER, learnable);
2998 update_smart_learn(m_idx, DRS_REFLECT);
3005 if (x!=px || y!=py) return (FALSE);
3008 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3010 if (blind) msg_format("%^s mumbles.", m_name);
3014 else msg_format("%^s¤¬ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3016 else msg_format("%^s casts a mana bolt.", m_name);
3019 dam = randint1(rlev * 7 / 2) + 50;
3020 bolt(m_idx, GF_MANA, dam, MS_BOLT_MANA, learnable);
3021 update_smart_learn(m_idx, DRS_REFLECT);
3028 if (x!=px || y!=py) return (FALSE);
3031 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3033 if (blind) msg_format("%^s mumbles.", m_name);
3037 else msg_format("%^s¤¬¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3039 else msg_format("%^s casts a plasma bolt.", m_name);
3042 dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3043 bolt(m_idx, GF_PLASMA, dam, MS_BOLT_PLASMA, learnable);
3044 update_smart_learn(m_idx, DRS_REFLECT);
3051 if (x!=px || y!=py) return (FALSE);
3054 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3056 if (blind) msg_format("%^s mumbles.", m_name);
3060 else msg_format("%^s¤¬¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3062 else msg_format("%^s casts an ice bolt.", m_name);
3065 dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3066 bolt(m_idx, GF_ICE, dam, MS_BOLT_ICE, learnable);
3067 update_smart_learn(m_idx, DRS_COLD);
3068 update_smart_learn(m_idx, DRS_REFLECT);
3075 if (x!=px || y!=py) return (FALSE);
3078 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3080 if (blind) msg_format("%^s mumbles.", m_name);
3084 else msg_format("%^s¤¬¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3086 else msg_format("%^s casts a magic missile.", m_name);
3089 dam = damroll(2, 6) + (rlev / 3);
3090 bolt(m_idx, GF_MISSILE, dam, MS_MAGIC_MISSILE, learnable);
3091 update_smart_learn(m_idx, DRS_REFLECT);
3098 if (x!=px || y!=py) return (FALSE);
3102 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
3104 if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
3108 else msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3110 else msg_format("%^s casts a fearful illusion.", m_name);
3113 if (p_ptr->resist_fear)
3116 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3118 msg_print("You refuse to be frightened.");
3122 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3125 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3127 msg_print("You refuse to be frightened.");
3133 (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
3135 learn_spell(MS_SCARE);
3136 update_smart_learn(m_idx, DRS_FEAR);
3143 if (x!=px || y!=py) return (FALSE);
3147 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3149 if (blind) msg_format("%^s mumbles.", m_name);
3153 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¤¢¤Ê¤¿¤ÎÌܤò¤¯¤é¤Þ¤·¤¿¡ª", m_name);
3155 else msg_format("%^s casts a spell, burning your eyes!", m_name);
3158 if (p_ptr->resist_blind)
3161 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3163 msg_print("You are unaffected!");
3167 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3170 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3172 msg_print("You resist the effects!");
3178 (void)set_blind(12 + randint0(4));
3180 learn_spell(MS_BLIND);
3181 update_smart_learn(m_idx, DRS_BLIND);
3188 if (x!=px || y!=py) return (FALSE);
3192 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
3194 if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
3198 else msg_format("%^s¤¬Í¶ÏÇŪ¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3200 else msg_format("%^s creates a mesmerising illusion.", m_name);
3203 if (p_ptr->resist_conf)
3206 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3208 msg_print("You disbelieve the feeble spell.");
3212 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3215 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3217 msg_print("You disbelieve the feeble spell.");
3223 (void)set_confused(p_ptr->confused + randint0(4) + 4);
3225 learn_spell(MS_CONF);
3226 update_smart_learn(m_idx, DRS_CONF);
3233 if (x!=px || y!=py) return (FALSE);
3237 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
3239 msg_format("%^s drains power from your muscles!", m_name);
3242 if (p_ptr->free_act)
3245 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3247 msg_print("You are unaffected!");
3251 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3254 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3256 msg_print("You resist the effects!");
3262 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
3264 learn_spell(MS_SLOW);
3265 update_smart_learn(m_idx, DRS_FREE);
3272 if (x!=px || y!=py) return (FALSE);
3276 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3278 if (blind) msg_format("%^s mumbles.", m_name);
3282 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÌܤò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡ª", m_name);
3284 else msg_format("%^s stares deep into your eyes!", m_name);
3287 if (p_ptr->free_act)
3290 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3292 msg_print("You are unaffected!");
3296 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3299 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3301 msg_format("You resist the effects!");
3307 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
3309 learn_spell(MS_SLEEP);
3310 update_smart_learn(m_idx, DRS_FREE);
3321 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3323 msg_format("%^s mumbles.", m_name);
3330 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name, m_poss);
3332 msg_format("%^s concentrates on %s body.", m_name, m_poss);
3337 /* Allow quick speed increases to base+10 */
3341 msg_format("%^s¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
3343 msg_format("%^s starts moving faster.", m_name);
3346 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3347 if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS;
3354 if (x!=px || y!=py) return (FALSE);
3357 msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
3359 msg_format("%^s invokes the Hand of Doom!", m_name);
3362 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3365 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3367 msg_format("You resist the effects!");
3369 learn_spell(MS_HAND_DOOM);
3374 int dummy = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
3376 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
3378 msg_print("Your feel your life fade away!");
3381 take_hit(DAMAGE_ATTACK, dummy, m_name, MS_HAND_DOOM);
3382 curse_equipment(100, 20);
3384 if (p_ptr->chp < 1) p_ptr->chp = 1;
3398 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3400 msg_format("%^s mumbles.", m_name);
3407 msg_format("%^s¤¬¼«Ê¬¤Î½ý¤Ë½¸Ã椷¤¿¡£", m_name);
3409 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3415 m_ptr->hp += (rlev * 6);
3418 if (m_ptr->hp >= m_ptr->maxhp)
3421 m_ptr->hp = m_ptr->maxhp;
3427 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3429 msg_format("%^s looks completely healed!", m_name);
3436 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¤è¤¦¤À¡ª", m_name);
3438 msg_format("%^s sounds completely healed!", m_name);
3444 /* Partially healed */
3451 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3453 msg_format("%^s looks healthier.", m_name);
3460 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3462 msg_format("%^s sounds healthier.", m_name);
3468 /* Redraw (later) if needed */
3469 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3470 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3480 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name, m_poss);
3482 msg_format("%^s recovers %s courage.", m_name, m_poss);
3498 msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3500 msg_format("%^s mumbles powerfully.", m_name);
3507 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3509 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3514 if (!(m_ptr->invulner))
3515 m_ptr->invulner = randint1(4) + 4;
3517 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3518 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3527 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3529 msg_format("%^s blinks away.", m_name);
3532 teleport_away(m_idx, 10, FALSE);
3533 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
3540 int i, oldfy, oldfx;
3541 u32b f1 = 0 , f2 = 0 , f3 = 0;
3549 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3551 msg_format("%^s teleports away.", m_name);
3554 teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
3556 if (los(py, px, oldfy, oldfx) && !world_monster)
3558 for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
3560 o_ptr = &inventory[i];
3561 if(!(o_ptr->ident & IDENT_CURSED))
3563 object_flags(o_ptr, &f1, &f2, &f3);
3565 if((f3 & TR3_TELEPORT) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
3568 if(get_check_strict("¤Ä¤¤¤Æ¤¤¤¤Þ¤¹¤«¡©", 1))
3570 if(get_check_strict("Do you follow it? ", 1))
3575 teleport_player(200);
3577 msg_print("¼ºÇÔ¡ª");
3579 msg_print("Failed!");
3582 else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3583 p_ptr->energy -= 100;
3598 if(m_ptr->r_idx == MON_DIO) who = 1;
3599 else if(m_ptr->r_idx == MON_WONG) who = 3;
3601 if (!process_the_world(randint1(2)+2, who, TRUE)) return (FALSE);
3611 switch(m_ptr->r_idx)
3614 if (p_ptr->inside_arena || p_ptr->inside_battle) return FALSE;
3615 for (k = 0; k < 6; k++)
3617 count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, TRUE, FALSE, FALSE, FALSE, FALSE);
3621 case MON_BANORLUPART:
3623 int dummy_hp = (m_ptr->hp + 1) / 2;
3624 int dummy_maxhp = m_ptr->maxhp/2;
3625 int dummy_y = m_ptr->fy;
3626 int dummy_x = m_ptr->fx;
3628 if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
3629 delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
3630 summon_named_creature(dummy_y, dummy_x, MON_BANOR, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3631 m_list[hack_m_idx_ii].hp = dummy_hp;
3632 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3633 summon_named_creature(dummy_y, dummy_x, MON_LUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3634 m_list[hack_m_idx_ii].hp = dummy_hp;
3635 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3638 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª");
3640 msg_print("Banor=Rupart splits in two person!");
3649 int dummy_maxhp = 0;
3650 int dummy_y = m_ptr->fy;
3651 int dummy_x = m_ptr->fx;
3653 if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
3654 for (k = 1; k < m_max; k++)
3656 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
3658 dummy_hp += m_list[k].hp;
3659 dummy_maxhp += m_list[k].maxhp;
3660 if (m_list[k].r_idx != m_ptr->r_idx)
3662 dummy_y = m_list[k].fy;
3663 dummy_x = m_list[k].fx;
3665 delete_monster_idx(k);
3668 summon_named_creature(dummy_y, dummy_x, MON_BANORLUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3669 m_list[hack_m_idx_ii].hp = dummy_hp;
3670 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3673 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª");
3675 msg_print("Banor and Rupart combine into one!");
3680 default: return FALSE;
3688 if (x!=px || y!=py) return (FALSE);
3692 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤Ìᤷ¤¿¡£", m_name);
3694 msg_format("%^s commands you to return.", m_name);
3697 teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3698 learn_spell(MS_TELE_TO);
3705 if (x!=px || y!=py) return (FALSE);
3709 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
3710 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
3711 msg_print("¤¯¤Ã¤½¡Á");
3713 msg_format("%^s teleports you away.", m_name);
3716 learn_spell(MS_TELE_AWAY);
3717 teleport_player(100);
3721 /* RF6_TELE_LEVEL */
3724 if (x!=px || y!=py) return (FALSE);
3728 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3730 if (blind) msg_format("%^s mumbles strangely.", m_name);
3734 else msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
3736 else msg_format("%^s gestures at your feet.", m_name);
3739 if (p_ptr->resist_nexus)
3742 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3744 msg_print("You are unaffected!");
3748 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3751 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3753 msg_print("You resist the effects!");
3759 teleport_player_level();
3761 learn_spell(MS_TELE_LEVEL);
3762 update_smart_learn(m_idx, DRS_NEXUS);
3769 if (x!=px || y!=py) return (FALSE);
3772 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3774 if (blind) msg_format("%^s mumbles.", m_name);
3778 else msg_format("%^s¤¬¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name);
3780 else msg_format("%^s throw a Psycho-Spear.", m_name);
3783 dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
3784 beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
3791 if (x!=px || y!=py) return (FALSE);
3795 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3797 if (blind) msg_format("%^s mumbles.", m_name);
3801 else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3802 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3804 else if (p_ptr->pclass == CLASS_NINJA)
3805 msg_format("%^s cast a spell to light up.", m_name);
3806 else msg_format("%^s gestures in shadow.", m_name);
3809 learn_spell(MS_DARKNESS);
3810 if (p_ptr->pclass == CLASS_NINJA)
3811 (void)lite_area(0, 3);
3813 (void)unlite_area(0, 3);
3823 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3825 if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
3829 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3831 else msg_format("%^s casts a spell and cackles evilly.", m_name);
3834 learn_spell(MS_MAKE_TRAP);
3835 (void)trap_creation(y, x);
3842 if (x!=px || y!=py) return (FALSE);
3846 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);
3848 msg_format("%^s tries to blank your mind.", m_name);
3852 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3855 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3857 msg_print("You resist the effects!");
3861 else if (lose_all_info())
3864 msg_print("µ²±¤¬Çö¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
3866 msg_print("Your memories fade away.");
3870 learn_spell(MS_FORGET);
3874 /* RF6_RAISE_DEAD */
3879 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3881 if (blind) msg_format("%^s mumbles.", m_name);
3885 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3887 else msg_format("%^s casts a spell to revive corpses.", m_name);
3889 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3893 /* RF6_SUMMON_KIN */
3897 if (m_ptr->r_idx == MON_ROLENTO)
3901 msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name);
3903 msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3906 msg_format("%^s spreads something.", m_name);
3908 msg_format("%^s throws some hand grenades.", m_name);
3911 else if (m_ptr->r_idx == MON_SERPENT)
3915 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3917 msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´¤·¤¿¡£", m_name);
3920 msg_format("%^s mumbles.", m_name);
3922 msg_format("%^s magically summons guardians of dungeons.", m_name);
3929 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3931 msg_format("%^s¤ÏËâË¡¤Ç%s¤ò¾¤´¤·¤¿¡£",
3933 ((r_ptr->flags1) & RF1_UNIQUE ?
3937 msg_format("%^s mumbles.", m_name);
3939 msg_format("%^s magically summons %s %s.",
3941 ((r_ptr->flags1) & RF1_UNIQUE ?
3942 "minions" : "kin"));
3946 if(m_ptr->r_idx == MON_ROLENTO)
3948 int num = 1 + randint1(3);
3949 for (k = 0; k < num; k++)
3951 count += summon_named_creature(y, x, MON_SHURYUUDAN, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
3954 else if(m_ptr->r_idx == MON_LOUSY)
3956 int num = 2 + randint1(3);
3957 for (k = 0; k < num; k++)
3959 count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, TRUE, FALSE, FALSE, FALSE, FALSE);
3962 else if(m_ptr->r_idx == MON_BULLGATES)
3964 int num = 2 + randint1(3);
3965 for (k = 0; k < num; k++)
3967 count += summon_named_creature(y, x, 921, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
3970 else if (m_ptr->r_idx == MON_CALDARM)
3972 int num = randint1(3);
3973 for (k = 0; k < num; k++)
3975 count += summon_named_creature(y, x, 930, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
3978 else if (m_ptr->r_idx == MON_SERPENT)
3980 int num = 2 + randint1(3);
3982 if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
3985 msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤½Ð¤·¤¿¡ª");
3987 msg_print("Water blew off from the ground!");
3989 fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
3992 for (k = 0; k < num; k++)
3994 count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, TRUE, FALSE, FALSE, TRUE, FALSE);
4000 summon_kin_type = r_ptr->d_char; /* Big hack */
4002 for (k = 0; k < 4; k++)
4004 count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, TRUE, FALSE, FALSE, FALSE, FALSE);
4008 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4010 if (blind && count) msg_print("You hear many things appear nearby.");
4022 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4024 if (blind) msg_format("%^s mumbles.", m_name);
4028 else msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4030 else msg_format("%^s magically summons Cyberdemons!", m_name);
4034 if (blind && count) msg_print("½Å¸ü¤Ê²»¤¬¶á¤¯¤Çʹ¤³¤¨¤ë¡£");
4036 if (blind && count) msg_print("You hear heavy steps nearby.");
4039 summon_cyber(m_idx, y, x);
4048 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4050 if (blind) msg_format("%^s mumbles.", m_name);
4054 else msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´¤·¤¿¡ª", m_name);
4056 else msg_format("%^s magically summons help!", m_name);
4059 for (k = 0; k < 1; k++)
4061 count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
4064 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4066 if (blind && count) msg_print("You hear something appear nearby.");
4072 /* RF6_S_MONSTERS */
4077 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4079 if (blind) msg_format("%^s mumbles.", m_name);
4083 else msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª", m_name);
4085 else msg_format("%^s magically summons monsters!", m_name);
4088 for (k = 0; k < s_num_6; k++)
4090 count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
4093 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4095 if (blind && count) msg_print("You hear many things appear nearby.");
4106 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4108 if (blind) msg_format("%^s mumbles.", m_name);
4112 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´¤·¤¿¡£", m_name);
4114 else msg_format("%^s magically summons ants.", m_name);
4117 for (k = 0; k < s_num_6; k++)
4119 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, TRUE, FALSE, FALSE, FALSE, FALSE);
4122 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4124 if (blind && count) msg_print("You hear many things appear nearby.");
4135 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4137 if (blind) msg_format("%^s mumbles.", m_name);
4141 else msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´¤·¤¿¡£", m_name);
4143 else msg_format("%^s magically summons spiders.", m_name);
4146 for (k = 0; k < s_num_6; k++)
4148 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, TRUE, FALSE, FALSE, FALSE, FALSE);
4151 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4153 if (blind && count) msg_print("You hear many things appear nearby.");
4164 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4166 if (blind) msg_format("%^s mumbles.", m_name);
4170 else msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£", m_name);
4172 else msg_format("%^s magically summons hounds.", m_name);
4175 for (k = 0; k < s_num_4; k++)
4177 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, TRUE, FALSE, FALSE, FALSE, FALSE);
4180 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4182 if (blind && count) msg_print("You hear many things appear nearby.");
4193 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4195 if (blind) msg_format("%^s mumbles.", m_name);
4199 else msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£", m_name);
4201 else msg_format("%^s magically summons hydras.", m_name);
4204 for (k = 0; k < s_num_4; k++)
4206 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, TRUE, FALSE, FALSE, FALSE, FALSE);
4209 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4211 if (blind && count) msg_print("You hear many things appear nearby.");
4224 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4226 if (blind) msg_format("%^s mumbles.", m_name);
4230 else msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´¤·¤¿¡ª", m_name);
4232 else msg_format("%^s magically summons an angel!", m_name);
4235 if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
4237 num += r_ptr->level/40;
4240 for (k = 0; k < num; k++)
4242 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, FALSE, FALSE);
4248 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4250 if (blind && count) msg_print("You hear something appear nearby.");
4256 if (blind) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4258 if (blind) msg_print("You hear many things appear nearby.");
4270 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4272 if (blind) msg_format("%^s mumbles.", m_name);
4276 else msg_format("%^s¤ÏËâË¡¤Çº®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª", m_name);
4278 else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4281 for (k = 0; k < 1; k++)
4283 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, TRUE, FALSE, FALSE, FALSE, FALSE);
4286 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4288 if (blind && count) msg_print("You hear something appear nearby.");
4299 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4301 if (blind) msg_format("%^s mumbles.", m_name);
4305 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4307 else msg_format("%^s magically summons an undead adversary!", m_name);
4310 for (k = 0; k < 1; k++)
4312 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, TRUE, FALSE, FALSE, FALSE, FALSE);
4315 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4317 if (blind && count) msg_print("You hear something appear nearby.");
4328 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4330 if (blind) msg_format("%^s mumbles.", m_name);
4334 else msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4336 else msg_format("%^s magically summons a dragon!", m_name);
4339 for (k = 0; k < 1; k++)
4341 count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, TRUE, FALSE, FALSE, FALSE, FALSE);
4344 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4346 if (blind && count) msg_print("You hear something appear nearby.");
4352 /* RF6_S_HI_UNDEAD */
4357 if (((m_ptr->r_idx == MON_MORGOTH) || (m_ptr->r_idx == MON_SAURON) || (m_ptr->r_idx == MON_ANGMAR)) && ((r_info[MON_NAZGUL].cur_num+2) < r_info[MON_NAZGUL].max_num))
4363 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4365 if (blind) msg_format("%^s mumbles.", m_name);
4369 else msg_format("%^s¤¬ËâË¡¤ÇÍ©µ´ÀïÂâ¤ò¾¤´¤·¤¿¡ª", m_name);
4371 else msg_format("%^s magically summons rangers of Nazgul!", m_name);
4375 for (k = 0; k < 30; k++)
4377 if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
4380 for (j = 100; j > 0; j--)
4382 scatter(&cy, &cx, y, x, 2, 0);
4383 if (cave_floor_bold(cy, cx)) break;
4387 if (!cave_floor_bold(cy, cx)) continue;
4389 if (summon_named_creature(cy, cx, MON_NAZGUL, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr)))
4396 msg_format("¡ÖÍ©µ´ÀïÂâ%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4398 msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
4402 msg_format("¡ÖƱ¤¸¤¯%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4404 msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
4410 msg_format("¡Ö%dɤ¤½¤í¤Ã¤Æ¡¢¥ê¥ó¥°¥ì¥ó¥¸¥ã¡¼¡ª¡×", count);
4412 msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
4419 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4421 if (blind) msg_format("%^s mumbles.", m_name);
4425 else msg_format("%^s¤¬ËâË¡¤Ç¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª", m_name);
4427 else msg_format("%^s magically summons greater undead!", m_name);
4430 for (k = 0; k < s_num_6; k++)
4432 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
4438 msg_print("´Ö¶á¤Ç²¿¤«Â¿¤¯¤Î¤â¤Î¤¬Ç礤²ó¤ë²»¤¬Ê¹¤³¤¨¤ë¡£");
4440 msg_print("You hear many creepy things appear nearby.");
4447 /* RF6_S_HI_DRAGON */
4452 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4454 if (blind) msg_format("%^s mumbles.", m_name);
4458 else msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4460 else msg_format("%^s magically summons ancient dragons!", m_name);
4463 for (k = 0; k < s_num_4; k++)
4465 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, TRUE, FALSE, FALSE, TRUE, FALSE);
4470 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4472 msg_print("You hear many powerful things appear nearby.");
4479 /* RF6_S_AMBERITES */
4484 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4486 if (blind) msg_format("%^s mumbles.", m_name);
4490 else msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦¤ò¾¤´¤·¤¿¡ª", m_name);
4492 else msg_format("%^s magically summons Lords of Amber!", m_name);
4497 for (k = 0; k < s_num_4; k++)
4499 count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, TRUE, FALSE, FALSE, TRUE, FALSE);
4504 msg_print("ÉÔ»à¤Î¼Ô¤¬¶á¤¯¤Ë¸½¤ì¤ë¤Î¤¬Ê¹¤³¤¨¤¿¡£");
4506 msg_print("You hear immortal beings appear nearby.");
4518 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4520 if (blind) msg_format("%^s mumbles.", m_name);
4524 else msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4526 else msg_format("%^s magically summons special opponents!", m_name);
4529 for (k = 0; k < s_num_4; k++)
4531 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, TRUE, FALSE, FALSE, TRUE, FALSE);
4533 if (r_ptr->flags3 & RF3_GOOD)
4535 for (k = count; k < s_num_4; k++)
4537 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, TRUE, FALSE);
4542 for (k = count; k < s_num_4; k++)
4544 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
4550 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4552 msg_print("You hear many powerful things appear nearby.");
4560 if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
4562 learn_spell(thrown_spell - 96);
4565 if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR))
4567 if (thrown_spell != 167)
4569 if (mane_num == MAX_MANE)
4573 for (i = 0;i < mane_num;i++)
4575 mane_spell[i] = mane_spell[i+1];
4576 mane_dam[i] = mane_dam[i+1];
4579 mane_spell[mane_num] = thrown_spell - 96;
4580 mane_dam[mane_num] = dam;
4584 p_ptr->redraw |= (PR_MANE);
4588 /* Remember what the monster did to us */
4592 if (thrown_spell < 32 * 4)
4594 r_ptr->r_flags4 |= (1L << (thrown_spell - 32 * 3));
4595 if (r_ptr->r_cast_inate < MAX_UCHAR) r_ptr->r_cast_inate++;
4599 else if (thrown_spell < 32 * 5)
4601 r_ptr->r_flags5 |= (1L << (thrown_spell - 32 * 4));
4602 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4606 else if (thrown_spell < 32 * 6)
4608 r_ptr->r_flags6 |= (1L << (thrown_spell - 32 * 5));
4609 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4614 /* Always take note of monsters that kill you */
4615 if (death && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
4620 /* A spell was cast */