OSDN Git Service

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