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