OSDN Git Service

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