4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
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.
11 /* Purpose: Mindcrafter code */
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, " ¹ÔÆ°:%ld²ó", (long int)(p_ptr->csp + 100-p_ptr->energy_need - 50)/100); break;
327 case 13: sprintf(p, " %ld acts.", (p_ptr->csp + 100-p_ptr->energy_need - 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 /* Hack -- If requested INVEN_FORCE(1111), pull again */
531 if (*sn == INVEN_FORCE) repeat_pull(sn);
533 /* Verify the spell */
534 if (mind_ptr->info[*sn].min_lev <= plev)
541 #endif /* ALLOW_REPEAT -- TNB */
543 /* Nothing chosen yet */
549 for (i = 0; i < MAX_MIND_POWERS; i++)
551 if (mind_ptr->info[i].min_lev <= plev)
557 /* Build a prompt (accept all spells) */
561 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤Ë¤Ä¤¤¤ÆÃΤê¤Þ¤¹¤«¡©",
563 (void) strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
565 p, I2A(0), I2A(num - 1), p);
570 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
572 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
574 p, I2A(0), I2A(num - 1), p);
577 if (use_menu && !only_browse) screen_save();
578 /* Get a spell from the user */
580 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
583 if(choice==ESCAPE) choice = ' ';
584 else if( !get_com(out_val, &choice, TRUE) )break;
586 if (use_menu && choice != ' ')
592 if (!only_browse) screen_load();
600 menu_line += (num - 1);
622 if (menu_line > num) menu_line -= num;
625 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
628 if (!redraw || use_menu)
636 /* Save the screen */
637 if (!only_browse && !use_menu) screen_save();
639 /* Display a list of spells */
642 put_str("̾Á°", y, x + 5);
644 put_str("Name", y, x + 5);
648 put_str(format("Lv %s ¼ºÎ¨ ¸ú²Ì", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
650 put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
652 has_weapon[0] = buki_motteruka(INVEN_RARM);
653 has_weapon[1] = buki_motteruka(INVEN_LARM);
655 /* Dump the spells */
656 for (i = 0; i < MAX_MIND_POWERS; i++)
660 /* Access the spell */
661 spell = mind_ptr->info[i];
663 if (spell.min_lev > plev) break;
667 mana_cost = spell.mana_cost;
671 /* Reduce failure rate by "effective" level adjustment */
672 chance -= 3 * (plev - spell.min_lev);
674 /* Reduce failure rate by INT/WIS adjustment */
675 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
677 if (use_mind == MIND_KI)
679 if (heavy_armor()) chance += 20;
680 if (p_ptr->icky_wield[0]) chance += 20;
681 else if (has_weapon[0]) chance += 10;
682 if (p_ptr->icky_wield[1]) chance += 20;
683 else if (has_weapon[1]) chance += 10;
687 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
688 mana_cost += (j+1) * 3 / 2;
692 /* Not enough mana to cast */
693 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU) && (mana_cost > p_ptr->csp))
695 chance += 5 * (mana_cost - p_ptr->csp);
698 chance += p_ptr->to_m_chance;
700 /* Extract the minimum failure rate */
701 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
703 /* Minimum failure rate */
704 if (chance < minfail) chance = minfail;
706 /* Stunning makes spells harder */
707 if (p_ptr->stun > 50) chance += 25;
708 else if (p_ptr->stun) chance += 15;
710 if (use_mind == MIND_KI)
712 if (heavy_armor()) chance += 5;
713 if (p_ptr->icky_wield[0]) chance += 5;
714 if (p_ptr->icky_wield[1]) chance += 5;
716 /* Always a 5 percent chance of working */
717 if (chance > 95) chance = 95;
721 mindcraft_info(comment, use_mind, i);
726 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ ");
728 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
730 else strcpy(psi_desc, " ");
733 sprintf(psi_desc, " %c) ",I2A(i));
734 /* Dump the spell --(-- */
736 format("%-30s%2d %4d%s %3d%%%s",
737 spell.name, spell.min_lev, mana_cost,
739 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "¡Á" : " "),
741 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "),
744 prt(psi_desc, y + i + 1, x);
747 /* Clear the bottom line */
748 prt("", y + i + 1, x);
752 else if (!only_browse)
757 /* Restore the screen */
768 ask = isupper(choice);
771 if (ask) choice = tolower(choice);
773 /* Extract request */
774 i = (islower(choice) ? A2I(choice) : -1);
777 /* Totally Illegal */
778 if ((i < 0) || (i >= num))
784 /* Save the spell index */
785 spell = mind_ptr->info[i];
794 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell.name);
796 (void)strnfmt(tmp_val, 78, "Use %s? ", spell.name);
800 /* Belay that order */
801 if (!get_check(tmp_val)) continue;
808 /* Restore the screen */
809 if (redraw && !only_browse) screen_load();
812 p_ptr->window |= (PW_SPELL);
817 /* Abort if needed */
818 if (!flag) return (FALSE);
820 /* Save the choice */
823 #ifdef ALLOW_REPEAT /* TNB */
827 #endif /* ALLOW_REPEAT -- TNB */
835 * do_cmd_cast calls this function if the player's class
838 static bool cast_mindcrafter_spell(int spell)
842 int plev = p_ptr->lev;
850 chg_virtue(V_KNOWLEDGE, 1);
851 chg_virtue(V_ENLIGHTEN, 1);
855 map_area(DETECT_RAD_MAP);
859 b = detect_monsters_normal(DETECT_RAD_DEFAULT);
860 if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
862 b |= detect_traps(DETECT_RAD_DEFAULT, TRUE);
863 b |= detect_doors(DETECT_RAD_DEFAULT);
868 b = detect_all(DETECT_RAD_DEFAULT);
871 if ((plev > 24) && (plev < 40))
872 set_tim_esp(plev, FALSE);
875 if (!b) msg_print("°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
877 if (!b) msg_print("You feel safe.");
883 if (!get_aim_dir(&dir)) return FALSE;
885 if (randint1(100) < plev * 2)
886 fire_beam(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
888 fire_ball(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
892 teleport_player(10, 0L);
896 teleport_player(plev * 5, 0L);
902 if (!get_aim_dir(&dir)) return FALSE;
904 fire_ball(GF_DOMINATION, dir, plev, 0);
908 charm_monsters(plev * 2);
912 /* Fist of Force --- not 'true' TK */
913 if (!get_aim_dir(&dir)) return FALSE;
915 fire_ball(GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
916 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
919 /* Character Armour */
920 set_shield(plev, FALSE);
921 if (plev > 14) set_oppose_acid(plev, FALSE);
922 if (plev > 19) set_oppose_fire(plev, FALSE);
923 if (plev > 24) set_oppose_cold(plev, FALSE);
924 if (plev > 29) set_oppose_elec(plev, FALSE);
925 if (plev > 34) set_oppose_pois(plev, FALSE);
930 return psychometry();
932 return ident_spell(FALSE);
936 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ëÇÈÆ°¤òȯÀ¸¤µ¤»¤¿¡ª");
938 msg_print("Mind-warping forces emanate from your brain!");
942 project(0, 2 + plev / 10, py, px,
943 (plev * 3), GF_PSI, PROJECT_KILL, -1);
945 (void)mindblast_monsters(randint1(plev * ((plev - 5) / 10 + 1)));
953 * Only heal when Adrenalin Channeling is not active. We check
954 * that by checking if the player isn't fast and 'heroed' atm.
956 if (!IS_FAST() || !IS_HERO())
961 b = 10 + randint1((plev * 3) / 2);
964 (void)set_fast(b, FALSE);
968 if (!get_aim_dir(&dir)) return FALSE;
970 fetch(dir, plev * 15, FALSE);
975 if (!get_aim_dir(&dir)) return FALSE;
977 b = damroll(plev / 2, 6);
979 /* This is always a radius-0 ball now */
980 if (fire_ball(GF_PSI_DRAIN, dir, b, 0))
981 p_ptr->energy_need += randint1(150);
985 if (!get_aim_dir(&dir)) return FALSE;
987 fire_beam(GF_PSY_SPEAR, dir, randint1(plev*3)+plev*3);
994 msg_print("´û¤Ë»þ¤Ï»ß¤Þ¤Ã¤Æ¤¤¤ë¡£");
996 msg_print("Time is already stopped.");
1000 world_player = TRUE;
1002 msg_print("¡Ö»þ¤è¡ª¡×");
1004 msg_print("You yell 'Time!'");
1009 p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10;
1012 p_ptr->redraw |= (PR_MAP);
1014 /* Update monsters */
1015 p_ptr->update |= (PU_MONSTERS);
1018 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1025 msg_print("¤Ê¤Ë¡©");
1037 * do_cmd_cast calls this function if the player's class
1038 * is 'ForceTrainer'.
1040 static bool cast_force_spell(int spell)
1043 int plev = p_ptr->lev;
1044 int boost = p_ptr->magic_num1[0];
1046 if (heavy_armor()) boost /= 2;
1052 if (!get_aim_dir(&dir)) return FALSE;
1053 fire_ball(GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
1056 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1059 set_tim_levitation(randint1(30) + 30 + boost / 5, FALSE);
1062 project_length = plev / 8 + 3;
1063 if (!get_aim_dir(&dir)) return FALSE;
1065 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
1068 set_resist_magic(randint1(20) + 20 + boost / 5, FALSE);
1072 msg_print("µ¤¤òÎý¤Ã¤¿¡£");
1074 msg_print("You improved the Force.");
1076 p_ptr->magic_num1[0] += (70 + plev);
1077 p_ptr->update |= (PU_BONUS);
1078 if (randint1(p_ptr->magic_num1[0]) > (plev * 4 + 120))
1081 msg_print("µ¤¤¬Ë½Áö¤·¤¿¡ª");
1083 msg_print("The Force exploded!");
1085 fire_ball(GF_MANA, 0, p_ptr->magic_num1[0] / 2, 10);
1087 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "µ¤¤Î˽Áö", -1);
1089 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "Explosion of the Force", -1);
1095 set_tim_sh_touki(randint1(plev / 2) + 15 + boost / 7, FALSE);
1101 if (!get_aim_dir(&dir)) return FALSE;
1105 dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
1106 fire_beam(GF_MISSILE, dir, dam);
1107 if (cave[y][x].m_idx)
1112 int m_idx = cave[y][x].m_idx;
1113 monster_type *m_ptr = &m_list[m_idx];
1114 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1117 monster_desc(m_name, m_ptr, 0);
1119 if (randint1(r_ptr->level * 3 / 2) > randint0(dam / 2) + dam/2)
1122 msg_format("%s¤ÏÈô¤Ð¤µ¤ì¤Ê¤«¤Ã¤¿¡£", m_name);
1124 msg_format("%^s was not blown away.", m_name);
1129 for (i = 0; i < 5; i++)
1133 if (cave_empty_bold(y, x))
1140 if ((ty != oy) || (tx != ox))
1143 msg_format("%s¤ò¿á¤Èô¤Ð¤·¤¿¡ª", m_name);
1145 msg_format("You blow %s away!", m_name);
1147 cave[oy][ox].m_idx = 0;
1148 cave[ty][tx].m_idx = m_idx;
1152 update_mon(m_idx, TRUE);
1156 if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
1157 p_ptr->update |= (PU_MON_LITE);
1164 if (!get_aim_dir(&dir)) return FALSE;
1165 fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
1171 if (!target_set(TARGET_KILL)) return FALSE;
1172 m_idx = cave[target_row][target_col].m_idx;
1174 if (!player_has_los_bold(target_row, target_col)) break;
1175 if (!projectable(py, px, target_row, target_col)) break;
1176 dispel_monster_status(m_idx);
1182 bool success = FALSE;
1184 for (i = 0; i < 1 + boost/100; i++)
1185 if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, PM_FORCE_PET))
1190 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤¬¡¢¸æ¼ç¿ÍÍÍ¡©");
1192 msg_print("'Your wish, master?'");
1198 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1200 msg_print("Nothing happen.");
1206 fire_ball(GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10);
1209 if (!get_aim_dir(&dir)) return FALSE;
1211 fire_beam(GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
1214 set_lightspeed(randint1(16) + 16 + boost / 20, FALSE);
1218 msg_print("¤Ê¤Ë¡©");
1224 p_ptr->magic_num1[0] = 0;
1225 p_ptr->update |= (PU_BONUS);
1231 /* calculate mirrors */
1232 static int number_of_mirrors( void )
1236 for( x=0 ; x < cur_wid ; x++ ){
1237 for( y=0 ; y < cur_hgt ; y++ ){
1238 if (is_mirror_grid(&cave[y][x])) val++;
1244 static bool cast_mirror_spell(int spell)
1247 int plev = p_ptr->lev;
1254 /* mirror of seeing */
1256 tmp = is_mirror_grid(&cave[py][px]) ? 4 : 0;
1257 if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
1258 if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
1259 if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
1260 if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
1261 if( tmp == 0 && plev < 5 ){
1263 msg_print("¶À¤¬¤Ê¤¯¤Æ½¸Ãæ¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
1265 msg_print("You need a mirror to concentrate!");
1271 if( number_of_mirrors() < 4 + plev/10 ){
1276 msg_format("¤³¤ì°Ê¾å¶À¤ÏÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
1278 msg_format("There are too many mirrors to control!");
1283 if (!get_aim_dir(&dir)) return FALSE;
1284 if ( plev > 9 && is_mirror_grid(&cave[py][px]) ) {
1285 fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1288 fire_bolt(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1293 teleport_player(10, 0L);
1295 /* mirror of light */
1297 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1299 /* mirror of wandering */
1301 teleport_player(plev * 5, 0L);
1305 set_dustrobe(20+randint1(20),FALSE);
1307 /* banishing mirror */
1309 if (!get_aim_dir(&dir)) return FALSE;
1310 (void)fire_beam(GF_AWAY_ALL, dir , plev);
1312 /* mirror clashing */
1314 if (!get_aim_dir(&dir)) return FALSE;
1315 fire_ball(GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
1316 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
1318 /* mirror sleeping */
1320 for(x=0;x<cur_wid;x++){
1321 for(y=0;y<cur_hgt;y++){
1322 if (is_mirror_grid(&cave[y][x])) {
1323 project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1330 if (!get_aim_dir(&dir)) return FALSE;
1331 fire_beam(GF_SEEKER,dir, damroll(11+(plev-5)/4,8));
1333 /* seal of mirror */
1335 seal_of_mirror(plev*4+100);
1337 /* shield of water */
1339 tmp = 20+randint1(20);
1340 set_shield(tmp, FALSE);
1341 if( plev > 31 )set_tim_reflect(tmp, FALSE);
1342 if( plev > 39 )set_resist_magic(tmp,FALSE);
1346 if (!get_aim_dir(&dir)) return FALSE;
1347 fire_beam(GF_SUPER_RAY,dir, 150+randint1(2*plev));
1349 /* illusion light */
1351 tmp = is_mirror_grid(&cave[py][px]) ? 4 : 3;
1353 stun_monsters(plev*tmp);
1354 confuse_monsters(plev*tmp);
1355 turn_monsters(plev*tmp);
1356 stun_monsters(plev*tmp);
1357 stasis_monsters(plev*tmp);
1361 if( !is_mirror_grid(&cave[py][px]) ){
1363 msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
1365 msg_print("You cannot find out where is the world of mirror!");
1374 msg_print("¶À¤ÎÀ¤³¦¤òÄ̤êÈ´¤±¡Ä ");
1376 msg_print("Go through the world of mirror...");
1378 return mirror_tunnel();
1380 /* mirror of recall */
1382 return word_of_recall();
1385 set_multishadow(6+randint1(6),FALSE);
1390 if( !binding_field(plev*11+5) )msg_print("ŬÅö¤Ê¶À¤òÁª¤Ù¤Ê¤«¤Ã¤¿¡ª");
1392 if( !binding_field(plev*11+5) )msg_print("You were not able to choose suitable mirrors!");
1395 /* mirror of Ruffnor */
1397 (void)set_invuln(randint1(4)+4,FALSE);
1401 msg_print("¤Ê¤Ë¡©");
1407 p_ptr->magic_num1[0] = 0;
1414 * do_cmd_cast calls this function if the player's class
1417 static bool cast_berserk_spell(int spell)
1426 detect_monsters_mind(DETECT_RAD_DEFAULT);
1433 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
1435 msg_print("You cannot do it when riding.");
1440 if (!get_rep_dir2(&dir)) return FALSE;
1442 if (dir == 5) return FALSE;
1446 if (!cave[y][x].m_idx)
1449 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1451 msg_print("There is no monster.");
1458 if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
1464 if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
1468 /* Move the player */
1469 (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
1475 if (!get_rep_dir2(&dir)) return FALSE;
1478 move_player(dir, easy_disarm, TRUE);
1482 earthquake(py, px, 8+randint0(5));
1487 monster_type *m_ptr;
1489 for (dir = 0; dir < 8; dir++)
1491 y = py + ddy_ddd[dir];
1492 x = px + ddx_ddd[dir];
1493 c_ptr = &cave[y][x];
1495 /* Get the monster */
1496 m_ptr = &m_list[c_ptr->m_idx];
1498 /* Hack -- attack monsters */
1499 if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
1506 msg_print("¤Ê¤Ë¡©");
1518 * do_cmd_cast calls this function if the player's class
1521 static bool cast_ninja_spell(int spell)
1525 int plev = p_ptr->lev;
1531 (void)unlite_area(0, 3);
1538 detect_monsters_normal(DETECT_RAD_DEFAULT);
1541 detect_traps(DETECT_RAD_DEFAULT, TRUE);
1542 detect_doors(DETECT_RAD_DEFAULT);
1543 detect_stairs(DETECT_RAD_DEFAULT);
1547 detect_objects_normal(DETECT_RAD_DEFAULT);
1552 teleport_player(10, 0L);
1557 if (!(p_ptr->special_defense & NINJA_KAWARIMI))
1560 msg_print("Ũ¤Î¹¶·â¤ËÂФ·¤ÆÉÒ´¶¤Ë¤Ê¤Ã¤¿¡£");
1562 msg_print("You are now prepare to evade any attacks.");
1565 p_ptr->special_defense |= NINJA_KAWARIMI;
1566 p_ptr->redraw |= (PR_STATUS);
1572 teleport_player(p_ptr->lev * 5, 0L);
1577 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1580 if (cave[y][x].m_idx)
1583 if (randint0(p_ptr->skill_dis) < 7)
1585 msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1587 msg_print("You failed to run away.");
1591 teleport_player(30, 0L);
1597 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1599 msg_print("You don't see any monster in this direction");
1608 if (!get_aim_dir(&dir)) return FALSE;
1609 (void)stasis_monster(dir);
1613 return ident_spell(FALSE);
1615 set_tim_levitation(randint1(20) + 20, FALSE);
1618 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
1619 teleport_player(30, 0L);
1620 set_oppose_fire(plev, FALSE);
1623 return rush_attack(NULL);
1627 for (i = 0; i < 8; i++)
1631 for (slot = 0; slot < INVEN_PACK; slot++)
1633 if (inventory[slot].tval == TV_SPIKE) break;
1635 if (slot == INVEN_PACK)
1638 if (!i) msg_print("¤¯¤µ¤Ó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£");
1639 else msg_print("¤¯¤µ¤Ó¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1641 if (!i) msg_print("You have no Iron Spikes.");
1642 else msg_print("You have no more Iron Spikes.");
1647 /* Gives a multiplier of 2 at first, up to 3 at 40th */
1648 do_cmd_throw_aux(1, FALSE, slot);
1656 monster_type *m_ptr;
1664 if (!target_set(TARGET_KILL)) return FALSE;
1665 m_idx = cave[target_row][target_col].m_idx;
1667 if (m_idx == p_ptr->riding) break;
1668 if (!player_has_los_bold(target_row, target_col)) break;
1669 if (!projectable(py, px, target_row, target_col)) break;
1670 m_ptr = &m_list[m_idx];
1671 monster_desc(m_name, m_ptr, 0);
1673 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1675 msg_format("You pull back %s.", m_name);
1678 path_n = project_path(path_g, MAX_RANGE, target_row, target_col, py, px, 0);
1679 ty = target_row, tx = target_col;
1680 for (i = 1; i < path_n; i++)
1682 int ny = GRID_Y(path_g[i]);
1683 int nx = GRID_X(path_g[i]);
1684 cave_type *c_ptr = &cave[ny][nx];
1686 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
1687 !(c_ptr->info & CAVE_OBJECT) &&
1688 !pattern_tile(ny, nx))
1694 /* Update the old location */
1695 cave[target_row][target_col].m_idx = 0;
1697 /* Update the new location */
1698 cave[ty][tx].m_idx = m_idx;
1700 /* Move the monster */
1704 /* Wake the monster up */
1705 (void)set_monster_csleep(m_idx, 0);
1707 /* Update the monster (new location) */
1708 update_mon(m_idx, TRUE);
1710 /* Redraw the old grid */
1711 lite_spot(target_row, target_col);
1713 /* Redraw the new grid */
1716 if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
1717 p_ptr->update |= (PU_MON_LITE);
1721 /* Auto-Recall if possible and visible */
1722 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
1724 /* Track a new monster */
1725 health_track(m_idx);
1731 if (!get_aim_dir(&dir)) return FALSE;
1732 fire_ball(GF_OLD_CONF, dir, plev*3, 3);
1735 project_length = -1;
1736 if (!get_aim_dir(&dir))
1743 (void)teleport_swap(dir);
1749 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
1750 set_oppose_acid(plev, FALSE);
1753 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
1754 fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
1755 fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
1756 teleport_player(30, 0L);
1761 int num = damroll(3, 9);
1763 for (k = 0; k < num; k++)
1765 int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
1766 int attempts = 1000;
1770 scatter(&y, &x, py, px, 4, 0);
1772 if (!player_bold(y, x)) break;
1774 project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
1775 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
1780 set_multishadow(6+randint1(6), FALSE);
1784 msg_print("¤Ê¤Ë¡©");
1796 * do_cmd_cast calls this function if the player's class
1799 void do_cmd_mind(void)
1804 int plev = p_ptr->lev;
1805 int old_csp = p_ptr->csp;
1808 int use_mind, mana_cost;
1812 bool on_mirror = FALSE;
1814 /* not if confused */
1815 if (p_ptr->confused)
1818 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1820 msg_print("You are too confused!");
1827 if (!get_mind_power(&n, FALSE)) return;
1830 switch(p_ptr->pclass)
1832 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;p = "Àº¿À";break;
1833 case CLASS_FORCETRAINER: use_mind = MIND_KI;p = "µ¤";break;
1834 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;p = "Åܤê";break;
1835 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;p = "¶ÀËâË¡";break;
1836 case CLASS_NINJA: use_mind = MIND_NINJUTSU;p = "Àº¿À";break;
1837 default: use_mind = 0;p = "ĶǽÎÏ";break;
1840 switch(p_ptr->pclass)
1842 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
1843 case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
1844 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;break;
1845 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;break;
1846 case CLASS_NINJA: use_mind = MIND_NINJUTSU;break;
1847 default: use_mind = 0;break;
1850 spell = mind_powers[use_mind].info[n];
1852 /* Spell failure chance */
1853 chance = spell.fail;
1855 mana_cost = spell.mana_cost;
1856 if (use_mind == MIND_KI)
1858 if (heavy_armor()) chance += 20;
1859 if (p_ptr->icky_wield[0]) chance += 20;
1860 else if (buki_motteruka(INVEN_RARM)) chance += 10;
1861 if (p_ptr->icky_wield[1]) chance += 20;
1862 else if (buki_motteruka(INVEN_LARM)) chance += 10;
1866 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
1867 mana_cost += (j+1) * 3 / 2;
1871 /* Verify "dangerous" spells */
1872 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
1874 if (mana_cost > p_ptr->chp)
1877 msg_print("£È£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1879 msg_print("You do not have enough hp to use this power.");
1884 else if (mana_cost > p_ptr->csp)
1888 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1890 msg_print("You do not have enough mana to use this power.");
1894 if (!over_exert) return;
1898 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return;
1900 if (!get_check("Attempt it anyway? ")) return;
1907 /* Reduce failure rate by "effective" level adjustment */
1908 chance -= 3 * (plev - spell.min_lev);
1910 chance += p_ptr->to_m_chance;
1912 /* Reduce failure rate by INT/WIS adjustment */
1913 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
1915 /* Not enough mana to cast */
1916 if ((mana_cost > p_ptr->csp) && (use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1918 chance += 5 * (mana_cost - p_ptr->csp);
1921 /* Extract the minimum failure rate */
1922 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
1924 /* Minimum failure rate */
1925 if (chance < minfail) chance = minfail;
1927 /* Stunning makes spells harder */
1928 if (p_ptr->stun > 50) chance += 25;
1929 else if (p_ptr->stun) chance += 15;
1931 if (use_mind == MIND_KI)
1933 if (heavy_armor()) chance += 5;
1934 if (p_ptr->icky_wield[0]) chance += 5;
1935 if (p_ptr->icky_wield[1]) chance += 5;
1939 /* Always a 5 percent chance of working */
1940 if (chance > 95) chance = 95;
1943 if (randint0(100) < chance)
1945 if (flush_failure) flush();
1947 msg_format("%s¤Î½¸Ãæ¤Ë¼ºÇÔ¤·¤¿¡ª",p);
1949 msg_format("You failed to concentrate hard enough!");
1954 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1956 if ((use_mind == MIND_KI) && (n != 5) && p_ptr->magic_num1[0])
1959 msg_print("µ¤¤¬»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
1961 msg_print("Your improved Force has gone away...");
1963 p_ptr->magic_num1[0] = 0;
1966 if (randint1(100) < (chance / 2))
1971 if( use_mind == MIND_MINDCRAFTER ){
1975 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ªÆ¬¤ÎÃ椬¿¿¤ÃÇò¤Ë¤Ê¤Ã¤¿¡ª");
1977 msg_print("Oh, no! Your mind has gone blank!");
1985 msg_print("´ñ̯¤Ê¸÷·Ê¤¬ÌܤÎÁ°¤ÇÍ٤äƤ¤¤ë...");
1987 msg_print("Weird visions seem to dance before your eyes...");
1990 set_image(p_ptr->image + 5 + randint1(10));
1995 msg_print("¤¢¤Ê¤¿¤ÎƬ¤Ïº®Í𤷤¿¡ª");
1997 msg_print("Your brain is addled!");
2000 set_confused(p_ptr->confused + randint1(8));
2004 set_stun(p_ptr->stun + randint1(8));
2010 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2012 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2015 project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
2016 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2017 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2020 if( use_mind == MIND_MIRROR_MASTER ){
2023 /* Nothing has happen */
2028 msg_print("¶À¤ÎÀ¤³¦¤Î´³¾Ä¤ò¼õ¤±¤¿¡ª");
2030 msg_print("Weird visions seem to dance before your eyes...");
2032 teleport_player(10, TELEPORT_PASSIVE);
2037 msg_print("¤Þ¤ï¤ê¤Î¤â¤Î¤¬¥¥é¥¥éµ±¤¤¤Æ¤¤¤ë¡ª");
2039 msg_print("Your brain is addled!");
2042 set_image(p_ptr->image + 5 + randint1(10));
2048 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2050 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2053 project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
2054 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2055 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2067 case MIND_MINDCRAFTER:
2068 /* Cast the spell */
2069 cast = cast_mindcrafter_spell(n);
2072 /* Cast the spell */
2073 cast = cast_force_spell(n);
2075 case MIND_BERSERKER:
2076 /* Cast the spell */
2077 cast = cast_berserk_spell(n);
2079 case MIND_MIRROR_MASTER:
2080 /* Cast the spell */
2081 if( is_mirror_grid(&cave[py][px]) )on_mirror = TRUE;
2082 cast = cast_mirror_spell(n);
2085 /* Cast the spell */
2086 cast = cast_ninja_spell(n);
2090 msg_format("Ææ¤ÎǽÎÏ:%d, %d",use_mind, n);
2092 msg_format("Mystery power:%d, %d",use_mind, n);
2103 /* teleport from mirror costs small energy */
2104 if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
2106 if( n==3 || n==5 || n==7 || n==16 )energy_use = 50;
2109 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
2112 take_hit(DAMAGE_USELIFE, mana_cost, "²áÅ٤ν¸Ãæ", -1);
2114 take_hit(DAMAGE_USELIFE, mana_cost, "concentrating too hard", -1);
2117 p_ptr->redraw |= (PR_HP);
2120 /* Sufficient mana */
2121 else if (mana_cost <= old_csp)
2124 p_ptr->csp -= mana_cost;
2127 if (p_ptr->csp < 0) p_ptr->csp = 0;
2129 if ((use_mind == MIND_MINDCRAFTER) && (n == 13))
2133 p_ptr->csp_frac = 0;
2137 /* Over-exert the player */
2140 int oops = mana_cost - old_csp;
2143 if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
2144 p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
2148 msg_format("%s¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª",p);
2150 msg_print("You faint from the effort!");
2154 /* Hack -- Bypass free action */
2155 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2157 /* Damage WIS (possibly permanently) */
2158 if (randint0(100) < 50)
2160 bool perm = (randint0(100) < 25);
2164 msg_print("¼«Ê¬¤ÎÀº¿À¤ò¹¶·â¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2166 msg_print("You have damaged your mind!");
2170 /* Reduce constitution */
2171 (void)dec_stat(A_WIS, 15 + randint1(10), perm);
2176 p_ptr->redraw |= (PR_MANA);
2179 p_ptr->window |= (PW_PLAYER);
2180 p_ptr->window |= (PW_SPELL);
2185 * do_cmd_cast calls this function if the player's class
2188 void do_cmd_mind_browse(void)
2195 if (p_ptr->pclass == CLASS_MINDCRAFTER) use_mind = MIND_MINDCRAFTER;
2196 else if (p_ptr->pclass == CLASS_FORCETRAINER) use_mind = MIND_KI;
2197 else if (p_ptr->pclass == CLASS_BERSERKER) use_mind = MIND_BERSERKER;
2198 else if (p_ptr->pclass == CLASS_NINJA) use_mind = MIND_NINJUTSU;
2199 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
2200 use_mind = MIND_MIRROR_MASTER;
2207 if (!get_mind_power(&n, TRUE))
2213 /* Clear lines, position cursor (really should use strlen here) */
2214 Term_erase(12, 21, 255);
2215 Term_erase(12, 20, 255);
2216 Term_erase(12, 19, 255);
2217 Term_erase(12, 18, 255);
2218 Term_erase(12, 17, 255);
2219 Term_erase(12, 16, 255);
2221 roff_to_buf(mind_tips[use_mind][n], 62, temp, sizeof(temp));
2222 for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
2224 prt(&temp[j], line, 15);
2229 case MIND_MIRROR_MASTER:
2232 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
2234 prt("Hit any key.",0,0);