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);
620 if (menu_line > num) menu_line -= num;
623 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
626 if (!redraw || use_menu)
634 /* Save the screen */
635 if (!only_browse && !use_menu) screen_save();
637 /* Display a list of spells */
640 put_str("̾Á°", y, x + 5);
642 put_str("Name", y, x + 5);
646 put_str(format("Lv %s ¼ºÎ¨ ¸ú²Ì", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
648 put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
650 has_weapon[0] = buki_motteruka(INVEN_RARM);
651 has_weapon[1] = buki_motteruka(INVEN_LARM);
653 /* Dump the spells */
654 for (i = 0; i < MAX_MIND_POWERS; i++)
658 /* Access the spell */
659 spell = mind_ptr->info[i];
661 if (spell.min_lev > plev) break;
665 mana_cost = spell.mana_cost;
669 /* Reduce failure rate by "effective" level adjustment */
670 chance -= 3 * (plev - spell.min_lev);
672 /* Reduce failure rate by INT/WIS adjustment */
673 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
675 if (use_mind == MIND_KI)
677 if (heavy_armor()) chance += 20;
678 if (p_ptr->icky_wield[0]) chance += 20;
679 else if (has_weapon[0]) chance += 10;
680 if (p_ptr->icky_wield[1]) chance += 20;
681 else if (has_weapon[1]) chance += 10;
685 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
686 mana_cost += (j+1) * 3 / 2;
690 /* Not enough mana to cast */
691 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU) && (mana_cost > p_ptr->csp))
693 chance += 5 * (mana_cost - p_ptr->csp);
696 chance += p_ptr->to_m_chance;
698 /* Extract the minimum failure rate */
699 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
701 /* Minimum failure rate */
702 if (chance < minfail) chance = minfail;
704 /* Stunning makes spells harder */
705 if (p_ptr->stun > 50) chance += 25;
706 else if (p_ptr->stun) chance += 15;
708 if (use_mind == MIND_KI)
710 if (heavy_armor()) chance += 5;
711 if (p_ptr->icky_wield[0]) chance += 5;
712 if (p_ptr->icky_wield[1]) chance += 5;
714 /* Always a 5 percent chance of working */
715 if (chance > 95) chance = 95;
719 mindcraft_info(comment, use_mind, i);
724 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ ");
726 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
728 else strcpy(psi_desc, " ");
731 sprintf(psi_desc, " %c) ",I2A(i));
732 /* Dump the spell --(-- */
734 format("%-30s%2d %4d%s %3d%%%s",
735 spell.name, spell.min_lev, mana_cost,
737 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "¡Á" : " "),
739 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "),
742 prt(psi_desc, y + i + 1, x);
745 /* Clear the bottom line */
746 prt("", y + i + 1, x);
750 else if (!only_browse)
755 /* Restore the screen */
766 ask = isupper(choice);
769 if (ask) choice = tolower(choice);
771 /* Extract request */
772 i = (islower(choice) ? A2I(choice) : -1);
775 /* Totally Illegal */
776 if ((i < 0) || (i >= num))
782 /* Save the spell index */
783 spell = mind_ptr->info[i];
792 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell.name);
794 (void)strnfmt(tmp_val, 78, "Use %s? ", spell.name);
798 /* Belay that order */
799 if (!get_check(tmp_val)) continue;
806 /* Restore the screen */
807 if (redraw && !only_browse) screen_load();
813 p_ptr->window |= (PW_SPELL);
819 /* Abort if needed */
820 if (!flag) return (FALSE);
822 /* Save the choice */
825 #ifdef ALLOW_REPEAT /* TNB */
829 #endif /* ALLOW_REPEAT -- TNB */
837 * do_cmd_cast calls this function if the player's class
840 static bool cast_mindcrafter_spell(int spell)
844 int plev = p_ptr->lev;
852 chg_virtue(V_KNOWLEDGE, 1);
853 chg_virtue(V_ENLIGHTEN, 1);
854 wiz_lite(FALSE, FALSE);
857 map_area(DETECT_RAD_MAP);
861 b = detect_monsters_normal(DETECT_RAD_DEFAULT);
862 if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
864 b |= detect_traps(DETECT_RAD_DEFAULT);
865 b |= detect_doors(DETECT_RAD_DEFAULT);
870 b = detect_all(DETECT_RAD_DEFAULT);
873 if ((plev > 24) && (plev < 40))
874 set_tim_esp(plev, FALSE);
877 if (!b) msg_print("°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
879 if (!b) msg_print("You feel safe.");
885 if (!get_aim_dir(&dir)) return FALSE;
887 if (randint1(100) < plev * 2)
888 fire_beam(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
890 fire_ball(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
898 teleport_player(plev * 5);
904 if (!get_aim_dir(&dir)) return FALSE;
906 fire_ball(GF_DOMINATION, dir, plev, 0);
910 charm_monsters(plev * 2);
914 /* Fist of Force --- not 'true' TK */
915 if (!get_aim_dir(&dir)) return FALSE;
917 fire_ball(GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
918 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
921 /* Character Armour */
922 set_shield(plev, FALSE);
923 if (plev > 14) set_oppose_acid(plev, FALSE);
924 if (plev > 19) set_oppose_fire(plev, FALSE);
925 if (plev > 24) set_oppose_cold(plev, FALSE);
926 if (plev > 29) set_oppose_elec(plev, FALSE);
927 if (plev > 34) set_oppose_pois(plev, FALSE);
932 return psychometry();
934 return ident_spell(FALSE);
939 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ëÇÈÆ°¤òȯÀ¸¤µ¤»¤¿¡ª");
941 msg_print("Mind-warping forces emanate from your brain!");
945 project(0, 2 + plev / 10, py, px,
946 (plev * 3), GF_PSI, PROJECT_KILL, -1);
948 (void)mindblast_monsters(randint1(plev * ((plev - 5) / 10 + 1)));
956 * Only heal when Adrenalin Channeling is not active. We check
957 * that by checking if the player isn't fast and 'heroed' atm.
959 if (!p_ptr->fast || !p_ptr->hero)
964 b = 10 + randint1((plev * 3) / 2);
967 (void)set_fast(b, FALSE);
971 if (!get_aim_dir(&dir)) return FALSE;
973 fetch(dir, plev * 15, FALSE);
978 if (!get_aim_dir(&dir)) return FALSE;
980 b = damroll(plev / 2, 6);
982 /* This is always a radius-0 ball now */
983 if (fire_ball(GF_PSI_DRAIN, dir, b, 0))
984 p_ptr->energy -= randint1(150);
988 if (!get_aim_dir(&dir)) return FALSE;
990 fire_beam(GF_PSY_SPEAR, dir, randint1(plev*3)+plev*3);
997 msg_print("´û¤Ë»þ¤Ï»ß¤Þ¤Ã¤Æ¤¤¤ë¡£");
999 msg_print("Time is already stopped.");
1003 world_player = TRUE;
1005 msg_print("¡Ö»þ¤è¡ª¡×");
1007 msg_print("You yell 'Time!'");
1011 p_ptr->energy += (p_ptr->csp + 950);
1014 p_ptr->redraw |= (PR_MAP);
1016 /* Update monsters */
1017 p_ptr->update |= (PU_MONSTERS);
1020 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1027 msg_print("¤Ê¤Ë¡©");
1039 * do_cmd_cast calls this function if the player's class
1040 * is 'ForceTrainer'.
1042 static bool cast_force_spell(int spell)
1045 int plev = p_ptr->lev;
1046 int boost = p_ptr->magic_num1[0];
1048 if (heavy_armor()) boost /= 2;
1054 if (!get_aim_dir(&dir)) return FALSE;
1055 fire_ball(GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
1058 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1061 set_tim_ffall(randint1(30) + 30 + boost / 5, FALSE);
1064 project_length = plev / 8 + 3;
1065 if (!get_aim_dir(&dir)) return FALSE;
1067 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
1070 set_resist_magic(randint1(20) + 20 + boost / 5, FALSE);
1074 msg_print("µ¤¤òÎý¤Ã¤¿¡£");
1076 msg_print("You improved the Force.");
1078 p_ptr->magic_num1[0] += (70 + plev);
1079 p_ptr->update |= (PU_BONUS);
1080 if (randint1(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(randint1(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 (randint1(r_info[m_ptr->r_idx].level * 3 / 2) > randint0(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(randint1(16) + 16 + boost / 20, FALSE);
1246 msg_print("¤Ê¤Ë¡©");
1252 p_ptr->magic_num1[0] = 0;
1253 p_ptr->update |= (PU_BONUS);
1259 /* calculate mirrors */
1260 static int number_of_mirrors( void )
1264 for( x=0 ; x < cur_wid ; x++ ){
1265 for( y=0 ; y < cur_hgt ; y++ ){
1266 if( cave[y][x].feat == FEAT_MIRROR )val++;
1272 static bool cast_mirror_spell(int spell)
1275 int plev = p_ptr->lev;
1282 /* mirror of seeing */
1284 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 0;
1285 if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
1286 if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
1287 if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
1288 if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
1289 if( tmp == 0 && plev < 5 ){
1291 msg_print("¶À¤¬¤Ê¤¯¤Æ½¸Ãæ¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
1293 msg_print("You need a mirror to concentrate!");
1299 if( number_of_mirrors() < 4 + plev/10 ){
1304 msg_format("¤³¤ì°Ê¾å¶À¤ÏÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
1306 msg_format("There are too many mirrors to control!");
1311 if (!get_aim_dir(&dir)) return FALSE;
1312 if ( plev > 9 && cave[py][px].feat == FEAT_MIRROR ){
1313 fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1316 fire_bolt(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1321 teleport_player(10);
1323 /* mirror of light */
1325 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1327 /* mirror of wandering */
1329 teleport_player(plev * 5);
1333 set_dustrobe(20+randint1(20),FALSE);
1335 /* banishing mirror */
1337 if (!get_aim_dir(&dir)) return FALSE;
1338 (void)fire_beam(GF_AWAY_ALL, dir , plev);
1340 /* mirror clashing */
1342 if (!get_aim_dir(&dir)) return FALSE;
1343 fire_ball(GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
1344 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
1346 /* mirror sleeping */
1348 for(x=0;x<cur_wid;x++){
1349 for(y=0;y<cur_hgt;y++){
1350 if(cave[y][x].feat == FEAT_MIRROR){
1351 project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
1358 if (!get_aim_dir(&dir)) return FALSE;
1359 fire_beam(GF_SEEKER,dir, damroll(11+(plev-5)/4,8));
1361 /* seal of mirror */
1363 seal_of_mirror(plev*4+100);
1365 /* shield of water */
1367 tmp = 20+randint1(20);
1368 set_shield(tmp, FALSE);
1369 if( plev > 31 )set_tim_reflect(tmp, FALSE);
1370 if( plev > 39 )set_resist_magic(tmp,FALSE);
1374 if (!get_aim_dir(&dir)) return FALSE;
1375 fire_beam(GF_SUPER_RAY,dir, 150+randint1(2*plev));
1377 /* illusion light */
1379 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 3;
1381 stun_monsters(plev*tmp);
1382 confuse_monsters(plev*tmp);
1383 turn_monsters(plev*tmp);
1384 stun_monsters(plev*tmp);
1385 stasis_monsters(plev*tmp);
1389 if( cave[py][px].feat != FEAT_MIRROR ){
1391 msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
1393 msg_print("You cannot find out where is the world of mirror!");
1402 msg_print("¶À¤ÎÀ¤³¦¤òÄ̤êÈ´¤±¡Ä ");
1404 msg_print("Go through the world of mirror...");
1406 return dimension_door();
1407 /* mirror of recall */
1409 if(!word_of_recall())return FALSE;
1413 set_multishadow(6+randint1(6),FALSE);
1418 if( !binding_field(plev*11+5) )msg_print("ŬÅö¤Ê¶À¤òÁª¤Ù¤Ê¤«¤Ã¤¿¡ª");
1420 if( !binding_field(plev*11+5) )msg_print("You were not able to choose suitable mirrors!");
1423 /* mirror of Ruffnor */
1425 (void)set_invuln(randint1(4)+4,FALSE);
1429 msg_print("¤Ê¤Ë¡©");
1435 p_ptr->magic_num1[0] = 0;
1442 * do_cmd_cast calls this function if the player's class
1445 static bool cast_berserk_spell(int spell)
1454 detect_monsters_mind(DETECT_RAD_DEFAULT);
1461 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
1463 msg_print("You cannot do it when riding.");
1468 if (!get_rep_dir2(&dir)) return FALSE;
1470 if (dir == 5) return FALSE;
1474 if (!cave[y][x].m_idx)
1477 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1479 msg_print("There is no monster.");
1486 if (!player_can_enter(cave[y][x].feat) || is_trap(cave[y][x].feat))
1492 if (player_can_enter(cave[y][x].feat) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
1498 /* Save the old location */
1502 /* Move the player */
1508 /* Redraw the old spot */
1511 /* Redraw the new spot */
1514 /* Check for new panel (redraw map) */
1518 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
1520 /* Update the monsters */
1521 p_ptr->update |= (PU_DISTANCE);
1524 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1526 /* Handle stuff XXX XXX XXX */
1533 if (!get_rep_dir2(&dir)) return FALSE;
1536 move_player(dir, easy_disarm, TRUE);
1540 earthquake(py, px, 8+randint0(5));
1545 monster_type *m_ptr;
1547 for (dir = 0; dir < 8; dir++)
1549 y = py + ddy_ddd[dir];
1550 x = px + ddx_ddd[dir];
1551 c_ptr = &cave[y][x];
1553 /* Get the monster */
1554 m_ptr = &m_list[c_ptr->m_idx];
1556 /* Hack -- attack monsters */
1557 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1564 msg_print("¤Ê¤Ë¡©");
1576 * do_cmd_cast calls this function if the player's class
1579 static bool cast_ninja_spell(int spell)
1583 int plev = p_ptr->lev;
1589 (void)unlite_area(0, 3);
1594 wiz_lite(FALSE, TRUE);
1596 detect_monsters_normal(DETECT_RAD_DEFAULT);
1599 detect_traps(DETECT_RAD_DEFAULT);
1600 detect_doors(DETECT_RAD_DEFAULT);
1601 detect_stairs(DETECT_RAD_DEFAULT);
1605 detect_objects_normal(DETECT_RAD_DEFAULT);
1610 teleport_player(10);
1611 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1612 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1617 if (!(p_ptr->special_defense & NINJA_KAWARIMI))
1620 msg_print("Ũ¤Î¹¶·â¤ËÂФ·¤ÆÉÒ´¶¤Ë¤Ê¤Ã¤¿¡£");
1622 msg_print("You are now prepare to evade any attacks.");
1625 p_ptr->special_defense |= NINJA_KAWARIMI;
1626 p_ptr->redraw |= (PR_STATUS);
1632 teleport_player(p_ptr->lev*5);
1633 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1634 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1639 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1642 if (cave[y][x].m_idx)
1645 if (randint0(p_ptr->skill_dis) < 7)
1647 msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1649 msg_print("You failed to run away.");
1653 teleport_player(30);
1654 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1655 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1661 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1663 msg_print("You don't see any monster in this direction");
1672 if (!get_aim_dir(&dir)) return FALSE;
1673 (void)stasis_monster(dir);
1677 return ident_spell(FALSE);
1680 set_tim_ffall(randint1(20) + 20, FALSE);
1683 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
1684 teleport_player(30);
1685 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1686 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1687 set_oppose_fire(plev, FALSE);
1691 if (!get_aim_dir(&dir)) return FALSE;
1692 project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL | PROJECT_NO_REF);
1698 for (i = 0; i < 8; i++)
1702 for (slot = 0; slot < INVEN_PACK; slot++)
1704 if (inventory[slot].tval == TV_SPIKE) break;
1706 if (slot == INVEN_PACK)
1709 if (!i) msg_print("¤¯¤µ¤Ó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£");
1710 else msg_print("¤¯¤µ¤Ó¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1712 if (!i) msg_print("You have no Iron Spikes.");
1713 else msg_print("You have no more Iron Spikes.");
1718 /* Gives a multiplier of 2 at first, up to 3 at 40th */
1719 do_cmd_throw_aux(1, FALSE, slot);
1727 monster_type *m_ptr;
1735 if (!target_set(TARGET_KILL)) return FALSE;
1736 m_idx = cave[target_row][target_col].m_idx;
1738 if (!player_has_los_bold(target_row, target_col)) break;
1739 m_ptr = &m_list[m_idx];
1740 monster_desc(m_name, m_ptr, 0);
1742 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1744 msg_format("You pull back %s.", m_name);
1747 path_n = project_path(path_g, MAX_RANGE, target_row, target_col, py, px, 0);
1748 ty = target_row, tx = target_col;
1749 for (i = 1; i < path_n; i++)
1751 int ny = GRID_Y(path_g[i]);
1752 int nx = GRID_X(path_g[i]);
1754 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
1755 cave[ny][nx].feat != FEAT_GLYPH &&
1756 cave[ny][nx].feat != FEAT_MINOR_GLYPH &&
1757 !(cave[ny][nx].feat >= FEAT_PATTERN_START &&
1758 cave[ny][nx].feat <= FEAT_PATTERN_XTRA2))
1764 /* Update the old location */
1765 cave[target_row][target_col].m_idx = 0;
1767 /* Update the new location */
1768 cave[ty][tx].m_idx = m_idx;
1770 /* Move the monster */
1774 /* Wake the monster up */
1777 /* Update the monster (new location) */
1778 update_mon(m_idx, TRUE);
1780 /* Redraw the old grid */
1781 lite_spot(target_row, target_col);
1783 /* Redraw the new grid */
1786 p_ptr->update |= (PU_MON_LITE);
1791 if (!get_aim_dir(&dir)) return FALSE;
1792 fire_ball(GF_OLD_CONF, dir, plev*3, 3);
1795 project_length = -1;
1796 if (!get_aim_dir(&dir))
1803 (void)teleport_swap(dir);
1809 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
1810 set_oppose_acid(plev, FALSE);
1813 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
1814 fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
1815 fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
1816 teleport_player(30);
1817 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1818 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1823 int num = damroll(3, 9);
1825 for (k = 0; k < num; k++)
1827 int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
1828 int attempts = 1000;
1832 scatter(&y, &x, py, px, 4, 0);
1834 if ((y != py) || (x != px)) break;
1836 project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
1837 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
1842 set_multishadow(6+randint1(6), FALSE);
1846 msg_print("¤Ê¤Ë¡©");
1858 * do_cmd_cast calls this function if the player's class
1861 void do_cmd_mind(void)
1866 int plev = p_ptr->lev;
1867 int old_csp = p_ptr->csp;
1870 int use_mind, mana_cost;
1874 bool on_mirror = FALSE;
1876 /* not if confused */
1877 if (p_ptr->confused)
1880 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1882 msg_print("You are too confused!");
1889 if (!get_mind_power(&n, FALSE)) return;
1892 switch(p_ptr->pclass)
1894 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;p = "Àº¿À";break;
1895 case CLASS_FORCETRAINER: use_mind = MIND_KI;p = "µ¤";break;
1896 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;p = "Åܤê";break;
1897 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;p = "¶ÀËâË¡";break;
1898 case CLASS_NINJA: use_mind = MIND_NINJUTSU;p = "Àº¿À";break;
1899 default: use_mind = 0;p = "ĶǽÎÏ";break;
1902 switch(p_ptr->pclass)
1904 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
1905 case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
1906 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;break;
1907 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;break;
1908 case CLASS_NINJA: use_mind = MIND_NINJUTSU;break;
1909 default: use_mind = 0;break;
1912 spell = mind_powers[use_mind].info[n];
1914 /* Spell failure chance */
1915 chance = spell.fail;
1917 mana_cost = spell.mana_cost;
1918 if (use_mind == MIND_KI)
1920 if (heavy_armor()) chance += 20;
1921 if (p_ptr->icky_wield[0]) chance += 20;
1922 else if (buki_motteruka(INVEN_RARM)) chance += 10;
1923 if (p_ptr->icky_wield[1]) chance += 20;
1924 else if (buki_motteruka(INVEN_LARM)) chance += 10;
1928 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
1929 mana_cost += (j+1) * 3 / 2;
1933 /* Verify "dangerous" spells */
1934 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
1936 if (mana_cost > p_ptr->chp)
1939 msg_print("£È£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1941 msg_print("You do not have enough hp to use this power.");
1946 else if (mana_cost > p_ptr->csp)
1950 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1952 msg_print("You do not have enough mana to use this power.");
1956 if (!over_exert) return;
1960 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return;
1962 if (!get_check("Attempt it anyway? ")) return;
1969 /* Reduce failure rate by "effective" level adjustment */
1970 chance -= 3 * (plev - spell.min_lev);
1972 chance += p_ptr->to_m_chance;
1974 /* Reduce failure rate by INT/WIS adjustment */
1975 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
1977 /* Not enough mana to cast */
1978 if ((mana_cost > p_ptr->csp) && (use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1980 chance += 5 * (mana_cost - p_ptr->csp);
1983 /* Extract the minimum failure rate */
1984 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
1986 /* Minimum failure rate */
1987 if (chance < minfail) chance = minfail;
1989 /* Stunning makes spells harder */
1990 if (p_ptr->stun > 50) chance += 25;
1991 else if (p_ptr->stun) chance += 15;
1993 if (use_mind == MIND_KI)
1995 if (heavy_armor()) chance += 5;
1996 if (p_ptr->icky_wield[0]) chance += 5;
1997 if (p_ptr->icky_wield[1]) chance += 5;
2001 /* Always a 5 percent chance of working */
2002 if (chance > 95) chance = 95;
2005 if (randint0(100) < chance)
2007 if (flush_failure) flush();
2009 msg_format("%s¤Î½¸Ãæ¤Ë¼ºÇÔ¤·¤¿¡ª",p);
2011 msg_format("You failed to concentrate hard enough!");
2016 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
2018 if ((use_mind == MIND_KI) && (n != 5) && p_ptr->magic_num1[0])
2021 msg_print("µ¤¤¬»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
2023 msg_print("Your improved Force has gone away...");
2025 p_ptr->magic_num1[0] = 0;
2028 if (randint1(100) < (chance / 2))
2033 if( use_mind == MIND_MINDCRAFTER ){
2037 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ªÆ¬¤ÎÃ椬¿¿¤ÃÇò¤Ë¤Ê¤Ã¤¿¡ª");
2039 msg_print("Oh, no! Your mind has gone blank!");
2047 msg_print("´ñ̯¤Ê¸÷·Ê¤¬ÌܤÎÁ°¤ÇÍ٤äƤ¤¤ë...");
2049 msg_print("Weird visions seem to dance before your eyes...");
2052 set_image(p_ptr->image + 5 + randint1(10));
2057 msg_print("¤¢¤Ê¤¿¤ÎƬ¤Ïº®Í𤷤¿¡ª");
2059 msg_print("Your brain is addled!");
2062 set_confused(p_ptr->confused + randint1(8));
2066 set_stun(p_ptr->stun + randint1(8));
2072 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2074 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2077 project(1, 2 + plev / 10, py, px, plev * 2,
2078 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2079 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2082 if( use_mind == MIND_MIRROR_MASTER ){
2085 /* Nothing has happen */
2090 msg_print("¶À¤ÎÀ¤³¦¤Î´³¾Ä¤ò¼õ¤±¤¿¡ª");
2092 msg_print("Weird visions seem to dance before your eyes...");
2094 teleport_player(10);
2100 msg_print("¤Þ¤ï¤ê¤Î¤â¤Î¤¬¥¥é¥¥éµ±¤¤¤Æ¤¤¤ë¡ª");
2102 msg_print("Your brain is addled!");
2105 set_image(p_ptr->image + 5 + randint1(10));
2111 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2113 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2116 project(1, 2 + plev / 10, py, px, plev * 2,
2117 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2118 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2130 case MIND_MINDCRAFTER:
2131 /* Cast the spell */
2132 cast = cast_mindcrafter_spell(n);
2135 /* Cast the spell */
2136 cast = cast_force_spell(n);
2138 case MIND_BERSERKER:
2139 /* Cast the spell */
2140 cast = cast_berserk_spell(n);
2142 case MIND_MIRROR_MASTER:
2143 /* Cast the spell */
2144 if( cave[py][px].feat == FEAT_MIRROR )on_mirror = TRUE;
2145 cast = cast_mirror_spell(n);
2148 /* Cast the spell */
2149 cast = cast_ninja_spell(n);
2153 msg_format("Ææ¤ÎǽÎÏ:%d, %d",use_mind, n);
2155 msg_format("Mystery power:%d, %d",use_mind, n);
2166 /* teleport from mirror costs small energy */
2167 if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
2169 if( n==2 || n==4 || n==6 || n==15 )energy_use = 50;
2172 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
2175 take_hit(DAMAGE_USELIFE, mana_cost, "²áÅ٤ν¸Ãæ", -1);
2177 take_hit(DAMAGE_USELIFE, mana_cost, "concentrating too hard", -1);
2180 p_ptr->redraw |= (PR_HP);
2183 /* Sufficient mana */
2184 else if (mana_cost <= old_csp)
2187 p_ptr->csp -= mana_cost;
2190 if (p_ptr->csp < 0) p_ptr->csp = 0;
2192 if ((use_mind == MIND_MINDCRAFTER) && (n == 13))
2196 p_ptr->csp_frac = 0;
2200 /* Over-exert the player */
2203 int oops = mana_cost - old_csp;
2206 if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
2207 p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
2211 msg_format("%s¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª",p);
2213 msg_print("You faint from the effort!");
2217 /* Hack -- Bypass free action */
2218 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2220 /* Damage WIS (possibly permanently) */
2221 if (randint0(100) < 50)
2223 bool perm = (randint0(100) < 25);
2227 msg_print("¼«Ê¬¤ÎÀº¿À¤ò¹¶·â¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2229 msg_print("You have damaged your mind!");
2233 /* Reduce constitution */
2234 (void)dec_stat(A_WIS, 15 + randint1(10), perm);
2239 p_ptr->redraw |= (PR_MANA);
2242 p_ptr->window |= (PW_PLAYER);
2243 p_ptr->window |= (PW_SPELL);
2248 * do_cmd_cast calls this function if the player's class
2251 void do_cmd_mind_browse(void)
2258 if (p_ptr->pclass == CLASS_MINDCRAFTER) use_mind = MIND_MINDCRAFTER;
2259 else if (p_ptr->pclass == CLASS_FORCETRAINER) use_mind = MIND_KI;
2260 else if (p_ptr->pclass == CLASS_BERSERKER) use_mind = MIND_BERSERKER;
2261 else if (p_ptr->pclass == CLASS_NINJA) use_mind = MIND_NINJUTSU;
2262 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
2263 use_mind = MIND_MIRROR_MASTER;
2270 if (!get_mind_power(&n, TRUE))
2276 /* Clear lines, position cursor (really should use strlen here) */
2277 Term_erase(12, 21, 255);
2278 Term_erase(12, 20, 255);
2279 Term_erase(12, 19, 255);
2280 Term_erase(12, 18, 255);
2281 Term_erase(12, 17, 255);
2282 Term_erase(12, 16, 255);
2284 roff_to_buf( mind_tips[use_mind][n],62,temp);
2285 for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
2287 prt(&temp[j], line, 15);
2292 case MIND_MIRROR_MASTER:
2295 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
2297 prt("Hit any key.",0,0);