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 (randint0(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 && (randint0(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 f4 &= ~(RF4_BR_ACID);
146 f5 &= ~(RF5_BA_ACID);
147 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 f4 &= ~(RF4_BR_ELEC);
166 f5 &= ~(RF5_BA_ELEC);
167 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 f4 &= ~(RF4_BR_FIRE);
186 f5 &= ~(RF5_BA_FIRE);
187 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 f4 &= ~(RF4_BR_COLD);
206 f5 &= ~(RF5_BA_COLD);
207 f5 &= ~(RF5_BO_COLD);
208 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 (prace_is_(RACE_SPECTRE))
244 f4 &= ~(RF4_BR_NETH);
245 f5 &= ~(RF5_BA_NETH);
246 f5 &= ~(RF5_BO_NETH);
250 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_NETH);
251 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_NETH);
252 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BO_NETH);
256 if (smart & (SM_RES_LITE))
258 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_LITE);
259 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_LITE);
262 if (smart & (SM_RES_DARK))
264 if (prace_is_(RACE_VAMPIRE))
266 f4 &= ~(RF4_BR_DARK);
267 f5 &= ~(RF5_BA_DARK);
271 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_DARK);
272 if (int_outof(r_ptr, 50)) f5 &= ~(RF5_BA_DARK);
276 if (smart & (SM_RES_FEAR))
281 if (smart & (SM_RES_CONF))
284 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_CONF);
287 if (smart & (SM_RES_CHAOS))
289 if (int_outof(r_ptr, 20)) f4 &= ~(RF4_BR_CHAO);
290 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BA_CHAO);
293 if (smart & (SM_RES_DISEN))
295 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_DISE);
298 if (smart & (SM_RES_BLIND))
303 if (smart & (SM_RES_NEXUS))
305 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_NEXU);
306 f6 &= ~(RF6_TELE_LEVEL);
309 if (smart & (SM_RES_SOUND))
311 if (int_outof(r_ptr, 50)) f4 &= ~(RF4_BR_SOUN);
314 if (smart & (SM_RES_SHARD))
316 if (int_outof(r_ptr, 40)) f4 &= ~(RF4_BR_SHAR);
319 if (smart & (SM_IMM_REFLECT))
321 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_COLD);
322 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_FIRE);
323 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ACID);
324 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ELEC);
325 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_NETH);
326 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_WATE);
327 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_MANA);
328 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
329 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
330 if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
331 if (int_outof(r_ptr, 150)) f4 &= ~(RF4_SHOOT);
334 if (smart & (SM_IMM_FREE))
340 if (smart & (SM_IMM_MANA))
342 f5 &= ~(RF5_DRAIN_MANA);
345 /* XXX XXX XXX No spells left? */
346 /* if (!f4 && !f5 && !f6) ... */
353 #endif /* DRS_SMART_OPTIONS */
357 * Determine if there is a space near the player in which
358 * a summoned creature can appear
360 bool summon_possible(int y1, int x1)
364 /* Start at the player's location, and check 2 grids in each dir */
365 for (y = y1 - 2; y <= y1 + 2; y++)
367 for (x = x1 - 2; x <= x1 + 2; x++)
369 /* Ignore illegal locations */
370 if (!in_bounds(y, x)) continue;
372 /* Only check a circular area */
373 if (distance(y1, x1, y, x)>2) continue;
376 /* Hack: no summon on glyph of warding */
377 if (cave[y][x].feat == FEAT_GLYPH) continue;
378 if (cave[y][x].feat == FEAT_MINOR_GLYPH) continue;
381 /* ...nor on the Pattern */
382 if ((cave[y][x].feat >= FEAT_PATTERN_START)
383 && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
385 /* Require empty floor grid in line of sight */
386 if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE);
394 static bool raise_possible(int y, int x)
397 s16b this_o_idx, next_o_idx = 0;
400 for (xx = x - 5; xx <= x + 5; xx++)
402 for (yy = y - 5; yy <= y + 5; yy++)
404 if (distance(y, x, yy, xx) > 5) continue;
405 if (!los(y, x, yy, xx)) continue;
407 c_ptr = &cave[yy][xx];
408 /* Scan the pile of objects */
409 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
412 object_type *o_ptr = &o_list[this_o_idx];
414 /* Acquire next object */
415 next_o_idx = o_ptr->next_o_idx;
417 /* Known to be worthless? */
418 if (o_ptr->tval == TV_CORPSE)
428 * Originally, it was possible for a friendly to shoot another friendly.
429 * Change it so a "clean shot" means no equally friendly monster is
430 * between the attacker and target.
433 * Determine if a bolt spell will hit the player.
435 * This is exactly like "projectable", but it will
436 * return FALSE if a monster is in the way.
437 * no equally friendly monster is
438 * between the attacker and target.
440 bool clean_shot(int y1, int x1, int y2, int x2, bool friend)
442 /* Must be the same as projectable() */
449 /* Check the projection path */
450 grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
452 /* No grid is ever projectable from itself */
453 if (!grid_n) return (FALSE);
456 y = GRID_Y(grid_g[grid_n-1]);
457 x = GRID_X(grid_g[grid_n-1]);
459 /* May not end in an unrequested grid */
460 if ((y != y2) || (x != x2)) return (FALSE);
462 for (i = 0; i < grid_n; i++)
464 y = GRID_Y(grid_g[i]);
465 x = GRID_X(grid_g[i]);
467 if ((cave[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
469 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
470 if (friend == is_pet(m_ptr))
475 /* Pets may not shoot through the character - TNB */
476 if ((y == py) && (x == px))
478 if (friend) return (FALSE);
486 * Cast a bolt at the player
487 * Stop if we hit a monster
488 * Affect monsters and the player
490 static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
492 int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
494 /* Target the player with a bolt attack */
495 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
498 static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
500 int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER | PROJECT_NO_REF;
502 /* Target the player with a bolt attack */
503 (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
508 * Cast a breath (or ball) attack at the player
509 * Pass over any monsters that may be in the way
510 * Affect grids, objects, monsters, and the player
512 static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, bool learnable)
514 int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_PLAYER;
516 monster_type *m_ptr = &m_list[m_idx];
517 monster_race *r_ptr = &r_info[m_ptr->r_idx];
519 /* Determine the radius of the blast */
520 if ((rad < 1) && breath) rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
522 /* Handle breath attacks */
523 if (breath) rad = 0 - rad;
525 if (typ == GF_ROCKET) flg |= PROJECT_STOP;
527 /* Target the player with a ball attack */
528 (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
532 u32b get_curse(int power, object_type *o_ptr)
538 new_curse = (1 << (randint0(MAX_CURSE)+4));
541 if (!(new_curse & TRC_HEAVY_MASK)) continue;
545 if (new_curse & TRC_SPECIAL_MASK) continue;
549 if (new_curse & TRC_HEAVY_MASK) continue;
551 if (((o_ptr->tval < TV_BOW) || (o_ptr->tval > TV_SWORD)) && (new_curse == TRC_LOW_MELEE)) continue;
552 if (((o_ptr->tval < TV_BOOTS) || (o_ptr->tval > TV_DRAG_ARMOR)) && (new_curse == TRC_LOW_AC)) continue;
558 void curse_equipment(int chance, int heavy_chance)
560 bool changed = FALSE;
564 object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
565 char o_name[MAX_NLEN];
567 if (randint1(100) > chance) return;
569 if (!o_ptr->k_idx) return;
571 object_flags(o_ptr, &o1, &o2, &o3);
573 object_desc(o_name, o_ptr, FALSE, 0);
575 /* Extra, biased saving throw for blessed items */
576 if ((o3 & TR3_BLESSED) && (randint1(888) > chance))
579 msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
581 msg_format("Your %s resist%s cursing!", o_name,
584 ((o_ptr->number > 1) ? "" : "s"));
585 /* Hmmm -- can we wear multiple items? If not, this is unnecessary */
589 if ((randint1(100) <= heavy_chance) &&
590 (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
592 if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
594 o_ptr->curse_flags |= TRC_HEAVY_CURSE;
595 o_ptr->curse_flags |= TRC_CURSED;
600 if (!cursed_p(o_ptr))
602 o_ptr->curse_flags |= TRC_CURSED;
604 if (heavy_chance >= 50) curse_power++;
606 new_curse = get_curse(curse_power, o_ptr);
607 if (!(o_ptr->curse_flags & new_curse))
610 o_ptr->curse_flags |= new_curse;
616 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
618 msg_format("There is a malignant black aura surrounding %s...", o_name);
621 o_ptr->feeling = FEEL_NONE;
623 p_ptr->update |= (PU_BONUS);
628 * Return TRUE if a spell is good for hurting the player (directly).
630 static bool spell_attack(byte spell)
632 /* All RF4 spells hurt (except for shriek and dispel) */
633 if (spell < 128 && spell > 98) return (TRUE);
635 /* Various "ball" spells */
636 if (spell >= 128 && spell <= 128 + 8) return (TRUE);
638 /* "Cause wounds" and "bolt" spells */
639 if (spell >= 128 + 12 && spell < 128 + 27) return (TRUE);
642 if (spell == 160 + 1) return (TRUE);
645 if (spell == 160 + 11) return (TRUE);
653 * Return TRUE if a spell is good for escaping.
655 static bool spell_escape(byte spell)
657 /* Blink or Teleport */
658 if (spell == 160 + 4 || spell == 160 + 5) return (TRUE);
660 /* Teleport the player away */
661 if (spell == 160 + 9 || spell == 160 + 10) return (TRUE);
663 /* Isn't good for escaping */
668 * Return TRUE if a spell is good for annoying the player.
670 static bool spell_annoy(byte spell)
673 if (spell == 96 + 0) return (TRUE);
675 /* Brain smash, et al (added curses) */
676 if (spell >= 128 + 9 && spell <= 128 + 14) return (TRUE);
678 /* Scare, confuse, blind, slow, paralyze */
679 if (spell >= 128 + 27 && spell <= 128 + 31) return (TRUE);
682 if (spell == 160 + 8) return (TRUE);
685 if (spell == 160 + 10) return (TRUE);
687 /* Darkness, make traps, cause amnesia */
688 if (spell >= 160 + 12 && spell <= 160 + 14) return (TRUE);
695 * Return TRUE if a spell summons help.
697 static bool spell_summon(byte spell)
699 /* All summon spells */
700 if (spell >= 160 + 16) return (TRUE);
708 * Return TRUE if a spell raise-dead.
710 static bool spell_raise(byte spell)
712 /* All raise-dead spells */
713 if (spell == 160 + 15) return (TRUE);
721 * Return TRUE if a spell is good in a tactical situation.
723 static bool spell_tactic(byte spell)
726 if (spell == 160 + 4) return (TRUE);
733 * Return TRUE if a spell makes invulnerable.
735 static bool spell_invulner(byte spell)
737 /* Invulnerability */
738 if (spell == 160 + 3) return (TRUE);
740 /* No invulnerability */
745 * Return TRUE if a spell hastes.
747 static bool spell_haste(byte spell)
750 if (spell == 160 + 0) return (TRUE);
752 /* Not a haste spell */
758 * Return TRUE if a spell world.
760 static bool spell_world(byte spell)
763 if (spell == 160 + 6) return (TRUE);
765 /* Not a haste spell */
771 * Return TRUE if a spell special.
773 static bool spell_special(byte spell)
775 if (p_ptr->inside_battle) return FALSE;
778 if (spell == 160 + 7) return (TRUE);
780 /* Not a haste spell */
786 * Return TRUE if a spell psycho-spear.
788 static bool spell_psy_spe(byte spell)
791 if (spell == 160 + 11) return (TRUE);
793 /* Not a haste spell */
799 * Return TRUE if a spell is good for healing.
801 static bool spell_heal(byte spell)
804 if (spell == 160 + 2) return (TRUE);
812 * Return TRUE if a spell is good for dispel.
814 static bool spell_dispel(byte spell)
817 if (spell == 96 + 2) return (TRUE);
825 * Check should monster cast dispel spell.
827 static bool dispel_check(int m_idx)
829 monster_type *m_ptr = &m_list[m_idx];
830 monster_race *r_ptr = &r_info[m_ptr->r_idx];
833 if (p_ptr->invuln) return (TRUE);
836 if (p_ptr->wraith_form) return (TRUE);
839 if (p_ptr->shield) return (TRUE);
842 if (p_ptr->magicdef) return (TRUE);
845 if (p_ptr->multishadow) return (TRUE);
848 if (p_ptr->dustrobe) return (TRUE);
850 /* Berserk Strength */
851 if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) return (TRUE);
853 /* Invulnability song */
854 if (music_singing(MUSIC_INVULN)) return (TRUE);
857 if (p_ptr->mimic_form == MIMIC_DEMON_LORD) return (TRUE);
859 /* Elemental resistances */
860 if (r_ptr->flags4 & RF4_BR_ACID)
862 if (!p_ptr->immune_acid && p_ptr->oppose_acid) return (TRUE);
864 if (p_ptr->special_defense & DEFENSE_ACID) return (TRUE);
867 if (r_ptr->flags4 & RF4_BR_FIRE)
869 if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44))
871 if(!p_ptr->immune_fire && p_ptr->oppose_fire) return (TRUE);
873 if(p_ptr->special_defense & DEFENSE_FIRE) return(TRUE);
877 if (r_ptr->flags4 & RF4_BR_ELEC)
879 if (!p_ptr->immune_elec && p_ptr->oppose_elec) return (TRUE);
881 if (p_ptr->special_defense & DEFENSE_ELEC) return (TRUE);
884 if (r_ptr->flags4 & RF4_BR_COLD)
886 if (!p_ptr->immune_cold && p_ptr->oppose_cold) return (TRUE);
888 if (p_ptr->special_defense & DEFENSE_COLD) return (TRUE);
891 if (r_ptr->flags4 & (RF4_BR_POIS | RF4_BR_NUKE))
893 if (!((p_ptr->pclass == CLASS_NINJA) && p_ptr->lev > 44))
895 if (p_ptr->oppose_pois) return (TRUE);
897 if (p_ptr->special_defense & DEFENSE_POIS) return (TRUE);
901 /* Elemental resist music */
902 if (music_singing(MUSIC_RESIST))
904 if (r_ptr->flags4 & (RF4_BR_ACID | RF4_BR_FIRE | RF4_BR_ELEC | RF4_BR_COLD | RF4_BR_POIS)) return (TRUE);
907 /* Ultimate resistance */
908 if (p_ptr->ult_res) return (TRUE);
910 /* Potion of Neo Tsuyosi special */
911 if (p_ptr->tsuyoshi) return (TRUE);
913 /* Elemental Brands */
914 if ((p_ptr->special_attack & ATTACK_ACID) && !(r_ptr->flags3 & RF3_IM_ACID)) return (TRUE);
915 if ((p_ptr->special_attack & ATTACK_FIRE) && !(r_ptr->flags3 & RF3_IM_FIRE)) return (TRUE);
916 if ((p_ptr->special_attack & ATTACK_ELEC) && !(r_ptr->flags3 & RF3_IM_ELEC)) return (TRUE);
917 if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flags3 & RF3_IM_COLD)) return (TRUE);
918 if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flags3 & RF3_IM_POIS)) return (TRUE);
921 if (p_ptr->pspeed < 145)
923 if (p_ptr->fast) return (TRUE);
925 if (music_singing(MUSIC_SPEED)) return (TRUE);
927 if (music_singing(MUSIC_SHERO)) return (TRUE);
931 if (p_ptr->lightspeed && (m_ptr->mspeed < 136)) return (TRUE);
933 if (p_ptr->riding && (m_list[p_ptr->riding].mspeed < 135))
935 if (m_list[p_ptr->riding].fast) return (TRUE);
938 /* No need to cast dispel spell */
944 * Have a monster choose a spell from a list of "useful" spells.
946 * Note that this list does NOT include spells that will just hit
947 * other monsters, and the list is restricted when the monster is
948 * "desperate". Should that be the job of this function instead?
950 * Stupid monsters will just pick a spell randomly. Smart monsters
951 * will choose more "intelligently".
953 * Use the helper functions above to put spells into categories.
955 * This function may well be an efficiency bottleneck.
957 static int choose_attack_spell(int m_idx, byte spells[], byte num)
959 monster_type *m_ptr = &m_list[m_idx];
960 monster_race *r_ptr = &r_info[m_ptr->r_idx];
962 byte escape[96], escape_num = 0;
963 byte attack[96], attack_num = 0;
964 byte summon[96], summon_num = 0;
965 byte tactic[96], tactic_num = 0;
966 byte annoy[96], annoy_num = 0;
967 byte invul[96], invul_num = 0;
968 byte haste[96], haste_num = 0;
969 byte world[96], world_num = 0;
970 byte special[96], special_num = 0;
971 byte psy_spe[96], psy_spe_num = 0;
972 byte raise[96], raise_num = 0;
973 byte heal[96], heal_num = 0;
974 byte dispel[96], dispel_num = 0;
978 /* Stupid monsters choose randomly */
979 if (r_ptr->flags2 & (RF2_STUPID))
982 return (spells[randint0(num)]);
985 /* Categorize spells */
986 for (i = 0; i < num; i++)
989 if (spell_escape(spells[i])) escape[escape_num++] = spells[i];
992 if (spell_attack(spells[i])) attack[attack_num++] = spells[i];
995 if (spell_summon(spells[i])) summon[summon_num++] = spells[i];
997 /* Tactical spell? */
998 if (spell_tactic(spells[i])) tactic[tactic_num++] = spells[i];
1000 /* Annoyance spell? */
1001 if (spell_annoy(spells[i])) annoy[annoy_num++] = spells[i];
1003 /* Invulnerability spell? */
1004 if (spell_invulner(spells[i])) invul[invul_num++] = spells[i];
1007 if (spell_haste(spells[i])) haste[haste_num++] = spells[i];
1010 if (spell_world(spells[i])) world[world_num++] = spells[i];
1012 /* Special spell? */
1013 if (spell_special(spells[i])) special[special_num++] = spells[i];
1015 /* Psycho-spear spell? */
1016 if (spell_psy_spe(spells[i])) psy_spe[psy_spe_num++] = spells[i];
1018 /* Raise-dead spell? */
1019 if (spell_raise(spells[i])) raise[raise_num++] = spells[i];
1022 if (spell_heal(spells[i])) heal[heal_num++] = spells[i];
1025 if (spell_dispel(spells[i])) dispel[dispel_num++] = spells[i];
1028 /*** Try to pick an appropriate spell type ***/
1031 if (world_num && (randint0(100) < 15) && !world_monster)
1033 /* Choose haste spell */
1034 return (world[randint0(world_num)]);
1040 bool success = FALSE;
1041 switch(m_ptr->r_idx)
1045 if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num) success = TRUE;
1049 if (success) return (special[randint0(special_num)]);
1052 /* Still hurt badly, couldn't flee, attempt to heal */
1053 if (m_ptr->hp < m_ptr->maxhp / 3 && one_in_(2))
1055 /* Choose heal spell if possible */
1056 if (heal_num) return (heal[randint0(heal_num)]);
1059 /* Hurt badly or afraid, attempt to flee */
1060 if (((m_ptr->hp < m_ptr->maxhp / 3) || m_ptr->monfear) && one_in_(2))
1062 /* Choose escape spell if possible */
1063 if (escape_num) return (escape[randint0(escape_num)]);
1069 bool success = FALSE;
1070 switch(m_ptr->r_idx)
1073 if (randint0(100) < 50) success = TRUE;
1075 case MON_BANORLUPART:
1076 if (randint0(100) < 70) success = TRUE;
1080 if (success) return (special[randint0(special_num)]);
1083 /* Player is close and we have attack spells, blink away */
1084 if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
1086 /* Choose tactical spell */
1087 if (tactic_num) return (tactic[randint0(tactic_num)]);
1090 /* Summon if possible (sometimes) */
1091 if (summon_num && (randint0(100) < 40))
1093 /* Choose summon spell */
1094 return (summon[randint0(summon_num)]);
1098 if (dispel_num && one_in_(2))
1100 /* Choose dispel spell if possible */
1101 if (dispel_check(m_idx))
1103 return (dispel[randint0(dispel_num)]);
1107 /* Raise-dead if possible (sometimes) */
1108 if (raise_num && (randint0(100) < 40) && raise_possible(m_ptr->fy, m_ptr->fx))
1110 /* Choose raise-dead spell */
1111 return (raise[randint0(raise_num)]);
1114 /* Attack spell (most of the time) */
1117 if (psy_spe_num && (randint0(100) < 50))
1119 /* Choose attack spell */
1120 return (psy_spe[randint0(psy_spe_num)]);
1122 else if (attack_num && (randint0(100) < 40))
1124 /* Choose attack spell */
1125 return (attack[randint0(attack_num)]);
1128 else if (attack_num && (randint0(100) < 85))
1130 /* Choose attack spell */
1131 return (attack[randint0(attack_num)]);
1134 /* Try another tactical spell (sometimes) */
1135 if (tactic_num && (randint0(100) < 50) && !world_monster)
1137 /* Choose tactic spell */
1138 return (tactic[randint0(tactic_num)]);
1141 /* Cast globe of invulnerability if not already in effect */
1142 if (invul_num && !(m_ptr->invulner) && (randint0(100) < 50))
1144 /* Choose Globe of Invulnerability */
1145 return (invul[randint0(invul_num)]);
1148 /* We're hurt (not badly), try to heal */
1149 if ((m_ptr->hp < m_ptr->maxhp * 3 / 4) && (randint0(100) < 25))
1151 /* Choose heal spell if possible */
1152 if (heal_num) return (heal[randint0(heal_num)]);
1155 /* Haste self if we aren't already somewhat hasted (rarely) */
1156 if (haste_num && (randint0(100) < 20) && !(m_ptr->fast))
1158 /* Choose haste spell */
1159 return (haste[randint0(haste_num)]);
1162 /* Annoy player (most of the time) */
1163 if (annoy_num && (randint0(100) < 80))
1165 /* Choose annoyance spell */
1166 return (annoy[randint0(annoy_num)]);
1169 /* Choose no spell */
1175 * Creatures can cast spells, shoot missiles, and breathe.
1177 * Returns "TRUE" if a spell (or whatever) was (successfully) cast.
1179 * XXX XXX XXX This function could use some work, but remember to
1180 * keep it as optimized as possible, while retaining generic code.
1182 * Verify the various "blind-ness" checks in the code.
1184 * XXX XXX XXX Note that several effects should really not be "seen"
1185 * if the player is blind. See also "effects.c" for other "mistakes".
1187 * Perhaps monsters should breathe at locations *near* the player,
1188 * since this would allow them to inflict "partial" damage.
1190 * Perhaps smart monsters should decline to use "bolt" spells if
1191 * there is a monster in the way, unless they wish to kill it.
1193 * Note that, to allow the use of the "track_target" option at some
1194 * later time, certain non-optimal things are done in the code below,
1195 * including explicit checks against the "direct" variable, which is
1196 * currently always true by the time it is checked, but which should
1197 * really be set according to an explicit "projectable()" test, and
1198 * the use of generic "x,y" locations instead of the player location,
1199 * with those values being initialized with the player location.
1201 * It will not be possible to "correctly" handle the case in which a
1202 * monster attempts to attack a location which is thought to contain
1203 * the player, but which in fact is nowhere near the player, since this
1204 * might induce all sorts of messages about the attack itself, and about
1205 * the effects of the attack, which the player might or might not be in
1206 * a position to observe. Thus, for simplicity, it is probably best to
1207 * only allow "faulty" attacks by a monster if one of the important grids
1208 * (probably the initial or final grid) is in fact in view of the player.
1209 * It may be necessary to actually prevent spell attacks except when the
1210 * monster actually has line of sight to the player. Note that a monster
1211 * could be left in a bizarre situation after the player ducked behind a
1212 * pillar and then teleported away, for example.
1214 * Note that certain spell attacks do not use the "project()" function
1215 * but "simulate" it via the "direct" variable, which is always at least
1216 * as restrictive as the "project()" function. This is necessary to
1217 * prevent "blindness" attacks and such from bending around walls, etc,
1218 * and to allow the use of the "track_target" option in the future.
1220 * Note that this function attempts to optimize the use of spells for the
1221 * cases in which the monster has no spells, or has spells but cannot use
1222 * them, or has spells but they will have no "useful" effect. Note that
1223 * this function has been an efficiency bottleneck in the past.
1225 * Note the special "MFLAG_NICE" flag, which prevents a monster from using
1226 * any spell attacks until the player has had a single chance to move.
1228 bool make_attack_spell(int m_idx)
1230 int k, chance, thrown_spell = 0, rlev, failrate;
1231 byte spell[96], num = 0;
1233 monster_type *m_ptr = &m_list[m_idx];
1234 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1238 bool no_inate = FALSE;
1239 bool do_disi = FALSE;
1242 int s_num_6 = (easy_band ? 2 : 6);
1243 int s_num_4 = (easy_band ? 1 : 4);
1245 /* Target location */
1252 /* Extract the blind-ness */
1253 bool blind = (p_ptr->blind ? TRUE : FALSE);
1255 /* Extract the "see-able-ness" */
1256 bool seen = (!blind && m_ptr->ml);
1258 bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
1259 bool learnable = (seen && maneable && !world_monster);
1261 /* Assume "normal" target */
1264 /* Assume "projectable" */
1267 /* Cannot cast spells when confused */
1268 if (m_ptr->confused)
1270 reset_target(m_ptr);
1274 /* Cannot cast spells when nice */
1275 if (m_ptr->mflag & MFLAG_NICE) return (FALSE);
1276 if (!is_hostile(m_ptr)) return (FALSE);
1278 /* Hack -- Extract the spell probability */
1279 chance = (r_ptr->freq_inate + r_ptr->freq_spell) / 2;
1281 /* Not allowed to cast spells */
1282 if (!chance) return (FALSE);
1285 if (stupid_monsters)
1287 /* Only do spells occasionally */
1288 if (randint0(100) >= chance) return (FALSE);
1292 if (randint0(100) >= chance) return (FALSE);
1294 /* Sometimes forbid inate attacks (breaths) */
1295 if (randint0(100) >= (chance * 2)) no_inate = TRUE;
1298 /* XXX XXX XXX Handle "track_target" option (?) */
1301 /* Extract the racial spell flags */
1306 /* Hack -- require projectable player */
1310 if ((m_ptr->cdis > MAX_RANGE) && !m_ptr->target_y) return (FALSE);
1313 if (projectable(m_ptr->fy, m_ptr->fx, y, x))
1315 /* Breath disintegration to the glyph */
1316 if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
1319 /* Check path to next grid */
1322 bool success = FALSE;
1324 if ((r_ptr->flags4 & RF4_BR_DISI) &&
1325 (m_ptr->cdis < MAX_RANGE/2) &&
1326 in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
1327 (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
1336 int tonari_y[4][8] = {{-1,-1,-1,0,0,1,1,1},
1337 {-1,-1,-1,0,0,1,1,1},
1338 {1,1,1,0,0,-1,-1,-1},
1339 {1,1,1,0,0,-1,-1,-1}};
1340 int tonari_x[4][8] = {{-1,0,1,-1,1,-1,0,1},
1341 {1,0,-1,1,-1,1,0,-1},
1342 {-1,0,1,-1,1,-1,0,1},
1343 {1,0,-1,1,-1,1,0,-1}};
1345 if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
1346 else if (m_ptr->fy < py) tonari = 1;
1347 else if (m_ptr->fx < px) tonari = 2;
1350 for (i = 0; i < 8; i++)
1352 int next_x = x + tonari_x[tonari][i];
1353 int next_y = y + tonari_y[tonari][i];
1356 /* Access the next grid */
1357 c_ptr = &cave[next_y][next_x];
1359 /* Skip door, rubble, wall */
1360 if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue;
1363 if (c_ptr->feat == FEAT_TREES) continue;
1366 if (c_ptr->feat == FEAT_MOUNTAIN) continue;
1368 if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
1380 if (m_ptr->target_y && m_ptr->target_x)
1382 y = m_ptr->target_y;
1383 x = m_ptr->target_x;
1384 f4 &= (RF4_INDIRECT_MASK);
1385 f5 &= (RF5_INDIRECT_MASK);
1386 f6 &= (RF6_INDIRECT_MASK);
1392 if (!success) return FALSE;
1396 reset_target(m_ptr);
1398 /* Extract the monster level */
1399 rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
1401 if (!stupid_monsters)
1403 /* Forbid inate attacks sometimes */
1404 if (no_inate) f4 &= 0x500000FF;
1409 f5 &= ~(RF5_DRAIN_MANA);
1411 if ((p_ptr->pclass == CLASS_NINJA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)))
1413 f6 &= ~(RF6_DARKNESS);
1416 if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
1418 f4 &= (RF4_NOMAGIC_MASK);
1419 f5 &= (RF5_NOMAGIC_MASK);
1420 f6 &= (RF6_NOMAGIC_MASK);
1423 /* Hack -- allow "desperate" spells */
1424 if ((r_ptr->flags2 & (RF2_SMART)) &&
1425 (m_ptr->hp < m_ptr->maxhp / 10) &&
1426 (randint0(100) < 50))
1428 /* Require intelligent spells */
1429 f4 &= (RF4_INT_MASK);
1430 f5 &= (RF5_INT_MASK);
1431 f6 &= (RF6_INT_MASK);
1433 /* No spells left */
1434 if (!f4 && !f5 && !f6) return (FALSE);
1437 /* Remove the "ineffective" spells */
1438 remove_bad_spells(m_idx, &f4, &f5, &f6);
1440 if (p_ptr->inside_arena)
1442 f4 &= ~(RF4_SUMMON_MASK);
1443 f5 &= ~(RF5_SUMMON_MASK);
1444 f6 &= ~(RF6_SUMMON_MASK);
1447 /* No spells left */
1448 if (!f4 && !f5 && !f6) return (FALSE);
1450 if (!stupid_monsters)
1452 /* Check for a clean bolt shot */
1453 if (((f4 & RF4_BOLT_MASK) ||
1454 (f5 & RF5_BOLT_MASK) ||
1455 (f6 & RF6_BOLT_MASK)) &&
1456 !(r_ptr->flags2 & RF2_STUPID) &&
1457 !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
1459 /* Remove spells that will only hurt friends */
1460 f4 &= ~(RF4_BOLT_MASK);
1461 f5 &= ~(RF5_BOLT_MASK);
1462 f6 &= ~(RF6_BOLT_MASK);
1465 /* Check for a possible summon */
1466 if (((f4 & RF4_SUMMON_MASK) ||
1467 (f5 & RF5_SUMMON_MASK) ||
1468 (f6 & RF6_SUMMON_MASK)) &&
1469 !(r_ptr->flags2 & RF2_STUPID) &&
1470 !(summon_possible(y, x)))
1472 /* Remove summoning spells */
1473 f4 &= ~(RF4_SUMMON_MASK);
1474 f5 &= ~(RF5_SUMMON_MASK);
1475 f6 &= ~(RF6_SUMMON_MASK);
1478 /* No spells left */
1479 if (!f4 && !f5 && !f6) return (FALSE);
1482 /* Extract the "inate" spells */
1483 for (k = 0; k < 32; k++)
1485 if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
1488 /* Extract the "normal" spells */
1489 for (k = 0; k < 32; k++)
1491 if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
1494 /* Extract the "bizarre" spells */
1495 for (k = 0; k < 32; k++)
1497 if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
1500 /* No spells left */
1501 if (!num) return (FALSE);
1503 /* Stop if player is dead or gone */
1504 if (!alive || death) return (FALSE);
1506 /* Stop if player is leaving */
1507 if (p_ptr->leaving) return (FALSE);
1509 /* Get the monster name (or "it") */
1510 monster_desc(m_name, m_ptr, 0x00);
1512 /* Get the monster possessive ("his"/"her"/"its") */
1513 monster_desc(m_poss, m_ptr, 0x22);
1515 /* Hack -- Get the "died from" name */
1516 monster_desc(ddesc, m_ptr, 0x288);
1518 if (stupid_monsters)
1520 /* Choose a spell to cast */
1521 thrown_spell = spell[randint0(num)];
1526 if (do_disi) thrown_spell = 96+31;
1531 thrown_spell = choose_attack_spell(m_idx, spell, num);
1532 if (thrown_spell) break;
1536 /* Abort if no spell was chosen */
1537 if (!thrown_spell) return (FALSE);
1539 /* Calculate spell failure rate */
1540 failrate = 25 - (rlev + 3) / 4;
1542 /* Hack -- Stupid monsters will never fail (for jellies and such) */
1543 if (r_ptr->flags2 & RF2_STUPID) failrate = 0;
1545 /* Check for spell failure (inate attacks never fail) */
1546 if ((thrown_spell >= 128) && ((m_ptr->stunned && one_in_(2)) || (randint0(100) < failrate)))
1550 if (thrown_spell != (160+7)) /* Not RF6_SPECIAL */
1553 msg_format("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", m_name);
1555 msg_format("%^s tries to cast a spell, but fails.", m_name);
1564 /* Cast the spell. */
1565 switch (thrown_spell)
1573 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
1575 msg_format("%^s makes a high pitched shriek.", m_name);
1578 aggravate_monsters(m_idx);
1592 if (x!=px || y!=py) return (FALSE);
1595 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
1596 else msg_format("%^s¤¬ËâÎϾõî¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
1598 if (blind) msg_format("%^s mumbles powerfully.", m_name);
1599 else msg_format("%^s invokes a dispel magic.", m_name);
1602 set_lightspeed(0, TRUE);
1604 set_shield(0, TRUE);
1605 set_blessed(0, TRUE);
1606 set_tsuyoshi(0, TRUE);
1609 set_protevil(0, TRUE);
1610 set_invuln(0, TRUE);
1611 set_wraith_form(0, TRUE);
1612 set_kabenuke(0, TRUE);
1613 set_tim_res_nether(0, TRUE);
1614 set_tim_res_time(0, TRUE);
1616 set_tim_reflect(0,TRUE);
1617 set_multishadow(0,TRUE);
1618 set_dustrobe(0,TRUE);
1620 set_tim_invis(0, TRUE);
1621 set_tim_infra(0, TRUE);
1622 set_tim_esp(0, TRUE);
1623 set_tim_regen(0, TRUE);
1624 set_tim_stealth(0, TRUE);
1625 set_tim_ffall(0, TRUE);
1626 set_tim_sh_touki(0, TRUE);
1627 set_tim_sh_fire(0, TRUE);
1628 set_tim_sh_holy(0, TRUE);
1629 set_tim_eyeeye(0, TRUE);
1630 set_magicdef(0, TRUE);
1631 set_resist_magic(0, TRUE);
1632 set_oppose_acid(0, TRUE);
1633 set_oppose_elec(0, TRUE);
1634 set_oppose_fire(0, TRUE);
1635 set_oppose_cold(0, TRUE);
1636 set_oppose_pois(0, TRUE);
1637 set_ultimate_res(0, TRUE);
1638 set_mimic(0, 0, TRUE);
1639 set_ele_attack(0, 0);
1640 set_ele_immune(0, 0);
1641 /* Cancel glowing hands */
1642 if (p_ptr->special_attack & ATTACK_CONFUSE)
1644 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1646 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1648 msg_print("Your hands stop glowing.");
1652 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0]))
1654 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
1655 p_ptr->magic_num1[0] = 0;
1657 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
1659 msg_print("Your singing is interrupted.");
1661 p_ptr->action = ACTION_NONE;
1663 /* Recalculate bonuses */
1664 p_ptr->update |= (PU_BONUS | PU_HP);
1667 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1669 /* Update monsters */
1670 p_ptr->update |= (PU_MONSTERS);
1673 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1675 p_ptr->energy_need += ENERGY_NEED();
1679 m_list[p_ptr->riding].invulner = 0;
1680 m_list[p_ptr->riding].fast = 0;
1681 m_list[p_ptr->riding].slow = 0;
1682 p_ptr->update |= PU_BONUS;
1683 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= PR_HEALTH;
1684 p_ptr->redraw |= (PR_UHEALTH);
1688 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1689 msg_print("¤ä¤ê¤ä¤¬¤Ã¤¿¤Ê¡ª");
1691 learn_spell(MS_DISPEL);
1700 if (blind) msg_format("%^s¤¬²¿¤«¤ò¼Í¤Ã¤¿¡£", m_name);
1702 if (blind) msg_format("%^s shoots something.", m_name);
1706 else msg_format("%^s¤¬¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£", m_name);
1708 else msg_format("%^s fires a rocket.", m_name);
1711 dam = ((m_ptr->hp / 4) > 800 ? 800 : (m_ptr->hp / 4));
1712 breath(y, x, m_idx, GF_ROCKET,
1713 dam, 2, FALSE, MS_ROCKET, learnable);
1714 update_smart_learn(m_idx, DRS_SHARD);
1721 if (x!=px || y!=py) return (FALSE);
1724 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
1726 if (blind) msg_format("%^s makes a strange noise.", m_name);
1730 else msg_format("%^s¤¬Ìð¤òÊü¤Ã¤¿¡£", m_name);
1732 else msg_format("%^s fires an arrow.", m_name);
1735 dam = damroll(r_ptr->blow[0].d_dice, r_ptr->blow[0].d_side);
1736 bolt(m_idx, GF_ARROW, dam, MS_SHOOT, learnable);
1737 update_smart_learn(m_idx, DRS_REFLECT);
1767 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1769 if (blind) msg_format("%^s breathes.", m_name);
1773 else msg_format("%^s¤¬»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1775 else msg_format("%^s breathes acid.", m_name);
1778 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1779 breath(y, x, m_idx, GF_ACID, dam, 0, TRUE, MS_BR_ACID, learnable);
1780 update_smart_learn(m_idx, DRS_ACID);
1789 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1791 if (blind) msg_format("%^s breathes.", m_name);
1795 else msg_format("%^s¤¬°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1797 else msg_format("%^s breathes lightning.", m_name);
1800 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1801 breath(y, x, m_idx, GF_ELEC, dam,0, TRUE, MS_BR_ELEC, learnable);
1802 update_smart_learn(m_idx, DRS_ELEC);
1811 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1813 if (blind) msg_format("%^s breathes.", m_name);
1817 else msg_format("%^s¤¬²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1819 else msg_format("%^s breathes fire.", m_name);
1822 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1823 breath(y, x, m_idx, GF_FIRE, dam,0, TRUE, MS_BR_FIRE, learnable);
1824 update_smart_learn(m_idx, DRS_FIRE);
1833 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1835 if (blind) msg_format("%^s breathes.", m_name);
1839 else msg_format("%^s¤¬Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1841 else msg_format("%^s breathes frost.", m_name);
1844 dam = ((m_ptr->hp / 3) > 1600 ? 1600 : (m_ptr->hp / 3));
1845 breath(y, x, m_idx, GF_COLD, dam,0, TRUE, MS_BR_COLD, learnable);
1846 update_smart_learn(m_idx, DRS_COLD);
1855 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1857 if (blind) msg_format("%^s breathes.", m_name);
1861 else msg_format("%^s¤¬¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1863 else msg_format("%^s breathes gas.", m_name);
1866 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
1867 breath(y, x, m_idx, GF_POIS, dam, 0, TRUE, MS_BR_POIS, learnable);
1868 update_smart_learn(m_idx, DRS_POIS);
1878 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1880 if (blind) msg_format("%^s breathes.", m_name);
1884 else msg_format("%^s¤¬ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1886 else msg_format("%^s breathes nether.", m_name);
1889 dam = ((m_ptr->hp / 6) > 550 ? 550 : (m_ptr->hp / 6));
1890 breath(y, x, m_idx, GF_NETHER, dam,0, TRUE, MS_BR_NETHER, learnable);
1891 update_smart_learn(m_idx, DRS_NETH);
1900 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1902 if (blind) msg_format("%^s breathes.", m_name);
1906 else msg_format("%^s¤¬Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1908 else msg_format("%^s breathes light.", m_name);
1911 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1912 breath(y, x, m_idx, GF_LITE, dam,0, TRUE, MS_BR_LITE, learnable);
1913 update_smart_learn(m_idx, DRS_LITE);
1922 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1924 if (blind) msg_format("%^s breathes.", m_name);
1928 else msg_format("%^s¤¬°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1930 else msg_format("%^s breathes darkness.", m_name);
1933 dam = ((m_ptr->hp / 6) > 400 ? 400 : (m_ptr->hp / 6));
1934 breath(y, x, m_idx, GF_DARK, dam,0, TRUE, MS_BR_DARK, learnable);
1935 update_smart_learn(m_idx, DRS_DARK);
1944 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1946 if (blind) msg_format("%^s breathes.", m_name);
1950 else msg_format("%^s¤¬º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1952 else msg_format("%^s breathes confusion.", m_name);
1955 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1956 breath(y, x, m_idx, GF_CONFUSION, dam,0, TRUE, MS_BR_CONF, learnable);
1957 update_smart_learn(m_idx, DRS_CONF);
1965 if (m_ptr->r_idx == MON_JAIAN)
1967 msg_format("¡Ö¥Ü¥©¥¨¡Á¡Á¡Á¡Á¡Á¡Á¡×");
1969 msg_format("'Booooeeeeee'");
1972 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1974 else if (blind) msg_format("%^s breathes.", m_name);
1978 else msg_format("%^s¤¬¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1980 else msg_format("%^s breathes sound.", m_name);
1983 dam = ((m_ptr->hp / 6) > 450 ? 450 : (m_ptr->hp / 6));
1984 breath(y, x, m_idx, GF_SOUND, dam,0, TRUE, MS_BR_SOUND, learnable);
1985 update_smart_learn(m_idx, DRS_SOUND);
1994 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
1996 if (blind) msg_format("%^s breathes.", m_name);
2000 else msg_format("%^s¤¬¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2002 else msg_format("%^s breathes chaos.", m_name);
2005 dam = ((m_ptr->hp / 6) > 600 ? 600 : (m_ptr->hp / 6));
2006 breath(y, x, m_idx, GF_CHAOS, dam,0, TRUE, MS_BR_CHAOS, learnable);
2007 update_smart_learn(m_idx, DRS_CHAOS);
2016 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2018 if (blind) msg_format("%^s breathes.", m_name);
2022 else msg_format("%^s¤¬Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2024 else msg_format("%^s breathes disenchantment.", m_name);
2027 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2028 breath(y, x, m_idx, GF_DISENCHANT, dam,0, TRUE, MS_BR_DISEN, learnable);
2029 update_smart_learn(m_idx, DRS_DISEN);
2038 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2040 if (blind) msg_format("%^s breathes.", m_name);
2044 else msg_format("%^s¤¬°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2046 else msg_format("%^s breathes nexus.", m_name);
2049 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2050 breath(y, x, m_idx, GF_NEXUS, dam,0, TRUE, MS_BR_NEXUS, learnable);
2051 update_smart_learn(m_idx, DRS_NEXUS);
2060 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2062 if (blind) msg_format("%^s breathes.", m_name);
2066 else msg_format("%^s¤¬»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2068 else msg_format("%^s breathes time.", m_name);
2071 dam = ((m_ptr->hp / 3) > 150 ? 150 : (m_ptr->hp / 3));
2072 breath(y, x, m_idx, GF_TIME, dam,0, TRUE, MS_BR_TIME, learnable);
2081 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2083 if (blind) msg_format("%^s breathes.", m_name);
2087 else msg_format("%^s¤¬ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2089 else msg_format("%^s breathes inertia.", m_name);
2092 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2093 breath(y, x, m_idx, GF_INERTIA, dam,0, TRUE, MS_BR_INERTIA, learnable);
2102 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2104 if (blind) msg_format("%^s breathes.", m_name);
2108 else msg_format("%^s¤¬½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2110 else msg_format("%^s breathes gravity.", m_name);
2113 dam = ((m_ptr->hp / 3) > 200 ? 200 : (m_ptr->hp / 3));
2114 breath(y, x, m_idx, GF_GRAVITY, dam,0, TRUE, MS_BR_GRAVITY, learnable);
2122 if (m_ptr->r_idx == MON_BOTEI)
2124 msg_format("¡Ö¥ÜÄë¥Ó¥ë¥«¥Ã¥¿¡¼¡ª¡ª¡ª¡×");
2126 msg_format("'Boty-Build cutter!!!'");
2129 else if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2131 else if (blind) msg_format("%^s breathes.", m_name);
2135 else msg_format("%^s¤¬ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2137 else msg_format("%^s breathes shards.", m_name);
2140 dam = ((m_ptr->hp / 6) > 500 ? 500 : (m_ptr->hp / 6));
2141 breath(y, x, m_idx, GF_SHARDS, dam,0, TRUE, MS_BR_SHARDS, learnable);
2142 update_smart_learn(m_idx, DRS_SHARD);
2151 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2153 if (blind) msg_format("%^s breathes.", m_name);
2157 else msg_format("%^s¤¬¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2159 else msg_format("%^s breathes plasma.", m_name);
2162 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2163 breath(y, x, m_idx, GF_PLASMA, dam,0, TRUE, MS_BR_PLASMA, learnable);
2172 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2174 if (blind) msg_format("%^s breathes.", m_name);
2178 else msg_format("%^s¤¬¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2180 else msg_format("%^s breathes force.", m_name);
2183 dam = ((m_ptr->hp / 6) > 200 ? 200 : (m_ptr->hp / 6));
2184 breath(y, x, m_idx, GF_FORCE, dam,0, TRUE, MS_BR_FORCE, learnable);
2193 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2195 if (blind) msg_format("%^s breathes.", m_name);
2199 else msg_format("%^s¤¬ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£", m_name);
2201 else msg_format("%^s breathes mana.", m_name);
2203 dam = ((m_ptr->hp / 3) > 250 ? 250 : (m_ptr->hp / 3));
2204 breath(y, x, m_idx, GF_MANA, dam,0, TRUE, MS_BR_MANA, learnable);
2213 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2215 if (blind) msg_format("%^s mumbles.", m_name);
2219 else msg_format("%^s¤¬Êü¼Íǽµå¤òÊü¤Ã¤¿¡£", m_name);
2221 else msg_format("%^s casts a ball of radiation.", m_name);
2224 dam = (rlev + damroll(10, 6)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2225 breath(y, x, m_idx, GF_NUKE, dam, 2, FALSE, MS_BALL_NUKE, learnable);
2226 update_smart_learn(m_idx, DRS_POIS);
2235 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2237 if (blind) msg_format("%^s breathes.", m_name);
2241 else msg_format("%^s¤¬Êü¼ÍÀÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2243 else msg_format("%^s breathes toxic waste.", m_name);
2246 dam = ((m_ptr->hp / 3) > 800 ? 800 : (m_ptr->hp / 3));
2247 breath(y, x, m_idx, GF_NUKE, dam,0, TRUE, MS_BR_NUKE, learnable);
2248 update_smart_learn(m_idx, DRS_POIS);
2257 if (blind) msg_format("%^s¤¬¶²¤í¤·¤²¤Ë¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2259 if (blind) msg_format("%^s mumbles frighteningly.", m_name);
2263 else msg_format("%^s¤¬½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£", m_name);/*nuke me*/
2265 else msg_format("%^s invokes a raw Logrus.", m_name);
2268 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? (rlev * 3) : (rlev * 2))+ damroll(10, 10);
2269 breath(y, x, m_idx, GF_CHAOS, dam, 4, FALSE, MS_BALL_CHAOS, learnable);
2270 update_smart_learn(m_idx, DRS_CHAOS);
2279 if (blind) msg_format("%^s¤¬²¿¤«¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2281 if (blind) msg_format("%^s breathes.", m_name);
2285 else msg_format("%^s¤¬Ê¬²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", m_name);
2287 else msg_format("%^s breathes disintegration.", m_name);
2290 dam = ((m_ptr->hp / 6) > 150 ? 150 : (m_ptr->hp / 6));
2291 breath(y, x, m_idx, GF_DISINTEGRATE, dam,0, TRUE, MS_BR_DISI, learnable);
2302 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2304 if (blind) msg_format("%^s mumbles.", m_name);
2308 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2310 else msg_format("%^s casts an acid ball.", m_name);
2313 dam = (randint1(rlev * 3) + 15) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2314 breath(y, x, m_idx, GF_ACID, dam, 2, FALSE, MS_BALL_ACID, learnable);
2315 update_smart_learn(m_idx, DRS_ACID);
2324 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2326 if (blind) msg_format("%^s mumbles.", m_name);
2330 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2332 else msg_format("%^s casts a lightning ball.", m_name);
2335 dam = (randint1(rlev * 3 / 2) + 8) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2336 breath(y, x, m_idx, GF_ELEC, dam, 2, FALSE, MS_BALL_ELEC, learnable);
2337 update_smart_learn(m_idx, DRS_ELEC);
2346 if (m_ptr->r_idx == MON_ROLENTO)
2350 msg_format("%s¤¬²¿¤«¤òÅꤲ¤¿¡£", m_name);
2352 msg_format("%s¤Ï¼êÜØÃƤòÅꤲ¤¿¡£", m_name);
2355 msg_format("%^s throws something.", m_name);
2357 msg_format("%^s throws a hand grenade.", m_name);
2363 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2365 if (blind) msg_format("%^s mumbles.", m_name);
2369 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2371 else msg_format("%^s casts a fire ball.", m_name);
2375 dam = (randint1(rlev * 7 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2376 breath(y, x, m_idx, GF_FIRE, dam, 2, FALSE, MS_BALL_FIRE, learnable);
2377 update_smart_learn(m_idx, DRS_FIRE);
2386 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2388 if (blind) msg_format("%^s mumbles.", m_name);
2392 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2394 else msg_format("%^s casts a frost ball.", m_name);
2397 dam = (randint1(rlev * 3 / 2) + 10) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2398 breath(y, x, m_idx, GF_COLD, dam, 2, FALSE, MS_BALL_COLD, learnable);
2399 update_smart_learn(m_idx, DRS_COLD);
2408 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2410 if (blind) msg_format("%^s mumbles.", m_name);
2414 else msg_format("%^s¤¬°½±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2416 else msg_format("%^s casts a stinking cloud.", m_name);
2419 dam = damroll(12, 2) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2420 breath(y, x, m_idx, GF_POIS, dam, 2, FALSE, MS_BALL_POIS, learnable);
2421 update_smart_learn(m_idx, DRS_POIS);
2430 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2432 if (blind) msg_format("%^s mumbles.", m_name);
2436 else msg_format("%^s¤¬ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2438 else msg_format("%^s casts a nether ball.", m_name);
2441 dam = 50 + damroll(10, 10) + (rlev * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1));
2442 breath(y, x, m_idx, GF_NETHER, dam, 2, FALSE, MS_BALL_NETHER, learnable);
2443 update_smart_learn(m_idx, DRS_NETH);
2452 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2454 if (blind) msg_format("%^s mumbles.", m_name);
2458 else msg_format("%^s¤¬Î®¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£", m_name);
2460 else msg_format("%^s gestures fluidly.", m_name);
2464 msg_print("¤¢¤Ê¤¿¤Ï±²´¬¤¤Ë°û¤ß¹þ¤Þ¤ì¤¿¡£");
2466 msg_print("You are engulfed in a whirlpool.");
2469 dam = ((r_ptr->flags2 & RF2_POWERFUL) ? randint1(rlev * 3) : randint1(rlev * 2)) + 50;
2470 breath(y, x, m_idx, GF_WATER, dam, 4, FALSE, MS_BALL_WATER, learnable);
2479 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2481 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2485 else msg_format("%^s¤¬ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2487 else msg_format("%^s invokes a mana storm.", m_name);
2490 dam = (rlev * 4) + 50 + damroll(10, 10);
2491 breath(y, x, m_idx, GF_MANA, dam, 4, FALSE, MS_BALL_MANA, learnable);
2500 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2502 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2506 else msg_format("%^s¤¬°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2508 else msg_format("%^s invokes a darkness storm.", m_name);
2511 dam = (rlev * 4) + 50 + damroll(10, 10);
2512 breath(y, x, m_idx, GF_DARK, dam, 4, FALSE, MS_BALL_DARK, learnable);
2513 update_smart_learn(m_idx, DRS_DARK);
2517 /* RF5_DRAIN_MANA */
2520 if (x!=px || y!=py) return (FALSE);
2529 msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2531 msg_format("%^s draws psychic energy from you!", m_name);
2536 r1 = (randint1(rlev) / 2) + 1;
2539 if (r1 >= p_ptr->csp)
2543 p_ptr->csp_frac = 0;
2552 learn_spell(MS_DRAIN_MANA);
2555 p_ptr->redraw |= (PR_MANA);
2558 p_ptr->window |= (PW_PLAYER);
2559 p_ptr->window |= (PW_SPELL);
2561 /* Heal the monster */
2562 if (m_ptr->hp < m_ptr->maxhp)
2565 m_ptr->hp += (6 * r1);
2566 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2568 /* Redraw (later) if needed */
2569 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2570 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2572 /* Special message */
2576 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
2578 msg_format("%^s appears healthier.", m_name);
2584 update_smart_learn(m_idx, DRS_MANA);
2588 /* RF5_MIND_BLAST */
2591 if (x!=px || y!=py) return (FALSE);
2597 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2599 msg_print("You feel something focusing on your mind.");
2606 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¤Ë¤é¤ó¤Ç¤¤¤ë¡£", m_name);
2608 msg_format("%^s gazes deep into your eyes.", m_name);
2613 dam = damroll(7, 7);
2614 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2617 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2619 msg_print("You resist the effects!");
2621 learn_spell(MS_MIND_BLAST);
2626 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2628 msg_print("Your mind is blasted by psyonic energy.");
2631 if (!p_ptr->resist_conf)
2633 (void)set_confused(p_ptr->confused + randint0(4) + 4);
2636 if (!p_ptr->resist_chaos && one_in_(3))
2638 (void)set_image(p_ptr->image + randint0(250) + 150);
2645 p_ptr->csp_frac = 0;
2647 p_ptr->redraw |= PR_MANA;
2649 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_MIND_BLAST);
2654 /* RF5_BRAIN_SMASH */
2657 if (x!=px || y!=py) return (FALSE);
2663 msg_print("²¿¤«¤¬¤¢¤Ê¤¿¤ÎÀº¿À¤ËÇ°¤òÊü¤Ã¤Æ¤¤¤ë¤è¤¦¤À¡£");
2665 msg_print("You feel something focusing on your mind.");
2672 msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÆ·¤ò¤¸¤Ã¤È¸«¤Æ¤¤¤ë¡£", m_name);
2674 msg_format("%^s looks deep into your eyes.", m_name);
2679 dam = damroll(12, 12);
2680 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
2683 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2685 msg_print("You resist the effects!");
2687 learn_spell(MS_BRAIN_SMASH);
2692 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
2694 msg_print("Your mind is blasted by psionic energy.");
2701 p_ptr->csp_frac = 0;
2703 p_ptr->redraw |= PR_MANA;
2705 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_BRAIN_SMASH);
2706 if (!p_ptr->resist_blind)
2708 (void)set_blind(p_ptr->blind + 8 + randint0(8));
2710 if (!p_ptr->resist_conf)
2712 (void)set_confused(p_ptr->confused + randint0(4) + 4);
2714 if (!p_ptr->free_act)
2716 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
2718 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
2720 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2721 (void)do_dec_stat(A_INT);
2722 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
2723 (void)do_dec_stat(A_WIS);
2725 if (!p_ptr->resist_chaos)
2727 (void)set_image(p_ptr->image + randint0(250) + 150);
2736 if (x!=px || y!=py) return (FALSE);
2740 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2742 if (blind) msg_format("%^s mumbles.", m_name);
2746 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¼ö¤Ã¤¿¡£", m_name);
2748 else msg_format("%^s points at you and curses.", m_name);
2751 dam = damroll(3, 8);
2752 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2755 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2757 msg_print("You resist the effects!");
2759 learn_spell(MS_CAUSE_1);
2763 curse_equipment(15, 0);
2764 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_1);
2772 if (x!=px || y!=py) return (FALSE);
2776 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2778 if (blind) msg_format("%^s mumbles.", m_name);
2782 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤Ã¤¿¡£", m_name);
2784 else msg_format("%^s points at you and curses horribly.", m_name);
2787 dam = damroll(8, 8);
2788 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2791 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2793 msg_print("You resist the effects!");
2795 learn_spell(MS_CAUSE_2);
2799 curse_equipment(25, MIN(rlev/2-15, 5));
2800 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_2);
2808 if (x!=px || y!=py) return (FALSE);
2812 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
2814 if (blind) msg_format("%^s mumbles loudly.", m_name);
2818 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ò»Ø¤µ¤·¤Æ¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
2820 else msg_format("%^s points at you, incanting terribly!", m_name);
2823 dam = damroll(10, 15);
2824 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
2827 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2829 msg_print("You resist the effects!");
2831 learn_spell(MS_CAUSE_3);
2835 curse_equipment(33, MIN(rlev/2-15, 15));
2836 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_3);
2844 if (x!=px || y!=py) return (FALSE);
2848 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2850 if (blind) msg_format("%^s screams the word 'DIE!'", m_name);
2854 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÈ빦¤òÆͤ¤¤Æ¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
2856 else msg_format("%^s points at you, screaming the word DIE!", m_name);
2859 dam = damroll(15, 15);
2860 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
2863 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
2865 msg_print("You resist the effects!");
2867 learn_spell(MS_CAUSE_4);
2871 take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_4);
2872 (void)set_cut(p_ptr->cut + damroll(10, 10));
2880 if (x!=px || y!=py) return (FALSE);
2883 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2885 if (blind) msg_format("%^s mumbles.", m_name);
2889 else msg_format("%^s¤¬¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2891 else msg_format("%^s casts a acid bolt.", m_name);
2894 dam = (damroll(7, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2895 bolt(m_idx, GF_ACID, dam, MS_BOLT_ACID, learnable);
2896 update_smart_learn(m_idx, DRS_ACID);
2897 update_smart_learn(m_idx, DRS_REFLECT);
2904 if (x!=px || y!=py) return (FALSE);
2907 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2909 if (blind) msg_format("%^s mumbles.", m_name);
2913 else msg_format("%^s¤¬¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2915 else msg_format("%^s casts a lightning bolt.", m_name);
2918 dam = (damroll(4, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2919 bolt(m_idx, GF_ELEC, dam, MS_BOLT_ELEC, learnable);
2920 update_smart_learn(m_idx, DRS_ELEC);
2921 update_smart_learn(m_idx, DRS_REFLECT);
2928 if (x!=px || y!=py) return (FALSE);
2931 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2933 if (blind) msg_format("%^s mumbles.", m_name);
2937 else msg_format("%^s¤¬¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2939 else msg_format("%^s casts a fire bolt.", m_name);
2942 dam = (damroll(9, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2943 bolt(m_idx, GF_FIRE, dam, MS_BOLT_FIRE, learnable);
2944 update_smart_learn(m_idx, DRS_FIRE);
2945 update_smart_learn(m_idx, DRS_REFLECT);
2952 if (x!=px || y!=py) return (FALSE);
2955 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2957 if (blind) msg_format("%^s mumbles.", m_name);
2961 else msg_format("%^s¤¬¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
2963 else msg_format("%^s casts a frost bolt.", m_name);
2966 dam = (damroll(6, 8) + (rlev / 3)) * ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 1);
2967 bolt(m_idx, GF_COLD, dam, MS_BOLT_COLD, learnable);
2968 update_smart_learn(m_idx, DRS_COLD);
2969 update_smart_learn(m_idx, DRS_REFLECT);
2978 if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
2980 if (blind) msg_format("%^s mumbles powerfully.", m_name);
2984 else msg_format("%^s¤¬¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£", m_name);
2986 else msg_format("%^s invokes a starburst.", m_name);
2989 dam = (rlev * 4) + 50 + damroll(10, 10);
2990 breath(y, x, m_idx, GF_LITE, dam, 4, FALSE, MS_STARBURST, learnable);
2991 update_smart_learn(m_idx, DRS_LITE);
2998 if (x!=px || y!=py) return (FALSE);
3001 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3003 if (blind) msg_format("%^s mumbles.", m_name);
3007 else msg_format("%^s¤¬ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3009 else msg_format("%^s casts a nether bolt.", m_name);
3012 dam = 30 + damroll(5, 5) + (rlev * 4) / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3);
3013 bolt(m_idx, GF_NETHER, dam, MS_BOLT_NETHER, learnable);
3014 update_smart_learn(m_idx, DRS_NETH);
3015 update_smart_learn(m_idx, DRS_REFLECT);
3022 if (x!=px || y!=py) return (FALSE);
3025 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3027 if (blind) msg_format("%^s mumbles.", m_name);
3031 else msg_format("%^s¤¬¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3033 else msg_format("%^s casts a water bolt.", m_name);
3036 dam = damroll(10, 10) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3037 bolt(m_idx, GF_WATER, dam, MS_BOLT_WATER, learnable);
3038 update_smart_learn(m_idx, DRS_REFLECT);
3045 if (x!=px || y!=py) return (FALSE);
3048 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3050 if (blind) msg_format("%^s mumbles.", m_name);
3054 else msg_format("%^s¤¬ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3056 else msg_format("%^s casts a mana bolt.", m_name);
3059 dam = randint1(rlev * 7 / 2) + 50;
3060 bolt(m_idx, GF_MANA, dam, MS_BOLT_MANA, learnable);
3061 update_smart_learn(m_idx, DRS_REFLECT);
3068 if (x!=px || y!=py) return (FALSE);
3071 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3073 if (blind) msg_format("%^s mumbles.", m_name);
3077 else msg_format("%^s¤¬¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3079 else msg_format("%^s casts a plasma bolt.", m_name);
3082 dam = 10 + damroll(8, 7) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3083 bolt(m_idx, GF_PLASMA, dam, MS_BOLT_PLASMA, learnable);
3084 update_smart_learn(m_idx, DRS_REFLECT);
3091 if (x!=px || y!=py) return (FALSE);
3094 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3096 if (blind) msg_format("%^s mumbles.", m_name);
3100 else msg_format("%^s¤¬¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3102 else msg_format("%^s casts an ice bolt.", m_name);
3105 dam = damroll(6, 6) + (rlev * 3 / ((r_ptr->flags2 & RF2_POWERFUL) ? 2 : 3));
3106 bolt(m_idx, GF_ICE, dam, MS_BOLT_ICE, learnable);
3107 update_smart_learn(m_idx, DRS_COLD);
3108 update_smart_learn(m_idx, DRS_REFLECT);
3115 if (x!=px || y!=py) return (FALSE);
3118 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3120 if (blind) msg_format("%^s mumbles.", m_name);
3124 else msg_format("%^s¤¬¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3126 else msg_format("%^s casts a magic missile.", m_name);
3129 dam = damroll(2, 6) + (rlev / 3);
3130 bolt(m_idx, GF_MISSILE, dam, MS_MAGIC_MISSILE, learnable);
3131 update_smart_learn(m_idx, DRS_REFLECT);
3138 if (x!=px || y!=py) return (FALSE);
3142 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
3144 if (blind) msg_format("%^s mumbles, and you hear scary noises.", m_name);
3148 else msg_format("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3150 else msg_format("%^s casts a fearful illusion.", m_name);
3153 if (p_ptr->resist_fear)
3156 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3158 msg_print("You refuse to be frightened.");
3162 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3165 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3167 msg_print("You refuse to be frightened.");
3173 (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
3175 learn_spell(MS_SCARE);
3176 update_smart_learn(m_idx, DRS_FEAR);
3183 if (x!=px || y!=py) return (FALSE);
3187 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3189 if (blind) msg_format("%^s mumbles.", m_name);
3193 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¤¢¤Ê¤¿¤ÎÌܤò¤¯¤é¤Þ¤·¤¿¡ª", m_name);
3195 else msg_format("%^s casts a spell, burning your eyes!", m_name);
3198 if (p_ptr->resist_blind)
3201 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3203 msg_print("You are unaffected!");
3207 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3210 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3212 msg_print("You resist the effects!");
3218 (void)set_blind(12 + randint0(4));
3220 learn_spell(MS_BLIND);
3221 update_smart_learn(m_idx, DRS_BLIND);
3228 if (x!=px || y!=py) return (FALSE);
3232 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
3234 if (blind) msg_format("%^s mumbles, and you hear puzzling noises.", m_name);
3238 else msg_format("%^s¤¬Í¶ÏÇŪ¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£", m_name);
3240 else msg_format("%^s creates a mesmerising illusion.", m_name);
3243 if (p_ptr->resist_conf)
3246 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3248 msg_print("You disbelieve the feeble spell.");
3252 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3255 msg_print("¤·¤«¤·¸¸³Ð¤Ë¤Ï¤À¤Þ¤µ¤ì¤Ê¤«¤Ã¤¿¡£");
3257 msg_print("You disbelieve the feeble spell.");
3263 (void)set_confused(p_ptr->confused + randint0(4) + 4);
3265 learn_spell(MS_CONF);
3266 update_smart_learn(m_idx, DRS_CONF);
3273 if (x!=px || y!=py) return (FALSE);
3277 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
3279 msg_format("%^s drains power from your muscles!", m_name);
3282 if (p_ptr->free_act)
3285 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3287 msg_print("You are unaffected!");
3291 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3294 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3296 msg_print("You resist the effects!");
3302 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
3304 learn_spell(MS_SLOW);
3305 update_smart_learn(m_idx, DRS_FREE);
3312 if (x!=px || y!=py) return (FALSE);
3316 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3318 if (blind) msg_format("%^s mumbles.", m_name);
3322 else msg_format("%^s¤¬¤¢¤Ê¤¿¤ÎÌܤò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡ª", m_name);
3324 else msg_format("%^s stares deep into your eyes!", m_name);
3327 if (p_ptr->free_act)
3330 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3332 msg_print("You are unaffected!");
3336 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3339 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3341 msg_format("You resist the effects!");
3347 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
3349 learn_spell(MS_SLEEP);
3350 update_smart_learn(m_idx, DRS_FREE);
3361 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3363 msg_format("%^s mumbles.", m_name);
3370 msg_format("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", m_name, m_poss);
3372 msg_format("%^s concentrates on %s body.", m_name, m_poss);
3377 /* Allow quick speed increases to base+10 */
3381 msg_format("%^s¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£", m_name);
3383 msg_format("%^s starts moving faster.", m_name);
3386 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3387 if (p_ptr->riding == m_idx) p_ptr->update |= PU_BONUS;
3394 if (x!=px || y!=py) return (FALSE);
3397 msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
3399 msg_format("%^s invokes the Hand of Doom!", m_name);
3402 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3405 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3407 msg_format("You resist the effects!");
3409 learn_spell(MS_HAND_DOOM);
3414 int dummy = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
3416 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
3418 msg_print("Your feel your life fade away!");
3421 take_hit(DAMAGE_ATTACK, dummy, m_name, MS_HAND_DOOM);
3422 curse_equipment(40, 20);
3424 if (p_ptr->chp < 1) p_ptr->chp = 1;
3438 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3440 msg_format("%^s mumbles.", m_name);
3447 msg_format("%^s¤¬¼«Ê¬¤Î½ý¤Ë½¸Ã椷¤¿¡£", m_name);
3449 msg_format("%^s concentrates on %s wounds.", m_name, m_poss);
3455 m_ptr->hp += (rlev * 6);
3458 if (m_ptr->hp >= m_ptr->maxhp)
3461 m_ptr->hp = m_ptr->maxhp;
3467 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", m_name);
3469 msg_format("%^s looks completely healed!", m_name);
3476 msg_format("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¤è¤¦¤À¡ª", m_name);
3478 msg_format("%^s sounds completely healed!", m_name);
3484 /* Partially healed */
3491 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3493 msg_format("%^s looks healthier.", m_name);
3500 msg_format("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
3502 msg_format("%^s sounds healthier.", m_name);
3508 /* Redraw (later) if needed */
3509 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3510 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3520 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name, m_poss);
3522 msg_format("%^s recovers %s courage.", m_name, m_poss);
3538 msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3540 msg_format("%^s mumbles powerfully.", m_name);
3547 msg_format("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3549 msg_format("%^s casts a Globe of Invulnerability.", m_name);
3554 if (!(m_ptr->invulner))
3555 m_ptr->invulner = randint1(4) + 4;
3557 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
3558 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
3567 msg_format("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", m_name);
3569 msg_format("%^s blinks away.", m_name);
3572 teleport_away(m_idx, 10, FALSE);
3573 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
3580 int i, oldfy, oldfx;
3581 u32b f1 = 0 , f2 = 0 , f3 = 0;
3589 msg_format("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", m_name);
3591 msg_format("%^s teleports away.", m_name);
3594 teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
3596 if (los(py, px, oldfy, oldfx) && !world_monster)
3598 for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
3600 o_ptr = &inventory[i];
3601 if(!cursed_p(o_ptr))
3603 object_flags(o_ptr, &f1, &f2, &f3);
3605 if((f3 & TR3_TELEPORT) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
3608 if(get_check_strict("¤Ä¤¤¤Æ¤¤¤¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3610 if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
3615 teleport_player(200);
3617 msg_print("¼ºÇÔ¡ª");
3619 msg_print("Failed!");
3622 else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3623 p_ptr->energy_need += ENERGY_NEED();
3638 if(m_ptr->r_idx == MON_DIO) who = 1;
3639 else if(m_ptr->r_idx == MON_WONG) who = 3;
3641 if (!process_the_world(randint1(2)+2, who, TRUE)) return (FALSE);
3651 switch(m_ptr->r_idx)
3654 if (p_ptr->inside_arena || p_ptr->inside_battle) return FALSE;
3655 for (k = 0; k < 6; k++)
3657 count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, PM_ALLOW_GROUP);
3661 case MON_BANORLUPART:
3663 int dummy_hp = (m_ptr->hp + 1) / 2;
3664 int dummy_maxhp = m_ptr->maxhp/2;
3665 int dummy_y = m_ptr->fy;
3666 int dummy_x = m_ptr->fx;
3668 if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
3669 delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
3670 summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
3671 m_list[hack_m_idx_ii].hp = dummy_hp;
3672 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3673 summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
3674 m_list[hack_m_idx_ii].hp = dummy_hp;
3675 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3678 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡¦¥ë¥Ñ¡¼¥È¡Ù¤¬Ê¬Îö¤·¤¿¡ª");
3680 msg_print("Banor=Rupart splits in two person!");
3689 int dummy_maxhp = 0;
3690 int dummy_y = m_ptr->fy;
3691 int dummy_x = m_ptr->fx;
3693 if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
3694 for (k = 1; k < m_max; k++)
3696 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
3698 dummy_hp += m_list[k].hp;
3699 dummy_maxhp += m_list[k].maxhp;
3700 if (m_list[k].r_idx != m_ptr->r_idx)
3702 dummy_y = m_list[k].fy;
3703 dummy_x = m_list[k].fx;
3705 delete_monster_idx(k);
3708 summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
3709 m_list[hack_m_idx_ii].hp = dummy_hp;
3710 m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
3713 msg_print("¡Ø¥Ð¡¼¥Î¡¼¥ë¡Ù¤È¡Ø¥ë¥Ñ¡¼¥È¡Ù¤¬¹çÂΤ·¤¿¡ª");
3715 msg_print("Banor and Rupart combine into one!");
3720 default: return FALSE;
3728 if (x!=px || y!=py) return (FALSE);
3732 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤Ìᤷ¤¿¡£", m_name);
3734 msg_format("%^s commands you to return.", m_name);
3737 teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
3738 learn_spell(MS_TELE_TO);
3745 if (x!=px || y!=py) return (FALSE);
3749 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
3750 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
3751 msg_print("¤¯¤Ã¤½¡Á");
3753 msg_format("%^s teleports you away.", m_name);
3756 learn_spell(MS_TELE_AWAY);
3757 teleport_player(100);
3761 /* RF6_TELE_LEVEL */
3764 if (x!=px || y!=py) return (FALSE);
3768 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3770 if (blind) msg_format("%^s mumbles strangely.", m_name);
3774 else msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¤ò»Ø¤µ¤·¤¿¡£", m_name);
3776 else msg_format("%^s gestures at your feet.", m_name);
3779 if (p_ptr->resist_nexus)
3782 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
3784 msg_print("You are unaffected!");
3788 else if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3791 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3793 msg_print("You resist the effects!");
3799 teleport_player_level();
3801 learn_spell(MS_TELE_LEVEL);
3802 update_smart_learn(m_idx, DRS_NEXUS);
3809 if (x!=px || y!=py) return (FALSE);
3812 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3814 if (blind) msg_format("%^s mumbles.", m_name);
3818 else msg_format("%^s¤¬¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", m_name);
3820 else msg_format("%^s throw a Psycho-Spear.", m_name);
3823 dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 150) : (randint1(rlev * 3 / 2) + 100);
3824 beam(m_idx, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, learnable);
3831 if (x!=px || y!=py) return (FALSE);
3835 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3837 if (blind) msg_format("%^s mumbles.", m_name);
3841 else if (p_ptr->pclass == CLASS_NINJA) msg_format("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", m_name);
3842 else msg_format("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", m_name);
3844 else if (p_ptr->pclass == CLASS_NINJA)
3845 msg_format("%^s cast a spell to light up.", m_name);
3846 else msg_format("%^s gestures in shadow.", m_name);
3849 learn_spell(MS_DARKNESS);
3850 if (p_ptr->pclass == CLASS_NINJA)
3851 (void)lite_area(0, 3);
3853 (void)unlite_area(0, 3);
3863 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3865 if (blind) msg_format("%^s mumbles, and then cackles evilly.", m_name);
3869 else msg_format("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", m_name);
3871 else msg_format("%^s casts a spell and cackles evilly.", m_name);
3874 learn_spell(MS_MAKE_TRAP);
3875 (void)trap_creation(y, x);
3882 if (x!=px || y!=py) return (FALSE);
3886 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);
3888 msg_format("%^s tries to blank your mind.", m_name);
3892 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
3895 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3897 msg_print("You resist the effects!");
3901 else if (lose_all_info())
3904 msg_print("µ²±¤¬Çö¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
3906 msg_print("Your memories fade away.");
3910 learn_spell(MS_FORGET);
3914 /* RF6_RAISE_DEAD */
3919 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3921 if (blind) msg_format("%^s mumbles.", m_name);
3925 else msg_format("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", m_name);
3927 else msg_format("%^s casts a spell to revive corpses.", m_name);
3929 animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
3933 /* RF6_SUMMON_KIN */
3937 if (m_ptr->r_idx == MON_ROLENTO)
3941 msg_format("%^s¤¬²¿¤«ÂçÎ̤ËÅꤲ¤¿¡£", m_name);
3943 msg_format("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", m_name);
3946 msg_format("%^s spreads something.", m_name);
3948 msg_format("%^s throws some hand grenades.", m_name);
3951 else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
3955 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3957 msg_format("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´¤·¤¿¡£", m_name);
3960 msg_format("%^s mumbles.", m_name);
3962 msg_format("%^s magically summons guardians of dungeons.", m_name);
3969 msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
3971 msg_format("%^s¤ÏËâË¡¤Ç%s¤ò¾¤´¤·¤¿¡£",
3973 ((r_ptr->flags1) & RF1_UNIQUE ?
3977 msg_format("%^s mumbles.", m_name);
3979 msg_format("%^s magically summons %s %s.",
3981 ((r_ptr->flags1) & RF1_UNIQUE ?
3982 "minions" : "kin"));
3986 if(m_ptr->r_idx == MON_ROLENTO)
3988 int num = 1 + randint1(3);
3990 for (k = 0; k < num; k++)
3992 count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
3995 else if(m_ptr->r_idx == MON_LOUSY)
3997 int num = 2 + randint1(3);
3998 for (k = 0; k < num; k++)
4000 count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
4003 else if(m_ptr->r_idx == MON_BULLGATES)
4005 int num = 2 + randint1(3);
4006 for (k = 0; k < num; k++)
4008 count += summon_named_creature(m_idx, y, x, 921, mode);
4011 else if (m_ptr->r_idx == MON_CALDARM)
4013 int num = randint1(3);
4014 for (k = 0; k < num; k++)
4016 count += summon_named_creature(m_idx, y, x, 930, mode);
4019 else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
4021 int num = 2 + randint1(3);
4023 if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
4026 msg_print("ÃÏÌ̤«¤é¿å¤¬¿á¤½Ð¤·¤¿¡ª");
4028 msg_print("Water blew off from the ground!");
4030 fire_ball_hide(GF_WATER_FLOW, 0, 3, 8);
4033 for (k = 0; k < num; k++)
4035 count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4041 summon_kin_type = r_ptr->d_char; /* Big hack */
4043 for (k = 0; k < 4; k++)
4045 count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
4049 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4051 if (blind && count) msg_print("You hear many things appear nearby.");
4063 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4065 if (blind) msg_format("%^s mumbles.", m_name);
4069 else msg_format("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4071 else msg_format("%^s magically summons Cyberdemons!", m_name);
4075 if (blind && count) msg_print("½Å¸ü¤Ê²»¤¬¶á¤¯¤Çʹ¤³¤¨¤ë¡£");
4077 if (blind && count) msg_print("You hear heavy steps nearby.");
4080 summon_cyber(m_idx, y, x);
4089 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4091 if (blind) msg_format("%^s mumbles.", m_name);
4095 else msg_format("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´¤·¤¿¡ª", m_name);
4097 else msg_format("%^s magically summons help!", m_name);
4100 for (k = 0; k < 1; k++)
4102 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4105 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4107 if (blind && count) msg_print("You hear something appear nearby.");
4113 /* RF6_S_MONSTERS */
4118 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4120 if (blind) msg_format("%^s mumbles.", m_name);
4124 else msg_format("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª", m_name);
4126 else msg_format("%^s magically summons monsters!", m_name);
4129 for (k = 0; k < s_num_6; k++)
4131 count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4134 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4136 if (blind && count) msg_print("You hear many things appear nearby.");
4147 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4149 if (blind) msg_format("%^s mumbles.", m_name);
4153 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´¤·¤¿¡£", m_name);
4155 else msg_format("%^s magically summons ants.", m_name);
4158 for (k = 0; k < s_num_6; k++)
4160 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
4163 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4165 if (blind && count) msg_print("You hear many things appear nearby.");
4176 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4178 if (blind) msg_format("%^s mumbles.", m_name);
4182 else msg_format("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´¤·¤¿¡£", m_name);
4184 else msg_format("%^s magically summons spiders.", m_name);
4187 for (k = 0; k < s_num_6; k++)
4189 count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
4192 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4194 if (blind && count) msg_print("You hear many things appear nearby.");
4205 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4207 if (blind) msg_format("%^s mumbles.", m_name);
4211 else msg_format("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£", m_name);
4213 else msg_format("%^s magically summons hounds.", m_name);
4216 for (k = 0; k < s_num_4; k++)
4218 count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
4221 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4223 if (blind && count) msg_print("You hear many things appear nearby.");
4234 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4236 if (blind) msg_format("%^s mumbles.", m_name);
4240 else msg_format("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£", m_name);
4242 else msg_format("%^s magically summons hydras.", m_name);
4245 for (k = 0; k < s_num_4; k++)
4247 count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
4250 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4252 if (blind && count) msg_print("You hear many things appear nearby.");
4265 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4267 if (blind) msg_format("%^s mumbles.", m_name);
4271 else msg_format("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´¤·¤¿¡ª", m_name);
4273 else msg_format("%^s magically summons an angel!", m_name);
4276 if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
4278 num += r_ptr->level/40;
4281 for (k = 0; k < num; k++)
4283 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
4289 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4291 if (blind && count) msg_print("You hear something appear nearby.");
4297 if (blind) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4299 if (blind) msg_print("You hear many things appear nearby.");
4311 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4313 if (blind) msg_format("%^s mumbles.", m_name);
4317 else msg_format("%^s¤ÏËâË¡¤Çº®Æ٤εÜÄ¤é°Ëâ¤ò¾¤´¤·¤¿¡ª", m_name);
4319 else msg_format("%^s magically summons a demon from the Courts of Chaos!", m_name);
4322 for (k = 0; k < 1; k++)
4324 count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
4327 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4329 if (blind && count) msg_print("You hear something appear nearby.");
4340 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4342 if (blind) msg_format("%^s mumbles.", m_name);
4346 else msg_format("%^s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4348 else msg_format("%^s magically summons an undead adversary!", m_name);
4351 for (k = 0; k < 1; k++)
4353 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
4356 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4358 if (blind && count) msg_print("You hear something appear nearby.");
4369 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4371 if (blind) msg_format("%^s mumbles.", m_name);
4375 else msg_format("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4377 else msg_format("%^s magically summons a dragon!", m_name);
4380 for (k = 0; k < 1; k++)
4382 count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
4385 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
4387 if (blind && count) msg_print("You hear something appear nearby.");
4393 /* RF6_S_HI_UNDEAD */
4398 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))
4404 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4406 if (blind) msg_format("%^s mumbles.", m_name);
4410 else msg_format("%^s¤¬ËâË¡¤ÇÍ©µ´ÀïÂâ¤ò¾¤´¤·¤¿¡ª", m_name);
4412 else msg_format("%^s magically summons rangers of Nazgul!", m_name);
4416 for (k = 0; k < 30; k++)
4418 if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
4421 for (j = 100; j > 0; j--)
4423 scatter(&cy, &cx, y, x, 2, 0);
4424 if (cave_floor_bold(cy, cx)) break;
4428 if (!cave_floor_bold(cy, cx)) continue;
4430 if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
4437 msg_format("¡ÖÍ©µ´ÀïÂâ%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4439 msg_format("A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'",count);
4443 msg_format("¡ÖƱ¤¸¤¯%d¹æ¡¢¥Ê¥º¥°¥ë¡¦¥Ö¥é¥Ã¥¯¡ª¡×", count);
4445 msg_format("Another one says 'Number %d, Nazgul-Black!'",count);
4451 msg_format("¡Ö%dɤ¤½¤í¤Ã¤Æ¡¢¥ê¥ó¥°¥ì¥ó¥¸¥ã¡¼¡ª¡×", count);
4453 msg_format("They say 'The %d meets! We are the Ring-Ranger!'.", count);
4460 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4462 if (blind) msg_format("%^s mumbles.", m_name);
4466 else msg_format("%^s¤¬ËâË¡¤Ç¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡ª", m_name);
4468 else msg_format("%^s magically summons greater undead!", m_name);
4471 for (k = 0; k < s_num_6; k++)
4473 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4479 msg_print("´Ö¶á¤Ç²¿¤«Â¿¤¯¤Î¤â¤Î¤¬Ç礤²ó¤ë²»¤¬Ê¹¤³¤¨¤ë¡£");
4481 msg_print("You hear many creepy things appear nearby.");
4488 /* RF6_S_HI_DRAGON */
4493 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4495 if (blind) msg_format("%^s mumbles.", m_name);
4499 else msg_format("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", m_name);
4501 else msg_format("%^s magically summons ancient dragons!", m_name);
4504 for (k = 0; k < s_num_4; k++)
4506 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4511 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4513 msg_print("You hear many powerful things appear nearby.");
4520 /* RF6_S_AMBERITES */
4525 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4527 if (blind) msg_format("%^s mumbles.", m_name);
4531 else msg_format("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª", m_name);
4533 else msg_format("%^s magically summons Lords of Amber!", m_name);
4538 for (k = 0; k < s_num_4; k++)
4540 count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4545 msg_print("ÉÔ»à¤Î¼Ô¤¬¶á¤¯¤Ë¸½¤ì¤ë¤Î¤¬Ê¹¤³¤¨¤¿¡£");
4547 msg_print("You hear immortal beings appear nearby.");
4559 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
4561 if (blind) msg_format("%^s mumbles.", m_name);
4565 else msg_format("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª", m_name);
4567 else msg_format("%^s magically summons special opponents!", m_name);
4570 for (k = 0; k < s_num_4; k++)
4572 count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4574 if (r_ptr->flags3 & RF3_GOOD)
4576 for (k = count; k < s_num_4; k++)
4578 count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4583 for (k = count; k < s_num_4; k++)
4585 count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
4591 msg_print("¿¤¯¤ÎÎ϶¯¤¤¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬Ê¹¤³¤¨¤ë¡£");
4593 msg_print("You hear many powerful things appear nearby.");
4601 if ((p_ptr->action == ACTION_LEARN) && thrown_spell > 175)
4603 learn_spell(thrown_spell - 96);
4606 if (seen && maneable && !world_monster && (p_ptr->pclass == CLASS_IMITATOR))
4608 if (thrown_spell != 167)
4610 if (mane_num == MAX_MANE)
4614 for (i = 0;i < mane_num;i++)
4616 mane_spell[i] = mane_spell[i+1];
4617 mane_dam[i] = mane_dam[i+1];
4620 mane_spell[mane_num] = thrown_spell - 96;
4621 mane_dam[mane_num] = dam;
4625 p_ptr->redraw |= (PR_MANE);
4629 /* Remember what the monster did to us */
4633 if (thrown_spell < 32 * 4)
4635 r_ptr->r_flags4 |= (1L << (thrown_spell - 32 * 3));
4636 if (r_ptr->r_cast_inate < MAX_UCHAR) r_ptr->r_cast_inate++;
4640 else if (thrown_spell < 32 * 5)
4642 r_ptr->r_flags5 |= (1L << (thrown_spell - 32 * 4));
4643 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4647 else if (thrown_spell < 32 * 6)
4649 r_ptr->r_flags6 |= (1L << (thrown_spell - 32 * 5));
4650 if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
4655 /* Always take note of monsters that kill you */
4656 if (death && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
4661 /* A spell was cast */