OSDN Git Service

閃光と弱い閃光のブレスとビームは透明な壁を通すように変更. ボルトと
[hengband/hengband.git] / src / mspells1.c
1 /* File: mspells1.c */
2
3 /*
4  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
5  *
6  * This software may be copied and distributed for educational, research,
7  * and not for profit purposes provided that this copyright and statement
8  * are included in all such copies.  Other copyrights may also apply.
9  */
10
11 /* Purpose: Monster spells (attack player) */
12
13 #include "angband.h"
14
15
16 /*
17  * And now for Intelligent monster attacks (including spells).
18  *
19  * Original idea and code by "DRS" (David Reeves Sward).
20  * Major modifications by "BEN" (Ben Harrison).
21  *
22  * Give monsters more intelligent attack/spell selection based on
23  * observations of previous attacks on the player, and/or by allowing
24  * the monster to "cheat" and know the player status.
25  *
26  * Maintain an idea of the player status, and use that information
27  * to occasionally eliminate "ineffective" spell attacks.  We could
28  * also eliminate ineffective normal attacks, but there is no reason
29  * for the monster to do this, since he gains no benefit.
30  * Note that MINDLESS monsters are not allowed to use this code.
31  * And non-INTELLIGENT monsters only use it partially effectively.
32  *
33  * Actually learn what the player resists, and use that information
34  * to remove attacks or spells before using them.  This will require
35  * much less space, if I am not mistaken.  Thus, each monster gets a
36  * set of 32 bit flags, "smart", build from the various "SM_*" flags.
37  *
38  * This has the added advantage that attacks and spells are related.
39  * The "smart_learn" option means that the monster "learns" the flags
40  * that should be set, and "smart_cheat" means that he "knows" them.
41  * So "smart_cheat" means that the "smart" field is always up to date,
42  * while "smart_learn" means that the "smart" field is slowly learned.
43  * Both of them have the same effect on the "choose spell" routine.
44  */
45
46
47
48 /*
49  * Internal probability routine
50  */
51 static bool int_outof(monster_race *r_ptr, int prob)
52 {
53         /* Non-Smart monsters are half as "smart" */
54         if (!(r_ptr->flags2 & RF2_SMART)) prob = prob / 2;
55
56         /* Roll the dice */
57         return (randint0(100) < prob);
58 }
59
60
61
62 /*
63  * Remove the "bad" spells from a spell list
64  */
65 static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
66 {
67         monster_type *m_ptr = &m_list[m_idx];
68         monster_race *r_ptr = &r_info[m_ptr->r_idx];
69
70         u32b f4 = (*f4p);
71         u32b f5 = (*f5p);
72         u32b f6 = (*f6p);
73
74         u32b smart = 0L;
75
76
77         /* Too stupid to know anything */
78         if (r_ptr->flags2 & RF2_STUPID) return;
79
80
81         /* Must be cheating or learning */
82         if (!smart_cheat && !smart_learn) return;
83
84
85         /* Update acquired knowledge */
86         if (smart_learn)
87         {
88                 /* Hack -- Occasionally forget player status */
89                 /* Only save SM_FRIENDLY, SM_PET or SM_CLONED */
90                 if (m_ptr->smart && (randint0(100) < 1)) m_ptr->smart &= (SM_FRIENDLY | SM_PET | SM_CLONED);
91
92                 /* Use the memorized flags */
93                 smart = m_ptr->smart;
94         }
95
96
97         /* Cheat if requested */
98         if (smart_cheat)
99         {
100                 /* Know basic info */
101                 if (p_ptr->resist_acid) smart |= (SM_RES_ACID);
102                 if (IS_OPPOSE_ACID()) smart |= (SM_OPP_ACID);
103                 if (p_ptr->immune_acid) smart |= (SM_IMM_ACID);
104                 if (p_ptr->resist_elec) smart |= (SM_RES_ELEC);
105                 if (IS_OPPOSE_ELEC()) smart |= (SM_OPP_ELEC);
106                 if (p_ptr->immune_elec) smart |= (SM_IMM_ELEC);
107                 if (p_ptr->resist_fire) smart |= (SM_RES_FIRE);
108                 if (IS_OPPOSE_FIRE()) smart |= (SM_OPP_FIRE);
109                 if (p_ptr->immune_fire) smart |= (SM_IMM_FIRE);
110                 if (p_ptr->resist_cold) smart |= (SM_RES_COLD);
111                 if (IS_OPPOSE_COLD()) smart |= (SM_OPP_COLD);
112                 if (p_ptr->immune_cold) smart |= (SM_IMM_COLD);
113
114                 /* Know poison info */
115                 if (p_ptr->resist_pois) smart |= (SM_RES_POIS);
116                 if (IS_OPPOSE_POIS()) smart |= (SM_OPP_POIS);
117
118                 /* Know special resistances */
119                 if (p_ptr->resist_neth) smart |= (SM_RES_NETH);
120                 if (p_ptr->resist_lite) smart |= (SM_RES_LITE);
121                 if (p_ptr->resist_dark) smart |= (SM_RES_DARK);
122                 if (p_ptr->resist_fear) smart |= (SM_RES_FEAR);
123                 if (p_ptr->resist_conf) smart |= (SM_RES_CONF);
124                 if (p_ptr->resist_chaos) smart |= (SM_RES_CHAOS);
125                 if (p_ptr->resist_disen) smart |= (SM_RES_DISEN);
126                 if (p_ptr->resist_blind) smart |= (SM_RES_BLIND);
127                 if (p_ptr->resist_nexus) smart |= (SM_RES_NEXUS);
128                 if (p_ptr->resist_sound) smart |= (SM_RES_SOUND);
129                 if (p_ptr->resist_shard) smart |= (SM_RES_SHARD);
130                 if (p_ptr->reflect) smart |= (SM_IMM_REFLECT);
131
132                 /* Know bizarre "resistances" */
133                 if (p_ptr->free_act) smart |= (SM_IMM_FREE);
134                 if (!p_ptr->msp) smart |= (SM_IMM_MANA);
135         }
136
137
138         /* Nothing known */
139         if (!smart) return;
140
141
142         if (smart & SM_IMM_ACID)
143         {
144                 f4 &= ~(RF4_BR_ACID);
145                 f5 &= ~(RF5_BA_ACID);
146                 f5 &= ~(RF5_BO_ACID);
147         }
148         else if ((smart & (SM_OPP_ACID)) && (smart & (SM_RES_ACID)))
149         {
150                 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ACID);
151                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ACID);
152                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ACID);
153         }
154         else if ((smart & (SM_OPP_ACID)) || (smart & (SM_RES_ACID)))
155         {
156                 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ACID);
157                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ACID);
158                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ACID);
159         }
160
161
162         if (smart & (SM_IMM_ELEC))
163         {
164                 f4 &= ~(RF4_BR_ELEC);
165                 f5 &= ~(RF5_BA_ELEC);
166                 f5 &= ~(RF5_BO_ELEC);
167         }
168         else if ((smart & (SM_OPP_ELEC)) && (smart & (SM_RES_ELEC)))
169         {
170                 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ELEC);
171                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ELEC);
172                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ELEC);
173         }
174         else if ((smart & (SM_OPP_ELEC)) || (smart & (SM_RES_ELEC)))
175         {
176                 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ELEC);
177                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ELEC);
178                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ELEC);
179         }
180
181
182         if (smart & (SM_IMM_FIRE))
183         {
184                 f4 &= ~(RF4_BR_FIRE);
185                 f5 &= ~(RF5_BA_FIRE);
186                 f5 &= ~(RF5_BO_FIRE);
187         }
188         else if ((smart & (SM_OPP_FIRE)) && (smart & (SM_RES_FIRE)))
189         {
190                 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_FIRE);
191                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_FIRE);
192                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_FIRE);
193         }
194         else if ((smart & (SM_OPP_FIRE)) || (smart & (SM_RES_FIRE)))
195         {
196                 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_FIRE);
197                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_FIRE);
198                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_FIRE);
199         }
200
201
202         if (smart & (SM_IMM_COLD))
203         {
204                 f4 &= ~(RF4_BR_COLD);
205                 f5 &= ~(RF5_BA_COLD);
206                 f5 &= ~(RF5_BO_COLD);
207                 f5 &= ~(RF5_BO_ICEE);
208         }
209         else if ((smart & (SM_OPP_COLD)) && (smart & (SM_RES_COLD)))
210         {
211                 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_COLD);
212                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_COLD);
213                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_COLD);
214                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ICEE);
215         }
216         else if ((smart & (SM_OPP_COLD)) || (smart & (SM_RES_COLD)))
217         {
218                 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_COLD);
219                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_COLD);
220                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_COLD);
221                 if (int_outof(r_ptr, 20)) f5 &= ~(RF5_BO_ICEE);
222         }
223
224
225         if ((smart & (SM_OPP_POIS)) && (smart & (SM_RES_POIS)))
226         {
227                 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_POIS);
228                 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_POIS);
229                 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BA_NUKE);
230                 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BR_NUKE);
231         }
232         else if ((smart & (SM_OPP_POIS)) || (smart & (SM_RES_POIS)))
233         {
234                 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_POIS);
235                 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_POIS);
236         }
237
238
239         if (smart & (SM_RES_NETH))
240         {
241                 if (prace_is_(RACE_SPECTRE))
242                 {
243                         f4 &= ~(RF4_BR_NETH);
244                         f5 &= ~(RF5_BA_NETH);
245                         f5 &= ~(RF5_BO_NETH);
246                 }
247                 else
248                 {
249                         if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_NETH);
250                         if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_NETH);
251                         if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BO_NETH);
252                 }
253         }
254
255         if (smart & (SM_RES_LITE))
256         {
257                 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_LITE);
258                 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_LITE);
259         }
260
261         if (smart & (SM_RES_DARK))
262         {
263                 if (prace_is_(RACE_VAMPIRE))
264                 {
265                         f4 &= ~(RF4_BR_DARK);
266                         f5 &= ~(RF5_BA_DARK);
267                 }
268                 else
269                 {
270                         if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_DARK);
271                         if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_DARK);
272                 }
273         }
274
275         if (smart & (SM_RES_FEAR))
276         {
277                 f5 &= ~(RF5_SCARE);
278         }
279
280         if (smart & (SM_RES_CONF))
281         {
282                 f5 &= ~(RF5_CONF);
283                 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_CONF);
284         }
285
286         if (smart & (SM_RES_CHAOS))
287         {
288                 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_CHAO);
289                 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BA_CHAO);
290         }
291
292         if (smart & (SM_RES_DISEN))
293         {
294                 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_DISE);
295         }
296
297         if (smart & (SM_RES_BLIND))
298         {
299                 f5 &= ~(RF5_BLIND);
300         }
301
302         if (smart & (SM_RES_NEXUS))
303         {
304                 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_NEXU);
305                 f6 &= ~(RF6_TELE_LEVEL);
306         }
307
308         if (smart & (SM_RES_SOUND))
309         {
310                 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_SOUN);
311         }
312
313         if (smart & (SM_RES_SHARD))
314         {
315                 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_SHAR);
316         }
317
318         if (smart & (SM_IMM_REFLECT))
319         {
320                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_COLD);
321                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_FIRE);
322                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ACID);
323                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ELEC);
324                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_NETH);
325                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_WATE);
326                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_MANA);
327                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
328                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
329                 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
330                 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_SHOOT);
331         }
332
333         if (smart & (SM_IMM_FREE))
334         {
335                 f5 &= ~(RF5_HOLD);
336                 f5 &= ~(RF5_SLOW);
337         }
338
339         if (smart & (SM_IMM_MANA))
340         {
341                 f5 &= ~(RF5_DRAIN_MANA);
342         }
343
344         /* XXX XXX XXX No spells left? */
345         /* if (!f4 && !f5 && !f6) ... */
346
347         (*f4p) = f4;
348         (*f5p) = f5;
349         (*f6p) = f6;
350 }
351
352
353 /*
354  * Determine if there is a space near the player in which
355  * a summoned creature can appear
356  */
357 bool summon_possible(int y1, int x1)
358 {
359         int y, x;
360
361         /* Start at the player's location, and check 2 grids in each dir */
362         for (y = y1 - 2; y <= y1 + 2; y++)
363         {
364                 for (x = x1 - 2; x <= x1 + 2; x++)
365                 {
366                         /* Ignore illegal locations */
367                         if (!in_bounds(y, x)) continue;
368
369                         /* Only check a circular area */
370                         if (distance(y1, x1, y, x)>2) continue;
371
372                         /* ...nor on the Pattern */
373                         if (pattern_tile(y, x)) continue;
374
375                         /* Require empty floor grid in line of projection */
376                         if (cave_empty_bold(y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE);
377                 }
378         }
379
380         return FALSE;
381 }
382
383
384 bool raise_possible(monster_type *m_ptr)
385 {
386         int xx, yy;
387         int y = m_ptr->fy;
388         int x = m_ptr->fx;
389         s16b this_o_idx, next_o_idx = 0;
390         cave_type *c_ptr;
391
392         for (xx = x - 5; xx <= x + 5; xx++)
393         {
394                 for (yy = y - 5; yy <= y + 5; yy++)
395                 {
396                         if (distance(y, x, yy, xx) > 5) continue;
397                         if (!los(y, x, yy, xx)) continue;
398                         if (!projectable(y, x, yy, xx)) continue;
399
400                         c_ptr = &cave[yy][xx];
401                         /* Scan the pile of objects */
402                         for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
403                         {
404                                 /* Acquire object */
405                                 object_type *o_ptr = &o_list[this_o_idx];
406
407                                 /* Acquire next object */
408                                 next_o_idx = o_ptr->next_o_idx;
409
410                                 /* Known to be worthless? */
411                                 if (o_ptr->tval == TV_CORPSE)
412                                 {
413                                         if (!monster_has_hostile_align(m_ptr, 0, 0, &r_info[o_ptr->pval])) return TRUE;
414                                 }
415                         }
416                 }
417         }
418         return FALSE;
419 }
420
421
422 /*
423  * Originally, it was possible for a friendly to shoot another friendly.
424  * Change it so a "clean shot" means no equally friendly monster is
425  * between the attacker and target.
426  */
427 /*
428  * Determine if a bolt spell will hit the player.
429  *
430  * This is exactly like "projectable", but it will
431  * return FALSE if a monster is in the way.
432  * no equally friendly monster is
433  * between the attacker and target.
434  */
435 bool clean_shot(int y1, int x1, int y2, int x2, bool friend)
436 {
437         /* Must be the same as projectable() */
438
439         int i, y, x;
440
441         int grid_n = 0;
442         u16b grid_g[512];
443
444         /* Check the projection path */
445         grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
446
447         /* No grid is ever projectable from itself */
448         if (!grid_n) return (FALSE);
449
450         /* Final grid */
451         y = GRID_Y(grid_g[grid_n-1]);
452         x = GRID_X(grid_g[grid_n-1]);
453
454         /* May not end in an unrequested grid */
455         if ((y != y2) || (x != x2)) return (FALSE);
456
457         for (i = 0; i < grid_n; i++)
458         {
459                 y = GRID_Y(grid_g[i]);
460                 x = GRID_X(grid_g[i]);
461
462                 if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
463                 {
464                         monster_type *m_ptr = &m_list[cave[y][x].m_idx];
465                         if (friend == is_pet(m_ptr))
466                         {
467                                 return (FALSE);
468                         }
469                 }
470                 /* Pets may not shoot through the character - TNB */
471                 if (player_bold(y, x))
472                 {
473                         if (friend) return (FALSE);
474                 }
475         }
476
477         return (TRUE);
478 }
479
480 /*
481  * Cast a bolt at the player
482  * Stop if we hit a monster
483  * Affect monsters and the player
484  */
485 static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
486 {
487         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER | PROJECT_REFLECTABLE;
488
489         /* Target the player with a bolt attack */
490         (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
491 }
492
493 static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
494 {
495         int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER;
496
497         /* Target the player with a bolt attack */
498         (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
499 }
500
501
502 /*
503  * Cast a breath (or ball) attack at the player
504  * Pass over any monsters that may be in the way
505  * Affect grids, objects, monsters, and the player
506  */
507 static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
508 {
509         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
510
511         monster_type *m_ptr = &m_list[m_idx];
512         monster_race *r_ptr = &r_info[m_ptr->r_idx];
513
514         /* Determine the radius of the blast */
515         if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
516
517         /* Handle breath attacks */
518         if (breath) rad = 0 - rad;
519
520         switch (typ)
521         {
522         case GF_ROCKET:
523                 flg |= PROJECT_STOP;
524                 break;
525         case GF_DRAIN_MANA:
526         case GF_MIND_BLAST:
527         case GF_BRAIN_SMASH:
528         case GF_CAUSE_1:
529         case GF_CAUSE_2:
530         case GF_CAUSE_3:
531         case GF_CAUSE_4:
532         case GF_HAND_DOOM:
533                 flg |= (PROJECT_HIDE | PROJECT_AIMED);
534                 break;
535         }
536
537         /* Target the player with a ball attack */
538         (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
539 }
540
541
542 u32b get_curse(int power, object_type *o_ptr)
543 {
544         u32b new_curse;
545
546         while(1)
547         {
548                 new_curse = (1 << (randint0(MAX_CURSE)+4));
549                 if (power == 2)
550                 {
551                         if (!(new_curse & TRC_HEAVY_MASK)) continue;
552                 }
553                 else if (power == 1)
554                 {
555                         if (new_curse & TRC_SPECIAL_MASK) continue;
556                 }
557                 else if (power == 0)
558                 {
559                         if (new_curse & TRC_HEAVY_MASK) continue;
560                 }
561                 if (((o_ptr->tval < TV_WEAPON_BEGIN) || (o_ptr->tval > TV_WEAPON_END)) && (new_curse == TRC_LOW_MELEE)) continue;
562                 if (((o_ptr->tval < TV_ARMOR_BEGIN) || (o_ptr->tval > TV_ARMOR_END)) && (new_curse == TRC_LOW_AC)) continue;
563                 break;
564         }
565         return new_curse;
566 }
567
568 void curse_equipment(int chance, int heavy_chance)
569 {
570         bool        changed = FALSE;
571         int         curse_power = 0;
572         u32b        new_curse;
573         u32b oflgs[TR_FLAG_SIZE];
574         object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
575         char o_name[MAX_NLEN];
576
577         if (randint1(100) > chance) return;
578
579         if (!o_ptr->k_idx) return;
580
581         object_flags(o_ptr, oflgs);
582
583         object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
584
585         /* Extra, biased saving throw for blessed items */
586         if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance))
587         {
588 #ifdef JP
589 msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
590 #else
591                 msg_format("Your %s resist%s cursing!", o_name,
592 #endif
593
594                         ((o_ptr->number > 1) ? "" : "s"));
595                 /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
596                 return;
597         }
598
599         if ((randint1(100) <= heavy_chance) &&
600                 (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
601         {
602                 if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
603                         changed = TRUE;
604                 o_ptr->curse_flags |= TRC_HEAVY_CURSE;
605                 o_ptr->curse_flags |= TRC_CURSED;
606                 curse_power++;
607         }
608         else
609         {
610                 if (!cursed_p(o_ptr))
611                         changed = TRUE;
612                 o_ptr->curse_flags |= TRC_CURSED;
613         }
614         if (heavy_chance >= 50) curse_power++;
615
616         new_curse = get_curse(curse_power, o_ptr);
617         if (!(o_ptr->curse_flags & new_curse))
618         {
619                 changed = TRUE;
620                 o_ptr->curse_flags |= new_curse;
621         }
622
623         if (changed)
624         {
625 #ifdef JP
626 msg_format("°­°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
627 #else
628                 msg_format("There is a malignant black aura surrounding %s...", o_name);
629 #endif
630
631                 o_ptr->feeling = FEEL_NONE;
632         }
633         p_ptr->update |= (PU_BONUS);
634 }
635
636
637 /*
638  * Return TRUE if a spell is good for hurting the player (directly).
639  */
640 static bool spell_attack(byte spell)
641 {
642         /* All RF4 spells hurt (except for shriek and dispel) */
643         if (spell < 128 && spell > 98) return (TRUE);
644
645         /* Various "ball" spells */
646         if (spell >= 128 && spell <= 128 + 8) return (TRUE);
647
648         /* "Cause wounds" and "bolt" spells */
649         if (spell >= 128 + 12 && spell < 128 + 27) return (TRUE);
650
651         /* Hand of Doom */
652         if (spell == 160 + 1) return (TRUE);
653
654         /* Psycho-Spear */
655         if (spell == 160 + 11) return (TRUE);
656
657         /* Doesn't hurt */
658         return (FALSE);
659 }
660
661
662 /*
663  * Return TRUE if a spell is good for escaping.
664  */
665 static bool spell_escape(byte spell)
666 {
667         /* Blink or Teleport */
668         if (spell == 160 + 4 || spell == 160 + 5) return (TRUE);
669
670         /* Teleport the player away */
671         if (spell == 160 + 9 || spell == 160 + 10) return (TRUE);
672
673         /* Isn't good for escaping */
674         return (FALSE);
675 }
676
677 /*
678  * Return TRUE if a spell is good for annoying the player.
679  */
680 static bool spell_annoy(byte spell)
681 {
682         /* Shriek */
683         if (spell == 96 + 0) return (TRUE);
684
685         /* Brain smash, et al (added curses) */
686         if (spell >= 128 + 9 && spell <= 128 + 14) return (TRUE);
687
688         /* Scare, confuse, blind, slow, paralyze */
689         if (spell >= 128 + 27 && spell <= 128 + 31) return (TRUE);
690
691         /* Teleport to */
692         if (spell == 160 + 8) return (TRUE);
693
694         /* Teleport level */
695         if (spell == 160 + 10) return (TRUE);
696
697         /* Darkness, make traps, cause amnesia */
698         if (spell >= 160 + 12 && spell <= 160 + 14) return (TRUE);
699
700         /* Doesn't annoy */
701         return (FALSE);
702 }
703
704 /*
705  * Return TRUE if a spell summons help.
706  */
707 static bool spell_summon(byte spell)
708 {
709         /* All summon spells */
710         if (spell >= 160 + 16) return (TRUE);
711
712         /* Doesn't summon */
713         return (FALSE);
714 }
715
716
717 /*
718  * Return TRUE if a spell raise-dead.
719  */
720 static bool spell_raise(byte spell)
721 {
722         /* All raise-dead spells */
723         if (spell == 160 + 15) return (TRUE);
724
725         /* Doesn't summon */
726         return (FALSE);
727 }
728
729
730 /*
731  * Return TRUE if a spell is good in a tactical situation.
732  */
733 static bool spell_tactic(byte spell)
734 {
735         /* Blink */
736         if (spell == 160 + 4) return (TRUE);
737
738         /* Not good */
739         return (FALSE);
740 }
741
742 /*
743  * Return TRUE if a spell makes invulnerable.
744  */
745 static bool spell_invulner(byte spell)
746 {
747         /* Invulnerability */
748         if (spell == 160 + 3) return (TRUE);
749
750         /* No invulnerability */
751         return (FALSE);
752 }
753
754 /*
755  * Return TRUE if a spell hastes.
756  */
757 static bool spell_haste(byte spell)
758 {
759         /* Haste self */
760         if (spell == 160 + 0) return (TRUE);
761
762         /* Not a haste spell */
763         return (FALSE);
764 }
765
766
767 /*
768  * Return TRUE if a spell world.
769  */
770 static bool spell_world(byte spell)
771 {
772         /* world */
773         if (spell == 160 + 6) return (TRUE);
774
775         /* Not a haste spell */
776         return (FALSE);
777 }
778
779
780 /*
781  * Return TRUE if a spell special.
782  */
783 static bool spell_special(byte spell)
784 {
785         if (p_ptr->inside_battle) return FALSE;
786
787         /* world */
788         if (spell == 160 + 7) return (TRUE);
789
790         /* Not a haste spell */
791         return (FALSE);
792 }
793
794
795 /*
796  * Return TRUE if a spell psycho-spear.
797  */
798 static bool spell_psy_spe(byte spell)
799 {
800         /* world */
801         if (spell == 160 + 11) return (TRUE);
802
803         /* Not a haste spell */
804         return (FALSE);
805 }
806
807
808 /*
809  * Return TRUE if a spell is good for healing.
810  */
811 static bool spell_heal(byte spell)
812 {
813         /* Heal */
814         if (spell == 160 + 2) return (TRUE);
815
816         /* No healing */
817         return (FALSE);
818 }
819
820
821 /*
822  * Return TRUE if a spell is good for dispel.
823  */
824 static bool spell_dispel(byte spell)
825 {
826         /* Dispel */
827         if (spell == 96 + 2) return (TRUE);
828
829         /* No dispel */
830         return (FALSE);
831 }
832
833
834 /*
835  * Check should monster cast dispel spell.
836  */
837 static bool dispel_check(int m_idx)
838 {
839         monster_type *m_ptr = &m_list[m_idx];
840         monster_race *r_ptr = &r_info[m_ptr->r_idx];
841
842         /* Invulnabilty (including the song) */
843         if (IS_INVULN()) return (TRUE);
844
845         /* Wraith form */
846         if (p_ptr->wraith_form) return (TRUE);
847
848         /* Shield */
849         if (p_ptr->shield) return (TRUE);
850
851         /* Magic defence */
852         if (p_ptr->magicdef) return (TRUE);
853
854         /* Multi Shadow */
855         if (p_ptr->multishadow) return (TRUE);
856
857         /* Robe of dust */
858         if (p_ptr->dustrobe) return (TRUE);
859
860         /* Berserk Strength */
861         if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) return (TRUE);
862
863         /* Demon Lord */
864         if (p_ptr->mimic_form == MIMIC_DEMON_LORD) return (TRUE);
865
866         /* Elemental resistances */
867         if (r_ptr->flags4 & RF4_BR_ACID)
868         {
869                 if (!p_ptr->immune_acid && (p_ptr->oppose_acid || music_singing(MUSIC_RESIST))) return (TRUE);
870                 if (p_ptr->special_defense & DEFENSE_ACID) return (TRUE);
871         }
872
873         if (r_ptr->flags4 & RF4_BR_FIRE)
874         {
875                 if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44))
876                 {
877                         if (!p_ptr->immune_fire && (p_ptr->oppose_fire || music_singing(MUSIC_RESIST))) return (TRUE);
878                         if (p_ptr->special_defense & DEFENSE_FIRE) return (TRUE);
879                 }
880         }
881
882         if (r_ptr->flags4 & RF4_BR_ELEC)
883         {
884                 if (!p_ptr->immune_elec && (p_ptr->oppose_elec || music_singing(MUSIC_RESIST))) return (TRUE);
885                 if (p_ptr->special_defense & DEFENSE_ELEC) return (TRUE);
886         }
887
888         if (r_ptr->flags4 & RF4_BR_COLD)
889         {
890                 if (!p_ptr->immune_cold && (p_ptr->oppose_cold || music_singing(MUSIC_RESIST))) return (TRUE);
891                 if (p_ptr->special_defense & DEFENSE_COLD) return (TRUE);
892         }
893
894         if (r_ptr->flags4 & (RF4_BR_POIS | RF4_BR_NUKE))
895         {
896                 if (!((p_ptr->pclass == CLASS_NINJA) && p_ptr->lev > 44))
897                 {
898                         if (p_ptr->oppose_pois || music_singing(MUSIC_RESIST)) return (TRUE);
899                         if (p_ptr->special_defense & DEFENSE_POIS) return (TRUE);
900                 }
901         }
902
903         /* Ultimate resistance */
904         if (p_ptr->ult_res) return (TRUE);
905
906         /* Potion of Neo Tsuyosi special */
907         if (p_ptr->tsuyoshi) return (TRUE);
908
909         /* Elemental Brands */
910         if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)) return (TRUE);
911         if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)) return (TRUE);
912         if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)) return (TRUE);
913         if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)) return (TRUE);
914         if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)) return (TRUE);
915
916         /* Speed */
917         if (p_ptr->pspeed < 145)
918         {
919                 if (IS_FAST()) return (TRUE);
920         }
921
922         /* Light speed */
923         if (p_ptr->lightspeed && (m_ptr->mspeed < 136)) return (TRUE);
924
925         if (p_ptr->riding && (m_list[p_ptr->riding].mspeed < 135))
926         {
927                 if (m_list[p_ptr->riding].fast) return (TRUE);
928         }
929
930         /* No need to cast dispel spell */
931         return (FALSE);
932 }
933
934
935 /*
936  * Have a monster choose a spell from a list of "useful" spells.
937  *
938  * Note that this list does NOT include spells that will just hit
939  * other monsters, and the list is restricted when the monster is
940  * "desperate".  Should that be the job of this function instead?
941  *
942  * Stupid monsters will just pick a spell randomly.  Smart monsters
943  * will choose more "intelligently".
944  *
945  * Use the helper functions above to put spells into categories.
946  *
947  * This function may well be an efficiency bottleneck.
948  */
949 static int choose_attack_spell(int m_idx, byte spells[], byte num)
950 {
951         monster_type *m_ptr = &m_list[m_idx];
952         monster_race *r_ptr = &r_info[m_ptr->r_idx];
953
954         byte escape[96], escape_num = 0;
955         byte attack[96], attack_num = 0;
956         byte summon[96], summon_num = 0;
957         byte tactic[96], tactic_num = 0;
958         byte annoy[96], annoy_num = 0;
959         byte invul[96], invul_num = 0;
960         byte haste[96], haste_num = 0;
961         byte world[96], world_num = 0;
962         byte special[96], special_num = 0;
963         byte psy_spe[96], psy_spe_num = 0;
964         byte raise[96], raise_num = 0;
965         byte heal[96], heal_num = 0;
966         byte dispel[96], dispel_num = 0;
967
968         int i;
969
970         /* Stupid monsters choose randomly */
971         if (r_ptr->flags2 & (RF2_STUPID))
972         {
973                 /* Pick at random */
974                 return (spells[randint0(num)]);
975         }
976
977         /* Categorize spells */
978         for (i = 0; i < num; i++)
979         {
980                 /* Escape spell? */
981                 if (spell_escape(spells[i])) escape[escape_num++] = spells[i];
982
983                 /* Attack spell? */
984                 if (spell_attack(spells[i])) attack[attack_num++] = spells[i];
985
986                 /* Summon spell? */
987                 if (spell_summon(spells[i])) summon[summon_num++] = spells[i];
988
989                 /* Tactical spell? */
990                 if (spell_tactic(spells[i])) tactic[tactic_num++] = spells[i];
991
992                 /* Annoyance spell? */
993                 if (spell_annoy(spells[i])) annoy[annoy_num++] = spells[i];
994
995                 /* Invulnerability spell? */
996                 if (spell_invulner(spells[i])) invul[invul_num++] = spells[i];
997
998                 /* Haste spell? */
999                 if (spell_haste(spells[i])) haste[haste_num++] = spells[i];
1000
1001                 /* World spell? */
1002                 if (spell_world(spells[i])) world[world_num++] = spells[i];
1003
1004                 /* Special spell? */
1005                 if (spell_special(spells[i])) special[special_num++] = spells[i];
1006
1007                 /* Psycho-spear spell? */
1008                 if (spell_psy_spe(spells[i])) psy_spe[psy_spe_num++] = spells[i];
1009
1010                 /* Raise-dead spell? */
1011                 if (spell_raise(spells[i])) raise[raise_num++] = spells[i];
1012
1013                 /* Heal spell? */
1014                 if (spell_heal(spells[i])) heal[heal_num++] = spells[i];
1015
1016                 /* Dispel spell? */
1017                 if (spell_dispel(spells[i])) dispel[dispel_num++] = spells[i];
1018         }
1019
1020         /*** Try to pick an appropriate spell type ***/
1021
1022         /* world */
1023         if (world_num && (randint0(100) < 15) && !world_monster)
1024         {
1025                 /* Choose haste spell */
1026                 return (world[randint0(world_num)]);
1027         }
1028
1029         /* special */
1030         if (special_num)
1031         {
1032                 bool success = FALSE;
1033                 switch(m_ptr->r_idx)
1034                 {
1035                         case MON_BANOR:
1036                         case MON_LUPART:
1037                                 if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num) success = TRUE;
1038                                 break;
1039                         default: break;
1040                 }
1041                 if (success) return (special[randint0(special_num)]);
1042         }
1043
1044         /* Still hurt badly, couldn't flee, attempt to heal */
1045         if (m_ptr->hp < m_ptr->maxhp / 3 && one_in_(2))
1046         {
1047                 /* Choose heal spell if possible */
1048                 if (heal_num) return (heal[randint0(heal_num)]);
1049         }
1050
1051         /* Hurt badly or afraid, attempt to flee */
1052         if (((m_ptr->hp < m_ptr->maxhp / 3) || m_ptr->monfear) && one_in_(2))
1053         {
1054                 /* Choose escape spell if possible */
1055                 if (escape_num) return (escape[randint0(escape_num)]);
1056         }
1057
1058         /* special */
1059         if (special_num)
1060         {
1061                 bool success = FALSE;
1062                 switch (m_ptr->r_idx)
1063                 {
1064                         case MON_OHMU:
1065                         case MON_BANOR:
1066                         case MON_LUPART:
1067                                 break;
1068                         case MON_BANORLUPART:
1069                                 if (randint0(100) < 70) success = TRUE;
1070                                 break;
1071                         case MON_ROLENTO:
1072                                 if (randint0(100) < 40) success = TRUE;
1073                                 break;
1074                         default:
1075                                 if (randint0(100) < 50) success = TRUE;
1076                                 break;
1077                 }
1078                 if (success) return (special[randint0(special_num)]);
1079         }
1080
1081         /* Player is close and we have attack spells, blink away */
1082         if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
1083         {
1084                 /* Choose tactical spell */
1085                 if (tactic_num) return (tactic[randint0(tactic_num)]);
1086         }
1087
1088         /* Summon if possible (sometimes) */
1089         if (summon_num && (randint0(100) < 40))
1090         {
1091                 /* Choose summon spell */
1092                 return (summon[randint0(summon_num)]);
1093         }
1094
1095         /* dispel */
1096         if (dispel_num && one_in_(2))
1097         {
1098                 /* Choose dispel spell if possible */
1099                 if (dispel_check(m_idx))
1100                 {
1101                         return (dispel[randint0(dispel_num)]);
1102                 }
1103         }
1104
1105         /* Raise-dead if possible (sometimes) */
1106         if (raise_num && (randint0(100) < 40))
1107         {
1108                 /* Choose raise-dead spell */
1109                 return (raise[randint0(raise_num)]);
1110         }
1111
1112         /* Attack spell (most of the time) */
1113         if (IS_INVULN())
1114         {
1115                 if (psy_spe_num && (randint0(100) < 50))
1116                 {
1117                         /* Choose attack spell */
1118                         return (psy_spe[randint0(psy_spe_num)]);
1119                 }
1120                 else if (attack_num && (randint0(100) < 40))
1121                 {
1122                         /* Choose attack spell */
1123                         return (attack[randint0(attack_num)]);
1124                 }
1125         }
1126         else if (attack_num && (randint0(100) < 85))
1127         {
1128                 /* Choose attack spell */
1129                 return (attack[randint0(attack_num)]);
1130         }
1131
1132         /* Try another tactical spell (sometimes) */
1133         if (tactic_num && (randint0(100) < 50) && !world_monster)
1134         {
1135                 /* Choose tactic spell */
1136                 return (tactic[randint0(tactic_num)]);
1137         }
1138
1139         /* Cast globe of invulnerability if not already in effect */
1140         if (invul_num && !(m_ptr->invulner) && (randint0(100) < 50))
1141         {
1142                 /* Choose Globe of Invulnerability */
1143                 return (invul[randint0(invul_num)]);
1144         }
1145
1146         /* We're hurt (not badly), try to heal */
1147         if ((m_ptr->hp < m_ptr->maxhp * 3 / 4) && (randint0(100) < 25))
1148         {
1149                 /* Choose heal spell if possible */
1150                 if (heal_num) return (heal[randint0(heal_num)]);
1151         }
1152
1153         /* Haste self if we aren't already somewhat hasted (rarely) */
1154         if (haste_num && (randint0(100) < 20) && !(m_ptr->fast))
1155         {
1156                 /* Choose haste spell */
1157                 return (haste[randint0(haste_num)]);
1158         }
1159
1160         /* Annoy player (most of the time) */
1161         if (annoy_num && (randint0(100) < 80))
1162         {
1163                 /* Choose annoyance spell */
1164                 return (annoy[randint0(annoy_num)]);
1165         }
1166
1167         /* Choose no spell */
1168         return (0);
1169 }
1170
1171
1172 /*
1173  * Return TRUE if a spell is inate spell.
1174  */
1175 bool spell_is_inate(u16b spell)
1176 {
1177         if (spell < 32 * 4) /* Set RF4 */
1178         {
1179                 if ((1L << (spell - 32 * 3)) & RF4_NOMAGIC_MASK) return TRUE;
1180         }
1181         else if (spell < 32 * 5) /* Set RF5 */
1182         {
1183                 if ((1L << (spell - 32 * 4)) & RF5_NOMAGIC_MASK) return TRUE;
1184         }
1185         else if (spell < 32 * 6) /* Set RF6 */
1186         {
1187                 if ((1L << (spell - 32 * 5)) & RF6_NOMAGIC_MASK) return TRUE;
1188         }
1189
1190         /* This spell is not "inate" */
1191         return FALSE;
1192 }
1193
1194
1195 /*
1196  * Creatures can cast spells, shoot missiles, and breathe.
1197  *
1198  * Returns "TRUE" if a spell (or whatever) was (successfully) cast.
1199  *
1200  * XXX XXX XXX This function could use some work, but remember to
1201  * keep it as optimized as possible, while retaining generic code.
1202  *
1203  * Verify the various "blind-ness" checks in the code.
1204  *
1205  * XXX XXX XXX Note that several effects should really not be "seen"
1206  * if the player is blind.  See also "effects.c" for other "mistakes".
1207  *
1208  * Perhaps monsters should breathe at locations *near* the player,
1209  * since this would allow them to inflict "partial" damage.
1210  *
1211  * Perhaps smart monsters should decline to use "bolt" spells if
1212  * there is a monster in the way, unless they wish to kill it.
1213  *
1214  * Note that, to allow the use of the "track_target" option at some
1215  * later time, certain non-optimal things are done in the code below,
1216  * including explicit checks against the "direct" variable, which is
1217  * currently always true by the time it is checked, but which should
1218  * really be set according to an explicit "projectable()" test, and
1219  * the use of generic "x,y" locations instead of the player location,
1220  * with those values being initialized with the player location.
1221  *
1222  * It will not be possible to "correctly" handle the case in which a
1223  * monster attempts to attack a location which is thought to contain
1224  * the player, but which in fact is nowhere near the player, since this
1225  * might induce all sorts of messages about the attack itself, and about
1226  * the effects of the attack, which the player might or might not be in
1227  * a position to observe.  Thus, for simplicity, it is probably best to
1228  * only allow "faulty" attacks by a monster if one of the important grids
1229  * (probably the initial or final grid) is in fact in view of the player.
1230  * It may be necessary to actually prevent spell attacks except when the
1231  * monster actually has line of sight to the player.  Note that a monster
1232  * could be left in a bizarre situation after the player ducked behind a
1233  * pillar and then teleported away, for example.
1234  *
1235  * Note that certain spell attacks do not use the "project()" function
1236  * but "simulate" it via the "direct" variable, which is always at least
1237  * as restrictive as the "project()" function.  This is necessary to
1238  * prevent "blindness" attacks and such from bending around walls, etc,
1239  * and to allow the use of the "track_target" option in the future.
1240  *
1241  * Note that this function attempts to optimize the use of spells for the
1242  * cases in which the monster has no spells, or has spells but cannot use
1243  * them, or has spells but they will have no "useful" effect.  Note that
1244  * this function has been an efficiency bottleneck in the past.
1245  *
1246  * Note the special "MFLAG_NICE" flag, which prevents a monster from using
1247  * any spell attacks until the player has had a single chance to move.
1248  */
1249 bool make_attack_spell(int m_idx)
1250 {
1251         int             k, thrown_spell = 0, rlev, failrate;
1252         byte            spell[96], num = 0;
1253         u32b            f4, f5, f6;
1254         monster_type    *m_ptr = &m_list[m_idx];
1255         monster_race    *r_ptr = &r_info[m_ptr->r_idx];
1256         char            m_name[80];
1257 #ifndef JP
1258         char            m_poss[80];
1259 #endif
1260         bool            no_inate = FALSE;
1261         bool            do_br_lite = FALSE;
1262         bool            do_br_disi = FALSE;
1263         int             dam = 0;
1264         u32b mode = 0L;
1265         int s_num_6 = (easy_band ? 2 : 6);
1266         int s_num_4 = (easy_band ? 1 : 4);
1267
1268         /* Target location */
1269         int x = px;
1270         int y = py;
1271
1272         /* Summon count */
1273         int count = 0;
1274
1275         /* Extract the blind-ness */
1276         bool blind = (p_ptr->blind ? TRUE : FALSE);
1277
1278         /* Extract the "see-able-ness" */
1279         bool seen = (!blind && m_ptr->ml);
1280
1281         bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
1282         bool learnable = (seen && maneable && !world_monster);
1283
1284         /* Check "projectable" */
1285         bool direct;
1286
1287         bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
1288                 && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
1289
1290         /* Cannot cast spells when confused */
1291         if (m_ptr->confused)
1292         {
1293                 reset_target(m_ptr);
1294                 return (FALSE);
1295         }
1296
1297         /* Cannot cast spells when nice */
1298         if (m_ptr->mflag & MFLAG_NICE) return (FALSE);
1299         if (!is_hostile(m_ptr)) return (FALSE);
1300
1301
1302         /* Sometimes forbid inate attacks (breaths) */
1303         if (randint0(100) >= (r_ptr->freq_spell * 2)) no_inate = TRUE;
1304
1305         /* XXX XXX XXX Handle "track_target" option (?) */
1306
1307
1308         /* Extract the racial spell flags */
1309         f4 = r_ptr->flags4;
1310         f5 = r_ptr->flags5;
1311         f6 = r_ptr->flags6;
1312
1313         /*** require projectable player ***/
1314
1315         /* Check range */
1316         if ((m_ptr->cdis > MAX_RANGE) && !m_ptr->target_y) return (FALSE);
1317
1318         /* Check path */
1319         if (projectable(m_ptr->fy, m_ptr->fx, y, x))
1320         {
1321                 if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
1322                 {
1323                         /* Breath lite to the transparent wall if possible */
1324                         if ((f4 & RF4_BR_LITE) && cave_los_bold(y, x) && one_in_(2)) do_br_lite = TRUE;
1325
1326                         /* Breath disintegration to the wall if possible */
1327                         if ((f4 & RF4_BR_DISI) && have_flag(f_flags_bold(y, x), FF_HURT_DISI) && one_in_(2)) do_br_disi = TRUE;
1328                 }
1329         }
1330
1331         /* Check path to next grid */
1332         else
1333         {
1334                 bool success = FALSE;
1335
1336                 if ((f4 & RF4_BR_DISI) &&
1337                     (m_ptr->cdis < MAX_RANGE/2) &&
1338                     in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
1339                     (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
1340                 {
1341                         do_br_disi = TRUE;
1342                         success = TRUE;
1343                 }
1344                 else if ((f4 & RF4_BR_LITE) &&
1345                     (m_ptr->cdis < MAX_RANGE/2) &&
1346                     los(m_ptr->fy, m_ptr->fx, y, x) &&
1347                     (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
1348                 {
1349                         do_br_lite = TRUE;
1350                         success = TRUE;
1351                 }
1352                 else
1353                 {
1354                         int i;
1355                         int tonari;
1356                         int tonari_y[4][8] = {{-1,-1,-1,0,0,1,1,1},
1357                                               {-1,-1,-1,0,0,1,1,1},
1358                                               {1,1,1,0,0,-1,-1,-1},
1359                                               {1,1,1,0,0,-1,-1,-1}};
1360                         int tonari_x[4][8] = {{-1,0,1,-1,1,-1,0,1},
1361                                               {1,0,-1,1,-1,1,0,-1},
1362                                               {-1,0,1,-1,1,-1,0,1},
1363                                               {1,0,-1,1,-1,1,0,-1}};
1364
1365                         if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
1366                         else if (m_ptr->fy < py) tonari = 1;
1367                         else if (m_ptr->fx < px) tonari = 2;
1368                         else tonari = 3;
1369
1370                         for (i = 0; i < 8; i++)
1371                         {
1372                                 int next_x = x + tonari_x[tonari][i];
1373                                 int next_y = y + tonari_y[tonari][i];
1374                                 cave_type *c_ptr;
1375
1376                                 /* Access the next grid */
1377                                 c_ptr = &cave[next_y][next_x];
1378
1379                                 /* Skip door, rubble, wall, tree, mountain, etc. */
1380                                 if (!have_flag(f_flags_grid(c_ptr), FF_PROJECT)) continue;
1381
1382                                 if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
1383                                 {
1384                                         y = next_y;
1385                                         x = next_x;
1386                                         success = TRUE;
1387                                         break;
1388                                 }
1389                         }
1390                 }
1391
1392                 if (!success)
1393                 {
1394                         if (m_ptr->target_y && m_ptr->target_x)
1395                         {
1396                                 y = m_ptr->target_y;
1397                                 x = m_ptr->target_x;
1398                                 f4 &= (RF4_INDIRECT_MASK);
1399                                 f5 &= (RF5_INDIRECT_MASK);
1400                                 f6 &= (RF6_INDIRECT_MASK);
1401                                 success = TRUE;
1402                         }
1403                 }
1404
1405                 /* No spells */
1406                 if (!success) return FALSE;
1407         }
1408
1409         reset_target(m_ptr);
1410
1411         /* Extract the monster level */
1412         rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
1413
1414         /* Forbid inate attacks sometimes */
1415         if (no_inate)
1416         {
1417                 f4 &= ~(RF4_NOMAGIC_MASK);
1418                 f5 &= ~(RF5_NOMAGIC_MASK);
1419                 f6 &= ~(RF6_NOMAGIC_MASK);
1420         }
1421
1422         if (!p_ptr->csp)
1423         {
1424                 f5 &= ~(RF5_DRAIN_MANA);
1425         }
1426
1427         if ((p_ptr->pclass == CLASS_NINJA) &&
1428             ((r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) ||
1429              (r_ptr->flags7 & RF7_DARK_MASK)))
1430         {
1431                 f6 &= ~(RF6_DARKNESS);
1432         }
1433
1434         if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID))
1435         {
1436                 f4 &= (RF4_NOMAGIC_MASK);
1437                 f5 &= (RF5_NOMAGIC_MASK);
1438                 f6 &= (RF6_NOMAGIC_MASK);
1439         }
1440
1441         if (r_ptr->flags2 & RF2_SMART)
1442         {
1443                 /* Hack -- allow "desperate" spells */
1444                 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
1445                         (randint0(100) < 50))
1446                 {
1447                         /* Require intelligent spells */
1448                         f4 &= (RF4_INT_MASK);
1449                         f5 &= (RF5_INT_MASK);
1450                         f6 &= (RF6_INT_MASK);
1451                 }
1452
1453                 /* Hack -- decline "teleport level" in some case */
1454                 if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF(0))
1455                 {
1456                         f6 &= ~(RF6_TELE_LEVEL);
1457                 }
1458         }
1459
1460         /* No spells left */
1461         if (!f4 && !f5 && !f6) return (FALSE);
1462
1463         /* Remove the "ineffective" spells */
1464         remove_bad_spells(m_idx, &f4, &f5, &f6);
1465
1466         if (p_ptr->inside_arena || p_ptr->inside_battle)
1467         {
1468                 f4 &= ~(RF4_SUMMON_MASK);
1469                 f5 &= ~(RF5_SUMMON_MASK);
1470                 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
1471
1472                 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
1473         }
1474
1475         /* No spells left */
1476         if (!f4 && !f5 && !f6) return (FALSE);
1477
1478         if (!(r_ptr->flags2 & RF2_STUPID))
1479         {
1480                 /* Check for a clean bolt shot */
1481                 if (((f4 & RF4_BOLT_MASK) ||
1482                      (f5 & RF5_BOLT_MASK) ||
1483                      (f6 & RF6_BOLT_MASK)) &&
1484                     !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
1485                 {
1486                         /* Remove spells that will only hurt friends */
1487                         f4 &= ~(RF4_BOLT_MASK);
1488                         f5 &= ~(RF5_BOLT_MASK);
1489                         f6 &= ~(RF6_BOLT_MASK);
1490                 }
1491
1492                 /* Check for a possible summon */
1493                 if (((f4 & RF4_SUMMON_MASK) ||
1494                      (f5 & RF5_SUMMON_MASK) ||
1495                      (f6 & RF6_SUMMON_MASK)) &&
1496                     !(summon_possible(y, x)))
1497                 {
1498                         /* Remove summoning spells */
1499                         f4 &= ~(RF4_SUMMON_MASK);
1500                         f5 &= ~(RF5_SUMMON_MASK);
1501                         f6 &= ~(RF6_SUMMON_MASK);
1502                 }
1503
1504                 /* Check for a possible raise dead */
1505                 if ((f6 & RF6_RAISE_DEAD) && !raise_possible(m_ptr))
1506                 {
1507                         /* Remove raise dead spell */
1508                         f6 &= ~(RF6_RAISE_DEAD);
1509                 }
1510
1511                 /* Special moves restriction */
1512                 if (f6 & RF6_SPECIAL)
1513                 {
1514                         if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(y, x))
1515                         {
1516                                 f6 &= ~(RF6_SPECIAL);
1517                         }
1518                 }
1519
1520                 /* No spells left */
1521                 if (!f4 && !f5 && !f6) return (FALSE);
1522         }
1523
1524         /* Extract the "inate" spells */
1525         for (k = 0; k < 32; k++)
1526         {
1527                 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
1528         }
1529
1530         /* Extract the "normal" spells */
1531         for (k = 0; k < 32; k++)
1532         {
1533                 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
1534         }
1535
1536         /* Extract the "bizarre" spells */
1537         for (k = 0; k < 32; k++)
1538         {
1539                 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
1540         }
1541
1542         /* No spells left */
1543         if (!num) return (FALSE);
1544
1545         /* Stop if player is dead or gone */
1546         if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
1547
1548         /* Stop if player is leaving */
1549         if (p_ptr->leaving) return (FALSE);
1550
1551         /* Get the monster name (or "it") */
1552         monster_desc(m_name, m_ptr, 0x00);
1553
1554 #ifndef JP
1555         /* Get the monster possessive ("his"/"her"/"its") */
1556         monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1557 #endif
1558
1559         if (do_br_lite && do_br_disi)
1560         {
1561                 if (one_in_(2)) thrown_spell = 96+14; /* RF4_BR_LITE */
1562                 else thrown_spell = 96+31; /* RF4_BR_DISI */
1563         }
1564         else if (do_br_lite)
1565         {
1566                 thrown_spell = 96+14; /* RF4_BR_LITE */
1567         }
1568         else if (do_br_disi)
1569         {
1570                 thrown_spell = 96+31; /* RF4_BR_DISI */
1571         }
1572         else
1573         {
1574                 int attempt = 10;
1575                 while(attempt--)
1576                 {
1577                         thrown_spell = choose_attack_spell(m_idx, spell, num);
1578                         if (thrown_spell) break;
1579                 }
1580         }
1581
1582         /* Abort if no spell was chosen */
1583         if (!thrown_spell) return (FALSE);
1584
1585         /* Calculate spell failure rate */
1586         failrate = 25 - (rlev + 3) / 4;
1587
1588         /* Hack -- Stupid monsters will never fail (for jellies and such) */
1589         if (r_ptr->flags2 & RF2_STUPID) failrate = 0;
1590
1591         /* Check for spell failure (inate attacks never fail) */
1592         if (!spell_is_inate(thrown_spell)
1593             && (in_no_magic_dungeon || (m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate)))
1594         {
1595                 disturb(1, 0);
1596                 /* Message */
1597 #ifdef JP
1598                 msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
1599 #else
1600                 msg_format("%^s tries to cast a spell, but fails.", m_name);
1601 #endif
1602
1603                 return (TRUE);
1604         }
1605
1606         /* Projectable? */
1607         direct = player_bold(y, x);
1608
1609         /* Cast the spell. */
1610         switch (thrown_spell)
1611         {
1612                 /* RF4_SHRIEK */
1613                 case 96+0:
1614                 {
1615                         disturb(1, 0);
1616 #ifdef JP
1617 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
1618 #else
1619                         msg_format("%^s makes a high pitched shriek.", m_name);
1620 #endif
1621
1622                         aggravate_monsters(m_idx);
1623                         break;
1624                 }
1625
1626                 /* RF4_XXX1 */
1627                 case 96+1:
1628                 {
1629                         /* XXX XXX XXX */
1630                         break;
1631                 }
1632
1633                 /* RF4_DISPEL */
1634                 case 96+2:
1635                 {
1636                         if (!direct) return (FALSE);
1637                         disturb(1, 0);
1638 #ifdef JP
1639                         if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1640                         else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
1641 #else
1642                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
1643                         else msg_format("%^s invokes a dispel magic.", m_name);
1644 #endif
1645                         set_fast(0, TRUE);
1646                         set_lightspeed(0, TRUE);
1647                         set_slow(0, TRUE);
1648                         set_shield(0, TRUE);
1649                         set_blessed(0, TRUE);
1650                         set_tsuyoshi(0, TRUE);
1651                         set_hero(0, TRUE);
1652                         set_shero(0, TRUE);
1653                         set_protevil(0, TRUE);
1654                         set_invuln(0, TRUE);
1655                         set_wraith_form(0, TRUE);
1656                         set_kabenuke(0, TRUE);
1657                         set_tim_res_nether(0, TRUE);
1658                         set_tim_res_time(0, TRUE);
1659                         /* by henkma */
1660                         set_tim_reflect(0,TRUE);
1661                         set_multishadow(0,TRUE);
1662                         set_dustrobe(0,TRUE);
1663
1664                         set_tim_invis(0, TRUE);
1665                         set_tim_infra(0, TRUE);
1666                         set_tim_esp(0, TRUE);
1667                         set_tim_regen(0, TRUE);
1668                         set_tim_stealth(0, TRUE);
1669                         set_tim_ffall(0, TRUE);
1670                         set_tim_sh_touki(0, TRUE);
1671                         set_tim_sh_fire(0, TRUE);
1672                         set_tim_sh_holy(0, TRUE);
1673                         set_tim_eyeeye(0, TRUE);
1674                         set_magicdef(0, TRUE);
1675                         set_resist_magic(0, TRUE);
1676                         set_oppose_acid(0, TRUE);
1677                         set_oppose_elec(0, TRUE);
1678                         set_oppose_fire(0, TRUE);
1679                         set_oppose_cold(0, TRUE);
1680                         set_oppose_pois(0, TRUE);
1681                         set_ultimate_res(0, TRUE);
1682                         set_mimic(0, 0, TRUE);
1683                         set_ele_attack(0, 0);
1684                         set_ele_immune(0, 0);
1685                         /* Cancel glowing hands */
1686                         if (p_ptr->special_attack & ATTACK_CONFUSE)
1687                         {
1688                                 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1689 #ifdef JP
1690                                 msg_print("¼ê¤Îµ±¤­¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1691 #else
1692                                 msg_print("Your hands stop glowing.");
1693 #endif
1694
1695                         }
1696                         if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
1697                         {
1698                                 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
1699                                 p_ptr->magic_num1[0] = 0;
1700 #ifdef JP
1701                                 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
1702 #else
1703                                 msg_print("Your singing is interrupted.");
1704 #endif
1705                                 p_ptr->action = ACTION_NONE;
1706
1707                                 /* Recalculate bonuses */
1708                                 p_ptr->update |= (PU_BONUS | PU_HP);
1709
1710                                 /* Redraw map */
1711                                 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1712
1713                                 /* Update monsters */
1714                                 p_ptr->update |= (PU_MONSTERS);
1715
1716                                 /* Window stuff */
1717                                 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1718
1719                                 p_ptr->energy_need += ENERGY_NEED();
1720                         }
1721                         if (p_ptr->riding)
1722                         {
1723                                 monster_type *riding_ptr = &m_list[p_ptr->riding];
1724                                 if (riding_ptr->invulner)
1725                                 {
1726                                         riding_ptr->invulner = 0;
1727                                         riding_ptr->energy_need += ENERGY_NEED();
1728                                 }
1729                                 riding_ptr->fast = 0;
1730                                 riding_ptr->slow = 0;
1731                                 p_ptr->update |= PU_BONUS;
1732                                 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH;
1733                                 p_ptr->redraw |= (PR_UHEALTH);
1734                         }
1735
1736 #ifdef JP
1737                         if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1738                                 msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
1739 #endif
1740                         learn_spell(MS_DISPEL);
1741                         break;
1742                 }
1743
1744                 /* RF4_ROCKET */
1745                 case 96+3:
1746                 {
1747                         disturb(1, 0);
1748 #ifdef JP
1749 if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
1750 #else
1751                         if (blind) msg_format("%^s shoots something.", m_name);
1752 #endif
1753
1754 #ifdef JP
1755 else msg_format("%^s¤¬¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name);
1756 #else
1757                         else msg_format("%^s fires a rocket.", m_name);
1758 #endif
1759
1760                         dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
1761                         breath(y, x, m_idx, GF_ROCKET,
1762                                 dam, 2, FALSE, MS_ROCKET, learnable);
1763                         update_smart_learn(m_idx, DRS_SHARD);
1764                         break;
1765                 }
1766
1767                 /* RF4_SHOOT */
1768                 case 96+4:
1769                 {
1770                         if (!direct) return (FALSE);
1771                         disturb(1, 0);
1772 #ifdef JP
1773 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1774 #else
1775                         if (blind) msg_format("%^s makes a strange noise.", m_name);
1776 #endif
1777
1778 #ifdef JP
1779 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1780 #else
1781                         else msg_format("%^s fires an arrow.", m_name);
1782 #endif
1783
1784                         dam = damroll(r_ptr->blow[0].d_dice, r_ptr->blow[0].d_side);
1785                         bolt(m_idx, GF_ARROW, dam, MS_SHOOT, learnable);
1786                         update_smart_learn(m_idx, DRS_REFLECT);
1787                         break;
1788                 }
1789
1790                 /* RF4_XXX2 */
1791                 case 96+5:
1792                 {
1793                         /* XXX XXX XXX */
1794                         break;
1795                 }
1796
1797                 /* RF4_XXX3 */
1798                 case 96+6:
1799                 {
1800                         /* XXX XXX XXX */
1801                         break;
1802                 }
1803
1804                 /* RF4_XXX4 */
1805                 case 96+7:
1806                 {
1807                         /* XXX XXX XXX */
1808                         break;
1809                 }
1810
1811                 /* RF4_BR_ACID */
1812                 case 96+8:
1813                 {
1814                         disturb(1, 0);
1815 #ifdef JP
1816 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1817 #else
1818                         if (blind) msg_format("%^s breathes.", m_name);
1819 #endif
1820
1821 #ifdef JP
1822 else msg_format("%^s¤¬»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1823 #else
1824                         else msg_format("%^s breathes acid.", m_name);
1825 #endif
1826
1827                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1828                         breath(y, x, m_idx, GF_ACID, dam, 0, TRUE, MS_BR_ACID, learnable);
1829                         update_smart_learn(m_idx, DRS_ACID);
1830                         break;
1831                 }
1832
1833                 /* RF4_BR_ELEC */
1834                 case 96+9:
1835                 {
1836                         disturb(1, 0);
1837 #ifdef JP
1838 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1839 #else
1840                         if (blind) msg_format("%^s breathes.", m_name);
1841 #endif
1842
1843 #ifdef JP
1844 else msg_format("%^s¤¬°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1845 #else
1846                         else msg_format("%^s breathes lightning.", m_name);
1847 #endif
1848
1849                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1850                         breath(y, x, m_idx, GF_ELEC, dam,0, TRUE, MS_BR_ELEC, learnable);
1851                         update_smart_learn(m_idx, DRS_ELEC);
1852                         break;
1853                 }
1854
1855                 /* RF4_BR_FIRE */
1856                 case 96+10:
1857                 {
1858                         disturb(1, 0);
1859 #ifdef JP
1860 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1861 #else
1862                         if (blind) msg_format("%^s breathes.", m_name);
1863 #endif
1864
1865 #ifdef JP
1866 else msg_format("%^s¤¬²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1867 #else
1868                         else msg_format("%^s breathes fire.", m_name);
1869 #endif
1870
1871                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1872                         breath(y, x, m_idx, GF_FIRE, dam,0, TRUE, MS_BR_FIRE, learnable);
1873                         update_smart_learn(m_idx, DRS_FIRE);
1874                         break;
1875                 }
1876
1877                 /* RF4_BR_COLD */
1878                 case 96+11:
1879                 {
1880                         disturb(1, 0);
1881 #ifdef JP
1882 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1883 #else
1884                         if (blind) msg_format("%^s breathes.", m_name);
1885 #endif
1886
1887 #ifdef JP
1888 else msg_format("%^s¤¬Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1889 #else
1890                         else msg_format("%^s breathes frost.", m_name);
1891 #endif
1892
1893                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1894                         breath(y, x, m_idx, GF_COLD, dam,0, TRUE, MS_BR_COLD, learnable);
1895                         update_smart_learn(m_idx, DRS_COLD);
1896                         break;
1897                 }
1898
1899                 /* RF4_BR_POIS */
1900                 case 96+12:
1901                 {
1902                         disturb(1, 0);
1903 #ifdef JP
1904 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1905 #else
1906                         if (blind) msg_format("%^s breathes.", m_name);
1907 #endif
1908
1909 #ifdef JP
1910 else msg_format("%^s¤¬¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1911 #else
1912                         else msg_format("%^s breathes gas.", m_name);
1913 #endif
1914
1915                         dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1916                         breath(y, x, m_idx, GF_POIS, dam, 0, TRUE, MS_BR_POIS, learnable);
1917                         update_smart_learn(m_idx, DRS_POIS);
1918                         break;
1919                 }
1920
1921
1922                 /* RF4_BR_NETH */
1923                 case 96+13:
1924                 {
1925                         disturb(1, 0);
1926 #ifdef JP
1927 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1928 #else
1929                         if (blind) msg_format("%^s breathes.", m_name);
1930 #endif
1931
1932 #ifdef JP
1933 else msg_format("%^s¤¬ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1934 #else
1935                         else msg_format("%^s breathes nether.", m_name);
1936 #endif
1937
1938                         dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1939                         breath(y, x, m_idx, GF_NETHER, dam,0, TRUE, MS_BR_NETHER, learnable);
1940                         update_smart_learn(m_idx, DRS_NETH);
1941                         break;
1942                 }
1943
1944                 /* RF4_BR_LITE */
1945                 case 96+14:
1946                 {
1947                         disturb(1, 0);
1948 #ifdef JP
1949 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1950 #else
1951                         if (blind) msg_format("%^s breathes.", m_name);
1952 #endif
1953
1954 #ifdef JP
1955 else msg_format("%^s¤¬Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1956 #else
1957                         else msg_format("%^s breathes light.", m_name);
1958 #endif
1959
1960                         dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1961                         breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable);
1962                         update_smart_learn(m_idx, DRS_LITE);
1963                         break;
1964                 }
1965
1966                 /* RF4_BR_DARK */
1967                 case 96+15:
1968                 {
1969                         disturb(1, 0);
1970 #ifdef JP
1971 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1972 #else
1973                         if (blind) msg_format("%^s breathes.", m_name);
1974 #endif
1975
1976 #ifdef JP
1977 else msg_format("%^s¤¬°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1978 #else
1979                         else msg_format("%^s breathes darkness.", m_name);
1980 #endif
1981
1982                         dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1983                         breath(y, x, m_idx, GF_DARK, dam,0, TRUE, MS_BR_DARK, learnable);
1984                         update_smart_learn(m_idx, DRS_DARK);
1985                         break;
1986                 }
1987
1988                 /* RF4_BR_CONF */
1989                 case 96+16:
1990                 {
1991                         disturb(1, 0);
1992 #ifdef JP
1993 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1994 #else
1995                         if (blind) msg_format("%^s breathes.", m_name);
1996 #endif
1997
1998 #ifdef JP
1999 else msg_format("%^s¤¬º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2000 #else
2001                         else msg_format("%^s breathes confusion.", m_name);
2002 #endif
2003
2004                         dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
2005                         breath(y, x, m_idx, GF_CONFUSION, dam,0, TRUE, MS_BR_CONF, learnable);
2006                         update_smart_learn(m_idx, DRS_CONF);
2007                         break;
2008                 }
2009
2010                 /* RF4_BR_SOUN */
2011                 case 96+17:
2012                 {
2013                         disturb(1, 0);
2014                         if (m_ptr->r_idx == MON_JAIAN)
2015 #ifdef JP
2016                                 msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
2017 #else
2018                                 msg_format("'Booooeeeeee'");
2019 #endif
2020 #ifdef JP
2021 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2022 #else
2023                         else if (blind) msg_format("%^s breathes.", m_name);
2024 #endif
2025
2026 #ifdef JP
2027 else msg_format("%^s¤¬¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2028 #else
2029                         else msg_format("%^s breathes sound.", m_name);
2030 #endif
2031
2032                         dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
2033                         breath(y, x, m_idx, GF_SOUND, dam,0, TRUE, MS_BR_SOUND, learnable);
2034                         update_smart_learn(m_idx, DRS_SOUND);
2035                         break;
2036                 }
2037
2038                 /* RF4_BR_CHAO */
2039                 case 96+18:
2040                 {
2041                         disturb(1, 0);
2042 #ifdef JP
2043 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2044 #else
2045                         if (blind) msg_format("%^s breathes.", m_name);
2046 #endif
2047
2048 #ifdef JP
2049 else msg_format("%^s¤¬¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2050 #else
2051                         else msg_format("%^s breathes chaos.", m_name);
2052 #endif
2053
2054                         dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
2055                         breath(y, x, m_idx, GF_CHAOS, dam,0, TRUE, MS_BR_CHAOS, learnable);
2056                         update_smart_learn(m_idx, DRS_CHAOS);
2057                         break;
2058                 }
2059
2060                 /* RF4_BR_DISE */
2061                 case 96+19:
2062                 {
2063                         disturb(1, 0);
2064 #ifdef JP
2065 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2066 #else
2067                         if (blind) msg_format("%^s breathes.", m_name);
2068 #endif
2069
2070 #ifdef JP
2071 else msg_format("%^s¤¬Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2072 #else
2073                         else msg_format("%^s breathes disenchantment.", m_name);
2074 #endif
2075
2076                         dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2077                         breath(y, x, m_idx, GF_DISENCHANT, dam,0, TRUE, MS_BR_DISEN, learnable);
2078                         update_smart_learn(m_idx, DRS_DISEN);
2079                         break;
2080                 }
2081
2082                 /* RF4_BR_NEXU */
2083                 case 96+20:
2084                 {
2085                         disturb(1, 0);
2086 #ifdef JP
2087 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2088 #else
2089                         if (blind) msg_format("%^s breathes.", m_name);
2090 #endif
2091
2092 #ifdef JP
2093 else msg_format("%^s¤¬°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2094 #else
2095                         else msg_format("%^s breathes nexus.", m_name);
2096 #endif
2097
2098                         dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2099                         breath(y, x, m_idx, GF_NEXUS, dam,0, TRUE, MS_BR_NEXUS, learnable);
2100                         update_smart_learn(m_idx, DRS_NEXUS);
2101                         break;
2102                 }
2103
2104                 /* RF4_BR_TIME */
2105                 case 96+21:
2106                 {
2107                         disturb(1, 0);
2108 #ifdef JP
2109 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2110 #else
2111                         if (blind) msg_format("%^s breathes.", m_name);
2112 #endif
2113
2114 #ifdef JP
2115 else msg_format("%^s¤¬»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2116 #else
2117                         else msg_format("%^s breathes time.", m_name);
2118 #endif
2119
2120                         dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
2121                         breath(y, x, m_idx, GF_TIME, dam,0, TRUE, MS_BR_TIME, learnable);
2122                         break;
2123                 }
2124
2125                 /* RF4_BR_INER */
2126                 case 96+22:
2127                 {
2128                         disturb(1, 0);
2129 #ifdef JP
2130 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2131 #else
2132                         if (blind) msg_format("%^s breathes.", m_name);
2133 #endif
2134
2135 #ifdef JP
2136 else msg_format("%^s¤¬ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2137 #else
2138                         else msg_format("%^s breathes inertia.", m_name);
2139 #endif
2140
2141                         dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2142                         breath(y, x, m_idx, GF_INERTIA, dam,0, TRUE, MS_BR_INERTIA, learnable);
2143                         break;
2144                 }
2145
2146                 /* RF4_BR_GRAV */
2147                 case 96+23:
2148                 {
2149                         disturb(1, 0);
2150 #ifdef JP
2151 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2152 #else
2153                         if (blind) msg_format("%^s breathes.", m_name);
2154 #endif
2155
2156 #ifdef JP
2157 else msg_format("%^s¤¬½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2158 #else
2159                         else msg_format("%^s breathes gravity.", m_name);
2160 #endif
2161
2162                         dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
2163                         breath(y, x, m_idx, GF_GRAVITY, dam,0, TRUE, MS_BR_GRAVITY, learnable);
2164                         break;
2165                 }
2166
2167                 /* RF4_BR_SHAR */
2168                 case 96+24:
2169                 {
2170                         disturb(1, 0);
2171                         if (m_ptr->r_idx == MON_BOTEI)
2172 #ifdef JP
2173                                 msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
2174 #else
2175                                 msg_format("'Boty-Build cutter!!!'");
2176 #endif
2177 #ifdef JP
2178 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2179 #else
2180                         else if (blind) msg_format("%^s breathes.", m_name);
2181 #endif
2182
2183 #ifdef JP
2184 else msg_format("%^s¤¬ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2185 #else
2186                         else msg_format("%^s breathes shards.", m_name);
2187 #endif
2188
2189                         dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2190                         breath(y, x, m_idx, GF_SHARDS, dam,0, TRUE, MS_BR_SHARDS, learnable);
2191                         update_smart_learn(m_idx, DRS_SHARD);
2192                         break;
2193                 }
2194
2195                 /* RF4_BR_PLAS */
2196                 case 96+25:
2197                 {
2198                         disturb(1, 0);
2199 #ifdef JP
2200 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2201 #else
2202                         if (blind) msg_format("%^s breathes.", m_name);
2203 #endif
2204
2205 #ifdef JP
2206 else msg_format("%^s¤¬¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2207 #else
2208                         else msg_format("%^s breathes plasma.", m_name);
2209 #endif
2210
2211                         dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2212                         breath(y, x, m_idx, GF_PLASMA, dam,0, TRUE, MS_BR_PLASMA, learnable);
2213                         break;
2214                 }
2215
2216                 /* RF4_BR_WALL */
2217                 case 96+26:
2218                 {
2219                         disturb(1, 0);
2220 #ifdef JP
2221 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2222 #else
2223                         if (blind) msg_format("%^s breathes.", m_name);
2224 #endif
2225
2226 #ifdef JP
2227 else msg_format("%^s¤¬¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2228 #else
2229                         else msg_format("%^s breathes force.", m_name);
2230 #endif
2231
2232                         dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2233                         breath(y, x, m_idx, GF_FORCE, dam,0, TRUE, MS_BR_FORCE, learnable);
2234                         break;
2235                 }
2236
2237                 /* RF4_BR_MANA */
2238                 case 96+27:
2239                 {
2240                         disturb(1, 0);
2241 #ifdef JP
2242 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2243 #else
2244                         if (blind) msg_format("%^s breathes.", m_name);
2245 #endif
2246
2247 #ifdef JP
2248 else msg_format("%^s¤¬ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2249 #else
2250                         else msg_format("%^s breathes mana.", m_name);
2251 #endif
2252                         dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2253                         breath(y, x, m_idx, GF_MANA, dam,0, TRUE, MS_BR_MANA, learnable);
2254                         break;
2255                 }
2256
2257                 /* RF4_BA_NUKE */
2258                 case 96+28:
2259                 {
2260                         disturb(1, 0);
2261 #ifdef JP
2262 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2263 #else
2264                         if (blind) msg_format("%^s mumbles.", m_name);
2265 #endif
2266
2267 #ifdef JP
2268 else msg_format("%^s¤¬Êü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name);
2269 #else
2270                         else msg_format("%^s casts a ball of radiation.", m_name);
2271 #endif
2272
2273                         dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2274                         breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, learnable);
2275                         update_smart_learn(m_idx, DRS_POIS);
2276                         break;
2277                 }
2278
2279                 /* RF4_BR_NUKE */
2280                 case 96+29:
2281                 {
2282                         disturb(1, 0);
2283 #ifdef JP
2284 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2285 #else
2286                         if (blind) msg_format("%^s breathes.", m_name);
2287 #endif
2288
2289 #ifdef JP
2290 else msg_format("%^s¤¬Êü¼ÍÀ­ÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2291 #else
2292                         else msg_format("%^s breathes toxic waste.", m_name);
2293 #endif
2294
2295                         dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
2296                         breath(y, x, m_idx, GF_NUKE, dam,0, TRUE, MS_BR_NUKE, learnable);
2297                         update_smart_learn(m_idx, DRS_POIS);
2298                         break;
2299                 }
2300
2301                 /* RF4_BA_CHAO */
2302                 case 96+30:
2303                 {
2304                         disturb(1, 0);
2305 #ifdef JP
2306 if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2307 #else
2308                         if (blind) msg_format("%^s mumbles frighteningly.", m_name);
2309 #endif
2310
2311 #ifdef JP
2312 else msg_format("%^s¤¬½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name);/*nuke me*/
2313 #else
2314                         else msg_format("%^s invokes a raw Logrus.", m_name);
2315 #endif
2316
2317                         dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2))+ damroll(10, 10);
2318                         breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, learnable);
2319                         update_smart_learn(m_idx, DRS_CHAOS);
2320                         break;
2321                 }
2322
2323                 /* RF4_BR_DISI */
2324                 case 96+31:
2325                 {
2326                         disturb(1, 0);
2327 #ifdef JP
2328 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2329 #else
2330                         if (blind) msg_format("%^s breathes.", m_name);
2331 #endif
2332
2333 #ifdef JP
2334 else msg_format("%^s¤¬Ê¬²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2335 #else
2336                         else msg_format("%^s breathes disintegration.", m_name);
2337 #endif
2338
2339                         dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2340                         breath(y, x, m_idx, GF_DISINTEGRATE, dam,0, TRUE, MS_BR_DISI, learnable);
2341                         break;
2342                 }
2343
2344
2345
2346                 /* RF5_BA_ACID */
2347                 case 128+0:
2348                 {
2349                         disturb(1, 0);
2350 #ifdef JP
2351 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2352 #else
2353                         if (blind) msg_format("%^s mumbles.", m_name);
2354 #endif
2355
2356 #ifdef JP
2357 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2358 #else
2359                         else msg_format("%^s casts an acid ball.", m_name);
2360 #endif
2361
2362                         dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2363                         breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
2364                         update_smart_learn(m_idx, DRS_ACID);
2365                         break;
2366                 }
2367
2368                 /* RF5_BA_ELEC */
2369                 case 128+1:
2370                 {
2371                         disturb(1, 0);
2372 #ifdef JP
2373 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2374 #else
2375                         if (blind) msg_format("%^s mumbles.", m_name);
2376 #endif
2377
2378 #ifdef JP
2379 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2380 #else
2381                         else msg_format("%^s casts a lightning ball.", m_name);
2382 #endif
2383
2384                         dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2385                         breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
2386                         update_smart_learn(m_idx, DRS_ELEC);
2387                         break;
2388                 }
2389
2390                 /* RF5_BA_FIRE */
2391                 case 128+2:
2392                 {
2393                         disturb(1, 0);
2394
2395                         if (m_ptr->r_idx == MON_ROLENTO)
2396                         {
2397 #ifdef JP
2398                                 if (blind)
2399                                         msg_format("%s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
2400                                 else 
2401                                         msg_format("%s¤Ï¼êÜØÃƤòÅꤲ¤¿¡£", m_name);
2402 #else
2403                                 if (blind)
2404                                         msg_format("%^s throws something.", m_name);
2405                                 else
2406                                         msg_format("%^s throws a hand grenade.", m_name);
2407 #endif
2408                         }
2409                         else
2410                         {
2411 #ifdef JP
2412 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2413 #else
2414                                 if (blind) msg_format("%^s mumbles.", m_name);
2415 #endif
2416
2417 #ifdef JP
2418 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2419 #else
2420                                 else msg_format("%^s casts a fire ball.", m_name);
2421 #endif
2422                         }
2423
2424                         dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2425                         breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2426                         update_smart_learn(m_idx, DRS_FIRE);
2427                         break;
2428                 }
2429
2430                 /* RF5_BA_COLD */
2431                 case 128+3:
2432                 {
2433                         disturb(1, 0);
2434 #ifdef JP
2435 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2436 #else
2437                         if (blind) msg_format("%^s mumbles.", m_name);
2438 #endif
2439
2440 #ifdef JP
2441 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2442 #else
2443                         else msg_format("%^s casts a frost ball.", m_name);
2444 #endif
2445
2446                         dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2447                         breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2448                         update_smart_learn(m_idx, DRS_COLD);
2449                         break;
2450                 }
2451
2452                 /* RF5_BA_POIS */
2453                 case 128+4:
2454                 {
2455                         disturb(1, 0);
2456 #ifdef JP
2457 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2458 #else
2459                         if (blind) msg_format("%^s mumbles.", m_name);
2460 #endif
2461
2462 #ifdef JP
2463 else msg_format("%^s¤¬°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2464 #else
2465                         else msg_format("%^s casts a stinking cloud.", m_name);
2466 #endif
2467
2468                         dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2469                         breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2470                         update_smart_learn(m_idx, DRS_POIS);
2471                         break;
2472                 }
2473
2474                 /* RF5_BA_NETH */
2475                 case 128+5:
2476                 {
2477                         disturb(1, 0);
2478 #ifdef JP
2479 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2480 #else
2481                         if (blind) msg_format("%^s mumbles.", m_name);
2482 #endif
2483
2484 #ifdef JP
2485 else msg_format("%^s¤¬ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2486 #else
2487                         else msg_format("%^s casts a nether ball.", m_name);
2488 #endif
2489
2490                         dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2491                         breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2492                         update_smart_learn(m_idx, DRS_NETH);
2493                         break;
2494                 }
2495
2496                 /* RF5_BA_WATE */
2497                 case 128+6:
2498                 {
2499                         disturb(1, 0);
2500 #ifdef JP
2501 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2502 #else
2503                         if (blind) msg_format("%^s mumbles.", m_name);
2504 #endif
2505
2506 #ifdef JP
2507 else msg_format("%^s¤¬Î®¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name);
2508 #else
2509                         else msg_format("%^s gestures fluidly.", m_name);
2510 #endif
2511
2512 #ifdef JP
2513 msg_print("¤¢¤Ê¤¿¤Ï±²´¬¤­¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£");
2514 #else
2515                         msg_print("You are engulfed in a whirlpool.");
2516 #endif
2517
2518                         dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
2519                         breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2520                         break;
2521                 }
2522
2523                 /* RF5_BA_MANA */
2524                 case 128+7:
2525                 {
2526                         disturb(1, 0);
2527 #ifdef JP
2528 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2529 #else
2530                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2531 #endif
2532
2533 #ifdef JP
2534 else msg_format("%^s¤¬ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2535 #else
2536                         else msg_format("%^s invokes a mana storm.", m_name);
2537 #endif
2538
2539                         dam = (rlev * 4) + 50 + damroll(10, 10);
2540                         breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2541                         break;
2542                 }
2543
2544                 /* RF5_BA_DARK */
2545                 case 128+8:
2546                 {
2547                         disturb(1, 0);
2548 #ifdef JP
2549 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2550 #else
2551                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2552 #endif
2553
2554 #ifdef JP
2555 else msg_format("%^s¤¬°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2556 #else
2557                         else msg_format("%^s invokes a darkness storm.", m_name);
2558 #endif
2559
2560                         dam = (rlev * 4) + 50 + damroll(10, 10);
2561                         breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2562                         update_smart_learn(m_idx, DRS_DARK);
2563                         break;
2564                 }
2565
2566                 /* RF5_DRAIN_MANA */
2567                 case 128+9:
2568                 {
2569                         if (!direct) return (FALSE);
2570                         disturb(1, 0);
2571
2572                         dam = (randint1(rlev) / 2) + 1;
2573                         breath(y, x, m_idx, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, learnable);
2574                         update_smart_learn(m_idx, DRS_MANA);
2575                         break;
2576                 }
2577
2578                 /* RF5_MIND_BLAST */
2579                 case 128+10:
2580                 {
2581                         if (!direct) return (FALSE);
2582                         disturb(1, 0);
2583                         if (!seen)
2584                         {
2585 #ifdef JP
2586 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2587 #else
2588                                 msg_print("You feel something focusing on your mind.");
2589 #endif
2590
2591                         }
2592                         else
2593                         {
2594 #ifdef JP
2595 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¤Ë¤é¤ó¤Ç¤¤¤ë¡£", m_name);
2596 #else
2597                                 msg_format("%^s gazes deep into your eyes.", m_name);
2598 #endif
2599
2600                         }
2601
2602                         dam = damroll(7, 7);
2603                         breath(y, x, m_idx, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, learnable);
2604                         break;
2605                 }
2606
2607                 /* RF5_BRAIN_SMASH */
2608                 case 128+11:
2609                 {
2610                         if (!direct) return (FALSE);
2611                         disturb(1, 0);
2612                         if (!seen)
2613                         {
2614 #ifdef JP
2615 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2616 #else
2617                                 msg_print("You feel something focusing on your mind.");
2618 #endif
2619
2620                         }
2621                         else
2622                         {
2623 #ifdef JP
2624 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¸«¤Æ¤¤¤ë¡£", m_name);
2625 #else
2626                                 msg_format("%^s looks deep into your eyes.", m_name);
2627 #endif
2628
2629                         }
2630
2631                         dam = damroll(12, 12);
2632                         breath(y, x, m_idx, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, learnable);
2633                         break;
2634                 }
2635
2636                 /* RF5_CAUSE_1 */
2637                 case 128+12:
2638                 {
2639                         if (!direct) return (FALSE);
2640                         disturb(1, 0);
2641 #ifdef JP
2642 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2643 #else
2644                         if (blind) msg_format("%^s mumbles.", m_name);
2645 #endif
2646
2647 #ifdef JP
2648 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¼ö¤Ã¤¿¡£", m_name);
2649 #else
2650                         else msg_format("%^s points at you and curses.", m_name);
2651 #endif
2652
2653                         dam = damroll(3, 8);
2654                         breath(y, x, m_idx, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, learnable);
2655                         break;
2656                 }
2657
2658                 /* RF5_CAUSE_2 */
2659                 case 128+13:
2660                 {
2661                         if (!direct) return (FALSE);
2662                         disturb(1, 0);
2663 #ifdef JP
2664 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2665 #else
2666                         if (blind) msg_format("%^s mumbles.", m_name);
2667 #endif
2668
2669 #ifdef JP
2670 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤Ã¤¿¡£", m_name);
2671 #else
2672                         else msg_format("%^s points at you and curses horribly.", m_name);
2673 #endif
2674
2675                         dam = damroll(8, 8);
2676                         breath(y, x, m_idx, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, learnable);
2677                         break;
2678                 }
2679
2680                 /* RF5_CAUSE_3 */
2681                 case 128+14:
2682                 {
2683                         if (!direct) return (FALSE);
2684                         disturb(1, 0);
2685 #ifdef JP
2686 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
2687 #else
2688                         if (blind) msg_format("%^s mumbles loudly.", m_name);
2689 #endif
2690
2691 #ifdef JP
2692 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
2693 #else
2694                         else msg_format("%^s points at you, incanting terribly!", m_name);
2695 #endif
2696
2697                         dam = damroll(10, 15);
2698                         breath(y, x, m_idx, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, learnable);
2699                         break;
2700                 }
2701
2702                 /* RF5_CAUSE_4 */
2703                 case 128+15:
2704                 {
2705                         if (!direct) return (FALSE);
2706                         disturb(1, 0);
2707 #ifdef JP
2708 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2709 #else
2710                         if (blind) msg_format("%^s screams the word 'DIE!'", m_name);
2711 #endif
2712
2713 #ifdef JP
2714 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÈ빦¤òÆͤ¤¤Æ¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2715 #else
2716                         else msg_format("%^s points at you, screaming the word DIE!", m_name);
2717 #endif
2718
2719                         dam = damroll(15, 15);
2720                         breath(y, x, m_idx, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, learnable);
2721                         break;
2722                 }
2723
2724                 /* RF5_BO_ACID */
2725                 case 128+16:
2726                 {
2727                         if (!direct) return (FALSE);
2728                         disturb(1, 0);
2729 #ifdef JP
2730 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2731 #else
2732                         if (blind) msg_format("%^s mumbles.", m_name);
2733 #endif
2734
2735 #ifdef JP
2736 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2737 #else
2738                         else msg_format("%^s casts a acid bolt.", m_name);
2739 #endif
2740
2741                         dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2742                         bolt(m_idx, GF_ACID, dam, MS_BOLT_ACID, learnable);
2743                         update_smart_learn(m_idx, DRS_ACID);
2744                         update_smart_learn(m_idx, DRS_REFLECT);
2745                         break;
2746                 }
2747
2748                 /* RF5_BO_ELEC */
2749                 case 128+17:
2750                 {
2751                         if (!direct) return (FALSE);
2752                         disturb(1, 0);
2753 #ifdef JP
2754 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2755 #else
2756                         if (blind) msg_format("%^s mumbles.", m_name);
2757 #endif
2758
2759 #ifdef JP
2760 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2761 #else
2762                         else msg_format("%^s casts a lightning bolt.", m_name);
2763 #endif
2764
2765                         dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2766                         bolt(m_idx, GF_ELEC, dam, MS_BOLT_ELEC, learnable);
2767                         update_smart_learn(m_idx, DRS_ELEC);
2768                         update_smart_learn(m_idx, DRS_REFLECT);
2769                         break;
2770                 }
2771
2772                 /* RF5_BO_FIRE */
2773                 case 128+18:
2774                 {
2775                         if (!direct) return (FALSE);
2776                         disturb(1, 0);
2777 #ifdef JP
2778 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2779 #else
2780                         if (blind) msg_format("%^s mumbles.", m_name);
2781 #endif
2782
2783 #ifdef JP
2784 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2785 #else
2786                         else msg_format("%^s casts a fire bolt.", m_name);
2787 #endif
2788
2789                         dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2790                         bolt(m_idx, GF_FIRE, dam, MS_BOLT_FIRE, learnable);
2791                         update_smart_learn(m_idx, DRS_FIRE);
2792                         update_smart_learn(m_idx, DRS_REFLECT);
2793                         break;
2794                 }
2795
2796                 /* RF5_BO_COLD */
2797                 case 128+19:
2798                 {
2799                         if (!direct) return (FALSE);
2800                         disturb(1, 0);
2801 #ifdef JP
2802 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2803 #else
2804                         if (blind) msg_format("%^s mumbles.", m_name);
2805 #endif
2806
2807 #ifdef JP
2808 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2809 #else
2810                         else msg_format("%^s casts a frost bolt.", m_name);
2811 #endif
2812
2813                         dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2814                         bolt(m_idx, GF_COLD, dam, MS_BOLT_COLD, learnable);
2815                         update_smart_learn(m_idx, DRS_COLD);
2816                         update_smart_learn(m_idx, DRS_REFLECT);
2817                         break;
2818                 }
2819
2820                 /* RF5_BA_LITE */
2821                 case 128+20:
2822                 {
2823                         disturb(1, 0);
2824 #ifdef JP
2825 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2826 #else
2827                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2828 #endif
2829
2830 #ifdef JP
2831 else msg_format("%^s¤¬¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2832 #else
2833                         else msg_format("%^s invokes a starburst.", m_name);
2834 #endif
2835
2836                         dam = (rlev * 4) + 50 + damroll(10, 10);
2837                         breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2838                         update_smart_learn(m_idx, DRS_LITE);
2839                         break;
2840                 }
2841
2842                 /* RF5_BO_NETH */
2843                 case 128+21:
2844                 {
2845                         if (!direct) return (FALSE);
2846                         disturb(1, 0);
2847 #ifdef JP
2848 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2849 #else
2850                         if (blind) msg_format("%^s mumbles.", m_name);
2851 #endif
2852
2853 #ifdef JP
2854 else msg_format("%^s¤¬ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2855 #else
2856                         else msg_format("%^s casts a nether bolt.", m_name);
2857 #endif
2858
2859                         dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
2860                         bolt(m_idx, GF_NETHER, dam, MS_BOLT_NETHER, learnable);
2861                         update_smart_learn(m_idx, DRS_NETH);
2862                         update_smart_learn(m_idx, DRS_REFLECT);
2863                         break;
2864                 }
2865
2866                 /* RF5_BO_WATE */
2867                 case 128+22:
2868                 {
2869                         if (!direct) return (FALSE);
2870                         disturb(1, 0);
2871 #ifdef JP
2872 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2873 #else
2874                         if (blind) msg_format("%^s mumbles.", m_name);
2875 #endif
2876
2877 #ifdef JP
2878 else msg_format("%^s¤¬¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2879 #else
2880                         else msg_format("%^s casts a water bolt.", m_name);
2881 #endif
2882
2883                         dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2884                         bolt(m_idx, GF_WATER, dam, MS_BOLT_WATER, learnable);
2885                         update_smart_learn(m_idx, DRS_REFLECT);
2886                         break;
2887                 }
2888
2889                 /* RF5_BO_MANA */
2890                 case 128+23:
2891                 {
2892                         if (!direct) return (FALSE);
2893                         disturb(1, 0);
2894 #ifdef JP
2895 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2896 #else
2897                         if (blind) msg_format("%^s mumbles.", m_name);
2898 #endif
2899
2900 #ifdef JP
2901 else msg_format("%^s¤¬ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2902 #else
2903                         else msg_format("%^s casts a mana bolt.", m_name);
2904 #endif
2905
2906                         dam = randint1(rlev * 7 / 2) + 50;
2907                         bolt(m_idx, GF_MANA, dam, MS_BOLT_MANA, learnable);
2908                         update_smart_learn(m_idx, DRS_REFLECT);
2909                         break;
2910                 }
2911
2912                 /* RF5_BO_PLAS */
2913                 case 128+24:
2914                 {
2915                         if (!direct) return (FALSE);
2916                         disturb(1, 0);
2917 #ifdef JP
2918 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2919 #else
2920                         if (blind) msg_format("%^s mumbles.", m_name);
2921 #endif
2922
2923 #ifdef JP
2924 else msg_format("%^s¤¬¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2925 #else
2926                         else msg_format("%^s casts a plasma bolt.", m_name);
2927 #endif
2928
2929                         dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2930                         bolt(m_idx, GF_PLASMA, dam, MS_BOLT_PLASMA, learnable);
2931                         update_smart_learn(m_idx, DRS_REFLECT);
2932                         break;
2933                 }
2934
2935                 /* RF5_BO_ICEE */
2936                 case 128+25:
2937                 {
2938                         if (!direct) return (FALSE);
2939                         disturb(1, 0);
2940 #ifdef JP
2941 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2942 #else
2943                         if (blind) msg_format("%^s mumbles.", m_name);
2944 #endif
2945
2946 #ifdef JP
2947 else msg_format("%^s¤¬¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2948 #else
2949                         else msg_format("%^s casts an ice bolt.", m_name);
2950 #endif
2951
2952                         dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2953                         bolt(m_idx, GF_ICE, dam, MS_BOLT_ICE, learnable);
2954                         update_smart_learn(m_idx, DRS_COLD);
2955                         update_smart_learn(m_idx, DRS_REFLECT);
2956                         break;
2957                 }
2958
2959                 /* RF5_MISSILE */
2960                 case 128+26:
2961                 {
2962                         if (!direct) return (FALSE);
2963                         disturb(1, 0);
2964 #ifdef JP
2965 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2966 #else
2967                         if (blind) msg_format("%^s mumbles.", m_name);
2968 #endif
2969
2970 #ifdef JP
2971 else msg_format("%^s¤¬¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2972 #else
2973                         else msg_format("%^s casts a magic missile.", m_name);
2974 #endif
2975
2976                         dam = damroll(2, 6) + (rlev / 3);
2977                         bolt(m_idx, GF_MISSILE, dam, MS_MAGIC_MISSILE, learnable);
2978                         update_smart_learn(m_idx, DRS_REFLECT);
2979                         break;
2980                 }
2981
2982                 /* RF5_SCARE */
2983                 case 128+27:
2984                 {
2985                         if (!direct) return (FALSE);
2986                         disturb(1, 0);
2987 #ifdef JP
2988 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
2989 #else
2990                         if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
2991 #endif
2992
2993 #ifdef JP
2994 else msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
2995 #else
2996                         else msg_format("%^s casts a fearful illusion.", m_name);
2997 #endif
2998
2999                         if (p_ptr->resist_fear)
3000                         {
3001 #ifdef JP
3002 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3003 #else
3004                                 msg_print("You refuse to be frightened.");
3005 #endif
3006
3007                         }
3008                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3009                         {
3010 #ifdef JP
3011 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3012 #else
3013                                 msg_print("You refuse to be frightened.");
3014 #endif
3015
3016                         }
3017                         else
3018                         {
3019                                 (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
3020                         }
3021                         learn_spell(MS_SCARE);
3022                         update_smart_learn(m_idx, DRS_FEAR);
3023                         break;
3024                 }
3025
3026                 /* RF5_BLIND */
3027                 case 128+28:
3028                 {
3029                         if (!direct) return (FALSE);
3030                         disturb(1, 0);
3031 #ifdef JP
3032 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3033 #else
3034                         if (blind) msg_format("%^s mumbles.", m_name);
3035 #endif
3036
3037 #ifdef JP
3038 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¤¢¤Ê¤¿¤ÎÌܤò¤¯¤é¤Þ¤·¤¿¡ª", m_name);
3039 #else
3040                         else msg_format("%^s casts a spell, burning your eyes!", m_name);
3041 #endif
3042
3043                         if (p_ptr->resist_blind)
3044                         {
3045 #ifdef JP
3046 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3047 #else
3048                                 msg_print("You are unaffected!");
3049 #endif
3050
3051                         }
3052                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3053                         {
3054 #ifdef JP
3055 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3056 #else
3057                                 msg_print("You resist the effects!");
3058 #endif
3059
3060                         }
3061                         else
3062                         {
3063                                 (void)set_blind(12 + randint0(4));
3064                         }
3065                         learn_spell(MS_BLIND);
3066                         update_smart_learn(m_idx, DRS_BLIND);
3067                         break;
3068                 }
3069
3070                 /* RF5_CONF */
3071                 case 128+29:
3072                 {
3073                         if (!direct) return (FALSE);
3074                         disturb(1, 0);
3075 #ifdef JP
3076 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
3077 #else
3078                         if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
3079 #endif
3080
3081 #ifdef JP
3082 else msg_format("%^s¤¬Í¶ÏÇŪ¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3083 #else
3084                         else msg_format("%^s creates a mesmerising illusion.", m_name);
3085 #endif
3086
3087                         if (p_ptr->resist_conf)
3088                         {
3089 #ifdef JP
3090 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3091 #else
3092                                 msg_print("You disbelieve the feeble spell.");
3093 #endif
3094
3095                         }
3096                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3097                         {
3098 #ifdef JP
3099 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3100 #else
3101                                 msg_print("You disbelieve the feeble spell.");
3102 #endif
3103
3104                         }
3105                         else
3106                         {
3107                                 (void)set_confused(p_ptr->confused + randint0(4) + 4);
3108                         }
3109                         learn_spell(MS_CONF);
3110                         update_smart_learn(m_idx, DRS_CONF);
3111                         break;
3112                 }
3113
3114                 /* RF5_SLOW */
3115                 case 128+30:
3116                 {
3117                         if (!direct) return (FALSE);
3118                         disturb(1, 0);
3119 #ifdef JP
3120 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
3121 #else
3122                         msg_format("%^s drains power from your muscles!", m_name);
3123 #endif
3124
3125                         if (p_ptr->free_act)
3126                         {
3127 #ifdef JP
3128 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3129 #else
3130                                 msg_print("You are unaffected!");
3131 #endif
3132
3133                         }
3134                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3135                         {
3136 #ifdef JP
3137 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3138 #else
3139                                 msg_print("You resist the effects!");
3140 #endif
3141
3142                         }
3143                         else
3144                         {
3145                                 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
3146                         }
3147                         learn_spell(MS_SLOW);
3148                         update_smart_learn(m_idx, DRS_FREE);
3149                         break;
3150                 }
3151
3152                 /* RF5_HOLD */
3153                 case 128+31:
3154                 {
3155                         if (!direct) return (FALSE);
3156                         disturb(1, 0);
3157 #ifdef JP
3158 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3159 #else
3160                         if (blind) msg_format("%^s mumbles.", m_name);
3161 #endif
3162
3163 #ifdef JP
3164 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÌܤò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡ª", m_name);
3165 #else
3166                         else msg_format("%^s stares deep into your eyes!", m_name);
3167 #endif
3168
3169                         if (p_ptr->free_act)
3170                         {
3171 #ifdef JP
3172 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3173 #else
3174                                 msg_print("You are unaffected!");
3175 #endif
3176
3177                         }
3178                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3179                         {
3180 #ifdef JP
3181 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3182 #else
3183                                 msg_format("You resist the effects!");
3184 #endif
3185
3186                         }
3187                         else
3188                         {
3189                                 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
3190                         }
3191                         learn_spell(MS_SLEEP);
3192                         update_smart_learn(m_idx, DRS_FREE);
3193                         break;
3194                 }
3195
3196                 /* RF6_HASTE */
3197                 case 160+0:
3198                 {
3199                         disturb(1, 0);
3200                         if (blind)
3201                         {
3202 #ifdef JP
3203 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3204 #else
3205                                 msg_format("%^s mumbles.", m_name);
3206 #endif
3207
3208                         }
3209                         else
3210                         {
3211 #ifdef JP
3212 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name);
3213 #else
3214                                 msg_format("%^s concentrates on %s body.", m_name, m_poss);
3215 #endif
3216
3217                         }
3218
3219                         /* Allow quick speed increases to base+10 */
3220                         if (!m_ptr->fast)
3221                         {
3222 #ifdef JP
3223 msg_format("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
3224 #else
3225                                 msg_format("%^s starts moving faster.", m_name);
3226 #endif
3227                         }
3228                         m_ptr->fast = MIN(200, m_ptr->fast + 100);
3229                         if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS;
3230                         break;
3231                 }
3232
3233                 /* RF6_HAND_DOOM */
3234                 case 160+1:
3235                 {
3236                         if (!direct) return (FALSE);
3237                         disturb(1, 0);
3238 #ifdef JP
3239 msg_format("%^s¤¬<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", m_name);
3240 #else
3241                         msg_format("%^s invokes the Hand of Doom!", m_name);
3242 #endif
3243                         dam = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
3244                         breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, learnable);
3245                         break;
3246                 }
3247
3248                 /* RF6_HEAL */
3249                 case 160+2:
3250                 {
3251                         disturb(1, 0);
3252
3253                         /* Message */
3254                         if (blind)
3255                         {
3256 #ifdef JP
3257 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3258 #else
3259                                 msg_format("%^s mumbles.", m_name);
3260 #endif
3261
3262                         }
3263                         else
3264                         {
3265 #ifdef JP
3266 msg_format("%^s¤¬¼«Ê¬¤Î½ý¤Ë½¸Ã椷¤¿¡£", m_name);
3267 #else
3268                                 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3269 #endif
3270
3271                         }
3272
3273                         /* Heal some */
3274                         m_ptr->hp += (rlev * 6);
3275
3276                         /* Fully healed */
3277                         if (m_ptr->hp >= m_ptr->maxhp)
3278                         {
3279                                 /* Fully healed */
3280                                 m_ptr->hp = m_ptr->maxhp;
3281
3282                                 /* Message */
3283                                 if (seen)
3284                                 {
3285 #ifdef JP
3286 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3287 #else
3288                                         msg_format("%^s looks completely healed!", m_name);
3289 #endif
3290
3291                                 }
3292                                 else
3293                                 {
3294 #ifdef JP
3295 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¤è¤¦¤À¡ª", m_name);
3296 #else
3297                                         msg_format("%^s sounds completely healed!", m_name);
3298 #endif
3299
3300                                 }
3301                         }
3302
3303                         /* Partially healed */
3304                         else
3305                         {
3306                                 /* Message */
3307                                 if (seen)
3308                                 {
3309 #ifdef JP
3310 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3311 #else
3312                                         msg_format("%^s looks healthier.", m_name);
3313 #endif
3314
3315                                 }
3316                                 else
3317                                 {
3318 #ifdef JP
3319 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3320 #else
3321                                         msg_format("%^s sounds healthier.", m_name);
3322 #endif
3323
3324                                 }
3325                         }
3326
3327                         /* Redraw (later) if needed */
3328                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3329                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3330
3331                         /* Cancel fear */
3332                         if (m_ptr->monfear)
3333                         {
3334                                 /* Cancel fear */
3335                                 m_ptr->monfear = 0;
3336
3337                                 /* Message */
3338 #ifdef JP
3339 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3340 #else
3341                                 msg_format("%^s recovers %s courage.", m_name, m_poss);
3342 #endif
3343
3344                         }
3345                         break;
3346                 }
3347
3348                 /* RF6_INVULNER */
3349                 case 160+3:
3350                 {
3351                         disturb(1, 0);
3352
3353                         /* Message */
3354                         if (!seen)
3355                         {
3356 #ifdef JP
3357 msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3358 #else
3359                                 msg_format("%^s mumbles powerfully.", m_name);
3360 #endif
3361
3362                         }
3363                         else
3364                         {
3365 #ifdef JP
3366 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3367 #else
3368                                 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3369 #endif
3370
3371                         }
3372
3373                         if (!(m_ptr->invulner))
3374                                 m_ptr->invulner = randint1(4) + 4;
3375
3376                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3377                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3378                         break;
3379                 }
3380
3381                 /* RF6_BLINK */
3382                 case 160+4:
3383                 {
3384                         disturb(1, 0);
3385 #ifdef JP
3386 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3387 #else
3388                         msg_format("%^s blinks away.", m_name);
3389 #endif
3390
3391                         teleport_away(m_idx, 10, FALSE);
3392                         p_ptr->update |= (PU_MONSTERS);
3393                         break;
3394                 }
3395
3396                 /* RF6_TPORT */
3397                 case 160+5:
3398                 {
3399                         int i, oldfy, oldfx;
3400                         u32b flgs[TR_FLAG_SIZE];
3401                         object_type *o_ptr;
3402
3403                         oldfy = m_ptr->fy;
3404                         oldfx = m_ptr->fx;
3405
3406                         disturb(1, 0);
3407 #ifdef JP
3408 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3409 #else
3410                         msg_format("%^s teleports away.", m_name);
3411 #endif
3412
3413                         teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
3414
3415                         if (los(py, px, oldfy, oldfx) && !world_monster)
3416                         {
3417                                 for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
3418                                 {
3419                                         o_ptr = &inventory[i];
3420                                         if(!cursed_p(o_ptr))
3421                                         {
3422                                                 object_flags(o_ptr, flgs);
3423
3424                                                 if((have_flag(flgs, TR_TELEPORT)) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
3425                                                 {
3426 #ifdef JP
3427                                                         if(get_check_strict("¤Ä¤¤¤Æ¤¤¤­¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3428 #else
3429                                                         if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
3430 #endif
3431                                                         {
3432                                                                 if (one_in_(3))
3433                                                                 {
3434                                                                         teleport_player(200);
3435 #ifdef JP
3436                                                                         msg_print("¼ºÇÔ¡ª");
3437 #else
3438                                                                         msg_print("Failed!");
3439 #endif
3440                                                                 }
3441                                                                 else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3442                                                                 p_ptr->energy_need += ENERGY_NEED();
3443                                                         }
3444                                                         break;
3445                                                 }
3446                                         }
3447                                 }
3448                         }
3449                         break;
3450                 }
3451
3452                 /* RF6_WORLD */
3453                 case 160+6:
3454                 {
3455                         int who = 0;
3456                         disturb(1, 0);
3457                         if(m_ptr->r_idx == MON_DIO) who = 1;
3458                         else if(m_ptr->r_idx == MON_WONG) who = 3;
3459                         dam = who;
3460                         if (!process_the_world(randint1(2)+2, who, TRUE)) return (FALSE);
3461                         break;
3462                 }
3463
3464                 /* RF6_SPECIAL */
3465                 case 160+7:
3466                 {
3467                         int k;
3468
3469                         disturb(1, 0);
3470                         switch (m_ptr->r_idx)
3471                         {
3472                         case MON_OHMU:
3473                                 /* Moved to process_monster(), like multiplication */
3474                                 return FALSE;
3475
3476                         case MON_BANORLUPART:
3477                                 {
3478                                         int dummy_hp = (m_ptr->hp + 1) / 2;
3479                                         int dummy_maxhp = m_ptr->maxhp/2;
3480                                         int dummy_y = m_ptr->fy;
3481                                         int dummy_x = m_ptr->fx;
3482
3483                                         if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
3484                                         delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
3485                                         summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
3486                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3487                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3488                                         summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
3489                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3490                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3491
3492 #ifdef JP
3493                                         msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª");
3494 #else
3495                                         msg_print("Banor=Rupart splits in two person!");
3496 #endif
3497
3498                                         break;
3499                                 }
3500
3501                         case MON_BANOR:
3502                         case MON_LUPART:
3503                                 {
3504                                         int dummy_hp = 0;
3505                                         int dummy_maxhp = 0;
3506                                         int dummy_y = m_ptr->fy;
3507                                         int dummy_x = m_ptr->fx;
3508
3509                                         if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
3510                                         for (k = 1; k < m_max; k++)
3511                                         {
3512                                                 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
3513                                                 {
3514                                                         dummy_hp += m_list[k].hp;
3515                                                         dummy_maxhp += m_list[k].maxhp;
3516                                                         if (m_list[k].r_idx != m_ptr->r_idx)
3517                                                         {
3518                                                                 dummy_y = m_list[k].fy;
3519                                                                 dummy_x = m_list[k].fx;
3520                                                         }
3521                                                         delete_monster_idx(k);
3522                                                 }
3523                                         }
3524                                         summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
3525                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3526                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3527
3528 #ifdef JP
3529                                         msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª");
3530 #else
3531                                         msg_print("Banor and Rupart combine into one!");
3532 #endif
3533
3534                                         break;
3535                                 }
3536
3537                         case MON_ROLENTO:
3538 #ifdef JP
3539                                 if (blind) msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name);
3540                                 else msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3541 #else
3542                                 if (blind) msg_format("%^s spreads something.", m_name);
3543                                 else msg_format("%^s throws some hand grenades.", m_name);
3544 #endif
3545
3546                                 {
3547                                         int num = 1 + randint1(3);
3548
3549                                         for (k = 0; k < num; k++)
3550                                         {
3551                                                 count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
3552                                         }
3553                                 }
3554 #ifdef JP
3555                                 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¤Ð¤é¤Þ¤«¤ì¤ë²»¤¬¤¹¤ë¡£");
3556 #else
3557                                 if (blind && count) msg_print("You hear many things are scattered nearby.");
3558 #endif
3559                                 break;
3560
3561                         default:
3562                                 if (r_ptr->d_char == 'B')
3563                                 {
3564                                         disturb(1, 0);
3565                                         if (one_in_(3) || !direct)
3566                                         {
3567 #ifdef JP
3568                                                 msg_format("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", m_name);
3569 #else
3570                                                 msg_format("%^s suddenly go out of your sight!", m_name);
3571 #endif
3572                                                 teleport_away(m_idx, 10, FALSE);
3573                                                 p_ptr->update |= (PU_MONSTERS);
3574                                         }
3575                                         else
3576                                         {
3577                                                 int get_damage = 0;
3578                                                 bool fear; /* dummy */
3579
3580 #ifdef JP
3581                                                 msg_format("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍ¤¿¡£", m_name);
3582 #else
3583                                                 msg_format("%^s holds you, and drops from the sky.", m_name);
3584 #endif
3585                                                 dam = damroll(4, 8);
3586                                                 teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE);
3587
3588                                                 sound(SOUND_FALL);
3589
3590                                                 if (p_ptr->ffall)
3591                                                 {
3592 #ifdef JP
3593                                                         msg_print("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£");
3594 #else
3595                                                         msg_print("You float gently down to the ground.");
3596 #endif
3597                                                 }
3598                                                 else
3599                                                 {
3600 #ifdef JP
3601                                                         msg_print("¤¢¤Ê¤¿¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£");
3602 #else
3603                                                         msg_print("You crashed into the ground.");
3604 #endif
3605                                                         dam += damroll(6, 8);
3606                                                 }
3607
3608                                                 /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
3609                                                    -- henkma
3610                                                  */
3611                                                 get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
3612                                                 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
3613                                                 {
3614 #ifdef JP
3615                                                         msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
3616 #else
3617                                                         char m_name_self[80];
3618
3619                                                         /* hisself */
3620                                                         monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3621
3622                                                         msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3623 #endif
3624                                                         project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3625                                                         set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3626                                                 }
3627
3628                                                 if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx);
3629                                         }
3630                                         break;
3631                                 }
3632
3633                                 /* Something is wrong */
3634                                 else return FALSE;
3635                         }
3636                         break;
3637                 }
3638
3639                 /* RF6_TELE_TO */
3640                 case 160+8:
3641                 {
3642                         if (!direct) return (FALSE);
3643                         disturb(1, 0);
3644 #ifdef JP
3645 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", m_name);
3646 #else
3647                         msg_format("%^s commands you to return.", m_name);
3648 #endif
3649
3650                         teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3651                         learn_spell(MS_TELE_TO);
3652                         break;
3653                 }
3654
3655                 /* RF6_TELE_AWAY */
3656                 case 160+9:
3657                 {
3658                         if (!direct) return (FALSE);
3659                         disturb(1, 0);
3660 #ifdef JP
3661 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
3662                         if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
3663                                 msg_print("¤¯¤Ã¤½¡Á");
3664 #else
3665                         msg_format("%^s teleports you away.", m_name);
3666 #endif
3667
3668                         learn_spell(MS_TELE_AWAY);
3669                         teleport_player(100);
3670                         break;
3671                 }
3672
3673                 /* RF6_TELE_LEVEL */
3674                 case 160+10:
3675                 {
3676                         if (!direct) return (FALSE);
3677                         disturb(1, 0);
3678 #ifdef JP
3679 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3680 #else
3681                         if (blind) msg_format("%^s mumbles strangely.", m_name);
3682 #endif
3683
3684 #ifdef JP
3685 else msg_format("%^s¤¬¤¢¤Ê¤¿¤Î­¤ò»Ø¤µ¤·¤¿¡£", m_name);
3686 #else
3687                         else msg_format("%^s gestures at your feet.", m_name);
3688 #endif
3689
3690                         if (p_ptr->resist_nexus)
3691                         {
3692 #ifdef JP
3693 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3694 #else
3695                                 msg_print("You are unaffected!");
3696 #endif
3697
3698                         }
3699                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3700                         {
3701 #ifdef JP
3702 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3703 #else
3704                                 msg_print("You resist the effects!");
3705 #endif
3706
3707                         }
3708                         else
3709                         {
3710                                 teleport_level(0);
3711                         }
3712                         learn_spell(MS_TELE_LEVEL);
3713                         update_smart_learn(m_idx, DRS_NEXUS);
3714                         break;
3715                 }
3716
3717                 /* RF6_PSY_SPEAR */
3718                 case 160+11:
3719                 {
3720                         if (!direct) return (FALSE);
3721                         disturb(1, 0);
3722 #ifdef JP
3723 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3724 #else
3725                         if (blind) msg_format("%^s mumbles.", m_name);
3726 #endif
3727
3728 #ifdef JP
3729 else msg_format("%^s¤¬¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name);
3730 #else
3731                         else msg_format("%^s throw a Psycho-Spear.", m_name);
3732 #endif
3733
3734                         dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
3735                         beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
3736                         break;
3737                 }
3738
3739                 /* RF6_DARKNESS */
3740                 case 160+12:
3741                 {
3742                         if (!direct) return (FALSE);
3743                         disturb(1, 0);
3744 #ifdef JP
3745 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3746 #else
3747                         if (blind) msg_format("%^s mumbles.", m_name);
3748 #endif
3749
3750 #ifdef JP
3751 else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3752 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3753 #else
3754                         else if (p_ptr->pclass == CLASS_NINJA)
3755                                 msg_format("%^s cast a spell to light up.", m_name);
3756                         else msg_format("%^s gestures in shadow.", m_name);
3757 #endif
3758
3759                         learn_spell(MS_DARKNESS);
3760                         if (p_ptr->pclass == CLASS_NINJA)
3761                                 (void)lite_area(0, 3);
3762                         else
3763                                 (void)unlite_area(0, 3);
3764                         break;
3765                 }
3766
3767                 /* RF6_TRAPS */
3768                 case 160+13:
3769                 {
3770                         disturb(1, 0);
3771 #ifdef JP
3772 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
3773 #else
3774                         if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
3775 #endif
3776
3777 #ifdef JP
3778 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
3779 #else
3780                         else msg_format("%^s casts a spell and cackles evilly.", m_name);
3781 #endif
3782
3783                         learn_spell(MS_MAKE_TRAP);
3784                         (void)trap_creation(y, x);
3785                         break;
3786                 }
3787
3788                 /* RF6_FORGET */
3789                 case 160+14:
3790                 {
3791                         if (!direct) return (FALSE);
3792                         disturb(1, 0);
3793 #ifdef JP
3794 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ­²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);
3795 #else
3796                         msg_format("%^s tries to blank your mind.", m_name);
3797 #endif
3798
3799
3800                         if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3801                         {
3802 #ifdef JP
3803 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3804 #else
3805                                 msg_print("You resist the effects!");
3806 #endif
3807
3808                         }
3809                         else if (lose_all_info())
3810                         {
3811 #ifdef JP
3812 msg_print("µ­²±¤¬Çö¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
3813 #else
3814                                 msg_print("Your memories fade away.");
3815 #endif
3816
3817                         }
3818                         learn_spell(MS_FORGET);
3819                         break;
3820                 }
3821
3822                 /* RF6_RAISE_DEAD */
3823                 case 160+15:
3824                 {
3825                         disturb(1, 0);
3826 #ifdef JP
3827 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3828 #else
3829                         if (blind) msg_format("%^s mumbles.", m_name);
3830 #endif
3831
3832 #ifdef JP
3833 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3834 #else
3835                         else msg_format("%^s casts a spell to revive corpses.", m_name);
3836 #endif
3837                         animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3838                         break;
3839                 }
3840
3841                 /* RF6_S_KIN */
3842                 case 160+16:
3843                 {
3844                         disturb(1, 0);
3845                         if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
3846                         {
3847 #ifdef JP
3848                                 if (blind)
3849                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3850                                 else
3851                                         msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´­¤·¤¿¡£", m_name);
3852 #else
3853                                 if (blind)
3854                                         msg_format("%^s mumbles.", m_name);
3855                                 else
3856                                         msg_format("%^s magically summons guardians of dungeons.", m_name);
3857 #endif
3858                         }
3859                         else
3860                         {
3861 #ifdef JP
3862                                 if (blind)
3863                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3864                                 else
3865                                         msg_format("%^s¤ÏËâË¡¤Ç%s¤ò¾¤´­¤·¤¿¡£",
3866                                         m_name,
3867                                         ((r_ptr->flags1) & RF1_UNIQUE ?
3868                                         "¼ê²¼" : "Ãç´Ö"));
3869 #else
3870                                 if (blind)
3871                                         msg_format("%^s mumbles.", m_name);
3872                                 else
3873                                         msg_format("%^s magically summons %s %s.",
3874                                         m_name, m_poss,
3875                                         ((r_ptr->flags1) & RF1_UNIQUE ?
3876                                         "minions" : "kin"));
3877 #endif
3878                         }
3879
3880                         switch (m_ptr->r_idx)
3881                         {
3882                         case MON_MENELDOR:
3883                         case MON_GWAIHIR:
3884                         case MON_THORONDOR:
3885                                 {
3886                                         int num = 4 + randint1(3);
3887                                         for (k = 0; k < num; k++)
3888                                         {
3889                                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3890                                         }
3891                                 }
3892                                 break;
3893
3894                         case MON_BULLGATES:
3895                                 {
3896                                         int num = 2 + randint1(3);
3897                                         for (k = 0; k < num; k++)
3898                                         {
3899                                                 count += summon_named_creature(m_idx, y, x, MON_IE, mode);
3900                                         }
3901                                 }
3902                                 break;
3903
3904                         case MON_SERPENT:
3905                         case MON_ZOMBI_SERPENT:
3906                                 {
3907                                         int num = 2 + randint1(3);
3908
3909                                         if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
3910                                         {
3911 #ifdef JP
3912                                                 msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª");
3913 #else
3914                                                 msg_print("Water blew off from the ground!");
3915 #endif
3916                                                 fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
3917                                         }
3918
3919                                         for (k = 0; k < num; k++)
3920                                         {
3921                                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3922                                         }
3923                                 }
3924                                 break;
3925
3926                         case MON_CALDARM:
3927                                 {
3928                                         int num = randint1(3);
3929                                         for (k = 0; k < num; k++)
3930                                         {
3931                                                 count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode);
3932                                         }
3933                                 }
3934                                 break;
3935
3936                         case MON_LOUSY:
3937                                 {
3938                                         int num = 2 + randint1(3);
3939                                         for (k = 0; k < num; k++)
3940                                         {
3941                                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
3942                                         }
3943                                 }
3944                                 break;
3945
3946                         default:
3947                                 summon_kin_type = r_ptr->d_char; /* Big hack */
3948
3949                                 for (k = 0; k < 4; k++)
3950                                 {
3951                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
3952                                 }
3953                                 break;
3954                         }
3955 #ifdef JP
3956                         if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
3957 #else
3958                         if (blind && count) msg_print("You hear many things appear nearby.");
3959 #endif
3960
3961                         break;
3962                 }
3963
3964                 /* RF6_S_CYBER */
3965                 case 160+17:
3966                 {
3967                         disturb(1, 0);
3968 #ifdef JP
3969 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3970 #else
3971                         if (blind) msg_format("%^s mumbles.", m_name);
3972 #endif
3973
3974 #ifdef JP
3975 else msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
3976 #else
3977                         else msg_format("%^s magically summons Cyberdemons!", m_name);
3978 #endif
3979
3980 #ifdef JP
3981 if (blind && count) msg_print("½Å¸ü¤Ê­²»¤¬¶á¤¯¤Çʹ¤³¤¨¤ë¡£");
3982 #else
3983                         if (blind && count) msg_print("You hear heavy steps nearby.");
3984 #endif
3985
3986                         summon_cyber(m_idx, y, x);
3987                         break;
3988                 }
3989
3990                 /* RF6_S_MONSTER */
3991                 case 160+18:
3992                 {
3993                         disturb(1, 0);
3994 #ifdef JP
3995 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3996 #else
3997                         if (blind) msg_format("%^s mumbles.", m_name);
3998 #endif
3999
4000 #ifdef JP
4001 else msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´­¤·¤¿¡ª", m_name);
4002 #else
4003                         else msg_format("%^s magically summons help!", m_name);
4004 #endif
4005
4006                         for (k = 0; k < 1; k++)
4007                         {
4008                                 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4009                         }
4010 #ifdef JP
4011 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4012 #else
4013                         if (blind && count) msg_print("You hear something appear nearby.");
4014 #endif
4015
4016                         break;
4017                 }
4018
4019                 /* RF6_S_MONSTERS */
4020                 case 160+19:
4021                 {
4022                         disturb(1, 0);
4023 #ifdef JP
4024 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4025 #else
4026                         if (blind) msg_format("%^s mumbles.", m_name);
4027 #endif
4028
4029 #ifdef JP
4030 else msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª", m_name);
4031 #else
4032                         else msg_format("%^s magically summons monsters!", m_name);
4033 #endif
4034
4035                         for (k = 0; k < s_num_6; k++)
4036                         {
4037                                 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4038                         }
4039 #ifdef JP
4040 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4041 #else
4042                         if (blind && count) msg_print("You hear many things appear nearby.");
4043 #endif
4044
4045                         break;
4046                 }
4047
4048                 /* RF6_S_ANT */
4049                 case 160+20:
4050                 {
4051                         disturb(1, 0);
4052 #ifdef JP
4053 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4054 #else
4055                         if (blind) msg_format("%^s mumbles.", m_name);
4056 #endif
4057
4058 #ifdef JP
4059 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´­¤·¤¿¡£", m_name);
4060 #else
4061                         else msg_format("%^s magically summons ants.", m_name);
4062 #endif
4063
4064                         for (k = 0; k < s_num_6; k++)
4065                         {
4066                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
4067                         }
4068 #ifdef JP
4069 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4070 #else
4071                         if (blind && count) msg_print("You hear many things appear nearby.");
4072 #endif
4073
4074                         break;
4075                 }
4076
4077                 /* RF6_S_SPIDER */
4078                 case 160+21:
4079                 {
4080                         disturb(1, 0);
4081 #ifdef JP
4082 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4083 #else
4084                         if (blind) msg_format("%^s mumbles.", m_name);
4085 #endif
4086
4087 #ifdef JP
4088 else msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´­¤·¤¿¡£", m_name);
4089 #else
4090                         else msg_format("%^s magically summons spiders.", m_name);
4091 #endif
4092
4093                         for (k = 0; k < s_num_6; k++)
4094                         {
4095                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
4096                         }
4097 #ifdef JP
4098 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4099 #else
4100                         if (blind && count) msg_print("You hear many things appear nearby.");
4101 #endif
4102
4103                         break;
4104                 }
4105
4106                 /* RF6_S_HOUND */
4107                 case 160+22:
4108                 {
4109                         disturb(1, 0);
4110 #ifdef JP
4111 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4112 #else
4113                         if (blind) msg_format("%^s mumbles.", m_name);
4114 #endif
4115
4116 #ifdef JP
4117 else msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£", m_name);
4118 #else
4119                         else msg_format("%^s magically summons hounds.", m_name);
4120 #endif
4121
4122                         for (k = 0; k < s_num_4; k++)
4123                         {
4124                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
4125                         }
4126 #ifdef JP
4127 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4128 #else
4129                         if (blind && count) msg_print("You hear many things appear nearby.");
4130 #endif
4131
4132                         break;
4133                 }
4134
4135                 /* RF6_S_HYDRA */
4136                 case 160+23:
4137                 {
4138                         disturb(1, 0);
4139 #ifdef JP
4140 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4141 #else
4142                         if (blind) msg_format("%^s mumbles.", m_name);
4143 #endif
4144
4145 #ifdef JP
4146 else msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£", m_name);
4147 #else
4148                         else msg_format("%^s magically summons hydras.", m_name);
4149 #endif
4150
4151                         for (k = 0; k < s_num_4; k++)
4152                         {
4153                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
4154                         }
4155 #ifdef JP
4156 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4157 #else
4158                         if (blind && count) msg_print("You hear many things appear nearby.");
4159 #endif
4160
4161                         break;
4162                 }
4163
4164                 /* RF6_S_ANGEL */
4165                 case 160+24:
4166                 {
4167                         int num = 1;
4168
4169                         disturb(1, 0);
4170 #ifdef JP
4171 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4172 #else
4173                         if (blind) msg_format("%^s mumbles.", m_name);
4174 #endif
4175
4176 #ifdef JP
4177 else msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´­¤·¤¿¡ª", m_name);
4178 #else
4179                         else msg_format("%^s magically summons an angel!", m_name);
4180 #endif
4181
4182                         if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
4183                         {
4184                                 num += r_ptr->level/40;
4185                         }
4186
4187                         for (k = 0; k < num; k++)
4188                         {
4189                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
4190                         }
4191
4192                         if (count < 2)
4193                         {
4194 #ifdef JP
4195 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4196 #else
4197                                 if (blind && count) msg_print("You hear something appear nearby.");
4198 #endif
4199                         }
4200                         else
4201                         {
4202 #ifdef JP
4203 if (blind) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4204 #else
4205                                 if (blind) msg_print("You hear many things appear nearby.");
4206 #endif
4207                         }
4208
4209                         break;
4210                 }
4211
4212                 /* RF6_S_DEMON */
4213                 case 160+25:
4214                 {
4215                         disturb(1, 0);
4216 #ifdef JP
4217 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4218 #else
4219                         if (blind) msg_format("%^s mumbles.", m_name);
4220 #endif
4221
4222 #ifdef JP
4223 else msg_format("%^s¤ÏËâË¡¤Çº®Æ٤εÜÄ¤é°­Ëâ¤ò¾¤´­¤·¤¿¡ª", m_name);
4224 #else
4225                         else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4226 #endif
4227
4228                         for (k = 0; k < 1; k++)
4229                         {
4230                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
4231                         }
4232 #ifdef JP
4233 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4234 #else
4235                         if (blind && count) msg_print("You hear something appear nearby.");
4236 #endif
4237
4238                         break;
4239                 }
4240
4241                 /* RF6_S_UNDEAD */
4242                 case 160+26:
4243                 {
4244                         disturb(1, 0);
4245 #ifdef JP
4246 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4247 #else
4248                         if (blind) msg_format("%^s mumbles.", m_name);
4249 #endif
4250
4251 #ifdef JP
4252 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´­¤·¤¿¡ª", m_name);
4253 #else
4254                         else msg_format("%^s magically summons an undead adversary!", m_name);
4255 #endif
4256
4257                         for (k = 0; k < 1; k++)
4258                         {
4259                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
4260                         }
4261 #ifdef JP
4262 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4263 #else
4264                         if (blind && count) msg_print("You hear something appear nearby.");
4265 #endif
4266
4267                         break;
4268                 }
4269
4270                 /* RF6_S_DRAGON */
4271                 case 160+27:
4272                 {
4273                         disturb(1, 0);
4274 #ifdef JP
4275 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4276 #else
4277                         if (blind) msg_format("%^s mumbles.", m_name);
4278 #endif
4279
4280 #ifdef JP
4281 else msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4282 #else
4283                         else msg_format("%^s magically summons a dragon!", m_name);
4284 #endif
4285
4286                         for (k = 0; k < 1; k++)
4287                         {
4288                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
4289                         }
4290 #ifdef JP
4291 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4292 #else
4293                         if (blind && count) msg_print("You hear something appear nearby.");
4294 #endif
4295
4296                         break;
4297                 }
4298
4299                 /* RF6_S_HI_UNDEAD */
4300                 case 160+28:
4301                 {
4302                         disturb(1, 0);
4303
4304                         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))
4305                         {
4306                                 int cy = y;
4307                                 int cx = x;
4308
4309 #ifdef JP
4310 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4311 #else
4312                                 if (blind) msg_format("%^s mumbles.", m_name);
4313 #endif
4314
4315 #ifdef JP
4316 else msg_format("%^s¤¬ËâË¡¤ÇÍ©µ´ÀïÂâ¤ò¾¤´­¤·¤¿¡ª", m_name);
4317 #else
4318                                 else msg_format("%^s magically summons rangers of Nazgul!", m_name);
4319 #endif
4320                                 msg_print(NULL);
4321
4322                                 for (k = 0; k < 30; k++)
4323                                 {
4324                                         if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
4325                                         {
4326                                                 int j;
4327                                                 for (j = 100; j > 0; j--)
4328                                                 {
4329                                                         scatter(&cy, &cx, y, x, 2, 0);
4330                                                         if (cave_empty_bold(cy, cx)) break;
4331                                                 }
4332                                                 if (!j) break;
4333                                         }
4334                                         if (!cave_empty_bold(cy, cx)) continue;
4335
4336                                         if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
4337                                         {
4338                                                 y = cy;
4339                                                 x = cx;
4340                                                 count++;
4341                                                 if (count == 1)
4342 #ifdef JP
4343 msg_format("¡ÖÍ©µ´ÀïÂâ%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4344 #else
4345                                                         msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
4346 #endif
4347                                                 else
4348 #ifdef JP
4349 msg_format("¡ÖƱ¤¸¤¯%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4350 #else
4351                                                         msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
4352 #endif
4353                                                 msg_print(NULL);
4354                                         }
4355                                 }
4356 #ifdef JP
4357 msg_format("¡Ö%d¿Í¤½¤í¤Ã¤Æ¡¢¥ê¥ó¥°¥ì¥ó¥¸¥ã¡¼¡ª¡×", count);
4358 #else
4359 msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
4360 #endif
4361                                 msg_print(NULL);
4362                         }
4363                         else
4364                         {
4365 #ifdef JP
4366 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4367 #else
4368                                 if (blind) msg_format("%^s mumbles.", m_name);
4369 #endif
4370
4371 #ifdef JP
4372 else msg_format("%^s¤¬ËâË¡¤Ç¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡ª", m_name);
4373 #else
4374                                 else msg_format("%^s magically summons greater undead!", m_name);
4375 #endif
4376
4377                                 for (k = 0; k < s_num_6; k++)
4378                                 {
4379                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4380                                 }
4381                         }
4382                         if (blind && count)
4383                         {
4384 #ifdef JP
4385 msg_print("´Ö¶á¤Ç²¿¤«Â¿¤¯¤Î¤â¤Î¤¬Ç礤²ó¤ë²»¤¬Ê¹¤³¤¨¤ë¡£");
4386 #else
4387                                 msg_print("You hear many creepy things appear nearby.");
4388 #endif
4389
4390                         }
4391                         break;
4392                 }
4393
4394                 /* RF6_S_HI_DRAGON */
4395                 case 160+29:
4396                 {
4397                         disturb(1, 0);
4398 #ifdef JP
4399 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4400 #else
4401                         if (blind) msg_format("%^s mumbles.", m_name);
4402 #endif
4403
4404 #ifdef JP
4405 else msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4406 #else
4407                         else msg_format("%^s magically summons ancient dragons!", m_name);
4408 #endif
4409
4410                         for (k = 0; k < s_num_4; k++)
4411                         {
4412                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4413                         }
4414                         if (blind && count)
4415                         {
4416 #ifdef JP
4417 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4418 #else
4419                                 msg_print("You hear many powerful things appear nearby.");
4420 #endif
4421
4422                         }
4423                         break;
4424                 }
4425
4426                 /* RF6_S_AMBERITES */
4427                 case 160+30:
4428                 {
4429                         disturb(1, 0);
4430 #ifdef JP
4431 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4432 #else
4433                         if (blind) msg_format("%^s mumbles.", m_name);
4434 #endif
4435
4436 #ifdef JP
4437 else msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª", m_name);
4438 #else
4439                         else msg_format("%^s magically summons Lords of Amber!", m_name);
4440 #endif
4441
4442
4443
4444                         for (k = 0; k < s_num_4; k++)
4445                         {
4446                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4447                         }
4448                         if (blind && count)
4449                         {
4450 #ifdef JP
4451 msg_print("ÉÔ»à¤Î¼Ô¤¬¶á¤¯¤Ë¸½¤ì¤ë¤Î¤¬Ê¹¤³¤¨¤¿¡£");
4452 #else
4453                                 msg_print("You hear immortal beings appear nearby.");
4454 #endif
4455
4456                         }
4457                         break;
4458                 }
4459
4460                 /* RF6_S_UNIQUE */
4461                 case 160+31:
4462                 {
4463                         disturb(1, 0);
4464 #ifdef JP
4465 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4466 #else
4467                         if (blind) msg_format("%^s mumbles.", m_name);
4468 #endif
4469
4470 #ifdef JP
4471 else msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª", m_name);
4472 #else
4473                         else msg_format("%^s magically summons special opponents!", m_name);
4474 #endif
4475
4476                         for (k = 0; k < s_num_4; k++)
4477                         {
4478                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4479                         }
4480                         if (r_ptr->flags3 & RF3_GOOD)
4481                         {
4482                                 for (k = count; k < s_num_4; k++)
4483                                 {
4484                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4485                                 }
4486                         }
4487                         else
4488                         {
4489                                 for (k = count; k < s_num_4; k++)
4490                                 {
4491                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4492                                 }
4493                         }
4494                         if (blind && count)
4495                         {
4496 #ifdef JP
4497 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4498 #else
4499                                 msg_print("You hear many powerful things appear nearby.");
4500 #endif
4501
4502                         }
4503                         break;
4504                 }
4505         }
4506
4507         if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
4508         {
4509                 learn_spell(thrown_spell - 96);
4510         }
4511
4512         if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR))
4513         {
4514                 if (thrown_spell != 167) /* Not RF6_SPECIAL */
4515                 {
4516                         if (p_ptr->mane_num == MAX_MANE)
4517                         {
4518                                 int i;
4519                                 p_ptr->mane_num--;
4520                                 for (i = 0;i < p_ptr->mane_num;i++)
4521                                 {
4522                                         p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
4523                                         p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
4524                                 }
4525                         }
4526                         p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
4527                         p_ptr->mane_dam[p_ptr->mane_num] = dam;
4528                         p_ptr->mane_num++;
4529                         new_mane = TRUE;
4530
4531                         p_ptr->redraw |= (PR_MANE);
4532                 }
4533         }
4534
4535         /* Remember what the monster did to us */
4536         if (seen && is_original_ap(m_ptr))
4537         {
4538                 /* Inate spell */
4539                 if (thrown_spell < 32 * 4)
4540                 {
4541                         r_ptr->r_flags4 |= (1L << (thrown_spell - 32 * 3));
4542                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4543                 }
4544
4545                 /* Bolt or Ball */
4546                 else if (thrown_spell < 32 * 5)
4547                 {
4548                         r_ptr->r_flags5 |= (1L << (thrown_spell - 32 * 4));
4549                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4550                 }
4551
4552                 /* Special spell */
4553                 else if (thrown_spell < 32 * 6)
4554                 {
4555                         r_ptr->r_flags6 |= (1L << (thrown_spell - 32 * 5));
4556                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4557                 }
4558         }
4559
4560
4561         /* Always take note of monsters that kill you */
4562         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
4563         {
4564                 r_ptr->r_deaths++; /* Ignore appearance difference */
4565         }
4566
4567         /* A spell was cast */
4568         return (TRUE);
4569 }