OSDN Git Service

モンスターの状態変化処理を標準ターンで行う際に, 処理の必要のある状態
[hengband/hengband.git] / src / mane.c
1 /* File: mind.c */
2
3 /*
4  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
5  *
6  * This software may be copied and distributed for educational, research,
7  * and not for profit purposes provided that this copyright and statement
8  * are included in all such copies.  Other copyrights may also apply.
9  */
10
11 /* Purpose: Mane code */
12
13 #include "angband.h"
14
15
16 static int damage;
17
18 static void mane_info(char *p, int power, int dam)
19 {
20         int plev = p_ptr->lev;
21 #ifdef JP
22         cptr s_dam = "»½ý:";
23         cptr s_dur = "´ü´Ö:";
24         cptr s_range = "ÈÏ°Ï:";
25         cptr s_heal = "²óÉü:";
26 #else
27         cptr s_dam = "dam ";
28         cptr s_dur = "dur ";
29         cptr s_range = "range ";
30         cptr s_heal = "heal ";
31 #endif
32
33         strcpy(p, "");
34
35         if ((power > 2 && power < 41) || (power > 41 && power < 59) || (power == 75))
36                 sprintf(p, " %s%d", s_dam, dam);
37         else
38         {
39                 switch (power)
40                 {
41                         case 41:
42                                 sprintf(p, " %sd%d+%d", s_heal, plev * 3, plev);
43                                 break;
44                         case 64:
45                                 sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
46                                 break;
47                         case 66:
48                                 sprintf(p, " %s%d", s_heal, plev*6);
49                                 break;
50                         case 67:
51                                 sprintf(p, " %sd7+7", s_dur);
52                                 break;
53                         case 68:
54                                 sprintf(p, " %s10", s_range);
55                                 break;
56                         case 69:
57                                 sprintf(p, " %s%d", s_range, plev * 5);
58                                 break;
59                         case 79:
60                                 sprintf(p, " %s5", s_range);
61                                 break;
62                         default:
63                                 break;
64                 }
65         }
66 }
67
68
69 /*
70  * Allow user to choose a imitation.
71  *
72  * If a valid spell is chosen, saves it in '*sn' and returns TRUE
73  * If the user hits escape, returns FALSE, and set '*sn' to -1
74  * If there are no legal choices, returns FALSE, and sets '*sn' to -2
75  *
76  * The "prompt" should be "cast", "recite", or "study"
77  * The "known" should be TRUE for cast/pray, FALSE for study
78  *
79  * nb: This function has a (trivial) display bug which will be obvious
80  * when you run it. It's probably easy to fix but I haven't tried,
81  * sorry.
82  */
83 static int get_mane_power(int *sn, bool baigaesi)
84 {
85         int             i = 0;
86         int             num = 0;
87         int             y = 1;
88         int             x = 18;
89         int             minfail = 0;
90         int             plev = p_ptr->lev;
91         int             chance = 0;
92         int             ask;
93         char            choice;
94         char            out_val[160];
95         char            comment[80];
96 #ifdef JP
97 cptr            p = "ǽÎÏ";
98 #else
99         cptr            p = "power";
100 #endif
101
102         monster_power   spell;
103         bool            flag, redraw;
104
105         /* Assume cancelled */
106         *sn = (-1);
107
108         /* Nothing chosen yet */
109         flag = FALSE;
110
111         /* No redraw yet */
112         redraw = FALSE;
113
114         num = p_ptr->mane_num;
115
116         /* Build a prompt (accept all spells) */
117         (void)strnfmt(out_val, 78, 
118 #ifdef JP
119                       "(%c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©",
120 #else
121                       "(%c-%c, *=List, ESC=exit) Use which %s? ",
122 #endif
123                       I2A(0), I2A(num - 1), p);
124
125         /* Get a spell from the user */
126
127         choice= always_show_list ? ESCAPE:1 ;
128         while (!flag)
129         {
130                 if(choice==ESCAPE) choice = ' '; 
131                 else if( !get_com(out_val, &choice, TRUE) )break; 
132
133                 /* Request redraw */
134                 if ((choice == ' ') || (choice == '*') || (choice == '?'))
135                 {
136                         /* Show the list */
137                         if (!redraw)
138                         {
139                                 char psi_desc[80];
140
141                                 /* Show list */
142                                 redraw = TRUE;
143
144                                 /* Save the screen */
145                                 screen_save();
146
147                                 /* Display a list of spells */
148                                 prt("", y, x);
149 #ifdef JP
150 put_str("̾Á°", y, x + 5);
151 #else
152                                 put_str("Name", y, x + 5);
153 #endif
154
155 #ifdef JP
156 put_str("¼ºÎ¨ ¸ú²Ì", y, x + 36);
157 #else
158                                 put_str("Fail Info", y, x + 35);
159 #endif
160
161
162                                 /* Dump the spells */
163                                 for (i = 0; i < num; i++)
164                                 {
165                                         /* Access the spell */
166                                         spell = monster_powers[p_ptr->mane_spell[i]];
167
168                                         chance = spell.manefail;
169
170                                         /* Reduce failure rate by "effective" level adjustment */
171                                         if (plev > spell.level) chance -= 3 * (plev - spell.level);
172
173                                         /* Reduce failure rate by INT/WIS adjustment */
174                                         chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
175
176                                         if (spell.manedam) chance = chance * p_ptr->mane_dam[i] / spell.manedam;
177
178                                         chance += p_ptr->to_m_chance;
179
180                                         /* Extract the minimum failure rate */
181                                         minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
182
183                                         /* Minimum failure rate */
184                                         if (chance < minfail) chance = minfail;
185
186                                         /* Stunning makes spells harder */
187                                         if (p_ptr->stun > 50) chance += 25;
188                                         else if (p_ptr->stun) chance += 15;
189
190                                         /* Always a 5 percent chance of working */
191                                         if (chance > 95) chance = 95;
192
193                                         /* Get info */
194                                         mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
195
196                                         /* Dump the spell --(-- */
197                                         sprintf(psi_desc, "  %c) %-30s %3d%%%s",
198                                                 I2A(i), spell.name,
199                                                 chance, comment);
200                                         prt(psi_desc, y + i + 1, x);
201                                 }
202
203                                 /* Clear the bottom line */
204                                 prt("", y + i + 1, x);
205                         }
206
207                         /* Hide the list */
208                         else
209                         {
210                                 /* Hide list */
211                                 redraw = FALSE;
212
213                                 /* Restore the screen */
214                                 screen_load();
215                         }
216
217                         /* Redo asking */
218                         continue;
219                 }
220
221                 /* Note verify */
222                 ask = isupper(choice);
223
224                 /* Lowercase */
225                 if (ask) choice = tolower(choice);
226
227                 /* Extract request */
228                 i = (islower(choice) ? A2I(choice) : -1);
229
230                 /* Totally Illegal */
231                 if ((i < 0) || (i >= num))
232                 {
233                         bell();
234                         continue;
235                 }
236
237                 /* Save the spell index */
238                 spell = monster_powers[p_ptr->mane_spell[i]];
239
240                 /* Verify it */
241                 if (ask)
242                 {
243                         char tmp_val[160];
244
245                         /* Prompt */
246 #ifdef JP
247                         (void) strnfmt(tmp_val, 78, "%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©", monster_powers[p_ptr->mane_spell[i]].name);
248 #else
249                         (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[p_ptr->mane_spell[i]].name);
250 #endif
251
252
253                         /* Belay that order */
254                         if (!get_check(tmp_val)) continue;
255                 }
256
257                 /* Stop the loop */
258                 flag = TRUE;
259         }
260
261         /* Restore the screen */
262         if (redraw) screen_load();
263
264         /* Show choices */
265         p_ptr->window |= (PW_SPELL);
266
267         /* Window stuff */
268         window_stuff();
269
270         /* Abort if needed */
271         if (!flag) return (FALSE);
272
273         /* Save the choice */
274         (*sn) = i;
275
276         damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
277
278         /* Success */
279         return (TRUE);
280 }
281
282
283 /*
284  * do_cmd_cast calls this function if the player's class
285  * is 'imitator'.
286  */
287 static bool use_mane(int spell)
288 {
289         int             dir;
290         int             plev = p_ptr->lev;
291         u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
292         u32b u_mode = 0L;
293
294         if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
295
296
297         /* spell code */
298         switch (spell)
299         {
300         case MS_SHRIEK:
301 #ifdef JP
302 msg_print("¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£");
303 #else
304                 msg_print("You make a high pitched shriek.");
305 #endif
306
307                 aggravate_monsters(0);
308                 break;
309         case MS_XXX1:
310                 break;
311         case MS_DISPEL:
312         {
313                 monster_type *m_ptr;
314                 bool need_mproc_remove = FALSE;
315                 char m_name[80];
316
317                 if (!target_set(TARGET_KILL)) return FALSE;
318                 if (!cave[target_row][target_col].m_idx) break;
319                 if (!player_has_los_bold(target_row, target_col)) break;
320                 if (!projectable(py, px, target_row, target_col)) break;
321                 m_ptr = &m_list[cave[target_row][target_col].m_idx];
322                 monster_desc(m_name, m_ptr, 0);
323                 if (m_ptr->invulner)
324                 {
325                         m_ptr->invulner = 0;
326                         need_mproc_remove = TRUE;
327                         if (m_ptr->ml)
328                         {
329 #ifdef JP
330                                 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
331 #else
332                                 msg_format("%^s is no longer invulnerable.", m_name);
333 #endif
334                                 p_ptr->redraw |= (PR_HEALTH);
335                                 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
336                         }
337                         m_ptr->energy_need += ENERGY_NEED();
338                 }
339                 if (m_ptr->fast)
340                 {
341                         m_ptr->fast = 0;
342                         need_mproc_remove = TRUE;
343 #ifdef JP
344                         if (m_ptr->ml) msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
345 #else
346                         if (m_ptr->ml) msg_format("%^s is no longer fast.", m_name);
347 #endif
348                 }
349                 if (m_ptr->slow)
350                 {
351                         m_ptr->slow = 0;
352                         need_mproc_remove = TRUE;
353 #ifdef JP
354                         if (m_ptr->ml) msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
355 #else
356                         if (m_ptr->ml) msg_format("%^s is no longer slow.", m_name);
357 #endif
358                 }
359
360                 if (need_mproc_remove && !need_mproc(m_ptr)) mproc_remove(m_ptr->mproc_idx);
361                 break;
362         }
363         case MS_ROCKET:
364                 if (!get_aim_dir(&dir)) return FALSE;
365 #ifdef JP
366 else msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
367 #else
368                         else msg_print("You fire a rocket.");
369 #endif
370                 
371                         fire_rocket(GF_ROCKET, dir, damage, 2);
372                 break;
373         case MS_SHOOT:
374                 if (!get_aim_dir(&dir)) return FALSE;
375 #ifdef JP
376 else msg_print("Ìð¤òÊü¤Ã¤¿¡£");
377 #else
378                         else msg_print("You fire an arrow.");
379 #endif
380                 
381                         fire_bolt(GF_ARROW, dir, damage);
382                 break;
383         case MS_XXX2:
384                 break;
385         case MS_XXX3:
386                 break;
387         case MS_XXX4:
388                 break;
389         case MS_BR_ACID:
390                 if (!get_aim_dir(&dir)) return FALSE;
391 #ifdef JP
392 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
393 #else
394                         else msg_print("You breathe acid.");
395 #endif
396                 
397                         fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2));
398                 break;
399         case MS_BR_ELEC:
400                 if (!get_aim_dir(&dir)) return FALSE;
401 #ifdef JP
402 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
403 #else
404                         else msg_print("You breathe lightning.");
405 #endif
406                 
407                         fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2));
408                 break;
409         case MS_BR_FIRE:
410                 if (!get_aim_dir(&dir)) return FALSE;
411 #ifdef JP
412 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
413 #else
414                         else msg_print("You breathe fire.");
415 #endif
416                 
417                         fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2));
418                 break;
419         case MS_BR_COLD:
420                 if (!get_aim_dir(&dir)) return FALSE;
421 #ifdef JP
422 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
423 #else
424                         else msg_print("You breathe frost.");
425 #endif
426                 
427                         fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2));
428                 break;
429         case MS_BR_POIS:
430                 if (!get_aim_dir(&dir)) return FALSE;
431 #ifdef JP
432 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
433 #else
434                         else msg_print("You breathe gas.");
435 #endif
436                 
437                         fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2));
438                 break;
439         case MS_BR_NETHER:
440                 if (!get_aim_dir(&dir)) return FALSE;
441 #ifdef JP
442 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
443 #else
444                         else msg_print("You breathe nether.");
445 #endif
446                 
447                         fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2));
448                 break;
449         case MS_BR_LITE:
450                 if (!get_aim_dir(&dir)) return FALSE;
451 #ifdef JP
452 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
453 #else
454                         else msg_print("You breathe light.");
455 #endif
456                 
457                         fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2));
458                 break;
459         case MS_BR_DARK:
460                 if (!get_aim_dir(&dir)) return FALSE;
461 #ifdef JP
462 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
463 #else
464                         else msg_print("You breathe darkness.");
465 #endif
466                 
467                         fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2));
468                 break;
469         case MS_BR_CONF:
470                 if (!get_aim_dir(&dir)) return FALSE;
471 #ifdef JP
472 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
473 #else
474                         else msg_print("You breathe confusion.");
475 #endif
476                 
477                         fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2));
478                 break;
479         case MS_BR_SOUND:
480                 if (!get_aim_dir(&dir)) return FALSE;
481 #ifdef JP
482 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
483 #else
484                         else msg_print("You breathe sound.");
485 #endif
486                 
487                         fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2));
488                 break;
489         case MS_BR_CHAOS:
490                 if (!get_aim_dir(&dir)) return FALSE;
491 #ifdef JP
492 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
493 #else
494                         else msg_print("You breathe chaos.");
495 #endif
496                 
497                         fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2));
498                 break;
499         case MS_BR_DISEN:
500                 if (!get_aim_dir(&dir)) return FALSE;
501 #ifdef JP
502 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
503 #else
504                         else msg_print("You breathe disenchantment.");
505 #endif
506                 
507                         fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2));
508                 break;
509         case MS_BR_NEXUS:
510                 if (!get_aim_dir(&dir)) return FALSE;
511 #ifdef JP
512 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
513 #else
514                         else msg_print("You breathe nexus.");
515 #endif
516                 
517                         fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2));
518                 break;
519         case MS_BR_TIME:
520                 if (!get_aim_dir(&dir)) return FALSE;
521 #ifdef JP
522 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
523 #else
524                         else msg_print("You breathe time.");
525 #endif
526                 
527                         fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2));
528                 break;
529         case MS_BR_INERTIA:
530                 if (!get_aim_dir(&dir)) return FALSE;
531 #ifdef JP
532 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
533 #else
534                         else msg_print("You breathe inertia.");
535 #endif
536                 
537                         fire_ball(GF_INERTIA, dir, damage, (plev > 35 ? -3 : -2));
538                 break;
539         case MS_BR_GRAVITY:
540                 if (!get_aim_dir(&dir)) return FALSE;
541 #ifdef JP
542 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
543 #else
544                         else msg_print("You breathe gravity.");
545 #endif
546                 
547                         fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2));
548                 break;
549         case MS_BR_SHARDS:
550                 if (!get_aim_dir(&dir)) return FALSE;
551 #ifdef JP
552 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
553 #else
554                         else msg_print("You breathe shards.");
555 #endif
556                 
557                         fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2));
558                 break;
559         case MS_BR_PLASMA:
560                 if (!get_aim_dir(&dir)) return FALSE;
561 #ifdef JP
562 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
563 #else
564                         else msg_print("You breathe plasma.");
565 #endif
566                 
567                         fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2));
568                 break;
569         case MS_BR_FORCE:
570                 if (!get_aim_dir(&dir)) return FALSE;
571 #ifdef JP
572 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
573 #else
574                         else msg_print("You breathe force.");
575 #endif
576                 
577                         fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2));
578                 break;
579         case MS_BR_MANA:
580                 if (!get_aim_dir(&dir)) return FALSE;
581 #ifdef JP
582 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
583 #else
584                         else msg_print("You breathe mana.");
585 #endif
586                 
587                         fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2));
588                 break;
589         case MS_BALL_NUKE:
590                 if (!get_aim_dir(&dir)) return FALSE;
591 #ifdef JP
592 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
593 #else
594                         else msg_print("You cast a ball of radiation.");
595 #endif
596                 
597                         fire_ball(GF_NUKE, dir, damage, 2);
598                 break;
599         case MS_BR_NUKE:
600                 if (!get_aim_dir(&dir)) return FALSE;
601 #ifdef JP
602 else msg_print("Êü¼ÍÀ­ÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
603 #else
604                         else msg_print("You breathe toxic waste.");
605 #endif
606                 
607                         fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2));
608                 break;
609         case MS_BALL_CHAOS:
610                 if (!get_aim_dir(&dir)) return FALSE;
611 #ifdef JP
612 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
613 #else
614                         else msg_print("You invoke a raw Logrus.");
615 #endif
616                 
617                         fire_ball(GF_CHAOS, dir, damage, 4);
618                 break;
619         case MS_BR_DISI:
620                 if (!get_aim_dir(&dir)) return FALSE;
621 #ifdef JP
622 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
623 #else
624                         else msg_print("You breathe disintegration.");
625 #endif
626                 
627                         fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2));
628                 break;
629         case MS_BALL_ACID:
630                 if (!get_aim_dir(&dir)) return FALSE;
631 #ifdef JP
632 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
633 #else
634                         else msg_print("You cast an acid ball.");
635 #endif
636                 
637                         fire_ball(GF_ACID, dir, damage, 2);
638                 break;
639         case MS_BALL_ELEC:
640                 if (!get_aim_dir(&dir)) return FALSE;
641 #ifdef JP
642 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
643 #else
644                         else msg_print("You cast a lightning ball.");
645 #endif
646                 
647                         fire_ball(GF_ELEC, dir, damage, 2);
648                 break;
649         case MS_BALL_FIRE:
650                 if (!get_aim_dir(&dir)) return FALSE;
651 #ifdef JP
652 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
653 #else
654                         else msg_print("You cast a fire ball.");
655 #endif
656                 
657                         fire_ball(GF_FIRE, dir, damage, 2);
658                 break;
659         case MS_BALL_COLD:
660                 if (!get_aim_dir(&dir)) return FALSE;
661 #ifdef JP
662 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
663 #else
664                         else msg_print("You cast a frost ball.");
665 #endif
666                 
667                         fire_ball(GF_COLD, dir, damage, 2);
668                 break;
669         case MS_BALL_POIS:
670                 if (!get_aim_dir(&dir)) return FALSE;
671 #ifdef JP
672 else msg_print("°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
673 #else
674                         else msg_print("You cast a stinking cloud.");
675 #endif
676                 
677                         fire_ball(GF_POIS, dir, damage, 2);
678                 break;
679         case MS_BALL_NETHER:
680                 if (!get_aim_dir(&dir)) return FALSE;
681 #ifdef JP
682 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
683 #else
684                         else msg_print("You cast a nether ball.");
685 #endif
686                 
687                         fire_ball(GF_NETHER, dir, damage, 2);
688                 break;
689         case MS_BALL_WATER:
690                 if (!get_aim_dir(&dir)) return FALSE;
691 #ifdef JP
692 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
693 #else
694                         else msg_print("You gesture fluidly.");
695 #endif
696                 
697                         fire_ball(GF_WATER, dir, damage, 4);
698                 break;
699         case MS_BALL_MANA:
700                 if (!get_aim_dir(&dir)) return FALSE;
701 #ifdef JP
702 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
703 #else
704                         else msg_print("You invoke a mana storm.");
705 #endif
706                 
707                         fire_ball(GF_MANA, dir, damage, 4);
708                 break;
709         case MS_BALL_DARK:
710                 if (!get_aim_dir(&dir)) return FALSE;
711 #ifdef JP
712 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
713 #else
714                         else msg_print("You invoke a darkness storm.");
715 #endif
716                 
717                         fire_ball(GF_DARK, dir, damage, 4);
718                 break;
719         case MS_DRAIN_MANA:
720                 if (!get_aim_dir(&dir)) return FALSE;
721                 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
722                 break;
723         case MS_MIND_BLAST:
724                 if (!get_aim_dir(&dir)) return FALSE;
725                 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
726                 break;
727         case MS_BRAIN_SMASH:
728                 if (!get_aim_dir(&dir)) return FALSE;
729                 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
730                 break;
731         case MS_CAUSE_1:
732                 if (!get_aim_dir(&dir)) return FALSE;
733                 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
734                 break;
735         case MS_CAUSE_2:
736                 if (!get_aim_dir(&dir)) return FALSE;
737                 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
738                 break;
739         case MS_CAUSE_3:
740                 if (!get_aim_dir(&dir)) return FALSE;
741                 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
742                 break;
743         case MS_CAUSE_4:
744                 if (!get_aim_dir(&dir)) return FALSE;
745                 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
746                 break;
747         case MS_BOLT_ACID:
748                 if (!get_aim_dir(&dir)) return FALSE;
749 #ifdef JP
750 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
751 #else
752                         else msg_print("You cast an acid bolt.");
753 #endif
754                 
755                         fire_bolt(GF_ACID, dir, damage);
756                 break;
757         case MS_BOLT_ELEC:
758                 if (!get_aim_dir(&dir)) return FALSE;
759 #ifdef JP
760 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
761 #else
762                         else msg_print("You cast a lightning bolt.");
763 #endif
764                 
765                         fire_bolt(GF_ELEC, dir, damage);
766                 break;
767         case MS_BOLT_FIRE:
768                 if (!get_aim_dir(&dir)) return FALSE;
769 #ifdef JP
770 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
771 #else
772                         else msg_print("You cast a fire bolt.");
773 #endif
774                 
775                         fire_bolt(GF_FIRE, dir, damage);
776                 break;
777         case MS_BOLT_COLD:
778                 if (!get_aim_dir(&dir)) return FALSE;
779 #ifdef JP
780 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
781 #else
782                         else msg_print("You cast a frost bolt.");
783 #endif
784                 
785                         fire_bolt(GF_COLD, dir, damage);
786                 break;
787         case MS_STARBURST:
788                 if (!get_aim_dir(&dir)) return FALSE;
789 #ifdef JP
790 else msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
791 #else
792                         else msg_print("You invoke a starburst.");
793 #endif
794                 
795                         fire_ball(GF_LITE, dir, damage, 4);
796                 break;
797         case MS_BOLT_NETHER:
798                 if (!get_aim_dir(&dir)) return FALSE;
799 #ifdef JP
800 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
801 #else
802                         else msg_print("You cast a nether bolt.");
803 #endif
804                 
805                         fire_bolt(GF_NETHER, dir, damage);
806                 break;
807         case MS_BOLT_WATER:
808                 if (!get_aim_dir(&dir)) return FALSE;
809 #ifdef JP
810 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
811 #else
812                         else msg_print("You cast a water bolt.");
813 #endif
814                 
815                         fire_bolt(GF_WATER, dir, damage);
816                 break;
817         case MS_BOLT_MANA:
818                 if (!get_aim_dir(&dir)) return FALSE;
819 #ifdef JP
820 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
821 #else
822                         else msg_print("You cast a mana bolt.");
823 #endif
824                 
825                         fire_bolt(GF_MANA, dir, damage);
826                 break;
827         case MS_BOLT_PLASMA:
828                 if (!get_aim_dir(&dir)) return FALSE;
829 #ifdef JP
830 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
831 #else
832                         else msg_print("You cast a plasma bolt.");
833 #endif
834                 
835                         fire_bolt(GF_PLASMA, dir, damage);
836                 break;
837         case MS_BOLT_ICE:
838                 if (!get_aim_dir(&dir)) return FALSE;
839 #ifdef JP
840 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
841 #else
842                         else msg_print("You cast a ice bolt.");
843 #endif
844                 
845                         fire_bolt(GF_ICE, dir, damage);
846                 break;
847         case MS_MAGIC_MISSILE:
848                 if (!get_aim_dir(&dir)) return FALSE;
849 #ifdef JP
850 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
851 #else
852                         else msg_print("You cast a magic missile.");
853 #endif
854                 
855                         fire_bolt(GF_MISSILE, dir, damage);
856                 break;
857         case MS_SCARE:
858                 if (!get_aim_dir(&dir)) return FALSE;
859 #ifdef JP
860 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
861 #else
862                         else msg_print("You cast a fearful illusion.");
863 #endif
864                 
865                         fear_monster(dir, plev+10);
866                 break;
867         case MS_BLIND:
868                 if (!get_aim_dir(&dir)) return FALSE;
869                 confuse_monster(dir, plev * 2);
870                 break;
871         case MS_CONF:
872                 if (!get_aim_dir(&dir)) return FALSE;
873 #ifdef JP
874 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
875 #else
876                         else msg_print("You cast a mesmerizing illusion.");
877 #endif
878                 
879                         confuse_monster(dir, plev * 2);
880                 break;
881         case MS_SLOW:
882                 if (!get_aim_dir(&dir)) return FALSE;
883                 slow_monster(dir);
884                 break;
885         case MS_SLEEP:
886                 if (!get_aim_dir(&dir)) return FALSE;
887                 sleep_monster(dir);
888                 break;
889         case MS_SPEED:
890                 (void)set_fast(randint1(20 + plev) + plev, FALSE);
891                 break;
892         case MS_HAND_DOOM:
893         {
894                 if (!get_aim_dir(&dir)) return FALSE;
895 #ifdef JP
896 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
897 #else
898                 else msg_print("You invoke the Hand of Doom!");
899 #endif
900
901                 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
902                 break;
903         }
904         case MS_HEAL:
905 #ifdef JP
906 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
907 #else
908                         msg_print("You concentrate on your wounds!");
909 #endif
910                 (void)hp_player(plev*6);
911                 (void)set_stun(0);
912                 (void)set_cut(0);
913                 break;
914         case MS_INVULNER:
915 #ifdef JP
916 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
917 #else
918                         msg_print("You cast a Globe of Invulnerability.");
919 #endif
920                 (void)set_invuln(randint1(7) + 7, FALSE);
921                 break;
922         case MS_BLINK:
923                 teleport_player(10, FALSE);
924                 break;
925         case MS_TELEPORT:
926                 teleport_player(plev * 5, FALSE);
927                 break;
928         case MS_WORLD:
929                 world_player = TRUE;
930                 if (damage == 1 || damage == 2)
931 #ifdef JP
932                         msg_print("¡Ö¡Ø¥¶¡¦¥ï¡¼¥ë¥É¡Ù¡ª»þ¤Ï»ß¤Þ¤Ã¤¿¡ª¡×");
933 #else
934                         msg_print("You yell 'The World! Time has stopped!'");
935 #endif
936                 else if (damage == 3 || damage == 6)
937 #ifdef JP
938                         msg_print("¡Ö»þ¤è¡ª¡×");
939 #else
940                         msg_print("You yell 'Time!'");
941 #endif
942                 else
943                         msg_print("hek!");
944                 msg_print(NULL);
945
946                 /* Hack */
947                 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
948
949                 /* Redraw map */
950                 p_ptr->redraw |= (PR_MAP);
951
952                 /* Update monsters */
953                 p_ptr->update |= (PU_MONSTERS);
954
955                 /* Window stuff */
956                 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
957
958                 handle_stuff();
959                 break;
960         case MS_SPECIAL:
961                 break;
962         case MS_TELE_TO:
963         {
964                 monster_type *m_ptr;
965                 monster_race *r_ptr;
966                 char m_name[80];
967
968                 if (!target_set(TARGET_KILL)) return FALSE;
969                 if (!cave[target_row][target_col].m_idx) break;
970                 if (!player_has_los_bold(target_row, target_col)) break;
971                 if (!projectable(py, px, target_row, target_col)) break;
972                 m_ptr = &m_list[cave[target_row][target_col].m_idx];
973                 r_ptr = &r_info[m_ptr->r_idx];
974                 monster_desc(m_name, m_ptr, 0);
975                 if (r_ptr->flagsr & RFR_RES_TELE)
976                 {
977                         if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
978                         {
979                                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
980 #ifdef JP
981                                 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
982 #else
983                                 msg_format("%s is unaffected!", m_name);
984 #endif
985
986                                 break;
987                         }
988                         else if (r_ptr->level > randint1(100))
989                         {
990                                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
991 #ifdef JP
992                                 msg_format("%s¤Ë¤ÏÂÑÀ­¤¬¤¢¤ë¡ª", m_name);
993 #else
994                                 msg_format("%s resists!", m_name);
995 #endif
996
997                                 break;
998                         }
999                 }
1000 #ifdef JP
1001 msg_format("%s¤ò°ú¤­Ìᤷ¤¿¡£", m_name);
1002 #else
1003                 msg_format("You command %s to return.", m_name);
1004 #endif
1005
1006                 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TRUE);
1007                 break;
1008         }
1009         case MS_TELE_AWAY:
1010                 if (!get_aim_dir(&dir)) return FALSE;
1011
1012                 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1013                 break;
1014         case MS_TELE_LEVEL:
1015         {
1016                 int target_m_idx;
1017                 monster_type *m_ptr;
1018                 monster_race *r_ptr;
1019                 char m_name[80];
1020
1021                 if (!target_set(TARGET_KILL)) return FALSE;
1022                 target_m_idx = cave[target_row][target_col].m_idx;
1023                 if (!target_m_idx) break;
1024                 if (!player_has_los_bold(target_row, target_col)) break;
1025                 if (!projectable(py, px, target_row, target_col)) break;
1026                 m_ptr = &m_list[target_m_idx];
1027                 r_ptr = &r_info[m_ptr->r_idx];
1028                 monster_desc(m_name, m_ptr, 0);
1029 #ifdef JP
1030                 msg_format("%^s¤Î­¤ò»Ø¤µ¤·¤¿¡£", m_name);
1031 #else
1032                 msg_format("You gesture at %^s's feet.", m_name);
1033 #endif
1034
1035                 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
1036                         (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1037                 {
1038 #ifdef JP
1039                         msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1040 #else
1041                         msg_format("%^s is unaffected!", m_name);
1042 #endif
1043                 }
1044                 else teleport_level(target_m_idx);
1045                 break;
1046         }
1047         case MS_PSY_SPEAR:
1048                 if (!get_aim_dir(&dir)) return FALSE;
1049
1050 #ifdef JP
1051 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1052 #else
1053                         else msg_print("You throw a psycho-spear.");
1054 #endif
1055                 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1056                 break;
1057         case MS_DARKNESS:
1058 #ifdef JP
1059 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1060 #else
1061                         msg_print("You gesture in shadow.");
1062 #endif
1063                 (void)unlite_area(10, 3);
1064                 break;
1065         case MS_MAKE_TRAP:
1066                 if (!target_set(TARGET_KILL)) return FALSE;
1067 #ifdef JP
1068 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£");
1069 #else
1070                         msg_print("You cast a spell and cackles evilly.");
1071 #endif
1072                 trap_creation(target_row, target_col);
1073                 break;
1074         case MS_FORGET:
1075 #ifdef JP
1076 msg_print("¤·¤«¤·²¿¤âµ¯¤­¤Ê¤«¤Ã¤¿¡£");
1077 #else
1078                         msg_print("Nothing happen.");
1079 #endif
1080                 break;
1081         case MS_RAISE_DEAD:
1082 #ifdef JP
1083 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1084 #else
1085                 msg_print("You cast a animate dead.");
1086 #endif
1087                 (void)animate_dead(0, py, px);
1088                 break;
1089         case MS_S_KIN:
1090         {
1091                 int k;
1092                 if (!target_set(TARGET_KILL)) return FALSE;
1093
1094 #ifdef JP
1095 msg_print("±ç·³¤ò¾¤´­¤·¤¿¡£");
1096 #else
1097                         msg_print("You summon minions.");
1098 #endif
1099                 for (k = 0;k < 4; k++)
1100                 {
1101                         (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
1102                 }
1103                 break;
1104         }
1105         case MS_S_CYBER:
1106         {
1107                 int k;
1108                 int max_cyber = (dun_level / 50) + randint1(3);
1109                 if (!target_set(TARGET_KILL)) return FALSE;
1110 #ifdef JP
1111 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª");
1112 #else
1113                         msg_print("You summon Cyberdemons!");
1114 #endif
1115                 if (max_cyber > 4) max_cyber = 4;
1116                 for (k = 0;k < max_cyber; k++)
1117                         summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
1118                 break;
1119         }
1120         case MS_S_MONSTER:
1121         {
1122                 int k;
1123                 if (!target_set(TARGET_KILL)) return FALSE;
1124 #ifdef JP
1125 msg_print("Ãç´Ö¤ò¾¤´­¤·¤¿¡£");
1126 #else
1127                         msg_print("You summon help.");
1128 #endif
1129                 for (k = 0;k < 1; k++)
1130                         summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1131                 break;
1132         }
1133         case MS_S_MONSTERS:
1134         {
1135                 int k;
1136                 if (!target_set(TARGET_KILL)) return FALSE;
1137 #ifdef JP
1138 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª");
1139 #else
1140                         msg_print("You summon monsters!");
1141 #endif
1142                 for (k = 0;k < 6; k++)
1143                         summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1144                 break;
1145         }
1146         case MS_S_ANT:
1147         {
1148                 int k;
1149                 if (!target_set(TARGET_KILL)) return FALSE;
1150 #ifdef JP
1151 msg_print("¥¢¥ê¤ò¾¤´­¤·¤¿¡£");
1152 #else
1153                         msg_print("You summon ants.");
1154 #endif
1155                 for (k = 0;k < 6; k++)
1156                         summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
1157                 break;
1158         }
1159         case MS_S_SPIDER:
1160         {
1161                 int k;
1162                 if (!target_set(TARGET_KILL)) return FALSE;
1163 #ifdef JP
1164 msg_print("ÃØéá¤ò¾¤´­¤·¤¿¡£");
1165 #else
1166                         msg_print("You summon spiders.");
1167 #endif
1168                 for (k = 0;k < 6; k++)
1169                         summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
1170                 break;
1171         }
1172         case MS_S_HOUND:
1173         {
1174                 int k;
1175                 if (!target_set(TARGET_KILL)) return FALSE;
1176 #ifdef JP
1177 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£");
1178 #else
1179                         msg_print("You summon hounds.");
1180 #endif
1181                 for (k = 0;k < 4; k++)
1182                         summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
1183                 break;
1184         }
1185         case MS_S_HYDRA:
1186         {
1187                 int k;
1188                 if (!target_set(TARGET_KILL)) return FALSE;
1189 #ifdef JP
1190 msg_print("¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£");
1191 #else
1192                         msg_print("You summon hydras.");
1193 #endif
1194                 for (k = 0;k < 4; k++)
1195                         summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
1196                 break;
1197         }
1198         case MS_S_ANGEL:
1199         {
1200                 int k;
1201                 if (!target_set(TARGET_KILL)) return FALSE;
1202 #ifdef JP
1203 msg_print("Å·»È¤ò¾¤´­¤·¤¿¡ª");
1204 #else
1205                         msg_print("You summon angel!");
1206 #endif
1207                 for (k = 0;k < 1; k++)
1208                         summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
1209                 break;
1210         }
1211         case MS_S_DEMON:
1212         {
1213                 int k;
1214                 if (!target_set(TARGET_KILL)) return FALSE;
1215 #ifdef JP
1216 msg_print("º®Æ٤εÜÄ¤é°­Ëâ¤ò¾¤´­¤·¤¿¡ª");
1217 #else
1218                         msg_print("You summon a demon from the Courts of Chaos!");
1219 #endif
1220                 for (k = 0;k < 1; k++)
1221                         summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
1222                 break;
1223         }
1224         case MS_S_UNDEAD:
1225         {
1226                 int k;
1227                 if (!target_set(TARGET_KILL)) return FALSE;
1228 #ifdef JP
1229 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´­¤·¤¿¡ª");
1230 #else
1231                         msg_print("You summon an undead adversary!");
1232 #endif
1233                 for (k = 0;k < 1; k++)
1234                         summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
1235                 break;
1236         }
1237         case MS_S_DRAGON:
1238         {
1239                 int k;
1240                 if (!target_set(TARGET_KILL)) return FALSE;
1241 #ifdef JP
1242 msg_print("¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª");
1243 #else
1244                         msg_print("You summon dragon!");
1245 #endif
1246                 for (k = 0;k < 1; k++)
1247                         summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
1248                 break;
1249         }
1250         case MS_S_HI_UNDEAD:
1251         {
1252                 int k;
1253                 if (!target_set(TARGET_KILL)) return FALSE;
1254 #ifdef JP
1255 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡ª");
1256 #else
1257                         msg_print("You summon greater undead!");
1258 #endif
1259                 for (k = 0;k < 6; k++)
1260                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1261                 break;
1262         }
1263         case MS_S_HI_DRAGON:
1264         {
1265                 int k;
1266                 if (!target_set(TARGET_KILL)) return FALSE;
1267 #ifdef JP
1268 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª");
1269 #else
1270                         msg_print("You summon ancient dragons!");
1271 #endif
1272                 for (k = 0;k < 4; k++)
1273                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
1274                 break;
1275         }
1276         case MS_S_AMBERITE:
1277         {
1278                 int k;
1279                 if (!target_set(TARGET_KILL)) return FALSE;
1280 #ifdef JP
1281 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª");
1282 #else
1283                         msg_print("You summon Lords of Amber!");
1284 #endif
1285                 for (k = 0;k < 4; k++)
1286                         summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
1287                 break;
1288         }
1289         case MS_S_UNIQUE:
1290         {
1291                 int k, count = 0;
1292                 if (!target_set(TARGET_KILL)) return FALSE;
1293 #ifdef JP
1294 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª");
1295 #else
1296                         msg_print("You summon special opponents!");
1297 #endif
1298                 for (k = 0;k < 4; k++)
1299                         if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
1300                 for (k = count;k < 4; k++)
1301                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1302                 break;
1303         }
1304         default:
1305                 msg_print("hoge?");
1306         }
1307
1308         return TRUE;
1309 }
1310
1311
1312 /*
1313  * do_cmd_cast calls this function if the player's class
1314  * is 'imitator'.
1315  */
1316 bool do_cmd_mane(bool baigaesi)
1317 {
1318         int             n = 0, j;
1319         int             chance;
1320         int             minfail = 0;
1321         int             plev = p_ptr->lev;
1322         monster_power   spell;
1323         bool            cast;
1324
1325
1326         /* not if confused */
1327         if (p_ptr->confused)
1328         {
1329 #ifdef JP
1330 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤­¤Ê¤¤¡ª");
1331 #else
1332                 msg_print("You are too confused!");
1333 #endif
1334
1335                 return TRUE;
1336         }
1337
1338         if (!p_ptr->mane_num)
1339         {
1340 #ifdef JP
1341 msg_print("¤Þ¤Í¤é¤ì¤ë¤â¤Î¤¬²¿¤â¤Ê¤¤¡ª");
1342 #else
1343                 msg_print("You don't remember any action!");
1344 #endif
1345
1346                 return FALSE;
1347         }
1348
1349         /* get power */
1350         if (!get_mane_power(&n, baigaesi)) return FALSE;
1351
1352         spell = monster_powers[p_ptr->mane_spell[n]];
1353
1354         /* Spell failure chance */
1355         chance = spell.manefail;
1356
1357         /* Reduce failure rate by "effective" level adjustment */
1358         if (plev > spell.level) chance -= 3 * (plev - spell.level);
1359
1360         /* Reduce failure rate by 1 stat and DEX adjustment */
1361         chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1362
1363         if (spell.manedam) chance = chance * damage / spell.manedam;
1364
1365         chance += p_ptr->to_m_chance;
1366
1367         /* Extract the minimum failure rate */
1368         minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1369
1370         /* Minimum failure rate */
1371         if (chance < minfail) chance = minfail;
1372
1373         /* Stunning makes spells harder */
1374         if (p_ptr->stun > 50) chance += 25;
1375         else if (p_ptr->stun) chance += 15;
1376
1377         /* Always a 5 percent chance of working */
1378         if (chance > 95) chance = 95;
1379
1380         /* Failed spell */
1381         if (randint0(100) < chance)
1382         {
1383                 if (flush_failure) flush();
1384 #ifdef JP
1385 msg_print("¤â¤Î¤Þ¤Í¤Ë¼ºÇÔ¤·¤¿¡ª");
1386 #else
1387                 msg_print("You failed to concentrate hard enough!");
1388 #endif
1389
1390                 sound(SOUND_FAIL);
1391         }
1392         else
1393         {
1394                 sound(SOUND_ZAP);
1395
1396                 /* Cast the spell */
1397                 cast = use_mane(p_ptr->mane_spell[n]);
1398
1399                 if (!cast) return FALSE;
1400         }
1401
1402         p_ptr->mane_num--;
1403         for (j = n; j < p_ptr->mane_num;j++)
1404         {
1405                 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1406                 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1407         }
1408
1409         /* Take a turn */
1410         energy_use = 100;
1411
1412         /* Window stuff */
1413         p_ptr->redraw |= (PR_MANE);
1414         p_ptr->window |= (PW_PLAYER);
1415         p_ptr->window |= (PW_SPELL);
1416
1417         return TRUE;
1418 }