OSDN Git Service

mon_scatter()、ヒr_idx、ソ、ィ、ニ。「ソシ、、ソ螟ホセ螟ヒ、イ、ハ、、・筵ケ・ソ。シ、ホセ、エュク菘マ、ネ、キ、ニチェ、ヌ、キ、゙、ヲ...
[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                 char m_name[80];
315
316                 if (!target_set(TARGET_KILL)) return FALSE;
317                 if (!cave[target_row][target_col].m_idx) break;
318                 if (!los(py, px, target_row, target_col)) break;
319                 m_ptr = &m_list[cave[target_row][target_col].m_idx];
320                 monster_desc(m_name, m_ptr, 0);
321                 if (m_ptr->invulner)
322                 {
323                         m_ptr->invulner = 0;
324 #ifdef JP
325 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
326 #else
327                         msg_format("%^s is no longer invulnerable.", m_name);
328 #endif
329                         m_ptr->energy_need += ENERGY_NEED();
330                 }
331                 if (m_ptr->fast)
332                 {
333                         m_ptr->fast = 0;
334 #ifdef JP
335 msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
336 #else
337                         msg_format("%^s is no longer fast.", m_name);
338 #endif
339                 }
340                 if (m_ptr->slow)
341                 {
342                         m_ptr->slow = 0;
343 #ifdef JP
344 msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
345 #else
346                         msg_format("%^s is no longer slow.", m_name);
347 #endif
348                 }
349                 p_ptr->redraw |= (PR_HEALTH);
350                 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_HEALTH);
351
352                 break;
353         }
354         case MS_ROCKET:
355                 if (!get_aim_dir(&dir)) return FALSE;
356 #ifdef JP
357 else msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
358 #else
359                         else msg_print("You fire a rocket.");
360 #endif
361                 
362                         fire_rocket(GF_ROCKET, dir, damage, 2);
363                 break;
364         case MS_SHOOT:
365                 if (!get_aim_dir(&dir)) return FALSE;
366 #ifdef JP
367 else msg_print("Ìð¤òÊü¤Ã¤¿¡£");
368 #else
369                         else msg_print("You fire an arrow.");
370 #endif
371                 
372                         fire_bolt(GF_ARROW, dir, damage);
373                 break;
374         case MS_XXX2:
375                 break;
376         case MS_XXX3:
377                 break;
378         case MS_XXX4:
379                 break;
380         case MS_BR_ACID:
381                 if (!get_aim_dir(&dir)) return FALSE;
382 #ifdef JP
383 else msg_print("»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
384 #else
385                         else msg_print("You breathe acid.");
386 #endif
387                 
388                         fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2));
389                 break;
390         case MS_BR_ELEC:
391                 if (!get_aim_dir(&dir)) return FALSE;
392 #ifdef JP
393 else msg_print("°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
394 #else
395                         else msg_print("You breathe lightning.");
396 #endif
397                 
398                         fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2));
399                 break;
400         case MS_BR_FIRE:
401                 if (!get_aim_dir(&dir)) return FALSE;
402 #ifdef JP
403 else msg_print("²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
404 #else
405                         else msg_print("You breathe fire.");
406 #endif
407                 
408                         fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2));
409                 break;
410         case MS_BR_COLD:
411                 if (!get_aim_dir(&dir)) return FALSE;
412 #ifdef JP
413 else msg_print("Î䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
414 #else
415                         else msg_print("You breathe frost.");
416 #endif
417                 
418                         fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2));
419                 break;
420         case MS_BR_POIS:
421                 if (!get_aim_dir(&dir)) return FALSE;
422 #ifdef JP
423 else msg_print("¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
424 #else
425                         else msg_print("You breathe gas.");
426 #endif
427                 
428                         fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2));
429                 break;
430         case MS_BR_NETHER:
431                 if (!get_aim_dir(&dir)) return FALSE;
432 #ifdef JP
433 else msg_print("ÃϹö¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
434 #else
435                         else msg_print("You breathe nether.");
436 #endif
437                 
438                         fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2));
439                 break;
440         case MS_BR_LITE:
441                 if (!get_aim_dir(&dir)) return FALSE;
442 #ifdef JP
443 else msg_print("Á®¸÷¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
444 #else
445                         else msg_print("You breathe light.");
446 #endif
447                 
448                         fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2));
449                 break;
450         case MS_BR_DARK:
451                 if (!get_aim_dir(&dir)) return FALSE;
452 #ifdef JP
453 else msg_print("°Å¹õ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
454 #else
455                         else msg_print("You breathe darkness.");
456 #endif
457                 
458                         fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2));
459                 break;
460         case MS_BR_CONF:
461                 if (!get_aim_dir(&dir)) return FALSE;
462 #ifdef JP
463 else msg_print("º®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
464 #else
465                         else msg_print("You breathe confusion.");
466 #endif
467                 
468                         fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2));
469                 break;
470         case MS_BR_SOUND:
471                 if (!get_aim_dir(&dir)) return FALSE;
472 #ifdef JP
473 else msg_print("¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
474 #else
475                         else msg_print("You breathe sound.");
476 #endif
477                 
478                         fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2));
479                 break;
480         case MS_BR_CHAOS:
481                 if (!get_aim_dir(&dir)) return FALSE;
482 #ifdef JP
483 else msg_print("¥«¥ª¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
484 #else
485                         else msg_print("You breathe chaos.");
486 #endif
487                 
488                         fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2));
489                 break;
490         case MS_BR_DISEN:
491                 if (!get_aim_dir(&dir)) return FALSE;
492 #ifdef JP
493 else msg_print("Îô²½¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
494 #else
495                         else msg_print("You breathe disenchantment.");
496 #endif
497                 
498                         fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2));
499                 break;
500         case MS_BR_NEXUS:
501                 if (!get_aim_dir(&dir)) return FALSE;
502 #ifdef JP
503 else msg_print("°ø²Ìº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
504 #else
505                         else msg_print("You breathe nexus.");
506 #endif
507                 
508                         fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2));
509                 break;
510         case MS_BR_TIME:
511                 if (!get_aim_dir(&dir)) return FALSE;
512 #ifdef JP
513 else msg_print("»þ´ÖµÕž¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
514 #else
515                         else msg_print("You breathe time.");
516 #endif
517                 
518                         fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2));
519                 break;
520         case MS_BR_INERTIA:
521                 if (!get_aim_dir(&dir)) return FALSE;
522 #ifdef JP
523 else msg_print("ÃÙÆߤΥ֥쥹¤òÅǤ¤¤¿¡£");
524 #else
525                         else msg_print("You breathe inertia.");
526 #endif
527                 
528                         fire_ball(GF_INERTIA, dir, damage, (plev > 35 ? -3 : -2));
529                 break;
530         case MS_BR_GRAVITY:
531                 if (!get_aim_dir(&dir)) return FALSE;
532 #ifdef JP
533 else msg_print("½ÅÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
534 #else
535                         else msg_print("You breathe gravity.");
536 #endif
537                 
538                         fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2));
539                 break;
540         case MS_BR_SHARDS:
541                 if (!get_aim_dir(&dir)) return FALSE;
542 #ifdef JP
543 else msg_print("ÇËÊҤΥ֥쥹¤òÅǤ¤¤¿¡£");
544 #else
545                         else msg_print("You breathe shards.");
546 #endif
547                 
548                         fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2));
549                 break;
550         case MS_BR_PLASMA:
551                 if (!get_aim_dir(&dir)) return FALSE;
552 #ifdef JP
553 else msg_print("¥×¥é¥º¥Þ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
554 #else
555                         else msg_print("You breathe plasma.");
556 #endif
557                 
558                         fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2));
559                 break;
560         case MS_BR_FORCE:
561                 if (!get_aim_dir(&dir)) return FALSE;
562 #ifdef JP
563 else msg_print("¥Õ¥©¡¼¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
564 #else
565                         else msg_print("You breathe force.");
566 #endif
567                 
568                         fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2));
569                 break;
570         case MS_BR_MANA:
571                 if (!get_aim_dir(&dir)) return FALSE;
572 #ifdef JP
573 else msg_print("ËâÎϤΥ֥쥹¤òÅǤ¤¤¿¡£");
574 #else
575                         else msg_print("You breathe mana.");
576 #endif
577                 
578                         fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2));
579                 break;
580         case MS_BALL_NUKE:
581                 if (!get_aim_dir(&dir)) return FALSE;
582 #ifdef JP
583 else msg_print("Êü¼Íǽµå¤òÊü¤Ã¤¿¡£");
584 #else
585                         else msg_print("You cast a ball of radiation.");
586 #endif
587                 
588                         fire_ball(GF_NUKE, dir, damage, 2);
589                 break;
590         case MS_BR_NUKE:
591                 if (!get_aim_dir(&dir)) return FALSE;
592 #ifdef JP
593 else msg_print("Êü¼ÍÀ­ÇÑ´þʪ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
594 #else
595                         else msg_print("You breathe toxic waste.");
596 #endif
597                 
598                         fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2));
599                 break;
600         case MS_BALL_CHAOS:
601                 if (!get_aim_dir(&dir)) return FALSE;
602 #ifdef JP
603 else msg_print("½ã¥í¥°¥ë¥¹¤òÊü¤Ã¤¿¡£");
604 #else
605                         else msg_print("You invoke a raw Logrus.");
606 #endif
607                 
608                         fire_ball(GF_CHAOS, dir, damage, 4);
609                 break;
610         case MS_BR_DISI:
611                 if (!get_aim_dir(&dir)) return FALSE;
612 #ifdef JP
613 else msg_print("ʬ²ò¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
614 #else
615                         else msg_print("You breathe disintegration.");
616 #endif
617                 
618                         fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2));
619                 break;
620         case MS_BALL_ACID:
621                 if (!get_aim_dir(&dir)) return FALSE;
622 #ifdef JP
623 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
624 #else
625                         else msg_print("You cast an acid ball.");
626 #endif
627                 
628                         fire_ball(GF_ACID, dir, damage, 2);
629                 break;
630         case MS_BALL_ELEC:
631                 if (!get_aim_dir(&dir)) return FALSE;
632 #ifdef JP
633 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
634 #else
635                         else msg_print("You cast a lightning ball.");
636 #endif
637                 
638                         fire_ball(GF_ELEC, dir, damage, 2);
639                 break;
640         case MS_BALL_FIRE:
641                 if (!get_aim_dir(&dir)) return FALSE;
642 #ifdef JP
643 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
644 #else
645                         else msg_print("You cast a fire ball.");
646 #endif
647                 
648                         fire_ball(GF_FIRE, dir, damage, 2);
649                 break;
650         case MS_BALL_COLD:
651                 if (!get_aim_dir(&dir)) return FALSE;
652 #ifdef JP
653 else msg_print("¥¢¥¤¥¹¡¦¥Ü¡¼¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
654 #else
655                         else msg_print("You cast a frost ball.");
656 #endif
657                 
658                         fire_ball(GF_COLD, dir, damage, 2);
659                 break;
660         case MS_BALL_POIS:
661                 if (!get_aim_dir(&dir)) return FALSE;
662 #ifdef JP
663 else msg_print("°­½­±À¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
664 #else
665                         else msg_print("You cast a stinking cloud.");
666 #endif
667                 
668                         fire_ball(GF_POIS, dir, damage, 2);
669                 break;
670         case MS_BALL_NETHER:
671                 if (!get_aim_dir(&dir)) return FALSE;
672 #ifdef JP
673 else msg_print("ÃϹöµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
674 #else
675                         else msg_print("You cast a nether ball.");
676 #endif
677                 
678                         fire_ball(GF_NETHER, dir, damage, 2);
679                 break;
680         case MS_BALL_WATER:
681                 if (!get_aim_dir(&dir)) return FALSE;
682 #ifdef JP
683 else msg_print("ή¤ì¤ë¤è¤¦¤Ê¿È¿¶¤ê¤ò¤·¤¿¡£");
684 #else
685                         else msg_print("You gesture fluidly.");
686 #endif
687                 
688                         fire_ball(GF_WATER, dir, damage, 4);
689                 break;
690         case MS_BALL_MANA:
691                 if (!get_aim_dir(&dir)) return FALSE;
692 #ifdef JP
693 else msg_print("ËâÎϤÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
694 #else
695                         else msg_print("You invoke a mana storm.");
696 #endif
697                 
698                         fire_ball(GF_MANA, dir, damage, 4);
699                 break;
700         case MS_BALL_DARK:
701                 if (!get_aim_dir(&dir)) return FALSE;
702 #ifdef JP
703 else msg_print("°Å¹õ¤ÎÍò¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
704 #else
705                         else msg_print("You invoke a darkness storm.");
706 #endif
707                 
708                         fire_ball(GF_DARK, dir, damage, 4);
709                 break;
710         case MS_DRAIN_MANA:
711                 if (!get_aim_dir(&dir)) return FALSE;
712                 fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
713                 break;
714         case MS_MIND_BLAST:
715                 if (!get_aim_dir(&dir)) return FALSE;
716                 fire_ball_hide(GF_MIND_BLAST, dir, damage, 0);
717                 break;
718         case MS_BRAIN_SMASH:
719                 if (!get_aim_dir(&dir)) return FALSE;
720                 fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0);
721                 break;
722         case MS_CAUSE_1:
723                 if (!get_aim_dir(&dir)) return FALSE;
724                 fire_ball_hide(GF_CAUSE_1, dir, damage, 0);
725                 break;
726         case MS_CAUSE_2:
727                 if (!get_aim_dir(&dir)) return FALSE;
728                 fire_ball_hide(GF_CAUSE_2, dir, damage, 0);
729                 break;
730         case MS_CAUSE_3:
731                 if (!get_aim_dir(&dir)) return FALSE;
732                 fire_ball_hide(GF_CAUSE_3, dir, damage, 0);
733                 break;
734         case MS_CAUSE_4:
735                 if (!get_aim_dir(&dir)) return FALSE;
736                 fire_ball_hide(GF_CAUSE_4, dir, damage, 0);
737                 break;
738         case MS_BOLT_ACID:
739                 if (!get_aim_dir(&dir)) return FALSE;
740 #ifdef JP
741 else msg_print("¥¢¥·¥Ã¥É¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
742 #else
743                         else msg_print("You cast an acid bolt.");
744 #endif
745                 
746                         fire_bolt(GF_ACID, dir, damage);
747                 break;
748         case MS_BOLT_ELEC:
749                 if (!get_aim_dir(&dir)) return FALSE;
750 #ifdef JP
751 else msg_print("¥µ¥ó¥À¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
752 #else
753                         else msg_print("You cast a lightning bolt.");
754 #endif
755                 
756                         fire_bolt(GF_ELEC, dir, damage);
757                 break;
758         case MS_BOLT_FIRE:
759                 if (!get_aim_dir(&dir)) return FALSE;
760 #ifdef JP
761 else msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
762 #else
763                         else msg_print("You cast a fire bolt.");
764 #endif
765                 
766                         fire_bolt(GF_FIRE, dir, damage);
767                 break;
768         case MS_BOLT_COLD:
769                 if (!get_aim_dir(&dir)) return FALSE;
770 #ifdef JP
771 else msg_print("¥¢¥¤¥¹¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
772 #else
773                         else msg_print("You cast a frost bolt.");
774 #endif
775                 
776                         fire_bolt(GF_COLD, dir, damage);
777                 break;
778         case MS_STARBURST:
779                 if (!get_aim_dir(&dir)) return FALSE;
780 #ifdef JP
781 else msg_print("¥¹¥¿¡¼¥Ð¡¼¥¹¥È¤Î¼öʸ¤òÇ°¤¸¤¿¡£");
782 #else
783                         else msg_print("You invoke a starburst.");
784 #endif
785                 
786                         fire_ball(GF_LITE, dir, damage, 4);
787                 break;
788         case MS_BOLT_NETHER:
789                 if (!get_aim_dir(&dir)) return FALSE;
790 #ifdef JP
791 else msg_print("ÃϹö¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
792 #else
793                         else msg_print("You cast a nether bolt.");
794 #endif
795                 
796                         fire_bolt(GF_NETHER, dir, damage);
797                 break;
798         case MS_BOLT_WATER:
799                 if (!get_aim_dir(&dir)) return FALSE;
800 #ifdef JP
801 else msg_print("¥¦¥©¡¼¥¿¡¼¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
802 #else
803                         else msg_print("You cast a water bolt.");
804 #endif
805                 
806                         fire_bolt(GF_WATER, dir, damage);
807                 break;
808         case MS_BOLT_MANA:
809                 if (!get_aim_dir(&dir)) return FALSE;
810 #ifdef JP
811 else msg_print("ËâÎϤÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
812 #else
813                         else msg_print("You cast a mana bolt.");
814 #endif
815                 
816                         fire_bolt(GF_MANA, dir, damage);
817                 break;
818         case MS_BOLT_PLASMA:
819                 if (!get_aim_dir(&dir)) return FALSE;
820 #ifdef JP
821 else msg_print("¥×¥é¥º¥Þ¡¦¥Ü¥ë¥È¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
822 #else
823                         else msg_print("You cast a plasma bolt.");
824 #endif
825                 
826                         fire_bolt(GF_PLASMA, dir, damage);
827                 break;
828         case MS_BOLT_ICE:
829                 if (!get_aim_dir(&dir)) return FALSE;
830 #ifdef JP
831 else msg_print("¶Ë´¨¤ÎÌð¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
832 #else
833                         else msg_print("You cast a ice bolt.");
834 #endif
835                 
836                         fire_bolt(GF_ICE, dir, damage);
837                 break;
838         case MS_MAGIC_MISSILE:
839                 if (!get_aim_dir(&dir)) return FALSE;
840 #ifdef JP
841 else msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
842 #else
843                         else msg_print("You cast a magic missile.");
844 #endif
845                 
846                         fire_bolt(GF_MISSILE, dir, damage);
847                 break;
848         case MS_SCARE:
849                 if (!get_aim_dir(&dir)) return FALSE;
850 #ifdef JP
851 else msg_print("¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£");
852 #else
853                         else msg_print("You cast a fearful illusion.");
854 #endif
855                 
856                         fear_monster(dir, plev+10);
857                 break;
858         case MS_BLIND:
859                 if (!get_aim_dir(&dir)) return FALSE;
860                 confuse_monster(dir, plev * 2);
861                 break;
862         case MS_CONF:
863                 if (!get_aim_dir(&dir)) return FALSE;
864 #ifdef JP
865 else msg_print("ͶÏÇŪ¤Ê¸¸³Ð¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£");
866 #else
867                         else msg_print("You cast a mesmerizing illusion.");
868 #endif
869                 
870                         confuse_monster(dir, plev * 2);
871                 break;
872         case MS_SLOW:
873                 if (!get_aim_dir(&dir)) return FALSE;
874                 slow_monster(dir);
875                 break;
876         case MS_SLEEP:
877                 if (!get_aim_dir(&dir)) return FALSE;
878                 sleep_monster(dir);
879                 break;
880         case MS_SPEED:
881                 (void)set_fast(randint1(20 + plev) + plev, FALSE);
882                 break;
883         case MS_HAND_DOOM:
884         {
885                 if (!get_aim_dir(&dir)) return FALSE;
886 #ifdef JP
887 else msg_print("<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª");
888 #else
889                 else msg_print("You invoke the Hand of Doom!");
890 #endif
891
892                 fire_ball_hide(GF_HAND_DOOM, dir, 200, 0);
893                 break;
894         }
895         case MS_HEAL:
896 #ifdef JP
897 msg_print("¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£");
898 #else
899                         msg_print("You concentrate on your wounds!");
900 #endif
901                 (void)hp_player(plev*6);
902                 (void)set_stun(0);
903                 (void)set_cut(0);
904                 break;
905         case MS_INVULNER:
906 #ifdef JP
907 msg_print("̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
908 #else
909                         msg_print("You cast a Globe of Invulnerability.");
910 #endif
911                 (void)set_invuln(randint1(7) + 7, FALSE);
912                 break;
913         case MS_BLINK:
914                 teleport_player(10);
915                 break;
916         case MS_TELEPORT:
917                 teleport_player(plev * 5);
918                 break;
919         case MS_WORLD:
920                 world_player = TRUE;
921                 if (damage == 1 || damage == 2)
922 #ifdef JP
923                         msg_print("¡Ö¡Ø¥¶¡¦¥ï¡¼¥ë¥É¡Ù¡ª»þ¤Ï»ß¤Þ¤Ã¤¿¡ª¡×");
924 #else
925                         msg_print("You yell 'The World! Time has stopped!'");
926 #endif
927                 else if (damage == 3 || damage == 6)
928 #ifdef JP
929                         msg_print("¡Ö»þ¤è¡ª¡×");
930 #else
931                         msg_print("You yell 'Time!'");
932 #endif
933                 else
934                         msg_print("hek!");
935                 msg_print(NULL);
936
937                 /* Hack */
938                 p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
939
940                 /* Redraw map */
941                 p_ptr->redraw |= (PR_MAP);
942
943                 /* Update monsters */
944                 p_ptr->update |= (PU_MONSTERS);
945
946                 /* Window stuff */
947                 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
948
949                 handle_stuff();
950                 break;
951         case MS_SPECIAL:
952                 break;
953         case MS_TELE_TO:
954         {
955                 monster_type *m_ptr;
956                 monster_race *r_ptr;
957                 char m_name[80];
958
959                 if (!target_set(TARGET_KILL)) return FALSE;
960                 if (!cave[target_row][target_col].m_idx) break;
961                 if (!player_has_los_bold(target_row, target_col)) break;
962                 m_ptr = &m_list[cave[target_row][target_col].m_idx];
963                 r_ptr = &r_info[m_ptr->r_idx];
964                 monster_desc(m_name, m_ptr, 0);
965                 if (r_ptr->flagsr & RFR_RES_TELE)
966                 {
967                         if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
968                         {
969                                 if (is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
970 #ifdef JP
971                                 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª", m_name);
972 #else
973                                 msg_format("%s is unaffected!", m_name);
974 #endif
975
976                                 break;
977                         }
978                         else if (r_ptr->level > randint1(100))
979                         {
980                                 if (is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
981 #ifdef JP
982                                 msg_format("%s¤Ë¤ÏÂÑÀ­¤¬¤¢¤ë¡ª", m_name);
983 #else
984                                 msg_format("%s resists!", m_name);
985 #endif
986
987                                 break;
988                         }
989                 }
990 #ifdef JP
991 msg_format("%s¤ò°ú¤­Ìᤷ¤¿¡£", m_name);
992 #else
993                 msg_format("You command %s to return.", m_name);
994 #endif
995
996                 teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100);
997                 break;
998         }
999         case MS_TELE_AWAY:
1000                 if (!get_aim_dir(&dir)) return FALSE;
1001
1002                 (void)fire_beam(GF_AWAY_ALL, dir, plev);
1003                 break;
1004         case MS_TELE_LEVEL:
1005         {
1006                 int target_m_idx;
1007                 monster_type *m_ptr;
1008                 monster_race *r_ptr;
1009                 char m_name[80];
1010
1011                 if (!target_set(TARGET_KILL)) return FALSE;
1012                 target_m_idx = cave[target_row][target_col].m_idx;
1013                 if (!target_m_idx) break;
1014                 if (!los(py, px, target_row, target_col)) break;
1015                 m_ptr = &m_list[target_m_idx];
1016                 r_ptr = &r_info[m_ptr->r_idx];
1017                 monster_desc(m_name, m_ptr, 0);
1018 #ifdef JP
1019                 msg_format("%^s¤Î­¤ò»Ø¤µ¤·¤¿¡£", m_name);
1020 #else
1021                 msg_format("You gesture at %^s's feet.", m_name);
1022 #endif
1023
1024                 if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
1025                         (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
1026                 {
1027 #ifdef JP
1028                         msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1029 #else
1030                         msg_format("%^s is unaffected!", m_name);
1031 #endif
1032                 }
1033                 else teleport_level(target_m_idx);
1034                 break;
1035         }
1036         case MS_PSY_SPEAR:
1037                 if (!get_aim_dir(&dir)) return FALSE;
1038
1039 #ifdef JP
1040 else msg_print("¸÷¤Î·õ¤òÊü¤Ã¤¿¡£");
1041 #else
1042                         else msg_print("You throw a psycho-spear.");
1043 #endif
1044                 (void)fire_beam(GF_PSY_SPEAR, dir, damage);
1045                 break;
1046         case MS_DARKNESS:
1047 #ifdef JP
1048 msg_print("°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£");
1049 #else
1050                         msg_print("You gesture in shadow.");
1051 #endif
1052                 (void)unlite_area(10, 3);
1053                 break;
1054         case MS_MAKE_TRAP:
1055                 if (!target_set(TARGET_KILL)) return FALSE;
1056 #ifdef JP
1057 msg_print("¼öʸ¤ò¾§¤¨¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£");
1058 #else
1059                         msg_print("You cast a spell and cackles evilly.");
1060 #endif
1061                 trap_creation(target_row, target_col);
1062                 break;
1063         case MS_FORGET:
1064 #ifdef JP
1065 msg_print("¤·¤«¤·²¿¤âµ¯¤­¤Ê¤«¤Ã¤¿¡£");
1066 #else
1067                         msg_print("Nothing happen.");
1068 #endif
1069                 break;
1070         case MS_RAISE_DEAD:
1071 #ifdef JP
1072 msg_print("»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£");
1073 #else
1074                 msg_print("You cast a animate dead.");
1075 #endif
1076                 (void)animate_dead(0, py, px);
1077                 break;
1078         case MS_S_KIN:
1079         {
1080                 int k;
1081                 if (!target_set(TARGET_KILL)) return FALSE;
1082
1083 #ifdef JP
1084 msg_print("±ç·³¤ò¾¤´­¤·¤¿¡£");
1085 #else
1086                         msg_print("You summon minions.");
1087 #endif
1088                 for (k = 0;k < 4; k++)
1089                 {
1090                         (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
1091                 }
1092                 break;
1093         }
1094         case MS_S_CYBER:
1095         {
1096                 int k;
1097                 int max_cyber = (dun_level / 50) + randint1(3);
1098                 if (!target_set(TARGET_KILL)) return FALSE;
1099 #ifdef JP
1100 msg_print("¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´­¤·¤¿¡ª");
1101 #else
1102                         msg_print("You summon Cyberdemons!");
1103 #endif
1104                 if (max_cyber > 4) max_cyber = 4;
1105                 for (k = 0;k < max_cyber; k++)
1106                         summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
1107                 break;
1108         }
1109         case MS_S_MONSTER:
1110         {
1111                 int k;
1112                 if (!target_set(TARGET_KILL)) return FALSE;
1113 #ifdef JP
1114 msg_print("Ãç´Ö¤ò¾¤´­¤·¤¿¡£");
1115 #else
1116                         msg_print("You summon help.");
1117 #endif
1118                 for (k = 0;k < 1; k++)
1119                         summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1120                 break;
1121         }
1122         case MS_S_MONSTERS:
1123         {
1124                 int k;
1125                 if (!target_set(TARGET_KILL)) return FALSE;
1126 #ifdef JP
1127 msg_print("¥â¥ó¥¹¥¿¡¼¤ò¾¤´­¤·¤¿¡ª");
1128 #else
1129                         msg_print("You summon monsters!");
1130 #endif
1131                 for (k = 0;k < 6; k++)
1132                         summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
1133                 break;
1134         }
1135         case MS_S_ANT:
1136         {
1137                 int k;
1138                 if (!target_set(TARGET_KILL)) return FALSE;
1139 #ifdef JP
1140 msg_print("¥¢¥ê¤ò¾¤´­¤·¤¿¡£");
1141 #else
1142                         msg_print("You summon ants.");
1143 #endif
1144                 for (k = 0;k < 6; k++)
1145                         summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
1146                 break;
1147         }
1148         case MS_S_SPIDER:
1149         {
1150                 int k;
1151                 if (!target_set(TARGET_KILL)) return FALSE;
1152 #ifdef JP
1153 msg_print("ÃØéá¤ò¾¤´­¤·¤¿¡£");
1154 #else
1155                         msg_print("You summon spiders.");
1156 #endif
1157                 for (k = 0;k < 6; k++)
1158                         summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
1159                 break;
1160         }
1161         case MS_S_HOUND:
1162         {
1163                 int k;
1164                 if (!target_set(TARGET_KILL)) return FALSE;
1165 #ifdef JP
1166 msg_print("¥Ï¥¦¥ó¥É¤ò¾¤´­¤·¤¿¡£");
1167 #else
1168                         msg_print("You summon hounds.");
1169 #endif
1170                 for (k = 0;k < 4; k++)
1171                         summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
1172                 break;
1173         }
1174         case MS_S_HYDRA:
1175         {
1176                 int k;
1177                 if (!target_set(TARGET_KILL)) return FALSE;
1178 #ifdef JP
1179 msg_print("¥Ò¥É¥é¤ò¾¤´­¤·¤¿¡£");
1180 #else
1181                         msg_print("You summon hydras.");
1182 #endif
1183                 for (k = 0;k < 4; k++)
1184                         summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
1185                 break;
1186         }
1187         case MS_S_ANGEL:
1188         {
1189                 int k;
1190                 if (!target_set(TARGET_KILL)) return FALSE;
1191 #ifdef JP
1192 msg_print("Å·»È¤ò¾¤´­¤·¤¿¡ª");
1193 #else
1194                         msg_print("You summon angel!");
1195 #endif
1196                 for (k = 0;k < 1; k++)
1197                         summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
1198                 break;
1199         }
1200         case MS_S_DEMON:
1201         {
1202                 int k;
1203                 if (!target_set(TARGET_KILL)) return FALSE;
1204 #ifdef JP
1205 msg_print("º®Æ٤εÜÄ¤é°­Ëâ¤ò¾¤´­¤·¤¿¡ª");
1206 #else
1207                         msg_print("You summon a demon from the Courts of Chaos!");
1208 #endif
1209                 for (k = 0;k < 1; k++)
1210                         summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
1211                 break;
1212         }
1213         case MS_S_UNDEAD:
1214         {
1215                 int k;
1216                 if (!target_set(TARGET_KILL)) return FALSE;
1217 #ifdef JP
1218 msg_print("¥¢¥ó¥Ç¥Ã¥É¤Î¶¯Å¨¤ò¾¤´­¤·¤¿¡ª");
1219 #else
1220                         msg_print("You summon an undead adversary!");
1221 #endif
1222                 for (k = 0;k < 1; k++)
1223                         summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
1224                 break;
1225         }
1226         case MS_S_DRAGON:
1227         {
1228                 int k;
1229                 if (!target_set(TARGET_KILL)) return FALSE;
1230 #ifdef JP
1231 msg_print("¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª");
1232 #else
1233                         msg_print("You summon dragon!");
1234 #endif
1235                 for (k = 0;k < 1; k++)
1236                         summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
1237                 break;
1238         }
1239         case MS_S_HI_UNDEAD:
1240         {
1241                 int k;
1242                 if (!target_set(TARGET_KILL)) return FALSE;
1243 #ifdef JP
1244 msg_print("¶¯ÎϤʥ¢¥ó¥Ç¥Ã¥É¤ò¾¤´­¤·¤¿¡ª");
1245 #else
1246                         msg_print("You summon greater undead!");
1247 #endif
1248                 for (k = 0;k < 6; k++)
1249                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1250                 break;
1251         }
1252         case MS_S_HI_DRAGON:
1253         {
1254                 int k;
1255                 if (!target_set(TARGET_KILL)) return FALSE;
1256 #ifdef JP
1257 msg_print("¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´­¤·¤¿¡ª");
1258 #else
1259                         msg_print("You summon ancient dragons!");
1260 #endif
1261                 for (k = 0;k < 4; k++)
1262                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
1263                 break;
1264         }
1265         case MS_S_AMBERITE:
1266         {
1267                 int k;
1268                 if (!target_set(TARGET_KILL)) return FALSE;
1269 #ifdef JP
1270 msg_print("¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´­¤·¤¿¡ª");
1271 #else
1272                         msg_print("You summon Lords of Amber!");
1273 #endif
1274                 for (k = 0;k < 4; k++)
1275                         summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
1276                 break;
1277         }
1278         case MS_S_UNIQUE:
1279         {
1280                 int k, count = 0;
1281                 if (!target_set(TARGET_KILL)) return FALSE;
1282 #ifdef JP
1283 msg_print("ÆÃÊ̤ʶ¯Å¨¤ò¾¤´­¤·¤¿¡ª");
1284 #else
1285                         msg_print("You summon special opponents!");
1286 #endif
1287                 for (k = 0;k < 4; k++)
1288                         if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
1289                 for (k = count;k < 4; k++)
1290                         summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
1291                 break;
1292         }
1293         default:
1294                 msg_print("hoge?");
1295         }
1296
1297         return TRUE;
1298 }
1299
1300
1301 /*
1302  * do_cmd_cast calls this function if the player's class
1303  * is 'imitator'.
1304  */
1305 bool do_cmd_mane(bool baigaesi)
1306 {
1307         int             n = 0, j;
1308         int             chance;
1309         int             minfail = 0;
1310         int             plev = p_ptr->lev;
1311         monster_power   spell;
1312         bool            cast;
1313
1314
1315         /* not if confused */
1316         if (p_ptr->confused)
1317         {
1318 #ifdef JP
1319 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤­¤Ê¤¤¡ª");
1320 #else
1321                 msg_print("You are too confused!");
1322 #endif
1323
1324                 return TRUE;
1325         }
1326
1327         if (!p_ptr->mane_num)
1328         {
1329 #ifdef JP
1330 msg_print("¤Þ¤Í¤é¤ì¤ë¤â¤Î¤¬²¿¤â¤Ê¤¤¡ª");
1331 #else
1332                 msg_print("You don't remember any action!");
1333 #endif
1334
1335                 return FALSE;
1336         }
1337
1338         /* get power */
1339         if (!get_mane_power(&n, baigaesi)) return FALSE;
1340
1341         spell = monster_powers[p_ptr->mane_spell[n]];
1342
1343         /* Spell failure chance */
1344         chance = spell.manefail;
1345
1346         /* Reduce failure rate by "effective" level adjustment */
1347         if (plev > spell.level) chance -= 3 * (plev - spell.level);
1348
1349         /* Reduce failure rate by 1 stat and DEX adjustment */
1350         chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
1351
1352         if (spell.manedam) chance = chance * damage / spell.manedam;
1353
1354         chance += p_ptr->to_m_chance;
1355
1356         /* Extract the minimum failure rate */
1357         minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
1358
1359         /* Minimum failure rate */
1360         if (chance < minfail) chance = minfail;
1361
1362         /* Stunning makes spells harder */
1363         if (p_ptr->stun > 50) chance += 25;
1364         else if (p_ptr->stun) chance += 15;
1365
1366         /* Always a 5 percent chance of working */
1367         if (chance > 95) chance = 95;
1368
1369         /* Failed spell */
1370         if (randint0(100) < chance)
1371         {
1372                 if (flush_failure) flush();
1373 #ifdef JP
1374 msg_print("¤â¤Î¤Þ¤Í¤Ë¼ºÇÔ¤·¤¿¡ª");
1375 #else
1376                 msg_print("You failed to concentrate hard enough!");
1377 #endif
1378
1379                 sound(SOUND_FAIL);
1380         }
1381         else
1382         {
1383                 sound(SOUND_ZAP);
1384
1385                 /* Cast the spell */
1386                 cast = use_mane(p_ptr->mane_spell[n]);
1387
1388                 if (!cast) return FALSE;
1389         }
1390
1391         p_ptr->mane_num--;
1392         for (j = n; j < p_ptr->mane_num;j++)
1393         {
1394                 p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
1395                 p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
1396         }
1397
1398         /* Take a turn */
1399         energy_use = 100;
1400
1401         /* Window stuff */
1402         p_ptr->redraw |= (PR_MANE);
1403         p_ptr->window |= (PW_PLAYER);
1404         p_ptr->window |= (PW_SPELL);
1405
1406         return TRUE;
1407 }