OSDN Git Service

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