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 */
23 { 1, 1, 15, "Îî»ë" , "Precognition"},
24 { 2, 1, 20, "¿À·Ð¹¶·â" , "Neural Blast"},
25 { 3, 2, 25, "¼¡¸µ¤Î½Ö¤" , "Minor Displacement"},
26 { 7, 6, 35, "µõ¶õ¤Î¸¸±Æ" , "Major Displacement"},
27 { 9, 7, 50, "Àº¿À»ÙÇÛ" , "Domination"},
28 { 11, 7, 30, "Ç°Æ°¾×·âÃÆ" , "Pulverise"},
29 { 13, 12, 50, "³»²½" , "Character Armour"},
30 { 15, 12, 60, "¥µ¥¤¥³¥á¥È¥ê¡¼" , "Psychometry" },
31 { 18, 10, 45, "Àº¿ÀÇÈÆ°", "Mind Wave" },
32 { 23, 15, 50, "¥¢¥É¥ì¥Ê¥ê¥ó¡¦¥É¡¼¥Ô¥ó¥°" , "Adrenaline Channeling"},
33 { 26, 28, 60, "¥Æ¥ì¥¥Í¥·¥¹" ,"Telekinesis"},
34 { 28, 10, 40, "¥µ¥¤¥¥Ã¥¯¡¦¥É¥ì¥¤¥ó" ,"Psychic Drain"},
35 { 35, 35, 75, "¸÷¤Î·õ", "Psycho-Spear"},
36 { 45,150, 85, "´°Á´¤ÊÀ¤³¦", "The World"},
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 */
75 { 1, 1, 15, "¾®Î¶" , "Small Force Ball"},
76 { 3, 3, 30, "Á®¸÷" , "Flash Light"},
77 { 5, 6, 35, "Éñ¶õ½Ñ" , "Flying Technique"},
78 { 8, 5, 40, "¥«¥á¥Ï¥áÇÈ" , "Kamehameha"},
79 { 10, 7, 45, "ÂÐËâË¡Ëɸæ" , "Magic Resistance"},
80 { 13, 5, 60, "Îýµ¤" , "Improve Force"},
81 { 17, 17, 50, "ŻƮµ¤" , "Aura of Force"},
82 { 20, 20, 50, "¾×ÇÈ" , "Shock Power"},
83 { 23, 18, 55, "×Âζ" , "Large Force Ball"},
84 { 25, 30, 70, "¤¤¤Æ¤Ä¤¯ÇÈÆ°" , "Dispel"},
85 { 28, 26, 50, "¸¸Î´" , "Summon Ghost"},
86 { 32, 35, 65, "Îû¹ö²Ð±ê" , "Exploding Frame"},
87 { 38, 42, 75, "Ķ¥«¥á¥Ï¥áÇÈ" , "Super Kamehameha"},
88 { 44, 50, 80, "¸÷®°ÜÆ°" , "Light Speed"},
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, "»¦µ¤´¶ÃÎ" , "Detect Atmosphere of Menace"},
128 { 15, 20, 0, "ÆÍ·â" , "Charge"},
129 { 20, 15, 0, "¥È¥é¥Ã¥×Ê´ºÕ" , "Smash a Trap"},
130 { 25, 20, 60, "ÃÏ¿Ì" , "Quake"},
131 { 30, 80, 75, "³§»¦¤·" , "Massacre"},
132 { 99, 0, 0, "" , ""},
133 { 99, 0, 0, "" , ""},
134 { 99, 0, 0, "" , ""},
135 { 99, 0, 0, "" , ""},
136 { 99, 0, 0, "" , ""},
137 { 99, 0, 0, "" , ""},
138 { 99, 0, 0, "" , ""},
139 { 99, 0, 0, "" , ""},
140 { 99, 0, 0, "" , ""},
141 { 99, 0, 0, "" , ""},
142 { 99, 0, 0, "" , ""},
143 { 99, 0, 0, "" , ""},
144 { 99, 0, 0, "" , ""},
145 { 99, 0, 0, "" , ""},
146 { 99, 0, 0, "" , ""},
147 { 99, 0, 0, "" , ""},
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, "¿¿¸«¤Î¶À" , "Mirror of Seeing"},
180 { 1, 2, 40, "¶ÀÀ¸À®" , "Making a Mirror"},
181 { 2, 2, 20, "¸÷¤Î¤·¤º¤¯" , "Drip of Light"},
182 { 3, 2, 20, "ÏĤó¤À¶À" , "Warped Mirror"},
183 { 5, 3, 35, "Á®¸÷¶À" , "Mirror of Light"},
184 { 6, 5, 35, "×Ǥ¨¤ë¶À" , "Mirror of Wandering"},
186 { 10, 5, 30, "Èù¿Ð±£¤ì" , "Robe of Dust"},
187 { 12, 12, 30, "ÄÉÊü¤Î¶À" , "Banishing Mirror"},
188 { 15, 15, 30, "¶ÀºÕ¤" , "Mirror Clashing"},
189 { 19, 13, 30, "ºÅ̲¶À" , "Mirror Sleeping"},
190 { 23, 18, 50, "¥·¡¼¥«¡¼¥ì¥¤" , "Seeker Ray"},
192 { 25, 20, 40, "¶À¤ÎÉõ°õ" , "Seal of Mirror"},
193 { 27, 30, 60, "¿å¶À¤Î½â" , "Shield of Water"},
194 { 29, 30, 60, "¥¹¡¼¥Ñ¡¼¥ì¥¤" , "Super Ray"},
195 { 31, 35, 60, "¸¸ÏǤθ÷" , "Illusion Light"},
196 { 33, 50, 80, "¶À¤Î¹ñ" , "Mirror Shift"},
198 { 36, 30, 80, "¶ÀÈ´¤±" , "Mirror Tunnel"},
199 { 38, 40, 70, "µ¢´Ô¤Î¶À" , "Mirror of Recall"},
200 { 40, 50, 55, "±Æʬ¿È" , "Multi-Shadow"},
201 { 43, 55, 70, "ÉõËâ·ë³¦" , "Binding Field"},
202 { 46, 70, 75, "¥é¥Õ¥Î¡¼¥ë¤Î¶À" , "Mirror of Ruffnor"},
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, "°Å°ÇÀ¸À®" , "Create Darkness"},
238 { 2, 2, 25, "¼þÊÕÄ´ºº" , "Detect Near"},
239 { 3, 3, 25, "ÍÕ±£¤ì" , "Hide in Leafs"},
240 { 5, 3, 30, "ÊѤï¤ê¿È" , "Quick Substitution"},
241 { 7, 8, 35, "¹âÈô¤Ó" , "Absconding"},
242 { 8, 10, 35, "°ì·âΥæ" , "Hit And Away"},
243 { 10, 10, 40, "¶âÇû¤ê" , "Bind Monster"},
244 { 12, 12, 70, "¸Å¤Î¸ýÅÁ" , "Ancient Knowledge"},
245 { 15, 10, 50, "Éâ±À" , "Floating"},
246 { 17, 12, 45, "²ÐÆÛ" , "Hide in Flame"},
247 { 18, 20, 40, "Æþ¿È" , "Surprise Attack"},
248 { 20, 5, 50, "ȬÊý¼ê΢·õ" , "Syuriken Spread"},
249 { 22, 15, 55, "º¿³ù" , "Chain Hook"},
250 { 25, 32, 60, "±ì¶Ì" , "Smoke Ball"},
251 { 28, 32, 60, "ž¿È" , "Swap Step"},
252 { 30, 30, 70, "Çúȯ¤ÎÌæ¾Ï" , "Glyph of Explosion"},
253 { 32, 40, 40, "ÅÚÆÛ" , "Hide in Mud"},
254 { 34, 35, 50, "̸±£¤ì" , "Hide in Mist"},
255 { 38, 40, 60, "Îû¹ö²Ð±ê" , "Flame Hell"},
256 { 41, 50, 55, "ʬ¿È" , "Multi Shadow"},
257 { 99, 0, 0, "" , ""},
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);
724 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ ");
725 else strcpy(psi_desc, " ");
728 sprintf(psi_desc, " %c) ",I2A(i));
729 /* Dump the spell --(-- */
731 format("%-30s%2d %4d%s %3d%%%s",
732 spell.name, spell.min_lev, mana_cost,
734 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "¡Á" : " "),
736 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "),
739 prt(psi_desc, y + i + 1, x);
742 /* Clear the bottom line */
743 prt("", y + i + 1, x);
747 else if (!only_browse)
752 /* Restore the screen */
763 ask = isupper(choice);
766 if (ask) choice = tolower(choice);
768 /* Extract request */
769 i = (islower(choice) ? A2I(choice) : -1);
772 /* Totally Illegal */
773 if ((i < 0) || (i >= num))
779 /* Save the spell index */
780 spell = mind_ptr->info[i];
789 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell.name);
791 (void)strnfmt(tmp_val, 78, "Use %s? ", spell.name);
795 /* Belay that order */
796 if (!get_check(tmp_val)) continue;
803 /* Restore the screen */
804 if (redraw && !only_browse) screen_load();
810 p_ptr->window |= (PW_SPELL);
816 /* Abort if needed */
817 if (!flag) return (FALSE);
819 /* Save the choice */
822 #ifdef ALLOW_REPEAT /* TNB */
826 #endif /* ALLOW_REPEAT -- TNB */
834 * do_cmd_cast calls this function if the player's class
837 static bool cast_mindcrafter_spell(int spell)
841 int plev = p_ptr->lev;
849 chg_virtue(V_KNOWLEDGE, 1);
850 chg_virtue(V_ENLIGHTEN, 1);
851 wiz_lite(FALSE, FALSE);
854 map_area(DETECT_RAD_MAP);
858 b = detect_monsters_normal(DETECT_RAD_DEFAULT);
859 if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
861 b |= detect_traps(DETECT_RAD_DEFAULT);
862 b |= detect_doors(DETECT_RAD_DEFAULT);
867 b = detect_all(DETECT_RAD_DEFAULT);
870 if ((plev > 24) && (plev < 40))
871 set_tim_esp(plev, FALSE);
874 if (!b) msg_print("°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
876 if (!b) msg_print("You feel safe.");
882 if (!get_aim_dir(&dir)) return FALSE;
884 if (randint(100) < plev * 2)
885 fire_beam(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
887 fire_ball(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
895 teleport_player(plev * 5);
901 if (!get_aim_dir(&dir)) return FALSE;
903 fire_ball(GF_DOMINATION, dir, plev, 0);
907 charm_monsters(plev * 2);
911 /* Fist of Force --- not 'true' TK */
912 if (!get_aim_dir(&dir)) return FALSE;
914 fire_ball(GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
915 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
918 /* Character Armour */
919 set_shield(plev, FALSE);
920 if (plev > 14) set_oppose_acid(plev, FALSE);
921 if (plev > 19) set_oppose_fire(plev, FALSE);
922 if (plev > 24) set_oppose_cold(plev, FALSE);
923 if (plev > 29) set_oppose_elec(plev, FALSE);
924 if (plev > 34) set_oppose_pois(plev, FALSE);
929 return psychometry();
931 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(randint(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 (!p_ptr->fast || !p_ptr->hero)
961 b = 10 + randint((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 -= randint(150);
985 if (!get_aim_dir(&dir)) return FALSE;
987 fire_beam(GF_PSY_SPEAR, dir, randint(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!'");
1008 p_ptr->energy += (p_ptr->csp + 950);
1011 p_ptr->redraw |= (PR_MAP);
1013 /* Update monsters */
1014 p_ptr->update |= (PU_MONSTERS);
1017 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1024 msg_print("¤Ê¤Ë¡©");
1036 * do_cmd_cast calls this function if the player's class
1037 * is 'ForceTrainer'.
1039 static bool cast_force_spell(int spell)
1042 int plev = p_ptr->lev;
1043 int boost = p_ptr->magic_num1[0];
1045 if (heavy_armor()) boost /= 2;
1051 if (!get_aim_dir(&dir)) return FALSE;
1052 fire_ball(GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
1055 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1058 set_tim_ffall(randint(30) + 30 + boost / 5, FALSE);
1061 project_length = plev / 8 + 3;
1062 if (!get_aim_dir(&dir)) return FALSE;
1064 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
1067 set_resist_magic(randint(20) + 20 + boost / 5, FALSE);
1071 msg_print("µ¤¤òÎý¤Ã¤¿¡£");
1073 msg_print("You improved the Force.");
1075 p_ptr->magic_num1[0] += (70 + plev);
1076 if (randint(p_ptr->magic_num1[0]) > (plev * 4 + 120))
1079 msg_print("µ¤¤¬Ë½Áö¤·¤¿¡ª");
1081 msg_print("The Force exploded!");
1083 fire_ball(GF_MANA, 0, p_ptr->magic_num1[0] / 2, 10);
1085 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "µ¤¤Î˽Áö", -1);
1087 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "Explosion of the Force", -1);
1093 set_tim_sh_touki(randint(plev / 2) + 15 + boost / 7, FALSE);
1099 if (!get_aim_dir(&dir)) return FALSE;
1103 dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
1104 fire_beam(GF_MISSILE, dir, dam);
1105 if (cave[y][x].m_idx)
1110 int m_idx = cave[y][x].m_idx;
1111 monster_type *m_ptr = &m_list[m_idx];
1114 monster_desc(m_name, m_ptr, 0);
1116 if (randint(r_info[m_ptr->r_idx].level * 3 / 2) > rand_int(dam / 2) + dam/2)
1119 msg_format("%s¤ÏÈô¤Ð¤µ¤ì¤Ê¤«¤Ã¤¿¡£", m_name);
1121 msg_format("%^s was not blown away.", m_name);
1126 for (i = 0; i < 5; i++)
1130 if (cave_empty_bold(y, x))
1137 if ((ty != oy) || (tx != ox))
1140 msg_format("%s¤ò¿á¤Èô¤Ð¤·¤¿¡ª", m_name);
1142 msg_format("You blow %s away!", m_name);
1144 cave[oy][ox].m_idx = 0;
1145 cave[ty][tx].m_idx = m_idx;
1149 update_mon(m_idx, TRUE);
1158 if (!get_aim_dir(&dir)) return FALSE;
1159 fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
1163 monster_type *m_ptr;
1166 if (!target_set(TARGET_KILL)) return FALSE;
1167 if (!cave[target_row][target_col].m_idx) break;
1168 if (!los(py, px, target_row, target_col)) break;
1169 m_ptr = &m_list[cave[target_row][target_col].m_idx];
1170 monster_desc(m_name, m_ptr, 0);
1171 if (m_ptr->invulner)
1173 m_ptr->invulner = 0;
1175 msg_format("%s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ï¤Ê¤¤¡£", m_name);
1177 msg_format("%^s is no longer invulnerable.", m_name);
1184 msg_format("%s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1186 msg_format("%^s is no longer fast.", m_name);
1193 msg_format("%s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1195 msg_format("%^s is no longer slow.", m_name);
1198 p_ptr->redraw |= (PR_HEALTH);
1199 if (p_ptr->riding == cave[target_row][target_col].m_idx) p_ptr->redraw |= (PR_UHEALTH);
1206 bool success = FALSE;
1208 for (i = 0; i < 1 + boost/100; i++)
1209 if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, FALSE, TRUE, TRUE, FALSE, FALSE))
1214 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤¬¡¢¸æ¼ç¿ÍÍÍ¡©");
1216 msg_print("'Your wish, master?'");
1222 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1224 msg_print("Nothing happen.");
1230 fire_ball(GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10);
1233 if (!get_aim_dir(&dir)) return FALSE;
1235 fire_beam(GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
1238 set_lightspeed(randint(16) + 16 + boost / 20, FALSE);
1242 msg_print("¤Ê¤Ë¡©");
1248 p_ptr->magic_num1[0] = 0;
1254 /* calculate mirrors */
1255 static int number_of_mirrors( void )
1259 for( x=0 ; x < cur_wid ; x++ ){
1260 for( y=0 ; y < cur_hgt ; y++ ){
1261 if( cave[y][x].feat == FEAT_MIRROR )val++;
1267 static bool cast_mirror_spell(int spell)
1270 int plev = p_ptr->lev;
1277 /* mirror of seeing */
1279 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 0;
1280 if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
1281 if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
1282 if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
1283 if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
1284 if( tmp == 0 && plev < 5 ){
1286 msg_print("¶À¤¬¤Ê¤¯¤Æ½¸Ãæ¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
1288 msg_print("You need a mirror to concentrate!");
1294 if( number_of_mirrors() < 4 + plev/10 ){
1299 msg_format("¤³¤ì°Ê¾å¶À¤ÏÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
1301 msg_format("There are too many mirrors to control!");
1306 if (!get_aim_dir(&dir)) return FALSE;
1307 if ( plev > 9 && cave[py][px].feat == FEAT_MIRROR ){
1308 fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1311 fire_bolt(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1316 teleport_player(10);
1318 /* mirror of light */
1320 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1322 /* mirror of wandering */
1324 teleport_player(plev * 5);
1328 set_dustrobe(20+randint(20),FALSE);
1330 /* banishing mirror */
1332 if (!get_aim_dir(&dir)) return FALSE;
1333 (void)fire_beam(GF_AWAY_ALL, dir , plev);
1335 /* mirror clashing */
1337 if (!get_aim_dir(&dir)) return FALSE;
1338 fire_ball(GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
1339 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
1341 /* mirror sleeping */
1343 for(x=0;x<cur_wid;x++){
1344 for(y=0;y<cur_hgt;y++){
1345 if(cave[y][x].feat == FEAT_MIRROR){
1346 project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
1353 if (!get_aim_dir(&dir)) return FALSE;
1354 fire_beam(GF_SEEKER,dir, damroll(11+(plev-5)/4,8));
1356 /* seal of mirror */
1358 seal_of_mirror(plev*4+100);
1360 /* shield of water */
1362 tmp = 20+randint(20);
1363 set_shield(tmp, FALSE);
1364 if( plev > 31 )set_tim_reflect(tmp, FALSE);
1365 if( plev > 39 )set_resist_magic(tmp,FALSE);
1369 if (!get_aim_dir(&dir)) return FALSE;
1370 fire_beam(GF_SUPER_RAY,dir, 150+randint(2*plev));
1372 /* illusion light */
1374 tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 3;
1376 stun_monsters(plev*tmp);
1377 confuse_monsters(plev*tmp);
1378 turn_monsters(plev*tmp);
1379 stun_monsters(plev*tmp);
1380 stasis_monsters(plev*tmp);
1384 if( cave[py][px].feat != FEAT_MIRROR ){
1386 msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
1388 msg_print("You cannot find out where is the world of mirror!");
1397 msg_print("¶À¤ÎÀ¤³¦¤òÄ̤êÈ´¤±¡Ä ");
1399 msg_print("Go through the world of mirror...");
1401 return dimension_door();
1402 /* mirror of recall */
1404 if(!word_of_recall())return FALSE;
1408 set_multishadow(6+randint(6),FALSE);
1413 if( !binding_field(plev*11+5) )msg_print("ŬÅö¤Ê¶À¤òÁª¤Ù¤Ê¤«¤Ã¤¿¡ª");
1415 if( !binding_field(plev*11+5) )msg_print("You were not able to choose suitable mirrors!");
1418 /* mirror of Ruffnor */
1420 (void)set_invuln(randint(4)+4,FALSE);
1424 msg_print("¤Ê¤Ë¡©");
1430 p_ptr->magic_num1[0] = 0;
1437 * do_cmd_cast calls this function if the player's class
1440 static bool cast_berserk_spell(int spell)
1449 detect_monsters_mind(DETECT_RAD_DEFAULT);
1456 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
1458 msg_print("You cannot do it when riding.");
1463 if (!get_rep_dir2(&dir)) return FALSE;
1465 if (dir == 5) return FALSE;
1469 if (!cave[y][x].m_idx)
1472 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1474 msg_print("There is no monster.");
1481 if (!player_can_enter(cave[y][x].feat) || is_trap(cave[y][x].feat))
1487 if (player_can_enter(cave[y][x].feat) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
1493 /* Save the old location */
1497 /* Move the player */
1503 /* Redraw the old spot */
1506 /* Redraw the new spot */
1509 /* Check for new panel (redraw map) */
1513 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
1515 /* Update the monsters */
1516 p_ptr->update |= (PU_DISTANCE);
1519 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1521 /* Handle stuff XXX XXX XXX */
1528 if (!get_rep_dir2(&dir)) return FALSE;
1531 move_player(dir, easy_disarm, TRUE);
1535 earthquake(py, px, 8+rand_int(5));
1540 monster_type *m_ptr;
1542 for (dir = 0; dir < 8; dir++)
1544 y = py + ddy_ddd[dir];
1545 x = px + ddx_ddd[dir];
1546 c_ptr = &cave[y][x];
1548 /* Get the monster */
1549 m_ptr = &m_list[c_ptr->m_idx];
1551 /* Hack -- attack monsters */
1552 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
1559 msg_print("¤Ê¤Ë¡©");
1571 * do_cmd_cast calls this function if the player's class
1574 static bool cast_ninja_spell(int spell)
1578 int plev = p_ptr->lev;
1584 (void)unlite_area(0, 3);
1589 wiz_lite(FALSE, TRUE);
1591 detect_monsters_normal(DETECT_RAD_DEFAULT);
1594 detect_traps(DETECT_RAD_DEFAULT);
1595 detect_doors(DETECT_RAD_DEFAULT);
1596 detect_stairs(DETECT_RAD_DEFAULT);
1600 detect_objects_normal(DETECT_RAD_DEFAULT);
1605 teleport_player(10);
1606 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1607 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1612 if (!(p_ptr->special_defense & NINJA_KAWARIMI))
1615 msg_print("Ũ¤Î¹¶·â¤ËÂФ·¤ÆÉÒ´¶¤Ë¤Ê¤Ã¤¿¡£");
1617 msg_print("You are now prepare to evade any attacks.");
1620 p_ptr->special_defense |= NINJA_KAWARIMI;
1621 p_ptr->redraw |= (PR_STATUS);
1627 teleport_player(p_ptr->lev*5);
1628 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1629 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1634 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1637 if (cave[y][x].m_idx)
1640 if (rand_int(p_ptr->skill_dis) < 7)
1642 msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1644 msg_print("You failed to run away.");
1648 teleport_player(30);
1649 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1650 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1656 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1658 msg_print("You don't see any monster in this direction");
1667 if (!get_aim_dir(&dir)) return FALSE;
1668 (void)stasis_monster(dir);
1672 return ident_spell(FALSE);
1675 set_tim_ffall(randint(20) + 20, FALSE);
1678 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
1679 teleport_player(30);
1680 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1681 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1682 set_oppose_fire(plev, FALSE);
1686 if (!get_aim_dir(&dir)) return FALSE;
1687 project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL | PROJECT_NO_REF);
1693 for (i = 0; i < 8; i++)
1697 for (slot = 0; slot < INVEN_PACK; slot++)
1699 if (inventory[slot].tval == TV_SPIKE) break;
1701 if (slot == INVEN_PACK)
1704 if (!i) msg_print("¤¯¤µ¤Ó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£");
1705 else msg_print("¤¯¤µ¤Ó¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1707 if (!i) msg_print("You have no Iron Spikes.");
1708 else msg_print("You have no more Iron Spikes.");
1713 /* Gives a multiplier of 2 at first, up to 3 at 40th */
1714 do_cmd_throw_aux(1, FALSE, slot);
1722 monster_type *m_ptr;
1730 if (!target_set(TARGET_KILL)) return FALSE;
1731 m_idx = cave[target_row][target_col].m_idx;
1733 if (!player_has_los_bold(target_row, target_col)) break;
1734 m_ptr = &m_list[m_idx];
1735 monster_desc(m_name, m_ptr, 0);
1737 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1739 msg_format("You pull back %s.", m_name);
1742 path_n = project_path(path_g, MAX_RANGE, target_row, target_col, py, px, 0);
1743 ty = target_row, tx = target_col;
1744 for (i = 1; i < path_n; i++)
1746 int ny = GRID_Y(path_g[i]);
1747 int nx = GRID_X(path_g[i]);
1749 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
1750 cave[ny][nx].feat != FEAT_GLYPH &&
1751 cave[ny][nx].feat != FEAT_MINOR_GLYPH &&
1752 !(cave[ny][nx].feat >= FEAT_PATTERN_START &&
1753 cave[ny][nx].feat <= FEAT_PATTERN_XTRA2))
1759 /* Update the old location */
1760 cave[target_row][target_col].m_idx = 0;
1762 /* Update the new location */
1763 cave[ty][tx].m_idx = m_idx;
1765 /* Move the monster */
1769 /* Wake the monster up */
1772 /* Update the monster (new location) */
1773 update_mon(m_idx, TRUE);
1775 /* Redraw the old grid */
1776 lite_spot(target_row, target_col);
1778 /* Redraw the new grid */
1781 p_ptr->update |= (PU_MON_LITE);
1786 if (!get_aim_dir(&dir)) return FALSE;
1787 fire_ball(GF_OLD_CONF, dir, plev*3, 3);
1790 project_length = -1;
1791 if (!get_aim_dir(&dir))
1798 (void)teleport_swap(dir);
1804 (void)set_kabenuke(randint(plev/2) + plev/2, FALSE);
1805 set_oppose_acid(plev, FALSE);
1808 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
1809 fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
1810 fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
1811 teleport_player(30);
1812 if (cave[py][px].info & (CAVE_GLOW | CAVE_MNLT)) set_superstealth(FALSE);
1813 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
1818 int num = damroll(3, 9);
1820 for (k = 0; k < num; k++)
1822 int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
1823 int attempts = 1000;
1827 scatter(&y, &x, py, px, 4, 0);
1829 if ((y != py) || (x != px)) break;
1831 project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
1832 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
1837 set_multishadow(6+randint(6), FALSE);
1841 msg_print("¤Ê¤Ë¡©");
1853 * do_cmd_cast calls this function if the player's class
1856 void do_cmd_mind(void)
1861 int plev = p_ptr->lev;
1862 int old_csp = p_ptr->csp;
1865 int use_mind, mana_cost;
1869 bool on_mirror = FALSE;
1871 /* not if confused */
1872 if (p_ptr->confused)
1875 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1877 msg_print("You are too confused!");
1884 if (!get_mind_power(&n, FALSE)) return;
1887 switch(p_ptr->pclass)
1889 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;p = "Àº¿À";break;
1890 case CLASS_FORCETRAINER: use_mind = MIND_KI;p = "µ¤";break;
1891 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;p = "Åܤê";break;
1892 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;p = "¶ÀËâË¡";break;
1893 case CLASS_NINJA: use_mind = MIND_NINJUTSU;p = "Àº¿À";break;
1894 default: use_mind = 0;p = "ĶǽÎÏ";break;
1897 switch(p_ptr->pclass)
1899 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
1900 case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
1901 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;break;
1902 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;break;
1903 case CLASS_NINJA: use_mind = MIND_NINJUTSU;break;
1904 default: use_mind = 0;break;
1907 spell = mind_powers[use_mind].info[n];
1909 /* Spell failure chance */
1910 chance = spell.fail;
1912 mana_cost = spell.mana_cost;
1913 if (use_mind == MIND_KI)
1915 if (heavy_armor()) chance += 20;
1916 if (p_ptr->icky_wield[0]) chance += 20;
1917 else if (buki_motteruka(INVEN_RARM)) chance += 10;
1918 if (p_ptr->icky_wield[1]) chance += 20;
1919 else if (buki_motteruka(INVEN_LARM)) chance += 10;
1923 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
1924 mana_cost += (j+1) * 3 / 2;
1928 /* Verify "dangerous" spells */
1929 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
1931 if (mana_cost > p_ptr->chp)
1934 msg_print("£È£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1936 msg_print("You do not have enough hp to use this power.");
1941 else if (mana_cost > p_ptr->csp)
1945 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1947 msg_print("You do not have enough mana to use this power.");
1951 if (!over_exert) return;
1955 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return;
1957 if (!get_check("Attempt it anyway? ")) return;
1964 /* Reduce failure rate by "effective" level adjustment */
1965 chance -= 3 * (plev - spell.min_lev);
1967 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
1968 if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
1969 if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
1971 /* Reduce failure rate by INT/WIS adjustment */
1972 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
1974 /* Not enough mana to cast */
1975 if ((mana_cost > p_ptr->csp) && (use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1977 chance += 5 * (mana_cost - p_ptr->csp);
1980 /* Extract the minimum failure rate */
1981 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
1983 /* Minimum failure rate */
1984 if (chance < minfail) chance = minfail;
1986 /* Stunning makes spells harder */
1987 if (p_ptr->stun > 50) chance += 25;
1988 else if (p_ptr->stun) chance += 15;
1990 if (use_mind == MIND_KI)
1992 if (heavy_armor()) chance += 5;
1993 if (p_ptr->icky_wield[0]) chance += 5;
1994 if (p_ptr->icky_wield[1]) chance += 5;
1998 /* Always a 5 percent chance of working */
1999 if (chance > 95) chance = 95;
2002 if (rand_int(100) < chance)
2004 if (flush_failure) flush();
2006 msg_format("%s¤Î½¸Ãæ¤Ë¼ºÇÔ¤·¤¿¡ª",p);
2008 msg_format("You failed to concentrate hard enough!");
2013 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
2015 if ((use_mind == MIND_KI) && (n != 5) && p_ptr->magic_num1[0])
2017 msg_print("µ¤¤¬»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
2018 p_ptr->magic_num1[0] = 0;
2021 if (randint(100) < (chance / 2))
2026 if( use_mind == MIND_MINDCRAFTER ){
2030 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ªÆ¬¤ÎÃ椬¿¿¤ÃÇò¤Ë¤Ê¤Ã¤¿¡ª");
2032 msg_print("Oh, no! Your mind has gone blank!");
2040 msg_print("´ñ̯¤Ê¸÷·Ê¤¬ÌܤÎÁ°¤ÇÍ٤äƤ¤¤ë...");
2042 msg_print("Weird visions seem to dance before your eyes...");
2045 set_image(p_ptr->image + 5 + randint(10));
2050 msg_print("¤¢¤Ê¤¿¤ÎƬ¤Ïº®Í𤷤¿¡ª");
2052 msg_print("Your brain is addled!");
2055 set_confused(p_ptr->confused + randint(8));
2059 set_stun(p_ptr->stun + randint(8));
2065 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2067 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2070 project(1, 2 + plev / 10, py, px, plev * 2,
2071 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2072 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2075 if( use_mind == MIND_MIRROR_MASTER ){
2078 /* Nothing has happen */
2083 msg_print("¶À¤ÎÀ¤³¦¤Î´³¾Ä¤ò¼õ¤±¤¿¡ª");
2085 msg_print("Weird visions seem to dance before your eyes...");
2087 teleport_player(10);
2093 msg_print("¤Þ¤ï¤ê¤Î¤â¤Î¤¬¥¥é¥¥éµ±¤¤¤Æ¤¤¤ë¡ª");
2095 msg_print("Your brain is addled!");
2098 set_image(p_ptr->image + 5 + randint(10));
2104 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2106 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2109 project(1, 2 + plev / 10, py, px, plev * 2,
2110 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2111 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2123 case MIND_MINDCRAFTER:
2124 /* Cast the spell */
2125 cast = cast_mindcrafter_spell(n);
2128 /* Cast the spell */
2129 cast = cast_force_spell(n);
2131 case MIND_BERSERKER:
2132 /* Cast the spell */
2133 cast = cast_berserk_spell(n);
2135 case MIND_MIRROR_MASTER:
2136 /* Cast the spell */
2137 if( cave[py][px].feat == FEAT_MIRROR )on_mirror = TRUE;
2138 cast = cast_mirror_spell(n);
2141 /* Cast the spell */
2142 cast = cast_ninja_spell(n);
2146 msg_format("Ææ¤ÎǽÎÏ:%d, %d",use_mind, n);
2148 msg_format("Mystery power:%d, %d",use_mind, n);
2159 /* teleport from mirror costs small energy */
2160 if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
2162 if( n==2 || n==4 || n==6 || n==15 )energy_use = 50;
2165 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
2168 take_hit(DAMAGE_USELIFE, mana_cost, "²áÅ٤ν¸Ãæ", -1);
2170 take_hit(DAMAGE_USELIFE, mana_cost, "concentrating too hard", -1);
2173 p_ptr->redraw |= (PR_HP);
2176 /* Sufficient mana */
2177 else if (mana_cost <= old_csp)
2180 p_ptr->csp -= mana_cost;
2183 if (p_ptr->csp < 0) p_ptr->csp = 0;
2185 if ((use_mind == MIND_MINDCRAFTER) && (n == 13))
2189 p_ptr->csp_frac = 0;
2193 /* Over-exert the player */
2196 int oops = mana_cost - old_csp;
2199 if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
2200 p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
2204 msg_format("%s¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª",p);
2206 msg_print("You faint from the effort!");
2210 /* Hack -- Bypass free action */
2211 (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1));
2213 /* Damage WIS (possibly permanently) */
2214 if (rand_int(100) < 50)
2216 bool perm = (rand_int(100) < 25);
2220 msg_print("¼«Ê¬¤ÎÀº¿À¤ò¹¶·â¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2222 msg_print("You have damaged your mind!");
2226 /* Reduce constitution */
2227 (void)dec_stat(A_WIS, 15 + randint(10), perm);
2232 p_ptr->redraw |= (PR_MANA);
2235 p_ptr->window |= (PW_PLAYER);
2236 p_ptr->window |= (PW_SPELL);
2241 * do_cmd_cast calls this function if the player's class
2244 void do_cmd_mind_browse(void)
2251 if (p_ptr->pclass == CLASS_MINDCRAFTER) use_mind = MIND_MINDCRAFTER;
2252 else if (p_ptr->pclass == CLASS_FORCETRAINER) use_mind = MIND_KI;
2253 else if (p_ptr->pclass == CLASS_BERSERKER) use_mind = MIND_BERSERKER;
2254 else if (p_ptr->pclass == CLASS_NINJA) use_mind = MIND_NINJUTSU;
2255 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
2256 use_mind = MIND_MIRROR_MASTER;
2263 if (!get_mind_power(&n, TRUE))
2269 /* Clear lines, position cursor (really should use strlen here) */
2270 Term_erase(12, 21, 255);
2271 Term_erase(12, 20, 255);
2272 Term_erase(12, 19, 255);
2273 Term_erase(12, 18, 255);
2274 Term_erase(12, 17, 255);
2275 Term_erase(12, 16, 255);
2277 roff_to_buf( mind_tips[use_mind][n],62,temp);
2278 for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
2280 prt(&temp[j], line, 15);
2285 case MIND_MIRROR_MASTER:
2288 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
2290 prt("Hit any key.",0,0);