OSDN Git Service

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