OSDN Git Service

refactor: extract breath spells in monst_spell_monst
[hengbandforosx/hengbandosx.git] / src / 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  * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨ÂÐ¥â¥ó¥¹¥¿¡¼¤Ë¥Ó¡¼¥à¤òÅö¤Æ¤ë¤³¤È²Äǽ¤«¤òȽÄꤹ¤ë /
18  * Determine if a beam spell will hit the target.
19  * @param y1 »ÏÅÀ¤ÎYºÂɸ
20  * @param x1 »ÏÅÀ¤ÎXºÂɸ
21  * @param y2 ÌÜɸ¤ÎYºÂɸ
22  * @param x2 ÌÜɸ¤ÎXºÂɸ
23  * @param m_ptr »ÈÍѤ¹¤ë¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
24  * @return ¥Ó¡¼¥à¤¬Åþã²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
25  */
26 static bool direct_beam(int y1, int x1, int y2, int x2, monster_type *m_ptr)
27 {
28         bool hit2 = FALSE;
29         int i, y, x;
30
31         int grid_n = 0;
32         u16b grid_g[512];
33
34         bool is_friend = is_pet(m_ptr);
35
36         /* Check the projection path */
37         grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, PROJECT_THRU);
38
39         /* No grid is ever projectable from itself */
40         if (!grid_n) return (FALSE);
41
42         for (i = 0; i < grid_n; i++)
43         {
44                 y = GRID_Y(grid_g[i]);
45                 x = GRID_X(grid_g[i]);
46
47                 if (y == y2 && x == x2)
48                         hit2 = TRUE;
49                 else if (is_friend && cave[y][x].m_idx > 0 &&
50                          !are_enemies(m_ptr, &m_list[cave[y][x].m_idx]))
51                 {
52                         /* Friends don't shoot friends */
53                         return FALSE;
54                 }
55
56                 if (is_friend && player_bold(y, x))
57                         return FALSE;
58         }
59         if (!hit2)
60                 return FALSE;
61         return TRUE;
62 }
63
64 /*!
65  * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨ÂÐ¥â¥ó¥¹¥¿¡¼¤ËľÀܥ֥쥹¤òÅö¤Æ¤ë¤³¤È¤¬²Äǽ¤«¤òȽÄꤹ¤ë /
66  * Determine if a breath will hit the target.
67  * @param y1 »ÏÅÀ¤ÎYºÂɸ
68  * @param x1 »ÏÅÀ¤ÎXºÂɸ
69  * @param y2 ÌÜɸ¤ÎYºÂɸ
70  * @param x2 ÌÜɸ¤ÎXºÂɸ
71  * @param rad È¾·Â
72  * @param typ ¸ú²Ì°À­ID
73  * @param is_friend TRUE¤Ê¤é¤Ð¡¢¥×¥ì¥¤¥ä¡¼¤ò´¬¤­¹þ¤à»þ¤Ë¥Ö¥ì¥¹¤ÎȽÄê¤òFALSE¤Ë¤¹¤ë¡£
74  * @return ¥Ö¥ì¥¹¤òľÀÜÅö¤Æ¤é¤ì¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
75  */
76 static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool is_friend)
77 {
78         /* Must be the same as projectable() */
79
80         int i;
81
82         /* Initial grid */
83         int y = y1;
84         int x = x1;
85
86         int grid_n = 0;
87         u16b grid_g[512];
88
89         int grids = 0;
90         byte gx[1024], gy[1024];
91         byte gm[32];
92         int gm_rad = rad;
93
94         bool hit2 = FALSE;
95         bool hityou = FALSE;
96
97         int flg;
98
99         switch (typ)
100         {
101         case GF_LITE:
102         case GF_LITE_WEAK:
103                 flg = PROJECT_LOS;
104                 break;
105         case GF_DISINTEGRATE:
106                 flg = PROJECT_DISI;
107                 break;
108         default:
109                 flg = 0;
110                 break;
111         }
112
113         /* Check the projection path */
114         grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
115
116         /* Project along the path */
117         for (i = 0; i < grid_n; ++i)
118         {
119                 int ny = GRID_Y(grid_g[i]);
120                 int nx = GRID_X(grid_g[i]);
121
122                 if (flg & PROJECT_DISI)
123                 {
124                         /* Hack -- Balls explode before reaching walls */
125                         if (cave_stop_disintegration(ny, nx)) break;
126                 }
127                 else if (flg & PROJECT_LOS)
128                 {
129                         /* Hack -- Balls explode before reaching walls */
130                         if (!cave_los_bold(ny, nx)) break;
131                 }
132                 else
133                 {
134                         /* Hack -- Balls explode before reaching walls */
135                         if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
136                 }
137
138                 /* Save the "blast epicenter" */
139                 y = ny;
140                 x = nx;
141         }
142
143         grid_n = i;
144
145         if (!grid_n)
146         {
147                 if (flg & PROJECT_DISI)
148                 {
149                         if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
150                         if (in_disintegration_range(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
151                 }
152                 else if (flg & PROJECT_LOS)
153                 {
154                         if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
155                         if (los(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
156                 }
157                 else
158                 {
159                         if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
160                         if (projectable(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
161                 }
162         }
163         else
164         {
165                 breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y, x, typ);
166
167                 for (i = 0; i < grids; i++)
168                 {
169                         /* Extract the location */
170                         y = gy[i];
171                         x = gx[i];
172
173                         if ((y == y2) && (x == x2)) hit2 = TRUE;
174                         if (player_bold(y, x)) hityou = TRUE;
175                 }
176         }
177
178         if (!hit2) return FALSE;
179         if (is_friend && hityou) return FALSE;
180
181         return TRUE;
182 }
183
184 /*!
185  * @brief ¥â¥ó¥¹¥¿¡¼¤¬ÆüìǽÎϤÎÌÜɸÃÏÅÀ¤ò·è¤á¤ë½èÍý /
186  * Get the actual center point of ball spells (rad > 1) (originally from TOband)
187  * @param sy »ÏÅÀ¤ÎYºÂɸ
188  * @param sx »ÏÅÀ¤ÎXºÂɸ
189  * @param ty ÌÜɸYºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
190  * @param tx ÌÜɸXºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
191  * @param flg È½Äê¤Î¥Õ¥é¥°ÇÛÎó
192  * @return ¤Ê¤·
193  */
194 void get_project_point(int sy, int sx, int *ty, int *tx, int flg)
195 {
196         u16b path_g[128];
197         int  path_n, i;
198
199         path_n = project_path(path_g, MAX_RANGE, sy, sx, *ty, *tx, flg);
200
201         *ty = sy;
202         *tx = sx;
203
204         /* Project along the path */
205         for (i = 0; i < path_n; i++)
206         {
207                 sy = GRID_Y(path_g[i]);
208                 sx = GRID_X(path_g[i]);
209
210                 /* Hack -- Balls explode before reaching walls */
211                 if (!cave_have_flag_bold(sy, sx, FF_PROJECT)) break;
212
213                 *ty = sy;
214                 *tx = sx;
215         }
216 }
217
218 /*!
219  * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨¥â¥ó¥¹¥¿¡¼¤ËËâÎϾõî¤ò»È¤¦¤«¤É¤¦¤«¤òÊÖ¤¹ /
220  * Check should monster cast dispel spell at other monster.
221  * @param m_idx ½Ñ¼Ô¤Î¥â¥ó¥¹¥¿¡¼ID
222  * @param t_idx ÌÜɸ¤Î¥â¥ó¥¹¥¿¡¼ID
223  * @return ËâÎϾõî¤ò»È¤¦¤Ù¤­¤Ê¤é¤ÐTRUE¤òÊѤ¨¤¹¡£
224  */
225 static bool dispel_check_monster(int m_idx, int t_idx)
226 {
227         monster_type *t_ptr = &m_list[t_idx];
228
229         /* Invulnabilty */
230         if (MON_INVULNER(t_ptr)) return TRUE;
231
232         /* Speed */
233         if (t_ptr->mspeed < 135)
234         {
235                 if (MON_FAST(t_ptr)) return TRUE;
236         }
237
238         /* Riding monster */
239         if (t_idx == p_ptr->riding)
240         {
241                 if (dispel_check(m_idx)) return TRUE;
242         }
243
244         /* No need to cast dispel spell */
245         return FALSE;
246 }
247
248 /*!
249  * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨¥â¥ó¥¹¥¿¡¼¤ËÆüìǽÎϤò»È¤¦½èÍý¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
250  * Monster tries to 'cast a spell' (or breath, etc) at another monster.
251  * @param m_idx ½Ñ¼Ô¤Î¥â¥ó¥¹¥¿¡¼ID
252  * @return ¼ÂºÝ¤ËÆüìǽÎϤò»È¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹
253  * @details
254  * The player is only disturbed if able to be affected by the spell.
255  */
256 bool monst_spell_monst(int m_idx)
257 {
258         int y = 0, x = 0;
259         int i, k, t_idx = 0;
260         int thrown_spell, count = 0;
261         int rlev;
262         int dam = 0;
263         int start;
264         int plus = 1;
265         u32b u_mode = 0L;
266         int s_num_6 = (easy_band ? 2 : 6);
267         int s_num_4 = (easy_band ? 1 : 4);
268         int rad = 0; //For elemental balls
269
270         byte spell[96], num = 0;
271
272         char m_name[160];
273         char t_name[160];
274
275 #ifndef JP
276         char m_poss[160];
277 #endif
278
279         monster_type *m_ptr = &m_list[m_idx];
280         monster_type *t_ptr = NULL;
281
282         monster_race *r_ptr = &r_info[m_ptr->r_idx];
283         monster_race *tr_ptr = NULL;
284
285         u32b f4, f5, f6;
286
287         bool wake_up = FALSE;
288         bool fear = FALSE;
289
290         bool blind = (p_ptr->blind ? TRUE : FALSE);
291
292         bool see_m = is_seen(m_ptr);
293         bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
294         bool see_t;
295         bool see_either;
296         bool known;
297
298         bool pet = is_pet(m_ptr);
299
300         bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
301                 && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
302
303         bool can_use_lite_area = FALSE;
304
305         bool can_remember;
306
307         bool resists_tele = FALSE;
308
309         /* Prepare flags for summoning */
310         if (!pet) u_mode |= PM_ALLOW_UNIQUE;
311
312         /* Cannot cast spells when confused */
313         if (MON_CONFUSED(m_ptr)) return (FALSE);
314
315         /* Extract the racial spell flags */
316         f4 = r_ptr->flags4;
317         f5 = r_ptr->flags5;
318         f6 = r_ptr->flags6;
319
320         /* Target is given for pet? */
321         if (pet_t_m_idx && pet)
322         {
323                 t_idx = pet_t_m_idx;
324                 t_ptr = &m_list[t_idx];
325
326                 /* Cancel if not projectable (for now) */
327                 if ((m_idx == t_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
328                 {
329                         t_idx = 0;
330                 }
331         }
332
333         /* Is there counter attack target? */
334         if (!t_idx && m_ptr->target_y)
335         {
336                 t_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
337
338                 if (t_idx)
339                 {
340                         t_ptr = &m_list[t_idx];
341
342                         /* Cancel if neither enemy nor a given target */
343                         if ((m_idx == t_idx) ||
344                             ((t_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
345                         {
346                                 t_idx = 0;
347                         }
348
349                         /* Allow only summoning etc.. if not projectable */
350                         else if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
351                         {
352                                 f4 &= (RF4_INDIRECT_MASK);
353                                 f5 &= (RF5_INDIRECT_MASK);
354                                 f6 &= (RF6_INDIRECT_MASK);
355                         }
356                 }
357         }
358
359         /* Look for enemies normally */
360         if (!t_idx)
361         {
362                 bool success = FALSE;
363
364                 if (p_ptr->inside_battle)
365                 {
366                         start = randint1(m_max-1) + m_max;
367                         if (randint0(2)) plus = -1;
368                 }
369                 else start = m_max + 1;
370
371                 /* Scan thru all monsters */
372                 for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
373                 {
374                         int dummy = (i % m_max);
375                         if (!dummy) continue;
376
377                         t_idx = dummy;
378                         t_ptr = &m_list[t_idx];
379
380                         /* Skip dead monsters */
381                         if (!t_ptr->r_idx) continue;
382
383                         /* Monster must be 'an enemy' */
384                         if ((m_idx == t_idx) || !are_enemies(m_ptr, t_ptr)) continue;
385
386                         /* Monster must be projectable */
387                         if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
388
389                         /* Get it */
390                         success = TRUE;
391                         break;
392                 }
393
394                 /* No enemy found */
395                 if (!success) return FALSE;
396         }
397
398
399         /* OK -- we've got a target */
400         y = t_ptr->fy;
401         x = t_ptr->fx;
402         tr_ptr = &r_info[t_ptr->r_idx];
403
404         /* Forget old counter attack target */
405         reset_target(m_ptr);
406
407         /* Extract the monster level */
408         rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
409
410         /* Remove unimplemented spells */
411         f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
412
413         if (f4 & RF4_BR_LITE)
414         {
415                 if (!los(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
416                         f4 &= ~(RF4_BR_LITE);
417         }
418
419         /* Remove unimplemented special moves */
420         if (f6 & RF6_SPECIAL)
421         {
422                 if ((m_ptr->r_idx != MON_ROLENTO) && (r_ptr->d_char != 'B'))
423                         f6 &= ~(RF6_SPECIAL);
424         }
425
426         if (f6 & RF6_DARKNESS)
427         {
428                 bool vs_ninja = (p_ptr->pclass == CLASS_NINJA) && !is_hostile(t_ptr);
429
430                 if (vs_ninja &&
431                     !(r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) &&
432                     !(r_ptr->flags7 & RF7_DARK_MASK))
433                         can_use_lite_area = TRUE;
434
435                 if (!(r_ptr->flags2 & RF2_STUPID))
436                 {
437                         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
438                         else if (vs_ninja && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
439                 }
440         }
441
442         if (in_no_magic_dungeon && !(r_ptr->flags2 & RF2_STUPID))
443         {
444                 f4 &= (RF4_NOMAGIC_MASK);
445                 f5 &= (RF5_NOMAGIC_MASK);
446                 f6 &= (RF6_NOMAGIC_MASK);
447         }
448
449         if (p_ptr->inside_arena || p_ptr->inside_battle)
450         {
451                 f4 &= ~(RF4_SUMMON_MASK);
452                 f5 &= ~(RF5_SUMMON_MASK);
453                 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
454
455                 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
456         }
457
458         if (p_ptr->inside_battle && !one_in_(3))
459         {
460                 f6 &= ~(RF6_HEAL);
461         }
462
463         if (m_idx == p_ptr->riding)
464         {
465                 f4 &= ~(RF4_RIDING_MASK);
466                 f5 &= ~(RF5_RIDING_MASK);
467                 f6 &= ~(RF6_RIDING_MASK);
468         }
469
470         if (pet)
471         {
472                 f4 &= ~(RF4_SHRIEK);
473                 f6 &= ~(RF6_DARKNESS | RF6_TRAPS);
474
475                 if (!(p_ptr->pet_extra_flags & PF_TELEPORT))
476                 {
477                         f6 &= ~(RF6_BLINK | RF6_TPORT | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL);
478                 }
479
480                 if (!(p_ptr->pet_extra_flags & PF_ATTACK_SPELL))
481                 {
482                         f4 &= ~(RF4_ATTACK_MASK);
483                         f5 &= ~(RF5_ATTACK_MASK);
484                         f6 &= ~(RF6_ATTACK_MASK);
485                 }
486
487                 if (!(p_ptr->pet_extra_flags & PF_SUMMON_SPELL))
488                 {
489                         f4 &= ~(RF4_SUMMON_MASK);
490                         f5 &= ~(RF5_SUMMON_MASK);
491                         f6 &= ~(RF6_SUMMON_MASK);
492                 }
493
494                 /* Prevent collateral damage */
495                 if (!(p_ptr->pet_extra_flags & PF_BALL_SPELL) && (m_idx != p_ptr->riding))
496                 {
497                         if ((f4 & (RF4_BALL_MASK & ~(RF4_ROCKET))) ||
498                             (f5 & RF5_BALL_MASK) ||
499                             (f6 & RF6_BALL_MASK))
500                         {
501                                 int real_y = y;
502                                 int real_x = x;
503
504                                 get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
505
506                                 if (projectable(real_y, real_x, py, px))
507                                 {
508                                         int dist = distance(real_y, real_x, py, px);
509
510                                         if (dist <= 2)
511                                         {
512                                                 f4 &= ~(RF4_BALL_MASK & ~(RF4_ROCKET));
513                                                 f5 &= ~(RF5_BALL_MASK);
514                                                 f6 &= ~(RF6_BALL_MASK);
515                                         }
516                                         else if (dist <= 4)
517                                         {
518                                                 f4 &= ~(RF4_BIG_BALL_MASK);
519                                                 f5 &= ~(RF5_BIG_BALL_MASK);
520                                                 f6 &= ~(RF6_BIG_BALL_MASK);
521                                         }
522                                 }
523                                 else if (f5 & RF5_BA_LITE)
524                                 {
525                                         if ((distance(real_y, real_x, py, px) <= 4) && los(real_y, real_x, py, px))
526                                                 f5 &= ~(RF5_BA_LITE);
527                                 }
528                         }
529
530                         if (f4 & RF4_ROCKET)
531                         {
532                                 int real_y = y;
533                                 int real_x = x;
534
535                                 get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
536                                 if (projectable(real_y, real_x, py, px) && (distance(real_y, real_x, py, px) <= 2))
537                                         f4 &= ~(RF4_ROCKET);
538                         }
539
540                         if (((f4 & RF4_BEAM_MASK) ||
541                              (f5 & RF5_BEAM_MASK) ||
542                              (f6 & RF6_BEAM_MASK)) &&
543                             !direct_beam(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, m_ptr))
544                         {
545                                 f4 &= ~(RF4_BEAM_MASK);
546                                 f5 &= ~(RF5_BEAM_MASK);
547                                 f6 &= ~(RF6_BEAM_MASK);
548                         }
549
550                         if ((f4 & RF4_BREATH_MASK) ||
551                             (f5 & RF5_BREATH_MASK) ||
552                             (f6 & RF6_BREATH_MASK))
553                         {
554                                 /* Expected breath radius */
555                                 int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
556
557                                 if (!breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
558                                 {
559                                         f4 &= ~(RF4_BREATH_MASK);
560                                         f5 &= ~(RF5_BREATH_MASK);
561                                         f6 &= ~(RF6_BREATH_MASK);
562                                 }
563                                 else if ((f4 & RF4_BR_LITE) &&
564                                          !breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_LITE, TRUE))
565                                 {
566                                         f4 &= ~(RF4_BR_LITE);
567                                 }
568                                 else if ((f4 & RF4_BR_DISI) &&
569                                          !breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, GF_DISINTEGRATE, TRUE))
570                                 {
571                                         f4 &= ~(RF4_BR_DISI);
572                                 }
573                         }
574                 }
575
576                 /* Special moves restriction */
577                 if (f6 & RF6_SPECIAL)
578                 {
579                         if (m_ptr->r_idx == MON_ROLENTO)
580                         {
581                                 if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_SUMMON_SPELL)) != (PF_ATTACK_SPELL | PF_SUMMON_SPELL))
582                                         f6 &= ~(RF6_SPECIAL);
583                         }
584                         else if (r_ptr->d_char == 'B')
585                         {
586                                 if ((p_ptr->pet_extra_flags & (PF_ATTACK_SPELL | PF_TELEPORT)) != (PF_ATTACK_SPELL | PF_TELEPORT))
587                                         f6 &= ~(RF6_SPECIAL);
588                         }
589                         else f6 &= ~(RF6_SPECIAL);
590                 }
591         }
592
593         /* Remove some spells if necessary */
594
595         if (!(r_ptr->flags2 & RF2_STUPID))
596         {
597                 /* Check for a clean bolt shot */
598                 if (((f4 & RF4_BOLT_MASK) ||
599                      (f5 & RF5_BOLT_MASK) ||
600                      (f6 & RF6_BOLT_MASK)) &&
601                     !clean_shot(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, pet))
602                 {
603                         f4 &= ~(RF4_BOLT_MASK);
604                         f5 &= ~(RF5_BOLT_MASK);
605                         f6 &= ~(RF6_BOLT_MASK);
606                 }
607
608                 /* Check for a possible summon */
609                 if (((f4 & RF4_SUMMON_MASK) ||
610                      (f5 & RF5_SUMMON_MASK) ||
611                      (f6 & RF6_SUMMON_MASK)) &&
612                     !(summon_possible(t_ptr->fy, t_ptr->fx)))
613                 {
614                         /* Remove summoning spells */
615                         f4 &= ~(RF4_SUMMON_MASK);
616                         f5 &= ~(RF5_SUMMON_MASK);
617                         f6 &= ~(RF6_SUMMON_MASK);
618                 }
619
620                 /* Dispel magic */
621                 if ((f4 & RF4_DISPEL) && !dispel_check_monster(m_idx, t_idx))
622                 {
623                         /* Remove dispel spell */
624                         f4 &= ~(RF4_DISPEL);
625                 }
626
627                 /* Check for a possible raise dead */
628                 if ((f6 & RF6_RAISE_DEAD) && !raise_possible(m_ptr))
629                 {
630                         /* Remove raise dead spell */
631                         f6 &= ~(RF6_RAISE_DEAD);
632                 }
633
634                 /* Special moves restriction */
635                 if (f6 & RF6_SPECIAL)
636                 {
637                         if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(t_ptr->fy, t_ptr->fx))
638                         {
639                                 f6 &= ~(RF6_SPECIAL);
640                         }
641                 }
642         }
643
644         if (r_ptr->flags2 & RF2_SMART)
645         {
646                 /* Hack -- allow "desperate" spells */
647                 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
648                     (randint0(100) < 50))
649                 {
650                         /* Require intelligent spells */
651                         f4 &= (RF4_INT_MASK);
652                         f5 &= (RF5_INT_MASK);
653                         f6 &= (RF6_INT_MASK);
654                 }
655
656                 /* Hack -- decline "teleport level" in some case */
657                 if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((t_idx == p_ptr->riding) ? 0 : t_idx))
658                 {
659                         f6 &= ~(RF6_TELE_LEVEL);
660                 }
661         }
662
663         /* No spells left */
664         if (!f4 && !f5 && !f6) return FALSE;
665
666         /* Extract the "inate" spells */
667         for (k = 0; k < 32; k++)
668         {
669                 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
670         }
671
672         /* Extract the "normal" spells */
673         for (k = 0; k < 32; k++)
674         {
675                 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
676         }
677
678         /* Extract the "bizarre" spells */
679         for (k = 0; k < 32; k++)
680         {
681                 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
682         }
683
684         /* No spells left */
685         if (!num) return (FALSE);
686
687         /* Stop if player is dead or gone */
688         if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
689
690         /* Handle "leaving" */
691         if (p_ptr->leaving) return (FALSE);
692
693         /* Get the monster name (or "it") */
694         monster_desc(m_name, m_ptr, 0x00);
695
696 #ifndef JP
697         /* Get the monster possessive ("his"/"her"/"its") */
698         monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
699 #endif
700
701         /* Get the target's name (or "it") */
702         monster_desc(t_name, t_ptr, 0x00);
703
704         /* Choose a spell to cast */
705         thrown_spell = spell[randint0(num)];
706
707         see_t = is_seen(t_ptr);
708         see_either = (see_m || see_t);
709
710         /* Can the player be aware of this attack? */
711         known = (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT);
712
713         if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
714
715         /* Check for spell failure (inate attacks never fail) */
716         if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
717         {
718                 disturb(1, 1);
719                 /* Message */
720                 if (see_m) msg_format(_("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", 
721                                             "%^s tries to cast a spell, but fails."), m_name);
722
723                 return (TRUE);
724         }
725
726         /* Hex: Anti Magic Barrier */
727         if (!spell_is_inate(thrown_spell) && magic_barrier(m_idx))
728         {
729                 if (see_m) msg_format(_("È¿ËâË¡¥Ð¥ê¥¢¤¬%^s¤Î¼öʸ¤ò¤«¤­¾Ã¤·¤¿¡£", 
730                                             "Anti magic barrier cancels the spell which %^s casts."), m_name);
731                 return (TRUE);
732         }
733
734         can_remember = is_original_ap_and_seen(m_ptr);
735
736         switch (thrown_spell)
737         {
738     case 96 + 0:  MM_spell_RF4_SHRIEK(m_idx, t_idx); break; /* RF4_SHRIEK */
739     case 96 + 1:  return FALSE;  /* RF4_XXX1 */
740     case 96 + 2:  MM_spell_RF4_DISPEL(m_idx, t_idx); break; /* RF4_DISPEL */
741     case 96 + 3:  dam = MM_spell_RF4_ROCKET(y, x, m_idx, t_idx); break; /* RF4_ROCKET */
742     case 96 + 4:  dam = MM_spell_RF4_SHOOT(y, x, m_idx, t_idx); break; /* RF4_SHOOT */
743     case 96 + 5:  return FALSE; /* RF4_XXX2 */
744     case 96 + 6:  return FALSE; /* RF4_XXX3 */
745     case 96 + 7:  return FALSE; /* RF4_XXX4 */
746     case 96 + 8:  dam = MM_spell_RF4_BREATH(GF_ACID, y, x, m_idx, t_idx); break; /* RF4_BR_ACID */
747     case 96 + 9:  dam = MM_spell_RF4_BREATH(GF_ELEC, y, x, m_idx, t_idx); break; /* RF4_BR_ELEC */
748     case 96 + 10: dam = MM_spell_RF4_BREATH(GF_FIRE, y, x, m_idx, t_idx); break; /* RF4_BR_FIRE */
749     case 96 + 11: dam = MM_spell_RF4_BREATH(GF_COLD, y, x, m_idx, t_idx); break; /* RF4_BR_COLD */
750     case 96 + 12: dam = MM_spell_RF4_BREATH(GF_POIS, y, x, m_idx, t_idx); break; /* RF4_BR_POIS */
751     case 96 + 13: dam = MM_spell_RF4_BREATH(GF_NETHER, y, x, m_idx, t_idx); break; /* RF4_BR_NETH */
752     case 96 + 14: dam = MM_spell_RF4_BREATH(GF_LITE, y, x, m_idx, t_idx); break; /* RF4_BR_LITE */
753     case 96 + 15: dam = MM_spell_RF4_BREATH(GF_DARK, y, x, m_idx, t_idx); break; /* RF4_BR_DARK */
754     case 96 + 16: dam = MM_spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, t_idx); break; /* RF4_BR_CONF */
755     case 96 + 17: dam = MM_spell_RF4_BREATH(GF_SOUND, y, x, m_idx, t_idx); break; /* RF4_BR_SOUN */
756     case 96 + 18: dam = MM_spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, t_idx); break; /* RF4_BR_CHAO */
757     case 96 + 19: dam = MM_spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, t_idx); break; /* RF4_BR_DISE */
758     case 96 + 20: dam = MM_spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, t_idx); break; /* RF4_BR_NEXU */
759     case 96 + 21: dam = MM_spell_RF4_BREATH(GF_TIME, y, x, m_idx, t_idx); break; /* RF4_BR_TIME */
760     case 96 + 22: dam = MM_spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, t_idx); break; /* RF4_BR_INER */
761     case 96 + 23: dam = MM_spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, t_idx); break; /* RF4_BR_GRAV */
762     case 96 + 24: dam = MM_spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, t_idx); break; /* RF4_BR_SHAR */
763     case 96 + 25: dam = MM_spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, t_idx); break; /* RF4_BR_PLAS */
764     case 96 + 26: dam = MM_spell_RF4_BREATH(GF_FORCE, y, x, m_idx, t_idx); break; /* RF4_BR_WALL */
765     case 96 + 27: dam = MM_spell_RF4_BREATH(GF_MANA, y, x, m_idx, t_idx); break; /* RF4_BR_MANA */
766
767     /* RF4_BA_NUKE */
768     case 96 + 28:
769         if (known)
770         {
771             if (see_either)
772             {
773                 disturb(1, 1);
774
775                 if (blind)
776                 {
777                     msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
778                 }
779                 else
780                 {
781                     msg_format(_("%^s¤¬%s¤ËÊü¼Íǽµå¤òÊü¤Ã¤¿¡£", "%^s casts a ball of radiation at %s."), m_name, t_name);
782                 }
783             }
784             else
785             {
786                 mon_fight = TRUE;
787             }
788         }
789
790         dam = (rlev + damroll(10, 6));
791         breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, MONSTER_TO_MONSTER);
792
793         break;
794
795     case 96 + 29: dam = MM_spell_RF4_BREATH(GF_NUKE, y, x, m_idx, t_idx); break; /* RF4_BR_NUKE */
796     
797     /* RF4_BA_CHAO */
798     case 96 + 30:
799         if (known)
800         {
801             if (see_either)
802             {
803                 disturb(1, 1);
804
805                 if (blind)
806                 {
807                     msg_format(_("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles frighteningly."), m_name);
808                 }
809                 else
810                 {
811                     msg_format(_("%^s¤¬%s¤Ë½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", "%^s invokes raw Logrus upon %s."), m_name, t_name);
812                 }
813             }
814             else
815             {
816                 mon_fight = TRUE;
817             }
818         }
819
820         dam = (rlev * 2) + damroll(10, 10);
821         breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, MONSTER_TO_MONSTER);
822         break;
823
824     case 96 + 31: dam = MM_spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, t_idx); break; /* RF4_BR_DISI */
825
826         /* RF5_BA_ACID */
827         case 128+0:
828                 if (known)
829                 {
830                         if (see_either)
831                         {
832                                 disturb(1, 1);
833
834                                 if (blind)
835                                 {
836                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
837                                 }
838                                 else
839                                 {
840                                         msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
841                                                          "%^s casts an acid ball at %s."), m_name, t_name);
842                                 }
843                         }
844                         else
845                         {
846                                 mon_fight = TRUE;
847                         }
848                 }
849
850                 if (r_ptr->flags2 & RF2_POWERFUL)
851                 {
852                         rad = 4;
853                         dam = (rlev * 4) + 50 + damroll(10, 10);
854                 }
855                 else
856                 {
857                         rad = 2;
858                         dam = (randint1(rlev * 3) + 15);
859                 }
860         breath(y, x, m_idx,GF_ACID, dam, rad, FALSE, MS_BALL_ACID, MONSTER_TO_MONSTER);
861                 break;
862
863         /* RF5_BA_ELEC */
864         case 128+1:
865                 if (known)
866                 {
867                         if (see_either)
868                         {
869                                 disturb(1, 1);
870
871                                 if (blind)
872                                 {
873                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
874                                 }
875                                 else
876                                 {
877                                         msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a lightning ball at %s."), m_name, t_name);
878                                 }
879                         }
880                         else
881                         {
882                                 mon_fight = TRUE;
883                         }
884                 }
885
886                 if (r_ptr->flags2 & RF2_POWERFUL)
887                 {
888                         rad = 4;
889                         dam = (rlev * 4) + 50 + damroll(10, 10);
890                 }
891                 else
892                 {
893                         rad = 2;
894                         dam = (randint1(rlev * 3 / 2) + 8);
895                 }
896         breath(y, x, m_idx,GF_ELEC, dam, rad, FALSE, MS_BALL_ELEC, MONSTER_TO_MONSTER);
897                 break;
898
899         /* RF5_BA_FIRE */
900         case 128+2:
901                 if (known)
902                 {
903                         if (see_either)
904                         {
905                                 disturb(1, 1);
906
907                                 if (m_ptr->r_idx == MON_ROLENTO)
908                                 {
909                                         if (blind)
910                                                 msg_format(_("%^s¤¬²¿¤«¤òÅꤲ¤¿¡£", "%^s throws something."), m_name);
911                                         else
912                                                 msg_format(_("%^s¤¬%^s¤Ë¸þ¤«¤Ã¤Æ¼êÜØÃƤòÅꤲ¤¿¡£", "%^s throws a hand grenade."), m_name, t_name);
913                                 }
914                                 else
915                                 {
916                                         if (blind)
917                                         {
918                                                 msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
919                                         }
920                                         else
921                                         {
922                                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£",
923                                                                  "%^s casts a fire ball at %s."), m_name, t_name);
924                                         }
925                                 }
926                         }
927                         else
928                         {
929                                 mon_fight = TRUE;
930                         }
931                 }
932
933                 if (r_ptr->flags2 & RF2_POWERFUL)
934                 {
935                         rad = 4;
936                         dam = (rlev * 4) + 50 + damroll(10, 10);
937                 }
938                 else
939                 {
940                         rad = 2;
941                         dam = (randint1(rlev * 7 / 2) + 10);
942                 }
943         breath(y, x, m_idx,GF_FIRE, dam, rad, FALSE, MS_BALL_FIRE, MONSTER_TO_MONSTER);
944                 break;
945
946         /* RF5_BA_COLD */
947         case 128+3:
948                 if (known)
949                 {
950                         if (see_either)
951                         {
952                                 disturb(1, 1);
953
954                                 if (blind)
955                                 {
956                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
957                                 }
958                                 else
959                                 {
960                                         msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
961                                                          "%^s casts a frost ball at %s."), m_name, t_name);
962                                 }
963                         }
964                         else
965                         {
966                                 mon_fight = TRUE;
967                         }
968                 }
969
970                 if (r_ptr->flags2 & RF2_POWERFUL)
971                 {
972                         rad = 4;
973                         dam = (rlev * 4) + 50 + damroll(10, 10);
974                 }
975                 else
976                 {
977                         rad = 2;
978                         dam = (randint1(rlev * 3 / 2) + 10);
979                 }
980         breath(y, x, m_idx,GF_COLD, dam, rad, FALSE, MS_BALL_COLD, MONSTER_TO_MONSTER);
981                 break;
982
983         /* RF5_BA_POIS */
984         case 128+4:
985                 if (known)
986                 {
987                         if (see_either)
988                         {
989                                 disturb(1, 1);
990
991                                 if (blind)
992                                 {
993                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
994                                 }
995                                 else
996                                 {
997                                         msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
998                                                          "%^s casts a stinking cloud at %s."), m_name, t_name);
999                                 }
1000                         }
1001                         else
1002                         {
1003                                 mon_fight = TRUE;
1004                         }
1005                 }
1006
1007                 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1008         breath(y, x, m_idx,GF_POIS, dam, 2, FALSE, MS_BALL_POIS, MONSTER_TO_MONSTER);
1009
1010                 break;
1011
1012         /* RF5_BA_NETH */
1013         case 128+5:
1014                 if (known)
1015                 {
1016                         if (see_either)
1017                         {
1018                                 disturb(1, 1);
1019
1020                                 if (blind)
1021                                 {
1022                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
1023                                 }
1024                                 else
1025                                 {
1026                                         msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a nether ball at %s."), m_name, t_name);
1027                                 }
1028                         }
1029                         else
1030                         {
1031                                 mon_fight = TRUE;
1032                         }
1033                 }
1034
1035                 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
1036         breath(y, x, m_idx,GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, MONSTER_TO_MONSTER);
1037
1038                 break;
1039
1040         /* RF5_BA_WATE */
1041         case 128+6:
1042                 if (known)
1043                 {
1044                         if (see_either)
1045                         {
1046                                 disturb(1, 1);
1047
1048                                 if (blind)
1049                                 {
1050                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
1051                                 }
1052                                 else
1053                                 {
1054                                         msg_format(_("%^s¤¬%s¤ËÂФ·¤Æή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", "%^s gestures fluidly at %s."), m_name, t_name);
1055
1056                                         msg_format(_("%^s¤Ï±²´¬¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£", "%^s is engulfed in a whirlpool."), t_name);
1057                                 }
1058                         }
1059                         else
1060                         {
1061                                 mon_fight = TRUE;
1062                         }
1063                 }
1064
1065                 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
1066         breath(y, x, m_idx,GF_WATER, dam, 4, FALSE, MS_BALL_WATER, MONSTER_TO_MONSTER);
1067
1068                 break;
1069
1070         /* RF5_BA_MANA */
1071         case 128+7:
1072                 if (known)
1073                 {
1074                         if (see_either)
1075                         {
1076                                 disturb(1, 1);
1077
1078                                 if (blind)
1079                                 {
1080                                         msg_format(_("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles powerfully."), m_name);
1081                                 }
1082                                 else
1083                                 {
1084                                         msg_format(_("%^s¤¬%s¤ËÂФ·¤ÆËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", "%^s invokes a mana storm upon %s."), m_name, t_name);
1085                                 }
1086                         }
1087                         else
1088                         {
1089                                 mon_fight = TRUE;
1090                         }
1091                 }
1092
1093                 dam = (rlev * 4) + 50 + damroll(10, 10);
1094         breath(y, x, m_idx,GF_MANA, dam, 4, FALSE, MS_BALL_MANA, MONSTER_TO_MONSTER);
1095
1096                 break;
1097
1098         /* RF5_BA_DARK */
1099         case 128+8:
1100                 if (known)
1101                 {
1102                         if (see_either)
1103                         {
1104                                 disturb(1, 1);
1105
1106                                 if (blind)
1107                                 {
1108                                         msg_format(_("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles powerfully."), m_name);
1109                                 }
1110                                 else
1111                                 {
1112                                         msg_format(_("%^s¤¬%s¤ËÂФ·¤Æ°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", "%^s invokes a darkness storm upon %s."), m_name, t_name);
1113                                 }
1114                         }
1115                         else
1116                         {
1117                                 mon_fight = TRUE;
1118                         }
1119                 }
1120
1121                 dam = (rlev * 4) + 50 + damroll(10, 10);
1122         breath(y, x, m_idx,GF_DARK, dam, 4, FALSE, MS_BALL_DARK, MONSTER_TO_MONSTER);
1123
1124                 break;
1125
1126         /* RF5_DRAIN_MANA */
1127         case 128+9:
1128                 if (see_m)
1129                 {
1130                         /* Basic message */
1131                         msg_format(_("%^s¤ÏÀº¿À¥¨¥Í¥ë¥®¡¼¤ò%s¤«¤éµÛ¤¤¤È¤Ã¤¿¡£", "%^s draws psychic energy from %s."), m_name, t_name);
1132                 }
1133
1134                 dam = ((randint1(rlev) / 2) + 1);
1135         breath(y, x, m_idx,GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, MONSTER_TO_MONSTER);
1136
1137                 break;
1138
1139         /* RF5_MIND_BLAST */
1140         case 128+10:
1141                 if (see_m)
1142                 {
1143                         msg_format(_("%^s¤Ï%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", "%^s gazes intently at %s."), m_name, t_name);
1144                 }
1145
1146                 dam = damroll(7, 7);
1147         breath(y, x, m_idx,GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, MONSTER_TO_MONSTER);
1148
1149                 break;
1150
1151         /* RF5_BRAIN_SMASH */
1152         case 128+11:
1153                 if (see_m)
1154                 {
1155                         msg_format(_("%^s¤Ï%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", "%^s gazes intently at %s."), m_name, t_name);
1156                 }
1157
1158                 dam = damroll(12, 12);
1159         breath(y, x, m_idx,GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, MONSTER_TO_MONSTER);
1160
1161                 break;
1162
1163         /* RF5_CAUSE_1 */
1164         case 128+12:
1165                 if (known)
1166                 {
1167                         if (see_m)
1168                         {
1169                                 msg_format(_("%^s¤Ï%s¤ò»Ø¤µ¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", "%^s points at %s and curses."), m_name, t_name);
1170                         }
1171                         else
1172                         {
1173                                 mon_fight = TRUE;
1174                         }
1175                 }
1176
1177                 dam = damroll(3, 8);
1178         breath(y, x, m_idx,GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, MONSTER_TO_MONSTER);
1179
1180                 break;
1181
1182         /* RF5_CAUSE_2 */
1183         case 128+13:
1184                 if (known)
1185                 {
1186                         if (see_m)
1187                         {
1188                                 msg_format(_("%^s¤Ï%s¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", 
1189                                                  "%^s points at %s and curses horribly."), m_name, t_name);
1190                         }
1191                         else
1192                         {
1193                                 mon_fight = TRUE;
1194                         }
1195                 }
1196
1197                 dam = damroll(8, 8);
1198         breath(y, x, m_idx,GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, MONSTER_TO_MONSTER);
1199
1200                 break;
1201
1202         /* RF5_CAUSE_3 */
1203         case 128+14:
1204                 if (known)
1205                 {
1206                         if (see_m)
1207                         {
1208                                 msg_format(_("%^s¤Ï%s¤ò»Ø¤µ¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", 
1209                                                  "%^s points at %s, incanting terribly!"), m_name, t_name);
1210                         }
1211                         else
1212                         {
1213                                 mon_fight = TRUE;
1214                         }
1215                 }
1216
1217                 dam = damroll(10, 15);
1218         breath(y, x, m_idx,GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, MONSTER_TO_MONSTER);
1219
1220                 break;
1221
1222         /* RF5_CAUSE_4 */
1223         case 128+15:
1224                 if (known)
1225                 {
1226                         if (see_m)
1227                         {
1228                                 msg_format(_("%^s¤¬%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", 
1229                                                  "%^s points at %s, screaming the word, 'DIE!'"), m_name, t_name);
1230                         }
1231                         else
1232                         {
1233                                 mon_fight = TRUE;
1234                         }
1235                 }
1236
1237                 dam = damroll(15, 15);
1238         breath(y, x, m_idx,GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, MONSTER_TO_MONSTER);
1239
1240                 break;
1241
1242         /* RF5_BO_ACID */
1243         case 128+16:
1244                 if (known)
1245                 {
1246                         if (see_either)
1247                         {
1248                                 msg_format(_("%s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts an acid bolt at %s."), m_name, t_name);
1249                         }
1250                         else
1251                         {
1252                                 mon_fight = TRUE;
1253                         }
1254                 }
1255
1256                 dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1257         bolt(m_idx, y, x, GF_ACID, dam, MS_BOLT_ACID, MONSTER_TO_MONSTER);
1258
1259                 break;
1260
1261         /* RF5_BO_ELEC */
1262         case 128+17:
1263                 if (known)
1264                 {
1265                         if (see_either)
1266                         {
1267                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a lightning bolt at %s."), m_name, t_name);
1268                         }
1269                         else
1270                         {
1271                                 mon_fight = TRUE;
1272                         }
1273                 }
1274
1275                 dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1276         bolt(m_idx, y, x, GF_ELEC, dam, MS_BOLT_ELEC, MONSTER_TO_MONSTER);
1277
1278                 break;
1279
1280         /* RF5_BO_FIRE */
1281         case 128+18:
1282                 if (known)
1283                 {
1284                         if (see_either)
1285                         {
1286                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a fire bolt at %s."), m_name, t_name);
1287                         }
1288                         else
1289                         {
1290                                 mon_fight = TRUE;
1291                         }
1292                 }
1293
1294                 dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1295         bolt(m_idx, y, x, GF_FIRE, dam, MS_BOLT_FIRE, MONSTER_TO_MONSTER);
1296
1297                 break;
1298
1299         /* RF5_BO_COLD */
1300         case 128+19:
1301                 if (known)
1302                 {
1303                         if (see_either)
1304                         {
1305                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a frost bolt at %s."), m_name, t_name);
1306                         }
1307                         else
1308                         {
1309                                 mon_fight = TRUE;
1310                         }
1311                 }
1312
1313                 dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
1314         bolt(m_idx, y, x, GF_COLD, dam, MS_BOLT_COLD, MONSTER_TO_MONSTER);
1315
1316                 break;
1317
1318         /* RF5_BA_LITE */
1319         case 128+20:
1320                 if (known)
1321                 {
1322                         if (see_either)
1323                         {
1324                                 disturb(1, 1);
1325
1326                                 if (blind)
1327                                 {
1328                                         msg_format(_("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles powerfully."), m_name);
1329                                 }
1330                                 else
1331                                 {
1332                                         msg_format(_("%^s¤¬%s¤ËÂФ·¤Æ¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", 
1333                                                          "%^s invokes a starburst upon %s."), m_name, t_name);
1334                                 }
1335                         }
1336                         else
1337                         {
1338                                 mon_fight = TRUE;
1339                         }
1340                 }
1341
1342                 dam = (rlev * 4) + 50 + damroll(10, 10);
1343         breath(y, x, m_idx,GF_LITE, dam, 4, FALSE, MS_STARBURST, MONSTER_TO_MONSTER);
1344
1345                 break;
1346
1347         /* RF5_BO_NETH */
1348         case 128+21:
1349                 if (known)
1350                 {
1351                         if (see_either)
1352                         {
1353                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£",
1354                                                  "%^s casts a nether bolt at %s."), m_name, t_name);
1355                         }
1356                         else
1357                         {
1358                                 mon_fight = TRUE;
1359                         }
1360                 }
1361
1362                 dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
1363         bolt(m_idx, y, x, GF_NETHER, dam, MS_BOLT_NETHER, MONSTER_TO_MONSTER);
1364
1365                 break;
1366
1367         /* RF5_BO_WATE */
1368         case 128+22:
1369                 if (known)
1370                 {
1371                         if (see_either)
1372                         {
1373                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
1374                                                  "%^s casts a water bolt at %s."), m_name, t_name);
1375                         }
1376                         else
1377                         {
1378                                 mon_fight = TRUE;
1379                         }
1380                 }
1381
1382                 dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
1383         bolt(m_idx, y, x, GF_WATER, dam, MS_BOLT_WATER, MONSTER_TO_MONSTER);
1384
1385                 break;
1386
1387         /* RF5_BO_MANA */
1388         case 128+23:
1389                 if (known)
1390                 {
1391                         if (see_either)
1392                         {
1393                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤ÆËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
1394                                                  "%^s casts a mana bolt at %s."), m_name, t_name);
1395                         }
1396                         else
1397                         {
1398                                 mon_fight = TRUE;
1399                         }
1400                 }
1401
1402                 dam = randint1(rlev * 7 / 2) + 50;
1403         bolt(m_idx, y, x, GF_MANA, dam, MS_BOLT_MANA, MONSTER_TO_MONSTER);
1404
1405                 break;
1406
1407         /* RF5_BO_PLAS */
1408         case 128+24:
1409                 if (known)
1410                 {
1411                         if (see_either)
1412                         {
1413                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
1414                                                  "%^s casts a plasma bolt at %s."), m_name, t_name);
1415                         }
1416                         else
1417                         {
1418                                 mon_fight = TRUE;
1419                         }
1420                 }
1421
1422                 dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
1423         bolt(m_idx, y, x, GF_PLASMA, dam, MS_BOLT_PLASMA, MONSTER_TO_MONSTER);
1424
1425                 break;
1426
1427         /* RF5_BO_ICEE */
1428         case 128+25:
1429                 if (known)
1430                 {
1431                         if (see_either)
1432                         {
1433                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£",
1434                                                  "%^s casts an ice bolt at %s."), m_name, t_name);
1435                         }
1436                         else
1437                         {
1438                                 mon_fight = TRUE;
1439                         }
1440                 }
1441
1442                 dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
1443         bolt(m_idx, y, x, GF_ICE, dam, MS_BOLT_ICE, MONSTER_TO_MONSTER);
1444
1445                 break;
1446
1447         /* RF5_MISSILE */
1448         case 128+26:
1449                 if (known)
1450                 {
1451                         if (see_either)
1452                         {
1453                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", 
1454                                                  "%^s casts a magic missile at %s."), m_name, t_name);
1455                         }
1456                         else
1457                         {
1458                                 mon_fight = TRUE;
1459                         }
1460                 }
1461
1462                 dam = damroll(2, 6) + (rlev / 3);
1463         bolt(m_idx, y, x, GF_MISSILE, dam, MS_MAGIC_MISSILE, MONSTER_TO_MONSTER);
1464
1465                 break;
1466
1467         /* RF5_SCARE */
1468         case 128+27:
1469                 if (known)
1470                 {
1471                         if (see_either)
1472                         {
1473                                 msg_format(_("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£",
1474                                                  "%^s casts a fearful illusion in front of %s."), m_name, t_name);
1475                         }
1476                         else
1477                         {
1478                                 mon_fight = TRUE;
1479                         }
1480                 }
1481
1482                 if (tr_ptr->flags3 & RF3_NO_FEAR)
1483                 {
1484                         if (see_t) msg_format(_("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£", 
1485                                                     "%^s refuses to be frightened."), t_name);
1486
1487                 }
1488                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
1489                 {
1490                         if (see_t) msg_format(_("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£", 
1491                                                     "%^s refuses to be frightened."), t_name);
1492                 }
1493                 else
1494                 {
1495                         if (set_monster_monfear(t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4)) fear = TRUE;
1496                 }
1497
1498                 wake_up = TRUE;
1499
1500                 break;
1501
1502         /* RF5_BLIND */
1503         case 128+28:
1504                 if (known)
1505                 {
1506                         if (see_either)
1507                         {
1508                                 _(msg_format("%s¤Ï¼öʸ¤ò¾§¤¨¤Æ%s¤ÎÌܤò¾Æ¤­ÉÕ¤«¤»¤¿¡£", m_name, t_name),
1509                                   msg_format("%^s casts a spell, burning %s%s eyes.", m_name, t_name,
1510                                                  (streq(t_name, "it") ? "s" : "'s")));
1511
1512                         }
1513                         else
1514                         {
1515                                 mon_fight = TRUE;
1516                         }
1517                 }
1518
1519                 /* Simulate blindness with confusion */
1520                 if (tr_ptr->flags3 & RF3_NO_CONF)
1521                 {
1522                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
1523                 }
1524                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
1525                 {
1526                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
1527                 }
1528                 else
1529                 {
1530                         if (see_t) msg_format(_("%^s¤ÏÌܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤¿¡ª ", "%^s is blinded!"), t_name);
1531
1532                         (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
1533                 }
1534
1535                 wake_up = TRUE;
1536
1537                 break;
1538
1539         /* RF5_CONF */
1540         case 128+29:
1541                 if (known)
1542                 {
1543                         if (see_either)
1544                         {
1545                                 msg_format(_("%^s¤¬%s¤ÎÁ°¤Ë¸¸ÏÇŪ¤Ê¸¸¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£",
1546                                                  "%^s casts a mesmerizing illusion in front of %s."), m_name, t_name);
1547                         }
1548                         else
1549                         {
1550                                 mon_fight = TRUE;
1551                         }
1552                 }
1553
1554                 if (tr_ptr->flags3 & RF3_NO_CONF)
1555                 {
1556                         if (see_t) msg_format(_("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£",
1557                                                     "%^s disbelieves the feeble spell."), t_name);
1558                 }
1559                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
1560                 {
1561                         if (see_t) msg_format(_("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£",
1562                                                     "%^s disbelieves the feeble spell."), t_name);
1563                 }
1564                 else
1565                 {
1566                         if (see_t) msg_format(_("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£",
1567                                                     "%^s seems confused."), t_name);
1568
1569                         (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
1570                 }
1571
1572                 wake_up = TRUE;
1573
1574                 break;
1575
1576         /* RF5_SLOW */
1577         case 128+30:
1578                 if (known)
1579                 {
1580                         if (see_either)
1581                         {
1582                                 _(msg_format("%s¤¬%s¤Î¶ÚÆù¤«¤éÎϤòµÛ¤¤¤È¤Ã¤¿¡£", m_name, t_name),
1583                                   msg_format("%^s drains power from %s%s muscles.", m_name, t_name,
1584                                            (streq(t_name, "it") ? "s" : "'s")));
1585                         }
1586                         else
1587                         {
1588                                 mon_fight = TRUE;
1589                         }
1590                 }
1591
1592                 if (tr_ptr->flags1 & RF1_UNIQUE)
1593                 {
1594                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",
1595                                                     "%^s is unaffected."), t_name);
1596                 }
1597                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
1598                 {
1599                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",
1600                                                     "%^s is unaffected."), t_name);
1601                 }
1602                 else
1603                 {
1604                         if (set_monster_slow(t_idx, MON_SLOW(t_ptr) + 50))
1605                         {
1606                                 if (see_t) msg_format(_("%s¤ÎÆ°¤­¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£",
1607                                                             "%^s starts moving slower."), t_name);
1608                         }
1609                 }
1610
1611                 wake_up = TRUE;
1612
1613                 break;
1614
1615         /* RF5_HOLD */
1616         case 128+31:
1617                 if (known)
1618                 {
1619                         if (see_either)
1620                         {
1621                                 msg_format(_("%^s¤Ï%s¤ò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡£", "%^s stares intently at %s."), m_name, t_name);
1622                         }
1623                         else
1624                         {
1625                                 mon_fight = TRUE;
1626                         }
1627                 }
1628
1629                 if ((tr_ptr->flags1 & RF1_UNIQUE) ||
1630                     (tr_ptr->flags3 & RF3_NO_STUN))
1631                 {
1632                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
1633                 }
1634                 else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
1635                 {
1636                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
1637                 }
1638                 else
1639                 {
1640                         if (see_t) msg_format(_("%^s¤ÏËãá㤷¤¿¡ª", "%^s is paralyzed!"), t_name);
1641
1642                         (void)set_monster_stunned(t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
1643                 }
1644
1645                 wake_up = TRUE;
1646
1647                 break;
1648
1649
1650         /* RF6_HASTE */
1651         case 160+0:
1652                 if (known)
1653                 {
1654                         if (see_m)
1655                         {
1656                                 msg_format(_("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", "%^s concentrates on %s body."), m_name);
1657                         }
1658                         else
1659                         {
1660                                 mon_fight = TRUE;
1661                         }
1662                 }
1663
1664                 /* Allow quick speed increases to base+10 */
1665                 if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
1666                 {
1667                         if (see_m) msg_format(_("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", "%^s starts moving faster."), m_name);
1668                 }
1669                 break;
1670
1671         /* RF6_HAND_DOOM */
1672         case 160+1:
1673                 if (known)
1674                 {
1675                         if (see_m)
1676                         {
1677                                 msg_format(_("%^s¤¬%s¤Ë<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", "%^s invokes the Hand of Doom upon %s!"), m_name, t_name);
1678                         }
1679                         else
1680                         {
1681                                 mon_fight = TRUE;
1682                         }
1683                 }
1684
1685                 dam = 20; /* Dummy power */
1686         breath(y, x, m_idx,GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_MONSTER);
1687
1688                 break;
1689
1690         /* RF6_HEAL */
1691         case 160+2:
1692                 if (known)
1693                 {
1694                         if (see_m)
1695                         {
1696                                 msg_format(_("%^s¤Ï¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£", "%^s concentrates on %s wounds."), m_name);
1697                         }
1698                         else
1699                         {
1700                                 mon_fight = TRUE;
1701                         }
1702                 }
1703
1704                 /* Heal some */
1705                 m_ptr->hp += (rlev * 6);
1706
1707                 /* Fully healed */
1708                 if (m_ptr->hp >= m_ptr->maxhp)
1709                 {
1710                         /* Fully healed */
1711                         m_ptr->hp = m_ptr->maxhp;
1712
1713                         if (known)
1714                         {
1715                                 if (see_m)
1716                                 {
1717                                         msg_format(_("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", "%^s looks completely healed!"), m_name);
1718                                 }
1719                                 else
1720                                 {
1721                                         mon_fight = TRUE;
1722                                 }
1723                         }
1724                 }
1725
1726                 /* Partially healed */
1727                 else if (known)
1728                 {
1729                         if (see_m)
1730                         {
1731                                 msg_format(_("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", "%^s looks healthier."), m_name);
1732                         }
1733                         else
1734                         {
1735                                 mon_fight = TRUE;
1736                         }
1737                 }
1738
1739                 /* Redraw (later) if needed */
1740                 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1741                 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1742
1743                 /* Cancel fear */
1744                 if (MON_MONFEAR(m_ptr))
1745                 {
1746                         /* Cancel fear */
1747                         (void)set_monster_monfear(m_idx, 0);
1748
1749                         /* Message */
1750                         if (see_m) msg_format(_("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", "%^s recovers %s courage."), m_name);
1751                 }
1752
1753                 break;
1754
1755         /* RF6_INVULNER */
1756         case 160+3:
1757                 if (known)
1758                 {
1759                         if (see_m)
1760                         {
1761                                 disturb(1, 1);
1762                                 msg_format(_("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a Globe of Invulnerability."), m_name);
1763                         }
1764                         else
1765                         {
1766                                 mon_fight = TRUE;
1767                         }
1768                 }
1769
1770                 if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
1771                 break;
1772
1773         /* RF6_BLINK */
1774         case 160+4:
1775                 if (teleport_barrier(m_idx))
1776                 {
1777                         if (see_m)
1778                         {
1779                                 msg_format(_("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", "Magic barrier obstructs teleporting of %^s."), m_name);
1780                         }
1781                 }
1782                 else
1783                 {
1784                         if (see_m)
1785                         {
1786                                 msg_format(_("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", "%^s blinks away."), m_name);
1787                         }
1788                         teleport_away(m_idx, 10, 0L);
1789                 }
1790                 break;
1791
1792         /* RF6_TPORT */
1793         case 160+5:
1794                 if (teleport_barrier(m_idx))
1795                 {
1796                         if (see_m)
1797                         {
1798                                 msg_format(_("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", "Magic barrier obstructs teleporting of %^s."), m_name);
1799                         }
1800                 }
1801                 else
1802                 {
1803                         if (see_m)
1804                         {
1805                                 msg_format(_("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", "%^s teleports away."), m_name);
1806                         }
1807                         teleport_away_followable(m_idx);
1808                 }
1809                 break;
1810
1811         /* RF6_WORLD */
1812         case 160+6:
1813 #if 0
1814                 int who = 0;
1815                 if(m_ptr->r_idx = MON_DIO) who == 1;
1816                 else if(m_ptr->r_idx = MON_WONG) who == 3;
1817                 dam = who;
1818                 if(!process_the_world(randint1(2)+2, who, player_has_los_bold(m_ptr->fy, m_ptr->fx))) return (FALSE);
1819 #endif
1820                 return FALSE;
1821
1822         /* RF6_SPECIAL */
1823         case 160+7:
1824                 switch (m_ptr->r_idx)
1825                 {
1826                 case MON_OHMU:
1827                         /* Moved to process_monster(), like multiplication */
1828                         return FALSE;
1829
1830                 case MON_ROLENTO:
1831                         if (known)
1832                         {
1833                                 if (see_either)
1834                                 {
1835                                         disturb(1, 1);
1836
1837                                         msg_format(_("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."), m_name);
1838                                 }
1839                                 else
1840                                 {
1841                                         mon_fight = TRUE;
1842                                 }
1843                         }
1844
1845                         {
1846                                 int num = 1 + randint1(3);
1847                                 for (k = 0; k < num; k++)
1848                                 {
1849                                         count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, 0);
1850                                 }
1851                         }
1852
1853                         if (known && !see_t && count)
1854                         {
1855                                 mon_fight = TRUE;
1856                         }
1857                         break;
1858
1859                 default:
1860                         if (r_ptr->d_char == 'B')
1861                         {
1862                                 if (one_in_(3))
1863                                 {
1864                                         if (see_m)
1865                                         {
1866                                                 msg_format(_("%^s¤ÏÆÍÁ³µÞ¾å¾º¤·¤Æ»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"), m_name);
1867                                         }
1868                                         teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
1869                                         p_ptr->update |= (PU_MONSTERS);
1870                                 }
1871                                 else
1872                                 {
1873                                         if (known)
1874                                         {
1875                                                 if (see_either)
1876                                                 {
1877                                                         msg_format(_("%^s¤¬%s¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", "%^s holds %s, and drops from the sky."), m_name, t_name);
1878                                                 }
1879                                                 else
1880                                                 {
1881                                                         mon_fight = TRUE;
1882                                                 }
1883                                         }
1884
1885                                         dam = damroll(4, 8);
1886
1887                                         if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
1888                                         else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
1889
1890                                         sound(SOUND_FALL);
1891
1892                                         if (tr_ptr->flags7 & RF7_CAN_FLY)
1893                                         {
1894                                                 if (see_t) msg_format(_("%^s¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "%^s floats gently down to the ground."), t_name);
1895                                         }
1896                                         else
1897                                         {
1898                                                 if (see_t) msg_format(_("%^s¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£", "%^s crashed into the ground."), t_name);
1899
1900                                                 dam += damroll(6, 8);
1901                                         }
1902
1903                                         if (p_ptr->riding == t_idx)
1904                                         {
1905                                                 int get_damage = 0;
1906
1907                                                 /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
1908                                                    -- henkma
1909                                                  */
1910                                                 get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
1911                                                 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
1912                                                 {
1913                                                         char m_name_self[80];
1914
1915                                                         /* hisself */
1916                                                         monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
1917
1918                                                         _(msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name),
1919                                                           msg_format("The attack of %s has wounded %s!", m_name, m_name_self));
1920
1921                                                         project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
1922                                                         set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
1923                                                 }
1924                                         }
1925
1926                                         mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
1927                                 }
1928                                 break;
1929                         }
1930
1931                         /* Something is wrong */
1932                         else return FALSE;
1933                 }
1934
1935                 /* done */
1936                 break;
1937
1938         /* RF6_TELE_TO */
1939         case 160+8:
1940                 if (known)
1941                 {
1942                         if (see_either)
1943                         {
1944                                 msg_format(_("%^s¤¬%s¤ò°ú¤­Ìᤷ¤¿¡£", "%^s commands %s to return."), m_name, t_name);
1945                         }
1946                         else
1947                         {
1948                                 mon_fight = TRUE;
1949                         }
1950                 }
1951
1952                 if (tr_ptr->flagsr & RFR_RES_TELE)
1953                 {
1954                         if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
1955                         {
1956                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1957                                 if (see_t)
1958                                 {
1959                                         msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
1960                                 }
1961
1962                                 resists_tele = TRUE;
1963                         }
1964                         else if (tr_ptr->level > randint1(100))
1965                         {
1966                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1967                                 if (see_t)
1968                                 {
1969                                         msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
1970                                 }
1971
1972                                 resists_tele = TRUE;
1973                         }
1974                 }
1975
1976                 if (!resists_tele)
1977                 {
1978                         if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
1979                         else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
1980                 }
1981
1982                 wake_up = TRUE;
1983                 break;
1984
1985         /* RF6_TELE_AWAY */
1986         case 160+9:
1987                 if (known)
1988                 {
1989                         if (see_either)
1990                         {
1991                                 msg_format(_("%^s¤Ï%s¤ò¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤¿¡£", "%^s teleports %s away."), m_name, t_name);
1992                         }
1993                         else
1994                         {
1995                                 mon_fight = TRUE;
1996                         }
1997                 }
1998
1999                 if (tr_ptr->flagsr & RFR_RES_TELE)
2000                 {
2001                         if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
2002                         {
2003                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
2004                                 if (see_t)
2005                                 {
2006                                         msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
2007                                 }
2008
2009                                 resists_tele = TRUE;
2010                         }
2011                         else if (tr_ptr->level > randint1(100))
2012                         {
2013                                 if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
2014                                 if (see_t)
2015                                 {
2016                                         msg_format(_("%^s¤ÏÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
2017                                 }
2018
2019                                 resists_tele = TRUE;
2020                         }
2021                 }
2022
2023                 if (!resists_tele)
2024                 {
2025                         if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
2026                         else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
2027                 }
2028
2029                 wake_up = TRUE;
2030                 break;
2031
2032         /* RF6_TELE_LEVEL */
2033         case 160+10:
2034                 if (known)
2035                 {
2036                         if (see_either)
2037                         {
2038                                 msg_format(_("%^s¤¬%s¤Î­¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at %s's feet."), m_name, t_name);
2039                         }
2040                         else
2041                         {
2042                                 mon_fight = TRUE;
2043                         }
2044                 }
2045
2046                 if (tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE))
2047                 {
2048                         if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
2049                 }
2050                 else if ((tr_ptr->flags1 & RF1_QUESTOR) ||
2051                             (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10))
2052                 {
2053                         if (see_t) msg_format(_("%^s¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "%^s resist the effects!"), t_name);
2054                 }
2055                 else teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
2056
2057                 wake_up = TRUE;
2058                 break;
2059
2060         /* RF6_PSY_SPEAR */
2061         case 160+11:
2062                 if (known)
2063                 {
2064                         if (see_either)
2065                         {
2066                                 msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", "%^s throw a Psycho-spear at %s."), m_name, t_name);
2067                         }
2068                         else
2069                         {
2070                                 mon_fight = TRUE;
2071                         }
2072                 }
2073
2074                 dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 180) : (randint1(rlev * 3 / 2) + 120);
2075                 beam(m_idx, y, x, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, MONSTER_TO_MONSTER);
2076                 break;
2077
2078         /* RF6_DARKNESS */
2079         case 160+12:
2080                 if (known)
2081                 {
2082                         if (see_m)
2083                         {
2084                                 if (can_use_lite_area)
2085                                 {
2086                                         msg_format(_("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", "%^s cast a spell to light up."), m_name);
2087                                 }
2088                                 else
2089                                 {
2090                                         msg_format(_("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", "%^s gestures in shadow."), m_name);
2091                                 }
2092
2093                                 if (see_t)
2094                                 {
2095                                         if (can_use_lite_area)
2096                                         {
2097                                                 msg_format(_("%^s¤ÏÇò¤¤¸÷¤ËÊñ¤Þ¤ì¤¿¡£", "%^s is surrounded by a white light."), t_name);
2098                                         }
2099                                         else
2100                                         {
2101                                                 msg_format(_("%^s¤Ï°Å°Ç¤ËÊñ¤Þ¤ì¤¿¡£", "%^s is surrounded by darkness."), t_name);
2102                                         }
2103                                 }
2104                         }
2105                         else
2106                         {
2107                                 mon_fight = TRUE;
2108                         }
2109                 }
2110
2111                 if (can_use_lite_area)
2112                 {
2113                         (void)project(m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
2114                         lite_room(y, x);
2115                 }
2116                 else
2117                 {
2118                         (void)project(m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
2119                         unlite_room(y, x);
2120                 }
2121
2122                 break;
2123
2124         /* RF6_TRAPS */
2125         case 160+13:
2126 #if 0
2127                 if (known)
2128                 {
2129                         if (see_m)
2130                         {
2131                                 msg_format(_("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", "%^s casts a spell and cackles evilly."), m_name);
2132                         }
2133                         else
2134                         {
2135                                 msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
2136                         }
2137                 }
2138
2139                 trap_creation(y, x);
2140
2141                 break;
2142 #else
2143                 /* Not implemented */
2144                 return FALSE;
2145 #endif
2146
2147         /* RF6_FORGET */
2148         case 160+14:
2149                 /* Not implemented */
2150                 return FALSE;
2151
2152         /* RF6_RAISE_DEAD */
2153         case 160+15:
2154                 if (known)
2155                 {
2156                         if (see_either)
2157                         {
2158                                 disturb(1, 1);
2159                                 if (blind)
2160                                 {
2161                                         msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
2162                                 }
2163                                 else
2164                                 {
2165                                         msg_format(_("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a spell to revive corpses."), m_name);
2166                                 }
2167                         }
2168                         else
2169                         {
2170                                 mon_fight = TRUE;
2171                         }
2172                 }
2173                 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
2174                 break;
2175
2176         /* RF6_S_KIN */
2177         case 160+16:
2178                 if (known)
2179                 {
2180                         if (see_either)
2181                         {
2182                                 disturb(1, 1);
2183
2184                                 if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
2185                                 {
2186                                         msg_format(_("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´­¤·¤¿¡£", "%^s magically summons guardians of dungeons."), m_name);
2187                                 }
2188                                 else
2189                                 {
2190                                         _(msg_format("%s¤¬ËâË¡¤Ç%s¤ò¾¤´­¤·¤¿¡£", m_name, ((r_ptr->flags1 & RF1_UNIQUE) ? "¼ê²¼" : "Ãç´Ö")),   
2191                                           msg_format("%^s magically summons %s %s.", m_name, m_poss, ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin")));
2192                                 }
2193
2194                         }
2195                         else
2196                         {
2197                                 mon_fight = TRUE;
2198                         }
2199                 }
2200
2201                 switch (m_ptr->r_idx)
2202                 {
2203                 case MON_MENELDOR:
2204                 case MON_GWAIHIR:
2205                 case MON_THORONDOR:
2206                         {
2207                                 int num = 4 + randint1(3);
2208                                 for (k = 0; k < num; k++)
2209                                 {
2210                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2211                                 }
2212                         }
2213                         break;
2214
2215                 case MON_BULLGATES:
2216                         {
2217                                 int num = 2 + randint1(3);
2218                                 for (k = 0; k < num; k++)
2219                                 {
2220                                         count += summon_named_creature(m_idx, y, x, MON_IE, 0);
2221                                 }
2222                         }
2223                         break;
2224
2225                 case MON_SERPENT:
2226                 case MON_ZOMBI_SERPENT:
2227                         if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
2228                         {
2229                                 if (known && see_t)
2230                                 {
2231                                         msg_print(_("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª", "Water blew off from the ground!"));
2232                                 }
2233                                 project(t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
2234                         }
2235
2236                         {
2237                                 int num = 2 + randint1(3);
2238                                 for (k = 0; k < num; k++)
2239                                 {
2240                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2241                                 }
2242                         }
2243                         break;
2244
2245                 case MON_CALDARM:
2246                         {
2247                                 int num = randint1(3);
2248                                 for (k = 0; k < num; k++)
2249                                 {
2250                                         count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, 0);
2251                                 }
2252                         }
2253                         break;
2254
2255                 case MON_LOUSY:
2256                         {
2257                                 int num = 2 + randint1(3);
2258                                 for (k = 0; k < num; k++)
2259                                 {
2260                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, (PM_ALLOW_GROUP));
2261                                 }
2262                         }
2263                         break;
2264
2265                 default:
2266                         summon_kin_type = r_ptr->d_char;
2267
2268                         for (k = 0; k < 4; k++)
2269                         {
2270                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, (PM_ALLOW_GROUP));
2271                         }
2272                         break;
2273                 }
2274
2275                 if (known && !see_t && count)
2276                 {
2277                         mon_fight = TRUE;
2278                 }
2279
2280                 break;
2281
2282         /* RF6_S_CYBER */
2283         case 160+17:
2284                 if (known)
2285                 {
2286                         if (see_either)
2287                         {
2288                                 disturb(1, 1);
2289
2290                                 msg_format(_("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons Cyberdemons!"), m_name);
2291                         }
2292                         else
2293                         {
2294                                 mon_fight = TRUE;
2295                         }
2296                 }
2297
2298                 if (is_friendly(m_ptr))
2299                 {
2300                         count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
2301                 }
2302                 else
2303                 {
2304                         count += summon_cyber(m_idx, y, x);
2305                 }
2306
2307                 if (known && !see_t && count)
2308                 {
2309                         mon_fight = TRUE;
2310                 }
2311
2312                 break;
2313
2314         /* RF6_S_MONSTER */
2315         case 160+18:
2316                 if (known)
2317                 {
2318                         if (see_either)
2319                         {
2320                                 disturb(1, 1);
2321
2322                                 msg_format(_("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons help!"), m_name);
2323                         }
2324                         else
2325                         {
2326                                 mon_fight = TRUE;
2327                         }
2328                 }
2329
2330                 count += summon_specific(m_idx, y, x, rlev, 0, (u_mode));
2331
2332                 if (known && !see_t && count)
2333                 {
2334                         mon_fight = TRUE;
2335                 }
2336
2337                 break;
2338
2339         /* RF6_S_MONSTERS */
2340         case 160+19:
2341                 if (known)
2342                 {
2343                         if (see_either)
2344                         {
2345                                 disturb(1, 1);
2346
2347                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons monsters!"), m_name);
2348                         }
2349                         else
2350                         {
2351                                 mon_fight = TRUE;
2352                         }
2353                 }
2354
2355                 for (k = 0; k < s_num_6; k++)
2356                 {
2357                         count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | u_mode));
2358                 }
2359
2360                 if (known && !see_t && count)
2361                 {
2362                         mon_fight = TRUE;
2363                 }
2364
2365                 break;
2366
2367         /* RF6_S_ANT */
2368         case 160+20:
2369                 if (known)
2370                 {
2371                         if (see_either)
2372                         {
2373                                 disturb(1, 1);
2374
2375                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´­¤·¤¿¡£", "%^s magically summons ants."), m_name);
2376                         }
2377                         else
2378                         {
2379                                 mon_fight = TRUE;
2380                         }
2381                 }
2382
2383                 for (k = 0; k < s_num_6; k++)
2384                 {
2385                         count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, (PM_ALLOW_GROUP));
2386                 }
2387
2388                 if (known && !see_t && count)
2389                 {
2390                         mon_fight = TRUE;
2391                 }
2392
2393                 break;
2394
2395         /* RF6_S_SPIDER */
2396         case 160+21:
2397                 if (known)
2398                 {
2399                         if (see_either)
2400                         {
2401                                 disturb(1, 1);
2402
2403                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´­¤·¤¿¡£", "%^s magically summons spiders."), m_name);
2404                         }
2405                         else
2406                         {
2407                                 mon_fight = TRUE;
2408                         }
2409                 }
2410
2411                 for (k = 0; k < s_num_6; k++)
2412                 {
2413                         count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, (PM_ALLOW_GROUP));
2414                 }
2415
2416                 if (known && !see_t && count)
2417                 {
2418                         mon_fight = TRUE;
2419                 }
2420
2421                 break;
2422
2423         /* RF6_S_HOUND */
2424         case 160+22:
2425                 if (known)
2426                 {
2427                         if (see_either)
2428                         {
2429                                 disturb(1, 1);
2430
2431                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£", "%^s magically summons hounds."), m_name);
2432                         }
2433                         else
2434                         {
2435                                 mon_fight = TRUE;
2436                         }
2437                 }
2438
2439                 for (k = 0; k < s_num_4; k++)
2440                 {
2441                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, (PM_ALLOW_GROUP));
2442                 }
2443
2444                 if (known && !see_t && count)
2445                 {
2446                         mon_fight = TRUE;
2447                 }
2448
2449                 break;
2450
2451         /* RF6_S_HYDRA */
2452         case 160+23:
2453                 if (known)
2454                 {
2455                         if (see_either)
2456                         {
2457                                 disturb(1, 1);
2458
2459                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£", "%^s magically summons hydras."), m_name);
2460                         }
2461                         else
2462                         {
2463                                 mon_fight = TRUE;
2464                         }
2465                 }
2466
2467                 for (k = 0; k < s_num_4; k++)
2468                 {
2469                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, (PM_ALLOW_GROUP));
2470                 }
2471
2472                 if (known && !see_t && count)
2473                 {
2474                         mon_fight = TRUE;
2475                 }
2476
2477                 break;
2478
2479         /* RF6_S_ANGEL */
2480         case 160+24:
2481                 if (known)
2482                 {
2483                         if (see_either)
2484                         {
2485                                 disturb(1, 1);
2486
2487                                 msg_format(_("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons an angel!"), m_name);
2488                         }
2489                         else
2490                         {
2491                                 mon_fight = TRUE;
2492                         }
2493                 }
2494
2495                 {
2496                         int num = 1;
2497
2498                         if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
2499                         {
2500                                 num += r_ptr->level/40;
2501                         }
2502
2503                         for (k = 0; k < num; k++)
2504                         {
2505                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP));
2506                         }
2507                 }
2508
2509                 if (known && !see_t && count)
2510                 {
2511                         mon_fight = TRUE;
2512                 }
2513
2514                 break;
2515
2516         /* RF6_S_DEMON */
2517         case 160+25:
2518                 if (known)
2519                 {
2520                         if (see_either)
2521                         {
2522                                 disturb(1, 1);
2523
2524                                 msg_format(_("%^s¤¬ËâË¡¤Çº®Æ٤εÜÄ¤é¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", 
2525                                                  "%^s magically summons a demon from the Courts of Chaos!"), m_name);
2526                         }
2527                         else
2528                         {
2529                                 mon_fight = TRUE;
2530                         }
2531                 }
2532
2533                 for (k = 0; k < 1; k++)
2534                 {
2535                         count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, (PM_ALLOW_GROUP));
2536                 }
2537
2538                 if (known && !see_t && count)
2539                 {
2540                         mon_fight = TRUE;
2541                 }
2542
2543                 break;
2544
2545         /* RF6_S_UNDEAD */
2546         case 160+26:
2547                 if (known)
2548                 {
2549                         if (see_either)
2550                         {
2551                                 disturb(1, 1);
2552
2553                                 msg_format(_("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡£", "%^s magically summons undead."), m_name);
2554                         }
2555                         else
2556                         {
2557                                 mon_fight = TRUE;
2558                         }
2559                 }
2560
2561                 for (k = 0; k < 1; k++)
2562                 {
2563                         count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, (PM_ALLOW_GROUP));
2564                 }
2565
2566                 if (known && !see_t && count)
2567                 {
2568                         mon_fight = TRUE;
2569                 }
2570
2571                 break;
2572
2573         /* RF6_S_DRAGON */
2574         case 160+27:
2575                 if (known)
2576                 {
2577                         if (see_either)
2578                         {
2579                                 disturb(1, 1);
2580
2581                                 msg_format(_("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons a dragon!"), m_name);
2582                         }
2583                         else
2584                         {
2585                                 mon_fight = TRUE;
2586                         }
2587                 }
2588
2589                 for (k = 0; k < 1; k++)
2590                 {
2591                         count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, (PM_ALLOW_GROUP));
2592                 }
2593
2594                 if (known && !see_t && count)
2595                 {
2596                         mon_fight = TRUE;
2597                 }
2598
2599                 break;
2600
2601         /* RF6_S_HI_UNDEAD */
2602         case 160+28:
2603                 if (known)
2604                 {
2605                         if (see_either)
2606                         {
2607                                 disturb(1, 1);
2608
2609                                 msg_format(_("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡£", "%^s magically summons undead."), m_name);
2610                         }
2611                         else
2612                         {
2613                                 mon_fight = TRUE;
2614                         }
2615                 }
2616
2617                 for (k = 0; k < s_num_6; k++)
2618                 {
2619                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | u_mode));
2620                 }
2621
2622                 if (known && !see_t && count)
2623                 {
2624                         mon_fight = TRUE;
2625                 }
2626
2627                 break;
2628
2629         /* RF6_S_HI_DRAGON */
2630         case 160+29:
2631                 if (known)
2632                 {
2633                         if (see_either)
2634                         {
2635                                 disturb(1, 1);
2636
2637                                 msg_format(_("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons ancient dragons!"), m_name);
2638                         }
2639                         else
2640                         {
2641                                 mon_fight = TRUE;
2642                         }
2643                 }
2644
2645                 for (k = 0; k < s_num_4; k++)
2646                 {
2647                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | u_mode));
2648                 }
2649
2650                 if (known && !see_t && count)
2651                 {
2652                         mon_fight = TRUE;
2653                 }
2654
2655                 break;
2656
2657         /* RF6_S_AMBERITES */
2658         case 160+30:
2659                 if (known)
2660                 {
2661                         if (see_either)
2662                         {
2663                                 disturb(1, 1);
2664
2665                                 msg_format(_("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons Lords of Amber!"), m_name);
2666                         }
2667                         else
2668                         {
2669                                 mon_fight = TRUE;
2670                         }
2671                 }
2672
2673                 for (k = 0; k < s_num_4; k++)
2674                 {
2675                         count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2676                 }
2677
2678                 if (known && !see_t && count)
2679                 {
2680                         mon_fight = TRUE;
2681                 }
2682
2683                 break;
2684
2685         /* RF6_S_UNIQUE */
2686         case 160+31:
2687                 if (known)
2688                 {
2689                         if (see_either)
2690                         {
2691                                 disturb(1, 1);
2692
2693                                 msg_format(_("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª", "%^s magically summons special opponents!"), m_name);
2694                         }
2695                         else
2696                         {
2697                                 mon_fight = TRUE;
2698                         }
2699                 }
2700
2701                 for (k = 0; k < s_num_4; k++)
2702                 {
2703                         count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2704                 }
2705
2706                 {
2707                         int non_unique_type = SUMMON_HI_UNDEAD;
2708
2709                         if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
2710                                 non_unique_type = 0;
2711                         else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
2712                                 non_unique_type = SUMMON_ANGEL;
2713
2714                         for (k = count; k < s_num_4; k++)
2715                         {
2716                                 count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
2717                         }
2718                 }
2719
2720                 if (known && !see_t && count)
2721                 {
2722                         mon_fight = TRUE;
2723                 }
2724
2725                 break;
2726         }
2727
2728         if (wake_up) (void)set_monster_csleep(t_idx, 0);
2729
2730         if (fear && see_t)
2731         {
2732                 msg_format(_("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", "%^s flees in terror!"), t_name);
2733         }
2734
2735         if (m_ptr->ml && maneable && !world_monster && !p_ptr->blind && (p_ptr->pclass == CLASS_IMITATOR))
2736         {
2737                 if (thrown_spell != 167) /* Not RF6_SPECIAL */
2738                 {
2739                         if (p_ptr->mane_num == MAX_MANE)
2740                         {
2741                                 p_ptr->mane_num--;
2742                                 for (i = 0; i < p_ptr->mane_num - 1; i++)
2743                                 {
2744                                         p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
2745                                         p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
2746                                 }
2747                         }
2748                         p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
2749                         p_ptr->mane_dam[p_ptr->mane_num] = dam;
2750                         p_ptr->mane_num++;
2751                         new_mane = TRUE;
2752
2753                         p_ptr->redraw |= (PR_IMITATION);
2754                 }
2755         }
2756
2757         /* Remember what the monster did, if we saw it */
2758         if (can_remember)
2759         {
2760                 /* Inate spell */
2761                 if (thrown_spell < 32*4)
2762                 {
2763                         r_ptr->r_flags4 |= (1L << (thrown_spell - 32*3));
2764                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
2765                 }
2766
2767                 /* Bolt or Ball */
2768                 else if (thrown_spell < 32*5)
2769                 {
2770                         r_ptr->r_flags5 |= (1L << (thrown_spell - 32*4));
2771                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
2772                 }
2773
2774                 /* Special spell */
2775                 else if (thrown_spell < 32*6)
2776                 {
2777                         r_ptr->r_flags6 |= (1L << (thrown_spell - 32*5));
2778                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
2779                 }
2780         }
2781
2782         /* Always take note of monsters that kill you */
2783         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
2784         {
2785                 r_ptr->r_deaths++; /* Ignore appearance difference */
2786         }
2787
2788         /* A spell was cast */
2789         return TRUE;
2790 }