3 * @brief ³Æ¿¦¶È¤ÎÆü쵻ǽ¼ÂÁõ / Special magics
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research,\n
8 * and not for profit purposes provided that this copyright and statement\n
9 * are included in all such copies. Other copyrights may also apply.\n
11 * 2014 Deskull rearranged comment for Doxygen.\n
13 * mind.c¤È¤¢¤ë¤¬¼ÂºÝ¤Ë¤ÏĶǽÎϼԡ¢Îýµ¤½Ñ»Õ¡¢¶¸Àï»Î¡¢¶À»È¤¤¡¢Ç¦¼Ô¤Þ¤Ç¤Î
14 * Æü쵻ǽ¤ò·¤¨¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¡£
22 /*! Æü쵻ǽ¤Î°ìÍ÷¥Æ¡¼¥Ö¥ë */
23 mind_power mind_powers[5] =
27 /* Level gained, cost, %fail, name */
30 { 2, 1, 20, "¿À·Ð¹¶·â"},
31 { 3, 2, 25, "¼¡¸µ¤Î½Ö¤"},
32 { 7, 6, 35, "µõ¶õ¤Î¸¸±Æ"},
33 { 9, 7, 50, "Àº¿À»ÙÇÛ"},
34 { 11, 7, 30, "Ç°Æ°¾×·âÃÆ"},
35 { 13, 12, 50, "³»²½"},
36 { 15, 12, 60, "¥µ¥¤¥³¥á¥È¥ê¡¼"},
37 { 18, 10, 45, "Àº¿ÀÇÈÆ°"},
38 { 23, 15, 50, "¥¢¥É¥ì¥Ê¥ê¥ó¡¦¥É¡¼¥Ô¥ó¥°"},
39 { 26, 28, 60, "¥Æ¥ì¥¥Í¥·¥¹"},
40 { 28, 10, 40, "¥µ¥¤¥¥Ã¥¯¡¦¥É¥ì¥¤¥ó"},
41 { 35, 35, 75, "¸÷¤Î·õ"},
42 { 45,150, 85, "´°Á´¤ÊÀ¤³¦"},
51 { 1, 1, 15, "Precognition"},
52 { 2, 1, 20, "Neural Blast"},
53 { 3, 2, 25, "Minor Displacement"},
54 { 7, 6, 35, "Major Displacement"},
55 { 9, 7, 50, "Domination"},
56 { 11, 7, 30, "Pulverise"},
57 { 13, 12, 50, "Character Armour"},
58 { 15, 12, 60, "Psychometry" },
59 { 18, 10, 45, "Mind Wave" },
60 { 23, 15, 50, "Adrenaline Channeling"},
61 { 26, 28, 60, "Telekinesis"},
62 { 28, 10, 40, "Psychic Drain"},
63 { 35, 35, 75, "Psycho-Spear"},
64 { 45,150, 85, "The World"},
79 /* Level gained, cost, %fail, name */
83 { 5, 6, 35, "Éñ¶õ½Ñ"},
84 { 8, 5, 40, "¥«¥á¥Ï¥áÇÈ"},
85 { 10, 7, 45, "ÂÐËâË¡Ëɸæ"},
87 { 17, 17, 50, "ŻƮµ¤"},
88 { 20, 20, 50, "¾×ÇÈ"},
89 { 23, 18, 55, "×Âζ"},
90 { 25, 30, 70, "¤¤¤Æ¤Ä¤¯ÇÈÆ°"},
91 { 28, 26, 50, "¸¸Î´"},
92 { 32, 35, 65, "Îû¹ö²Ð±ê"},
93 { 38, 42, 75, "Ķ¥«¥á¥Ï¥áÇÈ"},
94 { 44, 50, 80, "¸÷®°ÜÆ°"},
103 { 1, 1, 15, "Small Force Ball"},
104 { 3, 3, 30, "Flash Light"},
105 { 5, 6, 35, "Flying Technique"},
106 { 8, 5, 40, "Kamehameha"},
107 { 10, 7, 45, "Magic Resistance"},
108 { 13, 5, 60, "Improve Force"},
109 { 17, 17, 50, "Aura of Force"},
110 { 20, 20, 50, "Shock Power"},
111 { 23, 18, 55, "Large Force Ball"},
112 { 25, 30, 70, "Dispel Magic"},
113 { 28, 26, 50, "Summon Ghost"},
114 { 32, 35, 65, "Exploding Frame"},
115 { 38, 42, 75, "Super Kamehameha"},
116 { 44, 50, 80, "Light Speed"},
131 /* Level gained, cost, %fail, name */
133 { 8, 5, 40, "»¦µ¤´¶ÃÎ"},
134 { 15, 20, 0, "ÆÍ·â"},
135 { 20, 15, 0, "¥È¥é¥Ã¥×Ê´ºÕ"},
136 { 25, 20, 60, "ÃÏ¿Ì"},
137 { 30, 80, 75, "³§»¦¤·"},
155 { 8, 5, 40, "Detect Atmosphere of Menace"},
156 { 15, 20, 0, "Charge"},
157 { 20, 15, 0, "Smash a Trap"},
158 { 25, 20, 60, "Quake"},
159 { 30, 80, 75, "Massacre"},
183 /* Level gained, cost, %fail, name */
185 { 1, 1, 15, "¿¿¸«¤Î¶À"},
186 { 1, 2, 40, "¶ÀÀ¸À®"},
187 { 2, 2, 20, "¸÷¤Î¤·¤º¤¯"},
188 { 3, 2, 20, "ÏĤó¤À¶À"},
189 { 5, 3, 35, "Á®¸÷¶À"},
190 { 6, 5, 35, "×Ǥ¨¤ë¶À"},
192 { 10, 5, 30, "Èù¿Ð±£¤ì"},
193 { 12, 12, 30, "ÄÉÊü¤Î¶À"},
194 { 15, 15, 30, "¶ÀºÕ¤"},
195 { 19, 13, 30, "ºÅ̲¶À"},
196 { 23, 18, 50, "¥·¡¼¥«¡¼¥ì¥¤"},
198 { 25, 20, 40, "¶À¤ÎÉõ°õ"},
199 { 27, 30, 60, "¿å¶À¤Î½â"},
200 { 29, 30, 60, "¥¹¡¼¥Ñ¡¼¥ì¥¤"},
201 { 31, 35, 60, "¸¸ÏǤθ÷"},
202 { 33, 50, 80, "¶À¤Î¹ñ"},
204 { 36, 30, 80, "¶ÀÈ´¤±"},
205 { 38, 40, 70, "µ¢´Ô¤Î¶À"},
206 { 40, 50, 55, "±Æʬ¿È"},
207 { 43, 55, 70, "ÉõËâ·ë³¦"},
208 { 46, 70, 75, "¥é¥Õ¥Î¡¼¥ë¤Î¶À"},
210 { 1, 1, 15, "Mirror of Seeing"},
211 { 1, 2, 40, "Making a Mirror"},
212 { 2, 2, 20, "Drip of Light"},
213 { 3, 2, 20, "Warped Mirror"},
214 { 5, 3, 35, "Mirror of Light"},
215 { 6, 5, 35, "Mirror of Wandering"},
217 { 10, 5, 30, "Robe of Dust"},
218 { 12, 12, 30, "Banishing Mirror"},
219 { 15, 15, 30, "Mirror Clashing"},
220 { 19, 13, 30, "Mirror Sleeping"},
221 { 23, 18, 50, "Seeker Ray"},
223 { 25, 20, 40, "Seal of Mirror"},
224 { 27, 30, 60, "Shield of Water"},
225 { 29, 30, 60, "Super Ray"},
226 { 31, 35, 60, "Illusion Light"},
227 { 33, 50, 80, "Mirror Shift"},
229 { 36, 30, 80, "Mirror Tunnel"},
230 { 38, 40, 70, "Mirror of Recall"},
231 { 40, 50, 55, "Multi-Shadow"},
232 { 43, 55, 70, "Binding Field"},
233 { 46, 70, 75, "Mirror of Ruffnor"},
241 /* Level gained, cost, %fail, name */
243 { 1, 1, 20, "°Å°ÇÀ¸À®"},
244 { 2, 2, 25, "¼þÊÕÄ´ºº"},
245 { 3, 3, 25, "ÍÕ±£¤ì"},
246 { 5, 3, 30, "ÊѤï¤ê¿È"},
247 { 7, 8, 35, "¹âÈô¤Ó"},
248 { 8, 10, 35, "°ì·âΥæ"},
249 { 10, 10, 40, "¶âÇû¤ê"},
250 { 12, 12, 70, "¸Å¤Î¸ýÅÁ"},
251 { 15, 10, 50, "Éâ±À"},
252 { 17, 12, 45, "²ÐÆÛ"},
253 { 18, 20, 40, "Æþ¿È"},
254 { 20, 5, 50, "ȬÊý¼ê΢·õ"},
255 { 22, 15, 55, "º¿³ù"},
256 { 25, 32, 60, "±ì¶Ì"},
257 { 28, 32, 60, "ž¿È"},
258 { 30, 30, 70, "Çúȯ¤ÎÌæ¾Ï"},
259 { 32, 40, 40, "ÅÚÆÛ"},
260 { 34, 35, 50, "̸±£¤ì"},
261 { 38, 40, 60, "Îû¹ö²Ð±ê"},
262 { 41, 50, 55, "ʬ¿È"},
265 { 1, 1, 20, "Create Darkness"},
266 { 2, 2, 25, "Detect Near"},
267 { 3, 3, 25, "Hide in Leafs"},
268 { 5, 3, 30, "Kawarimi"},
269 { 7, 8, 35, "Absconding"},
270 { 8, 10, 35, "Hit and Away"},
271 { 10, 10, 40, "Bind Monster"},
272 { 12, 12, 70, "Ancient Knowledge"},
273 { 15, 10, 50, "Floating"},
274 { 17, 12, 45, "Hide in Flame"},
275 { 18, 20, 40, "Nyusin"},
276 { 20, 5, 50, "Syuriken Spreading"},
277 { 22, 15, 55, "Chain Hook"},
278 { 25, 32, 60, "Smoke Ball"},
279 { 28, 32, 60, "Swap Position"},
280 { 30, 30, 70, "Glyph of Explosion"},
281 { 32, 40, 40, "Hide in Mud"},
282 { 34, 35, 50, "Hide in Mist"},
283 { 38, 40, 60, "Rengoku-Kaen"},
284 { 41, 50, 55, "Bunshin"},
293 * @brief Æü쵻ǽ¤Î¸ú²Ì¾ðÊó¤ò¤Þ¤È¤á¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤òÊÖ¤¹
294 * @param p ¾ðÊó¤òÊÖ¤¹Ê¸»úÎ󻲾ȥݥ¤¥ó¥¿
295 * @param use_mind ¿¦¶ÈËè¤ÎÆü쵻ǽID
296 * @param power ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
299 void mindcraft_info(char *p, int use_mind, int power)
302 cptr s_dam = "»½ý:";
303 cptr s_dur = "´ü´Ö:";
304 cptr s_range = "ÈÏ°Ï:";
308 cptr s_range = "range ";
310 int plev = p_ptr->lev;
316 case MIND_MINDCRAFTER:
320 case 1: sprintf(p, " %s%dd%d", s_dam, 3 + ((plev - 1) / 4), 3 + plev/15); break;
321 case 2: sprintf(p, " %s10", s_range); break;
322 case 3: sprintf(p, " %s%d", s_range, plev * 5); break;
324 case 5: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 4)); break;
325 case 6: sprintf(p, " %s%d", s_dur, plev); break;
327 case 8: sprintf(p, (plev < 25 ? " %s%d" : " %sd%d"), s_dam, (plev < 25 ? plev * 3 / 2 : plev * ((plev - 5) / 10 + 1))); break;
328 case 9: sprintf(p, " %s10+d%d", s_dur, plev * 3 / 2); break;
330 case 10: sprintf(p, " ºÇÂç½ÅÎÌ:%d.%dkg", lbtokg1(plev * 15),lbtokg2(plev * 15)); break;
332 case 10: sprintf(p, " max wgt %d", plev * 15); break;
334 case 11: sprintf(p, " %s%dd6", s_dam, plev / 2); break;
335 case 12: sprintf(p, " %sd%d+%d", s_dam, plev * 3, plev * 3); break;
337 case 13: sprintf(p, " ¹ÔÆ°:%ld²ó", (long int)(p_ptr->csp + 100-p_ptr->energy_need - 50)/100); break;
339 case 13: sprintf(p, " %ld acts.", (p_ptr->csp + 100-p_ptr->energy_need - 50)/100); break;
345 int boost = p_ptr->magic_num1[0];
347 if (heavy_armor()) boost /= 2;
351 case 0: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5) + boost / 12); break;
353 case 2: sprintf(p, " %s%d+d30", s_dur, 30 + boost / 5); break;
354 case 3: sprintf(p, " %s%dd5", s_dam, 5 + ((plev - 1) / 5) + boost / 10); break;
355 case 4: sprintf(p, " %s%d+d20", s_dur, 20 + boost / 5); break;
357 case 6: sprintf(p, " %s%d+d%d", s_dur, 15 + boost / 7, plev / 2); break;
358 case 7: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 5) + boost / 12); break;
359 case 8: sprintf(p, " %s10d6+%d", s_dam, plev * 3 / 2 + boost * 3 / 5); break;
362 case 10: sprintf(p, " ºÇÂç%dÂÎ", 1+boost/100); break;
364 case 10: sprintf(p, " max %d", 1+boost/100); break;
366 case 11: sprintf(p, " %s%d", s_dam, 100 + plev + boost); break;
367 case 12: sprintf(p, " %s%dd15", s_dam, 10 + plev / 2 + boost * 3 / 10); break;
369 case 13: sprintf(p, " ¹ÔÆ°:%d+d16²ó", 16+boost/20); break;
371 case 13: sprintf(p, " %d+d16 acts", 16+boost/20); break;
376 case MIND_MIRROR_MASTER:
382 case 2: sprintf(p, " %s%dd4", s_dam, 3 + ((plev - 1) / 5) ); break;
383 case 3: sprintf(p, " %s10", s_range); break;
385 case 5: sprintf(p, " %s%d", s_range, plev *5); break;
386 case 6: sprintf(p, " %s20+d20", s_dur); break;
388 case 8: sprintf(p, " %s%dd8", s_dam, 8+((plev -5)/4) ); break;
390 case 10: sprintf(p, " %s%dd8", s_dam, 11+(plev-5)/4 ); break;
392 case 12: sprintf(p, " %s20+d20", s_dur); break;
393 case 13: sprintf(p, " %s150+d%d", s_dam, plev*2 ); break;
396 case 16: sprintf(p, " %s%d", s_range, plev/2 +10); break;
398 case 18: sprintf(p, " %s6+d6", s_dur); break;
399 case 19: sprintf(p, " %s%d", s_dam, plev*11+5 ); break;
400 case 20: sprintf(p, " %s4+d4", s_dur); break;
410 case 2: sprintf(p, " %s10", s_range); break;
412 case 4: sprintf(p, " %s%d", s_range , plev *5); break;
413 case 5: sprintf(p, " %s30", s_range); break;
416 case 8: sprintf(p, " %s20+d20", s_dur); break;
417 case 9: sprintf(p, " %s%d", s_dam, (50+plev)/2 ); break;
424 case 16: sprintf(p, " %s%d+d%d", s_dur, plev/2, plev/2); break;
425 case 17: sprintf(p, " %s%d*3", s_dam, (75+plev*2/3)/2 ); break;
426 case 18: sprintf(p, " %s%dd10", s_dam, 6+plev/8 ); break;
427 case 19: sprintf(p, " %s6+d6", s_dur); break;
435 * @brief »ÈÍѲÄǽ¤ÊÆü쵻ǽ¤òÁªÂò¤¹¤ë /
436 * Allow user to choose a mindcrafter power.
437 * @param sn ÁªÂò¤·¤¿Æü쵻ǽID¡¢¥¥ã¥ó¥»¥ë¤Î¾ì¹ç-1¡¢ÉÔÀµ¤ÊÁªÂò¤Î¾ì¹ç-2¤òÊÖ¤¹
438 * @param only_browse °ìÍ÷¤ò¸«¤ë¤À¤±¤Î¾ì¹çTRUE¤òÊÖ¤¹
439 * @return ȯư²Äǽ¤ÊËâË¡¤òÁªÂò¤·¤¿¾ì¹çTRUE¡¢¥¥ã¥ó¥»¥ë½èÍý¤«ÉÔÀµ¤ÊÁªÂò¤¬¹Ô¤ï¤ì¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
441 * If a valid spell is chosen, saves it in '*sn' and returns TRUE\n
442 * If the user hits escape, returns FALSE, and set '*sn' to -1\n
443 * If there are no legal choices, returns FALSE, and sets '*sn' to -2\n
445 * The "prompt" should be "cast", "recite", or "study"\n
446 * The "known" should be TRUE for cast/pray, FALSE for study\n
448 * nb: This function has a (trivial) display bug which will be obvious\n
449 * when you run it. It's probably easy to fix but I haven't tried,\n
452 static int get_mind_power(int *sn, bool only_browse)
459 int plev = p_ptr->lev;
468 mind_power *mind_ptr;
471 int menu_line = (use_menu ? 1 : 0);
473 switch(p_ptr->pclass)
475 case CLASS_MINDCRAFTER:
477 use_mind = MIND_MINDCRAFTER;
485 case CLASS_FORCETRAINER:
495 case CLASS_BERSERKER:
497 use_mind = MIND_BERSERKER;
505 case CLASS_MIRROR_MASTER:
507 use_mind = MIND_MIRROR_MASTER;
517 use_mind = MIND_NINJUTSU;
536 mind_ptr = &mind_powers[use_mind];
538 /* Assume cancelled */
541 #ifdef ALLOW_REPEAT /* TNB */
543 /* Get the spell, if available */
546 /* Hack -- If requested INVEN_FORCE(1111), pull again */
547 if (*sn == INVEN_FORCE) repeat_pull(sn);
549 /* Verify the spell */
550 if (mind_ptr->info[*sn].min_lev <= plev)
557 #endif /* ALLOW_REPEAT -- TNB */
559 /* Nothing chosen yet */
565 for (i = 0; i < MAX_MIND_POWERS; i++)
567 if (mind_ptr->info[i].min_lev <= plev)
573 /* Build a prompt (accept all spells) */
577 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤Ë¤Ä¤¤¤ÆÃΤê¤Þ¤¹¤«¡©",
579 (void) strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
581 p, I2A(0), I2A(num - 1), p);
586 (void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
588 (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
590 p, I2A(0), I2A(num - 1), p);
593 if (use_menu && !only_browse) screen_save();
594 /* Get a spell from the user */
596 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
599 if(choice==ESCAPE) choice = ' ';
600 else if( !get_com(out_val, &choice, TRUE) )break;
602 if (use_menu && choice != ' ')
608 if (!only_browse) screen_load();
616 menu_line += (num - 1);
638 if (menu_line > num) menu_line -= num;
641 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
644 if (!redraw || use_menu)
652 /* Save the screen */
653 if (!only_browse && !use_menu) screen_save();
655 /* Display a list of spells */
658 put_str("̾Á°", y, x + 5);
660 put_str("Name", y, x + 5);
664 put_str(format("Lv %s ¼ºÎ¨ ¸ú²Ì", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
666 put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
668 has_weapon[0] = buki_motteruka(INVEN_RARM);
669 has_weapon[1] = buki_motteruka(INVEN_LARM);
671 /* Dump the spells */
672 for (i = 0; i < MAX_MIND_POWERS; i++)
676 /* Access the spell */
677 spell = mind_ptr->info[i];
679 if (spell.min_lev > plev) break;
683 mana_cost = spell.mana_cost;
687 /* Reduce failure rate by "effective" level adjustment */
688 chance -= 3 * (plev - spell.min_lev);
690 /* Reduce failure rate by INT/WIS adjustment */
691 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
693 if (use_mind == MIND_KI)
695 if (heavy_armor()) chance += 20;
696 if (p_ptr->icky_wield[0]) chance += 20;
697 else if (has_weapon[0]) chance += 10;
698 if (p_ptr->icky_wield[1]) chance += 20;
699 else if (has_weapon[1]) chance += 10;
703 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
704 mana_cost += (j+1) * 3 / 2;
708 /* Not enough mana to cast */
709 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU) && (mana_cost > p_ptr->csp))
711 chance += 5 * (mana_cost - p_ptr->csp);
714 chance += p_ptr->to_m_chance;
716 /* Extract the minimum failure rate */
717 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
719 /* Minimum failure rate */
720 if (chance < minfail) chance = minfail;
722 /* Stunning makes spells harder */
723 if (p_ptr->stun > 50) chance += 25;
724 else if (p_ptr->stun) chance += 15;
726 if (use_mind == MIND_KI)
728 if (heavy_armor()) chance += 5;
729 if (p_ptr->icky_wield[0]) chance += 5;
730 if (p_ptr->icky_wield[1]) chance += 5;
732 /* Always a 5 percent chance of working */
733 if (chance > 95) chance = 95;
737 mindcraft_info(comment, use_mind, i);
742 if (i == (menu_line-1)) strcpy(psi_desc, " ¡Õ ");
744 if (i == (menu_line-1)) strcpy(psi_desc, " > ");
746 else strcpy(psi_desc, " ");
749 sprintf(psi_desc, " %c) ",I2A(i));
750 /* Dump the spell --(-- */
752 format("%-30s%2d %4d%s %3d%%%s",
753 spell.name, spell.min_lev, mana_cost,
755 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "¡Á" : " "),
757 (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "),
760 prt(psi_desc, y + i + 1, x);
763 /* Clear the bottom line */
764 prt("", y + i + 1, x);
768 else if (!only_browse)
773 /* Restore the screen */
784 ask = isupper(choice);
787 if (ask) choice = tolower(choice);
789 /* Extract request */
790 i = (islower(choice) ? A2I(choice) : -1);
793 /* Totally Illegal */
794 if ((i < 0) || (i >= num))
800 /* Save the spell index */
801 spell = mind_ptr->info[i];
810 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell.name);
812 (void)strnfmt(tmp_val, 78, "Use %s? ", spell.name);
816 /* Belay that order */
817 if (!get_check(tmp_val)) continue;
824 /* Restore the screen */
825 if (redraw && !only_browse) screen_load();
828 p_ptr->window |= (PW_SPELL);
833 /* Abort if needed */
834 if (!flag) return (FALSE);
836 /* Save the choice */
839 #ifdef ALLOW_REPEAT /* TNB */
843 #endif /* ALLOW_REPEAT -- TNB */
850 * @brief ĶǽÎϤÎȯư /
851 * do_cmd_cast calls this function if the player's class is 'mindcrafter'.
852 * @param spell ȯư¤¹¤ëÆü쵻ǽ¤ÎID
853 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
855 static bool cast_mindcrafter_spell(int spell)
859 int plev = p_ptr->lev;
867 chg_virtue(V_KNOWLEDGE, 1);
868 chg_virtue(V_ENLIGHTEN, 1);
872 map_area(DETECT_RAD_MAP);
876 b = detect_monsters_normal(DETECT_RAD_DEFAULT);
877 if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
879 b |= detect_traps(DETECT_RAD_DEFAULT, TRUE);
880 b |= detect_doors(DETECT_RAD_DEFAULT);
885 b = detect_all(DETECT_RAD_DEFAULT);
888 if ((plev > 24) && (plev < 40))
889 set_tim_esp(plev, FALSE);
892 if (!b) msg_print("°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
894 if (!b) msg_print("You feel safe.");
900 if (!get_aim_dir(&dir)) return FALSE;
902 if (randint1(100) < plev * 2)
903 fire_beam(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
905 fire_ball(GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
909 teleport_player(10, 0L);
913 teleport_player(plev * 5, 0L);
919 if (!get_aim_dir(&dir)) return FALSE;
921 fire_ball(GF_DOMINATION, dir, plev, 0);
925 charm_monsters(plev * 2);
929 /* Fist of Force --- not 'true' TK */
930 if (!get_aim_dir(&dir)) return FALSE;
932 fire_ball(GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
933 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
936 /* Character Armour */
937 set_shield(plev, FALSE);
938 if (plev > 14) set_oppose_acid(plev, FALSE);
939 if (plev > 19) set_oppose_fire(plev, FALSE);
940 if (plev > 24) set_oppose_cold(plev, FALSE);
941 if (plev > 29) set_oppose_elec(plev, FALSE);
942 if (plev > 34) set_oppose_pois(plev, FALSE);
947 return psychometry();
949 return ident_spell(FALSE);
953 msg_print("Àº¿À¤òDZ¤¸¶Ê¤²¤ëÇÈÆ°¤òȯÀ¸¤µ¤»¤¿¡ª");
955 msg_print("Mind-warping forces emanate from your brain!");
959 project(0, 2 + plev / 10, py, px,
960 (plev * 3), GF_PSI, PROJECT_KILL, -1);
962 (void)mindblast_monsters(randint1(plev * ((plev - 5) / 10 + 1)));
970 * Only heal when Adrenalin Channeling is not active. We check
971 * that by checking if the player isn't fast and 'heroed' atm.
973 if (!IS_FAST() || !IS_HERO())
978 b = 10 + randint1((plev * 3) / 2);
981 (void)set_fast(b, FALSE);
985 if (!get_aim_dir(&dir)) return FALSE;
987 fetch(dir, plev * 15, FALSE);
992 if (!get_aim_dir(&dir)) return FALSE;
994 b = damroll(plev / 2, 6);
996 /* This is always a radius-0 ball now */
997 if (fire_ball(GF_PSI_DRAIN, dir, b, 0))
998 p_ptr->energy_need += randint1(150);
1002 if (!get_aim_dir(&dir)) return FALSE;
1004 fire_beam(GF_PSY_SPEAR, dir, randint1(plev*3)+plev*3);
1011 msg_print("´û¤Ë»þ¤Ï»ß¤Þ¤Ã¤Æ¤¤¤ë¡£");
1013 msg_print("Time is already stopped.");
1017 world_player = TRUE;
1019 msg_print("¡Ö»þ¤è¡ª¡×");
1021 msg_print("You yell 'Time!'");
1026 p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10;
1029 p_ptr->redraw |= (PR_MAP);
1031 /* Update monsters */
1032 p_ptr->update |= (PU_MONSTERS);
1035 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1042 msg_print("¤Ê¤Ë¡©");
1053 * @brief Îýµ¤½Ñ¤Îȯư /
1054 * do_cmd_cast calls this function if the player's class is 'ForceTrainer'.
1055 * @param spell ȯư¤¹¤ëÆü쵻ǽ¤ÎID
1056 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
1058 static bool cast_force_spell(int spell)
1061 int plev = p_ptr->lev;
1062 int boost = p_ptr->magic_num1[0];
1064 if (heavy_armor()) boost /= 2;
1070 if (!get_aim_dir(&dir)) return FALSE;
1071 fire_ball(GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
1074 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1077 set_tim_levitation(randint1(30) + 30 + boost / 5, FALSE);
1080 project_length = plev / 8 + 3;
1081 if (!get_aim_dir(&dir)) return FALSE;
1083 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
1086 set_resist_magic(randint1(20) + 20 + boost / 5, FALSE);
1090 msg_print("µ¤¤òÎý¤Ã¤¿¡£");
1092 msg_print("You improved the Force.");
1094 p_ptr->magic_num1[0] += (70 + plev);
1095 p_ptr->update |= (PU_BONUS);
1096 if (randint1(p_ptr->magic_num1[0]) > (plev * 4 + 120))
1099 msg_print("µ¤¤¬Ë½Áö¤·¤¿¡ª");
1101 msg_print("The Force exploded!");
1103 fire_ball(GF_MANA, 0, p_ptr->magic_num1[0] / 2, 10);
1105 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "µ¤¤Î˽Áö", -1);
1107 take_hit(DAMAGE_LOSELIFE, p_ptr->magic_num1[0] / 2, "Explosion of the Force", -1);
1113 set_tim_sh_touki(randint1(plev / 2) + 15 + boost / 7, FALSE);
1119 if (!get_aim_dir(&dir)) return FALSE;
1123 dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
1124 fire_beam(GF_MISSILE, dir, dam);
1125 if (cave[y][x].m_idx)
1130 int m_idx = cave[y][x].m_idx;
1131 monster_type *m_ptr = &m_list[m_idx];
1132 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1135 monster_desc(m_name, m_ptr, 0);
1137 if (randint1(r_ptr->level * 3 / 2) > randint0(dam / 2) + dam/2)
1140 msg_format("%s¤ÏÈô¤Ð¤µ¤ì¤Ê¤«¤Ã¤¿¡£", m_name);
1142 msg_format("%^s was not blown away.", m_name);
1147 for (i = 0; i < 5; i++)
1151 if (cave_empty_bold(y, x))
1158 if ((ty != oy) || (tx != ox))
1161 msg_format("%s¤ò¿á¤Èô¤Ð¤·¤¿¡ª", m_name);
1163 msg_format("You blow %s away!", m_name);
1165 cave[oy][ox].m_idx = 0;
1166 cave[ty][tx].m_idx = m_idx;
1170 update_mon(m_idx, TRUE);
1174 if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
1175 p_ptr->update |= (PU_MON_LITE);
1182 if (!get_aim_dir(&dir)) return FALSE;
1183 fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
1189 if (!target_set(TARGET_KILL)) return FALSE;
1190 m_idx = cave[target_row][target_col].m_idx;
1192 if (!player_has_los_bold(target_row, target_col)) break;
1193 if (!projectable(py, px, target_row, target_col)) break;
1194 dispel_monster_status(m_idx);
1200 bool success = FALSE;
1202 for (i = 0; i < 1 + boost/100; i++)
1203 if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, PM_FORCE_PET))
1208 msg_print("¸æÍѤǤ´¤¶¤¤¤Þ¤¹¤¬¡¢¸æ¼ç¿ÍÍÍ¡©");
1210 msg_print("'Your wish, master?'");
1216 msg_print("²¿¤â¸½¤ì¤Ê¤«¤Ã¤¿¡£");
1218 msg_print("Nothing happen.");
1224 fire_ball(GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10);
1227 if (!get_aim_dir(&dir)) return FALSE;
1229 fire_beam(GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
1232 set_lightspeed(randint1(16) + 16 + boost / 20, FALSE);
1236 msg_print("¤Ê¤Ë¡©");
1242 p_ptr->magic_num1[0] = 0;
1243 p_ptr->update |= (PU_BONUS);
1250 * @brief ¸½ºß¥Õ¥í¥¢¤Ë¸ºß¤·¤Æ¤¤¤ë¶À¤Î¿ô¤ò¿ô¤¨¤ë / calculate mirrors
1253 static int number_of_mirrors( void )
1257 for( x=0 ; x < cur_wid ; x++ ){
1258 for( y=0 ; y < cur_hgt ; y++ ){
1259 if (is_mirror_grid(&cave[y][x])) val++;
1266 * @brief ¶ÀËâË¡¤Îȯư /
1267 * do_cmd_cast calls this function if the player's class is 'Mirror magic'.
1268 * @param spell ȯư¤¹¤ëÆü쵻ǽ¤ÎID
1269 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
1271 static bool cast_mirror_spell(int spell)
1274 int plev = p_ptr->lev;
1281 /* mirror of seeing */
1283 tmp = is_mirror_grid(&cave[py][px]) ? 4 : 0;
1284 if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
1285 if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
1286 if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
1287 if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
1288 if( tmp == 0 && plev < 5 ){
1290 msg_print("¶À¤¬¤Ê¤¯¤Æ½¸Ãæ¤Ç¤¤Ê¤«¤Ã¤¿¡ª");
1292 msg_print("You need a mirror to concentrate!");
1298 if( number_of_mirrors() < 4 + plev/10 ){
1303 msg_format("¤³¤ì°Ê¾å¶À¤ÏÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
1305 msg_format("There are too many mirrors to control!");
1310 if (!get_aim_dir(&dir)) return FALSE;
1311 if ( plev > 9 && is_mirror_grid(&cave[py][px]) ) {
1312 fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1315 fire_bolt(GF_LITE, dir,damroll(3+((plev-1)/5),4));
1320 teleport_player(10, 0L);
1322 /* mirror of light */
1324 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
1326 /* mirror of wandering */
1328 teleport_player(plev * 5, 0L);
1332 set_dustrobe(20+randint1(20),FALSE);
1334 /* banishing mirror */
1336 if (!get_aim_dir(&dir)) return FALSE;
1337 (void)fire_beam(GF_AWAY_ALL, dir , plev);
1339 /* mirror clashing */
1341 if (!get_aim_dir(&dir)) return FALSE;
1342 fire_ball(GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
1343 (plev > 20 ? (plev - 20) / 8 + 1 : 0));
1345 /* mirror sleeping */
1347 for(x=0;x<cur_wid;x++){
1348 for(y=0;y<cur_hgt;y++){
1349 if (is_mirror_grid(&cave[y][x])) {
1350 project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1357 if (!get_aim_dir(&dir)) return FALSE;
1358 fire_beam(GF_SEEKER,dir, damroll(11+(plev-5)/4,8));
1360 /* seal of mirror */
1362 seal_of_mirror(plev*4+100);
1364 /* shield of water */
1366 tmp = 20+randint1(20);
1367 set_shield(tmp, FALSE);
1368 if( plev > 31 )set_tim_reflect(tmp, FALSE);
1369 if( plev > 39 )set_resist_magic(tmp,FALSE);
1373 if (!get_aim_dir(&dir)) return FALSE;
1374 fire_beam(GF_SUPER_RAY,dir, 150+randint1(2*plev));
1376 /* illusion light */
1378 tmp = is_mirror_grid(&cave[py][px]) ? 4 : 3;
1379 slow_monsters(plev);
1380 stun_monsters(plev*tmp);
1381 confuse_monsters(plev*tmp);
1382 turn_monsters(plev*tmp);
1383 stun_monsters(plev*tmp);
1384 stasis_monsters(plev*tmp);
1388 if( !is_mirror_grid(&cave[py][px]) ){
1390 msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
1392 msg_print("You cannot find out where is the world of mirror!");
1401 msg_print("¶À¤ÎÀ¤³¦¤òÄ̤êÈ´¤±¡Ä ");
1403 msg_print("Go through the world of mirror...");
1405 return mirror_tunnel();
1407 /* mirror of recall */
1409 return word_of_recall();
1412 set_multishadow(6+randint1(6),FALSE);
1417 if( !binding_field(plev*11+5) )msg_print("ŬÅö¤Ê¶À¤òÁª¤Ù¤Ê¤«¤Ã¤¿¡ª");
1419 if( !binding_field(plev*11+5) )msg_print("You were not able to choose suitable mirrors!");
1422 /* mirror of Ruffnor */
1424 (void)set_invuln(randint1(4)+4,FALSE);
1428 msg_print("¤Ê¤Ë¡©");
1434 p_ptr->magic_num1[0] = 0;
1440 * @brief Åܤê¤Îȯư /
1441 * do_cmd_cast calls this function if the player's class is 'berserker'.
1442 * @param spell ȯư¤¹¤ëÆü쵻ǽ¤ÎID
1443 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
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, 0) || is_trap(cave[y][x].feat))
1492 if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
1496 /* Move the player */
1497 (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
1503 if (!get_rep_dir2(&dir)) return FALSE;
1506 move_player(dir, easy_disarm, TRUE);
1510 earthquake(py, px, 8+randint0(5));
1517 msg_print("¤Ê¤Ë¡©");
1527 * @brief Ǧ½Ñ¤Îȯư /
1528 * do_cmd_cast calls this function if the player's class is 'ninja'.
1529 * @param spell ȯư¤¹¤ëÆü쵻ǽ¤ÎID
1530 * @return ½èÍý¤ò¼Â¹Ô¤·¤¿¤éTRUE¡¢¥¥ã¥ó¥»¥ë¤·¤¿¾ì¹çFALSE¤òÊÖ¤¹¡£
1532 static bool cast_ninja_spell(int spell)
1536 int plev = p_ptr->lev;
1542 (void)unlite_area(0, 3);
1549 detect_monsters_normal(DETECT_RAD_DEFAULT);
1552 detect_traps(DETECT_RAD_DEFAULT, TRUE);
1553 detect_doors(DETECT_RAD_DEFAULT);
1554 detect_stairs(DETECT_RAD_DEFAULT);
1558 detect_objects_normal(DETECT_RAD_DEFAULT);
1563 teleport_player(10, 0L);
1568 if (!(p_ptr->special_defense & NINJA_KAWARIMI))
1571 msg_print("Ũ¤Î¹¶·â¤ËÂФ·¤ÆÉÒ´¶¤Ë¤Ê¤Ã¤¿¡£");
1573 msg_print("You are now prepare to evade any attacks.");
1576 p_ptr->special_defense |= NINJA_KAWARIMI;
1577 p_ptr->redraw |= (PR_STATUS);
1583 teleport_player(p_ptr->lev * 5, 0L);
1588 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1591 if (cave[y][x].m_idx)
1594 if (randint0(p_ptr->skill_dis) < 7)
1596 msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1598 msg_print("You failed to run away.");
1602 teleport_player(30, 0L);
1608 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1610 msg_print("You don't see any monster in this direction");
1619 if (!get_aim_dir(&dir)) return FALSE;
1620 (void)stasis_monster(dir);
1624 return ident_spell(FALSE);
1626 set_tim_levitation(randint1(20) + 20, FALSE);
1629 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
1630 teleport_player(30, 0L);
1631 set_oppose_fire(plev, FALSE);
1634 return rush_attack(NULL);
1638 for (i = 0; i < 8; i++)
1642 for (slot = 0; slot < INVEN_PACK; slot++)
1644 if (inventory[slot].tval == TV_SPIKE) break;
1646 if (slot == INVEN_PACK)
1649 if (!i) msg_print("¤¯¤µ¤Ó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£");
1650 else msg_print("¤¯¤µ¤Ó¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1652 if (!i) msg_print("You have no Iron Spikes.");
1653 else msg_print("You have no more Iron Spikes.");
1658 /* Gives a multiplier of 2 at first, up to 3 at 40th */
1659 do_cmd_throw_aux(1, FALSE, slot);
1667 monster_type *m_ptr;
1675 if (!target_set(TARGET_KILL)) return FALSE;
1676 m_idx = cave[target_row][target_col].m_idx;
1678 if (m_idx == p_ptr->riding) break;
1679 if (!player_has_los_bold(target_row, target_col)) break;
1680 if (!projectable(py, px, target_row, target_col)) break;
1681 m_ptr = &m_list[m_idx];
1682 monster_desc(m_name, m_ptr, 0);
1684 msg_format("%s¤ò°ú¤Ìᤷ¤¿¡£", m_name);
1686 msg_format("You pull back %s.", m_name);
1689 path_n = project_path(path_g, MAX_RANGE, target_row, target_col, py, px, 0);
1690 ty = target_row, tx = target_col;
1691 for (i = 1; i < path_n; i++)
1693 int ny = GRID_Y(path_g[i]);
1694 int nx = GRID_X(path_g[i]);
1695 cave_type *c_ptr = &cave[ny][nx];
1697 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
1698 !(c_ptr->info & CAVE_OBJECT) &&
1699 !pattern_tile(ny, nx))
1705 /* Update the old location */
1706 cave[target_row][target_col].m_idx = 0;
1708 /* Update the new location */
1709 cave[ty][tx].m_idx = m_idx;
1711 /* Move the monster */
1715 /* Wake the monster up */
1716 (void)set_monster_csleep(m_idx, 0);
1718 /* Update the monster (new location) */
1719 update_mon(m_idx, TRUE);
1721 /* Redraw the old grid */
1722 lite_spot(target_row, target_col);
1724 /* Redraw the new grid */
1727 if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
1728 p_ptr->update |= (PU_MON_LITE);
1732 /* Auto-Recall if possible and visible */
1733 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
1735 /* Track a new monster */
1736 health_track(m_idx);
1742 if (!get_aim_dir(&dir)) return FALSE;
1743 fire_ball(GF_OLD_CONF, dir, plev*3, 3);
1746 project_length = -1;
1747 if (!get_aim_dir(&dir))
1754 (void)teleport_swap(dir);
1760 (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
1761 set_oppose_acid(plev, FALSE);
1764 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
1765 fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2);
1766 fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2);
1767 teleport_player(30, 0L);
1772 int num = damroll(3, 9);
1774 for (k = 0; k < num; k++)
1776 int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
1777 int attempts = 1000;
1781 scatter(&y, &x, py, px, 4, 0);
1783 if (!player_bold(y, x)) break;
1785 project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
1786 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
1791 set_multishadow(6+randint1(6), FALSE);
1795 msg_print("¤Ê¤Ë¡©");
1805 * @brief Æü쵻ǽ¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
1808 void do_cmd_mind(void)
1813 int plev = p_ptr->lev;
1814 int old_csp = p_ptr->csp;
1817 int use_mind, mana_cost;
1821 bool on_mirror = FALSE;
1823 /* not if confused */
1824 if (p_ptr->confused)
1827 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1829 msg_print("You are too confused!");
1836 if (!get_mind_power(&n, FALSE)) return;
1839 switch(p_ptr->pclass)
1841 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;p = "Àº¿À";break;
1842 case CLASS_FORCETRAINER: use_mind = MIND_KI;p = "µ¤";break;
1843 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;p = "Åܤê";break;
1844 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;p = "¶ÀËâË¡";break;
1845 case CLASS_NINJA: use_mind = MIND_NINJUTSU;p = "Àº¿À";break;
1846 default: use_mind = 0;p = "ĶǽÎÏ";break;
1849 switch(p_ptr->pclass)
1851 case CLASS_MINDCRAFTER: use_mind = MIND_MINDCRAFTER;break;
1852 case CLASS_FORCETRAINER: use_mind = MIND_KI;break;
1853 case CLASS_BERSERKER: use_mind = MIND_BERSERKER;break;
1854 case CLASS_MIRROR_MASTER: use_mind = MIND_MIRROR_MASTER;break;
1855 case CLASS_NINJA: use_mind = MIND_NINJUTSU;break;
1856 default: use_mind = 0;break;
1859 spell = mind_powers[use_mind].info[n];
1861 /* Spell failure chance */
1862 chance = spell.fail;
1864 mana_cost = spell.mana_cost;
1865 if (use_mind == MIND_KI)
1867 if (heavy_armor()) chance += 20;
1868 if (p_ptr->icky_wield[0]) chance += 20;
1869 else if (buki_motteruka(INVEN_RARM)) chance += 10;
1870 if (p_ptr->icky_wield[1]) chance += 20;
1871 else if (buki_motteruka(INVEN_LARM)) chance += 10;
1875 for (j = 0; j < p_ptr->magic_num1[0] / 50; j++)
1876 mana_cost += (j+1) * 3 / 2;
1880 /* Verify "dangerous" spells */
1881 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
1883 if (mana_cost > p_ptr->chp)
1886 msg_print("£È£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1888 msg_print("You do not have enough hp to use this power.");
1893 else if (mana_cost > p_ptr->csp)
1897 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1899 msg_print("You do not have enough mana to use this power.");
1903 if (!over_exert) return;
1907 if (!get_check("¤½¤ì¤Ç¤âÄ©À路¤Þ¤¹¤«? ")) return;
1909 if (!get_check("Attempt it anyway? ")) return;
1916 /* Reduce failure rate by "effective" level adjustment */
1917 chance -= 3 * (plev - spell.min_lev);
1919 chance += p_ptr->to_m_chance;
1921 /* Reduce failure rate by INT/WIS adjustment */
1922 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
1924 /* Not enough mana to cast */
1925 if ((mana_cost > p_ptr->csp) && (use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1927 chance += 5 * (mana_cost - p_ptr->csp);
1930 /* Extract the minimum failure rate */
1931 minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
1933 /* Minimum failure rate */
1934 if (chance < minfail) chance = minfail;
1936 /* Stunning makes spells harder */
1937 if (p_ptr->stun > 50) chance += 25;
1938 else if (p_ptr->stun) chance += 15;
1940 if (use_mind == MIND_KI)
1942 if (heavy_armor()) chance += 5;
1943 if (p_ptr->icky_wield[0]) chance += 5;
1944 if (p_ptr->icky_wield[1]) chance += 5;
1948 /* Always a 5 percent chance of working */
1949 if (chance > 95) chance = 95;
1952 if (randint0(100) < chance)
1954 if (flush_failure) flush();
1956 msg_format("%s¤Î½¸Ãæ¤Ë¼ºÇÔ¤·¤¿¡ª",p);
1958 msg_format("You failed to concentrate hard enough!");
1963 if ((use_mind != MIND_BERSERKER) && (use_mind != MIND_NINJUTSU))
1965 if ((use_mind == MIND_KI) && (n != 5) && p_ptr->magic_num1[0])
1968 msg_print("µ¤¤¬»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
1970 msg_print("Your improved Force has gone away...");
1972 p_ptr->magic_num1[0] = 0;
1975 if (randint1(100) < (chance / 2))
1980 if( use_mind == MIND_MINDCRAFTER ){
1984 msg_print("¤Ê¤ó¤Æ¤³¤Ã¤¿¡ªÆ¬¤ÎÃ椬¿¿¤ÃÇò¤Ë¤Ê¤Ã¤¿¡ª");
1986 msg_print("Oh, no! Your mind has gone blank!");
1994 msg_print("´ñ̯¤Ê¸÷·Ê¤¬ÌܤÎÁ°¤ÇÍ٤äƤ¤¤ë...");
1996 msg_print("Weird visions seem to dance before your eyes...");
1999 set_image(p_ptr->image + 5 + randint1(10));
2004 msg_print("¤¢¤Ê¤¿¤ÎƬ¤Ïº®Í𤷤¿¡ª");
2006 msg_print("Your brain is addled!");
2009 set_confused(p_ptr->confused + randint1(8));
2013 set_stun(p_ptr->stun + randint1(8));
2019 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2021 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2024 project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
2025 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2026 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2029 if( use_mind == MIND_MIRROR_MASTER ){
2032 /* Nothing has happen */
2037 msg_print("¶À¤ÎÀ¤³¦¤Î´³¾Ä¤ò¼õ¤±¤¿¡ª");
2039 msg_print("Weird visions seem to dance before your eyes...");
2041 teleport_player(10, TELEPORT_PASSIVE);
2046 msg_print("¤Þ¤ï¤ê¤Î¤â¤Î¤¬¥¥é¥¥éµ±¤¤¤Æ¤¤¤ë¡ª");
2048 msg_print("Your brain is addled!");
2051 set_image(p_ptr->image + 5 + randint1(10));
2057 msg_format("%s¤ÎÎϤ¬À©¸æ¤Ç¤¤Ê¤¤ÈÅή¤È¤Ê¤Ã¤Æ²òÊü¤µ¤ì¤¿¡ª", p);
2059 msg_print("Your mind unleashes its power in an uncontrollable storm!");
2062 project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
2063 GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
2064 p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
2076 case MIND_MINDCRAFTER:
2077 /* Cast the spell */
2078 cast = cast_mindcrafter_spell(n);
2081 /* Cast the spell */
2082 cast = cast_force_spell(n);
2084 case MIND_BERSERKER:
2085 /* Cast the spell */
2086 cast = cast_berserk_spell(n);
2088 case MIND_MIRROR_MASTER:
2089 /* Cast the spell */
2090 if( is_mirror_grid(&cave[py][px]) )on_mirror = TRUE;
2091 cast = cast_mirror_spell(n);
2094 /* Cast the spell */
2095 cast = cast_ninja_spell(n);
2099 msg_format("Ææ¤ÎǽÎÏ:%d, %d",use_mind, n);
2101 msg_format("Mystery power:%d, %d",use_mind, n);
2112 /* teleport from mirror costs small energy */
2113 if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
2115 if( n==3 || n==5 || n==7 || n==16 )energy_use = 50;
2118 if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
2121 take_hit(DAMAGE_USELIFE, mana_cost, "²áÅ٤ν¸Ãæ", -1);
2123 take_hit(DAMAGE_USELIFE, mana_cost, "concentrating too hard", -1);
2126 p_ptr->redraw |= (PR_HP);
2129 /* Sufficient mana */
2130 else if (mana_cost <= old_csp)
2133 p_ptr->csp -= mana_cost;
2136 if (p_ptr->csp < 0) p_ptr->csp = 0;
2138 if ((use_mind == MIND_MINDCRAFTER) && (n == 13))
2142 p_ptr->csp_frac = 0;
2146 /* Over-exert the player */
2149 int oops = mana_cost - old_csp;
2152 if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
2153 p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
2157 msg_format("%s¤ò½¸Ã椷¤¹¤®¤Æµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª",p);
2159 msg_print("You faint from the effort!");
2163 /* Hack -- Bypass free action */
2164 (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2166 /* Damage WIS (possibly permanently) */
2167 if (randint0(100) < 50)
2169 bool perm = (randint0(100) < 25);
2173 msg_print("¼«Ê¬¤ÎÀº¿À¤ò¹¶·â¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
2175 msg_print("You have damaged your mind!");
2179 /* Reduce constitution */
2180 (void)dec_stat(A_WIS, 15 + randint1(10), perm);
2185 p_ptr->redraw |= (PR_MANA);
2188 p_ptr->window |= (PW_PLAYER);
2189 p_ptr->window |= (PW_SPELL);
2194 * @brief ¸½ºß¥×¥ì¥¤¥ä¡¼¤¬»ÈÍѲÄǽ¤ÊÆü쵻ǽ¤Î°ìÍ÷ɽ¼¨ /
2197 void do_cmd_mind_browse(void)
2204 if (p_ptr->pclass == CLASS_MINDCRAFTER) use_mind = MIND_MINDCRAFTER;
2205 else if (p_ptr->pclass == CLASS_FORCETRAINER) use_mind = MIND_KI;
2206 else if (p_ptr->pclass == CLASS_BERSERKER) use_mind = MIND_BERSERKER;
2207 else if (p_ptr->pclass == CLASS_NINJA) use_mind = MIND_NINJUTSU;
2208 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
2209 use_mind = MIND_MIRROR_MASTER;
2216 if (!get_mind_power(&n, TRUE))
2222 /* Clear lines, position cursor (really should use strlen here) */
2223 Term_erase(12, 21, 255);
2224 Term_erase(12, 20, 255);
2225 Term_erase(12, 19, 255);
2226 Term_erase(12, 18, 255);
2227 Term_erase(12, 17, 255);
2228 Term_erase(12, 16, 255);
2230 roff_to_buf(mind_tips[use_mind][n], 62, temp, sizeof(temp));
2231 for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
2233 prt(&temp[j], line, 15);
2238 case MIND_MIRROR_MASTER:
2241 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
2243 prt("Hit any key.",0,0);