OSDN Git Service

乗馬中のプレイヤーが'B'系の投げ落としを受けた場合は両方にダメージが行
[hengbandforosx/hengbandosx.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         if (r_ptr->flags2 & RF2_SMART)
1420         {
1421                 /* Hack -- allow "desperate" spells */
1422                 if ((m_ptr->hp < m_ptr->maxhp / 10) &&
1423                         (randint0(100) < 50))
1424                 {
1425                         /* Require intelligent spells */
1426                         f4 &= (RF4_INT_MASK);
1427                         f5 &= (RF5_INT_MASK);
1428                         f6 &= (RF6_INT_MASK);
1429                 }
1430
1431                 /* Hack -- decline "teleport level" in some case */
1432                 if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF(0))
1433                 {
1434                         f6 &= ~(RF6_TELE_LEVEL);
1435                 }
1436         }
1437
1438         /* No spells left */
1439         if (!f4 && !f5 && !f6) return (FALSE);
1440
1441         /* Remove the "ineffective" spells */
1442         remove_bad_spells(m_idx, &f4, &f5, &f6);
1443
1444         if (p_ptr->inside_arena || p_ptr->inside_battle)
1445         {
1446                 f4 &= ~(RF4_SUMMON_MASK);
1447                 f5 &= ~(RF5_SUMMON_MASK);
1448                 f6 &= ~(RF6_SUMMON_MASK | RF6_TELE_LEVEL);
1449         }
1450
1451         /* No spells left */
1452         if (!f4 && !f5 && !f6) return (FALSE);
1453
1454         if (!(r_ptr->flags2 & RF2_STUPID))
1455         {
1456                 /* Check for a clean bolt shot */
1457                 if (((f4 & RF4_BOLT_MASK) ||
1458                      (f5 & RF5_BOLT_MASK) ||
1459                      (f6 & RF6_BOLT_MASK)) &&
1460                     !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
1461                 {
1462                         /* Remove spells that will only hurt friends */
1463                         f4 &= ~(RF4_BOLT_MASK);
1464                         f5 &= ~(RF5_BOLT_MASK);
1465                         f6 &= ~(RF6_BOLT_MASK);
1466                 }
1467
1468                 /* Check for a possible summon */
1469                 if (((f4 & RF4_SUMMON_MASK) ||
1470                      (f5 & RF5_SUMMON_MASK) ||
1471                      (f6 & RF6_SUMMON_MASK)) &&
1472                     !(summon_possible(y, x)))
1473                 {
1474                         /* Remove summoning spells */
1475                         f4 &= ~(RF4_SUMMON_MASK);
1476                         f5 &= ~(RF5_SUMMON_MASK);
1477                         f6 &= ~(RF6_SUMMON_MASK);
1478                 }
1479
1480                 /* No spells left */
1481                 if (!f4 && !f5 && !f6) return (FALSE);
1482         }
1483
1484         /* Extract the "inate" spells */
1485         for (k = 0; k < 32; k++)
1486         {
1487                 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
1488         }
1489
1490         /* Extract the "normal" spells */
1491         for (k = 0; k < 32; k++)
1492         {
1493                 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
1494         }
1495
1496         /* Extract the "bizarre" spells */
1497         for (k = 0; k < 32; k++)
1498         {
1499                 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
1500         }
1501
1502         /* No spells left */
1503         if (!num) return (FALSE);
1504
1505         /* Stop if player is dead or gone */
1506         if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
1507
1508         /* Stop if player is leaving */
1509         if (p_ptr->leaving) return (FALSE);
1510
1511         /* Get the monster name (or "it") */
1512         monster_desc(m_name, m_ptr, 0x00);
1513
1514 #ifndef JP
1515         /* Get the monster possessive ("his"/"her"/"its") */
1516         monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1517 #endif
1518
1519         if (do_disi)
1520                 thrown_spell = 96+31;
1521         else
1522         {
1523                 int attempt = 10;
1524                 while(attempt--)
1525                 {
1526                         thrown_spell = choose_attack_spell(m_idx, spell, num);
1527                         if (thrown_spell) break;
1528                 }
1529         }
1530
1531         /* Abort if no spell was chosen */
1532         if (!thrown_spell) return (FALSE);
1533
1534         /* Calculate spell failure rate */
1535         failrate = 25 - (rlev + 3) / 4;
1536
1537         /* Hack -- Stupid monsters will never fail (for jellies and such) */
1538         if (r_ptr->flags2 & RF2_STUPID) failrate = 0;
1539
1540         /* Check for spell failure (inate attacks never fail) */
1541         if (!spell_is_inate(thrown_spell)
1542             && (in_no_magic_dungeon || (m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate)))
1543         {
1544                 disturb(1, 0);
1545                 /* Message */
1546 #ifdef JP
1547                 msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
1548 #else
1549                 msg_format("%^s tries to cast a spell, but fails.", m_name);
1550 #endif
1551
1552                 return (TRUE);
1553         }
1554
1555         /* Projectable? */
1556         direct = player_bold(y, x);
1557
1558         /* Cast the spell. */
1559         switch (thrown_spell)
1560         {
1561                 /* RF4_SHRIEK */
1562                 case 96+0:
1563                 {
1564                         disturb(1, 0);
1565 #ifdef JP
1566 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
1567 #else
1568                         msg_format("%^s makes a high pitched shriek.", m_name);
1569 #endif
1570
1571                         aggravate_monsters(m_idx);
1572                         break;
1573                 }
1574
1575                 /* RF4_XXX1 */
1576                 case 96+1:
1577                 {
1578                         /* XXX XXX XXX */
1579                         break;
1580                 }
1581
1582                 /* RF4_DISPEL */
1583                 case 96+2:
1584                 {
1585                         if (!direct) return (FALSE);
1586                         disturb(1, 0);
1587 #ifdef JP
1588                         if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1589                         else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
1590 #else
1591                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
1592                         else msg_format("%^s invokes a dispel magic.", m_name);
1593 #endif
1594                         set_fast(0, TRUE);
1595                         set_lightspeed(0, TRUE);
1596                         set_slow(0, TRUE);
1597                         set_shield(0, TRUE);
1598                         set_blessed(0, TRUE);
1599                         set_tsuyoshi(0, TRUE);
1600                         set_hero(0, TRUE);
1601                         set_shero(0, TRUE);
1602                         set_protevil(0, TRUE);
1603                         set_invuln(0, TRUE);
1604                         set_wraith_form(0, TRUE);
1605                         set_kabenuke(0, TRUE);
1606                         set_tim_res_nether(0, TRUE);
1607                         set_tim_res_time(0, TRUE);
1608                         /* by henkma */
1609                         set_tim_reflect(0,TRUE);
1610                         set_multishadow(0,TRUE);
1611                         set_dustrobe(0,TRUE);
1612
1613                         set_tim_invis(0, TRUE);
1614                         set_tim_infra(0, TRUE);
1615                         set_tim_esp(0, TRUE);
1616                         set_tim_regen(0, TRUE);
1617                         set_tim_stealth(0, TRUE);
1618                         set_tim_ffall(0, TRUE);
1619                         set_tim_sh_touki(0, TRUE);
1620                         set_tim_sh_fire(0, TRUE);
1621                         set_tim_sh_holy(0, TRUE);
1622                         set_tim_eyeeye(0, TRUE);
1623                         set_magicdef(0, TRUE);
1624                         set_resist_magic(0, TRUE);
1625                         set_oppose_acid(0, TRUE);
1626                         set_oppose_elec(0, TRUE);
1627                         set_oppose_fire(0, TRUE);
1628                         set_oppose_cold(0, TRUE);
1629                         set_oppose_pois(0, TRUE);
1630                         set_ultimate_res(0, TRUE);
1631                         set_mimic(0, 0, TRUE);
1632                         set_ele_attack(0, 0);
1633                         set_ele_immune(0, 0);
1634                         /* Cancel glowing hands */
1635                         if (p_ptr->special_attack & ATTACK_CONFUSE)
1636                         {
1637                                 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1638 #ifdef JP
1639                                 msg_print("¼ê¤Îµ±¤­¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1640 #else
1641                                 msg_print("Your hands stop glowing.");
1642 #endif
1643
1644                         }
1645                         if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
1646                         {
1647                                 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
1648                                 p_ptr->magic_num1[0] = 0;
1649 #ifdef JP
1650                                 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
1651 #else
1652                                 msg_print("Your singing is interrupted.");
1653 #endif
1654                                 p_ptr->action = ACTION_NONE;
1655
1656                                 /* Recalculate bonuses */
1657                                 p_ptr->update |= (PU_BONUS | PU_HP);
1658
1659                                 /* Redraw map */
1660                                 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1661
1662                                 /* Update monsters */
1663                                 p_ptr->update |= (PU_MONSTERS);
1664
1665                                 /* Window stuff */
1666                                 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1667
1668                                 p_ptr->energy_need += ENERGY_NEED();
1669                         }
1670                         if (p_ptr->riding)
1671                         {
1672                                 monster_type *riding_ptr = &m_list[p_ptr->riding];
1673                                 if (riding_ptr->invulner)
1674                                 {
1675                                         riding_ptr->invulner = 0;
1676                                         riding_ptr->energy_need += ENERGY_NEED();
1677                                 }
1678                                 riding_ptr->fast = 0;
1679                                 riding_ptr->slow = 0;
1680                                 p_ptr->update |= PU_BONUS;
1681                                 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH;
1682                                 p_ptr->redraw |= (PR_UHEALTH);
1683                         }
1684
1685 #ifdef JP
1686                         if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1687                                 msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
1688 #endif
1689                         learn_spell(MS_DISPEL);
1690                         break;
1691                 }
1692
1693                 /* RF4_XXX4X4 */
1694                 case 96+3:
1695                 {
1696                         disturb(1, 0);
1697 #ifdef JP
1698 if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
1699 #else
1700                         if (blind) msg_format("%^s shoots something.", m_name);
1701 #endif
1702
1703 #ifdef JP
1704 else msg_format("%^s¤¬¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name);
1705 #else
1706                         else msg_format("%^s fires a rocket.", m_name);
1707 #endif
1708
1709                         dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
1710                         breath(y, x, m_idx, GF_ROCKET,
1711                                 dam, 2, FALSE, MS_ROCKET, learnable);
1712                         update_smart_learn(m_idx, DRS_SHARD);
1713                         break;
1714                 }
1715
1716                 /* RF4_SHOOT */
1717                 case 96+4:
1718                 {
1719                         if (!direct) return (FALSE);
1720                         disturb(1, 0);
1721 #ifdef JP
1722 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1723 #else
1724                         if (blind) msg_format("%^s makes a strange noise.", m_name);
1725 #endif
1726
1727 #ifdef JP
1728 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1729 #else
1730                         else msg_format("%^s fires an arrow.", m_name);
1731 #endif
1732
1733                         dam = damroll(r_ptr->blow[0].d_dice, r_ptr->blow[0].d_side);
1734                         bolt(m_idx, GF_ARROW, dam, MS_SHOOT, learnable);
1735                         update_smart_learn(m_idx, DRS_REFLECT);
1736                         break;
1737                 }
1738
1739                 /* RF4_XXX2 */
1740                 case 96+5:
1741                 {
1742                         /* XXX XXX XXX */
1743                         break;
1744                 }
1745
1746                 /* RF4_XXX3 */
1747                 case 96+6:
1748                 {
1749                         /* XXX XXX XXX */
1750                         break;
1751                 }
1752
1753                 /* RF4_XXX4 */
1754                 case 96+7:
1755                 {
1756                         /* XXX XXX XXX */
1757                         break;
1758                 }
1759
1760                 /* RF4_BR_ACID */
1761                 case 96+8:
1762                 {
1763                         disturb(1, 0);
1764 #ifdef JP
1765 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1766 #else
1767                         if (blind) msg_format("%^s breathes.", m_name);
1768 #endif
1769
1770 #ifdef JP
1771 else msg_format("%^s¤¬»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1772 #else
1773                         else msg_format("%^s breathes acid.", m_name);
1774 #endif
1775
1776                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1777                         breath(y, x, m_idx, GF_ACID, dam, 0, TRUE, MS_BR_ACID, learnable);
1778                         update_smart_learn(m_idx, DRS_ACID);
1779                         break;
1780                 }
1781
1782                 /* RF4_BR_ELEC */
1783                 case 96+9:
1784                 {
1785                         disturb(1, 0);
1786 #ifdef JP
1787 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1788 #else
1789                         if (blind) msg_format("%^s breathes.", m_name);
1790 #endif
1791
1792 #ifdef JP
1793 else msg_format("%^s¤¬°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1794 #else
1795                         else msg_format("%^s breathes lightning.", m_name);
1796 #endif
1797
1798                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1799                         breath(y, x, m_idx, GF_ELEC, dam,0, TRUE, MS_BR_ELEC, learnable);
1800                         update_smart_learn(m_idx, DRS_ELEC);
1801                         break;
1802                 }
1803
1804                 /* RF4_BR_FIRE */
1805                 case 96+10:
1806                 {
1807                         disturb(1, 0);
1808 #ifdef JP
1809 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1810 #else
1811                         if (blind) msg_format("%^s breathes.", m_name);
1812 #endif
1813
1814 #ifdef JP
1815 else msg_format("%^s¤¬²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1816 #else
1817                         else msg_format("%^s breathes fire.", m_name);
1818 #endif
1819
1820                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1821                         breath(y, x, m_idx, GF_FIRE, dam,0, TRUE, MS_BR_FIRE, learnable);
1822                         update_smart_learn(m_idx, DRS_FIRE);
1823                         break;
1824                 }
1825
1826                 /* RF4_BR_COLD */
1827                 case 96+11:
1828                 {
1829                         disturb(1, 0);
1830 #ifdef JP
1831 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1832 #else
1833                         if (blind) msg_format("%^s breathes.", m_name);
1834 #endif
1835
1836 #ifdef JP
1837 else msg_format("%^s¤¬Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1838 #else
1839                         else msg_format("%^s breathes frost.", m_name);
1840 #endif
1841
1842                         dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1843                         breath(y, x, m_idx, GF_COLD, dam,0, TRUE, MS_BR_COLD, learnable);
1844                         update_smart_learn(m_idx, DRS_COLD);
1845                         break;
1846                 }
1847
1848                 /* RF4_BR_POIS */
1849                 case 96+12:
1850                 {
1851                         disturb(1, 0);
1852 #ifdef JP
1853 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1854 #else
1855                         if (blind) msg_format("%^s breathes.", m_name);
1856 #endif
1857
1858 #ifdef JP
1859 else msg_format("%^s¤¬¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1860 #else
1861                         else msg_format("%^s breathes gas.", m_name);
1862 #endif
1863
1864                         dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1865                         breath(y, x, m_idx, GF_POIS, dam, 0, TRUE, MS_BR_POIS, learnable);
1866                         update_smart_learn(m_idx, DRS_POIS);
1867                         break;
1868                 }
1869
1870
1871                 /* RF4_BR_NETH */
1872                 case 96+13:
1873                 {
1874                         disturb(1, 0);
1875 #ifdef JP
1876 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1877 #else
1878                         if (blind) msg_format("%^s breathes.", m_name);
1879 #endif
1880
1881 #ifdef JP
1882 else msg_format("%^s¤¬ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1883 #else
1884                         else msg_format("%^s breathes nether.", m_name);
1885 #endif
1886
1887                         dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1888                         breath(y, x, m_idx, GF_NETHER, dam,0, TRUE, MS_BR_NETHER, learnable);
1889                         update_smart_learn(m_idx, DRS_NETH);
1890                         break;
1891                 }
1892
1893                 /* RF4_BR_LITE */
1894                 case 96+14:
1895                 {
1896                         disturb(1, 0);
1897 #ifdef JP
1898 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1899 #else
1900                         if (blind) msg_format("%^s breathes.", m_name);
1901 #endif
1902
1903 #ifdef JP
1904 else msg_format("%^s¤¬Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1905 #else
1906                         else msg_format("%^s breathes light.", m_name);
1907 #endif
1908
1909                         dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1910                         breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable);
1911                         update_smart_learn(m_idx, DRS_LITE);
1912                         break;
1913                 }
1914
1915                 /* RF4_BR_DARK */
1916                 case 96+15:
1917                 {
1918                         disturb(1, 0);
1919 #ifdef JP
1920 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1921 #else
1922                         if (blind) msg_format("%^s breathes.", m_name);
1923 #endif
1924
1925 #ifdef JP
1926 else msg_format("%^s¤¬°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1927 #else
1928                         else msg_format("%^s breathes darkness.", m_name);
1929 #endif
1930
1931                         dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1932                         breath(y, x, m_idx, GF_DARK, dam,0, TRUE, MS_BR_DARK, learnable);
1933                         update_smart_learn(m_idx, DRS_DARK);
1934                         break;
1935                 }
1936
1937                 /* RF4_BR_CONF */
1938                 case 96+16:
1939                 {
1940                         disturb(1, 0);
1941 #ifdef JP
1942 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1943 #else
1944                         if (blind) msg_format("%^s breathes.", m_name);
1945 #endif
1946
1947 #ifdef JP
1948 else msg_format("%^s¤¬º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1949 #else
1950                         else msg_format("%^s breathes confusion.", m_name);
1951 #endif
1952
1953                         dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1954                         breath(y, x, m_idx, GF_CONFUSION, dam,0, TRUE, MS_BR_CONF, learnable);
1955                         update_smart_learn(m_idx, DRS_CONF);
1956                         break;
1957                 }
1958
1959                 /* RF4_BR_SOUN */
1960                 case 96+17:
1961                 {
1962                         disturb(1, 0);
1963                         if (m_ptr->r_idx == MON_JAIAN)
1964 #ifdef JP
1965                                 msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
1966 #else
1967                                 msg_format("'Booooeeeeee'");
1968 #endif
1969 #ifdef JP
1970 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1971 #else
1972                         else if (blind) msg_format("%^s breathes.", m_name);
1973 #endif
1974
1975 #ifdef JP
1976 else msg_format("%^s¤¬¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1977 #else
1978                         else msg_format("%^s breathes sound.", m_name);
1979 #endif
1980
1981                         dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1982                         breath(y, x, m_idx, GF_SOUND, dam,0, TRUE, MS_BR_SOUND, learnable);
1983                         update_smart_learn(m_idx, DRS_SOUND);
1984                         break;
1985                 }
1986
1987                 /* RF4_BR_CHAO */
1988                 case 96+18:
1989                 {
1990                         disturb(1, 0);
1991 #ifdef JP
1992 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1993 #else
1994                         if (blind) msg_format("%^s breathes.", m_name);
1995 #endif
1996
1997 #ifdef JP
1998 else msg_format("%^s¤¬¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1999 #else
2000                         else msg_format("%^s breathes chaos.", m_name);
2001 #endif
2002
2003                         dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
2004                         breath(y, x, m_idx, GF_CHAOS, dam,0, TRUE, MS_BR_CHAOS, learnable);
2005                         update_smart_learn(m_idx, DRS_CHAOS);
2006                         break;
2007                 }
2008
2009                 /* RF4_BR_DISE */
2010                 case 96+19:
2011                 {
2012                         disturb(1, 0);
2013 #ifdef JP
2014 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2015 #else
2016                         if (blind) msg_format("%^s breathes.", m_name);
2017 #endif
2018
2019 #ifdef JP
2020 else msg_format("%^s¤¬Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2021 #else
2022                         else msg_format("%^s breathes disenchantment.", m_name);
2023 #endif
2024
2025                         dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2026                         breath(y, x, m_idx, GF_DISENCHANT, dam,0, TRUE, MS_BR_DISEN, learnable);
2027                         update_smart_learn(m_idx, DRS_DISEN);
2028                         break;
2029                 }
2030
2031                 /* RF4_BR_NEXU */
2032                 case 96+20:
2033                 {
2034                         disturb(1, 0);
2035 #ifdef JP
2036 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2037 #else
2038                         if (blind) msg_format("%^s breathes.", m_name);
2039 #endif
2040
2041 #ifdef JP
2042 else msg_format("%^s¤¬°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2043 #else
2044                         else msg_format("%^s breathes nexus.", m_name);
2045 #endif
2046
2047                         dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2048                         breath(y, x, m_idx, GF_NEXUS, dam,0, TRUE, MS_BR_NEXUS, learnable);
2049                         update_smart_learn(m_idx, DRS_NEXUS);
2050                         break;
2051                 }
2052
2053                 /* RF4_BR_TIME */
2054                 case 96+21:
2055                 {
2056                         disturb(1, 0);
2057 #ifdef JP
2058 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2059 #else
2060                         if (blind) msg_format("%^s breathes.", m_name);
2061 #endif
2062
2063 #ifdef JP
2064 else msg_format("%^s¤¬»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2065 #else
2066                         else msg_format("%^s breathes time.", m_name);
2067 #endif
2068
2069                         dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
2070                         breath(y, x, m_idx, GF_TIME, dam,0, TRUE, MS_BR_TIME, learnable);
2071                         break;
2072                 }
2073
2074                 /* RF4_BR_INER */
2075                 case 96+22:
2076                 {
2077                         disturb(1, 0);
2078 #ifdef JP
2079 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2080 #else
2081                         if (blind) msg_format("%^s breathes.", m_name);
2082 #endif
2083
2084 #ifdef JP
2085 else msg_format("%^s¤¬ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2086 #else
2087                         else msg_format("%^s breathes inertia.", m_name);
2088 #endif
2089
2090                         dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2091                         breath(y, x, m_idx, GF_INERTIA, dam,0, TRUE, MS_BR_INERTIA, learnable);
2092                         break;
2093                 }
2094
2095                 /* RF4_BR_GRAV */
2096                 case 96+23:
2097                 {
2098                         disturb(1, 0);
2099 #ifdef JP
2100 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2101 #else
2102                         if (blind) msg_format("%^s breathes.", m_name);
2103 #endif
2104
2105 #ifdef JP
2106 else msg_format("%^s¤¬½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2107 #else
2108                         else msg_format("%^s breathes gravity.", m_name);
2109 #endif
2110
2111                         dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
2112                         breath(y, x, m_idx, GF_GRAVITY, dam,0, TRUE, MS_BR_GRAVITY, learnable);
2113                         break;
2114                 }
2115
2116                 /* RF4_BR_SHAR */
2117                 case 96+24:
2118                 {
2119                         disturb(1, 0);
2120                         if (m_ptr->r_idx == MON_BOTEI)
2121 #ifdef JP
2122                                 msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
2123 #else
2124                                 msg_format("'Boty-Build cutter!!!'");
2125 #endif
2126 #ifdef JP
2127 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2128 #else
2129                         else if (blind) msg_format("%^s breathes.", m_name);
2130 #endif
2131
2132 #ifdef JP
2133 else msg_format("%^s¤¬ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2134 #else
2135                         else msg_format("%^s breathes shards.", m_name);
2136 #endif
2137
2138                         dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2139                         breath(y, x, m_idx, GF_SHARDS, dam,0, TRUE, MS_BR_SHARDS, learnable);
2140                         update_smart_learn(m_idx, DRS_SHARD);
2141                         break;
2142                 }
2143
2144                 /* RF4_BR_PLAS */
2145                 case 96+25:
2146                 {
2147                         disturb(1, 0);
2148 #ifdef JP
2149 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2150 #else
2151                         if (blind) msg_format("%^s breathes.", m_name);
2152 #endif
2153
2154 #ifdef JP
2155 else msg_format("%^s¤¬¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2156 #else
2157                         else msg_format("%^s breathes plasma.", m_name);
2158 #endif
2159
2160                         dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2161                         breath(y, x, m_idx, GF_PLASMA, dam,0, TRUE, MS_BR_PLASMA, learnable);
2162                         break;
2163                 }
2164
2165                 /* RF4_BR_WALL */
2166                 case 96+26:
2167                 {
2168                         disturb(1, 0);
2169 #ifdef JP
2170 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2171 #else
2172                         if (blind) msg_format("%^s breathes.", m_name);
2173 #endif
2174
2175 #ifdef JP
2176 else msg_format("%^s¤¬¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2177 #else
2178                         else msg_format("%^s breathes force.", m_name);
2179 #endif
2180
2181                         dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2182                         breath(y, x, m_idx, GF_FORCE, dam,0, TRUE, MS_BR_FORCE, learnable);
2183                         break;
2184                 }
2185
2186                 /* RF4_BR_MANA */
2187                 case 96+27:
2188                 {
2189                         disturb(1, 0);
2190 #ifdef JP
2191 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2192 #else
2193                         if (blind) msg_format("%^s breathes.", m_name);
2194 #endif
2195
2196 #ifdef JP
2197 else msg_format("%^s¤¬ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2198 #else
2199                         else msg_format("%^s breathes mana.", m_name);
2200 #endif
2201                         dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2202                         breath(y, x, m_idx, GF_MANA, dam,0, TRUE, MS_BR_MANA, learnable);
2203                         break;
2204                 }
2205
2206                 /* RF4_BA_NUKE */
2207                 case 96+28:
2208                 {
2209                         disturb(1, 0);
2210 #ifdef JP
2211 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2212 #else
2213                         if (blind) msg_format("%^s mumbles.", m_name);
2214 #endif
2215
2216 #ifdef JP
2217 else msg_format("%^s¤¬Êü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name);
2218 #else
2219                         else msg_format("%^s casts a ball of radiation.", m_name);
2220 #endif
2221
2222                         dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2223                         breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, learnable);
2224                         update_smart_learn(m_idx, DRS_POIS);
2225                         break;
2226                 }
2227
2228                 /* RF4_BR_NUKE */
2229                 case 96+29:
2230                 {
2231                         disturb(1, 0);
2232 #ifdef JP
2233 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2234 #else
2235                         if (blind) msg_format("%^s breathes.", m_name);
2236 #endif
2237
2238 #ifdef JP
2239 else msg_format("%^s¤¬Êü¼ÍÀ­ÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2240 #else
2241                         else msg_format("%^s breathes toxic waste.", m_name);
2242 #endif
2243
2244                         dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
2245                         breath(y, x, m_idx, GF_NUKE, dam,0, TRUE, MS_BR_NUKE, learnable);
2246                         update_smart_learn(m_idx, DRS_POIS);
2247                         break;
2248                 }
2249
2250                 /* RF4_BA_CHAO */
2251                 case 96+30:
2252                 {
2253                         disturb(1, 0);
2254 #ifdef JP
2255 if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2256 #else
2257                         if (blind) msg_format("%^s mumbles frighteningly.", m_name);
2258 #endif
2259
2260 #ifdef JP
2261 else msg_format("%^s¤¬½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name);/*nuke me*/
2262 #else
2263                         else msg_format("%^s invokes a raw Logrus.", m_name);
2264 #endif
2265
2266                         dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2))+ damroll(10, 10);
2267                         breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, learnable);
2268                         update_smart_learn(m_idx, DRS_CHAOS);
2269                         break;
2270                 }
2271
2272                 /* RF4_BR_DISI */
2273                 case 96+31:
2274                 {
2275                         disturb(1, 0);
2276 #ifdef JP
2277 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2278 #else
2279                         if (blind) msg_format("%^s breathes.", m_name);
2280 #endif
2281
2282 #ifdef JP
2283 else msg_format("%^s¤¬Ê¬²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2284 #else
2285                         else msg_format("%^s breathes disintegration.", m_name);
2286 #endif
2287
2288                         dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2289                         breath(y, x, m_idx, GF_DISINTEGRATE, dam,0, TRUE, MS_BR_DISI, learnable);
2290                         break;
2291                 }
2292
2293
2294
2295                 /* RF5_BA_ACID */
2296                 case 128+0:
2297                 {
2298                         disturb(1, 0);
2299 #ifdef JP
2300 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2301 #else
2302                         if (blind) msg_format("%^s mumbles.", m_name);
2303 #endif
2304
2305 #ifdef JP
2306 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2307 #else
2308                         else msg_format("%^s casts an acid ball.", m_name);
2309 #endif
2310
2311                         dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2312                         breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
2313                         update_smart_learn(m_idx, DRS_ACID);
2314                         break;
2315                 }
2316
2317                 /* RF5_BA_ELEC */
2318                 case 128+1:
2319                 {
2320                         disturb(1, 0);
2321 #ifdef JP
2322 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2323 #else
2324                         if (blind) msg_format("%^s mumbles.", m_name);
2325 #endif
2326
2327 #ifdef JP
2328 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2329 #else
2330                         else msg_format("%^s casts a lightning ball.", m_name);
2331 #endif
2332
2333                         dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2334                         breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
2335                         update_smart_learn(m_idx, DRS_ELEC);
2336                         break;
2337                 }
2338
2339                 /* RF5_BA_FIRE */
2340                 case 128+2:
2341                 {
2342                         disturb(1, 0);
2343
2344                         if (m_ptr->r_idx == MON_ROLENTO)
2345                         {
2346 #ifdef JP
2347                                 if (blind)
2348                                         msg_format("%s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
2349                                 else 
2350                                         msg_format("%s¤Ï¼êÜØÃƤòÅꤲ¤¿¡£", m_name);
2351 #else
2352                                 if (blind)
2353                                         msg_format("%^s throws something.", m_name);
2354                                 else
2355                                         msg_format("%^s throws a hand grenade.", m_name);
2356 #endif
2357                         }
2358                         else
2359                         {
2360 #ifdef JP
2361 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2362 #else
2363                                 if (blind) msg_format("%^s mumbles.", m_name);
2364 #endif
2365
2366 #ifdef JP
2367 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2368 #else
2369                                 else msg_format("%^s casts a fire ball.", m_name);
2370 #endif
2371                         }
2372
2373                         dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2374                         breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2375                         update_smart_learn(m_idx, DRS_FIRE);
2376                         break;
2377                 }
2378
2379                 /* RF5_BA_COLD */
2380                 case 128+3:
2381                 {
2382                         disturb(1, 0);
2383 #ifdef JP
2384 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2385 #else
2386                         if (blind) msg_format("%^s mumbles.", m_name);
2387 #endif
2388
2389 #ifdef JP
2390 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2391 #else
2392                         else msg_format("%^s casts a frost ball.", m_name);
2393 #endif
2394
2395                         dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2396                         breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2397                         update_smart_learn(m_idx, DRS_COLD);
2398                         break;
2399                 }
2400
2401                 /* RF5_BA_POIS */
2402                 case 128+4:
2403                 {
2404                         disturb(1, 0);
2405 #ifdef JP
2406 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2407 #else
2408                         if (blind) msg_format("%^s mumbles.", m_name);
2409 #endif
2410
2411 #ifdef JP
2412 else msg_format("%^s¤¬°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2413 #else
2414                         else msg_format("%^s casts a stinking cloud.", m_name);
2415 #endif
2416
2417                         dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2418                         breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2419                         update_smart_learn(m_idx, DRS_POIS);
2420                         break;
2421                 }
2422
2423                 /* RF5_BA_NETH */
2424                 case 128+5:
2425                 {
2426                         disturb(1, 0);
2427 #ifdef JP
2428 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2429 #else
2430                         if (blind) msg_format("%^s mumbles.", m_name);
2431 #endif
2432
2433 #ifdef JP
2434 else msg_format("%^s¤¬ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2435 #else
2436                         else msg_format("%^s casts a nether ball.", m_name);
2437 #endif
2438
2439                         dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2440                         breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2441                         update_smart_learn(m_idx, DRS_NETH);
2442                         break;
2443                 }
2444
2445                 /* RF5_BA_WATE */
2446                 case 128+6:
2447                 {
2448                         disturb(1, 0);
2449 #ifdef JP
2450 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2451 #else
2452                         if (blind) msg_format("%^s mumbles.", m_name);
2453 #endif
2454
2455 #ifdef JP
2456 else msg_format("%^s¤¬Î®¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name);
2457 #else
2458                         else msg_format("%^s gestures fluidly.", m_name);
2459 #endif
2460
2461 #ifdef JP
2462 msg_print("¤¢¤Ê¤¿¤Ï±²´¬¤­¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£");
2463 #else
2464                         msg_print("You are engulfed in a whirlpool.");
2465 #endif
2466
2467                         dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
2468                         breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2469                         break;
2470                 }
2471
2472                 /* RF5_BA_MANA */
2473                 case 128+7:
2474                 {
2475                         disturb(1, 0);
2476 #ifdef JP
2477 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2478 #else
2479                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2480 #endif
2481
2482 #ifdef JP
2483 else msg_format("%^s¤¬ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2484 #else
2485                         else msg_format("%^s invokes a mana storm.", m_name);
2486 #endif
2487
2488                         dam = (rlev * 4) + 50 + damroll(10, 10);
2489                         breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2490                         break;
2491                 }
2492
2493                 /* RF5_BA_DARK */
2494                 case 128+8:
2495                 {
2496                         disturb(1, 0);
2497 #ifdef JP
2498 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2499 #else
2500                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2501 #endif
2502
2503 #ifdef JP
2504 else msg_format("%^s¤¬°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2505 #else
2506                         else msg_format("%^s invokes a darkness storm.", m_name);
2507 #endif
2508
2509                         dam = (rlev * 4) + 50 + damroll(10, 10);
2510                         breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2511                         update_smart_learn(m_idx, DRS_DARK);
2512                         break;
2513                 }
2514
2515                 /* RF5_DRAIN_MANA */
2516                 case 128+9:
2517                 {
2518                         if (!direct) return (FALSE);
2519                         disturb(1, 0);
2520                         if (p_ptr->csp)
2521                         {
2522                                 int r1;
2523
2524                                 /* Basic message */
2525 #ifdef JP
2526 msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2527 #else
2528                                 msg_format("%^s draws psychic energy from you!", m_name);
2529 #endif
2530
2531
2532                                 /* Attack power */
2533                                 r1 = (randint1(rlev) / 2) + 1;
2534
2535                                 /* Full drain */
2536                                 if (r1 >= p_ptr->csp)
2537                                 {
2538                                         r1 = p_ptr->csp;
2539                                         p_ptr->csp = 0;
2540                                         p_ptr->csp_frac = 0;
2541                                 }
2542
2543                                 /* Partial drain */
2544                                 else
2545                                 {
2546                                         p_ptr->csp -= r1;
2547                                 }
2548
2549                                 learn_spell(MS_DRAIN_MANA);
2550
2551                                 /* Redraw mana */
2552                                 p_ptr->redraw |= (PR_MANA);
2553
2554                                 /* Window stuff */
2555                                 p_ptr->window |= (PW_PLAYER);
2556                                 p_ptr->window |= (PW_SPELL);
2557
2558                                 /* Heal the monster */
2559                                 if (m_ptr->hp < m_ptr->maxhp)
2560                                 {
2561                                         /* Heal */
2562                                         m_ptr->hp += (6 * r1);
2563                                         if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2564
2565                                         /* Redraw (later) if needed */
2566                                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2567                                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2568
2569                                         /* Special message */
2570                                         if (seen)
2571                                         {
2572 #ifdef JP
2573 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
2574 #else
2575                                                 msg_format("%^s appears healthier.", m_name);
2576 #endif
2577
2578                                         }
2579                                 }
2580                         }
2581                         update_smart_learn(m_idx, DRS_MANA);
2582                         break;
2583                 }
2584
2585                 /* RF5_MIND_BLAST */
2586                 case 128+10:
2587                 {
2588                         if (!direct) return (FALSE);
2589                         disturb(1, 0);
2590                         if (!seen)
2591                         {
2592 #ifdef JP
2593 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2594 #else
2595                                 msg_print("You feel something focusing on your mind.");
2596 #endif
2597
2598                         }
2599                         else
2600                         {
2601 #ifdef JP
2602 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¤Ë¤é¤ó¤Ç¤¤¤ë¡£", m_name);
2603 #else
2604                                 msg_format("%^s gazes deep into your eyes.", m_name);
2605 #endif
2606
2607                         }
2608
2609                         dam = damroll(7, 7);
2610                         breath(y, x, m_idx, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, learnable);
2611                         break;
2612                 }
2613
2614                 /* RF5_BRAIN_SMASH */
2615                 case 128+11:
2616                 {
2617                         if (!direct) return (FALSE);
2618                         disturb(1, 0);
2619                         if (!seen)
2620                         {
2621 #ifdef JP
2622 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2623 #else
2624                                 msg_print("You feel something focusing on your mind.");
2625 #endif
2626
2627                         }
2628                         else
2629                         {
2630 #ifdef JP
2631 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¸«¤Æ¤¤¤ë¡£", m_name);
2632 #else
2633                                 msg_format("%^s looks deep into your eyes.", m_name);
2634 #endif
2635
2636                         }
2637
2638                         dam = damroll(12, 12);
2639                         breath(y, x, m_idx, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, learnable);
2640                         break;
2641                 }
2642
2643                 /* RF5_CAUSE_1 */
2644                 case 128+12:
2645                 {
2646                         if (!direct) return (FALSE);
2647                         disturb(1, 0);
2648 #ifdef JP
2649 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2650 #else
2651                         if (blind) msg_format("%^s mumbles.", m_name);
2652 #endif
2653
2654 #ifdef JP
2655 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¼ö¤Ã¤¿¡£", m_name);
2656 #else
2657                         else msg_format("%^s points at you and curses.", m_name);
2658 #endif
2659
2660                         dam = damroll(3, 8);
2661                         breath(y, x, m_idx, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, learnable);
2662                         break;
2663                 }
2664
2665                 /* RF5_CAUSE_2 */
2666                 case 128+13:
2667                 {
2668                         if (!direct) return (FALSE);
2669                         disturb(1, 0);
2670 #ifdef JP
2671 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2672 #else
2673                         if (blind) msg_format("%^s mumbles.", m_name);
2674 #endif
2675
2676 #ifdef JP
2677 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤Ã¤¿¡£", m_name);
2678 #else
2679                         else msg_format("%^s points at you and curses horribly.", m_name);
2680 #endif
2681
2682                         dam = damroll(8, 8);
2683                         breath(y, x, m_idx, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, learnable);
2684                         break;
2685                 }
2686
2687                 /* RF5_CAUSE_3 */
2688                 case 128+14:
2689                 {
2690                         if (!direct) return (FALSE);
2691                         disturb(1, 0);
2692 #ifdef JP
2693 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
2694 #else
2695                         if (blind) msg_format("%^s mumbles loudly.", m_name);
2696 #endif
2697
2698 #ifdef JP
2699 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
2700 #else
2701                         else msg_format("%^s points at you, incanting terribly!", m_name);
2702 #endif
2703
2704                         dam = damroll(10, 15);
2705                         breath(y, x, m_idx, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, learnable);
2706                         break;
2707                 }
2708
2709                 /* RF5_CAUSE_4 */
2710                 case 128+15:
2711                 {
2712                         if (!direct) return (FALSE);
2713                         disturb(1, 0);
2714 #ifdef JP
2715 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2716 #else
2717                         if (blind) msg_format("%^s screams the word 'DIE!'", m_name);
2718 #endif
2719
2720 #ifdef JP
2721 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÈ빦¤òÆͤ¤¤Æ¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2722 #else
2723                         else msg_format("%^s points at you, screaming the word DIE!", m_name);
2724 #endif
2725
2726                         dam = damroll(15, 15);
2727                         breath(y, x, m_idx, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, learnable);
2728                         break;
2729                 }
2730
2731                 /* RF5_BO_ACID */
2732                 case 128+16:
2733                 {
2734                         if (!direct) return (FALSE);
2735                         disturb(1, 0);
2736 #ifdef JP
2737 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2738 #else
2739                         if (blind) msg_format("%^s mumbles.", m_name);
2740 #endif
2741
2742 #ifdef JP
2743 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2744 #else
2745                         else msg_format("%^s casts a acid bolt.", m_name);
2746 #endif
2747
2748                         dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2749                         bolt(m_idx, GF_ACID, dam, MS_BOLT_ACID, learnable);
2750                         update_smart_learn(m_idx, DRS_ACID);
2751                         update_smart_learn(m_idx, DRS_REFLECT);
2752                         break;
2753                 }
2754
2755                 /* RF5_BO_ELEC */
2756                 case 128+17:
2757                 {
2758                         if (!direct) return (FALSE);
2759                         disturb(1, 0);
2760 #ifdef JP
2761 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2762 #else
2763                         if (blind) msg_format("%^s mumbles.", m_name);
2764 #endif
2765
2766 #ifdef JP
2767 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2768 #else
2769                         else msg_format("%^s casts a lightning bolt.", m_name);
2770 #endif
2771
2772                         dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2773                         bolt(m_idx, GF_ELEC, dam, MS_BOLT_ELEC, learnable);
2774                         update_smart_learn(m_idx, DRS_ELEC);
2775                         update_smart_learn(m_idx, DRS_REFLECT);
2776                         break;
2777                 }
2778
2779                 /* RF5_BO_FIRE */
2780                 case 128+18:
2781                 {
2782                         if (!direct) return (FALSE);
2783                         disturb(1, 0);
2784 #ifdef JP
2785 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2786 #else
2787                         if (blind) msg_format("%^s mumbles.", m_name);
2788 #endif
2789
2790 #ifdef JP
2791 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2792 #else
2793                         else msg_format("%^s casts a fire bolt.", m_name);
2794 #endif
2795
2796                         dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2797                         bolt(m_idx, GF_FIRE, dam, MS_BOLT_FIRE, learnable);
2798                         update_smart_learn(m_idx, DRS_FIRE);
2799                         update_smart_learn(m_idx, DRS_REFLECT);
2800                         break;
2801                 }
2802
2803                 /* RF5_BO_COLD */
2804                 case 128+19:
2805                 {
2806                         if (!direct) return (FALSE);
2807                         disturb(1, 0);
2808 #ifdef JP
2809 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2810 #else
2811                         if (blind) msg_format("%^s mumbles.", m_name);
2812 #endif
2813
2814 #ifdef JP
2815 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2816 #else
2817                         else msg_format("%^s casts a frost bolt.", m_name);
2818 #endif
2819
2820                         dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2821                         bolt(m_idx, GF_COLD, dam, MS_BOLT_COLD, learnable);
2822                         update_smart_learn(m_idx, DRS_COLD);
2823                         update_smart_learn(m_idx, DRS_REFLECT);
2824                         break;
2825                 }
2826
2827                 /* RF5_BA_LITE */
2828                 case 128+20:
2829                 {
2830                         disturb(1, 0);
2831 #ifdef JP
2832 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2833 #else
2834                         if (blind) msg_format("%^s mumbles powerfully.", m_name);
2835 #endif
2836
2837 #ifdef JP
2838 else msg_format("%^s¤¬¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2839 #else
2840                         else msg_format("%^s invokes a starburst.", m_name);
2841 #endif
2842
2843                         dam = (rlev * 4) + 50 + damroll(10, 10);
2844                         breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2845                         update_smart_learn(m_idx, DRS_LITE);
2846                         break;
2847                 }
2848
2849                 /* RF5_BO_NETH */
2850                 case 128+21:
2851                 {
2852                         if (!direct) return (FALSE);
2853                         disturb(1, 0);
2854 #ifdef JP
2855 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2856 #else
2857                         if (blind) msg_format("%^s mumbles.", m_name);
2858 #endif
2859
2860 #ifdef JP
2861 else msg_format("%^s¤¬ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2862 #else
2863                         else msg_format("%^s casts a nether bolt.", m_name);
2864 #endif
2865
2866                         dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
2867                         bolt(m_idx, GF_NETHER, dam, MS_BOLT_NETHER, learnable);
2868                         update_smart_learn(m_idx, DRS_NETH);
2869                         update_smart_learn(m_idx, DRS_REFLECT);
2870                         break;
2871                 }
2872
2873                 /* RF5_BO_WATE */
2874                 case 128+22:
2875                 {
2876                         if (!direct) return (FALSE);
2877                         disturb(1, 0);
2878 #ifdef JP
2879 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2880 #else
2881                         if (blind) msg_format("%^s mumbles.", m_name);
2882 #endif
2883
2884 #ifdef JP
2885 else msg_format("%^s¤¬¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2886 #else
2887                         else msg_format("%^s casts a water bolt.", m_name);
2888 #endif
2889
2890                         dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2891                         bolt(m_idx, GF_WATER, dam, MS_BOLT_WATER, learnable);
2892                         update_smart_learn(m_idx, DRS_REFLECT);
2893                         break;
2894                 }
2895
2896                 /* RF5_BO_MANA */
2897                 case 128+23:
2898                 {
2899                         if (!direct) return (FALSE);
2900                         disturb(1, 0);
2901 #ifdef JP
2902 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2903 #else
2904                         if (blind) msg_format("%^s mumbles.", m_name);
2905 #endif
2906
2907 #ifdef JP
2908 else msg_format("%^s¤¬ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2909 #else
2910                         else msg_format("%^s casts a mana bolt.", m_name);
2911 #endif
2912
2913                         dam = randint1(rlev * 7 / 2) + 50;
2914                         bolt(m_idx, GF_MANA, dam, MS_BOLT_MANA, learnable);
2915                         update_smart_learn(m_idx, DRS_REFLECT);
2916                         break;
2917                 }
2918
2919                 /* RF5_BO_PLAS */
2920                 case 128+24:
2921                 {
2922                         if (!direct) return (FALSE);
2923                         disturb(1, 0);
2924 #ifdef JP
2925 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2926 #else
2927                         if (blind) msg_format("%^s mumbles.", m_name);
2928 #endif
2929
2930 #ifdef JP
2931 else msg_format("%^s¤¬¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2932 #else
2933                         else msg_format("%^s casts a plasma bolt.", m_name);
2934 #endif
2935
2936                         dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2937                         bolt(m_idx, GF_PLASMA, dam, MS_BOLT_PLASMA, learnable);
2938                         update_smart_learn(m_idx, DRS_REFLECT);
2939                         break;
2940                 }
2941
2942                 /* RF5_BO_ICEE */
2943                 case 128+25:
2944                 {
2945                         if (!direct) return (FALSE);
2946                         disturb(1, 0);
2947 #ifdef JP
2948 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2949 #else
2950                         if (blind) msg_format("%^s mumbles.", m_name);
2951 #endif
2952
2953 #ifdef JP
2954 else msg_format("%^s¤¬¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2955 #else
2956                         else msg_format("%^s casts an ice bolt.", m_name);
2957 #endif
2958
2959                         dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
2960                         bolt(m_idx, GF_ICE, dam, MS_BOLT_ICE, learnable);
2961                         update_smart_learn(m_idx, DRS_COLD);
2962                         update_smart_learn(m_idx, DRS_REFLECT);
2963                         break;
2964                 }
2965
2966                 /* RF5_MISSILE */
2967                 case 128+26:
2968                 {
2969                         if (!direct) return (FALSE);
2970                         disturb(1, 0);
2971 #ifdef JP
2972 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2973 #else
2974                         if (blind) msg_format("%^s mumbles.", m_name);
2975 #endif
2976
2977 #ifdef JP
2978 else msg_format("%^s¤¬¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2979 #else
2980                         else msg_format("%^s casts a magic missile.", m_name);
2981 #endif
2982
2983                         dam = damroll(2, 6) + (rlev / 3);
2984                         bolt(m_idx, GF_MISSILE, dam, MS_MAGIC_MISSILE, learnable);
2985                         update_smart_learn(m_idx, DRS_REFLECT);
2986                         break;
2987                 }
2988
2989                 /* RF5_SCARE */
2990                 case 128+27:
2991                 {
2992                         if (!direct) return (FALSE);
2993                         disturb(1, 0);
2994 #ifdef JP
2995 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
2996 #else
2997                         if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
2998 #endif
2999
3000 #ifdef JP
3001 else msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3002 #else
3003                         else msg_format("%^s casts a fearful illusion.", m_name);
3004 #endif
3005
3006                         if (p_ptr->resist_fear)
3007                         {
3008 #ifdef JP
3009 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3010 #else
3011                                 msg_print("You refuse to be frightened.");
3012 #endif
3013
3014                         }
3015                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3016                         {
3017 #ifdef JP
3018 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3019 #else
3020                                 msg_print("You refuse to be frightened.");
3021 #endif
3022
3023                         }
3024                         else
3025                         {
3026                                 (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
3027                         }
3028                         learn_spell(MS_SCARE);
3029                         update_smart_learn(m_idx, DRS_FEAR);
3030                         break;
3031                 }
3032
3033                 /* RF5_BLIND */
3034                 case 128+28:
3035                 {
3036                         if (!direct) return (FALSE);
3037                         disturb(1, 0);
3038 #ifdef JP
3039 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3040 #else
3041                         if (blind) msg_format("%^s mumbles.", m_name);
3042 #endif
3043
3044 #ifdef JP
3045 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¤¢¤Ê¤¿¤ÎÌܤò¤¯¤é¤Þ¤·¤¿¡ª", m_name);
3046 #else
3047                         else msg_format("%^s casts a spell, burning your eyes!", m_name);
3048 #endif
3049
3050                         if (p_ptr->resist_blind)
3051                         {
3052 #ifdef JP
3053 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3054 #else
3055                                 msg_print("You are unaffected!");
3056 #endif
3057
3058                         }
3059                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3060                         {
3061 #ifdef JP
3062 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3063 #else
3064                                 msg_print("You resist the effects!");
3065 #endif
3066
3067                         }
3068                         else
3069                         {
3070                                 (void)set_blind(12 + randint0(4));
3071                         }
3072                         learn_spell(MS_BLIND);
3073                         update_smart_learn(m_idx, DRS_BLIND);
3074                         break;
3075                 }
3076
3077                 /* RF5_CONF */
3078                 case 128+29:
3079                 {
3080                         if (!direct) return (FALSE);
3081                         disturb(1, 0);
3082 #ifdef JP
3083 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
3084 #else
3085                         if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
3086 #endif
3087
3088 #ifdef JP
3089 else msg_format("%^s¤¬Í¶ÏÇŪ¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3090 #else
3091                         else msg_format("%^s creates a mesmerising illusion.", m_name);
3092 #endif
3093
3094                         if (p_ptr->resist_conf)
3095                         {
3096 #ifdef JP
3097 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3098 #else
3099                                 msg_print("You disbelieve the feeble spell.");
3100 #endif
3101
3102                         }
3103                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3104                         {
3105 #ifdef JP
3106 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3107 #else
3108                                 msg_print("You disbelieve the feeble spell.");
3109 #endif
3110
3111                         }
3112                         else
3113                         {
3114                                 (void)set_confused(p_ptr->confused + randint0(4) + 4);
3115                         }
3116                         learn_spell(MS_CONF);
3117                         update_smart_learn(m_idx, DRS_CONF);
3118                         break;
3119                 }
3120
3121                 /* RF5_SLOW */
3122                 case 128+30:
3123                 {
3124                         if (!direct) return (FALSE);
3125                         disturb(1, 0);
3126 #ifdef JP
3127 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
3128 #else
3129                         msg_format("%^s drains power from your muscles!", m_name);
3130 #endif
3131
3132                         if (p_ptr->free_act)
3133                         {
3134 #ifdef JP
3135 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3136 #else
3137                                 msg_print("You are unaffected!");
3138 #endif
3139
3140                         }
3141                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3142                         {
3143 #ifdef JP
3144 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3145 #else
3146                                 msg_print("You resist the effects!");
3147 #endif
3148
3149                         }
3150                         else
3151                         {
3152                                 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
3153                         }
3154                         learn_spell(MS_SLOW);
3155                         update_smart_learn(m_idx, DRS_FREE);
3156                         break;
3157                 }
3158
3159                 /* RF5_HOLD */
3160                 case 128+31:
3161                 {
3162                         if (!direct) return (FALSE);
3163                         disturb(1, 0);
3164 #ifdef JP
3165 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3166 #else
3167                         if (blind) msg_format("%^s mumbles.", m_name);
3168 #endif
3169
3170 #ifdef JP
3171 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÌܤò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡ª", m_name);
3172 #else
3173                         else msg_format("%^s stares deep into your eyes!", m_name);
3174 #endif
3175
3176                         if (p_ptr->free_act)
3177                         {
3178 #ifdef JP
3179 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3180 #else
3181                                 msg_print("You are unaffected!");
3182 #endif
3183
3184                         }
3185                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3186                         {
3187 #ifdef JP
3188 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3189 #else
3190                                 msg_format("You resist the effects!");
3191 #endif
3192
3193                         }
3194                         else
3195                         {
3196                                 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
3197                         }
3198                         learn_spell(MS_SLEEP);
3199                         update_smart_learn(m_idx, DRS_FREE);
3200                         break;
3201                 }
3202
3203                 /* RF6_HASTE */
3204                 case 160+0:
3205                 {
3206                         disturb(1, 0);
3207                         if (blind)
3208                         {
3209 #ifdef JP
3210 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3211 #else
3212                                 msg_format("%^s mumbles.", m_name);
3213 #endif
3214
3215                         }
3216                         else
3217                         {
3218 #ifdef JP
3219 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name);
3220 #else
3221                                 msg_format("%^s concentrates on %s body.", m_name, m_poss);
3222 #endif
3223
3224                         }
3225
3226                         /* Allow quick speed increases to base+10 */
3227                         if (!m_ptr->fast)
3228                         {
3229 #ifdef JP
3230 msg_format("%^s¤ÎÆ°¤­¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
3231 #else
3232                                 msg_format("%^s starts moving faster.", m_name);
3233 #endif
3234                         }
3235                         m_ptr->fast = MIN(200, m_ptr->fast + 100);
3236                         if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS;
3237                         break;
3238                 }
3239
3240                 /* RF6_HAND_DOOM */
3241                 case 160+1:
3242                 {
3243                         if (!direct) return (FALSE);
3244                         disturb(1, 0);
3245 #ifdef JP
3246 msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
3247 #else
3248                         msg_format("%^s invokes the Hand of Doom!", m_name);
3249 #endif
3250                         dam = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
3251                         breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, learnable);
3252                         break;
3253                 }
3254
3255                 /* RF6_HEAL */
3256                 case 160+2:
3257                 {
3258                         disturb(1, 0);
3259
3260                         /* Message */
3261                         if (blind)
3262                         {
3263 #ifdef JP
3264 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3265 #else
3266                                 msg_format("%^s mumbles.", m_name);
3267 #endif
3268
3269                         }
3270                         else
3271                         {
3272 #ifdef JP
3273 msg_format("%^s¤¬¼«Ê¬¤Î½ý¤Ë½¸Ã椷¤¿¡£", m_name);
3274 #else
3275                                 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3276 #endif
3277
3278                         }
3279
3280                         /* Heal some */
3281                         m_ptr->hp += (rlev * 6);
3282
3283                         /* Fully healed */
3284                         if (m_ptr->hp >= m_ptr->maxhp)
3285                         {
3286                                 /* Fully healed */
3287                                 m_ptr->hp = m_ptr->maxhp;
3288
3289                                 /* Message */
3290                                 if (seen)
3291                                 {
3292 #ifdef JP
3293 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3294 #else
3295                                         msg_format("%^s looks completely healed!", m_name);
3296 #endif
3297
3298                                 }
3299                                 else
3300                                 {
3301 #ifdef JP
3302 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¤è¤¦¤À¡ª", m_name);
3303 #else
3304                                         msg_format("%^s sounds completely healed!", m_name);
3305 #endif
3306
3307                                 }
3308                         }
3309
3310                         /* Partially healed */
3311                         else
3312                         {
3313                                 /* Message */
3314                                 if (seen)
3315                                 {
3316 #ifdef JP
3317 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3318 #else
3319                                         msg_format("%^s looks healthier.", m_name);
3320 #endif
3321
3322                                 }
3323                                 else
3324                                 {
3325 #ifdef JP
3326 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3327 #else
3328                                         msg_format("%^s sounds healthier.", m_name);
3329 #endif
3330
3331                                 }
3332                         }
3333
3334                         /* Redraw (later) if needed */
3335                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3336                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3337
3338                         /* Cancel fear */
3339                         if (m_ptr->monfear)
3340                         {
3341                                 /* Cancel fear */
3342                                 m_ptr->monfear = 0;
3343
3344                                 /* Message */
3345 #ifdef JP
3346 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3347 #else
3348                                 msg_format("%^s recovers %s courage.", m_name, m_poss);
3349 #endif
3350
3351                         }
3352                         break;
3353                 }
3354
3355                 /* RF6_INVULNER */
3356                 case 160+3:
3357                 {
3358                         disturb(1, 0);
3359
3360                         /* Message */
3361                         if (!seen)
3362                         {
3363 #ifdef JP
3364 msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3365 #else
3366                                 msg_format("%^s mumbles powerfully.", m_name);
3367 #endif
3368
3369                         }
3370                         else
3371                         {
3372 #ifdef JP
3373 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3374 #else
3375                                 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3376 #endif
3377
3378                         }
3379
3380                         if (!(m_ptr->invulner))
3381                                 m_ptr->invulner = randint1(4) + 4;
3382
3383                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3384                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3385                         break;
3386                 }
3387
3388                 /* RF6_BLINK */
3389                 case 160+4:
3390                 {
3391                         disturb(1, 0);
3392 #ifdef JP
3393 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3394 #else
3395                         msg_format("%^s blinks away.", m_name);
3396 #endif
3397
3398                         teleport_away(m_idx, 10, FALSE);
3399                         p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
3400                         break;
3401                 }
3402
3403                 /* RF6_TPORT */
3404                 case 160+5:
3405                 {
3406                         int i, oldfy, oldfx;
3407                         u32b flgs[TR_FLAG_SIZE];
3408                         object_type *o_ptr;
3409
3410                         oldfy = m_ptr->fy;
3411                         oldfx = m_ptr->fx;
3412
3413                         disturb(1, 0);
3414 #ifdef JP
3415 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3416 #else
3417                         msg_format("%^s teleports away.", m_name);
3418 #endif
3419
3420                         teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
3421
3422                         if (los(py, px, oldfy, oldfx) && !world_monster)
3423                         {
3424                                 for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
3425                                 {
3426                                         o_ptr = &inventory[i];
3427                                         if(!cursed_p(o_ptr))
3428                                         {
3429                                                 object_flags(o_ptr, flgs);
3430
3431                                                 if((have_flag(flgs, TR_TELEPORT)) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
3432                                                 {
3433 #ifdef JP
3434                                                         if(get_check_strict("¤Ä¤¤¤Æ¤¤¤­¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3435 #else
3436                                                         if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
3437 #endif
3438                                                         {
3439                                                                 if (one_in_(3))
3440                                                                 {
3441                                                                         teleport_player(200);
3442 #ifdef JP
3443                                                                         msg_print("¼ºÇÔ¡ª");
3444 #else
3445                                                                         msg_print("Failed!");
3446 #endif
3447                                                                 }
3448                                                                 else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3449                                                                 p_ptr->energy_need += ENERGY_NEED();
3450                                                         }
3451                                                         break;
3452                                                 }
3453                                         }
3454                                 }
3455                         }
3456                         break;
3457                 }
3458
3459                 /* RF6_WORLD */
3460                 case 160+6:
3461                 {
3462                         int who = 0;
3463                         disturb(1, 0);
3464                         if(m_ptr->r_idx == MON_DIO) who = 1;
3465                         else if(m_ptr->r_idx == MON_WONG) who = 3;
3466                         dam = who;
3467                         if (!process_the_world(randint1(2)+2, who, TRUE)) return (FALSE);
3468                         break;
3469                 }
3470
3471                 /* RF6_SPECIAL */
3472                 case 160+7:
3473                 {
3474                         int k;
3475
3476                         disturb(1, 0);
3477                         switch(m_ptr->r_idx)
3478                         {
3479                         case MON_OHMU:
3480                                 /* Moved to process_monster(), like multiplication */
3481                                 return FALSE;
3482
3483                         case MON_BANORLUPART:
3484                                 {
3485                                         int dummy_hp = (m_ptr->hp + 1) / 2;
3486                                         int dummy_maxhp = m_ptr->maxhp/2;
3487                                         int dummy_y = m_ptr->fy;
3488                                         int dummy_x = m_ptr->fx;
3489
3490                                         if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
3491                                         delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
3492                                         summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
3493                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3494                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3495                                         summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
3496                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3497                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3498
3499 #ifdef JP
3500                                         msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª");
3501 #else
3502                                         msg_print("Banor=Rupart splits in two person!");
3503 #endif
3504
3505                                         break;
3506                                 }
3507                                 case MON_BANOR:
3508                                 case MON_LUPART:
3509                                 {
3510                                         int dummy_hp = 0;
3511                                         int dummy_maxhp = 0;
3512                                         int dummy_y = m_ptr->fy;
3513                                         int dummy_x = m_ptr->fx;
3514
3515                                         if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
3516                                         for (k = 1; k < m_max; k++)
3517                                         {
3518                                                 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
3519                                                 {
3520                                                         dummy_hp += m_list[k].hp;
3521                                                         dummy_maxhp += m_list[k].maxhp;
3522                                                         if (m_list[k].r_idx != m_ptr->r_idx)
3523                                                         {
3524                                                                 dummy_y = m_list[k].fy;
3525                                                                 dummy_x = m_list[k].fx;
3526                                                         }
3527                                                         delete_monster_idx(k);
3528                                                 }
3529                                         }
3530                                         summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
3531                                         m_list[hack_m_idx_ii].hp = dummy_hp;
3532                                         m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3533
3534 #ifdef JP
3535                                         msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª");
3536 #else
3537                                         msg_print("Banor and Rupart combine into one!");
3538 #endif
3539
3540                                         break;
3541                                 }
3542
3543                         default:
3544                                 if (r_ptr->d_char == 'B')
3545                                 {
3546                                         disturb(1, 0);
3547                                         if (one_in_(3) || !direct)
3548                                         {
3549 #ifdef JP
3550                                                 msg_format("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", m_name);
3551 #else
3552                                                 msg_format("%^s suddenly go out of your sight!", m_name);
3553 #endif
3554                                                 teleport_away(m_idx, 10, FALSE);
3555                                                 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
3556                                         }
3557                                         else
3558                                         {
3559                                                 int get_damage = 0;
3560                                                 bool fear; /* dummy */
3561
3562 #ifdef JP
3563                                                 msg_format("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍ¤¿¡£", m_name);
3564 #else
3565                                                 msg_format("%^s holds you, and drops from the sky.", m_name);
3566 #endif
3567                                                 dam = damroll(4, 8);
3568                                                 teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE);
3569
3570                                                 sound(SOUND_FALL);
3571
3572                                                 if (p_ptr->ffall)
3573                                                 {
3574 #ifdef JP
3575                                                         msg_print("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£");
3576 #else
3577                                                         msg_print("You float gently down to the ground.");
3578 #endif
3579                                                 }
3580                                                 else
3581                                                 {
3582 #ifdef JP
3583                                                         msg_print("¤¢¤Ê¤¿¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£");
3584 #else
3585                                                         msg_print("You crashed into the ground.");
3586 #endif
3587                                                         dam += damroll(6, 8);
3588                                                 }
3589
3590                                                 /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
3591                                                    -- henkma
3592                                                  */
3593                                                 get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
3594                                                 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
3595                                                 {
3596 #ifdef JP
3597                                                         msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
3598 #else
3599                                                         char m_name_self[80];
3600
3601                                                         /* hisself */
3602                                                         monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3603
3604                                                         msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3605 #endif
3606                                                         project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3607                                                         set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3608                                                 }
3609
3610                                                 if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, NULL, m_idx);
3611                                         }
3612                                         break;
3613                                 }
3614
3615                                 /* Something is wrong */
3616                                 else return FALSE;
3617                         }
3618                         break;
3619                 }
3620
3621                 /* RF6_TELE_TO */
3622                 case 160+8:
3623                 {
3624                         if (!direct) return (FALSE);
3625                         disturb(1, 0);
3626 #ifdef JP
3627 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", m_name);
3628 #else
3629                         msg_format("%^s commands you to return.", m_name);
3630 #endif
3631
3632                         teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3633                         learn_spell(MS_TELE_TO);
3634                         break;
3635                 }
3636
3637                 /* RF6_TELE_AWAY */
3638                 case 160+9:
3639                 {
3640                         if (!direct) return (FALSE);
3641                         disturb(1, 0);
3642 #ifdef JP
3643 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
3644                         if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
3645                                 msg_print("¤¯¤Ã¤½¡Á");
3646 #else
3647                         msg_format("%^s teleports you away.", m_name);
3648 #endif
3649
3650                         learn_spell(MS_TELE_AWAY);
3651                         teleport_player(100);
3652                         break;
3653                 }
3654
3655                 /* RF6_TELE_LEVEL */
3656                 case 160+10:
3657                 {
3658                         if (!direct) return (FALSE);
3659                         disturb(1, 0);
3660 #ifdef JP
3661 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3662 #else
3663                         if (blind) msg_format("%^s mumbles strangely.", m_name);
3664 #endif
3665
3666 #ifdef JP
3667 else msg_format("%^s¤¬¤¢¤Ê¤¿¤Î­¤ò»Ø¤µ¤·¤¿¡£", m_name);
3668 #else
3669                         else msg_format("%^s gestures at your feet.", m_name);
3670 #endif
3671
3672                         if (p_ptr->resist_nexus)
3673                         {
3674 #ifdef JP
3675 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3676 #else
3677                                 msg_print("You are unaffected!");
3678 #endif
3679
3680                         }
3681                         else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3682                         {
3683 #ifdef JP
3684 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3685 #else
3686                                 msg_print("You resist the effects!");
3687 #endif
3688
3689                         }
3690                         else
3691                         {
3692                                 teleport_level(0);
3693                         }
3694                         learn_spell(MS_TELE_LEVEL);
3695                         update_smart_learn(m_idx, DRS_NEXUS);
3696                         break;
3697                 }
3698
3699                 /* RF6_PSY_SPEAR */
3700                 case 160+11:
3701                 {
3702                         if (!direct) return (FALSE);
3703                         disturb(1, 0);
3704 #ifdef JP
3705 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3706 #else
3707                         if (blind) msg_format("%^s mumbles.", m_name);
3708 #endif
3709
3710 #ifdef JP
3711 else msg_format("%^s¤¬¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name);
3712 #else
3713                         else msg_format("%^s throw a Psycho-Spear.", m_name);
3714 #endif
3715
3716                         dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
3717                         beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
3718                         break;
3719                 }
3720
3721                 /* RF6_DARKNESS */
3722                 case 160+12:
3723                 {
3724                         if (!direct) return (FALSE);
3725                         disturb(1, 0);
3726 #ifdef JP
3727 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3728 #else
3729                         if (blind) msg_format("%^s mumbles.", m_name);
3730 #endif
3731
3732 #ifdef JP
3733 else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3734 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3735 #else
3736                         else if (p_ptr->pclass == CLASS_NINJA)
3737                                 msg_format("%^s cast a spell to light up.", m_name);
3738                         else msg_format("%^s gestures in shadow.", m_name);
3739 #endif
3740
3741                         learn_spell(MS_DARKNESS);
3742                         if (p_ptr->pclass == CLASS_NINJA)
3743                                 (void)lite_area(0, 3);
3744                         else
3745                                 (void)unlite_area(0, 3);
3746                         break;
3747                 }
3748
3749                 /* RF6_TRAPS */
3750                 case 160+13:
3751                 {
3752                         disturb(1, 0);
3753 #ifdef JP
3754 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
3755 #else
3756                         if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
3757 #endif
3758
3759 #ifdef JP
3760 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
3761 #else
3762                         else msg_format("%^s casts a spell and cackles evilly.", m_name);
3763 #endif
3764
3765                         learn_spell(MS_MAKE_TRAP);
3766                         (void)trap_creation(y, x);
3767                         break;
3768                 }
3769
3770                 /* RF6_FORGET */
3771                 case 160+14:
3772                 {
3773                         if (!direct) return (FALSE);
3774                         disturb(1, 0);
3775 #ifdef JP
3776 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ­²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);
3777 #else
3778                         msg_format("%^s tries to blank your mind.", m_name);
3779 #endif
3780
3781
3782                         if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3783                         {
3784 #ifdef JP
3785 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3786 #else
3787                                 msg_print("You resist the effects!");
3788 #endif
3789
3790                         }
3791                         else if (lose_all_info())
3792                         {
3793 #ifdef JP
3794 msg_print("µ­²±¤¬Çö¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
3795 #else
3796                                 msg_print("Your memories fade away.");
3797 #endif
3798
3799                         }
3800                         learn_spell(MS_FORGET);
3801                         break;
3802                 }
3803
3804                 /* RF6_RAISE_DEAD */
3805                 case 160+15:
3806                 {
3807                         disturb(1, 0);
3808 #ifdef JP
3809 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3810 #else
3811                         if (blind) msg_format("%^s mumbles.", m_name);
3812 #endif
3813
3814 #ifdef JP
3815 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3816 #else
3817                         else msg_format("%^s casts a spell to revive corpses.", m_name);
3818 #endif
3819                         animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3820                         break;
3821                 }
3822
3823                 /* RF6_SUMMON_KIN */
3824                 case 160+16:
3825                 {
3826                         disturb(1, 0);
3827                         if (m_ptr->r_idx == MON_ROLENTO)
3828                         {
3829 #ifdef JP
3830                                 if (blind)
3831                                         msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name);
3832                                 else 
3833                                         msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3834 #else
3835                                 if (blind)
3836                                         msg_format("%^s spreads something.", m_name);
3837                                 else
3838                                         msg_format("%^s throws some hand grenades.", m_name);
3839 #endif
3840                         }
3841                         else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
3842                         {
3843 #ifdef JP
3844                                 if (blind)
3845                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3846                                 else
3847                                         msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´­¤·¤¿¡£", m_name);
3848 #else
3849                                 if (blind)
3850                                         msg_format("%^s mumbles.", m_name);
3851                                 else
3852                                         msg_format("%^s magically summons guardians of dungeons.", m_name);
3853 #endif
3854                         }
3855                         else
3856                         {
3857 #ifdef JP
3858                                 if (blind)
3859                                         msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3860                                 else
3861                                         msg_format("%^s¤ÏËâË¡¤Ç%s¤ò¾¤´­¤·¤¿¡£",
3862                                         m_name,
3863                                         ((r_ptr->flags1) & RF1_UNIQUE ?
3864                                         "¼ê²¼" : "Ãç´Ö"));
3865 #else
3866                                 if (blind)
3867                                         msg_format("%^s mumbles.", m_name);
3868                                 else
3869                                         msg_format("%^s magically summons %s %s.",
3870                                         m_name, m_poss,
3871                                         ((r_ptr->flags1) & RF1_UNIQUE ?
3872                                         "minions" : "kin"));
3873 #endif
3874                         }
3875
3876                         if(m_ptr->r_idx == MON_ROLENTO)
3877                         {
3878                                 int num = 1 + randint1(3);
3879
3880                                 for (k = 0; k < num; k++)
3881                                 {
3882                                         count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
3883                                 }
3884                         }
3885                         else if(m_ptr->r_idx == MON_THORONDOR ||
3886                                 m_ptr->r_idx == MON_GWAIHIR ||
3887                                 m_ptr->r_idx == MON_MENELDOR)
3888                         {
3889                                 int num = 4 + randint1(3);
3890                                 for (k = 0; k < num; k++)
3891                                 {
3892                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3893                                 }
3894                         }
3895                         else if(m_ptr->r_idx == MON_LOUSY)
3896                         {
3897                                 int num = 2 + randint1(3);
3898                                 for (k = 0; k < num; k++)
3899                                 {
3900                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
3901                                 }
3902                         }
3903                         else if(m_ptr->r_idx == MON_BULLGATES)
3904                         {
3905                                 int num = 2 + randint1(3);
3906                                 for (k = 0; k < num; k++)
3907                                 {
3908                                         count += summon_named_creature(m_idx, y, x, 921, mode);
3909                                 }
3910                         }
3911                         else if (m_ptr->r_idx == MON_CALDARM)
3912                         {
3913                                 int num = randint1(3);
3914                                 for (k = 0; k < num; k++)
3915                                 {
3916                                         count += summon_named_creature(m_idx, y, x, 930, mode);
3917                                 }
3918                         }
3919                         else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
3920                         {
3921                                 int num = 2 + randint1(3);
3922
3923                                 if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
3924                                 {
3925 #ifdef JP
3926                                         msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤­½Ð¤·¤¿¡ª");
3927 #else
3928                                         msg_print("Water blew off from the ground!");
3929 #endif
3930                                         fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
3931                                 }
3932
3933                                 for (k = 0; k < num; k++)
3934                                 {
3935                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
3936                                 }
3937                         }
3938                         else
3939                         {
3940
3941                                 summon_kin_type = r_ptr->d_char; /* Big hack */
3942
3943                                 for (k = 0; k < 4; k++)
3944                                 {
3945                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
3946                                 }
3947                         }
3948 #ifdef JP
3949 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
3950 #else
3951                         if (blind && count) msg_print("You hear many things appear nearby.");
3952 #endif
3953
3954
3955                         break;
3956                 }
3957
3958                 /* RF6_S_CYBER */
3959                 case 160+17:
3960                 {
3961                         disturb(1, 0);
3962 #ifdef JP
3963 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3964 #else
3965                         if (blind) msg_format("%^s mumbles.", m_name);
3966 #endif
3967
3968 #ifdef JP
3969 else msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
3970 #else
3971                         else msg_format("%^s magically summons Cyberdemons!", m_name);
3972 #endif
3973
3974 #ifdef JP
3975 if (blind && count) msg_print("½Å¸ü¤Ê­²»¤¬¶á¤¯¤Çʹ¤³¤¨¤ë¡£");
3976 #else
3977                         if (blind && count) msg_print("You hear heavy steps nearby.");
3978 #endif
3979
3980                         summon_cyber(m_idx, y, x);
3981                         break;
3982                 }
3983
3984                 /* RF6_S_MONSTER */
3985                 case 160+18:
3986                 {
3987                         disturb(1, 0);
3988 #ifdef JP
3989 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3990 #else
3991                         if (blind) msg_format("%^s mumbles.", m_name);
3992 #endif
3993
3994 #ifdef JP
3995 else msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´­¤·¤¿¡ª", m_name);
3996 #else
3997                         else msg_format("%^s magically summons help!", m_name);
3998 #endif
3999
4000                         for (k = 0; k < 1; k++)
4001                         {
4002                                 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4003                         }
4004 #ifdef JP
4005 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4006 #else
4007                         if (blind && count) msg_print("You hear something appear nearby.");
4008 #endif
4009
4010                         break;
4011                 }
4012
4013                 /* RF6_S_MONSTERS */
4014                 case 160+19:
4015                 {
4016                         disturb(1, 0);
4017 #ifdef JP
4018 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4019 #else
4020                         if (blind) msg_format("%^s mumbles.", m_name);
4021 #endif
4022
4023 #ifdef JP
4024 else msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª", m_name);
4025 #else
4026                         else msg_format("%^s magically summons monsters!", m_name);
4027 #endif
4028
4029                         for (k = 0; k < s_num_6; k++)
4030                         {
4031                                 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4032                         }
4033 #ifdef JP
4034 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4035 #else
4036                         if (blind && count) msg_print("You hear many things appear nearby.");
4037 #endif
4038
4039                         break;
4040                 }
4041
4042                 /* RF6_S_ANT */
4043                 case 160+20:
4044                 {
4045                         disturb(1, 0);
4046 #ifdef JP
4047 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4048 #else
4049                         if (blind) msg_format("%^s mumbles.", m_name);
4050 #endif
4051
4052 #ifdef JP
4053 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´­¤·¤¿¡£", m_name);
4054 #else
4055                         else msg_format("%^s magically summons ants.", m_name);
4056 #endif
4057
4058                         for (k = 0; k < s_num_6; k++)
4059                         {
4060                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
4061                         }
4062 #ifdef JP
4063 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4064 #else
4065                         if (blind && count) msg_print("You hear many things appear nearby.");
4066 #endif
4067
4068                         break;
4069                 }
4070
4071                 /* RF6_S_SPIDER */
4072                 case 160+21:
4073                 {
4074                         disturb(1, 0);
4075 #ifdef JP
4076 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4077 #else
4078                         if (blind) msg_format("%^s mumbles.", m_name);
4079 #endif
4080
4081 #ifdef JP
4082 else msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´­¤·¤¿¡£", m_name);
4083 #else
4084                         else msg_format("%^s magically summons spiders.", m_name);
4085 #endif
4086
4087                         for (k = 0; k < s_num_6; k++)
4088                         {
4089                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
4090                         }
4091 #ifdef JP
4092 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4093 #else
4094                         if (blind && count) msg_print("You hear many things appear nearby.");
4095 #endif
4096
4097                         break;
4098                 }
4099
4100                 /* RF6_S_HOUND */
4101                 case 160+22:
4102                 {
4103                         disturb(1, 0);
4104 #ifdef JP
4105 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4106 #else
4107                         if (blind) msg_format("%^s mumbles.", m_name);
4108 #endif
4109
4110 #ifdef JP
4111 else msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£", m_name);
4112 #else
4113                         else msg_format("%^s magically summons hounds.", m_name);
4114 #endif
4115
4116                         for (k = 0; k < s_num_4; k++)
4117                         {
4118                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
4119                         }
4120 #ifdef JP
4121 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4122 #else
4123                         if (blind && count) msg_print("You hear many things appear nearby.");
4124 #endif
4125
4126                         break;
4127                 }
4128
4129                 /* RF6_S_HYDRA */
4130                 case 160+23:
4131                 {
4132                         disturb(1, 0);
4133 #ifdef JP
4134 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4135 #else
4136                         if (blind) msg_format("%^s mumbles.", m_name);
4137 #endif
4138
4139 #ifdef JP
4140 else msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£", m_name);
4141 #else
4142                         else msg_format("%^s magically summons hydras.", m_name);
4143 #endif
4144
4145                         for (k = 0; k < s_num_4; k++)
4146                         {
4147                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
4148                         }
4149 #ifdef JP
4150 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4151 #else
4152                         if (blind && count) msg_print("You hear many things appear nearby.");
4153 #endif
4154
4155                         break;
4156                 }
4157
4158                 /* RF6_S_ANGEL */
4159                 case 160+24:
4160                 {
4161                         int num = 1;
4162
4163                         disturb(1, 0);
4164 #ifdef JP
4165 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4166 #else
4167                         if (blind) msg_format("%^s mumbles.", m_name);
4168 #endif
4169
4170 #ifdef JP
4171 else msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´­¤·¤¿¡ª", m_name);
4172 #else
4173                         else msg_format("%^s magically summons an angel!", m_name);
4174 #endif
4175
4176                         if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
4177                         {
4178                                 num += r_ptr->level/40;
4179                         }
4180
4181                         for (k = 0; k < num; k++)
4182                         {
4183                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
4184                         }
4185
4186                         if (count < 2)
4187                         {
4188 #ifdef JP
4189 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4190 #else
4191                                 if (blind && count) msg_print("You hear something appear nearby.");
4192 #endif
4193                         }
4194                         else
4195                         {
4196 #ifdef JP
4197 if (blind) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4198 #else
4199                                 if (blind) msg_print("You hear many things appear nearby.");
4200 #endif
4201                         }
4202
4203                         break;
4204                 }
4205
4206                 /* RF6_S_DEMON */
4207                 case 160+25:
4208                 {
4209                         disturb(1, 0);
4210 #ifdef JP
4211 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4212 #else
4213                         if (blind) msg_format("%^s mumbles.", m_name);
4214 #endif
4215
4216 #ifdef JP
4217 else msg_format("%^s¤ÏËâË¡¤Çº®Æ٤εÜÄ¤é°­Ëâ¤ò¾¤´­¤·¤¿¡ª", m_name);
4218 #else
4219                         else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4220 #endif
4221
4222                         for (k = 0; k < 1; k++)
4223                         {
4224                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
4225                         }
4226 #ifdef JP
4227 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4228 #else
4229                         if (blind && count) msg_print("You hear something appear nearby.");
4230 #endif
4231
4232                         break;
4233                 }
4234
4235                 /* RF6_S_UNDEAD */
4236                 case 160+26:
4237                 {
4238                         disturb(1, 0);
4239 #ifdef JP
4240 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4241 #else
4242                         if (blind) msg_format("%^s mumbles.", m_name);
4243 #endif
4244
4245 #ifdef JP
4246 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´­¤·¤¿¡ª", m_name);
4247 #else
4248                         else msg_format("%^s magically summons an undead adversary!", m_name);
4249 #endif
4250
4251                         for (k = 0; k < 1; k++)
4252                         {
4253                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
4254                         }
4255 #ifdef JP
4256 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4257 #else
4258                         if (blind && count) msg_print("You hear something appear nearby.");
4259 #endif
4260
4261                         break;
4262                 }
4263
4264                 /* RF6_S_DRAGON */
4265                 case 160+27:
4266                 {
4267                         disturb(1, 0);
4268 #ifdef JP
4269 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4270 #else
4271                         if (blind) msg_format("%^s mumbles.", m_name);
4272 #endif
4273
4274 #ifdef JP
4275 else msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4276 #else
4277                         else msg_format("%^s magically summons a dragon!", m_name);
4278 #endif
4279
4280                         for (k = 0; k < 1; k++)
4281                         {
4282                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
4283                         }
4284 #ifdef JP
4285 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4286 #else
4287                         if (blind && count) msg_print("You hear something appear nearby.");
4288 #endif
4289
4290                         break;
4291                 }
4292
4293                 /* RF6_S_HI_UNDEAD */
4294                 case 160+28:
4295                 {
4296                         disturb(1, 0);
4297
4298                         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))
4299                         {
4300                                 int cy = y;
4301                                 int cx = x;
4302
4303 #ifdef JP
4304 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4305 #else
4306                                 if (blind) msg_format("%^s mumbles.", m_name);
4307 #endif
4308
4309 #ifdef JP
4310 else msg_format("%^s¤¬ËâË¡¤ÇÍ©µ´ÀïÂâ¤ò¾¤´­¤·¤¿¡ª", m_name);
4311 #else
4312                                 else msg_format("%^s magically summons rangers of Nazgul!", m_name);
4313 #endif
4314                                 msg_print(NULL);
4315
4316                                 for (k = 0; k < 30; k++)
4317                                 {
4318                                         if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
4319                                         {
4320                                                 int j;
4321                                                 for (j = 100; j > 0; j--)
4322                                                 {
4323                                                         scatter(&cy, &cx, y, x, 2, 0);
4324                                                         if (cave_floor_bold(cy, cx)) break;
4325                                                 }
4326                                                 if (!j) break;
4327                                         }
4328                                         if (!cave_floor_bold(cy, cx)) continue;
4329
4330                                         if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
4331                                         {
4332                                                 y = cy;
4333                                                 x = cx;
4334                                                 count++;
4335                                                 if (count == 1)
4336 #ifdef JP
4337 msg_format("¡ÖÍ©µ´ÀïÂâ%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4338 #else
4339                                                         msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
4340 #endif
4341                                                 else
4342 #ifdef JP
4343 msg_format("¡ÖƱ¤¸¤¯%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4344 #else
4345                                                         msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
4346 #endif
4347                                                 msg_print(NULL);
4348                                         }
4349                                 }
4350 #ifdef JP
4351 msg_format("¡Ö%d¿Í¤½¤í¤Ã¤Æ¡¢¥ê¥ó¥°¥ì¥ó¥¸¥ã¡¼¡ª¡×", count);
4352 #else
4353 msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
4354 #endif
4355                                 msg_print(NULL);
4356                         }
4357                         else
4358                         {
4359 #ifdef JP
4360 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4361 #else
4362                                 if (blind) msg_format("%^s mumbles.", m_name);
4363 #endif
4364
4365 #ifdef JP
4366 else msg_format("%^s¤¬ËâË¡¤Ç¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡ª", m_name);
4367 #else
4368                                 else msg_format("%^s magically summons greater undead!", m_name);
4369 #endif
4370
4371                                 for (k = 0; k < s_num_6; k++)
4372                                 {
4373                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4374                                 }
4375                         }
4376                         if (blind && count)
4377                         {
4378 #ifdef JP
4379 msg_print("´Ö¶á¤Ç²¿¤«Â¿¤¯¤Î¤â¤Î¤¬Ç礤²ó¤ë²»¤¬Ê¹¤³¤¨¤ë¡£");
4380 #else
4381                                 msg_print("You hear many creepy things appear nearby.");
4382 #endif
4383
4384                         }
4385                         break;
4386                 }
4387
4388                 /* RF6_S_HI_DRAGON */
4389                 case 160+29:
4390                 {
4391                         disturb(1, 0);
4392 #ifdef JP
4393 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4394 #else
4395                         if (blind) msg_format("%^s mumbles.", m_name);
4396 #endif
4397
4398 #ifdef JP
4399 else msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª", m_name);
4400 #else
4401                         else msg_format("%^s magically summons ancient dragons!", m_name);
4402 #endif
4403
4404                         for (k = 0; k < s_num_4; k++)
4405                         {
4406                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4407                         }
4408                         if (blind && count)
4409                         {
4410 #ifdef JP
4411 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4412 #else
4413                                 msg_print("You hear many powerful things appear nearby.");
4414 #endif
4415
4416                         }
4417                         break;
4418                 }
4419
4420                 /* RF6_S_AMBERITES */
4421                 case 160+30:
4422                 {
4423                         disturb(1, 0);
4424 #ifdef JP
4425 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4426 #else
4427                         if (blind) msg_format("%^s mumbles.", m_name);
4428 #endif
4429
4430 #ifdef JP
4431 else msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª", m_name);
4432 #else
4433                         else msg_format("%^s magically summons Lords of Amber!", m_name);
4434 #endif
4435
4436
4437
4438                         for (k = 0; k < s_num_4; k++)
4439                         {
4440                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4441                         }
4442                         if (blind && count)
4443                         {
4444 #ifdef JP
4445 msg_print("ÉÔ»à¤Î¼Ô¤¬¶á¤¯¤Ë¸½¤ì¤ë¤Î¤¬Ê¹¤³¤¨¤¿¡£");
4446 #else
4447                                 msg_print("You hear immortal beings appear nearby.");
4448 #endif
4449
4450                         }
4451                         break;
4452                 }
4453
4454                 /* RF6_S_UNIQUE */
4455                 case 160+31:
4456                 {
4457                         disturb(1, 0);
4458 #ifdef JP
4459 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4460 #else
4461                         if (blind) msg_format("%^s mumbles.", m_name);
4462 #endif
4463
4464 #ifdef JP
4465 else msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª", m_name);
4466 #else
4467                         else msg_format("%^s magically summons special opponents!", m_name);
4468 #endif
4469
4470                         for (k = 0; k < s_num_4; k++)
4471                         {
4472                                 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4473                         }
4474                         if (r_ptr->flags3 & RF3_GOOD)
4475                         {
4476                                 for (k = count; k < s_num_4; k++)
4477                                 {
4478                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4479                                 }
4480                         }
4481                         else
4482                         {
4483                                 for (k = count; k < s_num_4; k++)
4484                                 {
4485                                         count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4486                                 }
4487                         }
4488                         if (blind && count)
4489                         {
4490 #ifdef JP
4491 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4492 #else
4493                                 msg_print("You hear many powerful things appear nearby.");
4494 #endif
4495
4496                         }
4497                         break;
4498                 }
4499         }
4500
4501         if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
4502         {
4503                 learn_spell(thrown_spell - 96);
4504         }
4505
4506         if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR))
4507         {
4508                 if (thrown_spell != 167) /* Not RF6_SPECIAL */
4509                 {
4510                         if (p_ptr->mane_num == MAX_MANE)
4511                         {
4512                                 int i;
4513                                 p_ptr->mane_num--;
4514                                 for (i = 0;i < p_ptr->mane_num;i++)
4515                                 {
4516                                         p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
4517                                         p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
4518                                 }
4519                         }
4520                         p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
4521                         p_ptr->mane_dam[p_ptr->mane_num] = dam;
4522                         p_ptr->mane_num++;
4523                         new_mane = TRUE;
4524
4525                         p_ptr->redraw |= (PR_MANE);
4526                 }
4527         }
4528
4529         /* Remember what the monster did to us */
4530         if (seen && is_original_ap(m_ptr))
4531         {
4532                 /* Inate spell */
4533                 if (thrown_spell < 32 * 4)
4534                 {
4535                         r_ptr->r_flags4 |= (1L << (thrown_spell - 32 * 3));
4536                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4537                 }
4538
4539                 /* Bolt or Ball */
4540                 else if (thrown_spell < 32 * 5)
4541                 {
4542                         r_ptr->r_flags5 |= (1L << (thrown_spell - 32 * 4));
4543                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4544                 }
4545
4546                 /* Special spell */
4547                 else if (thrown_spell < 32 * 6)
4548                 {
4549                         r_ptr->r_flags6 |= (1L << (thrown_spell - 32 * 5));
4550                         if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4551                 }
4552         }
4553
4554
4555         /* Always take note of monsters that kill you */
4556         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
4557         {
4558                 r_ptr->r_deaths++; /* Ignore appearance difference */
4559         }
4560
4561         /* A spell was cast */
4562         return (TRUE);
4563 }