OSDN Git Service

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