3 /* Purpose: Mindcrafter code */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 mind_power mind_powers[5] =
21 /* Level gained, cost, %fail, name */
24 { 2, 1, 20, "¿À·Ð¹¶·â"},
25 { 3, 2, 25, "¼¡¸µ¤Î½Ö¤"},
26 { 7, 6, 35, "µõ¶õ¤Î¸¸±Æ"},
27 { 9, 7, 50, "Àº¿À»ÙÇÛ"},
28 { 11, 7, 30, "Ç°Æ°¾×·âÃÆ"},
29 { 13, 12, 50, "³»²½"},
30 { 15, 12, 60, "¥µ¥¤¥³¥á¥È¥ê¡¼"},
31 { 18, 10, 45, "Àº¿ÀÇÈÆ°"},
32 { 23, 15, 50, "¥¢¥É¥ì¥Ê¥ê¥ó¡¦¥É¡¼¥Ô¥ó¥°"},
33 { 26, 28, 60, "¥Æ¥ì¥¥Í¥·¥¹"},
34 { 28, 10, 40, "¥µ¥¤¥¥Ã¥¯¡¦¥É¥ì¥¤¥ó"},
35 { 35, 35, 75, "¸÷¤Î·õ"},
36 { 45,150, 85, "´°Á´¤ÊÀ¤³¦"},
45 { 1, 1, 15, "Precognition"},
46 { 2, 1, 20, "Neural Blast"},
47 { 3, 2, 25, "Minor Displacement"},
48 { 7, 6, 35, "Major Displacement"},
49 { 9, 7, 50, "Domination"},
50 { 11, 7, 30, "Pulverise"},
51 { 13, 12, 50, "Character Armour"},
52 { 15, 12, 60, "Psychometry" },
53 { 18, 10, 45, "Mind Wave" },
54 { 23, 15, 50, "Adrenaline Channeling"},
55 { 26, 28, 60, "Telekinesis"},
56 { 28, 10, 40, "Psychic Drain"},
57 { 35, 35, 75, "Psycho-Spear"},
58 { 45,150, 85, "The World"},
73 /* Level gained, cost, %fail, name */
77 { 5, 6, 35, "Éñ¶õ½Ñ"},
78 { 8, 5, 40, "¥«¥á¥Ï¥áÇÈ"},
79 { 10, 7, 45, "ÂÐËâË¡Ëɸæ"},
81 { 17, 17, 50, "ŻƮµ¤"},
82 { 20, 20, 50, "¾×ÇÈ"},
83 { 23, 18, 55, "×Âζ"},
84 { 25, 30, 70, "¤¤¤Æ¤Ä¤¯ÇÈÆ°"},
85 { 28, 26, 50, "¸¸Î´"},
86 { 32, 35, 65, "Îû¹ö²Ð±ê"},
87 { 38, 42, 75, "Ķ¥«¥á¥Ï¥áÇÈ"},
88 { 44, 50, 80, "¸÷®°ÜÆ°"},
97 { 1, 1, 15, "Small Force Ball"},
98 { 3, 3, 30, "Flash Light"},
99 { 5, 6, 35, "Flying Technique"},
100 { 8, 5, 40, "Kamehameha"},
101 { 10, 7, 45, "Magic Resistance"},
102 { 13, 5, 60, "Improve Force"},
103 { 17, 17, 50, "Aura of Force"},
104 { 20, 20, 50, "Shock Power"},
105 { 23, 18, 55, "Large Force Ball"},
106 { 25, 30, 70, "Dispel Magic"},
107 { 28, 26, 50, "Summon Ghost"},
108 { 32, 35, 65, "Exploding Frame"},
109 { 38, 42, 75, "Super Kamehameha"},
110 { 44, 50, 80, "Light Speed"},
125 /* Level gained, cost, %fail, name */
127 { 8, 5, 40, "»¦µ¤´¶ÃÎ"},
128 { 15, 20, 0, "ÆÍ·â"},
129 { 20, 15, 0, "¥È¥é¥Ã¥×Ê´ºÕ"},
130 { 25, 20, 60, "ÃÏ¿Ì"},
131 { 30, 80, 75, "³§»¦¤·"},
149 { 8, 5, 40, "Detect Atmosphere of Menace"},
150 { 15, 20, 0, "Charge"},
151 { 20, 15, 0, "Smash a Trap"},
152 { 25, 20, 60, "Quake"},
153 { 30, 80, 75, "Massacre"},
177 /* Level gained, cost, %fail, name */
179 { 1, 1, 15, "¿¿¸«¤Î¶À"},
180 { 1, 2, 40, "¶ÀÀ¸À®"},
181 { 2, 2, 20, "¸÷¤Î¤·¤º¤¯"},
182 { 3, 2, 20, "ÏĤó¤À¶À"},
183 { 5, 3, 35, "Á®¸÷¶À"},
184 { 6, 5, 35, "×Ǥ¨¤ë¶À"},
186 { 10, 5, 30, "Èù¿Ð±£¤ì"},
187 { 12, 12, 30, "ÄÉÊü¤Î¶À"},
188 { 15, 15, 30, "¶ÀºÕ¤"},
189 { 19, 13, 30, "ºÅ̲¶À"},
190 { 23, 18, 50, "¥·¡¼¥«¡¼¥ì¥¤"},
192 { 25, 20, 40, "¶À¤ÎÉõ°õ"},
193 { 27, 30, 60, "¿å¶À¤Î½â"},
194 { 29, 30, 60, "¥¹¡¼¥Ñ¡¼¥ì¥¤"},
195 { 31, 35, 60, "¸¸ÏǤθ÷"},
196 { 33, 50, 80, "¶À¤Î¹ñ"},
198 { 36, 30, 80, "¶ÀÈ´¤±"},
199 { 38, 40, 70, "µ¢´Ô¤Î¶À"},
200 { 40, 50, 55, "±Æʬ¿È"},
201 { 43, 55, 70, "ÉõËâ·ë³¦"},
202 { 46, 70, 75, "¥é¥Õ¥Î¡¼¥ë¤Î¶À"},
204 { 1, 1, 15, "Mirror of Seeing"},
205 { 1, 2, 40, "Making a Mirror"},
206 { 2, 2, 20, "Drip of Light"},
207 { 3, 2, 20, "Warped Mirror"},
208 { 5, 3, 35, "Mirror of Light"},
209 { 6, 5, 35, "Mirror of Wandering"},
211 { 10, 5, 30, "Robe of Dust"},
212 { 12, 12, 30, "Banishing Mirror"},
213 { 15, 15, 30, "Mirror Clashing"},
214 { 19, 13, 30, "Mirror Sleeping"},
215 { 23, 18, 50, "Seeker Ray"},
217 { 25, 20, 40, "Seal of Mirror"},
218 { 27, 30, 60, "Shield of Water"},
219 { 29, 30, 60, "Super Ray"},
220 { 31, 35, 60, "Illusion Light"},
221 { 33, 50, 80, "Mirror Shift"},
223 { 36, 30, 80, "Mirror Tunnel"},
224 { 38, 40, 70, "Mirror of Recall"},
225 { 40, 50, 55, "Multi-Shadow"},
226 { 43, 55, 70, "Binding Field"},
227 { 46, 70, 75, "Mirror of Ruffnor"},
235 /* Level gained, cost, %fail, name */
237 { 1, 1, 20, "°Å°ÇÀ¸À®"},
238 { 2, 2, 25, "¼þÊÕÄ´ºº"},
239 { 3, 3, 25, "ÍÕ±£¤ì"},
240 { 5, 3, 30, "ÊѤï¤ê¿È"},
241 { 7, 8, 35, "¹âÈô¤Ó"},
242 { 8, 10, 35, "°ì·âΥæ"},
243 { 10, 10, 40, "¶âÇû¤ê"},
244 { 12, 12, 70, "¸Å¤Î¸ýÅÁ"},
245 { 15, 10, 50, "Éâ±À"},
246 { 17, 12, 45, "²ÐÆÛ"},
247 { 18, 20, 40, "Æþ¿È"},
248 { 20, 5, 50, "ȬÊý¼ê΢·õ"},
249 { 22, 15, 55, "º¿³ù"},
250 { 25, 32, 60, "±ì¶Ì"},
251 { 28, 32, 60, "ž¿È"},
252 { 30, 30, 70, "Çúȯ¤ÎÌæ¾Ï"},
253 { 32, 40, 40, "ÅÚÆÛ"},
254 { 34, 35, 50, "̸±£¤ì"},
255 { 38, 40, 60, "Îû¹ö²Ð±ê"},
256 { 41, 50, 55, "ʬ¿È"},
259 { 1, 1, 20, "Create Darkness"},
260 { 2, 2, 25, "Detect Near"},
261 { 3, 3, 25, "Hide in Leafs"},
262 { 5, 3, 30, "Kawarimi"},
263 { 7, 8, 35, "Absconding"},
264 { 8, 10, 35, "Hit and Away"},
265 { 10, 10, 40, "Bind Monster"},
266 { 12, 12, 70, "Ancient Knowledge"},
267 { 15, 10, 50, "Floating"},
268 { 17, 12, 45, "Hide in Flame"},
269 { 18, 20, 40, "Nyusin"},
270 { 20, 5, 50, "Syuriken Spreading"},
271 { 22, 15, 55, "Chain Hook"},
272 { 25, 32, 60, "Smoke Ball"},
273 { 28, 32, 60, "Swap Position"},
274 { 30, 30, 70, "Glyph of Explosion"},
275 { 32, 40, 40, "Hide in Mud"},
276 { 34, 35, 50, "Hide in Mist"},
277 { 38, 40, 60, "Rengoku-Kaen"},
278 { 41, 50, 55, "Bunshin"},
287 void mindcraft_info(char *p, int use_mind, int power)
290 cptr s_dam = "»½ý:";
291 cptr s_dur = "´ü´Ö:";
292 cptr s_range = "ÈÏ°Ï:";
296 cptr s_range = "range ";
298 int plev = p_ptr->lev;
304 case MIND_MINDCRAFTER:
308 case 1: sprintf(p, " %s%dd%d", s_dam, 3 + ((plev - 1) / 4), 3 + plev/15); break;
309 case 2: sprintf(p, " %s10", s_range); break;
310 case 3: sprintf(p, " %s%d", s_range, plev * 5); break;
312 case 5: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 4)); break;
313 case 6: sprintf(p, " %s%d", s_dur, plev); break;
315 case 8: sprintf(p, (plev < 25 ? " %s%d" : " %sd%d"), s_dam, (plev < 25 ? plev * 3 / 2 : plev * ((plev - 5) / 10 + 1))); break;
316 case 9: sprintf(p, " %s10+d%d", s_dur, plev * 3 / 2); break;
318 case 10: sprintf(p, " ºÇÂç½ÅÎÌ:%d.%dkg", lbtokg1(plev * 15),lbtokg2(plev * 15)); break;
320 case 10: sprintf(p, " max wgt %d", plev * 15); break;
322 case 11: sprintf(p, " %s%dd6", s_dam, plev / 2); break;
323 case 12: sprintf(p, " %sd%d+%d", s_dam, plev * 3, plev * 3); break;
325 case 13: sprintf(p, " ¹ÔÆ°:%d²ó", (p_ptr->csp + p_ptr->energy - 50)/100); break;
327 case 13: sprintf(p, " %d acts.", (p_ptr->csp + p_ptr->energy - 50)/100); break;
333 int boost = p_ptr->magic_num1[0];
335 if (heavy_armor()) boost /= 2;
339 case 0: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5) + boost / 12); break;
341 case 2: sprintf(p, " %s%d+d30", s_dur, 30 + boost / 5); break;
342 case 3: sprintf(p, " %s%dd5", s_dam, 5 + ((plev - 1) / 5) + boost / 10); break;
343 case 4: sprintf(p, " %s%d+d20", s_dur, 20 + boost / 5); break;
345 case 6: sprintf(p, " %s%d+d%d", s_dur, 15 + boost / 7, plev / 2); break;
346 case 7: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 5) + boost / 12); break;
347 case 8: sprintf(p, " %s10d6+%d", s_dam, plev * 3 / 2 + boost * 3 / 5); break;
350 case 10: sprintf(p, " ºÇÂç%dɤ", 1+boost/100); break;
352 case 10: sprintf(p, " max %d", 1+boost/100); break;
354 case 11: sprintf(p, " %s%d", s_dam, 100 + plev + boost); break;
355 case 12: sprintf(p, " %s%dd15", s_dam, 10 + plev / 2 + boost * 3 / 10); break;
357 case 13: sprintf(p, " ¹ÔÆ°:%d+d16²ó", 16+boost/20); break;
359 case 13: sprintf(p, " %d+d16 acts", 16+boost/20); break;
363 case MIND_MIRROR_MASTER:
369 case 2: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5) ); break;
370 case 3: sprintf(p, " %s10", s_range); break;
372 case 5: sprintf(p, " %s%d", s_range, plev *5); break;
373 case 6: sprintf(p, " %s20+d20", s_dur); break;
375 case 8: sprintf(p, " %s%dd8", s_dam, 8+((plev -5)/4) ); break;
377 case 10: sprintf(p, " %s%dd8", s_dam, 11+(plev-5)/4 ); break;
379 case 12: sprintf(p, " %s20+d20", s_dur); break;
380 case 13: sprintf(p, " %s150+d%d", s_dam, plev*2 ); break;
383 case 16: sprintf(p, " %s%d", s_range, plev/2 +10); break;
385 case 18: sprintf(p, " %s6+d6", s_dur); break;
386 case 19: sprintf(p, " %s%d", s_dam, plev*11+5 ); break;
387 case 20: sprintf(p, " %s4+d4", s_dur); break;
397 case 2: sprintf(p, " %s10", s_range); break;
399 case 4: sprintf(p, " %s%d", s_range , plev *5); break;
400 case 5: sprintf(p, " %s30", s_range); break;
403 case 8: sprintf(p, " %s20+d20", s_dur); break;
404 case 9: sprintf(p, " %s%d", s_dam, (50+plev)/2 ); break;
411 case 16: sprintf(p, " %s%d+d%d", s_dur, plev/2, plev/2); break;
412 case 17: sprintf(p, " %s%d*3", s_dam, (75+plev*2/3)/2 ); break;
413 case 18: sprintf(p, " %s%dd10", s_dam, 6+plev/8 ); break;
414 case 19: sprintf(p, " %s6+d6", s_dur); break;
423 * Allow user to choose a mindcrafter power.
425 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
426 * If the user hits escape, returns FALSE, and set '*sn' to -1
427 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
429 * The "prompt" should be "cast", "recite", or "study"
430 * The "known" should be TRUE for cast/pray, FALSE for study
432 * nb: This function has a (trivial) display bug which will be obvious
433 * when you run it. It's probably easy to fix but I haven't tried,
436 static int get_mind_power(int *sn, bool only_browse)
443 int plev = p_ptr->lev;
452 mind_power *mind_ptr;
455 int menu_line = (use_menu ? 1 : 0);
457 switch(p_ptr->pclass)
459 case CLASS_MINDCRAFTER:
461 use_mind = MIND_MINDCRAFTER;
469 case CLASS_FORCETRAINER:
479 case CLASS_BERSERKER:
481 use_mind = MIND_BERSERKER;
489 case CLASS_MIRROR_MASTER:
491 use_mind = MIND_MIRROR_MASTER;
501 use_mind = MIND_NINJUTSU;
520 mind_ptr = &mind_powers[use_mind];
522 /* Assume cancelled */
525 #ifdef ALLOW_REPEAT /* TNB */
527 /* Get the spell, if available */
530 /* Verify the spell */
531 if (mind_ptr->info[*sn].min_lev <= plev)
538 #endif /* ALLOW_REPEAT -- TNB */
540 /* Nothing chosen yet */
546 for (i = 0; i < MAX_MIND_POWERS; i++)
548 if (mind_ptr->info[i].min_lev <= plev)
554 /* Build a prompt (accept all spells) */
558 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤Ë¤Ä¤¤¤ÆÃΤê¤Þ¤¹¤«¡©",
560 (void) strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
562 p, I2A(0), I2A(num - 1), p);
567 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
569 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
571 p, I2A(0), I2A(num - 1), p);
574 if (use_menu && !only_browse) screen_save();
575 /* Get a spell from the user */
577 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
580 if(choice==ESCAPE) choice = ' ';
581 else if( !get_com(out_val, &choice, TRUE) )break;
583 if (use_menu && choice != ' ')
589 if (!only_browse) screen_load();
598 menu_line += (num - 1);
619 if (menu_line > num) menu_line -= num;
622 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
625 if (!redraw || use_menu)
633 /* Save the screen */
634 if (!only_browse && !use_menu) screen_save();
636 /* Display a list of spells */
639 put_str("̾Á°", y, x + 5);
641 put_str("Name", y, x + 5);
645 put_str(format("Lv %s ¼ºÎ¨ ¸ú²Ì", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
647 put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
649 has_weapon[0] = buki_motteruka(INVEN_RARM);
650 has_weapon[1] = buki_motteruka(INVEN_LARM);
652 /* Dump the spells */
653 for (i = 0; i < MAX_MIND_POWERS; i++)
657 /* Access the spell */
658 spell = mind_ptr->info[i];
660 if (spell.min_lev > plev) break;
664 mana_cost = spell.mana_cost;
668 /* Reduce failure rate by "effective" level adjustment */
669 chance -= 3 * (plev - spell.min_lev);
671 /* Reduce failure rate by INT/WIS adjustment */
672 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
674 if (use_mind == MIND_KI)
676 if (heavy_armor()) chance += 20;
677 if (p_ptr->icky_wield[0]) chance += 20;
678 else if (has_weapon[0]) chance += 10;
679 if (p_ptr->icky_wield[1]) chance += 20;
680 else if (has_weapon[1]) chance += 10;
684 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
685 mana_cost += (j+1) * 3 / 2;
689 /* Not enough mana to cast */
690 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU) && (mana_cost > p_ptr->csp))
692 chance += 5 * (mana_cost - p_ptr->csp);
695 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
696 if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
697 if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
699 /* Extract the minimum failure rate */
700 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
702 /* Minimum failure rate */
703 if (chance < minfail) chance = minfail;
705 /* Stunning makes spells harder */
706 if (p_ptr->stun > 50) chance += 25;
707 else if (p_ptr->stun) chance += 15;
709 if (use_mind == MIND_KI)
711 if (heavy_armor()) chance += 5;
712 if (p_ptr->icky_wield[0]) chance += 5;
713 if (p_ptr->icky_wield[1]) chance += 5;
715 /* Always a 5 percent chance of working */
716 if (chance > 95) chance = 95;
720 mindcraft_info(comment, use_mind, i);
725 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ ");
727 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
729 else strcpy(psi_desc, " ");
732 sprintf(psi_desc, " %c) ",I2A(i));
733 /* Dump the spell --(-- */
735 format("%-30s%2d %4d%s %3d%%%s",
736 spell.name, spell.min_lev, mana_cost,
738 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "¡Á" : " "),
740 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "),
743 prt(psi_desc, y + i + 1, x);
746 /* Clear the bottom line */
747 prt("", y + i + 1, x);
751 else if (!only_browse)
756 /* Restore the screen */
767 ask = isupper(choice);
770 if (ask) choice = tolower(choice);
772 /* Extract request */
773 i = (islower(choice) ? A2I(choice) : -1);
776 /* Totally Illegal */
777 if ((i < 0) || (i >= num))
783 /* Save the spell index */
784 spell = mind_ptr->info[i];
793 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell.name);
795 (void)strnfmt(tmp_val, 78, "Use %s? ", spell.name);
799 /* Belay that order */
800 if (!get_check(tmp_val)) continue;
807 /* Restore the screen */
808 if (redraw && !only_browse) screen_load();
814 p_ptr->window |= (PW_SPELL);
820 /* Abort if needed */
821 if (!flag) return (FALSE);
823 /* Save the choice */
826 #ifdef ALLOW_REPEAT /* TNB */
830 #endif /* ALLOW_REPEAT -- TNB */
838 * do_cmd_cast calls this function if the player's class
841 static bool cast_mindcrafter_spell(int spell)
845 int plev = p_ptr->lev;
853 chg_virtue(V_KNOWLEDGE, 1);
854 chg_virtue(V_ENLIGHTEN, 1);
855 wiz_lite(FALSE, FALSE);
858 map_area(DETECT_RAD_MAP);
862 b = detect_monsters_normal(DETECT_RAD_DEFAULT);
863 if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
865 b |= detect_traps(DETECT_RAD_DEFAULT);
866 b |= detect_doors(DETECT_RAD_DEFAULT);
871 b = detect_all(DETECT_RAD_DEFAULT);
874 if ((plev > 24) && (plev < 40))
875 set_tim_esp(plev, FALSE);
878 if (!b) msg_print("°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
880 if (!b) msg_print("You feel safe.");
886 if (!get_aim_dir(&dir)) return FALSE;
888 if (randint(100) < plev * 2)
889 fire_beam(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
891 fire_ball(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
899 teleport_player(plev * 5);
905 if (!get_aim_dir(&dir)) return FALSE;
907 fire_ball(GF_DOMINATION, dir, plev, 0);
911 charm_monsters(plev * 2);
915 /* Fist of Force --- not 'true' TK */
916 if (!get_aim_dir(&dir)) return FALSE;
918 fire_ball(GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
919 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
922 /* Character Armour */
923 set_shield(plev, FALSE);
924 if (plev > 14) set_oppose_acid(plev, FALSE);
925 if (plev > 19) set_oppose_fire(plev, FALSE);
926 if (plev > 24) set_oppose_cold(plev, FALSE);
927 if (plev > 29) set_oppose_elec(plev, FALSE);
928 if (plev > 34) set_oppose_pois(plev, FALSE);
933 return psychometry();
935 return ident_spell(FALSE);
940 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ëÇÈÆ°¤òȯÀ¸¤µ¤»¤¿¡ª");
942 msg_print("Mind-warping forces emanate from your brain!");
946 project(0, 2 + plev / 10, py, px,
947 (plev * 3), GF_PSI, PROJECT_KILL, -1);
949 (void)mindblast_monsters(randint(plev * ((plev - 5) / 10 + 1)));
957 * Only heal when Adrenalin Channeling is not active. We check
958 * that by checking if the player isn't fast and 'heroed' atm.
960 if (!p_ptr->fast || !p_ptr->hero)
965 b = 10 + randint((plev * 3) / 2);
968 (void)set_fast(b, FALSE);
972 if (!get_aim_dir(&dir)) return FALSE;
974 fetch(dir, plev * 15, FALSE);
979 if (!get_aim_dir(&dir)) return FALSE;
981 b = damroll(plev / 2, 6);
983 /* This is always a radius-0 ball now */
984 if (fire_ball(GF_PSI_DRAIN, dir, b, 0))
985 p_ptr->energy -= randint(150);
989 if (!get_aim_dir(&dir)) return FALSE;
991 fire_beam(GF_PSY_SPEAR, dir, randint(plev*3)+plev*3);
998 msg_print("´û¤Ë»þ¤Ï»ß¤Þ¤Ã¤Æ¤¤¤ë¡£");
1000 msg_print("Time is already stopped.");
1004 world_player = TRUE;
1006 msg_print("¡Ö»þ¤è¡ª¡×");
1008 msg_print("You yell 'Time!'");
1012 p_ptr->energy += (p_ptr->csp + 950);
1015 p_ptr->redraw |= (PR_MAP);
1017 /* Update monsters */
1018 p_ptr->update |= (PU_MONSTERS);
1021 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1028 msg_print("¤Ê¤Ë¡©");
1040 * do_cmd_cast calls this function if the player's class
1041 * is 'ForceTrainer'.
1043 static bool cast_force_spell(int spell)
1046 int plev = p_ptr->lev;
1047 int boost = p_ptr->magic_num1[0];
1049 if (heavy_armor()) boost /= 2;
1055 if (!get_aim_dir(&dir)) return FALSE;
1056 fire_ball(GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
1059 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1062 set_tim_ffall(randint(30) + 30 + boost / 5, FALSE);
1065 project_length = plev / 8 + 3;
1066 if (!get_aim_dir(&dir)) return FALSE;
1068 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
1071 set_resist_magic(randint(20) + 20 + boost / 5, FALSE);
1075 msg_print("µ¤¤òÎý¤Ã¤¿¡£");
1077 msg_print("You improved the Force.");
1079 p_ptr->magic_num1[0] += (70 + plev);
1080 if (randint(p_ptr->magic_num1[0]) > (plev * 4 + 120))
1083 msg_print("µ¤¤¬Ë½Áö¤·¤¿¡ª");
1085 msg_print("The Force exploded!");
1087 fire_ball(GF_MANA, 0, p_ptr->magic_num1[0] / 2, 10);
1089 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "µ¤¤Î˽Áö", -1);
1091 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "Explosion of the Force", -1);
1097 set_tim_sh_touki(randint(plev / 2) + 15 + boost / 7, FALSE);
1103 if (!get_aim_dir(&dir)) return FALSE;
1107 dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
1108 fire_beam(GF_MISSILE, dir, dam);
1109 if (cave[y][x].m_idx)
1114 int m_idx = cave[y][x].m_idx;
1115 monster_type *m_ptr = &m_list[m_idx];
1118 monster_desc(m_name, m_ptr, 0);
1120 if (randint(r_info[m_ptr->r_idx].level * 3 / 2) > rand_int(dam / 2) + dam/2)
1123 msg_format("%s¤ÏÈô¤Ð¤µ¤ì¤Ê¤«¤Ã¤¿¡£", m_name);
1125 msg_format("%^s was not blown away.", m_name);
1130 for (i = 0; i < 5; i++)
1134 if (cave_empty_bold(y, x))
1141 if ((ty != oy) || (tx != ox))
1144 msg_format("%s¤ò¿á¤Èô¤Ð¤·¤¿¡ª", m_name);
1146 msg_format("You blow %s away!", m_name);
1148 cave[oy][ox].m_idx = 0;
1149 cave[ty][tx].m_idx = m_idx;
1153 update_mon(m_idx, TRUE);
1162 if (!get_aim_dir(&dir)) return FALSE;
1163 fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
1167 monster_type *m_ptr;
1170 if (!target_set(TARGET_KILL)) return FALSE;
1171 if (!cave[target_row][target_col].m_idx) break;
1172 if (!los(py, px, target_row, target_col)) break;
1173 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1174 monster_desc(m_name, m_ptr, 0);
1175 if (m_ptr->invulner)
1177 m_ptr->invulner = 0;
1179 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
1181 msg_format("%^s is no longer invulnerable.", m_name);
1188 msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1190 msg_format("%^s is no longer fast.", m_name);
1197 msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1199 msg_format("%^s is no longer slow.", m_name);
1202 p_ptr->redraw |= (PR_HEALTH);
1203 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
1210 bool success = FALSE;
1212 for (i = 0; i < 1 + boost/100; i++)
1213 if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, FALSE, TRUE, TRUE, FALSE, FALSE))
1218 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤¬¡¢¸æ¼ç¿ÍÍÍ¡©");
1220 msg_print("'Your wish, master?'");
1226 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1228 msg_print("Nothing happen.");
1234 fire_ball(GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10);
1237 if (!get_aim_dir(&dir)) return FALSE;
1239 fire_beam(GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
1242 set_lightspeed(randint(16) + 16 + boost / 20, FALSE);
1246 msg_print("¤Ê¤Ë¡©");
1252 p_ptr->magic_num1[0] = 0;
1258 /* calculate mirrors */
1259 static int number_of_mirrors( void )
1263 for( x=0 ; x < cur_wid ; x++ ){
1264 for( y=0 ; y < cur_hgt ; y++ ){
1265 if( cave[y][x].feat == FEAT_MIRROR )val++;
1271 static bool cast_mirror_spell(int spell)
1274 int plev = p_ptr->lev;
1281 /* mirror of seeing */
1283 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 0;
1284 if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
1285 if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
1286 if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
1287 if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
1288 if( tmp == 0 && plev < 5 ){
1290 msg_print("¶À¤¬¤Ê¤¯¤Æ½¸Ãæ¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
1292 msg_print("You need a mirror to concentrate!");
1298 if( number_of_mirrors() < 4 + plev/10 ){
1303 msg_format("¤³¤ì°Ê¾å¶À¤ÏÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
1305 msg_format("There are too many mirrors to control!");
1310 if (!get_aim_dir(&dir)) return FALSE;
1311 if ( plev > 9 && cave[py][px].feat == FEAT_MIRROR ){
1312 fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1315 fire_bolt(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1320 teleport_player(10);
1322 /* mirror of light */
1324 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1326 /* mirror of wandering */
1328 teleport_player(plev * 5);
1332 set_dustrobe(20+randint(20),FALSE);
1334 /* banishing mirror */
1336 if (!get_aim_dir(&dir)) return FALSE;
1337 (void)fire_beam(GF_AWAY_ALL, dir , plev);
1339 /* mirror clashing */
1341 if (!get_aim_dir(&dir)) return FALSE;
1342 fire_ball(GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
1343 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
1345 /* mirror sleeping */
1347 for(x=0;x<cur_wid;x++){
1348 for(y=0;y<cur_hgt;y++){
1349 if(cave[y][x].feat == FEAT_MIRROR){
1350 project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
1357 if (!get_aim_dir(&dir)) return FALSE;
1358 fire_beam(GF_SEEKER,dir, damroll(11+(plev-5)/4,8));
1360 /* seal of mirror */
1362 seal_of_mirror(plev*4+100);
1364 /* shield of water */
1366 tmp = 20+randint(20);
1367 set_shield(tmp, FALSE);
1368 if( plev > 31 )set_tim_reflect(tmp, FALSE);
1369 if( plev > 39 )set_resist_magic(tmp,FALSE);
1373 if (!get_aim_dir(&dir)) return FALSE;
1374 fire_beam(GF_SUPER_RAY,dir, 150+randint(2*plev));
1376 /* illusion light */
1378 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 3;
1380 stun_monsters(plev*tmp);
1381 confuse_monsters(plev*tmp);
1382 turn_monsters(plev*tmp);
1383 stun_monsters(plev*tmp);
1384 stasis_monsters(plev*tmp);
1388 if( cave[py][px].feat != FEAT_MIRROR ){
1390 msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
1392 msg_print("You cannot find out where is the world of mirror!");
1401 msg_print("¶À¤ÎÀ¤³¦¤òÄ̤êÈ´¤±¡Ä ");
1403 msg_print("Go through the world of mirror...");
1405 return dimension_door();
1406 /* mirror of recall */
1408 if(!word_of_recall())return FALSE;
1412 set_multishadow(6+randint(6),FALSE);
1417 if( !binding_field(plev*11+5) )msg_print("ŬÅö¤Ê¶À¤òÁª¤Ù¤Ê¤«¤Ã¤¿¡ª");
1419 if( !binding_field(plev*11+5) )msg_print("You were not able to choose suitable mirrors!");
1422 /* mirror of Ruffnor */
1424 (void)set_invuln(randint(4)+4,FALSE);
1428 msg_print("¤Ê¤Ë¡©");
1434 p_ptr->magic_num1[0] = 0;
1441 * do_cmd_cast calls this function if the player's class
1444 static bool cast_berserk_spell(int spell)
1453 detect_monsters_mind(DETECT_RAD_DEFAULT);
1460 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
1462 msg_print("You cannot do it when riding.");
1467 if (!get_rep_dir2(&dir)) return FALSE;
1469 if (dir == 5) return FALSE;
1473 if (!cave[y][x].m_idx)
1476 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1478 msg_print("There is no monster.");
1485 if (!player_can_enter(cave[y][x].feat) || is_trap(cave[y][x].feat))
1491 if (player_can_enter(cave[y][x].feat) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
1497 /* Save the old location */
1501 /* Move the player */
1507 /* Redraw the old spot */
1510 /* Redraw the new spot */
1513 /* Check for new panel (redraw map) */
1517 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
1519 /* Update the monsters */
1520 p_ptr->update |= (PU_DISTANCE);
1523 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1525 /* Handle stuff XXX XXX XXX */
1532 if (!get_rep_dir2(&dir)) return FALSE;
1535 move_player(dir, easy_disarm, TRUE);
1539 earthquake(py, px, 8+rand_int(5));
1544 monster_type *m_ptr;
1546 for (dir = 0; dir < 8; dir++)
1548 y = py + ddy_ddd[dir];
1549 x = px + ddx_ddd[dir];
1550 c_ptr = &cave[y][x];
1552 /* Get the monster */
1553 m_ptr = &m_list[c_ptr->m_idx];
1555 /* Hack -- attack monsters */
1556 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1563 msg_print("¤Ê¤Ë¡©");
1575 * do_cmd_cast calls this function if the player's class
1578 static bool cast_ninja_spell(int spell)
1582 int plev = p_ptr->lev;
1588 (void)unlite_area(0, 3);
1593 wiz_lite(FALSE, TRUE);
1595 detect_monsters_normal(DETECT_RAD_DEFAULT);
1598 detect_traps(DETECT_RAD_DEFAULT);
1599 detect_doors(DETECT_RAD_DEFAULT);
1600 detect_stairs(DETECT_RAD_DEFAULT);
1604 detect_objects_normal(DETECT_RAD_DEFAULT);
1609 teleport_player(10);
1610 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1611 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1616 if (!(p_ptr->special_defense & NINJA_KAWARIMI))
1619 msg_print("Ũ¤Î¹¶·â¤ËÂФ·¤ÆÉÒ´¶¤Ë¤Ê¤Ã¤¿¡£");
1621 msg_print("You are now prepare to evade any attacks.");
1624 p_ptr->special_defense |= NINJA_KAWARIMI;
1625 p_ptr->redraw |= (PR_STATUS);
1631 teleport_player(p_ptr->lev*5);
1632 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1633 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1638 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1641 if (cave[y][x].m_idx)
1644 if (rand_int(p_ptr->skill_dis) < 7)
1646 msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1648 msg_print("You failed to run away.");
1652 teleport_player(30);
1653 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1654 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1660 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1662 msg_print("You don't see any monster in this direction");
1671 if (!get_aim_dir(&dir)) return FALSE;
1672 (void)stasis_monster(dir);
1676 return ident_spell(FALSE);
1679 set_tim_ffall(randint(20) + 20, FALSE);
1682 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
1683 teleport_player(30);
1684 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1685 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1686 set_oppose_fire(plev, FALSE);
1690 if (!get_aim_dir(&dir)) return FALSE;
1691 project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL | PROJECT_NO_REF);
1697 for (i = 0; i < 8; i++)
1701 for (slot = 0; slot < INVEN_PACK; slot++)
1703 if (inventory[slot].tval == TV_SPIKE) break;
1705 if (slot == INVEN_PACK)
1708 if (!i) msg_print("¤¯¤µ¤Ó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£");
1709 else msg_print("¤¯¤µ¤Ó¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1711 if (!i) msg_print("You have no Iron Spikes.");
1712 else msg_print("You have no more Iron Spikes.");
1717 /* Gives a multiplier of 2 at first, up to 3 at 40th */
1718 do_cmd_throw_aux(1, FALSE, slot);
1726 monster_type *m_ptr;
1734 if (!target_set(TARGET_KILL)) return FALSE;
1735 m_idx = cave[target_row][target_col].m_idx;
1737 if (!player_has_los_bold(target_row, target_col)) break;
1738 m_ptr = &m_list[m_idx];
1739 monster_desc(m_name, m_ptr, 0);
1741 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1743 msg_format("You pull back %s.", m_name);
1746 path_n = project_path(path_g, MAX_RANGE, target_row, target_col, py, px, 0);
1747 ty = target_row, tx = target_col;
1748 for (i = 1; i < path_n; i++)
1750 int ny = GRID_Y(path_g[i]);
1751 int nx = GRID_X(path_g[i]);
1753 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
1754 cave[ny][nx].feat != FEAT_GLYPH &&
1755 cave[ny][nx].feat != FEAT_MINOR_GLYPH &&
1756 !(cave[ny][nx].feat >= FEAT_PATTERN_START &&
1757 cave[ny][nx].feat <= FEAT_PATTERN_XTRA2))
1763 /* Update the old location */
1764 cave[target_row][target_col].m_idx = 0;
1766 /* Update the new location */
1767 cave[ty][tx].m_idx = m_idx;
1769 /* Move the monster */
1773 /* Wake the monster up */
1776 /* Update the monster (new location) */
1777 update_mon(m_idx, TRUE);
1779 /* Redraw the old grid */
1780 lite_spot(target_row, target_col);
1782 /* Redraw the new grid */
1785 p_ptr->update |= (PU_MON_LITE);
1790 if (!get_aim_dir(&dir)) return FALSE;
1791 fire_ball(GF_OLD_CONF, dir, plev*3, 3);
1794 project_length = -1;
1795 if (!get_aim_dir(&dir))
1802 (void)teleport_swap(dir);
1808 (void)set_kabenuke(randint(plev/2) + plev/2, FALSE);
1809 set_oppose_acid(plev, FALSE);
1812 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
1813 fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
1814 fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
1815 teleport_player(30);
1816 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1817 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1822 int num = damroll(3, 9);
1824 for (k = 0; k < num; k++)
1826 int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
1827 int attempts = 1000;
1831 scatter(&y, &x, py, px, 4, 0);
1833 if ((y != py) || (x != px)) break;
1835 project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
1836 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
1841 set_multishadow(6+randint(6), FALSE);
1845 msg_print("¤Ê¤Ë¡©");
1857 * do_cmd_cast calls this function if the player's class
1860 void do_cmd_mind(void)
1865 int plev = p_ptr->lev;
1866 int old_csp = p_ptr->csp;
1869 int use_mind, mana_cost;
1873 bool on_mirror = FALSE;
1875 /* not if confused */
1876 if (p_ptr->confused)
1879 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1881 msg_print("You are too confused!");
1888 if (!get_mind_power(&n, FALSE)) return;
1891 switch(p_ptr->pclass)
1893 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;p = "Àº¿À";break;
1894 case CLASS_FORCETRAINER: use_mind = MIND_KI;p = "µ¤";break;
1895 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;p = "Åܤê";break;
1896 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;p = "¶ÀËâË¡";break;
1897 case CLASS_NINJA: use_mind = MIND_NINJUTSU;p = "Àº¿À";break;
1898 default: use_mind = 0;p = "ĶǽÎÏ";break;
1901 switch(p_ptr->pclass)
1903 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
1904 case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
1905 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;break;
1906 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;break;
1907 case CLASS_NINJA: use_mind = MIND_NINJUTSU;break;
1908 default: use_mind = 0;break;
1911 spell = mind_powers[use_mind].info[n];
1913 /* Spell failure chance */
1914 chance = spell.fail;
1916 mana_cost = spell.mana_cost;
1917 if (use_mind == MIND_KI)
1919 if (heavy_armor()) chance += 20;
1920 if (p_ptr->icky_wield[0]) chance += 20;
1921 else if (buki_motteruka(INVEN_RARM)) chance += 10;
1922 if (p_ptr->icky_wield[1]) chance += 20;
1923 else if (buki_motteruka(INVEN_LARM)) chance += 10;
1927 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
1928 mana_cost += (j+1) * 3 / 2;
1932 /* Verify "dangerous" spells */
1933 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
1935 if (mana_cost > p_ptr->chp)
1938 msg_print("£È£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1940 msg_print("You do not have enough hp to use this power.");
1945 else if (mana_cost > p_ptr->csp)
1949 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1951 msg_print("You do not have enough mana to use this power.");
1955 if (!over_exert) return;
1959 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return;
1961 if (!get_check("Attempt it anyway? ")) return;
1968 /* Reduce failure rate by "effective" level adjustment */
1969 chance -= 3 * (plev - spell.min_lev);
1971 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
1972 if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
1973 if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
1975 /* Reduce failure rate by INT/WIS adjustment */
1976 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
1978 /* Not enough mana to cast */
1979 if ((mana_cost > p_ptr->csp) && (use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1981 chance += 5 * (mana_cost - p_ptr->csp);
1984 /* Extract the minimum failure rate */
1985 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
1987 /* Minimum failure rate */
1988 if (chance < minfail) chance = minfail;
1990 /* Stunning makes spells harder */
1991 if (p_ptr->stun > 50) chance += 25;
1992 else if (p_ptr->stun) chance += 15;
1994 if (use_mind == MIND_KI)
1996 if (heavy_armor()) chance += 5;
1997 if (p_ptr->icky_wield[0]) chance += 5;
1998 if (p_ptr->icky_wield[1]) chance += 5;
2002 /* Always a 5 percent chance of working */
2003 if (chance > 95) chance = 95;
2006 if (rand_int(100) < chance)
2008 if (flush_failure) flush();
2010 msg_format("%s¤Î½¸Ãæ¤Ë¼ºÇÔ¤·¤¿¡ª",p);
2012 msg_format("You failed to concentrate hard enough!");
2017 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
2019 if ((use_mind == MIND_KI) && (n != 5) && p_ptr->magic_num1[0])
2022 msg_print("µ¤¤¬»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
2024 msg_print("Your improved Force has gone away...");
2026 p_ptr->magic_num1[0] = 0;
2029 if (randint(100) < (chance / 2))
2034 if( use_mind == MIND_MINDCRAFTER ){
2038 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ªÆ¬¤ÎÃ椬¿¿¤ÃÇò¤Ë¤Ê¤Ã¤¿¡ª");
2040 msg_print("Oh, no! Your mind has gone blank!");
2048 msg_print("´ñ̯¤Ê¸÷·Ê¤¬ÌܤÎÁ°¤ÇÍ٤äƤ¤¤ë...");
2050 msg_print("Weird visions seem to dance before your eyes...");
2053 set_image(p_ptr->image + 5 + randint(10));
2058 msg_print("¤¢¤Ê¤¿¤ÎƬ¤Ïº®Í𤷤¿¡ª");
2060 msg_print("Your brain is addled!");
2063 set_confused(p_ptr->confused + randint(8));
2067 set_stun(p_ptr->stun + randint(8));
2073 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2075 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2078 project(1, 2 + plev / 10, py, px, plev * 2,
2079 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2080 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2083 if( use_mind == MIND_MIRROR_MASTER ){
2086 /* Nothing has happen */
2091 msg_print("¶À¤ÎÀ¤³¦¤Î´³¾Ä¤ò¼õ¤±¤¿¡ª");
2093 msg_print("Weird visions seem to dance before your eyes...");
2095 teleport_player(10);
2101 msg_print("¤Þ¤ï¤ê¤Î¤â¤Î¤¬¥¥é¥¥éµ±¤¤¤Æ¤¤¤ë¡ª");
2103 msg_print("Your brain is addled!");
2106 set_image(p_ptr->image + 5 + randint(10));
2112 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2114 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2117 project(1, 2 + plev / 10, py, px, plev * 2,
2118 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2119 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2131 case MIND_MINDCRAFTER:
2132 /* Cast the spell */
2133 cast = cast_mindcrafter_spell(n);
2136 /* Cast the spell */
2137 cast = cast_force_spell(n);
2139 case MIND_BERSERKER:
2140 /* Cast the spell */
2141 cast = cast_berserk_spell(n);
2143 case MIND_MIRROR_MASTER:
2144 /* Cast the spell */
2145 if( cave[py][px].feat == FEAT_MIRROR )on_mirror = TRUE;
2146 cast = cast_mirror_spell(n);
2149 /* Cast the spell */
2150 cast = cast_ninja_spell(n);
2154 msg_format("Ææ¤ÎǽÎÏ:%d, %d",use_mind, n);
2156 msg_format("Mystery power:%d, %d",use_mind, n);
2167 /* teleport from mirror costs small energy */
2168 if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
2170 if( n==2 || n==4 || n==6 || n==15 )energy_use = 50;
2173 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
2176 take_hit(DAMAGE_USELIFE, mana_cost, "²áÅ٤ν¸Ãæ", -1);
2178 take_hit(DAMAGE_USELIFE, mana_cost, "concentrating too hard", -1);
2181 p_ptr->redraw |= (PR_HP);
2184 /* Sufficient mana */
2185 else if (mana_cost <= old_csp)
2188 p_ptr->csp -= mana_cost;
2191 if (p_ptr->csp < 0) p_ptr->csp = 0;
2193 if ((use_mind == MIND_MINDCRAFTER) && (n == 13))
2197 p_ptr->csp_frac = 0;
2201 /* Over-exert the player */
2204 int oops = mana_cost - old_csp;
2207 if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
2208 p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
2212 msg_format("%s¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª",p);
2214 msg_print("You faint from the effort!");
2218 /* Hack -- Bypass free action */
2219 (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1));
2221 /* Damage WIS (possibly permanently) */
2222 if (rand_int(100) < 50)
2224 bool perm = (rand_int(100) < 25);
2228 msg_print("¼«Ê¬¤ÎÀº¿À¤ò¹¶·â¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2230 msg_print("You have damaged your mind!");
2234 /* Reduce constitution */
2235 (void)dec_stat(A_WIS, 15 + randint(10), perm);
2240 p_ptr->redraw |= (PR_MANA);
2243 p_ptr->window |= (PW_PLAYER);
2244 p_ptr->window |= (PW_SPELL);
2249 * do_cmd_cast calls this function if the player's class
2252 void do_cmd_mind_browse(void)
2259 if (p_ptr->pclass == CLASS_MINDCRAFTER) use_mind = MIND_MINDCRAFTER;
2260 else if (p_ptr->pclass == CLASS_FORCETRAINER) use_mind = MIND_KI;
2261 else if (p_ptr->pclass == CLASS_BERSERKER) use_mind = MIND_BERSERKER;
2262 else if (p_ptr->pclass == CLASS_NINJA) use_mind = MIND_NINJUTSU;
2263 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
2264 use_mind = MIND_MIRROR_MASTER;
2271 if (!get_mind_power(&n, TRUE))
2277 /* Clear lines, position cursor (really should use strlen here) */
2278 Term_erase(12, 21, 255);
2279 Term_erase(12, 20, 255);
2280 Term_erase(12, 19, 255);
2281 Term_erase(12, 18, 255);
2282 Term_erase(12, 17, 255);
2283 Term_erase(12, 16, 255);
2285 roff_to_buf( mind_tips[use_mind][n],62,temp);
2286 for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
2288 prt(&temp[j], line, 15);
2293 case MIND_MIRROR_MASTER:
2296 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
2298 prt("Hit any key.",0,0);