OSDN Git Service

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