OSDN Git Service

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