3 /* Purpose: Monster spells (attack player) */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
16 #ifdef DRS_SMART_OPTIONS
19 * And now for Intelligent monster attacks (including spells).
21 * Original idea and code by "DRS" (David Reeves Sward).
22 * Major modifications by "BEN" (Ben Harrison).
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.
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.
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.
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.
51 * Internal probability routine
53 static bool int_outof(monster_race *r_ptr, int prob)
55 /* Non-Smart monsters are half as "smart" */
56 if (!(r_ptr->flags2 & RF2_SMART)) prob = prob / 2;
59 return (rand_int(100) < prob);
65 * Remove the "bad" spells from a spell list
67 static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
69 monster_type *m_ptr = &m_list[m_idx];
70 monster_race *r_ptr = &r_info[m_ptr->r_idx];
79 /* Too stupid to know anything */
80 if (r_ptr->flags2 & RF2_STUPID) return;
83 /* Must be cheating or learning */
84 if (!smart_cheat && !smart_learn) return;
87 /* Update acquired knowledge */
90 /* Hack -- Occasionally forget player status */
91 if (m_ptr->smart && (rand_int(100) < 1)) m_ptr->smart = 0L;
93 /* Use the memorized flags */
98 /* Cheat if requested */
101 /* Know basic info */
102 if (p_ptr->resist_acid) smart |= (SM_RES_ACID);
103 if (p_ptr->oppose_acid) smart |= (SM_OPP_ACID);
104 if (p_ptr->immune_acid) smart |= (SM_IMM_ACID);
105 if (p_ptr->resist_elec) smart |= (SM_RES_ELEC);
106 if (p_ptr->oppose_elec) smart |= (SM_OPP_ELEC);
107 if (p_ptr->immune_elec) smart |= (SM_IMM_ELEC);
108 if (p_ptr->resist_fire) smart |= (SM_RES_FIRE);
109 if (p_ptr->oppose_fire) smart |= (SM_OPP_FIRE);
110 if (p_ptr->immune_fire) smart |= (SM_IMM_FIRE);
111 if (p_ptr->resist_cold) smart |= (SM_RES_COLD);
112 if (p_ptr->oppose_cold) smart |= (SM_OPP_COLD);
113 if (p_ptr->immune_cold) smart |= (SM_IMM_COLD);
115 /* Know poison info */
116 if (p_ptr->resist_pois) smart |= (SM_RES_POIS);
117 if (p_ptr->oppose_pois) smart |= (SM_OPP_POIS);
119 /* Know special resistances */
120 if (p_ptr->resist_neth) smart |= (SM_RES_NETH);
121 if (p_ptr->resist_lite) smart |= (SM_RES_LITE);
122 if (p_ptr->resist_dark) smart |= (SM_RES_DARK);
123 if (p_ptr->resist_fear) smart |= (SM_RES_FEAR);
124 if (p_ptr->resist_conf) smart |= (SM_RES_CONF);
125 if (p_ptr->resist_chaos) smart |= (SM_RES_CHAOS);
126 if (p_ptr->resist_disen) smart |= (SM_RES_DISEN);
127 if (p_ptr->resist_blind) smart |= (SM_RES_BLIND);
128 if (p_ptr->resist_nexus) smart |= (SM_RES_NEXUS);
129 if (p_ptr->resist_sound) smart |= (SM_RES_SOUND);
130 if (p_ptr->resist_shard) smart |= (SM_RES_SHARD);
131 if (p_ptr->reflect) smart |= (SM_IMM_REFLECT);
133 /* Know bizarre "resistances" */
134 if (p_ptr->free_act) smart |= (SM_IMM_FREE);
135 if (!p_ptr->msp) smart |= (SM_IMM_MANA);
143 if (smart & SM_IMM_ACID)
145 if (int_outof(r_ptr, 200)) f4 &= ~(RF4_BR_ACID);
146 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BA_ACID);
147 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BO_ACID);
149 else if ((smart & (SM_OPP_ACID)) && (smart & (SM_RES_ACID)))
151 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ACID);
152 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ACID);
153 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ACID);
155 else if ((smart & (SM_OPP_ACID)) || (smart & (SM_RES_ACID)))
157 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ACID);
158 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ACID);
159 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ACID);
163 if (smart & (SM_IMM_ELEC))
165 if (int_outof(r_ptr, 200)) f4 &= ~(RF4_BR_ELEC);
166 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BA_ELEC);
167 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BO_ELEC);
169 else if ((smart & (SM_OPP_ELEC)) && (smart & (SM_RES_ELEC)))
171 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_ELEC);
172 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_ELEC);
173 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ELEC);
175 else if ((smart & (SM_OPP_ELEC)) || (smart & (SM_RES_ELEC)))
177 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_ELEC);
178 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_ELEC);
179 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_ELEC);
183 if (smart & (SM_IMM_FIRE))
185 if (int_outof(r_ptr, 200)) f4 &= ~(RF4_BR_FIRE);
186 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BA_FIRE);
187 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BO_FIRE);
189 else if ((smart & (SM_OPP_FIRE)) && (smart & (SM_RES_FIRE)))
191 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_FIRE);
192 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_FIRE);
193 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_FIRE);
195 else if ((smart & (SM_OPP_FIRE)) || (smart & (SM_RES_FIRE)))
197 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_FIRE);
198 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_FIRE);
199 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_FIRE);
203 if (smart & (SM_IMM_COLD))
205 if (int_outof(r_ptr, 200)) f4 &= ~(RF4_BR_COLD);
206 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BA_COLD);
207 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BO_COLD);
208 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BO_ICEE);
210 else if ((smart & (SM_OPP_COLD)) && (smart & (SM_RES_COLD)))
212 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_COLD);
213 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_COLD);
214 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_COLD);
215 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BO_ICEE);
217 else if ((smart & (SM_OPP_COLD)) || (smart & (SM_RES_COLD)))
219 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_COLD);
220 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_COLD);
221 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BO_COLD);
222 if (int_outof(r_ptr, 20)) f5 &= ~(RF5_BO_ICEE);
226 if ((smart & (SM_OPP_POIS)) && (smart & (SM_RES_POIS)))
228 if (int_outof(r_ptr, 80)) f4 &= ~(RF4_BR_POIS);
229 if (int_outof(r_ptr, 80)) f5 &= ~(RF5_BA_POIS);
230 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BA_NUKE);
231 if (int_outof(r_ptr, 60)) f4 &= ~(RF4_BR_NUKE);
233 else if ((smart & (SM_OPP_POIS)) || (smart & (SM_RES_POIS)))
235 if (int_outof(r_ptr, 30)) f4 &= ~(RF4_BR_POIS);
236 if (int_outof(r_ptr, 30)) f5 &= ~(RF5_BA_POIS);
240 if (smart & (SM_RES_NETH))
242 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_NETH);
243 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_NETH);
244 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BO_NETH);
247 if (smart & (SM_RES_LITE))
249 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_LITE);
250 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_LITE);
253 if (smart & (SM_RES_DARK))
255 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_DARK);
256 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_DARK);
259 if (smart & (SM_RES_FEAR))
261 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_SCARE);
264 if (smart & (SM_RES_CONF))
266 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_CONF);
267 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_CONF);
270 if (smart & (SM_RES_CHAOS))
272 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_CHAO);
273 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BA_CHAO);
276 if (smart & (SM_RES_DISEN))
278 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_DISE);
281 if (smart & (SM_RES_BLIND))
283 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_BLIND);
286 if (smart & (SM_RES_NEXUS))
288 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_NEXU);
289 if (int_outof(r_ptr, 200)) f6 &= ~(RF6_TELE_LEVEL);
292 if (smart & (SM_RES_SOUND))
294 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_SOUN);
297 if (smart & (SM_RES_SHARD))
299 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_SHAR);
302 if (smart & (SM_IMM_REFLECT))
304 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_COLD);
305 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_FIRE);
306 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ACID);
307 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ELEC);
308 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_NETH);
309 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_WATE);
310 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_MANA);
311 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
312 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
313 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
314 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_ARROW_1);
315 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_ARROW_2);
316 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_ARROW_3);
317 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_ARROW_4);
320 if (smart & (SM_IMM_FREE))
322 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_HOLD);
323 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_SLOW);
326 if (smart & (SM_IMM_MANA))
328 if (int_outof(r_ptr, 200)) f5 &= ~(RF5_DRAIN_MANA);
331 /* XXX XXX XXX No spells left? */
332 /* if (!f4 && !f5 && !f6) ... */
339 #endif /* DRS_SMART_OPTIONS */
343 * Determine if there is a space near the player in which
344 * a summoned creature can appear
346 bool summon_possible(int y1, int x1)
350 /* Start at the player's location, and check 2 grids in each dir */
351 for (y = y1 - 2; y <= y1 + 2; y++)
353 for (x = x1 - 2; x <= x1 + 2; x++)
355 /* Ignore illegal locations */
356 if (!in_bounds(y, x)) continue;
358 /* Only check a circular area */
359 if (distance(y1, x1, y, x)>2) continue;
362 /* Hack: no summon on glyph of warding */
363 if (cave[y][x].feat == FEAT_GLYPH) continue;
364 if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
367 /* ...nor on the Pattern */
368 if ((cave[y][x].feat >= FEAT_PATTERN_START)
369 && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
371 /* Require empty floor grid in line of sight */
372 if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE);
380 static bool raise_possible(int y, int x)
383 s16b this_o_idx, next_o_idx = 0;
386 for (xx = x - 5; xx <= x + 5; xx++)
388 for (yy = y - 5; yy <= y + 5; yy++)
390 if (distance(y, x, yy, xx) > 5) continue;
391 if (!los(y, x, yy, xx)) continue;
393 c_ptr = &cave[yy][xx];
394 /* Scan the pile of objects */
395 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
398 object_type *o_ptr = &o_list[this_o_idx];
400 /* Acquire next object */
401 next_o_idx = o_ptr->next_o_idx;
403 /* Known to be worthless? */
404 if (o_ptr->tval == TV_CORPSE)
414 * Originally, it was possible for a friendly to shoot another friendly.
415 * Change it so a "clean shot" means no equally friendly monster is
416 * between the attacker and target.
419 * Determine if a bolt spell will hit the player.
421 * This is exactly like "projectable", but it will
422 * return FALSE if a monster is in the way.
423 * no equally friendly monster is
424 * between the attacker and target.
426 bool clean_shot(int y1, int x1, int y2, int x2, bool friend)
428 /* Must be the same as projectable() */
435 /* Check the projection path */
436 grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
438 /* No grid is ever projectable from itself */
439 if (!grid_n) return (FALSE);
442 y = GRID_Y(grid_g[grid_n-1]);
443 x = GRID_X(grid_g[grid_n-1]);
445 /* May not end in an unrequested grid */
446 if ((y != y2) || (x != x2)) return (FALSE);
448 for (i = 0; i < grid_n; i++)
450 y = GRID_Y(grid_g[i]);
451 x = GRID_X(grid_g[i]);
453 if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
455 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
456 if (friend == is_pet(m_ptr))
461 /* Pets may not shoot through the character - TNB */
462 if ((y == py) && (x == px))
464 if (friend) return (FALSE);
472 * Cast a bolt at the player
473 * Stop if we hit a monster
474 * Affect monsters and the player
476 static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
478 int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
480 /* Target the player with a bolt attack */
481 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
484 static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
486 int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER | PROJECT_NO_REF;
488 /* Target the player with a bolt attack */
489 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
494 * Cast a breath (or ball) attack at the player
495 * Pass over any monsters that may be in the way
496 * Affect grids, objects, monsters, and the player
498 static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
500 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
502 monster_type *m_ptr = &m_list[m_idx];
503 monster_race *r_ptr = &r_info[m_ptr->r_idx];
505 /* Determine the radius of the blast */
506 if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
508 /* Handle breath attacks */
509 if (breath) rad = 0 - rad;
511 if (typ == GF_ROCKET) flg |= PROJECT_STOP;
513 /* Target the player with a ball attack */
514 (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
518 void curse_equipment(int chance, int heavy_chance)
520 bool changed = FALSE;
522 object_type *o_ptr = &inventory[INVEN_RARM + rand_int(12)];
524 if (randint(100) > chance) return;
526 if (!o_ptr->k_idx) return;
528 object_flags(o_ptr, &o1, &o2, &o3);
531 /* Extra, biased saving throw for blessed items */
532 if ((o3 & TR3_BLESSED) && (randint(888) > chance))
534 char o_name[MAX_NLEN];
535 object_desc(o_name, o_ptr, FALSE, 0);
537 msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
539 msg_format("Your %s resist%s cursing!", o_name,
542 ((o_ptr->number > 1) ? "" : "s"));
543 /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
547 if ((randint(100) <= heavy_chance) &&
548 (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
550 if (!(o3 & TR3_HEAVY_CURSE))
552 o_ptr->art_flags3 |= TR3_HEAVY_CURSE;
553 o_ptr->art_flags3 |= TR3_CURSED;
554 o_ptr->ident |= IDENT_CURSED;
558 if (!(o_ptr->ident & IDENT_CURSED))
560 o_ptr->art_flags3 |= TR3_CURSED;
561 o_ptr->ident |= IDENT_CURSED;
567 msg_print("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤ò¤È¤ê¤Þ¤¤¤¿...");
569 msg_print("There is a malignant black aura surrounding you...");
572 o_ptr->feeling = FEEL_NONE;
578 * Return TRUE if a spell is good for hurting the player (directly).
580 static bool spell_attack(byte spell)
582 /* All RF4 spells hurt (except for shriek and dispel) */
583 if (spell < 128 && spell > 98) return (TRUE);
585 /* Various "ball" spells */
586 if (spell >= 128 && spell <= 128 + 8) return (TRUE);
588 /* "Cause wounds" and "bolt" spells */
589 if (spell >= 128 + 12 && spell < 128 + 27) return (TRUE);
592 if (spell == 160 + 1) return (TRUE);
595 if (spell == 160 + 11) return (TRUE);
603 * Return TRUE if a spell is good for escaping.
605 static bool spell_escape(byte spell)
607 /* Blink or Teleport */
608 if (spell == 160 + 4 || spell == 160 + 5) return (TRUE);
610 /* Teleport the player away */
611 if (spell == 160 + 9 || spell == 160 + 10) return (TRUE);
613 /* Isn't good for escaping */
618 * Return TRUE if a spell is good for annoying the player.
620 static bool spell_annoy(byte spell)
623 if (spell == 96 + 0) return (TRUE);
625 /* Brain smash, et al (added curses) */
626 if (spell >= 128 + 9 && spell <= 128 + 14) return (TRUE);
628 /* Scare, confuse, blind, slow, paralyze */
629 if (spell >= 128 + 27 && spell <= 128 + 31) return (TRUE);
632 if (spell == 160 + 8) return (TRUE);
635 if (spell == 160 + 10) return (TRUE);
637 /* Darkness, make traps, cause amnesia */
638 if (spell >= 160 + 12 && spell <= 160 + 14) return (TRUE);
645 * Return TRUE if a spell summons help.
647 static bool spell_summon(byte spell)
649 /* All summon spells */
650 if (spell >= 160 + 16) return (TRUE);
658 * Return TRUE if a spell raise-dead.
660 static bool spell_raise(byte spell)
662 /* All raise-dead spells */
663 if (spell == 160 + 15) return (TRUE);
671 * Return TRUE if a spell is good in a tactical situation.
673 static bool spell_tactic(byte spell)
676 if (spell == 160 + 4) return (TRUE);
683 * Return TRUE if a spell makes invulnerable.
685 static bool spell_invulner(byte spell)
687 /* Invulnerability */
688 if (spell == 160 + 3) return (TRUE);
690 /* No invulnerability */
695 * Return TRUE if a spell hastes.
697 static bool spell_haste(byte spell)
700 if (spell == 160 + 0) return (TRUE);
702 /* Not a haste spell */
708 * Return TRUE if a spell world.
710 static bool spell_world(byte spell)
713 if (spell == 160 + 6) return (TRUE);
715 /* Not a haste spell */
721 * Return TRUE if a spell special.
723 static bool spell_special(byte spell)
725 if (p_ptr->inside_battle) return FALSE;
728 if (spell == 160 + 7) return (TRUE);
730 /* Not a haste spell */
736 * Return TRUE if a spell psycho-spear.
738 static bool spell_psy_spe(byte spell)
741 if (spell == 160 + 11) return (TRUE);
743 /* Not a haste spell */
749 * Return TRUE if a spell is good for healing.
751 static bool spell_heal(byte spell)
754 if (spell == 160 + 2) return (TRUE);
762 * Return TRUE if a spell is good for dispel.
764 static bool spell_dispel(byte spell)
767 if (spell == 96 + 2) return (TRUE);
775 * Check should monster cast dispel spell.
777 static bool dispel_check(int m_idx)
779 monster_type *m_ptr = &m_list[m_idx];
780 monster_race *r_ptr = &r_info[m_ptr->r_idx];
783 if (p_ptr->invuln) return (TRUE);
786 if (p_ptr->wraith_form) return (TRUE);
789 if (p_ptr->shield) return (TRUE);
792 if (p_ptr->magicdef) return (TRUE);
795 if (p_ptr->multishadow) return (TRUE);
798 if (p_ptr->dustrobe) return (TRUE);
800 /* Berserk Strength */
801 if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) return (TRUE);
803 /* Invulnability song */
804 if (music_singing(MUSIC_INVULN)) return (TRUE);
807 if (p_ptr->mimic_form == MIMIC_DEMON_LORD) return (TRUE);
809 /* Elemental resistances */
810 if (r_ptr->flags4 & RF4_BR_ACID)
812 if (!p_ptr->immune_acid && p_ptr->oppose_acid) return (TRUE);
814 if (p_ptr->special_defense & DEFENSE_ACID) return (TRUE);
817 if (r_ptr->flags4 & RF4_BR_FIRE)
819 if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44))
821 if(!p_ptr->immune_fire && p_ptr->oppose_fire) return (TRUE);
823 if(p_ptr->special_defense & DEFENSE_FIRE) return(TRUE);
827 if (r_ptr->flags4 & RF4_BR_ELEC)
829 if (!p_ptr->immune_elec && p_ptr->oppose_elec) return (TRUE);
831 if (p_ptr->special_defense & DEFENSE_ELEC) return (TRUE);
834 if (r_ptr->flags4 & RF4_BR_COLD)
836 if (!p_ptr->immune_cold && p_ptr->oppose_cold) return (TRUE);
838 if (p_ptr->special_defense & DEFENSE_COLD) return (TRUE);
841 if (r_ptr->flags4 & (RF4_BR_POIS | RF4_BR_NUKE))
843 if (!((p_ptr->pclass == CLASS_NINJA) && p_ptr->lev > 44))
845 if (p_ptr->oppose_pois) return (TRUE);
847 if (p_ptr->special_defense & DEFENSE_POIS) return (TRUE);
851 /* Elemental resist music */
852 if (music_singing(MUSIC_RESIST))
854 if (r_ptr->flags4 & (RF4_BR_ACID | RF4_BR_FIRE | RF4_BR_ELEC | RF4_BR_COLD | RF4_BR_POIS)) return (TRUE);
857 /* Ultimate resistance */
858 if (p_ptr->ult_res) return (TRUE);
860 /* Potion of Neo Tsuyosi special */
861 if (p_ptr->tsuyoshi) return (TRUE);
863 /* Elemental Brands */
864 if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flags3 & RF3_IM_ACID)) return (TRUE);
865 if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flags3 & RF3_IM_FIRE)) return (TRUE);
866 if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flags3 & RF3_IM_ELEC)) return (TRUE);
867 if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flags3 & RF3_IM_COLD)) return (TRUE);
868 if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flags3 & RF3_IM_POIS)) return (TRUE);
871 if (p_ptr->pspeed < 145)
873 if (p_ptr->fast) return (TRUE);
875 if (music_singing(MUSIC_SPEED)) return (TRUE);
877 if (music_singing(MUSIC_SHERO)) return (TRUE);
881 if (p_ptr->lightspeed && (m_ptr->mspeed < 136)) return (TRUE);
883 if (p_ptr->riding && (m_list[p_ptr->riding].mspeed < 135))
885 if (m_list[p_ptr->riding].fast) return (TRUE);
888 /* No need to cast dispel spell */
894 * Have a monster choose a spell from a list of "useful" spells.
896 * Note that this list does NOT include spells that will just hit
897 * other monsters, and the list is restricted when the monster is
898 * "desperate". Should that be the job of this function instead?
900 * Stupid monsters will just pick a spell randomly. Smart monsters
901 * will choose more "intelligently".
903 * Use the helper functions above to put spells into categories.
905 * This function may well be an efficiency bottleneck.
907 static int choose_attack_spell(int m_idx, byte spells[], byte num)
909 monster_type *m_ptr = &m_list[m_idx];
910 monster_race *r_ptr = &r_info[m_ptr->r_idx];
912 byte escape[96], escape_num = 0;
913 byte attack[96], attack_num = 0;
914 byte summon[96], summon_num = 0;
915 byte tactic[96], tactic_num = 0;
916 byte annoy[96], annoy_num = 0;
917 byte invul[96], invul_num = 0;
918 byte haste[96], haste_num = 0;
919 byte world[96], world_num = 0;
920 byte special[96], special_num = 0;
921 byte psy_spe[96], psy_spe_num = 0;
922 byte raise[96], raise_num = 0;
923 byte heal[96], heal_num = 0;
924 byte dispel[96], dispel_num = 0;
928 /* Stupid monsters choose randomly */
929 if (r_ptr->flags2 & (RF2_STUPID))
932 return (spells[rand_int(num)]);
935 /* Categorize spells */
936 for (i = 0; i < num; i++)
939 if (spell_escape(spells[i])) escape[escape_num++] = spells[i];
942 if (spell_attack(spells[i])) attack[attack_num++] = spells[i];
945 if (spell_summon(spells[i])) summon[summon_num++] = spells[i];
947 /* Tactical spell? */
948 if (spell_tactic(spells[i])) tactic[tactic_num++] = spells[i];
950 /* Annoyance spell? */
951 if (spell_annoy(spells[i])) annoy[annoy_num++] = spells[i];
953 /* Invulnerability spell? */
954 if (spell_invulner(spells[i])) invul[invul_num++] = spells[i];
957 if (spell_haste(spells[i])) haste[haste_num++] = spells[i];
960 if (spell_world(spells[i])) world[world_num++] = spells[i];
963 if (spell_special(spells[i])) special[special_num++] = spells[i];
965 /* Psycho-spear spell? */
966 if (spell_psy_spe(spells[i])) psy_spe[psy_spe_num++] = spells[i];
968 /* Raise-dead spell? */
969 if (spell_raise(spells[i])) raise[raise_num++] = spells[i];
972 if (spell_heal(spells[i])) heal[heal_num++] = spells[i];
975 if (spell_dispel(spells[i])) dispel[dispel_num++] = spells[i];
978 /*** Try to pick an appropriate spell type ***/
981 if (world_num && (rand_int(100) < 15) && !world_monster)
983 /* Choose haste spell */
984 return (world[rand_int(world_num)]);
990 bool success = FALSE;
995 if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num) success = TRUE;
999 if (success) return (special[rand_int(special_num)]);
1002 /* Still hurt badly, couldn't flee, attempt to heal */
1003 if (m_ptr->hp < m_ptr->maxhp / 3 && one_in_(2))
1005 /* Choose heal spell if possible */
1006 if (heal_num) return (heal[rand_int(heal_num)]);
1009 /* Hurt badly or afraid, attempt to flee */
1010 if (((m_ptr->hp < m_ptr->maxhp / 3) || m_ptr->monfear) && one_in_(2))
1012 /* Choose escape spell if possible */
1013 if (escape_num) return (escape[rand_int(escape_num)]);
1019 bool success = FALSE;
1020 switch(m_ptr->r_idx)
1023 if (rand_int(100) < 50) success = TRUE;
1025 case MON_BANORLUPART:
1026 if (rand_int(100) < 70) success = TRUE;
1030 if (success) return (special[rand_int(special_num)]);
1033 /* Player is close and we have attack spells, blink away */
1034 if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (rand_int(100) < 75) && !world_monster)
1036 /* Choose tactical spell */
1037 if (tactic_num) return (tactic[rand_int(tactic_num)]);
1040 /* Summon if possible (sometimes) */
1041 if (summon_num && (rand_int(100) < 40))
1043 /* Choose summon spell */
1044 return (summon[rand_int(summon_num)]);
1048 if (dispel_num && one_in_(2))
1050 /* Choose dispel spell if possible */
1051 if (dispel_check(m_idx))
1053 return (dispel[rand_int(dispel_num)]);
1057 /* Raise-dead if possible (sometimes) */
1058 if (raise_num && (rand_int(100) < 40) && raise_possible(m_ptr->fy, m_ptr->fx))
1060 /* Choose raise-dead spell */
1061 return (raise[rand_int(raise_num)]);
1064 /* Attack spell (most of the time) */
1067 if (psy_spe_num && (rand_int(100) < 50))
1069 /* Choose attack spell */
1070 return (psy_spe[rand_int(psy_spe_num)]);
1072 else if (attack_num && (rand_int(100) < 40))
1074 /* Choose attack spell */
1075 return (attack[rand_int(attack_num)]);
1078 else if (attack_num && (rand_int(100) < 85))
1080 /* Choose attack spell */
1081 return (attack[rand_int(attack_num)]);
1084 /* Try another tactical spell (sometimes) */
1085 if (tactic_num && (rand_int(100) < 50) && !world_monster)
1087 /* Choose tactic spell */
1088 return (tactic[rand_int(tactic_num)]);
1091 /* Cast globe of invulnerability if not already in effect */
1092 if (invul_num && !(m_ptr->invulner) && (rand_int(100) < 50))
1094 /* Choose Globe of Invulnerability */
1095 return (invul[rand_int(invul_num)]);
1098 /* We're hurt (not badly), try to heal */
1099 if ((m_ptr->hp < m_ptr->maxhp * 3 / 4) && (rand_int(100) < 25))
1101 /* Choose heal spell if possible */
1102 if (heal_num) return (heal[rand_int(heal_num)]);
1105 /* Haste self if we aren't already somewhat hasted (rarely) */
1106 if (haste_num && (rand_int(100) < 20) && !(m_ptr->fast))
1108 /* Choose haste spell */
1109 return (haste[rand_int(haste_num)]);
1112 /* Annoy player (most of the time) */
1113 if (annoy_num && (rand_int(100) < 80))
1115 /* Choose annoyance spell */
1116 return (annoy[rand_int(annoy_num)]);
1119 /* Choose no spell */
1125 * Creatures can cast spells, shoot missiles, and breathe.
1127 * Returns "TRUE" if a spell (or whatever) was (successfully) cast.
1129 * XXX XXX XXX This function could use some work, but remember to
1130 * keep it as optimized as possible, while retaining generic code.
1132 * Verify the various "blind-ness" checks in the code.
1134 * XXX XXX XXX Note that several effects should really not be "seen"
1135 * if the player is blind. See also "effects.c" for other "mistakes".
1137 * Perhaps monsters should breathe at locations *near* the player,
1138 * since this would allow them to inflict "partial" damage.
1140 * Perhaps smart monsters should decline to use "bolt" spells if
1141 * there is a monster in the way, unless they wish to kill it.
1143 * Note that, to allow the use of the "track_target" option at some
1144 * later time, certain non-optimal things are done in the code below,
1145 * including explicit checks against the "direct" variable, which is
1146 * currently always true by the time it is checked, but which should
1147 * really be set according to an explicit "projectable()" test, and
1148 * the use of generic "x,y" locations instead of the player location,
1149 * with those values being initialized with the player location.
1151 * It will not be possible to "correctly" handle the case in which a
1152 * monster attempts to attack a location which is thought to contain
1153 * the player, but which in fact is nowhere near the player, since this
1154 * might induce all sorts of messages about the attack itself, and about
1155 * the effects of the attack, which the player might or might not be in
1156 * a position to observe. Thus, for simplicity, it is probably best to
1157 * only allow "faulty" attacks by a monster if one of the important grids
1158 * (probably the initial or final grid) is in fact in view of the player.
1159 * It may be necessary to actually prevent spell attacks except when the
1160 * monster actually has line of sight to the player. Note that a monster
1161 * could be left in a bizarre situation after the player ducked behind a
1162 * pillar and then teleported away, for example.
1164 * Note that certain spell attacks do not use the "project()" function
1165 * but "simulate" it via the "direct" variable, which is always at least
1166 * as restrictive as the "project()" function. This is necessary to
1167 * prevent "blindness" attacks and such from bending around walls, etc,
1168 * and to allow the use of the "track_target" option in the future.
1170 * Note that this function attempts to optimize the use of spells for the
1171 * cases in which the monster has no spells, or has spells but cannot use
1172 * them, or has spells but they will have no "useful" effect. Note that
1173 * this function has been an efficiency bottleneck in the past.
1175 * Note the special "MFLAG_NICE" flag, which prevents a monster from using
1176 * any spell attacks until the player has had a single chance to move.
1178 bool make_attack_spell(int m_idx)
1180 int k, chance, thrown_spell = 0, rlev, failrate;
1181 byte spell[96], num = 0;
1183 monster_type *m_ptr = &m_list[m_idx];
1184 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1188 bool no_inate = FALSE;
1189 bool do_disi = FALSE;
1191 int s_num_6 = (easy_band ? 2 : 6);
1192 int s_num_4 = (easy_band ? 1 : 4);
1194 /* Target location */
1201 /* Extract the blind-ness */
1202 bool blind = (p_ptr->blind ? TRUE : FALSE);
1204 /* Extract the "see-able-ness" */
1205 bool seen = (!blind && m_ptr->ml);
1207 bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
1208 bool learnable = (seen && maneable && !world_monster);
1210 /* Assume "normal" target */
1213 /* Assume "projectable" */
1216 /* Cannot cast spells when confused */
1217 if (m_ptr->confused)
1219 reset_target(m_ptr);
1223 /* Cannot cast spells when nice */
1224 if (m_ptr->mflag & MFLAG_NICE) return (FALSE);
1225 if (!is_hostile(m_ptr)) return (FALSE);
1227 /* Hack -- Extract the spell probability */
1228 chance = (r_ptr->freq_inate + r_ptr->freq_spell) / 2;
1230 /* Not allowed to cast spells */
1231 if (!chance) return (FALSE);
1234 if (stupid_monsters)
1236 /* Only do spells occasionally */
1237 if (rand_int(100) >= chance) return (FALSE);
1241 if (rand_int(100) >= chance) return (FALSE);
1243 /* Sometimes forbid inate attacks (breaths) */
1244 if (rand_int(100) >= (chance * 2)) no_inate = TRUE;
1247 /* XXX XXX XXX Handle "track_target" option (?) */
1250 /* Extract the racial spell flags */
1255 /* Hack -- require projectable player */
1259 if ((m_ptr->cdis > MAX_RANGE) && !m_ptr->target_y) return (FALSE);
1262 if (projectable(m_ptr->fy, m_ptr->fx, y, x))
1264 /* Breath disintegration to the glyph */
1265 if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
1268 /* Check path to next grid */
1271 bool success = FALSE;
1273 if ((r_ptr->flags4 & RF4_BR_DISI) &&
1274 (m_ptr->cdis < MAX_RANGE/2) &&
1275 in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
1276 (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
1285 int tonari_y[4][8] = {{-1,-1,-1,0,0,1,1,1},
1286 {-1,-1,-1,0,0,1,1,1},
1287 {1,1,1,0,0,-1,-1,-1},
1288 {1,1,1,0,0,-1,-1,-1}};
1289 int tonari_x[4][8] = {{-1,0,1,-1,1,-1,0,1},
1290 {1,0,-1,1,-1,1,0,-1},
1291 {-1,0,1,-1,1,-1,0,1},
1292 {1,0,-1,1,-1,1,0,-1}};
1294 if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
1295 else if (m_ptr->fy < py) tonari = 1;
1296 else if (m_ptr->fx < px) tonari = 2;
1299 for (i = 0; i < 8; i++)
1301 int next_x = x + tonari_x[tonari][i];
1302 int next_y = y + tonari_y[tonari][i];
1305 /* Access the next grid */
1306 c_ptr = &cave[next_y][next_x];
1308 /* Skip door, rubble, wall */
1309 if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue;
1312 if (c_ptr->feat == FEAT_TREES) continue;
1315 if (c_ptr->feat == FEAT_MOUNTAIN) continue;
1317 if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
1329 if (m_ptr->target_y && m_ptr->target_x)
1331 y = m_ptr->target_y;
1332 x = m_ptr->target_x;
1333 f4 &= (RF4_INDIRECT_MASK);
1334 f5 &= (RF5_INDIRECT_MASK);
1335 f6 &= (RF6_INDIRECT_MASK);
1341 if (!success) return FALSE;
1345 reset_target(m_ptr);
1347 /* Extract the monster level */
1348 rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
1350 if (!stupid_monsters)
1352 /* Forbid inate attacks sometimes */
1353 if (no_inate) f4 &= 0x500000FF;
1358 f5 &= ~(RF5_DRAIN_MANA);
1360 if ((p_ptr->pclass == CLASS_NINJA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)))
1362 f6 &= ~(RF6_DARKNESS);
1365 if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
1367 f4 &= (RF4_NOMAGIC_MASK);
1368 f5 &= (RF5_NOMAGIC_MASK);
1369 f6 &= (RF6_NOMAGIC_MASK);
1372 /* Hack -- allow "desperate" spells */
1373 if ((r_ptr->flags2 & (RF2_SMART)) &&
1374 (m_ptr->hp < m_ptr->maxhp / 10) &&
1375 (rand_int(100) < 50))
1377 /* Require intelligent spells */
1378 f4 &= (RF4_INT_MASK);
1379 f5 &= (RF5_INT_MASK);
1380 f6 &= (RF6_INT_MASK);
1382 /* No spells left */
1383 if (!f4 && !f5 && !f6) return (FALSE);
1386 /* Remove the "ineffective" spells */
1387 remove_bad_spells(m_idx, &f4, &f5, &f6);
1389 if (p_ptr->inside_arena)
1391 f4 &= ~(RF4_SUMMON_MASK);
1392 f5 &= ~(RF5_SUMMON_MASK);
1393 f6 &= ~(RF6_SUMMON_MASK);
1396 /* No spells left */
1397 if (!f4 && !f5 && !f6) return (FALSE);
1399 if (!stupid_monsters)
1401 /* Check for a clean bolt shot */
1402 if (((f4 & RF4_BOLT_MASK) ||
1403 (f5 & RF5_BOLT_MASK) ||
1404 (f6 & RF6_BOLT_MASK)) &&
1405 !(r_ptr->flags2 & RF2_STUPID) &&
1406 !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
1408 /* Remove spells that will only hurt friends */
1409 f4 &= ~(RF4_BOLT_MASK);
1410 f5 &= ~(RF5_BOLT_MASK);
1411 f6 &= ~(RF6_BOLT_MASK);
1414 /* Check for a possible summon */
1415 if (((f4 & RF4_SUMMON_MASK) ||
1416 (f5 & RF5_SUMMON_MASK) ||
1417 (f6 & RF6_SUMMON_MASK)) &&
1418 !(r_ptr->flags2 & RF2_STUPID) &&
1419 !(summon_possible(y, x)))
1421 /* Remove summoning spells */
1422 f4 &= ~(RF4_SUMMON_MASK);
1423 f5 &= ~(RF5_SUMMON_MASK);
1424 f6 &= ~(RF6_SUMMON_MASK);
1427 /* No spells left */
1428 if (!f4 && !f5 && !f6) return (FALSE);
1431 /* Extract the "inate" spells */
1432 for (k = 0; k < 32; k++)
1434 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
1437 /* Extract the "normal" spells */
1438 for (k = 0; k < 32; k++)
1440 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
1443 /* Extract the "bizarre" spells */
1444 for (k = 0; k < 32; k++)
1446 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
1449 /* No spells left */
1450 if (!num) return (FALSE);
1452 /* Stop if player is dead or gone */
1453 if (!alive || death) return (FALSE);
1455 /* Stop if player is leaving */
1456 if (p_ptr->leaving) return (FALSE);
1458 /* Get the monster name (or "it") */
1459 monster_desc(m_name, m_ptr, 0x00);
1461 /* Get the monster possessive ("his"/"her"/"its") */
1462 monster_desc(m_poss, m_ptr, 0x22);
1464 /* Hack -- Get the "died from" name */
1465 monster_desc(ddesc, m_ptr, 0x88);
1467 if (stupid_monsters)
1469 /* Choose a spell to cast */
1470 thrown_spell = spell[rand_int(num)];
1475 if (do_disi) thrown_spell = 96+31;
1480 thrown_spell = choose_attack_spell(m_idx, spell, num);
1481 if (thrown_spell) break;
1485 /* Abort if no spell was chosen */
1486 if (!thrown_spell) return (FALSE);
1488 /* Calculate spell failure rate */
1489 failrate = 25 - (rlev + 3) / 4;
1491 /* Hack -- Stupid monsters will never fail (for jellies and such) */
1492 if (r_ptr->flags2 & RF2_STUPID) failrate = 0;
1494 /* Check for spell failure (inate attacks never fail) */
1495 if ((thrown_spell >= 128) && ((m_ptr->stunned && one_in_(2)) || (rand_int(100) < failrate)))
1499 if (thrown_spell != (160+7)) /* Not RF6_SPECIAL */
1502 msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
1504 msg_format("%^s tries to cast a spell, but fails.", m_name);
1512 /* Cast the spell. */
1513 switch (thrown_spell)
1521 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
1523 msg_format("%^s makes a high pitched shriek.", m_name);
1526 aggravate_monsters(m_idx);
1540 if (x!=px || y!=py) return (FALSE);
1543 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1544 else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
1546 if (blind) msg_format("%^s mumbles powerfully.", m_name);
1547 else msg_format("%^s invokes a dispel magic.", m_name);
1550 set_lightspeed(0, TRUE);
1552 set_shield(0, TRUE);
1553 set_blessed(0, TRUE);
1554 set_tsuyoshi(0, TRUE);
1557 set_protevil(0, TRUE);
1558 set_invuln(0, TRUE);
1559 set_wraith_form(0, TRUE);
1560 set_kabenuke(0, TRUE);
1561 set_tim_res_nether(0, TRUE);
1562 set_tim_res_time(0, TRUE);
1564 set_tim_reflect(0,TRUE);
1565 set_multishadow(0,TRUE);
1566 set_dustrobe(0,TRUE);
1568 set_tim_invis(0, TRUE);
1569 set_tim_infra(0, TRUE);
1570 set_tim_esp(0, TRUE);
1571 set_tim_regen(0, TRUE);
1572 set_tim_stealth(0, TRUE);
1573 set_tim_ffall(0, TRUE);
1574 set_tim_sh_touki(0, TRUE);
1575 set_tim_sh_fire(0, TRUE);
1576 set_magicdef(0, TRUE);
1577 set_resist_magic(0, TRUE);
1578 set_oppose_acid(0, TRUE);
1579 set_oppose_elec(0, TRUE);
1580 set_oppose_fire(0, TRUE);
1581 set_oppose_cold(0, TRUE);
1582 set_oppose_pois(0, TRUE);
1583 set_ultimate_res(0, TRUE);
1584 set_mimic(0, 0, TRUE);
1585 set_ele_attack(0, 0);
1586 set_ele_immune(0, 0);
1587 /* Cancel glowing hands */
1588 if (p_ptr->special_attack & ATTACK_CONFUSE)
1590 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1592 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1594 msg_print("Your hands stop glowing.");
1598 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
1600 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
1601 p_ptr->magic_num1[0] = 0;
1603 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
1605 msg_print("Your singing is interrupted.");
1607 p_ptr->action = ACTION_NONE;
1609 /* Recalculate bonuses */
1610 p_ptr->update |= (PU_BONUS | PU_HP);
1613 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1615 /* Update monsters */
1616 p_ptr->update |= (PU_MONSTERS);
1619 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1621 p_ptr->energy -= 100;
1625 m_list[p_ptr->riding].invulner = 0;
1626 m_list[p_ptr->riding].fast = 0;
1627 m_list[p_ptr->riding].slow = 0;
1628 p_ptr->update |= PU_BONUS;
1629 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH;
1630 p_ptr->redraw |= (PR_UHEALTH);
1634 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1635 msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
1637 learn_spell(MS_DISPEL);
1646 if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
1648 if (blind) msg_format("%^s shoots something.", m_name);
1652 else msg_format("%^s¤¬¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name);
1654 else msg_format("%^s fires a rocket.", m_name);
1657 dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
1658 breath(y, x, m_idx, GF_ROCKET,
1659 dam, 2, FALSE, MS_ROCKET, learnable);
1660 update_smart_learn(m_idx, DRS_SHARD);
1667 if (x!=px || y!=py) return (FALSE);
1670 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1672 if (blind) msg_format("%^s makes a strange noise.", m_name);
1676 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1678 else msg_format("%^s fires an arrow.", m_name);
1681 dam = damroll(2, 5);
1682 bolt(m_idx, GF_ARROW, dam, MS_ARROW_1, learnable);
1683 update_smart_learn(m_idx, DRS_REFLECT);
1690 if (x!=px || y!=py) return (FALSE);
1693 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1695 if (blind) msg_format("%^s makes a strange noise.", m_name);
1699 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1701 else msg_format("%^s fires an arrow!", m_name);
1704 dam = damroll(3, 6);
1705 bolt(m_idx, GF_ARROW, dam, MS_ARROW_2, learnable);
1706 update_smart_learn(m_idx, DRS_REFLECT);
1713 if (x!=px || y!=py) return (FALSE);
1716 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1718 if (blind) msg_format("%^s makes a strange noise.", m_name);
1722 else msg_format("%s¤¬¥Ü¥ë¥È¤ò·â¤Ã¤¿¡£", m_name);
1724 else msg_format("%^s fires a bolt.", m_name);
1726 dam = damroll(5, 6);
1727 bolt(m_idx, GF_ARROW, dam, MS_ARROW_3, learnable);
1728 update_smart_learn(m_idx, DRS_REFLECT);
1735 if (x!=px || y!=py) return (FALSE);
1738 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1740 if (blind) msg_format("%^s makes a strange noise.", m_name);
1744 else msg_format("%s¤¬¥Ü¥ë¥È¤ò·â¤Ã¤¿¡£", m_name);
1746 else msg_format("%^s fires a bolt.", m_name);
1748 dam = damroll(7, 6);
1749 bolt(m_idx, GF_ARROW, dam, MS_ARROW_4, learnable);
1750 update_smart_learn(m_idx, DRS_REFLECT);
1759 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1761 if (blind) msg_format("%^s breathes.", m_name);
1765 else msg_format("%^s¤¬»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1767 else msg_format("%^s breathes acid.", m_name);
1770 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1771 breath(y, x, m_idx, GF_ACID, dam, 0, TRUE, MS_BR_ACID, learnable);
1772 update_smart_learn(m_idx, DRS_ACID);
1781 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1783 if (blind) msg_format("%^s breathes.", m_name);
1787 else msg_format("%^s¤¬°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1789 else msg_format("%^s breathes lightning.", m_name);
1792 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1793 breath(y, x, m_idx, GF_ELEC, dam,0, TRUE, MS_BR_ELEC, learnable);
1794 update_smart_learn(m_idx, DRS_ELEC);
1803 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1805 if (blind) msg_format("%^s breathes.", m_name);
1809 else msg_format("%^s¤¬²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1811 else msg_format("%^s breathes fire.", m_name);
1814 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1815 breath(y, x, m_idx, GF_FIRE, dam,0, TRUE, MS_BR_FIRE, learnable);
1816 update_smart_learn(m_idx, DRS_FIRE);
1825 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1827 if (blind) msg_format("%^s breathes.", m_name);
1831 else msg_format("%^s¤¬Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1833 else msg_format("%^s breathes frost.", m_name);
1836 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1837 breath(y, x, m_idx, GF_COLD, dam,0, TRUE, MS_BR_COLD, learnable);
1838 update_smart_learn(m_idx, DRS_COLD);
1847 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1849 if (blind) msg_format("%^s breathes.", m_name);
1853 else msg_format("%^s¤¬¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1855 else msg_format("%^s breathes gas.", m_name);
1858 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1859 breath(y, x, m_idx, GF_POIS, dam, 0, TRUE, MS_BR_POIS, learnable);
1860 update_smart_learn(m_idx, DRS_POIS);
1870 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1872 if (blind) msg_format("%^s breathes.", m_name);
1876 else msg_format("%^s¤¬ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1878 else msg_format("%^s breathes nether.", m_name);
1881 dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1882 breath(y, x, m_idx, GF_NETHER, dam,0, TRUE, MS_BR_NETHER, learnable);
1883 update_smart_learn(m_idx, DRS_NETH);
1892 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1894 if (blind) msg_format("%^s breathes.", m_name);
1898 else msg_format("%^s¤¬Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1900 else msg_format("%^s breathes light.", m_name);
1903 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1904 breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable);
1905 update_smart_learn(m_idx, DRS_LITE);
1914 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1916 if (blind) msg_format("%^s breathes.", m_name);
1920 else msg_format("%^s¤¬°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1922 else msg_format("%^s breathes darkness.", m_name);
1925 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1926 breath(y, x, m_idx, GF_DARK, dam,0, TRUE, MS_BR_DARK, learnable);
1927 update_smart_learn(m_idx, DRS_DARK);
1936 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1938 if (blind) msg_format("%^s breathes.", m_name);
1942 else msg_format("%^s¤¬º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1944 else msg_format("%^s breathes confusion.", m_name);
1947 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1948 breath(y, x, m_idx, GF_CONFUSION, dam,0, TRUE, MS_BR_CONF, learnable);
1949 update_smart_learn(m_idx, DRS_CONF);
1957 if (m_ptr->r_idx == MON_JAIAN)
1959 msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
1961 msg_format("'Booooeeeeee'");
1964 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1966 else if (blind) msg_format("%^s breathes.", m_name);
1970 else msg_format("%^s¤¬¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1972 else msg_format("%^s breathes sound.", m_name);
1975 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1976 breath(y, x, m_idx, GF_SOUND, dam,0, TRUE, MS_BR_SOUND, learnable);
1977 update_smart_learn(m_idx, DRS_SOUND);
1986 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1988 if (blind) msg_format("%^s breathes.", m_name);
1992 else msg_format("%^s¤¬¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1994 else msg_format("%^s breathes chaos.", m_name);
1997 dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
1998 breath(y, x, m_idx, GF_CHAOS, dam,0, TRUE, MS_BR_CHAOS, learnable);
1999 update_smart_learn(m_idx, DRS_CHAOS);
2008 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2010 if (blind) msg_format("%^s breathes.", m_name);
2014 else msg_format("%^s¤¬Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2016 else msg_format("%^s breathes disenchantment.", m_name);
2019 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2020 breath(y, x, m_idx, GF_DISENCHANT, dam,0, TRUE, MS_BR_DISEN, learnable);
2021 update_smart_learn(m_idx, DRS_DISEN);
2030 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2032 if (blind) msg_format("%^s breathes.", m_name);
2036 else msg_format("%^s¤¬°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2038 else msg_format("%^s breathes nexus.", m_name);
2041 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2042 breath(y, x, m_idx, GF_NEXUS, dam,0, TRUE, MS_BR_NEXUS, learnable);
2043 update_smart_learn(m_idx, DRS_NEXUS);
2052 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2054 if (blind) msg_format("%^s breathes.", m_name);
2058 else msg_format("%^s¤¬»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2060 else msg_format("%^s breathes time.", m_name);
2063 dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
2064 breath(y, x, m_idx, GF_TIME, dam,0, TRUE, MS_BR_TIME, learnable);
2073 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2075 if (blind) msg_format("%^s breathes.", m_name);
2079 else msg_format("%^s¤¬ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2081 else msg_format("%^s breathes inertia.", m_name);
2084 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2085 breath(y, x, m_idx, GF_INERTIA, dam,0, TRUE, MS_BR_INERTIA, learnable);
2094 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2096 if (blind) msg_format("%^s breathes.", m_name);
2100 else msg_format("%^s¤¬½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2102 else msg_format("%^s breathes gravity.", m_name);
2105 dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
2106 breath(y, x, m_idx, GF_GRAVITY, dam,0, TRUE, MS_BR_GRAVITY, learnable);
2114 if (m_ptr->r_idx == MON_BOTEI)
2116 msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
2118 msg_format("'Boty-Build cutter!!!'");
2121 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2123 else if (blind) msg_format("%^s breathes.", m_name);
2127 else msg_format("%^s¤¬ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2129 else msg_format("%^s breathes shards.", m_name);
2132 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2133 breath(y, x, m_idx, GF_SHARDS, dam,0, TRUE, MS_BR_SHARDS, learnable);
2134 update_smart_learn(m_idx, DRS_SHARD);
2143 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2145 if (blind) msg_format("%^s breathes.", m_name);
2149 else msg_format("%^s¤¬¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2151 else msg_format("%^s breathes plasma.", m_name);
2154 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2155 breath(y, x, m_idx, GF_PLASMA, dam,0, TRUE, MS_BR_PLASMA, learnable);
2164 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2166 if (blind) msg_format("%^s breathes.", m_name);
2170 else msg_format("%^s¤¬¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2172 else msg_format("%^s breathes force.", m_name);
2175 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2176 breath(y, x, m_idx, GF_FORCE, dam,0, TRUE, MS_BR_FORCE, learnable);
2185 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2187 if (blind) msg_format("%^s breathes.", m_name);
2191 else msg_format("%^s¤¬ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2193 else msg_format("%^s breathes mana.", m_name);
2195 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2196 breath(y, x, m_idx, GF_MANA, dam,0, TRUE, MS_BR_MANA, learnable);
2205 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2207 if (blind) msg_format("%^s mumbles.", m_name);
2211 else msg_format("%^s¤¬Êü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name);
2213 else msg_format("%^s casts a ball of radiation.", m_name);
2216 dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2217 breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, learnable);
2218 update_smart_learn(m_idx, DRS_POIS);
2227 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2229 if (blind) msg_format("%^s breathes.", m_name);
2233 else msg_format("%^s¤¬Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2235 else msg_format("%^s breathes toxic waste.", m_name);
2238 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
2239 breath(y, x, m_idx, GF_NUKE, dam,0, TRUE, MS_BR_NUKE, learnable);
2240 update_smart_learn(m_idx, DRS_POIS);
2249 if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2251 if (blind) msg_format("%^s mumbles frighteningly.", m_name);
2255 else msg_format("%^s¤¬½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name);/*nuke me*/
2257 else msg_format("%^s invokes a raw Logrus.", m_name);
2260 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2))+ damroll(10, 10);
2261 breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, learnable);
2262 update_smart_learn(m_idx, DRS_CHAOS);
2271 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2273 if (blind) msg_format("%^s breathes.", m_name);
2277 else msg_format("%^s¤¬Ê¬²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2279 else msg_format("%^s breathes disintegration.", m_name);
2282 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2283 breath(y, x, m_idx, GF_DISINTEGRATE, dam,0, TRUE, MS_BR_DISI, learnable);
2294 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2296 if (blind) msg_format("%^s mumbles.", m_name);
2300 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2302 else msg_format("%^s casts an acid ball.", m_name);
2305 dam = (randint(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2306 breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
2307 update_smart_learn(m_idx, DRS_ACID);
2316 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2318 if (blind) msg_format("%^s mumbles.", m_name);
2322 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2324 else msg_format("%^s casts a lightning ball.", m_name);
2327 dam = (randint(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2328 breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
2329 update_smart_learn(m_idx, DRS_ELEC);
2338 if (m_ptr->r_idx == MON_ROLENTO)
2342 msg_format("%s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
2344 msg_format("%s¤Ï¼êÜØÃƤòÅꤲ¤¿¡£", m_name);
2347 msg_format("%^s throws something.", m_name);
2349 msg_format("%^s throws a hand grenade.", m_name);
2355 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2357 if (blind) msg_format("%^s mumbles.", m_name);
2361 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2363 else msg_format("%^s casts a fire ball.", m_name);
2367 dam = (randint(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2368 breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2369 update_smart_learn(m_idx, DRS_FIRE);
2378 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2380 if (blind) msg_format("%^s mumbles.", m_name);
2384 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2386 else msg_format("%^s casts a frost ball.", m_name);
2389 dam = (randint(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2390 breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2391 update_smart_learn(m_idx, DRS_COLD);
2400 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2402 if (blind) msg_format("%^s mumbles.", m_name);
2406 else msg_format("%^s¤¬°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2408 else msg_format("%^s casts a stinking cloud.", m_name);
2411 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2412 breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2413 update_smart_learn(m_idx, DRS_POIS);
2422 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2424 if (blind) msg_format("%^s mumbles.", m_name);
2428 else msg_format("%^s¤¬ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2430 else msg_format("%^s casts a nether ball.", m_name);
2433 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2434 breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2435 update_smart_learn(m_idx, DRS_NETH);
2444 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2446 if (blind) msg_format("%^s mumbles.", m_name);
2450 else msg_format("%^s¤¬Î®¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name);
2452 else msg_format("%^s gestures fluidly.", m_name);
2456 msg_print("¤¢¤Ê¤¿¤Ï±²´¬¤¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£");
2458 msg_print("You are engulfed in a whirlpool.");
2461 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint(rlev * 3) : randint(rlev * 2)) + 50;
2462 breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2471 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2473 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2477 else msg_format("%^s¤¬ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2479 else msg_format("%^s invokes a mana storm.", m_name);
2482 dam = (rlev * 4) + 50 + damroll(10, 10);
2483 breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2492 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2494 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2498 else msg_format("%^s¤¬°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2500 else msg_format("%^s invokes a darkness storm.", m_name);
2503 dam = (rlev * 4) + 50 + damroll(10, 10);
2504 breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2505 update_smart_learn(m_idx, DRS_DARK);
2509 /* RF5_DRAIN_MANA */
2512 if (x!=px || y!=py) return (FALSE);
2521 msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2523 msg_format("%^s draws psychic energy from you!", m_name);
2528 r1 = (randint(rlev) / 2) + 1;
2531 if (r1 >= p_ptr->csp)
2535 p_ptr->csp_frac = 0;
2544 learn_spell(MS_DRAIN_MANA);
2547 p_ptr->redraw |= (PR_MANA);
2550 p_ptr->window |= (PW_PLAYER);
2551 p_ptr->window |= (PW_SPELL);
2553 /* Heal the monster */
2554 if (m_ptr->hp < m_ptr->maxhp)
2557 m_ptr->hp += (6 * r1);
2558 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2560 /* Redraw (later) if needed */
2561 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2562 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2564 /* Special message */
2568 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
2570 msg_format("%^s appears healthier.", m_name);
2576 update_smart_learn(m_idx, DRS_MANA);
2580 /* RF5_MIND_BLAST */
2583 if (x!=px || y!=py) return (FALSE);
2589 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2591 msg_print("You feel something focusing on your mind.");
2598 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¤Ë¤é¤ó¤Ç¤¤¤ë¡£", m_name);
2600 msg_format("%^s gazes deep into your eyes.", m_name);
2605 dam = damroll(7, 7);
2606 if (rand_int(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2609 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2611 msg_print("You resist the effects!");
2613 learn_spell(MS_MIND_BLAST);
2618 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2620 msg_print("Your mind is blasted by psyonic energy.");
2623 if (!p_ptr->resist_conf)
2625 (void)set_confused(p_ptr->confused + rand_int(4) + 4);
2628 if (!p_ptr->resist_chaos && one_in_(3))
2630 (void)set_image(p_ptr->image + rand_int(250) + 150);
2637 p_ptr->csp_frac = 0;
2639 p_ptr->redraw |= PR_MANA;
2641 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_MIND_BLAST);
2646 /* RF5_BRAIN_SMASH */
2649 if (x!=px || y!=py) return (FALSE);
2655 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2657 msg_print("You feel something focusing on your mind.");
2664 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¸«¤Æ¤¤¤ë¡£", m_name);
2666 msg_format("%^s looks deep into your eyes.", m_name);
2671 dam = damroll(12, 12);
2672 if (rand_int(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2675 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2677 msg_print("You resist the effects!");
2679 learn_spell(MS_BRAIN_SMASH);
2684 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2686 msg_print("Your mind is blasted by psionic energy.");
2693 p_ptr->csp_frac = 0;
2695 p_ptr->redraw |= PR_MANA;
2697 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_BRAIN_SMASH);
2698 if (!p_ptr->resist_blind)
2700 (void)set_blind(p_ptr->blind + 8 + rand_int(8));
2702 if (!p_ptr->resist_conf)
2704 (void)set_confused(p_ptr->confused + rand_int(4) + 4);
2706 if (!p_ptr->free_act)
2708 (void)set_paralyzed(p_ptr->paralyzed + rand_int(4) + 4);
2710 (void)set_slow(p_ptr->slow + rand_int(4) + 4, FALSE);
2712 while (rand_int(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2713 (void)do_dec_stat(A_INT);
2714 while (rand_int(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2715 (void)do_dec_stat(A_WIS);
2717 if (!p_ptr->resist_chaos)
2719 (void)set_image(p_ptr->image + rand_int(250) + 150);
2728 if (x!=px || y!=py) return (FALSE);
2732 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2734 if (blind) msg_format("%^s mumbles.", m_name);
2738 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¼ö¤Ã¤¿¡£", m_name);
2740 else msg_format("%^s points at you and curses.", m_name);
2743 dam = damroll(3, 8);
2744 if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
2747 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2749 msg_print("You resist the effects!");
2751 learn_spell(MS_CAUSE_1);
2755 curse_equipment(33, 0);
2756 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_1);
2764 if (x!=px || y!=py) return (FALSE);
2768 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2770 if (blind) msg_format("%^s mumbles.", m_name);
2774 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤Ã¤¿¡£", m_name);
2776 else msg_format("%^s points at you and curses horribly.", m_name);
2779 dam = damroll(8, 8);
2780 if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
2783 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2785 msg_print("You resist the effects!");
2787 learn_spell(MS_CAUSE_2);
2791 curse_equipment(50, 5);
2792 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_2);
2800 if (x!=px || y!=py) return (FALSE);
2804 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
2806 if (blind) msg_format("%^s mumbles loudly.", m_name);
2810 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
2812 else msg_format("%^s points at you, incanting terribly!", m_name);
2815 dam = damroll(10, 15);
2816 if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
2819 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2821 msg_print("You resist the effects!");
2823 learn_spell(MS_CAUSE_3);
2827 curse_equipment(80, 15);
2828 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_3);
2836 if (x!=px || y!=py) return (FALSE);
2840 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2842 if (blind) msg_format("%^s screams the word 'DIE!'", m_name);
2846 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÈ빦¤òÆͤ¤¤Æ¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2848 else msg_format("%^s points at you, screaming the word DIE!", m_name);
2851 dam = damroll(15, 15);
2852 if ((rand_int(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
2855 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
2857 msg_print("You resist the effects!");
2859 learn_spell(MS_CAUSE_4);
2863 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_4);
2864 (void)set_cut(p_ptr->cut + damroll(10, 10));
2872 if (x!=px || y!=py) return (FALSE);
2875 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2877 if (blind) msg_format("%^s mumbles.", m_name);
2881 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2883 else msg_format("%^s casts a acid bolt.", m_name);
2886 dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2887 bolt(m_idx, GF_ACID, dam, MS_BOLT_ACID, learnable);
2888 update_smart_learn(m_idx, DRS_ACID);
2889 update_smart_learn(m_idx, DRS_REFLECT);
2896 if (x!=px || y!=py) return (FALSE);
2899 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2901 if (blind) msg_format("%^s mumbles.", m_name);
2905 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2907 else msg_format("%^s casts a lightning bolt.", m_name);
2910 dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2911 bolt(m_idx, GF_ELEC, dam, MS_BOLT_ELEC, learnable);
2912 update_smart_learn(m_idx, DRS_ELEC);
2913 update_smart_learn(m_idx, DRS_REFLECT);
2920 if (x!=px || y!=py) return (FALSE);
2923 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2925 if (blind) msg_format("%^s mumbles.", m_name);
2929 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2931 else msg_format("%^s casts a fire bolt.", m_name);
2934 dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2935 bolt(m_idx, GF_FIRE, dam, MS_BOLT_FIRE, learnable);
2936 update_smart_learn(m_idx, DRS_FIRE);
2937 update_smart_learn(m_idx, DRS_REFLECT);
2944 if (x!=px || y!=py) return (FALSE);
2947 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2949 if (blind) msg_format("%^s mumbles.", m_name);
2953 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2955 else msg_format("%^s casts a frost bolt.", m_name);
2958 dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2959 bolt(m_idx, GF_COLD, dam, MS_BOLT_COLD, learnable);
2960 update_smart_learn(m_idx, DRS_COLD);
2961 update_smart_learn(m_idx, DRS_REFLECT);
2970 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2972 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2976 else msg_format("%^s¤¬¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2978 else msg_format("%^s invokes a starburst.", m_name);
2981 dam = (rlev * 4) + 50 + damroll(10, 10);
2982 breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2983 update_smart_learn(m_idx, DRS_LITE);
2990 if (x!=px || y!=py) return (FALSE);
2993 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2995 if (blind) msg_format("%^s mumbles.", m_name);
2999 else msg_format("%^s¤¬ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3001 else msg_format("%^s casts a nether bolt.", m_name);
3004 dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
3005 bolt(m_idx, GF_NETHER, dam, MS_BOLT_NETHER, learnable);
3006 update_smart_learn(m_idx, DRS_NETH);
3007 update_smart_learn(m_idx, DRS_REFLECT);
3014 if (x!=px || y!=py) return (FALSE);
3017 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3019 if (blind) msg_format("%^s mumbles.", m_name);
3023 else msg_format("%^s¤¬¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3025 else msg_format("%^s casts a water bolt.", m_name);
3028 dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3029 bolt(m_idx, GF_WATER, dam, MS_BOLT_WATER, learnable);
3030 update_smart_learn(m_idx, DRS_REFLECT);
3037 if (x!=px || y!=py) return (FALSE);
3040 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3042 if (blind) msg_format("%^s mumbles.", m_name);
3046 else msg_format("%^s¤¬ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3048 else msg_format("%^s casts a mana bolt.", m_name);
3051 dam = randint(rlev * 7 / 2) + 50;
3052 bolt(m_idx, GF_MANA, dam, MS_BOLT_MANA, learnable);
3053 update_smart_learn(m_idx, DRS_REFLECT);
3060 if (x!=px || y!=py) return (FALSE);
3063 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3065 if (blind) msg_format("%^s mumbles.", m_name);
3069 else msg_format("%^s¤¬¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3071 else msg_format("%^s casts a plasma bolt.", m_name);
3074 dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3075 bolt(m_idx, GF_PLASMA, dam, MS_BOLT_PLASMA, learnable);
3076 update_smart_learn(m_idx, DRS_REFLECT);
3083 if (x!=px || y!=py) return (FALSE);
3086 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3088 if (blind) msg_format("%^s mumbles.", m_name);
3092 else msg_format("%^s¤¬¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3094 else msg_format("%^s casts an ice bolt.", m_name);
3097 dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3098 bolt(m_idx, GF_ICE, dam, MS_BOLT_ICE, learnable);
3099 update_smart_learn(m_idx, DRS_COLD);
3100 update_smart_learn(m_idx, DRS_REFLECT);
3107 if (x!=px || y!=py) return (FALSE);
3110 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3112 if (blind) msg_format("%^s mumbles.", m_name);
3116 else msg_format("%^s¤¬¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3118 else msg_format("%^s casts a magic missile.", m_name);
3121 dam = damroll(2, 6) + (rlev / 3);
3122 bolt(m_idx, GF_MISSILE, dam, MS_MAGIC_MISSILE, learnable);
3123 update_smart_learn(m_idx, DRS_REFLECT);
3130 if (x!=px || y!=py) return (FALSE);
3134 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
3136 if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
3140 else msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3142 else msg_format("%^s casts a fearful illusion.", m_name);
3145 if (p_ptr->resist_fear)
3148 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3150 msg_print("You refuse to be frightened.");
3154 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3157 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3159 msg_print("You refuse to be frightened.");
3165 (void)set_afraid(p_ptr->afraid + rand_int(4) + 4);
3167 learn_spell(MS_SCARE);
3168 update_smart_learn(m_idx, DRS_FEAR);
3175 if (x!=px || y!=py) return (FALSE);
3179 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3181 if (blind) msg_format("%^s mumbles.", m_name);
3185 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¤¢¤Ê¤¿¤ÎÌܤò¤¯¤é¤Þ¤·¤¿¡ª", m_name);
3187 else msg_format("%^s casts a spell, burning your eyes!", m_name);
3190 if (p_ptr->resist_blind)
3193 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3195 msg_print("You are unaffected!");
3199 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3202 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3204 msg_print("You resist the effects!");
3210 (void)set_blind(12 + rand_int(4));
3212 learn_spell(MS_BLIND);
3213 update_smart_learn(m_idx, DRS_BLIND);
3220 if (x!=px || y!=py) return (FALSE);
3224 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
3226 if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
3230 else msg_format("%^s¤¬Í¶ÏÇŪ¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3232 else msg_format("%^s creates a mesmerising illusion.", m_name);
3235 if (p_ptr->resist_conf)
3238 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3240 msg_print("You disbelieve the feeble spell.");
3244 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3247 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3249 msg_print("You disbelieve the feeble spell.");
3255 (void)set_confused(p_ptr->confused + rand_int(4) + 4);
3257 learn_spell(MS_CONF);
3258 update_smart_learn(m_idx, DRS_CONF);
3265 if (x!=px || y!=py) return (FALSE);
3269 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
3271 msg_format("%^s drains power from your muscles!", m_name);
3274 if (p_ptr->free_act)
3277 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3279 msg_print("You are unaffected!");
3283 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3286 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3288 msg_print("You resist the effects!");
3294 (void)set_slow(p_ptr->slow + rand_int(4) + 4, FALSE);
3296 learn_spell(MS_SLOW);
3297 update_smart_learn(m_idx, DRS_FREE);
3304 if (x!=px || y!=py) return (FALSE);
3308 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3310 if (blind) msg_format("%^s mumbles.", m_name);
3314 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÌܤò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡ª", m_name);
3316 else msg_format("%^s stares deep into your eyes!", m_name);
3319 if (p_ptr->free_act)
3322 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3324 msg_print("You are unaffected!");
3328 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3331 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3333 msg_format("You resist the effects!");
3339 (void)set_paralyzed(p_ptr->paralyzed + rand_int(4) + 4);
3341 learn_spell(MS_SLEEP);
3342 update_smart_learn(m_idx, DRS_FREE);
3353 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3355 msg_format("%^s mumbles.", m_name);
3362 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name, m_poss);
3364 msg_format("%^s concentrates on %s body.", m_name, m_poss);
3369 /* Allow quick speed increases to base+10 */
3373 msg_format("%^s¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
3375 msg_format("%^s starts moving faster.", m_name);
3378 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3379 if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS;
3386 if (x!=px || y!=py) return (FALSE);
3389 msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
3391 msg_format("%^s invokes the Hand of Doom!", m_name);
3394 if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3397 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3399 msg_format("You resist the effects!");
3401 learn_spell(MS_HAND_DOOM);
3406 int dummy = (((s32b) ((40 + randint(20)) * (p_ptr->chp))) / 100);
3408 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
3410 msg_print("Your feel your life fade away!");
3413 take_hit(DAMAGE_ATTACK, dummy, m_name, MS_HAND_DOOM);
3414 curse_equipment(100, 20);
3416 if (p_ptr->chp < 1) p_ptr->chp = 1;
3430 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3432 msg_format("%^s mumbles.", m_name);
3439 msg_format("%^s¤¬¼«Ê¬¤Î½ý¤Ë½¸Ã椷¤¿¡£", m_name);
3441 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3447 m_ptr->hp += (rlev * 6);
3450 if (m_ptr->hp >= m_ptr->maxhp)
3453 m_ptr->hp = m_ptr->maxhp;
3459 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3461 msg_format("%^s looks completely healed!", m_name);
3468 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¤è¤¦¤À¡ª", m_name);
3470 msg_format("%^s sounds completely healed!", m_name);
3476 /* Partially healed */
3483 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3485 msg_format("%^s looks healthier.", m_name);
3492 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3494 msg_format("%^s sounds healthier.", m_name);
3500 /* Redraw (later) if needed */
3501 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3502 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3512 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name, m_poss);
3514 msg_format("%^s recovers %s courage.", m_name, m_poss);
3530 msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3532 msg_format("%^s mumbles powerfully.", m_name);
3539 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3541 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3546 if (!(m_ptr->invulner))
3547 m_ptr->invulner = randint(4) + 4;
3549 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3550 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3559 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3561 msg_format("%^s blinks away.", m_name);
3564 teleport_away(m_idx, 10, FALSE);
3565 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
3572 int i, oldfy, oldfx;
3573 u32b f1 = 0 , f2 = 0 , f3 = 0;
3581 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3583 msg_format("%^s teleports away.", m_name);
3586 teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
3588 if (los(py, px, oldfy, oldfx) && !world_monster)
3590 for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
3592 o_ptr = &inventory[i];
3593 if(!(o_ptr->ident & IDENT_CURSED))
3595 object_flags(o_ptr, &f1, &f2, &f3);
3597 if((f3 & TR3_TELEPORT) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
3600 if(get_check_strict("¤Ä¤¤¤Æ¤¤¤¤Þ¤¹¤«¡©", 1))
3602 if(get_check_strict("Do you follow it? ", 1))
3605 if (randint(3) == 1)
3607 teleport_player(200);
3609 msg_print("¼ºÇÔ¡ª");
3611 msg_print("Failed!");
3614 else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3615 p_ptr->energy -= 100;
3630 if(m_ptr->r_idx == MON_DIO) who = 1;
3631 else if(m_ptr->r_idx == MON_WONG) who = 3;
3633 if (!process_the_world(randint(2)+2, who, TRUE)) return (FALSE);
3643 switch(m_ptr->r_idx)
3646 if (p_ptr->inside_arena || p_ptr->inside_battle) return FALSE;
3647 for (k = 0; k < 6; k++)
3649 count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, TRUE, FALSE, FALSE, FALSE, FALSE);
3653 case MON_BANORLUPART:
3655 int dummy_hp = (m_ptr->hp + 1) / 2;
3656 int dummy_maxhp = m_ptr->maxhp/2;
3657 int dummy_y = m_ptr->fy;
3658 int dummy_x = m_ptr->fx;
3660 if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
3661 delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
3662 summon_named_creature(dummy_y, dummy_x, MON_BANOR, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3663 m_list[hack_m_idx_ii].hp = dummy_hp;
3664 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3665 summon_named_creature(dummy_y, dummy_x, MON_LUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3666 m_list[hack_m_idx_ii].hp = dummy_hp;
3667 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3670 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª");
3672 msg_print("Banor=Rupart splits in two person!");
3681 int dummy_maxhp = 0;
3682 int dummy_y = m_ptr->fy;
3683 int dummy_x = m_ptr->fx;
3685 if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
3686 for (k = 1; k < m_max; k++)
3688 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
3690 dummy_hp += m_list[k].hp;
3691 dummy_maxhp += m_list[k].maxhp;
3692 if (m_list[k].r_idx != m_ptr->r_idx)
3694 dummy_y = m_list[k].fy;
3695 dummy_x = m_list[k].fx;
3697 delete_monster_idx(k);
3700 summon_named_creature(dummy_y, dummy_x, MON_BANORLUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
3701 m_list[hack_m_idx_ii].hp = dummy_hp;
3702 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3705 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª");
3707 msg_print("Banor and Rupart combine into one!");
3712 default: return FALSE;
3720 if (x!=px || y!=py) return (FALSE);
3724 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤Ìᤷ¤¿¡£", m_name);
3726 msg_format("%^s commands you to return.", m_name);
3729 teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3730 learn_spell(MS_TELE_TO);
3737 if (x!=px || y!=py) return (FALSE);
3741 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
3742 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
3743 msg_print("¤¯¤Ã¤½¡Á");
3745 msg_format("%^s teleports you away.", m_name);
3748 learn_spell(MS_TELE_AWAY);
3749 teleport_player(100);
3753 /* RF6_TELE_LEVEL */
3756 if (x!=px || y!=py) return (FALSE);
3760 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3762 if (blind) msg_format("%^s mumbles strangely.", m_name);
3766 else msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
3768 else msg_format("%^s gestures at your feet.", m_name);
3771 if (p_ptr->resist_nexus)
3774 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3776 msg_print("You are unaffected!");
3780 else if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3783 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3785 msg_print("You resist the effects!");
3791 teleport_player_level();
3793 learn_spell(MS_TELE_LEVEL);
3794 update_smart_learn(m_idx, DRS_NEXUS);
3801 if (x!=px || y!=py) return (FALSE);
3804 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3806 if (blind) msg_format("%^s mumbles.", m_name);
3810 else msg_format("%^s¤¬¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name);
3812 else msg_format("%^s throw a Psycho-Spear.", m_name);
3815 dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint(rlev * 2) + 150) : (randint(rlev * 3 / 2) + 100);
3816 beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
3823 if (x!=px || y!=py) return (FALSE);
3827 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3829 if (blind) msg_format("%^s mumbles.", m_name);
3833 else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3834 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3836 else if (p_ptr->pclass == CLASS_NINJA)
3837 msg_format("%^s cast a spell to light up.", m_name);
3838 else msg_format("%^s gestures in shadow.", m_name);
3841 learn_spell(MS_DARKNESS);
3842 if (p_ptr->pclass == CLASS_NINJA)
3843 (void)lite_area(0, 3);
3845 (void)unlite_area(0, 3);
3855 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3857 if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
3861 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3863 else msg_format("%^s casts a spell and cackles evilly.", m_name);
3866 learn_spell(MS_MAKE_TRAP);
3867 (void)trap_creation(y, x);
3874 if (x!=px || y!=py) return (FALSE);
3878 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);
3880 msg_format("%^s tries to blank your mind.", m_name);
3884 if (rand_int(100 + rlev/2) < p_ptr->skill_sav)
3887 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3889 msg_print("You resist the effects!");
3893 else if (lose_all_info())
3896 msg_print("µ²±¤¬Çö¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
3898 msg_print("Your memories fade away.");
3902 learn_spell(MS_FORGET);
3906 /* RF6_RAISE_DEAD */
3911 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3913 if (blind) msg_format("%^s mumbles.", m_name);
3917 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3919 else msg_format("%^s casts a spell to revive corpses.", m_name);
3921 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3925 /* RF6_SUMMON_KIN */
3929 if (m_ptr->r_idx == MON_ROLENTO)
3933 msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name);
3935 msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3938 msg_format("%^s spreads something.", m_name);
3940 msg_format("%^s throws some hand grenades.", m_name);
3943 else if (m_ptr->r_idx == MON_SERPENT)
3947 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3949 msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´¤·¤¿¡£", m_name);
3952 msg_format("%^s mumbles.", m_name);
3954 msg_format("%^s magically summons guardians of dungeons.", m_name);
3961 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3963 msg_format("%^s¤ÏËâË¡¤Ç%s¤ò¾¤´¤·¤¿¡£",
3965 ((r_ptr->flags1) & RF1_UNIQUE ?
3969 msg_format("%^s mumbles.", m_name);
3971 msg_format("%^s magically summons %s %s.",
3973 ((r_ptr->flags1) & RF1_UNIQUE ?
3974 "minions" : "kin"));
3978 if(m_ptr->r_idx == MON_ROLENTO)
3980 int num = 1 + randint(3);
3981 for (k = 0; k < num; k++)
3983 count += summon_named_creature(y, x, MON_SHURYUUDAN, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
3986 else if(m_ptr->r_idx == MON_LOUSY)
3988 int num = 2 + randint(3);
3989 for (k = 0; k < num; k++)
3991 count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, TRUE, FALSE, FALSE, FALSE, FALSE);
3994 else if(m_ptr->r_idx == MON_BULLGATES)
3996 int num = 2 + randint(3);
3997 for (k = 0; k < num; k++)
3999 count += summon_named_creature(y, x, 921, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
4002 else if (m_ptr->r_idx == MON_CALDARM)
4004 int num = randint(3);
4005 for (k = 0; k < num; k++)
4007 count += summon_named_creature(y, x, 930, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
4010 else if (m_ptr->r_idx == MON_SERPENT)
4012 int num = 2 + randint(3);
4014 if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
4017 msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤½Ð¤·¤¿¡ª");
4019 msg_print("Water blew off from the ground!");
4021 fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
4024 for (k = 0; k < num; k++)
4026 count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, TRUE, FALSE, FALSE, TRUE, FALSE);
4032 summon_kin_type = r_ptr->d_char; /* Big hack */
4034 for (k = 0; k < 4; k++)
4036 count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, TRUE, FALSE, FALSE, FALSE, FALSE);
4040 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4042 if (blind && count) msg_print("You hear many things appear nearby.");
4054 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4056 if (blind) msg_format("%^s mumbles.", m_name);
4060 else msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4062 else msg_format("%^s magically summons Cyberdemons!", m_name);
4066 if (blind && count) msg_print("½Å¸ü¤Ê²»¤¬¶á¤¯¤Çʹ¤³¤¨¤ë¡£");
4068 if (blind && count) msg_print("You hear heavy steps nearby.");
4071 summon_cyber(m_idx, y, x);
4080 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4082 if (blind) msg_format("%^s mumbles.", m_name);
4086 else msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´¤·¤¿¡ª", m_name);
4088 else msg_format("%^s magically summons help!", m_name);
4091 for (k = 0; k < 1; k++)
4093 count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
4096 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4098 if (blind && count) msg_print("You hear something appear nearby.");
4104 /* RF6_S_MONSTERS */
4109 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4111 if (blind) msg_format("%^s mumbles.", m_name);
4115 else msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª", m_name);
4117 else msg_format("%^s magically summons monsters!", m_name);
4120 for (k = 0; k < s_num_6; k++)
4122 count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
4125 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4127 if (blind && count) msg_print("You hear many things appear nearby.");
4138 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4140 if (blind) msg_format("%^s mumbles.", m_name);
4144 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´¤·¤¿¡£", m_name);
4146 else msg_format("%^s magically summons ants.", m_name);
4149 for (k = 0; k < s_num_6; k++)
4151 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, TRUE, FALSE, FALSE, FALSE, FALSE);
4154 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4156 if (blind && count) msg_print("You hear many things appear nearby.");
4167 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4169 if (blind) msg_format("%^s mumbles.", m_name);
4173 else msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´¤·¤¿¡£", m_name);
4175 else msg_format("%^s magically summons spiders.", m_name);
4178 for (k = 0; k < s_num_6; k++)
4180 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, TRUE, FALSE, FALSE, FALSE, FALSE);
4183 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4185 if (blind && count) msg_print("You hear many things appear nearby.");
4196 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4198 if (blind) msg_format("%^s mumbles.", m_name);
4202 else msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£", m_name);
4204 else msg_format("%^s magically summons hounds.", m_name);
4207 for (k = 0; k < s_num_4; k++)
4209 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, TRUE, FALSE, FALSE, FALSE, FALSE);
4212 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4214 if (blind && count) msg_print("You hear many things appear nearby.");
4225 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4227 if (blind) msg_format("%^s mumbles.", m_name);
4231 else msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£", m_name);
4233 else msg_format("%^s magically summons hydras.", m_name);
4236 for (k = 0; k < s_num_4; k++)
4238 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, TRUE, FALSE, FALSE, FALSE, FALSE);
4241 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4243 if (blind && count) msg_print("You hear many things appear nearby.");
4256 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4258 if (blind) msg_format("%^s mumbles.", m_name);
4262 else msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´¤·¤¿¡ª", m_name);
4264 else msg_format("%^s magically summons an angel!", m_name);
4267 if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
4269 num += r_ptr->level/40;
4272 for (k = 0; k < num; k++)
4274 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, FALSE, FALSE);
4280 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4282 if (blind && count) msg_print("You hear something appear nearby.");
4288 if (blind) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4290 if (blind) msg_print("You hear many things appear nearby.");
4302 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4304 if (blind) msg_format("%^s mumbles.", m_name);
4308 else msg_format("%^s¤ÏËâË¡¤Çº®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª", m_name);
4310 else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4313 for (k = 0; k < 1; k++)
4315 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, TRUE, FALSE, FALSE, FALSE, FALSE);
4318 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4320 if (blind && count) msg_print("You hear something appear nearby.");
4331 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4333 if (blind) msg_format("%^s mumbles.", m_name);
4337 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4339 else msg_format("%^s magically summons an undead adversary!", m_name);
4342 for (k = 0; k < 1; k++)
4344 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, TRUE, FALSE, FALSE, FALSE, FALSE);
4347 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4349 if (blind && count) msg_print("You hear something appear nearby.");
4360 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4362 if (blind) msg_format("%^s mumbles.", m_name);
4366 else msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4368 else msg_format("%^s magically summons a dragon!", m_name);
4371 for (k = 0; k < 1; k++)
4373 count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, TRUE, FALSE, FALSE, FALSE, FALSE);
4376 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4378 if (blind && count) msg_print("You hear something appear nearby.");
4384 /* RF6_S_HI_UNDEAD */
4389 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))
4395 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4397 if (blind) msg_format("%^s mumbles.", m_name);
4401 else msg_format("%^s¤¬ËâË¡¤ÇÍ©µ´ÀïÂâ¤ò¾¤´¤·¤¿¡ª", m_name);
4403 else msg_format("%^s magically summons rangers of Nazgul!", m_name);
4407 for (k = 0; k < 30; k++)
4409 if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
4412 for (j = 100; j > 0; j--)
4414 scatter(&cy, &cx, y, x, 2, 0);
4415 if (cave_floor_bold(cy, cx)) break;
4419 if (!cave_floor_bold(cy, cx)) continue;
4421 if (summon_named_creature(cy, cx, MON_NAZGUL, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr)))
4428 msg_format("¡ÖÍ©µ´ÀïÂâ%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4430 msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
4434 msg_format("¡ÖƱ¤¸¤¯%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4436 msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
4442 msg_format("¡Ö%dɤ¤½¤í¤Ã¤Æ¡¢¥ê¥ó¥°¥ì¥ó¥¸¥ã¡¼¡ª¡×", count);
4444 msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
4451 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4453 if (blind) msg_format("%^s mumbles.", m_name);
4457 else msg_format("%^s¤¬ËâË¡¤Ç¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª", m_name);
4459 else msg_format("%^s magically summons greater undead!", m_name);
4462 for (k = 0; k < s_num_6; k++)
4464 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
4470 msg_print("´Ö¶á¤Ç²¿¤«Â¿¤¯¤Î¤â¤Î¤¬Ç礤²ó¤ë²»¤¬Ê¹¤³¤¨¤ë¡£");
4472 msg_print("You hear many creepy things appear nearby.");
4479 /* RF6_S_HI_DRAGON */
4484 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4486 if (blind) msg_format("%^s mumbles.", m_name);
4490 else msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4492 else msg_format("%^s magically summons ancient dragons!", m_name);
4495 for (k = 0; k < s_num_4; k++)
4497 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, TRUE, FALSE, FALSE, TRUE, FALSE);
4502 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4504 msg_print("You hear many powerful things appear nearby.");
4511 /* RF6_S_AMBERITES */
4516 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4518 if (blind) msg_format("%^s mumbles.", m_name);
4522 else msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦¤ò¾¤´¤·¤¿¡ª", m_name);
4524 else msg_format("%^s magically summons Lords of Amber!", m_name);
4529 for (k = 0; k < s_num_4; k++)
4531 count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, TRUE, FALSE, FALSE, TRUE, FALSE);
4536 msg_print("ÉÔ»à¤Î¼Ô¤¬¶á¤¯¤Ë¸½¤ì¤ë¤Î¤¬Ê¹¤³¤¨¤¿¡£");
4538 msg_print("You hear immortal beings appear nearby.");
4550 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4552 if (blind) msg_format("%^s mumbles.", m_name);
4556 else msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4558 else msg_format("%^s magically summons special opponents!", m_name);
4561 for (k = 0; k < s_num_4; k++)
4563 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, TRUE, FALSE, FALSE, TRUE, FALSE);
4565 if (r_ptr->flags3 & RF3_GOOD)
4567 for (k = count; k < s_num_4; k++)
4569 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, TRUE, FALSE);
4574 for (k = count; k < s_num_4; k++)
4576 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
4582 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4584 msg_print("You hear many powerful things appear nearby.");
4592 if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
4594 learn_spell(thrown_spell - 96);
4597 if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR))
4599 if (thrown_spell != 167)
4601 if (mane_num == MAX_MANE)
4605 for (i = 0;i < mane_num;i++)
4607 mane_spell[i] = mane_spell[i+1];
4608 mane_dam[i] = mane_dam[i+1];
4611 mane_spell[mane_num] = thrown_spell - 96;
4612 mane_dam[mane_num] = dam;
4616 p_ptr->redraw |= (PR_MANE);
4620 /* Remember what the monster did to us */
4624 if (thrown_spell < 32 * 4)
4626 r_ptr->r_flags4 |= (1L << (thrown_spell - 32 * 3));
4627 if (r_ptr->r_cast_inate < MAX_UCHAR) r_ptr->r_cast_inate++;
4631 else if (thrown_spell < 32 * 5)
4633 r_ptr->r_flags5 |= (1L << (thrown_spell - 32 * 4));
4634 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4638 else if (thrown_spell < 32 * 6)
4640 r_ptr->r_flags6 |= (1L << (thrown_spell - 32 * 5));
4641 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4646 /* Always take note of monsters that kill you */
4647 if (death && (r_ptr->r_deaths < MAX_SHORT))
4652 /* A spell was cast */