3 /* Purpose: Mindcrafter code */
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
15 #define TECHNIC_HISSATSU (REALM_HISSATSU - MIN_TECHNIC)
18 * Allow user to choose a mindcrafter power.
20 * If a valid spell is chosen, saves it in '*sn' and returns TRUE
21 * If the user hits escape, returns FALSE, and set '*sn' to -1
22 * If there are no legal choices, returns FALSE, and sets '*sn' to -2
24 * The "prompt" should be "cast", "recite", or "study"
25 * The "known" should be TRUE for cast/pray, FALSE for study
27 * nb: This function has a (trivial) display bug which will be obvious
28 * when you run it. It's probably easy to fix but I haven't tried,
31 static int get_hissatsu_power(int *sn)
37 int plev = p_ptr->lev;
45 cptr p = "special attack";
50 int menu_line = (use_menu ? 1 : 0);
52 /* Assume cancelled */
55 #ifdef ALLOW_REPEAT /* TNB */
57 /* Get the spell, if available */
60 /* Verify the spell */
61 if (technic_info[TECHNIC_HISSATSU][*sn].slevel <= plev)
68 #endif /* ALLOW_REPEAT -- TNB */
70 /* Nothing chosen yet */
76 for (i = 0; i < 32; i++)
78 if (technic_info[TECHNIC_HISSATSU][i].slevel <= PY_MAX_LEVEL)
85 /* Build a prompt (accept all spells) */
86 (void) strnfmt(out_val, 78,
88 "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
90 "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
92 p, I2A(0), "abcdefghijklmnopqrstuvwxyz012345"[num-1], p);
94 if (use_menu) screen_save();
96 /* Get a spell from the user */
98 choice= always_show_list ? ESCAPE:1 ;
101 if(choice==ESCAPE) choice = ' ';
102 else if( !get_com(out_val, &choice, FALSE) )break;
104 if (use_menu && choice != ' ')
121 if (menu_line > 32) menu_line -= 32;
122 } while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))));
133 if (menu_line > 32) menu_line -= 32;
134 } while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))));
145 bool reverse = FALSE;
146 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
153 while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))))
158 if (menu_line < 2) reverse = FALSE;
163 if (menu_line > 31) reverse = TRUE;
181 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
184 if (!redraw || use_menu)
192 /* Save the screen */
193 if (!use_menu) screen_save();
195 /* Display a list of spells */
198 put_str("̾Á° Lv MP ̾Á° Lv MP ", y, x + 5);
200 put_str("name Lv SP name Lv SP ", y, x + 5);
203 /* Dump the spells */
204 for (i = 0, line = 0; i < 32; i++)
206 spell = technic_info[TECHNIC_HISSATSU][i];
208 if (spell.slevel > PY_MAX_LEVEL) continue;
210 if (!(p_ptr->spell_learned1 >> i)) break;
212 /* Access the spell */
213 if (spell.slevel > plev) continue;
214 if (!(p_ptr->spell_learned1 & (1L << i))) continue;
217 if (i == (menu_line-1))
219 strcpy(psi_desc, " ¡Õ");
221 strcpy(psi_desc, " > ");
223 else strcpy(psi_desc, " ");
230 letter = I2A(line-1);
232 letter = '0' + line - 27;
233 sprintf(psi_desc, " %c)",letter);
236 /* Dump the spell --(-- */
237 strcat(psi_desc, format(" %-18s%2d %3d",
238 spell_names[technic2magic(REALM_HISSATSU)-1][i],
239 spell.slevel, spell.smana));
240 prt(psi_desc, y + (line%17) + (line >= 17), x+(line/17)*30);
241 prt("", y + (line%17) + (line >= 17) + 1, x+(line/17)*30);
251 /* Restore the screen */
264 ask = (isupper(choice));
267 if (ask) choice = tolower(choice);
269 /* Extract request */
270 i = (islower(choice) ? A2I(choice) : -1);
274 ask = FALSE; /* Can't uppercase digits */
276 i = choice - '0' + 26;
280 /* Totally Illegal */
281 if ((i < 0) || (i >= 32) || !(p_ptr->spell_learned1 & (1 << sentaku[i])))
296 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell_names[technic2magic(REALM_HISSATSU)-1][j]);
298 (void)strnfmt(tmp_val, 78, "Use %s? ", spell_names[technic2magic(REALM_HISSATSU)-1][j]);
302 /* Belay that order */
303 if (!get_check(tmp_val)) continue;
310 /* Restore the screen */
311 if (redraw) screen_load();
314 p_ptr->window |= (PW_SPELL);
320 /* Abort if needed */
321 if (!flag) return (FALSE);
323 /* Save the choice */
326 #ifdef ALLOW_REPEAT /* TNB */
330 #endif /* ALLOW_REPEAT -- TNB */
338 * do_cmd_cast calls this function if the player's class
341 static bool cast_hissatsu_spell(int spell)
352 if (!get_aim_dir(&dir)) return FALSE;
353 project_hook(GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
359 if (!get_rep_dir2(&dir)) return FALSE;
360 if (dir == 5) return FALSE;
361 for (cdir = 0;cdir < 8; cdir++)
363 if (cdd[cdir] == dir) break;
365 if (cdir == 8) return FALSE;
366 y = py + ddy_cdd[cdir];
367 x = px + ddx_cdd[cdir];
368 if (cave[y][x].m_idx)
372 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
374 msg_print("You attack the empty air.");
376 y = py + ddy_cdd[(cdir + 7) % 8];
377 x = px + ddx_cdd[(cdir + 7) % 8];
378 if (cave[y][x].m_idx)
382 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
384 msg_print("You attack the empty air.");
386 y = py + ddy_cdd[(cdir + 1) % 8];
387 x = px + ddx_cdd[(cdir + 1) % 8];
388 if (cave[y][x].m_idx)
392 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
394 msg_print("You attack the empty air.");
401 if (!do_cmd_throw_aux(1, TRUE, 0)) return FALSE;
406 if (!get_rep_dir2(&dir)) return FALSE;
407 if (dir == 5) return FALSE;
410 if (cave[y][x].m_idx)
411 py_attack(y, x, HISSATSU_FIRE);
415 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
417 msg_print("There is no monster.");
425 detect_monsters_mind(DETECT_RAD_DEFAULT);
430 if (!get_rep_dir2(&dir)) return FALSE;
431 if (dir == 5) return FALSE;
434 if (cave[y][x].m_idx)
435 py_attack(y, x, HISSATSU_MINEUCHI);
439 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
441 msg_print("There is no monster.");
452 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
454 msg_print("You cannot do it when riding.");
459 msg_print("Áê¼ê¤Î¹¶·â¤ËÂФ·¤Æ¿È¹½¤¨¤¿¡£");
461 msg_print("You prepare to counter blow.");
463 p_ptr->counter = TRUE;
471 msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
473 msg_print("You cannot do it when riding.");
478 if (!get_rep_dir2(&dir)) return FALSE;
480 if (dir == 5) return FALSE;
484 if (!cave[y][x].m_idx)
487 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
489 msg_print("There is no monster.");
496 if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
502 if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
506 /* Move the player */
507 (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
513 if (!get_rep_dir2(&dir)) return FALSE;
514 if (dir == 5) return FALSE;
517 if (cave[y][x].m_idx)
518 py_attack(y, x, HISSATSU_POISON);
522 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
524 msg_print("There is no monster.");
532 if (!get_rep_dir2(&dir)) return FALSE;
533 if (dir == 5) return FALSE;
536 if (cave[y][x].m_idx)
537 py_attack(y, x, HISSATSU_ZANMA);
541 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
543 msg_print("There is no monster.");
551 if (!get_rep_dir2(&dir)) return FALSE;
552 if (dir == 5) return FALSE;
555 if (cave[y][x].m_idx)
560 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
562 msg_print("There is no monster.");
566 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
570 if (cave[y][x].m_idx)
575 int m_idx = cave[y][x].m_idx;
576 monster_type *m_ptr = &m_list[m_idx];
579 monster_desc(m_name, m_ptr, 0);
581 for (i = 0; i < 5; i++)
585 if (cave_empty_bold(y, x))
592 if ((ty != oy) || (tx != ox))
595 msg_format("%s¤ò¿á¤Èô¤Ð¤·¤¿¡ª", m_name);
597 msg_format("You blow %s away!", m_name);
599 cave[oy][ox].m_idx = 0;
600 cave[ty][tx].m_idx = m_idx;
604 update_mon(m_idx, TRUE);
608 if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
609 p_ptr->update |= (PU_MON_LITE);
618 if (!identify_fully(TRUE)) return FALSE;
622 if (!ident_spell(TRUE)) return FALSE;
628 if (!get_rep_dir2(&dir)) return FALSE;
629 if (dir == 5) return FALSE;
632 if (cave[y][x].m_idx)
633 py_attack(y, x, HISSATSU_HAGAN);
635 if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
637 /* Destroy the feature */
638 cave_alter_feat(y, x, FF_HURT_ROCK);
640 /* Update some things */
641 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
647 if (!get_rep_dir2(&dir)) return FALSE;
648 if (dir == 5) return FALSE;
651 if (cave[y][x].m_idx)
652 py_attack(y, x, HISSATSU_COLD);
656 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
658 msg_print("There is no monster.");
666 if (!get_rep_dir2(&dir)) return FALSE;
667 if (dir == 5) return FALSE;
670 if (cave[y][x].m_idx)
671 py_attack(y, x, HISSATSU_KYUSHO);
675 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
677 msg_print("There is no monster.");
685 if (!get_rep_dir2(&dir)) return FALSE;
686 if (dir == 5) return FALSE;
689 if (cave[y][x].m_idx)
690 py_attack(y, x, HISSATSU_MAJIN);
694 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
696 msg_print("There is no monster.");
704 if (!get_rep_dir2(&dir)) return FALSE;
705 if (dir == 5) return FALSE;
708 if (cave[y][x].m_idx)
709 py_attack(y, x, HISSATSU_SUTEMI);
713 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
715 msg_print("There is no monster.");
719 p_ptr->sutemi = TRUE;
724 if (!get_rep_dir2(&dir)) return FALSE;
725 if (dir == 5) return FALSE;
728 if (cave[y][x].m_idx)
729 py_attack(y, x, HISSATSU_ELEC);
733 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
735 msg_print("There is no monster.");
742 return rush_attack(NULL);
743 case 19: /* Whirlwind Attack */
749 if (p_ptr->cut < 300)
750 set_cut(p_ptr->cut + 300);
752 set_cut(p_ptr->cut * 2);
754 for (dir = 0; dir < 8; dir++)
756 y = py + ddy_ddd[dir];
757 x = px + ddx_ddd[dir];
760 /* Get the monster */
761 m_ptr = &m_list[c_ptr->m_idx];
763 /* Hack -- attack monsters */
764 if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
766 if (!monster_living(&r_info[m_ptr->r_idx]))
770 monster_desc(m_name, m_ptr, 0);
772 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤¤¡ª", m_name);
774 msg_format("%s is unharmed!", m_name);
777 else py_attack(y, x, HISSATSU_SEKIRYUKA);
784 if (!get_rep_dir2(&dir)) return FALSE;
785 if (dir == 5) return FALSE;
788 if (cave[y][x].m_idx)
789 py_attack(y, x, HISSATSU_QUAKE);
792 earthquake(py, px, 10);
798 int total_damage = 0, basedam, i;
799 u32b flgs[TR_FLAG_SIZE];
801 if (!get_aim_dir(&dir)) return FALSE;
803 msg_print("Éð´ï¤òÂ礤¯¿¶¤ê²¼¤í¤·¤¿¡£");
805 msg_print("You swing your weapon downward.");
807 for (i = 0; i < 2; i++)
811 if (!buki_motteruka(INVEN_RARM+i)) break;
812 o_ptr = &inventory[INVEN_RARM+i];
813 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
814 damage = o_ptr->to_d * 100;
815 object_flags(o_ptr, flgs);
816 if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
822 else if (have_flag(flgs, TR_VORPAL))
824 /* vorpal flag only */
829 damage *= p_ptr->num_blow[i];
830 total_damage += damage / 200;
831 if (i) total_damage = total_damage*7/10;
833 fire_beam(GF_FORCE, dir, total_damage);
839 msg_print("ͺ¶«¤Ó¤ò¤¢¤²¤¿¡ª");
841 msg_print("You roar out!");
843 project_hack(GF_SOUND, randint1(p_ptr->lev * 3));
844 aggravate_monsters(0);
850 if (!get_rep_dir2(&dir)) return FALSE;
851 if (dir == 5) return FALSE;
852 for (i = 0; i < 3; i++)
864 py_attack(y, x, HISSATSU_3DAN);
868 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
870 msg_print("There is no monster.");
875 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
880 /* Monster is dead? */
881 if (!c_ptr->m_idx) break;
885 m_idx = c_ptr->m_idx;
886 m_ptr = &m_list[m_idx];
888 /* Monster cannot move back? */
889 if (!monster_can_enter(ny, nx, &r_info[m_ptr->r_idx], 0))
892 if (i < 2) msg_print(NULL);
897 cave[ny][nx].m_idx = m_idx;
901 update_mon(m_idx, TRUE);
903 /* Redraw the old spot */
906 /* Redraw the new spot */
909 /* Player can move forward? */
910 if (player_can_enter(c_ptr->feat, 0))
912 /* Move the player */
913 if (!move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP)) break;
917 if (i < 2) msg_print(NULL);
923 if (!get_rep_dir2(&dir)) return FALSE;
924 if (dir == 5) return FALSE;
927 if (cave[y][x].m_idx)
928 py_attack(y, x, HISSATSU_DRAIN);
932 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
934 msg_print("There is no monster.");
943 msg_print("Éð´ï¤òÉÔµ¬Â§¤ËÍɤ餷¤¿¡¥¡¥¡¥");
945 msg_print("You irregularly wave your weapon...");
947 project_hack(GF_ENGETSU, p_ptr->lev * 4);
948 project_hack(GF_ENGETSU, p_ptr->lev * 4);
949 project_hack(GF_ENGETSU, p_ptr->lev * 4);
954 #define NEED_MANA_PER_MONSTER 8
957 /* int count = 0; currently unused */
960 if (!rush_attack(&mdeath)) break;
963 /* Reserve needed mana point */
964 p_ptr->csp -= technic_info[TECHNIC_HISSATSU][26].smana;
968 p_ptr->csp -= NEED_MANA_PER_MONSTER;
970 /* count++; currently unused */
972 p_ptr->redraw |= PR_MANA;
975 while (p_ptr->csp > NEED_MANA_PER_MONSTER);
976 if (new) return FALSE;
978 /* Restore reserved mana */
979 p_ptr->csp += technic_info[TECHNIC_HISSATSU][26].smana;
982 #undef NEED_MANA_PER_MONSTER
986 if (!tgt_pt(&x, &y)) return FALSE;
987 if (!cave_player_teleportable_bold(y, x, FALSE, FALSE) ||
988 (distance(y, x, py, px) > MAX_SIGHT / 2) ||
989 !projectable(py, px, y, x))
994 msg_print("You cannot move to that place!");
998 if (p_ptr->anti_tele)
1001 msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
1003 msg_print("A mysterious force prevents you from teleporting!");
1008 project(0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL, -1);
1009 teleport_player_to(y, x, TRUE, FALSE);
1016 if (!get_rep_dir(&dir, FALSE)) return FALSE;
1019 if (cave[y][x].m_idx)
1022 if (cave[y][x].m_idx)
1031 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1033 msg_print("You don't see any monster in this direction");
1041 int total_damage = 0, basedam, i;
1043 u32b flgs[TR_FLAG_SIZE];
1046 if (!get_rep_dir2(&dir)) return FALSE;
1047 if (dir == 5) return FALSE;
1050 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
1053 msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¡£");
1055 msg_print("Something prevent you from attacking.");
1060 msg_print("Éð´ï¤òÂ礤¯¿¶¤ê²¼¤í¤·¤¿¡£");
1062 msg_print("You swing your weapon downward.");
1064 for (i = 0; i < 2; i++)
1067 if (!buki_motteruka(INVEN_RARM+i)) break;
1068 o_ptr = &inventory[INVEN_RARM+i];
1069 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
1070 damage = o_ptr->to_d * 100;
1071 object_flags(o_ptr, flgs);
1072 if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
1078 else if (have_flag(flgs, TR_VORPAL))
1080 /* vorpal flag only */
1085 damage += p_ptr->to_d[i] * 100;
1086 damage *= p_ptr->num_blow[i];
1087 total_damage += (damage / 100);
1089 project(0, (cave_have_flag_bold(y, x, FF_PROJECT) ? 5 : 0), y, x, total_damage * 3 / 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1094 if (!get_rep_dir2(&dir)) return FALSE;
1095 if (dir == 5) return FALSE;
1098 if (cave[y][x].m_idx)
1099 py_attack(y, x, HISSATSU_UNDEAD);
1103 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
1105 msg_print("There is no monster.");
1110 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "·Ä±Àµ´Ç¦·õ¤ò»È¤Ã¤¿¾×·â", -1);
1112 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "exhaustion on using Keiun-Kininken", -1);
1120 if (!get_check("ËÜÅö¤Ë¼«»¦¤·¤Þ¤¹¤«¡©")) return FALSE;
1122 if (!get_check("Do you really want to commit suicide? ")) return FALSE;
1124 /* Special Verification for suicide */
1126 prt("³Îǧ¤Î¤¿¤á '@' ¤ò²¡¤·¤Æ²¼¤µ¤¤¡£", 0, 0);
1128 prt("Please verify SUICIDE by typing the '@' sign: ", 0, 0);
1134 if (i != '@') return FALSE;
1135 if (p_ptr->total_winner)
1137 take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
1138 p_ptr->total_winner = TRUE;
1143 msg_print("Éð»ÎÆ»¤È¤Ï¡¢»à¤Ì¤³¤È¤È¸«¤Ä¤±¤¿¤ê¡£");
1144 take_hit(DAMAGE_FORCE, 9999, "ÀÚÊ¢", -1);
1146 msg_print("Meaning of Bushi-do is found in the death.");
1147 take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
1154 msg_print("¤Ê¤Ë¡©");
1166 * do_cmd_cast calls this function if the player's class
1169 void do_cmd_hissatsu(void)
1176 /* not if confused */
1177 if (p_ptr->confused)
1180 msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤¤Ê¤¤¡ª");
1182 msg_print("You are too confused!");
1187 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
1189 if (flush_failure) flush();
1191 msg_print("Éð´ï¤ò»ý¤¿¤Ê¤¤¤Èɬ»¦µ»¤Ï»È¤¨¤Ê¤¤¡ª");
1193 msg_print("You need to wield a weapon!");
1198 if (!p_ptr->spell_learned1)
1201 msg_print("²¿¤âµ»¤òÃΤé¤Ê¤¤¡£");
1203 msg_print("You don't know any special attacks.");
1209 if (p_ptr->special_defense & KATA_MASK)
1211 set_action(ACTION_NONE);
1215 if (!get_hissatsu_power(&n)) return;
1217 spell = technic_info[TECHNIC_HISSATSU][n];
1219 /* Verify "dangerous" spells */
1220 if (spell.smana > p_ptr->csp)
1222 if (flush_failure) flush();
1225 msg_print("£Í£Ð¤¬Â¤ê¤Þ¤»¤ó¡£");
1227 msg_print("You do not have enough mana to use this power.");
1235 /* Cast the spell */
1236 cast = cast_hissatsu_spell(n);
1244 p_ptr->csp -= spell.smana;
1247 if (p_ptr->csp < 0) p_ptr->csp = 0;
1250 p_ptr->redraw |= (PR_MANA);
1253 p_ptr->window |= (PW_PLAYER);
1254 p_ptr->window |= (PW_SPELL);
1258 void do_cmd_gain_hissatsu(void)
1267 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1269 set_action(ACTION_NONE);
1272 if (p_ptr->blind || no_lite())
1275 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
1277 msg_print("You cannot see!");
1283 if (p_ptr->confused)
1286 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
1288 msg_print("You are too confused!");
1294 if (!(p_ptr->new_spells))
1297 msg_print("¿·¤·¤¤É¬»¦µ»¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡ª");
1299 msg_print("You cannot learn any new special attacks!");
1306 if( p_ptr->new_spells < 10 ){
1307 msg_format("¤¢¤È %d ¤Ä¤Îɬ»¦µ»¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells);
1309 msg_format("¤¢¤È %d ¸Ä¤Îɬ»¦µ»¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells);
1312 msg_format("You can learn %d new special attack%s.", p_ptr->new_spells,
1313 (p_ptr->new_spells == 1?"":"s"));
1316 item_tester_tval = TV_HISSATSU_BOOK;
1320 q = "¤É¤Î½ñ¤«¤é³Ø¤Ó¤Þ¤¹¤«? ";
1322 q = "Study which book? ";
1326 s = "Æɤá¤ë½ñ¤¬¤Ê¤¤¡£";
1328 s = "You have no books that you can read.";
1331 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1333 /* Get the item (in the pack) */
1336 o_ptr = &inventory[item];
1339 /* Get the item (on the floor) */
1342 o_ptr = &o_list[0 - item];
1345 for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
1347 if (p_ptr->spell_learned1 & (1L << i)) continue;
1348 if (technic_info[TECHNIC_HISSATSU][i].slevel > p_ptr->lev) continue;
1350 p_ptr->spell_learned1 |= (1L << i);
1351 p_ptr->spell_worked1 |= (1L << i);
1353 msg_format("%s¤Îµ»¤ò³Ð¤¨¤¿¡£", spell_names[technic2magic(REALM_HISSATSU)-1][i]);
1355 msg_format("You have learned the special attack of %s.", spell_names[technic2magic(REALM_HISSATSU)-1][i]);
1357 for (j = 0; j < 64; j++)
1359 /* Stop at the first empty space */
1360 if (p_ptr->spell_order[j] == 99) break;
1362 p_ptr->spell_order[j] = i;
1369 msg_print("²¿¤â³Ð¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
1371 msg_print("You were not able to learn any special attacks.");
1378 p_ptr->update |= (PU_SPELLS);