OSDN Git Service

branch-hexの変更をコミット。
[hengband/hengband.git] / src / mspells2.c
1 /* File: mspells2.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 monster) */
12
13 #include "angband.h"
14
15
16 /*
17  * Monster casts a breath (or ball) attack at another monster.
18  * Pass over any monsters that may be in the way
19  * Affect grids, objects, monsters, and the player
20  */
21 static void monst_breath_monst(int m_idx, int y, int x, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
22 {
23         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
24
25         monster_type *m_ptr = &m_list[m_idx];
26         monster_race *r_ptr = &r_info[m_ptr->r_idx];
27
28         /* Determine the radius of the blast */
29         if (rad < 1 && breath) rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
30
31         /* Handle breath attacks */
32         if (breath) rad = 0 - rad;
33
34         switch (typ)
35         {
36         case GF_ROCKET:
37                 flg |= PROJECT_STOP;
38                 break;
39         case GF_DRAIN_MANA:
40         case GF_MIND_BLAST:
41         case GF_BRAIN_SMASH:
42         case GF_CAUSE_1:
43         case GF_CAUSE_2:
44         case GF_CAUSE_3:
45         case GF_CAUSE_4:
46         case GF_HAND_DOOM:
47                 flg |= (PROJECT_HIDE | PROJECT_AIMED);
48                 break;
49         }
50
51         (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
52 }
53
54
55 /*
56  * Monster casts a bolt at another monster
57  * Stop if we hit a monster
58  * Affect monsters and the player
59  */
60 static void monst_bolt_monst(int m_idx, int y, int x, int typ, int dam_hp, int monspell, bool learnable)
61 {
62         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
63
64         (void)project(m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
65 }
66
67 static void monst_beam_monst(int m_idx, int y, int x, int typ, int dam_hp, int monspell, bool learnable)
68 {
69         int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU;
70
71         (void)project(m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
72 }
73
74 /*
75  * Determine if a beam spell will hit the target.
76  */
77 static bool direct_beam(int y1, int x1, int y2, int x2, monster_type *m_ptr)
78 {
79         bool hit2 = FALSE;
80         int i, y, x;
81
82         int grid_n = 0;
83         u16b grid_g[512];
84
85         bool friend = is_pet(m_ptr);
86
87         /* Check the projection path */
88         grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, PROJECT_THRU);
89
90         /* No grid is ever projectable from itself */
91         if (!grid_n) return (FALSE);
92
93         for (i = 0; i < grid_n; i++)
94         {
95                 y = GRID_Y(grid_g[i]);
96                 x = GRID_X(grid_g[i]);
97
98                 if (y == y2 && x == x2)
99                         hit2 = TRUE;
100                 else if (friend && cave[y][x].m_idx > 0 &&
101                          !are_enemies(m_ptr, &m_list[cave[y][x].m_idx]))
102                 {
103                         /* Friends don't shoot friends */
104                         return FALSE;
105                 }
106
107                 if (friend && player_bold(y, x))
108                         return FALSE;
109         }
110         if (!hit2)
111                 return FALSE;
112         return TRUE;
113 }
114
115 static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool friend)
116 {
117         /* Must be the same as projectable() */
118
119         int i;
120
121         /* Initial grid */
122         int y = y1;
123         int x = x1;
124
125         int grid_n = 0;
126         u16b grid_g[512];
127
128         int grids = 0;
129         byte gx[1024], gy[1024];
130         byte gm[32];
131         int gm_rad = rad;
132
133         bool hit2 = FALSE;
134         bool hityou = FALSE;
135
136         int flg;
137
138         switch (typ)
139         {
140         case GF_LITE:
141         case GF_LITE_WEAK:
142                 flg = PROJECT_LOS;
143                 break;
144         case GF_DISINTEGRATE:
145                 flg = PROJECT_DISI;
146                 break;
147         default:
148                 flg = 0;
149                 break;
150         }
151
152         /* Check the projection path */
153         grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
154
155         /* Project along the path */
156         for (i = 0; i < grid_n; ++i)
157         {
158                 int ny = GRID_Y(grid_g[i]);
159                 int nx = GRID_X(grid_g[i]);
160
161                 if (flg & PROJECT_DISI)
162                 {
163                         /* Hack -- Balls explode before reaching walls */
164                         if (cave_stop_disintegration(ny, nx)) break;
165                 }
166                 else if (flg & PROJECT_LOS)
167                 {
168                         /* Hack -- Balls explode before reaching walls */
169                         if (!cave_los_bold(ny, nx)) break;
170                 }
171                 else
172                 {
173                         /* Hack -- Balls explode before reaching walls */
174                         if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
175                 }
176
177                 /* Save the "blast epicenter" */
178                 y = ny;
179                 x = nx;
180         }
181
182         grid_n = i;
183
184         if (!grid_n)
185         {
186                 if (flg & PROJECT_DISI)
187                 {
188                         if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
189                         if (in_disintegration_range(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
190                 }
191                 else if (flg & PROJECT_LOS)
192                 {
193                         if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
194                         if (los(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
195                 }
196                 else
197                 {
198                         if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
199                         if (projectable(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
200                 }
201         }
202         else
203         {
204                 breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y, x, typ);
205
206                 for (i = 0; i < grids; i++)
207                 {
208                         /* Extract the location */
209                         y = gy[i];
210                         x = gx[i];
211
212                         if ((y == y2) && (x == x2)) hit2 = TRUE;
213                         if (player_bold(y, x)) hityou = TRUE;
214                 }
215         }
216
217         if (!hit2) return FALSE;
218         if (friend && hityou) return FALSE;
219
220         return TRUE;
221 }
222
223 /*
224  * Get the actual center point of ball spells (rad > 1) (originally from TOband)
225  */
226 void get_project_point(int sy, int sx, int *ty, int *tx, int flg)
227 {
228         u16b path_g[128];
229         int  path_n, i;
230
231         path_n = project_path(path_g, MAX_RANGE, sy, sx, *ty, *tx, flg);
232
233         *ty = sy;
234         *tx = sx;
235
236         /* Project along the path */
237         for (i = 0; i < path_n; i++)
238         {
239                 sy = GRID_Y(path_g[i]);
240                 sx = GRID_X(path_g[i]);
241
242                 /* Hack -- Balls explode before reaching walls */
243                 if (!cave_have_flag_bold(sy, sx, FF_PROJECT)) break;
244
245                 *ty = sy;
246                 *tx = sx;
247         }
248 }
249
250 /*
251  * Check should monster cast dispel spell at other monster.
252  */
253 static bool dispel_check_monster(int m_idx, int t_idx)
254 {
255         monster_type *t_ptr = &m_list[t_idx];
256
257         /* Invulnabilty */
258         if (MON_INVULNER(t_ptr)) return TRUE;
259
260         /* Speed */
261         if (t_ptr->mspeed < 135)
262         {
263                 if (MON_FAST(t_ptr)) return TRUE;
264         }
265
266         /* Riding monster */
267         if (t_idx == p_ptr->riding)
268         {
269                 if (dispel_check(m_idx)) return TRUE;
270         }
271
272         /* No need to cast dispel spell */
273         return FALSE;
274 }
275
276 /*
277  * Monster tries to 'cast a spell' (or breath, etc)
278  * at another monster.
279  *
280  * The player is only disturbed if able to be affected by the spell.
281  */
282 bool monst_spell_monst(int m_idx)
283 {
284         int y = 0, x = 0;
285         int i, k, t_idx = 0;
286         int thrown_spell, count = 0;
287         int rlev;
288         int dam = 0;
289         int start;
290         int plus = 1;
291         u32b u_mode = 0L;
292         int s_num_6 = (easy_band ? 2 : 6);
293         int s_num_4 = (easy_band ? 1 : 4);
294
295         byte spell[96], num = 0;
296
297         char m_name[160];
298         char t_name[160];
299
300 #ifndef JP
301         char m_poss[160];
302 #endif
303
304         monster_type *m_ptr = &m_list[m_idx];
305         monster_type *t_ptr = NULL;
306
307         monster_race *r_ptr = &r_info[m_ptr->r_idx];
308         monster_race *tr_ptr = NULL;
309
310         u32b f4, f5, f6;
311
312         bool wake_up = FALSE;
313         bool fear = FALSE;
314
315         bool blind = (p_ptr->blind ? TRUE : FALSE);
316
317         bool see_m = is_seen(m_ptr);
318         bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
319         bool learnable = (m_ptr->ml && maneable && !world_monster);
320         bool see_t;
321         bool see_either;
322         bool known;
323
324         bool pet = is_pet(m_ptr);
325
326         bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
327                 && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
328
329         bool can_use_lite_area = FALSE;
330
331         bool can_remember;
332
333         bool resists_tele = FALSE;
334
335         /* Prepare flags for summoning */
336         if (!pet) u_mode |= PM_ALLOW_UNIQUE;
337
338         /* Cannot cast spells when confused */
339         if (MON_CONFUSED(m_ptr)) return (FALSE);
340
341         /* Extract the racial spell flags */
342         f4 = r_ptr->flags4;
343         f5 = r_ptr->flags5;
344         f6 = r_ptr->flags6;
345
346         /* Target is given for pet? */
347         if (pet_t_m_idx && pet)
348         {
349                 t_idx = pet_t_m_idx;
350                 t_ptr = &m_list[t_idx];
351
352                 /* Cancel if not projectable (for now) */
353                 if ((m_idx == t_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
354                 {
355                         t_idx = 0;
356                 }
357         }
358
359         /* Is there counter attack target? */
360         if (!t_idx && m_ptr->target_y)
361         {
362                 t_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
363
364                 if (t_idx)
365                 {
366                         t_ptr = &m_list[t_idx];
367
368                         /* Cancel if neither enemy nor a given target */
369                         if ((m_idx == t_idx) ||
370                             ((t_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
371                         {
372                                 t_idx = 0;
373                         }
374
375                         /* Allow only summoning etc.. if not projectable */
376                         else if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
377                         {
378                                 f4 &= (RF4_INDIRECT_MASK);
379                                 f5 &= (RF5_INDIRECT_MASK);
380                                 f6 &= (RF6_INDIRECT_MASK);
381                         }
382                 }
383         }
384
385         /* Look for enemies normally */
386         if (!t_idx)
387         {
388                 bool success = FALSE;
389
390                 if (p_ptr->inside_battle)
391                 {
392                         start = randint1(m_max-1) + m_max;
393                         if (randint0(2)) plus = -1;
394                 }
395                 else start = m_max + 1;
396
397                 /* Scan thru all monsters */
398                 for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
399                 {
400                         int dummy = (i % m_max);
401                         if (!dummy) continue;
402
403                         t_idx = dummy;
404                         t_ptr = &m_list[t_idx];
405
406                         /* Skip dead monsters */
407                         if (!t_ptr->r_idx) continue;
408
409                         /* Monster must be 'an enemy' */
410                         if ((m_idx == t_idx) || !are_enemies(m_ptr, t_ptr)) continue;
411
412                         /* Monster must be projectable */
413                         if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
414
415                         /* Get it */
416                         success = TRUE;
417                         break;
418                 }
419
420                 /* No enemy found */
421                 if (!success) return FALSE;
422         }
423
424
425         /* OK -- we've got a target */
426         y = t_ptr->fy;
427         x = t_ptr->fx;
428         tr_ptr = &r_info[t_ptr->r_idx];
429
430         /* Forget old counter attack target */
431         reset_target(m_ptr);
432
433         /* Extract the monster level */
434         rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
435
436         /* Remove unimplemented spells */
437         f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
438
439         if (f4 & RF4_BR_LITE)
440         {
441                 if (!los(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
442                         f4 &= ~(RF4_BR_LITE);
443         }
444
445         /* Remove unimplemented special moves */
446         if (f6 & RF6_SPECIAL)
447         {
448                 if ((m_ptr->r_idx != MON_ROLENTO) && (r_ptr->d_char != 'B'))
449                         f6 &= ~(RF6_SPECIAL);
450         }
451
452         if (f6 & RF6_DARKNESS)
453         {
454                 bool vs_ninja = (p_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
455
456                 if (vs_ninja &&
457                     !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
458                     !(r_ptr->flags7 & RF7_DARK_MASK))
459                         can_use_lite_area = TRUE;
460
461                 if (!(r_ptr->flags2 & RF2_STUPID))
462                 {
463                         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
464                         else if (vs_ninja && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
465                 }
466         }
467
468         if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID))
469         {
470                 f4 &= (RF4_NOMAGIC_MASK);
471                 f5 &= (RF5_NOMAGIC_MASK);
472                 f6 &= (RF6_NOMAGIC_MASK);
473         }
474
475         if (p_ptr->inside_arena || p_ptr->inside_battle)
476         {
477                 f4 &= ~(RF4_SUMMON_MASK);
478                 f5 &= ~(RF5_SUMMON_MASK);
479                 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
480
481                 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
482         }
483
484         if (p_ptr->inside_battle && !one_in_(3))
485         {
486                 f6 &= ~(RF6_HEAL);
487         }
488
489         if (m_idx == p_ptr->riding)
490         {
491                 f4 &= ~(RF4_RIDING_MASK);
492                 f5 &= ~(RF5_RIDING_MASK);
493                 f6 &= ~(RF6_RIDING_MASK);
494         }
495
496         if (pet)
497         {
498                 f4 &= ~(RF4_SHRIEK);
499                 f6 &= ~(RF6_DARKNESS | RF6_TRAPS);
500
501                 if (!(p_ptr->pet_extra_flags & PF_TELEPORT))
502                 {
503                         f6 &= ~(RF6_BLINK | RF6_TPORT | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL);
504                 }
505
506                 if (!(p_ptr->pet_extra_flags & PF_ATTACK_SPELL))
507                 {
508                         f4 &= ~(RF4_ATTACK_MASK);
509                         f5 &= ~(RF5_ATTACK_MASK);
510                         f6 &= ~(RF6_ATTACK_MASK);
511                 }
512
513                 if (!(p_ptr->pet_extra_flags & PF_SUMMON_SPELL))
514                 {
515                         f4 &= ~(RF4_SUMMON_MASK);
516                         f5 &= ~(RF5_SUMMON_MASK);
517                         f6 &= ~(RF6_SUMMON_MASK);
518                 }
519
520                 /* Prevent collateral damage */
521                 if (!(p_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != p_ptr->riding))
522                 {
523                         if ((f4 & (RF4_BALL_MASK & ~(RF4_ROCKET))) ||
524                             (f5 & RF5_BALL_MASK) ||
525                             (f6 & RF6_BALL_MASK))
526                         {
527                                 int real_y = y;
528                                 int real_x = x;
529
530                                 get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
531
532                                 if (projectable(real_y, real_x, py, px))
533                                 {
534                                         int dist = distance(real_y, real_x, py, px);
535
536                                         if (dist <= 2)
537                                         {
538                                                 f4 &= ~(RF4_BALL_MASK & ~(RF4_ROCKET));
539                                                 f5 &= ~(RF5_BALL_MASK);
540                                                 f6 &= ~(RF6_BALL_MASK);
541                                         }
542                                         else if (dist <= 4)
543                                         {
544                                                 f4 &= ~(RF4_BIG_BALL_MASK);
545                                                 f5 &= ~(RF5_BIG_BALL_MASK);
546                                                 f6 &= ~(RF6_BIG_BALL_MASK);
547                                         }
548                                 }
549                                 else if (f5 & RF5_BA_LITE)
550                                 {
551                                         if ((distance(real_y, real_x, py, px) <= 4) && los(real_y, real_x, py, px))
552                                                 f5 &= ~(RF5_BA_LITE);
553                                 }
554                         }
555
556                         if (f4 & RF4_ROCKET)
557                         {
558                                 int real_y = y;
559                                 int real_x = x;
560
561                                 get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
562                                 if (projectable(real_y, real_x, py, px) && (distance(real_y, real_x, py, px) <= 2))
563                                         f4 &= ~(RF4_ROCKET);
564                         }
565
566                         if (((f4 & RF4_BEAM_MASK) ||
567                              (f5 & RF5_BEAM_MASK) ||
568                              (f6 & RF6_BEAM_MASK)) &&
569                             !direct_beam(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, m_ptr))
570                         {
571                                 f4 &= ~(RF4_BEAM_MASK);
572                                 f5 &= ~(RF5_BEAM_MASK);
573                                 f6 &= ~(RF6_BEAM_MASK);
574                         }
575
576                         if ((f4 & RF4_BREATH_MASK) ||
577                             (f5 & RF5_BREATH_MASK) ||
578                             (f6 & RF6_BREATH_MASK))
579                         {
580                                 /* Expected breath radius */
581                                 int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
582
583                                 if (!breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
584                                 {
585                                         f4 &= ~(RF4_BREATH_MASK);
586                                         f5 &= ~(RF5_BREATH_MASK);
587                                         f6 &= ~(RF6_BREATH_MASK);
588                                 }
589                                 else if ((f4 & RF4_BR_LITE) &&
590                                          !breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
591                                 {
592                                         f4 &= ~(RF4_BR_LITE);
593                                 }
594                                 else if ((f4 & RF4_BR_DISI) &&
595                                          !breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
596                                 {
597                                         f4 &= ~(RF4_BR_DISI);
598                                 }
599                         }
600                 }
601
602                 /* Special moves restriction */
603                 if (f6 & RF6_SPECIAL)
604                 {
605                         if (m_ptr->r_idx == MON_ROLENTO)
606                         {
607                                 if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
608                                         f6 &= ~(RF6_SPECIAL);
609                         }
610                         else if (r_ptr->d_char == 'B')
611                         {
612                                 if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
613                                         f6 &= ~(RF6_SPECIAL);
614                         }
615                         else f6 &= ~(RF6_SPECIAL);
616                 }
617         }
618
619         /* Remove some spells if necessary */
620
621         if (!(r_ptr->flags2 & RF2_STUPID))
622         {
623                 /* Check for a clean bolt shot */
624                 if (((f4 & RF4_BOLT_MASK) ||
625                      (f5 & RF5_BOLT_MASK) ||
626                      (f6 & RF6_BOLT_MASK)) &&
627                     !clean_shot(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, pet))
628                 {
629                         f4 &= ~(RF4_BOLT_MASK);
630                         f5 &= ~(RF5_BOLT_MASK);
631                         f6 &= ~(RF6_BOLT_MASK);
632                 }
633
634                 /* Check for a possible summon */
635                 if (((f4 & RF4_SUMMON_MASK) ||
636                      (f5 & RF5_SUMMON_MASK) ||
637                      (f6 & RF6_SUMMON_MASK)) &&
638                     !(summon_possible(t_ptr->fy, t_ptr->fx)))
639                 {
640                         /* Remove summoning spells */
641                         f4 &= ~(RF4_SUMMON_MASK);
642                         f5 &= ~(RF5_SUMMON_MASK);
643                         f6 &= ~(RF6_SUMMON_MASK);
644                 }
645
646                 /* Dispel magic */
647                 if ((f4 & RF4_DISPEL) && !dispel_check_monster(m_idx, t_idx))
648                 {
649                         /* Remove dispel spell */
650                         f4 &= ~(RF4_DISPEL);
651                 }
652
653                 /* Check for a possible raise dead */
654                 if ((f6 & RF6_RAISE_DEAD) && !raise_possible(m_ptr))
655                 {
656                         /* Remove raise dead spell */
657                         f6 &= ~(RF6_RAISE_DEAD);
658                 }
659
660                 /* Special moves restriction */
661                 if (f6 & RF6_SPECIAL)
662                 {
663                         if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(t_ptr->fy, t_ptr->fx))
664                         {
665                                 f6 &= ~(RF6_SPECIAL);
666                         }
667                 }
668         }
669
670         if (r_ptr->flags2 & RF2_SMART)
671         {
672                 /* Hack -- allow "desperate" spells */
673                 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
674                     (randint0(100) < 50))
675                 {
676                         /* Require intelligent spells */
677                         f4 &= (RF4_INT_MASK);
678                         f5 &= (RF5_INT_MASK);
679                         f6 &= (RF6_INT_MASK);
680                 }
681
682                 /* Hack -- decline "teleport level" in some case */
683                 if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((t_idx == p_ptr->riding) ? 0 : t_idx))
684                 {
685                         f6 &= ~(RF6_TELE_LEVEL);
686                 }
687         }
688
689         /* No spells left */
690         if (!f4 && !f5 && !f6) return FALSE;
691
692         /* Extract the "inate" spells */
693         for (k = 0; k < 32; k++)
694         {
695                 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
696         }
697
698         /* Extract the "normal" spells */
699         for (k = 0; k < 32; k++)
700         {
701                 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
702         }
703
704         /* Extract the "bizarre" spells */
705         for (k = 0; k < 32; k++)
706         {
707                 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
708         }
709
710         /* No spells left */
711         if (!num) return (FALSE);
712
713         /* Stop if player is dead or gone */
714         if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
715
716         /* Handle "leaving" */
717         if (p_ptr->leaving) return (FALSE);
718
719         /* Get the monster name (or "it") */
720         monster_desc(m_name, m_ptr, 0x00);
721
722 #ifndef JP
723         /* Get the monster possessive ("his"/"her"/"its") */
724         monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
725 #endif
726
727         /* Get the target's name (or "it") */
728         monster_desc(t_name, t_ptr, 0x00);
729
730         /* Choose a spell to cast */
731         thrown_spell = spell[randint0(num)];
732
733         see_t = is_seen(t_ptr);
734         see_either = (see_m || see_t);
735
736         /* Can the player be aware of this attack? */
737         known = (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT);
738
739         if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 0);
740
741         /* Check for spell failure (inate attacks never fail) */
742         if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
743         {
744                 disturb(1, 0);
745                 /* Message */
746 #ifdef JP
747                 if (see_m) msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
748 #else
749                 if (see_m) msg_format("%^s tries to cast a spell, but fails.", m_name);
750 #endif
751
752                 return (TRUE);
753         }
754
755         /* Hex: Anti Magic Barrier */
756         if (!spell_is_inate(thrown_spell) && magic_barrier(m_idx))
757         {
758 #ifdef JP
759                 if (see_m) msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%^s¤Î¼öʸ¤ò¤«¤­¾Ã¤·¤¿¡£", m_name);
760 #else
761                 if (see_m) msg_format("Anti magic barrier cancels the spell which %^s casts.");
762 #endif
763                 return (TRUE);
764         }
765
766         can_remember = is_original_ap_and_seen(m_ptr);
767
768         switch (thrown_spell)
769         {
770         /* RF4_SHRIEK */
771         case 96+0:
772                 if (known)
773                 {
774                         if (see_m)
775                         {
776 #ifdef JP
777                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¶«¤ó¤À¡£", m_name, t_name);
778 #else
779                                 msg_format("%^s shrieks at %s.", m_name, t_name);
780 #endif
781
782                         }
783                         else
784                         {
785                                 mon_fight = TRUE;
786                         }
787                 }
788
789                 wake_up = TRUE;
790
791                 break;
792
793         /* RF4_XXX1 */
794         case 96+1:
795                 /* XXX XXX XXX */
796                 return FALSE;
797
798         /* RF4_DISPEL */
799         case 96+2:
800                 if (known)
801                 {
802                         if (see_m)
803                         {
804 #ifdef JP
805                                 msg_format("%^s¤¬%s¤ËÂФ·¤ÆËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name, t_name);
806 #else
807                                 msg_format("%^s invokes a dispel magic at %s.", m_name, t_name);
808 #endif
809                         }
810                         else
811                         {
812                                 mon_fight = TRUE;
813                         }
814                 }
815
816                 if (t_idx == p_ptr->riding) dispel_player();
817                 dispel_monster_status(t_idx);
818
819                 break;
820
821         /* RF4_ROCKET */
822         case 96+3:
823                 if (known)
824                 {
825                         if (see_either)
826                         {
827                                 disturb(1, 0);
828
829                                 if (blind)
830                                 {
831 #ifdef JP
832                                         msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
833 #else
834                                         msg_format("%^s shoots something.", m_name);
835 #endif
836
837                                 }
838                                 else
839                                 {
840 #ifdef JP
841                                         msg_format("%^s¤¬%s¤Ë¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name, t_name);
842 #else
843                                         msg_format("%^s fires a rocket at %s.", m_name, t_name);
844 #endif
845
846                                 }
847                         }
848                         else
849                         {
850                                 mon_fight = TRUE;
851                         }
852                 }
853
854                 dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
855                 monst_breath_monst(m_idx, y, x, GF_ROCKET,
856                                    dam, 2, FALSE, MS_ROCKET, learnable);
857
858                 break;
859
860         /* RF4_SHOOT */
861         case 96+4:
862                 if (known)
863                 {
864                         if (see_either)
865                         {
866                                 if (blind)
867                                 {
868 #ifdef JP
869                                         msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
870 #else
871                                         msg_format("%^s makes a strange noise.", m_name);
872 #endif
873
874                                 }
875                                 else
876                                 {
877 #ifdef JP
878                                         msg_format("%^s¤¬%s¤ËÌð¤òÊü¤Ã¤¿¡£", m_name, t_name);
879 #else
880                                         msg_format("%^s fires an arrow at %s.", m_name, t_name);
881 #endif
882
883                                 }
884                         }
885                         else
886                         {
887                                 mon_fight = TRUE;
888                         }
889
890                         sound(SOUND_SHOOT);
891                 }
892
893                 dam = damroll(r_ptr->blow[0].d_dice, r_ptr->blow[0].d_side);
894                 monst_bolt_monst(m_idx, y, x, GF_ARROW, dam, MS_SHOOT, learnable);
895
896                 break;
897
898         /* RF4_XXX2 */
899         case 96+5:
900                 /* XXX XXX XXX */
901                 return FALSE;
902
903         /* RF4_XXX3 */
904         case 96+6:
905                 /* XXX XXX XXX */
906                 return FALSE;
907
908         /* RF4_XXX4 */
909         case 96+7:
910                 /* XXX XXX XXX */
911                 return FALSE;
912
913         /* RF4_BR_ACID */
914         case 96+8:
915                 if (known)
916                 {
917                         if (see_either)
918                         {
919                                 disturb(1, 0);
920
921                                 if (blind)
922                                 {
923 #ifdef JP
924                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
925 #else
926                                         msg_format("%^s breathes.", m_name);
927 #endif
928
929                                 }
930                                 else
931                                 {
932 #ifdef JP
933                                         msg_format("%^s¤¬%s¤Ë»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
934 #else
935                                         msg_format("%^s breathes acid at %s.", m_name, t_name);
936 #endif
937
938                                 }
939                         }
940                         else
941                         {
942                                 mon_fight = TRUE;
943                         }
944
945                         sound(SOUND_BREATH);
946                 }
947
948                 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
949                 monst_breath_monst(m_idx, y, x, GF_ACID,
950                                    dam,0, TRUE, MS_BR_ACID, learnable);
951
952                 break;
953
954         /* RF4_BR_ELEC */
955         case 96+9:
956                 if (known)
957                 {
958                         if (see_either)
959                         {
960                                 disturb(1, 0);
961
962                                 if (blind)
963                                 {
964 #ifdef JP
965                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
966 #else
967                                         msg_format("%^s breathes.", m_name);
968 #endif
969
970                                 }
971                                 else
972                                 {
973 #ifdef JP
974                                         msg_format("%^s¤¬%s¤Ë°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
975 #else
976                                         msg_format("%^s breathes lightning at %s.", m_name, t_name);
977 #endif
978
979                                 }
980                         }
981                         else
982                         {
983                                 mon_fight = TRUE;
984                         }
985
986                         sound(SOUND_BREATH);
987                 }
988
989                 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
990                 monst_breath_monst(m_idx, y, x, GF_ELEC,
991                                    dam,0, TRUE, MS_BR_ELEC, learnable);
992
993                 break;
994
995         /* RF4_BR_FIRE */
996         case 96+10:
997                 if (known)
998                 {
999                         if (see_either)
1000                         {
1001                                 disturb(1, 0);
1002
1003                                 if (blind)
1004                                 {
1005 #ifdef JP
1006                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1007 #else
1008                                         msg_format("%^s breathes.", m_name);
1009 #endif
1010
1011                                 }
1012                                 else
1013                                 {
1014 #ifdef JP
1015                                         msg_format("%^s¤¬%s¤Ë²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1016 #else
1017                                         msg_format("%^s breathes fire at %s.", m_name, t_name);
1018 #endif
1019
1020                                 }
1021                         }
1022                         else
1023                         {
1024                                 mon_fight = TRUE;
1025                         }
1026
1027                         sound(SOUND_BREATH);
1028                 }
1029
1030                 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1031                 monst_breath_monst(m_idx, y, x, GF_FIRE,
1032                                    dam,0, TRUE, MS_BR_FIRE, learnable);
1033
1034                 break;
1035
1036         /* RF4_BR_COLD */
1037         case 96+11:
1038                 if (known)
1039                 {
1040                         if (see_either)
1041                         {
1042                                 disturb(1, 0);
1043
1044                                 if (blind)
1045                                 {
1046 #ifdef JP
1047                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1048 #else
1049                                         msg_format("%^s breathes.", m_name);
1050 #endif
1051
1052                                 }
1053                                 else
1054                                 {
1055 #ifdef JP
1056                                         msg_format("%^s¤¬%s¤ËÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1057 #else
1058                                         msg_format("%^s breathes frost at %s.", m_name, t_name);
1059 #endif
1060
1061                                 }
1062                         }
1063                         else
1064                         {
1065                                 mon_fight = TRUE;
1066                         }
1067
1068                         sound(SOUND_BREATH);
1069                 }
1070
1071                 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1072                 monst_breath_monst(m_idx, y, x, GF_COLD,
1073                                    dam,0, TRUE, MS_BR_COLD, learnable);
1074                 break;
1075
1076         /* RF4_BR_POIS */
1077         case 96+12:
1078                 if (known)
1079                 {
1080                         if (see_either)
1081                         {
1082                                 disturb(1, 0);
1083
1084                                 if (blind)
1085                                 {
1086 #ifdef JP
1087                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1088 #else
1089                                         msg_format("%^s breathes.", m_name);
1090 #endif
1091
1092                                 }
1093                                 else
1094                                 {
1095 #ifdef JP
1096                                         msg_format("%^s¤¬%s¤Ë¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1097 #else
1098                                         msg_format("%^s breathes gas at %s.", m_name, t_name);
1099 #endif
1100
1101                                 }
1102                         }
1103                         else
1104                         {
1105                                 mon_fight = TRUE;
1106                         }
1107
1108                         sound(SOUND_BREATH);
1109                 }
1110
1111                 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1112                 monst_breath_monst(m_idx, y, x, GF_POIS,
1113                                    dam,0, TRUE, MS_BR_POIS, learnable);
1114
1115                 break;
1116
1117         /* RF4_BR_NETH */
1118         case 96+13:
1119                 if (known)
1120                 {
1121                         if (see_either)
1122                         {
1123                                 disturb(1, 0);
1124
1125                                 if (blind)
1126                                 {
1127 #ifdef JP
1128                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1129 #else
1130                                         msg_format("%^s breathes.", m_name);
1131 #endif
1132
1133                                 }
1134                                 else
1135                                 {
1136 #ifdef JP
1137                                         msg_format("%^s¤¬%s¤ËÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1138 #else
1139                                         msg_format("%^s breathes nether at %s.", m_name, t_name);
1140 #endif
1141
1142                                 }
1143                         }
1144                         else
1145                         {
1146                                 mon_fight = TRUE;
1147                         }
1148
1149                         sound(SOUND_BREATH);
1150                 }
1151
1152                 dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1153                 monst_breath_monst(m_idx, y, x, GF_NETHER,
1154                                    dam,0, TRUE, MS_BR_NETHER, learnable);
1155
1156                 break;
1157
1158         /* RF4_BR_LITE */
1159         case 96+14:
1160                 if (known)
1161                 {
1162                         if (see_either)
1163                         {
1164                                 disturb(1, 0);
1165
1166                                 if (blind)
1167                                 {
1168 #ifdef JP
1169                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1170 #else
1171                                         msg_format("%^s breathes.", m_name);
1172 #endif
1173
1174                                 }
1175                                 else
1176                                 {
1177 #ifdef JP
1178                                         msg_format("%^s¤¬%s¤ËÁ®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1179 #else
1180                                         msg_format("%^s breathes light at %s.", m_name, t_name);
1181 #endif
1182
1183                                 }
1184                         }
1185                         else
1186                         {
1187                                 mon_fight = TRUE;
1188                         }
1189
1190                         sound(SOUND_BREATH);
1191                 }
1192
1193                 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1194                 monst_breath_monst(m_idx, y, x, GF_LITE,
1195                                    dam,0, TRUE, MS_BR_LITE, learnable);
1196
1197                 break;
1198
1199         /* RF4_BR_DARK */
1200         case 96+15:
1201                 if (known)
1202                 {
1203                         if (see_either)
1204                         {
1205                                 disturb(1, 0);
1206
1207                                 if (blind)
1208                                 {
1209 #ifdef JP
1210                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1211 #else
1212                                         msg_format("%^s breathes.", m_name);
1213 #endif
1214
1215                                 }
1216                                 else
1217                                 {
1218 #ifdef JP
1219                                         msg_format("%^s¤¬%s¤Ë°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1220 #else
1221                                         msg_format("%^s breathes darkness at %s.", m_name, t_name);
1222 #endif
1223
1224                                 }
1225                         }
1226                         else
1227                         {
1228                                 mon_fight = TRUE;
1229                         }
1230
1231                         sound(SOUND_BREATH);
1232                 }
1233
1234                 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1235                 monst_breath_monst(m_idx, y, x, GF_DARK,
1236                                    dam,0, TRUE, MS_BR_DARK, learnable);
1237
1238                 break;
1239
1240         /* RF4_BR_CONF */
1241         case 96+16:
1242                 if (known)
1243                 {
1244                         if (see_either)
1245                         {
1246                                 disturb(1, 0);
1247
1248                                 if (blind)
1249                                 {
1250 #ifdef JP
1251                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1252 #else
1253                                         msg_format("%^s breathes.", m_name);
1254 #endif
1255
1256                                 }
1257                                 else
1258                                 {
1259 #ifdef JP
1260                                         msg_format("%^s¤¬%s¤Ëº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1261 #else
1262                                         msg_format("%^s breathes confusion at %s.", m_name, t_name);
1263 #endif
1264
1265                                 }
1266                         }
1267                         else
1268                         {
1269                                 mon_fight = TRUE;
1270                         }
1271
1272                         sound(SOUND_BREATH);
1273                 }
1274
1275                 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1276                 monst_breath_monst(m_idx, y, x, GF_CONFUSION,
1277                                    dam,0, TRUE, MS_BR_CONF, learnable);
1278
1279                 break;
1280
1281         /* RF4_BR_SOUN */
1282         case 96+17:
1283                 if (known)
1284                 {
1285                         if (see_either)
1286                         {
1287                                 disturb(1, 0);
1288
1289                                 if (m_ptr->r_idx == MON_JAIAN)
1290 #ifdef JP
1291                                         msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
1292 #else
1293                                 msg_format("'Booooeeeeee'");
1294 #endif
1295                                 else if (blind)
1296                                 {
1297 #ifdef JP
1298                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1299 #else
1300                                         msg_format("%^s breathes.", m_name);
1301 #endif
1302
1303                                 }
1304                                 else
1305                                 {
1306 #ifdef JP
1307                                         msg_format("%^s¤¬%s¤Ë¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1308 #else
1309                                         msg_format("%^s breathes sound at %s.", m_name, t_name);
1310 #endif
1311
1312                                 }
1313                         }
1314                         else
1315                         {
1316                                 mon_fight = TRUE;
1317                         }
1318
1319                         sound(SOUND_BREATH);
1320                 }
1321
1322                 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1323                 monst_breath_monst(m_idx, y, x, GF_SOUND,
1324                                    dam,0, TRUE, MS_BR_SOUND, learnable);
1325
1326                 break;
1327
1328         /* RF4_BR_CHAO */
1329         case 96+18:
1330                 if (known)
1331                 {
1332                         if (see_either)
1333                         {
1334                                 disturb(1, 0);
1335
1336                                 if (blind)
1337                                 {
1338 #ifdef JP
1339                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1340 #else
1341                                         msg_format("%^s breathes.", m_name);
1342 #endif
1343
1344                                 }
1345                                 else
1346                                 {
1347 #ifdef JP
1348                                         msg_format("%^s¤¬%s¤Ë¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1349 #else
1350                                         msg_format("%^s breathes chaos at %s.", m_name, t_name);
1351 #endif
1352
1353                                 }
1354                         }
1355                         else
1356                         {
1357                                 mon_fight = TRUE;
1358                         }
1359
1360                         sound(SOUND_BREATH);
1361                 }
1362
1363                 dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
1364                 monst_breath_monst(m_idx, y, x, GF_CHAOS,
1365                                    dam,0, TRUE, MS_BR_CHAOS, learnable);
1366
1367                 break;
1368
1369         /* RF4_BR_DISE */
1370         case 96+19:
1371                 if (known)
1372                 {
1373                         if (see_either)
1374                         {
1375                                 disturb(1, 0);
1376
1377                                 if (blind)
1378                                 {
1379 #ifdef JP
1380                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1381 #else
1382                                         msg_format("%^s breathes.", m_name);
1383 #endif
1384
1385                                 }
1386                                 else
1387                                 {
1388 #ifdef JP
1389                                         msg_format("%^s¤¬%s¤ËÎô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1390 #else
1391                                         msg_format("%^s breathes disenchantment at %s.", m_name, t_name);
1392 #endif
1393
1394                                 }
1395                         }
1396                         else
1397                         {
1398                                 mon_fight = TRUE;
1399                         }
1400
1401                         sound(SOUND_BREATH);
1402                 }
1403
1404                 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
1405                 monst_breath_monst(m_idx, y, x, GF_DISENCHANT,
1406                                    dam,0, TRUE, MS_BR_DISEN, learnable);
1407
1408                 break;
1409
1410         /* RF4_BR_NEXU */
1411         case 96+20:
1412                 if (known)
1413                 {
1414                         if (see_either)
1415                         {
1416                                 disturb(1, 0);
1417
1418                                 if (blind)
1419                                 {
1420 #ifdef JP
1421                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1422 #else
1423                                         msg_format("%^s breathes.", m_name);
1424 #endif
1425
1426                                 }
1427                                 else
1428                                 {
1429 #ifdef JP
1430                                         msg_format("%^s¤¬%s¤Ë°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1431 #else
1432                                         msg_format("%^s breathes nexus at %s.", m_name, t_name);
1433 #endif
1434
1435                                 }
1436                         }
1437                         else
1438                         {
1439                                 mon_fight = TRUE;
1440                         }
1441
1442                         sound(SOUND_BREATH);
1443                 }
1444
1445                 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
1446                 monst_breath_monst(m_idx, y, x, GF_NEXUS,
1447                                    dam,0, TRUE, MS_BR_NEXUS, learnable);
1448
1449                 break;
1450
1451         /* RF4_BR_TIME */
1452         case 96+21:
1453                 if (known)
1454                 {
1455                         if (see_either)
1456                         {
1457                                 disturb(1, 0);
1458
1459                                 if (blind)
1460                                 {
1461 #ifdef JP
1462                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1463 #else
1464                                         msg_format("%^s breathes.", m_name);
1465 #endif
1466
1467                                 }
1468                                 else
1469                                 {
1470 #ifdef JP
1471                                         msg_format("%^s¤¬%s¤Ë»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1472 #else
1473                                         msg_format("%^s breathes time at %s.", m_name, t_name);
1474 #endif
1475
1476                                 }
1477                         }
1478                         else
1479                         {
1480                                 mon_fight = TRUE;
1481                         }
1482
1483                         sound(SOUND_BREATH);
1484                 }
1485
1486                 dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
1487                 monst_breath_monst(m_idx, y, x, GF_TIME,
1488                                    dam,0, TRUE, MS_BR_TIME, learnable);
1489
1490                 break;
1491
1492         /* RF4_BR_INER */
1493         case 96+22:
1494                 if (known)
1495                 {
1496                         if (see_either)
1497                         {
1498                                 disturb(1, 0);
1499
1500                                 if (blind)
1501                                 {
1502 #ifdef JP
1503                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1504 #else
1505                                         msg_format("%^s breathes.", m_name);
1506 #endif
1507
1508                                 }
1509                                 else
1510                                 {
1511 #ifdef JP
1512                                         msg_format("%^s¤¬%s¤ËÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name, t_name);
1513 #else
1514                                         msg_format("%^s breathes inertia at %s.", m_name, t_name);
1515 #endif
1516
1517                                 }
1518                         }
1519                         else
1520                         {
1521                                 mon_fight = TRUE;
1522                         }
1523
1524                         sound(SOUND_BREATH);
1525                 }
1526
1527                 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
1528                 monst_breath_monst(m_idx, y, x, GF_INERTIA,
1529                                    dam,0, TRUE, MS_BR_INERTIA, learnable);
1530
1531                 break;
1532
1533         /* RF4_BR_GRAV */
1534         case 96+23:
1535                 if (known)
1536                 {
1537                         if (see_either)
1538                         {
1539                                 disturb(1, 0);
1540
1541                                 if (blind)
1542                                 {
1543 #ifdef JP
1544                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1545 #else
1546                                         msg_format("%^s breathes.", m_name);
1547 #endif
1548
1549                                 }
1550                                 else
1551                                 {
1552 #ifdef JP
1553                                         msg_format("%^s¤¬%s¤Ë½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name, t_name);
1554 #else
1555                                         msg_format("%^s breathes gravity at %s.", m_name, t_name);
1556 #endif
1557
1558                                 }
1559                         }
1560                         else
1561                         {
1562                                 mon_fight = TRUE;
1563                         }
1564
1565                         sound(SOUND_BREATH);
1566                 }
1567
1568                 dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
1569                 monst_breath_monst(m_idx, y, x, GF_GRAVITY,
1570                                    dam,0, TRUE, MS_BR_GRAVITY, learnable);
1571
1572                 break;
1573
1574         /* RF4_BR_SHAR */
1575         case 96+24:
1576                 if (known)
1577                 {
1578                         if (see_either)
1579                         {
1580                                 disturb(1, 0);
1581
1582                                 if (m_ptr->r_idx == MON_BOTEI)
1583 #ifdef JP
1584                                         msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
1585 #else
1586                                 msg_format("'Boty-Build cutter!!!'");
1587 #endif
1588                                 else if (blind)
1589                                 {
1590 #ifdef JP
1591                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1592 #else
1593                                         msg_format("%^s breathes.", m_name);
1594 #endif
1595
1596                                 }
1597                                 else
1598                                 {
1599 #ifdef JP
1600                                         msg_format("%^s¤¬%s¤ËÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name, t_name);
1601 #else
1602                                         msg_format("%^s breathes shards at %s.", m_name, t_name);
1603 #endif
1604
1605                                 }
1606                         }
1607                         else
1608                         {
1609                                 mon_fight = TRUE;
1610                         }
1611
1612                         sound(SOUND_BREATH);
1613                 }
1614
1615                 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
1616                 monst_breath_monst(m_idx, y, x, GF_SHARDS,
1617                                    dam,0, TRUE, MS_BR_SHARDS, learnable);
1618
1619                 break;
1620
1621         /* RF4_BR_PLAS */
1622         case 96+25:
1623                 if (known)
1624                 {
1625                         if (see_either)
1626                         {
1627                                 disturb(1, 0);
1628
1629                                 if (blind)
1630                                 {
1631 #ifdef JP
1632                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1633 #else
1634                                         msg_format("%^s breathes.", m_name);
1635 #endif
1636
1637                                 }
1638                                 else
1639                                 {
1640 #ifdef JP
1641                                         msg_format("%^s¤¬%s¤Ë¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1642 #else
1643                                         msg_format("%^s breathes plasma at %s.", m_name, t_name);
1644 #endif
1645
1646                                 }
1647                         }
1648                         else
1649                         {
1650                                 mon_fight = TRUE;
1651                         }
1652
1653                         sound(SOUND_BREATH);
1654                 }
1655
1656                 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
1657                 monst_breath_monst(m_idx, y, x, GF_PLASMA,
1658                                    dam,0, TRUE, MS_BR_PLASMA, learnable);
1659
1660                 break;
1661
1662         /* RF4_BR_WALL */
1663         case 96+26:
1664                 if (known)
1665                 {
1666                         if (see_either)
1667                         {
1668                                 disturb(1, 0);
1669
1670                                 if (blind)
1671                                 {
1672 #ifdef JP
1673                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1674 #else
1675                                         msg_format("%^s breathes.", m_name);
1676 #endif
1677
1678                                 }
1679                                 else
1680                                 {
1681 #ifdef JP
1682                                         msg_format("%^s¤¬%s¤Ë¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1683 #else
1684                                         msg_format("%^s breathes force at %s.", m_name, t_name);
1685 #endif
1686
1687                                 }
1688                         }
1689                         else
1690                         {
1691                                 mon_fight = TRUE;
1692                         }
1693
1694                         sound(SOUND_BREATH);
1695                 }
1696
1697                 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
1698                 monst_breath_monst(m_idx, y, x, GF_FORCE,
1699                                    dam,0, TRUE, MS_BR_FORCE, learnable);
1700                 break;
1701
1702         /* RF4_BR_MANA */
1703         case 96+27:
1704                 if (known)
1705                 {
1706                         if (see_either)
1707                         {
1708                                 disturb(1, 0);
1709
1710                                 if (blind)
1711                                 {
1712 #ifdef JP
1713                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1714 #else
1715                                         msg_format("%^s breathes.", m_name);
1716 #endif
1717
1718                                 }
1719                                 else
1720                                 {
1721 #ifdef JP
1722                                         msg_format("%^s¤¬%s¤ËËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name, t_name);
1723 #else
1724                                         msg_format("%^s breathes mana at %s.", m_name, t_name);
1725 #endif
1726
1727                                 }
1728                         }
1729                         else
1730                         {
1731                                 mon_fight = TRUE;
1732                         }
1733
1734                         sound(SOUND_BREATH);
1735                 }
1736
1737                 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
1738                 monst_breath_monst(m_idx, y, x, GF_MANA,
1739                                    dam,0, TRUE, MS_BR_MANA, learnable);
1740
1741                 break;
1742
1743         /* RF4_BA_NUKE */
1744         case 96+28:
1745                 if (known)
1746                 {
1747                         if (see_either)
1748                         {
1749                                 disturb(1, 0);
1750
1751                                 if (blind)
1752                                 {
1753 #ifdef JP
1754                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1755 #else
1756                                         msg_format("%^s mumbles.", m_name);
1757 #endif
1758
1759                                 }
1760                                 else
1761                                 {
1762 #ifdef JP
1763                                         msg_format("%^s¤¬%s¤ËÊü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name, t_name);
1764 #else
1765                                         msg_format("%^s casts a ball of radiation at %s.", m_name, t_name);
1766 #endif
1767
1768                                 }
1769                         }
1770                         else
1771                         {
1772                                 mon_fight = TRUE;
1773                         }
1774                 }
1775
1776                 dam = (rlev + damroll(10, 6));
1777                 monst_breath_monst(m_idx, y, x, GF_NUKE,
1778                                    dam, 2, FALSE, MS_BALL_NUKE, learnable);
1779
1780                 break;
1781
1782         /* RF4_BR_NUKE */
1783         case 96+29:
1784                 if (known)
1785                 {
1786                         if (see_either)
1787                         {
1788                                 disturb(1, 0);
1789
1790                                 if (blind)
1791                                 {
1792 #ifdef JP
1793                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1794 #else
1795                                         msg_format("%^s breathes.", m_name);
1796 #endif
1797
1798                                 }
1799                                 else
1800                                 {
1801 #ifdef JP
1802                                         msg_format("%^s¤¬%s¤ËÊü¼ÍÀ­ÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1803 #else
1804                                         msg_format("%^s breathes toxic waste at %s.", m_name, t_name);
1805 #endif
1806
1807                                 }
1808                         }
1809                         else
1810                         {
1811                                 mon_fight = TRUE;
1812                         }
1813
1814                         sound(SOUND_BREATH);
1815                 }
1816
1817                 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1818                 monst_breath_monst(m_idx, y, x, GF_NUKE,
1819                                    dam,0, TRUE, MS_BR_NUKE, learnable);
1820                 break;
1821
1822         /* RF4_BA_CHAO */
1823         case 96+30:
1824                 if (known)
1825                 {
1826                         if (see_either)
1827                         {
1828                                 disturb(1, 0);
1829
1830                                 if (blind)
1831                                 {
1832 #ifdef JP
1833                                         msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1834 #else
1835                                         msg_format("%^s mumbles frighteningly.", m_name);
1836 #endif
1837
1838                                 }
1839                                 else
1840                                 {
1841 #ifdef JP
1842                                         msg_format("%^s¤¬%s¤Ë½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name, t_name);
1843 #else
1844                                         msg_format("%^s invokes raw Logrus upon %s.", m_name, t_name);
1845 #endif
1846
1847                                 }
1848                         }
1849                         else
1850                         {
1851                                 mon_fight = TRUE;
1852                         }
1853                 }
1854
1855                 dam = (rlev * 2) + damroll(10, 10);
1856                 monst_breath_monst(m_idx, y, x, GF_CHAOS,
1857                                    dam, 4, FALSE, MS_BALL_CHAOS, learnable);
1858
1859                 break;
1860
1861         /* RF4_BR_DISI */
1862         case 96+31:
1863                 if (known)
1864                 {
1865                         if (see_either)
1866                         {
1867                                 disturb(1, 0);
1868
1869                                 if (blind)
1870                                 {
1871 #ifdef JP
1872                                         msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1873 #else
1874                                         msg_format("%^s breathes.", m_name);
1875 #endif
1876
1877                                 }
1878                                 else
1879                                 {
1880 #ifdef JP
1881                                         msg_format("%^s¤¬%s¤Ëʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name, t_name);
1882 #else
1883                                         msg_format("%^s breathes disintegration at %s.", m_name, t_name);
1884 #endif
1885
1886                                 }
1887                         }
1888                         else
1889                         {
1890                                 mon_fight = TRUE;
1891                         }
1892
1893                         sound(SOUND_BREATH);
1894                 }
1895
1896                 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
1897                 monst_breath_monst(m_idx, y, x, GF_DISINTEGRATE,
1898                                    dam,0, TRUE, MS_BR_DISI, learnable);
1899                 break;
1900
1901         /* RF5_BA_ACID */
1902         case 128+0:
1903                 if (known)
1904                 {
1905                         if (see_either)
1906                         {
1907                                 disturb(1, 0);
1908
1909                                 if (blind)
1910                                 {
1911 #ifdef JP
1912                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1913 #else
1914                                         msg_format("%^s mumbles.", m_name);
1915 #endif
1916
1917                                 }
1918                                 else
1919                                 {
1920 #ifdef JP
1921                                         msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
1922 #else
1923                                         msg_format("%^s casts an acid ball at %s.", m_name, t_name);
1924 #endif
1925
1926                                 }
1927                         }
1928                         else
1929                         {
1930                                 mon_fight = TRUE;
1931                         }
1932                 }
1933
1934                 dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1935                 monst_breath_monst(m_idx, y, x, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
1936
1937                 break;
1938
1939         /* RF5_BA_ELEC */
1940         case 128+1:
1941                 if (known)
1942                 {
1943                         if (see_either)
1944                         {
1945                                 disturb(1, 0);
1946
1947                                 if (blind)
1948                                 {
1949 #ifdef JP
1950                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1951 #else
1952                                         msg_format("%^s mumbles.", m_name);
1953 #endif
1954
1955                                 }
1956                                 else
1957                                 {
1958 #ifdef JP
1959                                         msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
1960 #else
1961                                         msg_format("%^s casts a lightning ball at %s.", m_name, t_name);
1962 #endif
1963
1964                                 }
1965                         }
1966                         else
1967                         {
1968                                 mon_fight = TRUE;
1969                         }
1970                 }
1971
1972                 dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1973                 monst_breath_monst(m_idx, y, x, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
1974
1975                 break;
1976
1977         /* RF5_BA_FIRE */
1978         case 128+2:
1979                 if (known)
1980                 {
1981                         if (see_either)
1982                         {
1983                                 disturb(1, 0);
1984
1985                                 if (m_ptr->r_idx == MON_ROLENTO)
1986                                 {
1987 #ifdef JP
1988                                         if (blind)
1989                                                 msg_format("%^s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
1990                                         else
1991                                                 msg_format("%^s¤¬%^s¤Ë¸þ¤«¤Ã¤Æ¼êÜØÃƤòÅꤲ¤¿¡£", m_name, t_name);
1992 #else
1993                                         if (blind)
1994                                                 msg_format("%^s throws something.", m_name);
1995                                         else
1996                                                 msg_format("%^s throws a hand grenade.", m_name);
1997 #endif
1998                                 }
1999                                 else
2000                                 {
2001                                         if (blind)
2002                                         {
2003 #ifdef JP
2004                                                 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2005 #else
2006                                                 msg_format("%^s mumbles.", m_name);
2007 #endif
2008
2009                                         }
2010                                         else
2011                                         {
2012 #ifdef JP
2013                                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2014 #else
2015                                                 msg_format("%^s casts a fire ball at %s.", m_name, t_name);
2016 #endif
2017
2018                                         }
2019                                 }
2020                         }
2021                         else
2022                         {
2023                                 mon_fight = TRUE;
2024                         }
2025                 }
2026
2027                 dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2028                 monst_breath_monst(m_idx, y, x, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2029
2030                 break;
2031
2032         /* RF5_BA_COLD */
2033         case 128+3:
2034                 if (known)
2035                 {
2036                         if (see_either)
2037                         {
2038                                 disturb(1, 0);
2039
2040                                 if (blind)
2041                                 {
2042 #ifdef JP
2043                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2044 #else
2045                                         msg_format("%^s mumbles.", m_name);
2046 #endif
2047
2048                                 }
2049                                 else
2050                                 {
2051 #ifdef JP
2052                                         msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2053 #else
2054                                         msg_format("%^s casts a frost ball at %s.", m_name, t_name);
2055 #endif
2056
2057                                 }
2058                         }
2059                         else
2060                         {
2061                                 mon_fight = TRUE;
2062                         }
2063                 }
2064
2065                 dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2066                 monst_breath_monst(m_idx, y, x, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2067
2068                 break;
2069
2070         /* RF5_BA_POIS */
2071         case 128+4:
2072                 if (known)
2073                 {
2074                         if (see_either)
2075                         {
2076                                 disturb(1, 0);
2077
2078                                 if (blind)
2079                                 {
2080 #ifdef JP
2081                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2082 #else
2083                                         msg_format("%^s mumbles.", m_name);
2084 #endif
2085
2086                                 }
2087                                 else
2088                                 {
2089 #ifdef JP
2090                                         msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2091 #else
2092                                         msg_format("%^s casts a stinking cloud at %s.", m_name, t_name);
2093 #endif
2094
2095                                 }
2096                         }
2097                         else
2098                         {
2099                                 mon_fight = TRUE;
2100                         }
2101                 }
2102
2103                 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2104                 monst_breath_monst(m_idx, y, x, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2105
2106                 break;
2107
2108         /* RF5_BA_NETH */
2109         case 128+5:
2110                 if (known)
2111                 {
2112                         if (see_either)
2113                         {
2114                                 disturb(1, 0);
2115
2116                                 if (blind)
2117                                 {
2118 #ifdef JP
2119                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2120 #else
2121                                         msg_format("%^s mumbles.", m_name);
2122 #endif
2123
2124                                 }
2125                                 else
2126                                 {
2127 #ifdef JP
2128                                         msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2129 #else
2130                                         msg_format("%^s casts a nether ball at %s.", m_name, t_name);
2131 #endif
2132
2133                                 }
2134                         }
2135                         else
2136                         {
2137                                 mon_fight = TRUE;
2138                         }
2139                 }
2140
2141                 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2142                 monst_breath_monst(m_idx, y, x, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2143
2144                 break;
2145
2146         /* RF5_BA_WATE */
2147         case 128+6:
2148                 if (known)
2149                 {
2150                         if (see_either)
2151                         {
2152                                 disturb(1, 0);
2153
2154                                 if (blind)
2155                                 {
2156 #ifdef JP
2157                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2158 #else
2159                                         msg_format("%^s mumbles.", m_name);
2160 #endif
2161
2162                                 }
2163                                 else
2164                                 {
2165 #ifdef JP
2166                                         msg_format("%^s¤¬%s¤ËÂФ·¤Æή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name, t_name);
2167 #else
2168                                         msg_format("%^s gestures fluidly at %s.", m_name, t_name);
2169 #endif
2170
2171 #ifdef JP
2172                                         msg_format("%^s¤Ï±²´¬¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£", t_name);
2173 #else
2174                                         msg_format("%^s is engulfed in a whirlpool.", t_name);
2175 #endif
2176
2177                                 }
2178                         }
2179                         else
2180                         {
2181                                 mon_fight = TRUE;
2182                         }
2183                 }
2184
2185                 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
2186                 monst_breath_monst(m_idx, y, x, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2187
2188                 break;
2189
2190         /* RF5_BA_MANA */
2191         case 128+7:
2192                 if (known)
2193                 {
2194                         if (see_either)
2195                         {
2196                                 disturb(1, 0);
2197
2198                                 if (blind)
2199                                 {
2200 #ifdef JP
2201                                         msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2202 #else
2203                                         msg_format("%^s mumbles powerfully.", m_name);
2204 #endif
2205
2206                                 }
2207                                 else
2208                                 {
2209 #ifdef JP
2210                                         msg_format("%^s¤¬%s¤ËÂФ·¤ÆËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name, t_name);
2211 #else
2212                                         msg_format("%^s invokes a mana storm upon %s.", m_name, t_name);
2213 #endif
2214
2215                                 }
2216                         }
2217                         else
2218                         {
2219                                 mon_fight = TRUE;
2220                         }
2221                 }
2222
2223                 dam = (rlev * 4) + 50 + damroll(10, 10);
2224                 monst_breath_monst(m_idx, y, x, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2225
2226                 break;
2227
2228         /* RF5_BA_DARK */
2229         case 128+8:
2230                 if (known)
2231                 {
2232                         if (see_either)
2233                         {
2234                                 disturb(1, 0);
2235
2236                                 if (blind)
2237                                 {
2238 #ifdef JP
2239                                         msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2240 #else
2241                                         msg_format("%^s mumbles powerfully.", m_name);
2242 #endif
2243
2244                                 }
2245                                 else
2246                                 {
2247 #ifdef JP
2248                                         msg_format("%^s¤¬%s¤ËÂФ·¤Æ°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name, t_name);
2249 #else
2250                                         msg_format("%^s invokes a darkness storm upon %s.", m_name, t_name);
2251 #endif
2252
2253                                 }
2254                         }
2255                         else
2256                         {
2257                                 mon_fight = TRUE;
2258                         }
2259                 }
2260
2261                 dam = (rlev * 4) + 50 + damroll(10, 10);
2262                 monst_breath_monst(m_idx, y, x, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2263
2264                 break;
2265
2266         /* RF5_DRAIN_MANA */
2267         case 128+9:
2268                 if (see_m)
2269                 {
2270                         /* Basic message */
2271 #ifdef JP
2272                         msg_format("%^s¤ÏÀº¿À¥¨¥Í¥ë¥®¡¼¤ò%s¤«¤éµÛ¤¤¤È¤Ã¤¿¡£", m_name, t_name);
2273 #else
2274                         msg_format("%^s draws psychic energy from %s.", m_name, t_name);
2275 #endif
2276
2277                 }
2278
2279                 dam = ((randint1(rlev) / 2) + 1);
2280                 monst_breath_monst(m_idx, y, x, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, learnable);
2281
2282                 break;
2283
2284         /* RF5_MIND_BLAST */
2285         case 128+10:
2286                 if (see_m)
2287                 {
2288 #ifdef JP
2289                         msg_format("%^s¤Ï%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name, t_name);
2290 #else
2291                         msg_format("%^s gazes intently at %s.", m_name, t_name);
2292 #endif
2293
2294                 }
2295
2296                 dam = damroll(7, 7);
2297                 monst_breath_monst(m_idx, y, x, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, learnable);
2298
2299                 break;
2300
2301         /* RF5_BRAIN_SMASH */
2302         case 128+11:
2303                 if (see_m)
2304                 {
2305 #ifdef JP
2306                         msg_format("%^s¤Ï%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name, t_name);
2307 #else
2308                         msg_format("%^s gazes intently at %s.", m_name, t_name);
2309 #endif
2310
2311                 }
2312
2313                 dam = damroll(12, 12);
2314                 monst_breath_monst(m_idx, y, x, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, learnable);
2315
2316                 break;
2317
2318         /* RF5_CAUSE_1 */
2319         case 128+12:
2320                 if (known)
2321                 {
2322                         if (see_m)
2323                         {
2324 #ifdef JP
2325                                 msg_format("%^s¤Ï%s¤ò»Ø¤µ¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name, t_name);
2326 #else
2327                                 msg_format("%^s points at %s and curses.", m_name, t_name);
2328 #endif
2329
2330                         }
2331                         else
2332                         {
2333                                 mon_fight = TRUE;
2334                         }
2335                 }
2336
2337                 dam = damroll(3, 8);
2338                 monst_breath_monst(m_idx, y, x, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, learnable);
2339
2340                 break;
2341
2342         /* RF5_CAUSE_2 */
2343         case 128+13:
2344                 if (known)
2345                 {
2346                         if (see_m)
2347                         {
2348 #ifdef JP
2349                                 msg_format("%^s¤Ï%s¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name, t_name);
2350 #else
2351                                 msg_format("%^s points at %s and curses horribly.", m_name, t_name);
2352 #endif
2353
2354                         }
2355                         else
2356                         {
2357                                 mon_fight = TRUE;
2358                         }
2359                 }
2360
2361                 dam = damroll(8, 8);
2362                 monst_breath_monst(m_idx, y, x, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, learnable);
2363
2364                 break;
2365
2366         /* RF5_CAUSE_3 */
2367         case 128+14:
2368                 if (known)
2369                 {
2370                         if (see_m)
2371                         {
2372 #ifdef JP
2373                                 msg_format("%^s¤Ï%s¤ò»Ø¤µ¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name, t_name);
2374 #else
2375                                 msg_format("%^s points at %s, incanting terribly!", m_name, t_name);
2376 #endif
2377
2378                         }
2379                         else
2380                         {
2381                                 mon_fight = TRUE;
2382                         }
2383                 }
2384
2385                 dam = damroll(10, 15);
2386                 monst_breath_monst(m_idx, y, x, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, learnable);
2387
2388                 break;
2389
2390         /* RF5_CAUSE_4 */
2391         case 128+15:
2392                 if (known)
2393                 {
2394                         if (see_m)
2395                         {
2396 #ifdef JP
2397                                 msg_format("%^s¤¬%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name, t_name);
2398 #else
2399                                 msg_format("%^s points at %s, screaming the word, 'DIE!'", m_name, t_name);
2400 #endif
2401
2402                         }
2403                         else
2404                         {
2405                                 mon_fight = TRUE;
2406                         }
2407                 }
2408
2409                 dam = damroll(15, 15);
2410                 monst_breath_monst(m_idx, y, x, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, learnable);
2411
2412                 break;
2413
2414         /* RF5_BO_ACID */
2415         case 128+16:
2416                 if (known)
2417                 {
2418                         if (see_either)
2419                         {
2420 #ifdef JP
2421                                 msg_format("%s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2422 #else
2423                                 msg_format("%^s casts an acid bolt at %s.", m_name, t_name);
2424 #endif
2425
2426                         }
2427                         else
2428                         {
2429                                 mon_fight = TRUE;
2430                         }
2431                 }
2432
2433                 dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2434                 monst_bolt_monst(m_idx, y, x, GF_ACID,
2435                                  dam, MS_BOLT_ACID, learnable);
2436
2437                 break;
2438
2439         /* RF5_BO_ELEC */
2440         case 128+17:
2441                 if (known)
2442                 {
2443                         if (see_either)
2444                         {
2445 #ifdef JP
2446                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2447 #else
2448                                 msg_format("%^s casts a lightning bolt at %s.", m_name, t_name);
2449 #endif
2450
2451                         }
2452                         else
2453                         {
2454                                 mon_fight = TRUE;
2455                         }
2456                 }
2457
2458                 dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2459                 monst_bolt_monst(m_idx, y, x, GF_ELEC,
2460                                  dam, MS_BOLT_ELEC, learnable);
2461
2462                 break;
2463
2464         /* RF5_BO_FIRE */
2465         case 128+18:
2466                 if (known)
2467                 {
2468                         if (see_either)
2469                         {
2470 #ifdef JP
2471                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2472 #else
2473                                 msg_format("%^s casts a fire bolt at %s.", m_name, t_name);
2474 #endif
2475
2476                         }
2477                         else
2478                         {
2479                                 mon_fight = TRUE;
2480                         }
2481                 }
2482
2483                 dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2484                 monst_bolt_monst(m_idx, y, x, GF_FIRE,
2485                                  dam, MS_BOLT_FIRE, learnable);
2486
2487                 break;
2488
2489         /* RF5_BO_COLD */
2490         case 128+19:
2491                 if (known)
2492                 {
2493                         if (see_either)
2494                         {
2495 #ifdef JP
2496                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2497 #else
2498                                 msg_format("%^s casts a frost bolt at %s.", m_name, t_name);
2499 #endif
2500
2501                         }
2502                         else
2503                         {
2504                                 mon_fight = TRUE;
2505                         }
2506                 }
2507
2508                 dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2509                 monst_bolt_monst(m_idx, y, x, GF_COLD,
2510                                  dam, MS_BOLT_COLD, learnable);
2511
2512                 break;
2513
2514         /* RF5_BA_LITE */
2515         case 128+20:
2516                 if (known)
2517                 {
2518                         if (see_either)
2519                         {
2520                                 disturb(1, 0);
2521
2522                                 if (blind)
2523                                 {
2524 #ifdef JP
2525                                         msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2526 #else
2527                                         msg_format("%^s mumbles powerfully.", m_name);
2528 #endif
2529
2530                                 }
2531                                 else
2532                                 {
2533 #ifdef JP
2534                                         msg_format("%^s¤¬%s¤ËÂФ·¤Æ¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name, t_name);
2535 #else
2536                                         msg_format("%^s invokes a starburst upon %s.", m_name, t_name);
2537 #endif
2538
2539                                 }
2540                         }
2541                         else
2542                         {
2543                                 mon_fight = TRUE;
2544                         }
2545                 }
2546
2547                 dam = (rlev * 4) + 50 + damroll(10, 10);
2548                 monst_breath_monst(m_idx, y, x, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2549
2550                 break;
2551
2552         /* RF5_BO_NETH */
2553         case 128+21:
2554                 if (known)
2555                 {
2556                         if (see_either)
2557                         {
2558 #ifdef JP
2559                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2560 #else
2561                                 msg_format("%^s casts a nether bolt at %s.", m_name, t_name);
2562 #endif
2563
2564                         }
2565                         else
2566                         {
2567                                 mon_fight = TRUE;
2568                         }
2569                 }
2570
2571                 dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
2572                 monst_bolt_monst(m_idx, y, x, GF_NETHER,
2573                                  dam, MS_BOLT_NETHER, learnable);
2574
2575                 break;
2576
2577         /* RF5_BO_WATE */
2578         case 128+22:
2579                 if (known)
2580                 {
2581                         if (see_either)
2582                         {
2583 #ifdef JP
2584                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2585 #else
2586                                 msg_format("%^s casts a water bolt at %s.", m_name, t_name);
2587 #endif
2588
2589                         }
2590                         else
2591                         {
2592                                 mon_fight = TRUE;
2593                         }
2594                 }
2595
2596                 dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2597                 monst_bolt_monst(m_idx, y, x, GF_WATER,
2598                                  dam, MS_BOLT_WATER, learnable);
2599
2600                 break;
2601
2602         /* RF5_BO_MANA */
2603         case 128+23:
2604                 if (known)
2605                 {
2606                         if (see_either)
2607                         {
2608 #ifdef JP
2609                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2610 #else
2611                                 msg_format("%^s casts a mana bolt at %s.", m_name, t_name);
2612 #endif
2613
2614                         }
2615                         else
2616                         {
2617                                 mon_fight = TRUE;
2618                         }
2619                 }
2620
2621                 dam = randint1(rlev * 7 / 2) + 50;
2622                 monst_bolt_monst(m_idx, y, x, GF_MANA,
2623                                  dam, MS_BOLT_MANA, learnable);
2624
2625                 break;
2626
2627         /* RF5_BO_PLAS */
2628         case 128+24:
2629                 if (known)
2630                 {
2631                         if (see_either)
2632                         {
2633 #ifdef JP
2634                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2635 #else
2636                                 msg_format("%^s casts a plasma bolt at %s.", m_name, t_name);
2637 #endif
2638
2639                         }
2640                         else
2641                         {
2642                                 mon_fight = TRUE;
2643                         }
2644                 }
2645
2646                 dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2647                 monst_bolt_monst(m_idx, y, x, GF_PLASMA,
2648                                  dam, MS_BOLT_PLASMA, learnable);
2649
2650                 break;
2651
2652         /* RF5_BO_ICEE */
2653         case 128+25:
2654                 if (known)
2655                 {
2656                         if (see_either)
2657                         {
2658 #ifdef JP
2659                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2660 #else
2661                                 msg_format("%^s casts an ice bolt at %s.", m_name, t_name);
2662 #endif
2663
2664                         }
2665                         else
2666                         {
2667                                 mon_fight = TRUE;
2668                         }
2669                 }
2670
2671                 dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2672                 monst_bolt_monst(m_idx, y, x, GF_ICE,
2673                                  dam, MS_BOLT_ICE, learnable);
2674
2675                 break;
2676
2677         /* RF5_MISSILE */
2678         case 128+26:
2679                 if (known)
2680                 {
2681                         if (see_either)
2682                         {
2683 #ifdef JP
2684                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name, t_name);
2685 #else
2686                                 msg_format("%^s casts a magic missile at %s.", m_name, t_name);
2687 #endif
2688
2689                         }
2690                         else
2691                         {
2692                                 mon_fight = TRUE;
2693                         }
2694                 }
2695
2696                 dam = damroll(2, 6) + (rlev / 3);
2697                 monst_bolt_monst(m_idx, y, x, GF_MISSILE,
2698                                  dam, MS_MAGIC_MISSILE, learnable);
2699
2700                 break;
2701
2702         /* RF5_SCARE */
2703         case 128+27:
2704                 if (known)
2705                 {
2706                         if (see_either)
2707                         {
2708 #ifdef JP
2709                                 msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name, t_name);
2710 #else
2711                                 msg_format("%^s casts a fearful illusion in front of %s.", m_name, t_name);
2712 #endif
2713
2714                         }
2715                         else
2716                         {
2717                                 mon_fight = TRUE;
2718                         }
2719                 }
2720
2721                 if (tr_ptr->flags3 & RF3_NO_FEAR)
2722                 {
2723 #ifdef JP
2724                         if (see_t) msg_format("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£", t_name);
2725 #else
2726                         if (see_t) msg_format("%^s refuses to be frightened.", t_name);
2727 #endif
2728
2729                 }
2730                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
2731                 {
2732 #ifdef JP
2733                         if (see_t) msg_format("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£", t_name);
2734 #else
2735                         if (see_t) msg_format("%^s refuses to be frightened.", t_name);
2736 #endif
2737
2738                 }
2739                 else
2740                 {
2741                         if (set_monster_monfear(t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4)) fear = TRUE;
2742                 }
2743
2744                 wake_up = TRUE;
2745
2746                 break;
2747
2748         /* RF5_BLIND */
2749         case 128+28:
2750                 if (known)
2751                 {
2752                         if (see_either)
2753                         {
2754 #ifdef JP
2755                                 msg_format("%s¤Ï¼öʸ¤ò¾§¤¨¤Æ%s¤ÎÌܤò¾Æ¤­ÉÕ¤«¤»¤¿¡£", m_name, t_name);
2756 #else
2757                                 msg_format("%^s casts a spell, burning %s%s eyes.", m_name, t_name,
2758                                            (streq(t_name, "it") ? "s" : "'s"));
2759 #endif
2760
2761                         }
2762                         else
2763                         {
2764                                 mon_fight = TRUE;
2765                         }
2766                 }
2767
2768                 /* Simulate blindness with confusion */
2769                 if (tr_ptr->flags3 & RF3_NO_CONF)
2770                 {
2771 #ifdef JP
2772                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2773 #else
2774                         if (see_t) msg_format("%^s is unaffected.", t_name);
2775 #endif
2776
2777                 }
2778                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
2779                 {
2780 #ifdef JP
2781                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2782 #else
2783                         if (see_t) msg_format("%^s is unaffected.", t_name);
2784 #endif
2785
2786                 }
2787                 else
2788                 {
2789 #ifdef JP
2790                         if (see_t) msg_format("%^s¤ÏÌܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤¿¡ª ", t_name);
2791 #else
2792                         if (see_t) msg_format("%^s is blinded!", t_name);
2793 #endif
2794
2795                         (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
2796                 }
2797
2798                 wake_up = TRUE;
2799
2800                 break;
2801
2802         /* RF5_CONF */
2803         case 128+29:
2804                 if (known)
2805                 {
2806                         if (see_either)
2807                         {
2808 #ifdef JP
2809                                 msg_format("%^s¤¬%s¤ÎÁ°¤Ë¸¸ÏÇŪ¤Ê¸¸¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£", m_name, t_name);
2810 #else
2811                                 msg_format("%^s casts a mesmerizing illusion in front of %s.", m_name, t_name);
2812 #endif
2813
2814                         }
2815                         else
2816                         {
2817                                 mon_fight = TRUE;
2818                         }
2819                 }
2820
2821                 if (tr_ptr->flags3 & RF3_NO_CONF)
2822                 {
2823 #ifdef JP
2824                         if (see_t) msg_format("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£", t_name);
2825 #else
2826                         if (see_t) msg_format("%^s disbelieves the feeble spell.", t_name);
2827 #endif
2828
2829                 }
2830                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
2831                 {
2832 #ifdef JP
2833                         if (see_t) msg_format("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£", t_name);
2834 #else
2835                         if (see_t) msg_format("%^s disbelieves the feeble spell.", t_name);
2836 #endif
2837
2838                 }
2839                 else
2840                 {
2841 #ifdef JP
2842                         if (see_t) msg_format("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£", t_name);
2843 #else
2844                         if (see_t) msg_format("%^s seems confused.", t_name);
2845 #endif
2846
2847                         (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
2848                 }
2849
2850                 wake_up = TRUE;
2851
2852                 break;
2853
2854         /* RF5_SLOW */
2855         case 128+30:
2856                 if (known)
2857                 {
2858                         if (see_either)
2859                         {
2860 #ifdef JP
2861                                 msg_format("%s¤¬%s¤Î¶ÚÆù¤«¤éÎϤòµÛ¤¤¤È¤Ã¤¿¡£", m_name, t_name);
2862 #else
2863                                 msg_format("%^s drains power from %s%s muscles.", m_name, t_name,
2864                                            (streq(t_name, "it") ? "s" : "'s"));
2865 #endif
2866
2867                         }
2868                         else
2869                         {
2870                                 mon_fight = TRUE;
2871                         }
2872                 }
2873
2874                 if (tr_ptr->flags1 & RF1_UNIQUE)
2875                 {
2876 #ifdef JP
2877                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2878 #else
2879                         if (see_t) msg_format("%^s is unaffected.", t_name);
2880 #endif
2881
2882                 }
2883                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
2884                 {
2885 #ifdef JP
2886                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2887 #else
2888                         if (see_t) msg_format("%^s is unaffected.", t_name);
2889 #endif
2890
2891                 }
2892                 else
2893                 {
2894                         if (set_monster_slow(t_idx, MON_SLOW(t_ptr) + 50))
2895                         {
2896 #ifdef JP
2897                                 if (see_t) msg_format("%s¤ÎÆ°¤­¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£", t_name);
2898 #else
2899                                 if (see_t) msg_format("%^s starts moving slower.", t_name);
2900 #endif
2901                         }
2902                 }
2903
2904                 wake_up = TRUE;
2905
2906                 break;
2907
2908         /* RF5_HOLD */
2909         case 128+31:
2910                 if (known)
2911                 {
2912                         if (see_either)
2913                         {
2914 #ifdef JP
2915                                 msg_format("%^s¤Ï%s¤ò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡£", m_name, t_name);
2916 #else
2917                                 msg_format("%^s stares intently at %s.", m_name, t_name);
2918 #endif
2919
2920                         }
2921                         else
2922                         {
2923                                 mon_fight = TRUE;
2924                         }
2925                 }
2926
2927                 if ((tr_ptr->flags1 & RF1_UNIQUE) ||
2928                     (tr_ptr->flags3 & RF3_NO_STUN))
2929                 {
2930 #ifdef JP
2931                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2932 #else
2933                         if (see_t) msg_format("%^s is unaffected.", t_name);
2934 #endif
2935
2936                 }
2937                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
2938                 {
2939 #ifdef JP
2940                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
2941 #else
2942                         if (see_t) msg_format("%^s is unaffected.", t_name);
2943 #endif
2944
2945                 }
2946                 else
2947                 {
2948 #ifdef JP
2949                         if (see_t) msg_format("%^s¤ÏËãá㤷¤¿¡ª", t_name);
2950 #else
2951                         if (see_t) msg_format("%^s is paralyzed!", t_name);
2952 #endif
2953
2954                         (void)set_monster_stunned(t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
2955                 }
2956
2957                 wake_up = TRUE;
2958
2959                 break;
2960
2961
2962         /* RF6_HASTE */
2963         case 160+0:
2964                 if (known)
2965                 {
2966                         if (see_m)
2967                         {
2968 #ifdef JP
2969                                 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name);
2970 #else
2971                                 msg_format("%^s concentrates on %s body.", m_name, m_poss);
2972 #endif
2973
2974                         }
2975                         else
2976                         {
2977                                 mon_fight = TRUE;
2978                         }
2979                 }
2980
2981                 /* Allow quick speed increases to base+10 */
2982                 if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
2983                 {
2984 #ifdef JP
2985                         if (see_m) msg_format("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
2986 #else
2987                         if (see_m) msg_format("%^s starts moving faster.", m_name);
2988 #endif
2989                 }
2990                 break;
2991
2992         /* RF6_HAND_DOOM */
2993         case 160+1:
2994                 if (known)
2995                 {
2996                         if (see_m)
2997                         {
2998 #ifdef JP
2999                                 msg_format("%^s¤¬%s¤Ë<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", m_name, t_name);
3000 #else
3001                                 msg_format("%^s invokes the Hand of Doom upon %s!", m_name, t_name);
3002 #endif
3003
3004                         }
3005                         else
3006                         {
3007                                 mon_fight = TRUE;
3008                         }
3009                 }
3010
3011                 dam = 20; /* Dummy power */
3012                 monst_breath_monst(m_idx, y, x, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, learnable);
3013
3014                 break;
3015
3016         /* RF6_HEAL */
3017         case 160+2:
3018                 if (known)
3019                 {
3020                         if (see_m)
3021                         {
3022 #ifdef JP
3023                                 msg_format("%^s¤Ï¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£", m_name);
3024 #else
3025                                 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3026 #endif
3027
3028                         }
3029                         else
3030                         {
3031                                 mon_fight = TRUE;
3032                         }
3033                 }
3034
3035                 /* Heal some */
3036                 m_ptr->hp += (rlev * 6);
3037
3038                 /* Fully healed */
3039                 if (m_ptr->hp >= m_ptr->maxhp)
3040                 {
3041                         /* Fully healed */
3042                         m_ptr->hp = m_ptr->maxhp;
3043
3044                         if (known)
3045                         {
3046                                 if (see_m)
3047                                 {
3048 #ifdef JP
3049                                         msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3050 #else
3051                                         msg_format("%^s looks completely healed!", m_name);
3052 #endif
3053
3054                                 }
3055                                 else
3056                                 {
3057                                         mon_fight = TRUE;
3058                                 }
3059                         }
3060                 }
3061
3062                 /* Partially healed */
3063                 else if (known)
3064                 {
3065                         if (see_m)
3066                         {
3067 #ifdef JP
3068                                 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3069 #else
3070                                 msg_format("%^s looks healthier.", m_name);
3071 #endif
3072                         }
3073                         else
3074                         {
3075                                 mon_fight = TRUE;
3076                         }
3077                 }
3078
3079                 /* Redraw (later) if needed */
3080                 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3081                 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3082
3083                 /* Cancel fear */
3084                 if (MON_MONFEAR(m_ptr))
3085                 {
3086                         /* Cancel fear */
3087                         (void)set_monster_monfear(m_idx, 0);
3088
3089                         /* Message */
3090 #ifdef JP
3091                         if (see_m) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3092 #else
3093                         if (see_m) msg_format("%^s recovers %s courage.", m_name, m_poss);
3094 #endif
3095                 }
3096
3097                 break;
3098
3099         /* RF6_INVULNER */
3100         case 160+3:
3101                 if (known)
3102                 {
3103                         if (see_m)
3104                         {
3105                                 disturb(1, 0);
3106 #ifdef JP
3107                                 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3108 #else
3109                                 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3110 #endif
3111                         }
3112                         else
3113                         {
3114                                 mon_fight = TRUE;
3115                         }
3116                 }
3117
3118                 if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
3119                 break;
3120
3121         /* RF6_BLINK */
3122         case 160+4:
3123                 if (teleport_barrier(m_idx))
3124                 {
3125                         if (see_m)
3126                         {
3127 #ifdef JP
3128                                 msg_format("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", m_name);
3129 #else
3130                                 msg_format("Magic barrier obstructs teleporting of %^s.", m_name);
3131 #endif
3132                         }
3133                 }
3134                 else
3135                 {
3136                         if (see_m)
3137                         {
3138 #ifdef JP
3139                                 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3140 #else
3141                                 msg_format("%^s blinks away.", m_name);
3142 #endif
3143                         }
3144                         teleport_away(m_idx, 10, 0L);
3145                 }
3146                 break;
3147
3148         /* RF6_TPORT */
3149         case 160+5:
3150                 if (teleport_barrier(m_idx))
3151                 {
3152                         if (see_m)
3153                         {
3154 #ifdef JP
3155                                 msg_format("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", m_name);
3156 #else
3157                                 msg_format("Magic barrier obstructs teleporting of %^s.", m_name);
3158 #endif
3159                         }
3160                 }
3161                 else
3162                 {
3163                         if (see_m)
3164                         {
3165 #ifdef JP
3166                                 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3167 #else
3168                                 msg_format("%^s teleports away.", m_name);
3169 #endif
3170                         }
3171                         teleport_away_followable(m_idx);
3172                 }
3173                 break;
3174
3175         /* RF6_WORLD */
3176         case 160+6:
3177 #if 0
3178                 int who = 0;
3179                 if(m_ptr->r_idx = MON_DIO) who == 1;
3180                 else if(m_ptr->r_idx = MON_WONG) who == 3;
3181                 dam = who;
3182                 if(!process_the_world(randint1(2)+2, who, player_has_los_bold(m_ptr->fy, m_ptr->fx))) return (FALSE);
3183 #endif
3184                 return FALSE;
3185
3186         /* RF6_SPECIAL */
3187         case 160+7:
3188                 switch (m_ptr->r_idx)
3189                 {
3190                 case MON_OHMU:
3191                         /* Moved to process_monster(), like multiplication */
3192                         return FALSE;
3193
3194                 case MON_ROLENTO:
3195                         if (known)
3196                         {
3197                                 if (see_either)
3198                                 {
3199                                         disturb(1, 0);
3200
3201 #ifdef JP
3202                                         msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3203 #else
3204                                         msg_format("%^s throws some hand grenades.", m_name);
3205 #endif
3206                                 }
3207                                 else
3208                                 {
3209                                         mon_fight = TRUE;
3210                                 }
3211                         }
3212
3213                         {
3214                                 int num = 1 + randint1(3);
3215                                 for (k = 0; k < num; k++)
3216                                 {
3217                                         count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, 0);
3218                                 }
3219                         }
3220
3221                         if (known && !see_t && count)
3222                         {
3223                                 mon_fight = TRUE;
3224                         }
3225                         break;
3226
3227                 default:
3228                         if (r_ptr->d_char == 'B')
3229                         {
3230                                 if (one_in_(3))
3231                                 {
3232                                         if (see_m)
3233                                         {
3234 #ifdef JP
3235                                                 msg_format("%^s¤ÏÆÍÁ³µÞ¾å¾º¤·¤Æ»ë³¦¤«¤é¾Ã¤¨¤¿!", m_name);
3236 #else
3237                                                 msg_format("%^s suddenly go out of your sight!", m_name);
3238 #endif
3239                                         }
3240                                         teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
3241                                         p_ptr->update |= (PU_MONSTERS);
3242                                 }
3243                                 else
3244                                 {
3245                                         if (known)
3246                                         {
3247                                                 if (see_either)
3248                                                 {
3249 #ifdef JP
3250                                                         msg_format("%^s¤¬%s¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", m_name, t_name);
3251 #else
3252                                                         msg_format("%^s holds %s, and drops from the sky.", m_name, t_name);
3253 #endif
3254
3255                                                 }
3256                                                 else
3257                                                 {
3258                                                         mon_fight = TRUE;
3259                                                 }
3260                                         }
3261
3262                                         dam = damroll(4, 8);
3263
3264                                         if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
3265                                         else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
3266
3267                                         sound(SOUND_FALL);
3268
3269                                         if (tr_ptr->flags7 & RF7_CAN_FLY)
3270                                         {
3271 #ifdef JP
3272                                                 if (see_t) msg_format("%^s¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", t_name);
3273 #else
3274                                                 if (see_t) msg_format("%^s floats gently down to the ground.", t_name);
3275 #endif
3276                                         }
3277                                         else
3278                                         {
3279 #ifdef JP
3280                                                 if (see_t) msg_format("%^s¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", t_name);
3281 #else
3282                                                 if (see_t) msg_format("%^s crashed into the ground.", t_name);
3283 #endif
3284                                                 dam += damroll(6, 8);
3285                                         }
3286
3287                                         if (p_ptr->riding == t_idx)
3288                                         {
3289                                                 int get_damage = 0;
3290
3291                                                 /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
3292                                                    -- henkma
3293                                                  */
3294                                                 get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
3295                                                 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
3296                                                 {
3297 #ifdef JP
3298                                                         msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
3299 #else
3300                                                         char m_name_self[80];
3301
3302                                                         /* hisself */
3303                                                         monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3304
3305                                                         msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3306 #endif
3307                                                         project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3308                                                         set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3309                                                 }
3310                                         }
3311
3312                                         mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
3313                                 }
3314                                 break;
3315                         }
3316
3317                         /* Something is wrong */
3318                         else return FALSE;
3319                 }
3320
3321                 /* done */
3322                 break;
3323
3324         /* RF6_TELE_TO */
3325         case 160+8:
3326                 if (known)
3327                 {
3328                         if (see_either)
3329                         {
3330 #ifdef JP
3331                                 msg_format("%^s¤¬%s¤ò°ú¤­Ìᤷ¤¿¡£", m_name, t_name);
3332 #else
3333                                 msg_format("%^s commands %s to return.", m_name, t_name);
3334 #endif
3335
3336                         }
3337                         else
3338                         {
3339                                 mon_fight = TRUE;
3340                         }
3341                 }
3342
3343                 if (tr_ptr->flagsr & RFR_RES_TELE)
3344                 {
3345                         if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
3346                         {
3347                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
3348                                 if (see_t)
3349                                 {
3350 #ifdef JP
3351                                         msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
3352 #else
3353                                         msg_format("%^s is unaffected!", t_name);
3354 #endif
3355                                 }
3356
3357                                 resists_tele = TRUE;
3358                         }
3359                         else if (tr_ptr->level > randint1(100))
3360                         {
3361                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
3362                                 if (see_t)
3363                                 {
3364 #ifdef JP
3365                                         msg_format("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", t_name);
3366 #else
3367                                         msg_format("%^s resists!", t_name);
3368 #endif
3369                                 }
3370
3371                                 resists_tele = TRUE;
3372                         }
3373                 }
3374
3375                 if (!resists_tele)
3376                 {
3377                         if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
3378                         else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
3379                 }
3380
3381                 wake_up = TRUE;
3382                 break;
3383
3384         /* RF6_TELE_AWAY */
3385         case 160+9:
3386                 if (known)
3387                 {
3388                         if (see_either)
3389                         {
3390 #ifdef JP
3391                                 msg_format("%^s¤Ï%s¤ò¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤¿¡£", m_name, t_name);
3392 #else
3393                                 msg_format("%^s teleports %s away.", m_name, t_name);
3394 #endif
3395
3396                         }
3397                         else
3398                         {
3399                                 mon_fight = TRUE;
3400                         }
3401                 }
3402
3403                 if (tr_ptr->flagsr & RFR_RES_TELE)
3404                 {
3405                         if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
3406                         {
3407                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
3408                                 if (see_t)
3409                                 {
3410 #ifdef JP
3411                                         msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
3412 #else
3413                                         msg_format("%^s is unaffected!", t_name);
3414 #endif
3415                                 }
3416
3417                                 resists_tele = TRUE;
3418                         }
3419                         else if (tr_ptr->level > randint1(100))
3420                         {
3421                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
3422                                 if (see_t)
3423                                 {
3424 #ifdef JP
3425                                         msg_format("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", t_name);
3426 #else
3427                                         msg_format("%^s resists!", t_name);
3428 #endif
3429                                 }
3430
3431                                 resists_tele = TRUE;
3432                         }
3433                 }
3434
3435                 if (!resists_tele)
3436                 {
3437                         if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
3438                         else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
3439                 }
3440
3441                 wake_up = TRUE;
3442                 break;
3443
3444         /* RF6_TELE_LEVEL */
3445         case 160+10:
3446                 if (known)
3447                 {
3448                         if (see_either)
3449                         {
3450 #ifdef JP
3451                                 msg_format("%^s¤¬%s¤Î­¤ò»Ø¤µ¤·¤¿¡£", m_name, t_name);
3452 #else
3453                                 msg_format("%^s gestures at %s's feet.", m_name, t_name);
3454 #endif
3455                         }
3456                         else
3457                         {
3458                                 mon_fight = TRUE;
3459                         }
3460                 }
3461
3462                 if (tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE))
3463                 {
3464 #ifdef JP
3465                         if (see_t) msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", t_name);
3466 #else
3467                         if (see_t) msg_format("%^s is unaffected!", t_name);
3468 #endif
3469                 }
3470                 else if ((tr_ptr->flags1 & RF1_QUESTOR) ||
3471                             (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10))
3472                 {
3473 #ifdef JP
3474                         if (see_t) msg_format("%^s¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", t_name);
3475 #else
3476                         if (see_t) msg_format("%^s resist the effects!", t_name);
3477 #endif
3478                 }
3479                 else teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
3480
3481                 wake_up = TRUE;
3482                 break;
3483
3484         /* RF6_PSY_SPEAR */
3485         case 160+11:
3486                 if (known)
3487                 {
3488                         if (see_either)
3489                         {
3490 #ifdef JP
3491                                 msg_format("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name, t_name);
3492 #else
3493                                 msg_format("%^s throw a Psycho-spear at %s.", m_name, t_name);
3494 #endif
3495
3496                         }
3497                         else
3498                         {
3499                                 mon_fight = TRUE;
3500                         }
3501                 }
3502
3503                 dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 180) : (randint1(rlev * 3 / 2) + 120);
3504                 monst_beam_monst(m_idx, y, x, GF_PSY_SPEAR,
3505                                  dam, MS_PSY_SPEAR, learnable);
3506                 break;
3507
3508         /* RF6_DARKNESS */
3509         case 160+12:
3510                 if (known)
3511                 {
3512                         if (see_m)
3513                         {
3514 #ifdef JP
3515                                 if (can_use_lite_area) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3516                                 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3517 #else
3518                                 if (can_use_lite_area) msg_format("%^s cast a spell to light up.", m_name);
3519                                 else msg_format("%^s gestures in shadow.", m_name);
3520 #endif
3521
3522                                 if (see_t)
3523                                 {
3524 #ifdef JP
3525                                         if (can_use_lite_area) msg_format("%^s¤ÏÇò¤¤¸÷¤ËÊñ¤Þ¤ì¤¿¡£", t_name);
3526                                         else msg_format("%^s¤Ï°Å°Ç¤ËÊñ¤Þ¤ì¤¿¡£", t_name);
3527 #else
3528                                         if (can_use_lite_area) msg_format("%^s is surrounded by a white light.", t_name);
3529                                         else msg_format("%^s is surrounded by darkness.", t_name);
3530 #endif
3531                                 }
3532                         }
3533                         else
3534                         {
3535                                 mon_fight = TRUE;
3536                         }
3537                 }
3538
3539                 if (can_use_lite_area)
3540                 {
3541                         (void)project(m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
3542                         lite_room(y, x);
3543                 }
3544                 else
3545                 {
3546                         (void)project(m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
3547                         unlite_room(y, x);
3548                 }
3549
3550                 break;
3551
3552         /* RF6_TRAPS */
3553         case 160+13:
3554 #if 0
3555                 if (known)
3556                 {
3557                         if (see_m)
3558                         {
3559 #ifdef JP
3560                                 msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
3561 #else
3562                                 msg_format("%^s casts a spell and cackles evilly.", m_name);
3563 #endif
3564                         }
3565                         else
3566                         {
3567 #ifdef JP
3568                                 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3569 #else
3570                                 msg_format("%^s mumbles.", m_name);
3571 #endif
3572                         }
3573                 }
3574
3575                 trap_creation(y, x);
3576
3577                 break;
3578 #else
3579                 /* Not implemented */
3580                 return FALSE;
3581 #endif
3582
3583         /* RF6_FORGET */
3584         case 160+14:
3585                 /* Not implemented */
3586                 return FALSE;
3587
3588         /* RF6_RAISE_DEAD */
3589         case 160+15:
3590                 if (known)
3591                 {
3592                         if (see_either)
3593                         {
3594                                 disturb(1, 0);
3595 #ifdef JP
3596                                 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3597 #else
3598                                 if (blind) msg_format("%^s mumbles.", m_name);
3599 #endif
3600
3601 #ifdef JP
3602                                 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3603 #else
3604                                 else msg_format("%^s casts a spell to revive corpses.", m_name);
3605 #endif
3606                         }
3607                         else
3608                         {
3609                                 mon_fight = TRUE;
3610                         }
3611                 }
3612                 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3613                 break;
3614
3615         /* RF6_S_KIN */
3616         case 160+16:
3617                 if (known)
3618                 {
3619                         if (see_either)
3620                         {
3621                                 disturb(1, 0);
3622
3623                                 if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
3624                                 {
3625 #ifdef JP
3626                                         msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´­¤·¤¿¡£", m_name);
3627 #else
3628                                         msg_format("%^s magically summons guardians of dungeons.", m_name);
3629 #endif
3630                                 }
3631                                 else
3632                                 {
3633 #ifdef JP
3634                                         msg_format("%s¤¬ËâË¡¤Ç%s¤ò¾¤´­¤·¤¿¡£", m_name,
3635                                                    ((r_ptr->flags1 & RF1_UNIQUE) ? "¼ê²¼" : "Ãç´Ö"));
3636 #else
3637                                         msg_format("%^s magically summons %s %s.", m_name, m_poss,
3638                                                    ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin"));
3639 #endif
3640                                 }
3641
3642                         }
3643                         else
3644                         {
3645                                 mon_fight = TRUE;
3646                         }
3647                 }
3648
3649                 switch (m_ptr->r_idx)
3650                 {
3651                 case MON_MENELDOR:
3652                 case MON_GWAIHIR:
3653                 case MON_THORONDOR:
3654                         {
3655                                 int num = 4 + randint1(3);
3656                                 for (k = 0; k < num; k++)
3657                                 {
3658                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3659                                 }
3660                         }
3661                         break;
3662
3663                 case MON_BULLGATES:
3664                         {
3665                                 int num = 2 + randint1(3);
3666                                 for (k = 0; k < num; k++)
3667                                 {
3668                                         count += summon_named_creature(m_idx, y, x, MON_IE, 0);
3669                                 }
3670                         }
3671                         break;
3672
3673                 case MON_SERPENT:
3674                 case MON_ZOMBI_SERPENT:
3675                         if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
3676                         {
3677                                 if (known && see_t)
3678                                 {
3679 #ifdef JP
3680                                         msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª");
3681 #else
3682                                         msg_print("Water blew off from the ground!");
3683 #endif
3684                                 }
3685                                 project(t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
3686                         }
3687
3688                         {
3689                                 int num = 2 + randint1(3);
3690                                 for (k = 0; k < num; k++)
3691                                 {
3692                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3693                                 }
3694                         }
3695                         break;
3696
3697                 case MON_CALDARM:
3698                         {
3699                                 int num = randint1(3);
3700                                 for (k = 0; k < num; k++)
3701                                 {
3702                                         count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, 0);
3703                                 }
3704                         }
3705                         break;
3706
3707                 case MON_LOUSY:
3708                         {
3709                                 int num = 2 + randint1(3);
3710                                 for (k = 0; k < num; k++)
3711                                 {
3712                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, (PM_ALLOW_GROUP));
3713                                 }
3714                         }
3715                         break;
3716
3717                 default:
3718                         summon_kin_type = r_ptr->d_char;
3719
3720                         for (k = 0; k < 4; k++)
3721                         {
3722                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, (PM_ALLOW_GROUP));
3723                         }
3724                         break;
3725                 }
3726
3727                 if (known && !see_t && count)
3728                 {
3729                         mon_fight = TRUE;
3730                 }
3731
3732                 break;
3733
3734         /* RF6_S_CYBER */
3735         case 160+17:
3736                 if (known)
3737                 {
3738                         if (see_either)
3739                         {
3740                                 disturb(1, 0);
3741
3742 #ifdef JP
3743                                 msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
3744 #else
3745                                 msg_format("%^s magically summons Cyberdemons!", m_name);
3746 #endif
3747
3748                         }
3749                         else
3750                         {
3751                                 mon_fight = TRUE;
3752                         }
3753                 }
3754
3755                 if (is_friendly(m_ptr))
3756                 {
3757                         count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
3758                 }
3759                 else
3760                 {
3761                         count += summon_cyber(m_idx, y, x);
3762                 }
3763
3764                 if (known && !see_t && count)
3765                 {
3766                         mon_fight = TRUE;
3767                 }
3768
3769                 break;
3770
3771         /* RF6_S_MONSTER */
3772         case 160+18:
3773                 if (known)
3774                 {
3775                         if (see_either)
3776                         {
3777                                 disturb(1, 0);
3778
3779 #ifdef JP
3780                                 msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´­¤·¤¿¡ª", m_name);
3781 #else
3782                                 msg_format("%^s magically summons help!", m_name);
3783 #endif
3784
3785                         }
3786                         else
3787                         {
3788                                 mon_fight = TRUE;
3789                         }
3790                 }
3791
3792                 count += summon_specific(m_idx, y, x, rlev, 0, (u_mode));
3793
3794                 if (known && !see_t && count)
3795                 {
3796                         mon_fight = TRUE;
3797                 }
3798
3799                 break;
3800
3801         /* RF6_S_MONSTERS */
3802         case 160+19:
3803                 if (known)
3804                 {
3805                         if (see_either)
3806                         {
3807                                 disturb(1, 0);
3808
3809 #ifdef JP
3810                                 msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª", m_name);
3811 #else
3812                                 msg_format("%^s magically summons monsters!", m_name);
3813 #endif
3814
3815                         }
3816                         else
3817                         {
3818                                 mon_fight = TRUE;
3819                         }
3820                 }
3821
3822                 for (k = 0; k < s_num_6; k++)
3823                 {
3824                         count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | u_mode));
3825                 }
3826
3827                 if (known && !see_t && count)
3828                 {
3829                         mon_fight = TRUE;
3830                 }
3831
3832                 break;
3833
3834         /* RF6_S_ANT */
3835         case 160+20:
3836                 if (known)
3837                 {
3838                         if (see_either)
3839                         {
3840                                 disturb(1, 0);
3841
3842 #ifdef JP
3843                                 msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´­¤·¤¿¡£", m_name);
3844 #else
3845                                 msg_format("%^s magically summons ants.", m_name);
3846 #endif
3847
3848                         }
3849                         else
3850                         {
3851                                 mon_fight = TRUE;
3852                         }
3853                 }
3854
3855                 for (k = 0; k < s_num_6; k++)
3856                 {
3857                         count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, (PM_ALLOW_GROUP));
3858                 }
3859
3860                 if (known && !see_t && count)
3861                 {
3862                         mon_fight = TRUE;
3863                 }
3864
3865                 break;
3866
3867         /* RF6_S_SPIDER */
3868         case 160+21:
3869                 if (known)
3870                 {
3871                         if (see_either)
3872                         {
3873                                 disturb(1, 0);
3874
3875 #ifdef JP
3876                                 msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´­¤·¤¿¡£", m_name);
3877 #else
3878                                 msg_format("%^s magically summons spiders.", m_name);
3879 #endif
3880
3881                         }
3882                         else
3883                         {
3884                                 mon_fight = TRUE;
3885                         }
3886                 }
3887
3888                 for (k = 0; k < s_num_6; k++)
3889                 {
3890                         count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, (PM_ALLOW_GROUP));
3891                 }
3892
3893                 if (known && !see_t && count)
3894                 {
3895                         mon_fight = TRUE;
3896                 }
3897
3898                 break;
3899
3900         /* RF6_S_HOUND */
3901         case 160+22:
3902                 if (known)
3903                 {
3904                         if (see_either)
3905                         {
3906                                 disturb(1, 0);
3907
3908 #ifdef JP
3909                                 msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£", m_name);
3910 #else
3911                                 msg_format("%^s magically summons hounds.", m_name);
3912 #endif
3913
3914                         }
3915                         else
3916                         {
3917                                 mon_fight = TRUE;
3918                         }
3919                 }
3920
3921                 for (k = 0; k < s_num_4; k++)
3922                 {
3923                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, (PM_ALLOW_GROUP));
3924                 }
3925
3926                 if (known && !see_t && count)
3927                 {
3928                         mon_fight = TRUE;
3929                 }
3930
3931                 break;
3932
3933         /* RF6_S_HYDRA */
3934         case 160+23:
3935                 if (known)
3936                 {
3937                         if (see_either)
3938                         {
3939                                 disturb(1, 0);
3940
3941 #ifdef JP
3942                                 msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£", m_name);
3943 #else
3944                                 msg_format("%^s magically summons hydras.", m_name);
3945 #endif
3946
3947                         }
3948                         else
3949                         {
3950                                 mon_fight = TRUE;
3951                         }
3952                 }
3953
3954                 for (k = 0; k < s_num_4; k++)
3955                 {
3956                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, (PM_ALLOW_GROUP));
3957                 }
3958
3959                 if (known && !see_t && count)
3960                 {
3961                         mon_fight = TRUE;
3962                 }
3963
3964                 break;
3965
3966         /* RF6_S_ANGEL */
3967         case 160+24:
3968                 if (known)
3969                 {
3970                         if (see_either)
3971                         {
3972                                 disturb(1, 0);
3973
3974 #ifdef JP
3975                                 msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´­¤·¤¿¡ª", m_name);
3976 #else
3977                                 msg_format("%^s magically summons an angel!", m_name);
3978 #endif
3979
3980                         }
3981                         else
3982                         {
3983                                 mon_fight = TRUE;
3984                         }
3985                 }
3986
3987                 {
3988                         int num = 1;
3989
3990                         if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
3991                         {
3992                                 num += r_ptr->level/40;
3993                         }
3994
3995                         for (k = 0; k < num; k++)
3996                         {
3997                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP));
3998                         }
3999                 }
4000
4001                 if (known && !see_t && count)
4002                 {
4003                         mon_fight = TRUE;
4004                 }
4005
4006                 break;
4007
4008         /* RF6_S_DEMON */
4009         case 160+25:
4010                 if (known)
4011                 {
4012                         if (see_either)
4013                         {
4014                                 disturb(1, 0);
4015
4016 #ifdef JP
4017                                 msg_format("%^s¤¬ËâË¡¤Çº®Æ٤εÜÄ¤é¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4018 #else
4019                                 msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4020 #endif
4021
4022                         }
4023                         else
4024                         {
4025                                 mon_fight = TRUE;
4026                         }
4027                 }
4028
4029                 for (k = 0; k < 1; k++)
4030                 {
4031                         count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, (PM_ALLOW_GROUP));
4032                 }
4033
4034                 if (known && !see_t && count)
4035                 {
4036                         mon_fight = TRUE;
4037                 }
4038
4039                 break;
4040
4041         /* RF6_S_UNDEAD */
4042         case 160+26:
4043                 if (known)
4044                 {
4045                         if (see_either)
4046                         {
4047                                 disturb(1, 0);
4048
4049 #ifdef JP
4050                                 msg_format("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡£", m_name);
4051 #else
4052                                 msg_format("%^s magically summons undead.", m_name);
4053 #endif
4054
4055                         }
4056                         else
4057                         {
4058                                 mon_fight = TRUE;
4059                         }
4060                 }
4061
4062                 for (k = 0; k < 1; k++)
4063                 {
4064                         count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, (PM_ALLOW_GROUP));
4065                 }
4066
4067                 if (known && !see_t && count)
4068                 {
4069                         mon_fight = TRUE;
4070                 }
4071
4072                 break;
4073
4074         /* RF6_S_DRAGON */
4075         case 160+27:
4076                 if (known)
4077                 {
4078                         if (see_either)
4079                         {
4080                                 disturb(1, 0);
4081
4082 #ifdef JP
4083                                 msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4084 #else
4085                                 msg_format("%^s magically summons a dragon!", m_name);
4086 #endif
4087
4088                         }
4089                         else
4090                         {
4091                                 mon_fight = TRUE;
4092                         }
4093                 }
4094
4095                 for (k = 0; k < 1; k++)
4096                 {
4097                         count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, (PM_ALLOW_GROUP));
4098                 }
4099
4100                 if (known && !see_t && count)
4101                 {
4102                         mon_fight = TRUE;
4103                 }
4104
4105                 break;
4106
4107         /* RF6_S_HI_UNDEAD */
4108         case 160+28:
4109                 if (known)
4110                 {
4111                         if (see_either)
4112                         {
4113                                 disturb(1, 0);
4114
4115 #ifdef JP
4116                                 msg_format("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡£", m_name);
4117 #else
4118                                 msg_format("%^s magically summons undead.", m_name);
4119 #endif
4120
4121                         }
4122                         else
4123                         {
4124                                 mon_fight = TRUE;
4125                         }
4126                 }
4127
4128                 for (k = 0; k < s_num_6; k++)
4129                 {
4130                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | u_mode));
4131                 }
4132
4133                 if (known && !see_t && count)
4134                 {
4135                         mon_fight = TRUE;
4136                 }
4137
4138                 break;
4139
4140         /* RF6_S_HI_DRAGON */
4141         case 160+29:
4142                 if (known)
4143                 {
4144                         if (see_either)
4145                         {
4146                                 disturb(1, 0);
4147
4148 #ifdef JP
4149                                 msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4150 #else
4151                                 msg_format("%^s magically summons ancient dragons!", m_name);
4152 #endif
4153
4154                         }
4155                         else
4156                         {
4157                                 mon_fight = TRUE;
4158                         }
4159                 }
4160
4161                 for (k = 0; k < s_num_4; k++)
4162                 {
4163                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | u_mode));
4164                 }
4165
4166                 if (known && !see_t && count)
4167                 {
4168                         mon_fight = TRUE;
4169                 }
4170
4171                 break;
4172
4173         /* RF6_S_AMBERITES */
4174         case 160+30:
4175                 if (known)
4176                 {
4177                         if (see_either)
4178                         {
4179                                 disturb(1, 0);
4180
4181 #ifdef JP
4182                                 msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª", m_name);
4183 #else
4184                                 msg_format("%^s magically summons Lords of Amber!", m_name);
4185 #endif
4186
4187                         }
4188                         else
4189                         {
4190                                 mon_fight = TRUE;
4191                         }
4192                 }
4193
4194                 for (k = 0; k < s_num_4; k++)
4195                 {
4196                         count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4197                 }
4198
4199                 if (known && !see_t && count)
4200                 {
4201                         mon_fight = TRUE;
4202                 }
4203
4204                 break;
4205
4206         /* RF6_S_UNIQUE */
4207         case 160+31:
4208                 if (known)
4209                 {
4210                         if (see_either)
4211                         {
4212                                 disturb(1, 0);
4213
4214 #ifdef JP
4215                                 msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª", m_name);
4216 #else
4217                                 msg_format("%^s magically summons special opponents!", m_name);
4218 #endif
4219
4220                         }
4221                         else
4222                         {
4223                                 mon_fight = TRUE;
4224                         }
4225                 }
4226
4227                 for (k = 0; k < s_num_4; k++)
4228                 {
4229                         count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4230                 }
4231
4232                 {
4233                         int non_unique_type = SUMMON_HI_UNDEAD;
4234
4235                         if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
4236                                 non_unique_type = 0;
4237                         else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
4238                                 non_unique_type = SUMMON_ANGEL;
4239
4240                         for (k = count; k < s_num_4; k++)
4241                         {
4242                                 count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4243                         }
4244                 }
4245
4246                 if (known && !see_t && count)
4247                 {
4248                         mon_fight = TRUE;
4249                 }
4250
4251                 break;
4252         }
4253
4254         if (wake_up) (void)set_monster_csleep(t_idx, 0);
4255
4256         if (fear && see_t)
4257         {
4258 #ifdef JP
4259                 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", t_name);
4260 #else
4261                 msg_format("%^s flees in terror!", t_name);
4262 #endif
4263         }
4264
4265         if (m_ptr->ml && maneable && !world_monster && !p_ptr->blind && (p_ptr->pclass == CLASS_IMITATOR))
4266         {
4267                 if (thrown_spell != 167) /* Not RF6_SPECIAL */
4268                 {
4269                         if (p_ptr->mane_num == MAX_MANE)
4270                         {
4271                                 p_ptr->mane_num--;
4272                                 for (i = 0; i < p_ptr->mane_num - 1; i++)
4273                                 {
4274                                         p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
4275                                         p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
4276                                 }
4277                         }
4278                         p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
4279                         p_ptr->mane_dam[p_ptr->mane_num] = dam;
4280                         p_ptr->mane_num++;
4281                         new_mane = TRUE;
4282
4283                         p_ptr->redraw |= (PR_IMITATION);
4284                 }
4285         }
4286
4287         /* Remember what the monster did, if we saw it */
4288         if (can_remember)
4289         {
4290                 /* Inate spell */
4291                 if (thrown_spell < 32*4)
4292                 {
4293                         r_ptr->r_flags4 |= (1L << (thrown_spell - 32*3));
4294                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4295                 }
4296
4297                 /* Bolt or Ball */
4298                 else if (thrown_spell < 32*5)
4299                 {
4300                         r_ptr->r_flags5 |= (1L << (thrown_spell - 32*4));
4301                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4302                 }
4303
4304                 /* Special spell */
4305                 else if (thrown_spell < 32*6)
4306                 {
4307                         r_ptr->r_flags6 |= (1L << (thrown_spell - 32*5));
4308                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4309                 }
4310         }
4311
4312         /* Always take note of monsters that kill you */
4313         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
4314         {
4315                 r_ptr->r_deaths++; /* Ignore appearance difference */
4316         }
4317
4318         /* A spell was cast */
4319         return TRUE;
4320 }