OSDN Git Service

#37287 #37353 (2.2.0.89) FEAT_POWER 型を定義し、型の置換を継続中。 / Define FEAT_POWER, ongoing...
[hengband/hengband.git] / src / hissatsu.c
index 76a6b1b..ec0316e 100644 (file)
@@ -1,36 +1,41 @@
-/* File: mind.c */
-
-/* Purpose: Mindcrafter code */
-
-/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
- *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+/*!
+ * @file hissatsu.c
+ * @brief 剣術の実装 / Blade arts
+ * @date 2014/01/17
+ * @author
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
+ * This software may be copied and distributed for educational, research,\n
+ * and not for profit purposes provided that this copyright and statement\n
+ * are included in all such copies.  Other copyrights may also apply.\n
+ * 2014 Deskull rearranged comment for Doxygen.\n
  */
 
 #include "angband.h"
 
 #define TECHNIC_HISSATSU (REALM_HISSATSU - MIN_TECHNIC)
 
-/*
- * Allow user to choose a mindcrafter power.
- *
- * If a valid spell is chosen, saves it in '*sn' and returns TRUE
- * If the user hits escape, returns FALSE, and set '*sn' to -1
- * If there are no legal choices, returns FALSE, and sets '*sn' to -2
- *
- * The "prompt" should be "cast", "recite", or "study"
- * The "known" should be TRUE for cast/pray, FALSE for study
- *
- * nb: This function has a (trivial) display bug which will be obvious
- * when you run it. It's probably easy to fix but I haven't tried,
- * sorry.
+
+/*!
+ * @brief 使用可能な剣術を選択する /
+ * Allow user to choose a blade arts.
+ * @param sn 選択した特殊技能ID、キャンセルの場合-1、不正な選択の場合-2を返す
+ * @return 発動可能な魔法を選択した場合TRUE、キャンセル処理か不正な選択が行われた場合FALSEを返す。
+ * @details
+ * If a valid spell is chosen, saves it in '*sn' and returns TRUE\n
+ * If the user hits escape, returns FALSE, and set '*sn' to -1\n
+ * If there are no legal choices, returns FALSE, and sets '*sn' to -2\n
+ *\n
+ * The "prompt" should be "cast", "recite", or "study"\n
+ * The "known" should be TRUE for cast/pray, FALSE for study\n
+ *\n
+ * nb: This function has a (trivial) display bug which will be obvious\n
+ * when you run it. It's probably easy to fix but I haven't tried,\n
+ * sorry.\n
  */
-static int get_hissatsu_power(int *sn)
+static int get_hissatsu_power(SPELL_IDX *sn)
 {
-       int             i, j = 0;
+       SPELL_IDX i;
+       int j = 0;
        int             num = 0;
        int             y = 1;
        int             x = 15;
@@ -38,12 +43,8 @@ static int get_hissatsu_power(int *sn)
        int             ask = TRUE;
        char            choice;
        char            out_val[160];
-       char sentaku[32];
-#ifdef JP
-cptr            p = "ɬ»¦·õ";
-#else
-       cptr            p = "special attack";
-#endif
+       SPELL_IDX sentaku[32];
+       cptr            p = _("必殺剣", "special attack");
 
        magic_type spell;
        bool            flag, redraw;
@@ -83,20 +84,17 @@ cptr            p = "ɬ
        }
 
        /* Build a prompt (accept all spells) */
-#ifdef JP
-(void) strnfmt(out_val, 78, "(%^s %c-%c, '*'¤Ç°ìÍ÷, ESC) ¤É¤Î%s¤ò»È¤¤¤Þ¤¹¤«¡©",
-#else
-       (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
-#endif
-        p, I2A(0), "abcdefghijklmnopqrstuvwxyz012345"[num-1], p);
+       (void) strnfmt(out_val, 78, 
+                      _("(%^s %c-%c, '*'で一覧, ESC) どの%sを使いますか?", "(%^ss %c-%c, *=List, ESC=exit) Use which %s? "),
+                      p, I2A(0), "abcdefghijklmnopqrstuvwxyz012345"[num-1], p);
 
        if (use_menu) screen_save();
 
        /* Get a spell from the user */
 
-        choice= always_show_list ? ESCAPE:1 ;
-        while (!flag)
-        {
+       choice= always_show_list ? ESCAPE:1 ;
+       while (!flag)
+       {
                if(choice==ESCAPE) choice = ' '; 
                else if( !get_com(out_val, &choice, FALSE) )break;
 
@@ -108,7 +106,6 @@ cptr            p = "ɬ
                                {
                                        screen_load();
                                        return (FALSE);
-                                       break;
                                }
 
                                case '8':
@@ -194,11 +191,8 @@ cptr            p = "ɬ
 
                                /* Display a list of spells */
                                prt("", y, x);
-#ifdef JP
-put_str("̾Á°              Lv  MP      Ì¾Á°              Lv  MP ", y, x + 5);
-#else
-put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
-#endif
+                               put_str(_("名前              Lv  MP      名前              Lv  MP ", 
+                                                 "name              Lv  SP      name              Lv  SP "), y, x + 5);
                                prt("", y+1, x);
                                /* Dump the spells */
                                for (i = 0, line = 0; i < 32; i++)
@@ -215,11 +209,7 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
                                        if (use_menu)
                                        {
                                                if (i == (menu_line-1))
-#ifdef JP
-                                                       strcpy(psi_desc, "  ¡Õ");
-#else
-                                                       strcpy(psi_desc, "  > ");
-#endif
+                                                       strcpy(psi_desc, _("  》", "  > "));
                                                else strcpy(psi_desc, "    ");
                                                
                                        }
@@ -235,8 +225,8 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
 
                                        /* Dump the spell --(-- */
                                        strcat(psi_desc, format(" %-18s%2d %3d",
-                                               spell_names[technic2magic(REALM_HISSATSU)-1][i],
-                                               spell.slevel, spell.smana));
+                                               do_spell(REALM_HISSATSU, i, SPELL_NAME),
+                                               spell.slevel, spell.smana));
                                        prt(psi_desc, y + (line%17) + (line >= 17), x+(line/17)*30);
                                        prt("", y + (line%17) + (line >= 17) + 1, x+(line/17)*30);
                                }
@@ -264,7 +254,7 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
                                ask = (isupper(choice));
 
                                /* Lowercase */
-                               if (ask) choice = tolower(choice);
+                               if (ask) choice = (char)tolower(choice);
 
                                /* Extract request */
                                i = (islower(choice) ? A2I(choice) : -1);
@@ -292,12 +282,7 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
                        char tmp_val[160];
 
                        /* Prompt */
-#ifdef JP
-(void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡©", spell_names[technic2magic(REALM_HISSATSU)-1][j]);
-#else
-                       (void)strnfmt(tmp_val, 78, "Use %s? ", spell_names[technic2magic(REALM_HISSATSU)-1][j]);
-#endif
-
+                       (void) strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), do_spell(REALM_HISSATSU, j, SPELL_NAME));
 
                        /* Belay that order */
                        if (!get_check(tmp_val)) continue;
@@ -311,14 +296,11 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
        if (redraw) screen_load();
 
        /* Show choices */
-       if (show_choices)
-       {
-               /* Update */
-               p_ptr->window |= (PW_SPELL);
+       p_ptr->window |= (PW_SPELL);
+
+       /* Window stuff */
+       window_stuff();
 
-               /* Window stuff */
-               window_stuff();
-       }
 
        /* Abort if needed */
        if (!flag) return (FALSE);
@@ -337,1097 +319,357 @@ put_str("name              Lv  SP      name              Lv  SP ", y, x + 5);
 }
 
 
-/*
- * do_cmd_cast calls this function if the player's class
- * is 'mindcrafter'.
+/*!
+ * @brief 剣術コマンドのメインルーチン
+ * @return なし
  */
-static bool cast_hissatsu_spell(int spell)
+void do_cmd_hissatsu(void)
 {
-       int             y, x;
-       int             dir;
-
+       SPELL_IDX       n = 0;
+       magic_type      spell;
 
-       /* spell code */
-       switch (spell)
-       {
-       case 0:
-               project_length = 2;
-               if (!get_aim_dir(&dir)) return FALSE;
-               project_hook(GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
 
-               break;
-       case 1:
+       /* not if confused */
+       if (p_ptr->confused)
        {
-               int cdir;
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               for (cdir = 0;cdir < 8; cdir++)
-               {
-                       if (cdd[cdir] == dir) break;
-               }
-               if (cdir == 8) return FALSE;
-               y = py + ddy_cdd[cdir];
-               x = px + ddx_cdd[cdir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, 0);
-               else
-#ifdef JP
-                       msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
-#else
-                       msg_print("You attack the empty air.");
-#endif
-               y = py + ddy_cdd[(cdir + 7) % 8];
-               x = px + ddx_cdd[(cdir + 7) % 8];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, 0);
-               else
-#ifdef JP
-                       msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
-#else
-                       msg_print("You attack the empty air.");
-#endif
-               y = py + ddy_cdd[(cdir + 1) % 8];
-               x = px + ddx_cdd[(cdir + 1) % 8];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, 0);
-               else
-#ifdef JP
-                       msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
-#else
-                       msg_print("You attack the empty air.");
-#endif
-
-               break;
+               msg_print(_("混乱していて集中できない!", "You are too confused!"));
+               return;
        }
-       case 2:
+       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
        {
-               if (!do_cmd_throw_aux(1, TRUE, 0)) return FALSE;
-               break;
+               if (flush_failure) flush();
+               msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
+               return;
        }
-       case 3:
+       if (!p_ptr->spell_learned1)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_FIRE);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
+               msg_print(_("何も技を知らない。", "You don't know any special attacks."));
+               return;
        }
-       case 4:
+
+       if (p_ptr->special_defense & KATA_MASK)
        {
-               detect_monsters_mind(DETECT_RAD_DEFAULT);
-               break;
+               set_action(ACTION_NONE);
        }
-       case 5:
+
+       /* get power */
+       if (!get_hissatsu_power(&n)) return;
+
+       spell = technic_info[TECHNIC_HISSATSU][n];
+
+       /* Verify "dangerous" spells */
+       if (spell.smana > p_ptr->csp)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_MINEUCHI);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
+               if (flush_failure) flush();
+               /* Warning */
+               msg_print(_("MPが足りません。", "You do not have enough mana to use this power."));
+               msg_print(NULL);
+               return;
        }
-       case 6:
+
+       sound(SOUND_ZAP);
+
+       /* Cast the spell */
+       if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
+
+       /* Take a turn */
+       p_ptr->energy_use = 100;
+
+       /* Use some mana */
+       p_ptr->csp -= spell.smana;
+
+       /* Limit */
+       if (p_ptr->csp < 0) p_ptr->csp = 0;
+
+       /* Redraw mana */
+       p_ptr->redraw |= (PR_MANA);
+
+       /* Window stuff */
+       p_ptr->window |= (PW_PLAYER);
+       p_ptr->window |= (PW_SPELL);
+}
+
+
+/*!
+ * @brief 剣術コマンドの学習
+ * @return なし
+ */
+void do_cmd_gain_hissatsu(void)
+{
+       int item, i, j;
+
+       object_type *o_ptr;
+       cptr q, s;
+
+       bool gain = FALSE;
+
+       if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
        {
-               if (p_ptr->riding)
-               {
-#ifdef JP
-                       msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
-#else
-                       msg_print("You cannot do it when riding.");
-#endif
-                       return FALSE;
-               }
-#ifdef JP
-               msg_print("Áê¼ê¤Î¹¶·â¤ËÂФ·¤Æ¿È¹½¤¨¤¿¡£");
-#else
-               msg_print("You prepare to counter blow.");
-#endif
-               p_ptr->counter = TRUE;
-               break;
+               set_action(ACTION_NONE);
        }
-       case 7:
+
+       if (p_ptr->blind || no_lite())
        {
-               if (p_ptr->riding)
-               {
-#ifdef JP
-                       msg_print("¾èÇÏÃæ¤Ë¤Ï̵Íý¤À¡£");
-#else
-                       msg_print("You cannot do it when riding.");
-#endif
-                       return FALSE;
-               }
+               msg_print(_("目が見えない!", "You cannot see!"));
+               return;
+       }
 
-               if (!get_rep_dir2(&dir)) return FALSE;
+       if (p_ptr->confused)
+       {
+               msg_print(_("混乱していて読めない!", "You are too confused!"));
+               return;
+       }
 
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
+       if (!(p_ptr->new_spells))
+       {
+               msg_print(_("新しい必殺技を覚えることはできない!", "You cannot learn any new special attacks!"));
+               return;
+       }
 
-               if (!cave[y][x].m_idx)
-               {
 #ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
+       if( p_ptr->new_spells < 10 ){
+               msg_format("あと %d つの必殺技を学べる。", p_ptr->new_spells);
+       }else{
+               msg_format("あと %d 個の必殺技を学べる。", p_ptr->new_spells);
+       }
 #else
-                       msg_print("There is no monster.");
+       msg_format("You can learn %d new special attack%s.", p_ptr->new_spells,
+               (p_ptr->new_spells == 1?"":"s"));
 #endif
-                       return FALSE;
-               }
-
-               py_attack(y, x, 0);
 
-               if (!player_can_enter(cave[y][x].feat) || is_trap(cave[y][x].feat))
-                       break;
+       item_tester_tval = TV_HISSATSU_BOOK;
 
-               y += ddy[dir];
-               x += ddx[dir];
+       /* Get an item */
+       q = _("どの書から学びますか? ", "Study which book? ");
+       s = _("読める書がない。", "You have no books that you can read.");
 
-               if (player_can_enter(cave[y][x].feat) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
-               {
-                       int oy, ox;
+       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
 
-                       msg_print(NULL);
+       /* Get the item (in the pack) */
+       if (item >= 0)
+       {
+               o_ptr = &inventory[item];
+       }
 
-                       /* Save the old location */
-                       oy = py;
-                       ox = px;
+       /* Get the item (on the floor) */
+       else
+       {
+               o_ptr = &o_list[0 - item];
+       }
 
-                       /* Move the player */
-                       py = y;
-                       px = x;
+       for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
+       {
+               if (p_ptr->spell_learned1 & (1L << i)) continue;
+               if (technic_info[TECHNIC_HISSATSU][i].slevel > p_ptr->lev) continue;
 
-                       forget_flow();
+               p_ptr->spell_learned1 |= (1L << i);
+               p_ptr->spell_worked1 |= (1L << i);
+               msg_format(_("%sの技を覚えた。", "You have learned the special attack of %s."), do_spell(REALM_HISSATSU, i, SPELL_NAME));
+               for (j = 0; j < 64; j++)
+               {
+                       /* Stop at the first empty space */
+                       if (p_ptr->spell_order[j] == 99) break;
+               }
+               p_ptr->spell_order[j] = i;
+               gain = TRUE;
+       }
 
-                       /* Redraw the old spot */
-                       lite_spot(oy, ox);
+       /* No gain ... */
+       if (!gain)
+               msg_print(_("何も覚えられなかった。", "You were not able to learn any special attacks."));
 
-                       /* Redraw the new spot */
-                       lite_spot(py, px);
+       /* Take a turn */
+       else
+               p_ptr->energy_use = 100;
 
-                       /* Check for new panel (redraw map) */
-                       verify_panel();
+       p_ptr->update |= (PU_SPELLS);
+}
 
-                       /* Update stuff */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
 
-                       /* Update the monsters */
-                       p_ptr->update |= (PU_DISTANCE);
+/*!
+ * @brief 剣術のスレイ倍率計算を行う /
+ * Calcurate magnification of hissatsu technics
+ * @param mult 剣術のスレイ効果以前に算出している多要素の倍率(/10倍)
+ * @param flgs 剣術に使用する武器のスレイフラグ配列
+ * @param m_ptr 目標となるモンスターの構造体参照ポインタ
+ * @param mode 剣術のスレイ型ID
+ * @return スレイの倍率(/10倍)
+ */
+s16b mult_hissatsu(int mult, u32b *flgs, monster_type *m_ptr, int mode)
+{
+       monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
-                       /* Window stuff */
-                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       /* Burning Strike (Fire) */
+       if (mode == HISSATSU_FIRE)
+       {
+               /* Notice immunity */
+               if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
+               {
+                       if (is_original_ap_and_seen(m_ptr))
+                       {
+                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
+                       }
+               }
 
-                       /* Handle stuff XXX XXX XXX */
-                       handle_stuff();
+               /* Otherwise, take the damage */
+               else if (have_flag(flgs, TR_BRAND_FIRE))
+               {
+                       if (r_ptr->flags3 & RF3_HURT_FIRE)
+                       {
+                               if (mult < 70) mult = 70;
+                               if (is_original_ap_and_seen(m_ptr))
+                               {
+                                       r_ptr->r_flags3 |= RF3_HURT_FIRE;
+                               }
+                       }
+                       else if (mult < 35) mult = 35;
+               }
+               else
+               {
+                       if (r_ptr->flags3 & RF3_HURT_FIRE)
+                       {
+                               if (mult < 50) mult = 50;
+                               if (is_original_ap_and_seen(m_ptr))
+                               {
+                                       r_ptr->r_flags3 |= RF3_HURT_FIRE;
+                               }
+                       }
+                       else if (mult < 25) mult = 25;
                }
-               break;
        }
-       case 8:
+
+       /* Serpent's Tongue (Poison) */
+       if (mode == HISSATSU_POISON)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_POISON);
+               /* Notice immunity */
+               if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
+               {
+                       if (is_original_ap_and_seen(m_ptr))
+                       {
+                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
+                       }
+               }
+
+               /* Otherwise, take the damage */
+               else if (have_flag(flgs, TR_BRAND_POIS))
+               {
+                       if (mult < 35) mult = 35;
+               }
                else
                {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
+                       if (mult < 25) mult = 25;
                }
-               break;
        }
-       case 9:
+
+       /* Zammaken (Nonliving Evil) */
+       if (mode == HISSATSU_ZANMA)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_ZANMA);
-               else
+               if (!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
                {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
+                       if (mult < 15) mult = 25;
+                       else if (mult < 50) mult = MIN(50, mult+20);
                }
-               break;
        }
-       case 10:
+
+       /* Rock Smash (Hurt Rock) */
+       if (mode == HISSATSU_HAGAN)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, 0);
-               else
+               if (r_ptr->flags3 & RF3_HURT_ROCK)
                {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
+                       if (is_original_ap_and_seen(m_ptr))
+                       {
+                               r_ptr->r_flags3 |= RF3_HURT_ROCK;
+                       }
+                       if (mult == 10) mult = 40;
+                       else if (mult < 60) mult = 60;
                }
-               if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       }
+
+       /* Midare-Setsugekka (Cold) */
+       if (mode == HISSATSU_COLD)
+       {
+               /* Notice immunity */
+               if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
                {
-                       return TRUE;
+                       if (is_original_ap_and_seen(m_ptr))
+                       {
+                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
+                       }
                }
-               if (cave[y][x].m_idx)
+               /* Otherwise, take the damage */
+               else if (have_flag(flgs, TR_BRAND_COLD))
                {
-                       int i;
-                       int ty = y, tx = x;
-                       int oy = y, ox = x;
-                       int m_idx = cave[y][x].m_idx;
-                       monster_type *m_ptr = &m_list[m_idx];
-                       char m_name[80];
-
-                       monster_desc(m_name, m_ptr, 0);
-
-                       for (i = 0; i < 5; i++)
+                       if (r_ptr->flags3 & RF3_HURT_COLD)
                        {
-                               y += ddy[dir];
-                               x += ddx[dir];
-                               if (cave_empty_bold(y, x))
+                               if (mult < 70) mult = 70;
+                               if (is_original_ap_and_seen(m_ptr))
                                {
-                                       ty = y;
-                                       tx = x;
+                                       r_ptr->r_flags3 |= RF3_HURT_COLD;
                                }
-                               else break;
                        }
-                       if ((ty != oy) || (tx != ox))
+                       else if (mult < 35) mult = 35;
+               }
+               else
+               {
+                       if (r_ptr->flags3 & RF3_HURT_COLD)
                        {
-#ifdef JP
-                               msg_format("%s¤ò¿á¤­Èô¤Ð¤·¤¿¡ª", m_name);
-#else
-                               msg_format("You blow %s away!", m_name);
-#endif
-                               cave[oy][ox].m_idx = 0;
-                               cave[ty][tx].m_idx = m_idx;
-                               m_ptr->fy = ty;
-                               m_ptr->fx = tx;
-
-                               update_mon(m_idx, TRUE);
-                               lite_spot(oy, ox);
-                               lite_spot(ty, tx);
+                               if (mult < 50) mult = 50;
+                               if (is_original_ap_and_seen(m_ptr))
+                               {
+                                       r_ptr->r_flags3 |= RF3_HURT_COLD;
+                               }
                        }
+                       else if (mult < 25) mult = 25;
                }
-               break;
        }
-       case 11:
+
+       /* Lightning Eagle (Elec) */
+       if (mode == HISSATSU_ELEC)
        {
-               if (p_ptr->lev > 44)
+               /* Notice immunity */
+               if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
+               {
+                       if (is_original_ap_and_seen(m_ptr))
+                       {
+                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
+                       }
+               }
+
+               /* Otherwise, take the damage */
+               else if (have_flag(flgs, TR_BRAND_ELEC))
                {
-                       if (!identify_fully(TRUE)) return FALSE;
+                       if (mult < 70) mult = 70;
                }
                else
                {
-                       if (!ident_spell(TRUE)) return FALSE;
+                       if (mult < 50) mult = 50;
                }
-               break;
        }
-       case 12:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_HAGAN);
-
-               /* Non-walls (etc) */
-               if (cave_floor_bold(y, x)) break;
-
-               /* Permanent walls */
-               if (cave[y][x].feat >= FEAT_PERM_EXTRA) break;
-
-               if (cave[y][x].feat < FEAT_DOOR_HEAD) break;
-
-               /* Forget the wall */
-               cave[y][x].info &= ~(CAVE_MARK);
-
-               /* Destroy the feature */
-               cave[y][x].feat = floor_type[randint0(100)];
 
-               /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-
-               lite_spot(y, x);
-
-               break;
+       /* Bloody Maelstrom */
+       if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
+       {
+               int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
+               if (mult < tmp) mult = tmp;
        }
-       case 13:
+
+       /* Keiun-Kininken */
+       if (mode == HISSATSU_UNDEAD)
        {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_COLD);
-               else
+               if (r_ptr->flags3 & RF3_UNDEAD)
                {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 14:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_KYUSHO);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 15:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_MAJIN);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 16:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_SUTEMI);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               p_ptr->sutemi = TRUE;
-               break;
-       }
-       case 17:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_ELEC);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 18:
-               project_length = 5;
-               if (!get_aim_dir(&dir)) return FALSE;
-               project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL);
-
-               break;
-       case 19: /* Whirlwind Attack */
-       {
-               int y = 0, x = 0;
-               cave_type       *c_ptr;
-               monster_type    *m_ptr;
-
-               if (p_ptr->cut < 300)
-                       set_cut(p_ptr->cut + 300);
-               else
-                       set_cut(p_ptr->cut * 2);
-
-               for (dir = 0; dir < 8; dir++)
-               {
-                       y = py + ddy_ddd[dir];
-                       x = px + ddx_ddd[dir];
-                       c_ptr = &cave[y][x];
-
-                       /* Get the monster */
-                       m_ptr = &m_list[c_ptr->m_idx];
-
-                       /* Hack -- attack monsters */
-                       if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
+                       if (is_original_ap_and_seen(m_ptr))
                        {
-                               if (r_info[m_list[c_ptr->m_idx].r_idx].flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING))
-                               {
-                                       char m_name[80];
-
-                                       monster_desc(m_name, &m_list[c_ptr->m_idx], 0);
-#ifdef JP
-                                       msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤¤¡ª", m_name);
-#else
-                                       msg_format("%s is unharmed!", m_name);
-#endif
-                               }
-                               else py_attack(y, x, HISSATSU_SEKIRYUKA);
-                       }
-               }
-               break;
-       }
-       case 20:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_QUAKE);
-               else
-               {
-                       earthquake(py, px, 10);
-               }
-               break;
-       }
-       case 21:
-       {
-               int total_damage = 0, basedam, i;
-               u32b flgs[TR_FLAG_SIZE];
-               object_type *o_ptr;
-               if (!get_aim_dir(&dir)) return FALSE;
-#ifdef JP
-               msg_print("Éð´ï¤òÂ礭¤¯¿¶¤ê²¼¤í¤·¤¿¡£");
-#else
-               msg_print("You swing your weapon downward.");
-#endif
-               for (i = 0; i < 2; i++)
-               {
-                       int damage;
-
-                       if (!buki_motteruka(INVEN_RARM+i)) break;
-                       o_ptr = &inventory[INVEN_RARM+i];
-                       basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
-                       damage = o_ptr->to_d * 100;
-                       object_flags(o_ptr, flgs);
-                       if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
-                       {
-                               /* vorpal blade */
-                               basedam *= 5;
-                               basedam /= 3;
-                       }
-                       else if (object_known_p(o_ptr) && (have_flag(flgs, TR_VORPAL)))
-                       {
-                               /* vorpal flag only */
-                               basedam *= 11;
-                               basedam /= 9;
-                       }
-                       damage += basedam;
-                       damage *= p_ptr->num_blow[i];
-                       total_damage += damage / 200;
-                       if (i) total_damage = total_damage*7/10;
-               }
-               fire_beam(GF_FORCE, dir, total_damage);
-               break;
-       }
-       case 22:
-       {
-#ifdef JP
-               msg_print("ͺ¶«¤Ó¤ò¤¢¤²¤¿¡ª");
-#else
-               msg_print("You roar out!");
-#endif
-               project_hack(GF_SOUND, randint1(p_ptr->lev * 3));
-               aggravate_monsters(0);
-               break;
-       }
-       case 23:
-       {
-               int i;
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               for (i = 0; i < 3; i++)
-               {
-                       if (cave[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_3DAN);
-                       else
-                       {
-#ifdef JP
-                               msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                               msg_print("There is no monster.");
-#endif
-                               return FALSE;
+                               r_ptr->r_flags3 |= RF3_UNDEAD;
                        }
-                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
-                       {
-                               return TRUE;
-                       }
-                       if (cave[y][x].m_idx)
-                       {
-                               int oy, ox;
-                               int ny = y + ddy[dir];
-                               int nx = x + ddx[dir];
-                               int m_idx = cave[y][x].m_idx;
-                               monster_type *m_ptr = &m_list[m_idx];
-                               if (cave_empty_bold(ny, nx))
-                               {
-                                       cave[y][x].m_idx = 0;
-                                       cave[ny][nx].m_idx = m_idx;
-                                       m_ptr->fy = ny;
-                                       m_ptr->fx = nx;
-
-                                       update_mon(m_idx, TRUE);
-
-                                       /* Save the old location */
-                                       oy = py;
-                                       ox = px;
-
-                                       /* Move the player */
-                                       py = y;
-                                       px = x;
-
-                                       if (p_ptr->riding)
-                                       {
-                                               int tmp;
-                                               tmp = cave[py][px].m_idx;
-                                               cave[py][px].m_idx = cave[oy][ox].m_idx;
-                                               cave[oy][ox].m_idx = tmp;
-                                               m_list[p_ptr->riding].fy = py;
-                                               m_list[p_ptr->riding].fx = px;
-                                               update_mon(cave[py][px].m_idx, TRUE);
-                                       }
-
-                                       forget_flow();
-
-                                       /* Redraw the old spot */
-                                       lite_spot(oy, ox);
-
-                                       /* Redraw the new spot */
-                                       lite_spot(py, px);
-
-                                       /* Redraw the new spot */
-                                       lite_spot(ny, nx);
-
-                                       /* Check for new panel (redraw map) */
-                                       verify_panel();
-
-                                       /* Update stuff */
-                                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
-
-                                       /* Update the monsters */
-                                       p_ptr->update |= (PU_DISTANCE);
-
-                                       /* Window stuff */
-                                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
-                                       /* Handle stuff XXX XXX XXX */
-                                       handle_stuff();
-
-                                       if (i < 2) msg_print(NULL);
-                                       y += ddy[dir];
-                                       x += ddx[dir];
-                               }
-                       }
-                       else break;
-               }
-               break;
-       }
-       case 24:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_DRAIN);
-               else
-               {
-#ifdef JP
-                               msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                               msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 25:
-       {
-#ifdef JP
-               msg_print("Éð´ï¤òÉÔµ¬Â§¤ËÍɤ餷¤¿¡¥¡¥¡¥");
-#else
-               msg_print("You irregularly wave your weapon...");
-#endif
-               project_hack(GF_ENGETSU, p_ptr->lev * 4);
-               project_hack(GF_ENGETSU, p_ptr->lev * 4);
-               project_hack(GF_ENGETSU, p_ptr->lev * 4);
-               break;
-       }
-       case 26:
-       {
-               bool new = TRUE;
-               int count = 0;
-               do
-               {
-                       project_length = 5;
-                       if (!get_aim_dir(&dir)) break;
-                       if (new)
-                               /* Reserve needed mana point */
-                               p_ptr->csp -= technic_info[TECHNIC_HISSATSU][26].smana;
-                       else
-                               p_ptr->csp -= 8;
-                       new = FALSE;
-                       if (!project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL)) break;
-                       count++;
-                       command_dir = 0;
-                       p_ptr->redraw |= PR_MANA;
-                       handle_stuff();
-               } while (p_ptr->csp > 8);
-               if (new) return FALSE;
-
-               /* Restore reserved mana */
-               p_ptr->csp += technic_info[TECHNIC_HISSATSU][26].smana;
-
-               break;
-       }
-       case 27:
-       {
-               if (!tgt_pt(&x, &y)) return FALSE;
-               if (!cave_empty_bold(y, x) || (cave[y][x].info & CAVE_ICKY) ||
-                       (distance(y, x, py, px) > MAX_SIGHT / 2) ||
-                   !projectable(py, px, y, x))
-               {
-#ifdef JP
-                       msg_print("¼ºÇÔ¡ª");
-#else
-                       msg_print("You cannot move to that place!");
-#endif
-                       break;
-               }
-               if (p_ptr->anti_tele)
-               {
-#ifdef JP
-msg_print("ÉԻ׵ĤÊÎϤ¬¥Æ¥ì¥Ý¡¼¥È¤òËɤ¤¤À¡ª");
-#else
-                       msg_print("A mysterious force prevents you from teleporting!");
-#endif
-
-                       break;
-               }
-               project(0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL, -1);
-               teleport_player_to(y, x, TRUE);
-               break;
-       }
-       case 28:
-       {
-               int x, y;
-
-               if (!get_rep_dir(&dir, FALSE)) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-               {
-                       py_attack(y, x, 0);
-                       if (cave[y][x].m_idx)
-                       {
-                               handle_stuff();
-                               py_attack(y, x, 0);
-                       }
-               }
-               else
-               {
-#ifdef JP
-msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("You don't see any monster in this direction");
-#endif
-                       return FALSE;
-               }
-               break;
-       }
-       case 29:
-       {
-               int total_damage = 0, basedam, i;
-               int y, x;
-               u32b flgs[TR_FLAG_SIZE];
-               object_type *o_ptr;
-
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
-               {
-#ifdef JP
-                       msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£");
-#else
-                       msg_print("Something prevent you from attacking.");
-#endif
-                       return TRUE;
-               }
-#ifdef JP
-               msg_print("Éð´ï¤òÂ礭¤¯¿¶¤ê²¼¤í¤·¤¿¡£");
-#else
-               msg_print("You swing your weapon downward.");
-#endif
-               for (i = 0; i < 2; i++)
-               {
-                       int damage;
-                       if (!buki_motteruka(INVEN_RARM+i)) break;
-                       o_ptr = &inventory[INVEN_RARM+i];
-                       basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
-                       damage = o_ptr->to_d * 100;
-                       object_flags(o_ptr, flgs);
-                       if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
-                       {
-                               /* vorpal blade */
-                               basedam *= 5;
-                               basedam /= 3;
-                       }
-                       else if (object_known_p(o_ptr) && (have_flag(flgs, TR_VORPAL)))
-                       {
-                               /* vorpal flag only */
-                               basedam *= 11;
-                               basedam /= 9;
-                       }
-                       damage += basedam;
-                       damage += p_ptr->to_d[i] * 100;
-                       damage *= p_ptr->num_blow[i];
-                       total_damage += (damage / 100);
-               }
-               project(0, (cave_floor_bold(y, x) ? 5 : 0), y, x, total_damage * 3 / 2, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
-               break;
-       }
-       case 30:
-       {
-               if (!get_rep_dir2(&dir)) return FALSE;
-               if (dir == 5) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
-               if (cave[y][x].m_idx)
-                       py_attack(y, x, HISSATSU_UNDEAD);
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
-#else
-                       msg_print("There is no monster.");
-#endif
-                       return FALSE;
-               }
-#ifdef JP
-               take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "·Ä±Àµ´Ç¦·õ¤ò»È¤Ã¤¿¾×·â", -1);
-#else
-               take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "exhaustion on using Keiun-Kininken", -1);
-#endif
-               break;
-       }
-       case 31:
-       {
-               int i;
-#ifdef JP
-if (!get_check("ËÜÅö¤Ë¼«»¦¤·¤Þ¤¹¤«¡©")) return FALSE;
-#else
-               if (!get_check("Do you really want to commit suicide? ")) return FALSE;
-#endif
-                       /* Special Verification for suicide */
-#ifdef JP
-prt("³Îǧ¤Î¤¿¤á '@' ¤ò²¡¤·¤Æ²¼¤µ¤¤¡£", 0, 0);
-#else
-               prt("Please verify SUICIDE by typing the '@' sign: ", 0, 0);
-#endif
-
-               flush();
-               i = inkey();
-               prt("", 0, 0);
-               if (i != '@') return FALSE;
-               if (p_ptr->total_winner)
-               {
-                       take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
-                       p_ptr->total_winner = TRUE;
-               }
-               else
-               {
-#ifdef JP
-                       msg_print("Éð»ÎÆ»¤È¤Ï¡¢»à¤Ì¤³¤È¤È¸«¤Ä¤±¤¿¤ê¡£");
-                       take_hit(DAMAGE_FORCE, 9999, "ÀÚÊ¢", -1);
-#else
-                       msg_print("Meaning of Bushi-do is found in the death.");
-                       take_hit(DAMAGE_FORCE, 9999, "Seppuku", -1);
-#endif
+                       if (mult == 10) mult = 70;
+                       else if (mult < 140) mult = MIN(140, mult+60);
                }
-               break;
-       }
-       default:
-#ifdef JP
-msg_print("¤Ê¤Ë¡©");
-#else
-               msg_print("Zap?");
-#endif
-
+               if (mult == 10) mult = 40;
+               else if (mult < 60) mult = MIN(60, mult+30);
        }
 
-       return TRUE;
-}
-
-
-/*
- * do_cmd_cast calls this function if the player's class
- * is 'mindcrafter'.
- */
-void do_cmd_hissatsu(void)
-{
-       int             n = 0;
-       magic_type      spell;
-       bool            cast;
-
-
-       /* not if confused */
-       if (p_ptr->confused)
-       {
-#ifdef JP
-msg_print("º®Í𤷤Ƥ¤¤Æ½¸Ãæ¤Ç¤­¤Ê¤¤¡ª");
-#else
-               msg_print("You are too confused!");
-#endif
-
-               return;
-       }
-       if (!buki_motteruka(INVEN_RARM))
-       {
-               if (flush_failure) flush();
-#ifdef JP
-msg_print("Éð´ï¤ò»ý¤¿¤Ê¤¤¤Èɬ»¦µ»¤Ï»È¤¨¤Ê¤¤¡ª");
-#else
-               msg_print("You need to wield a weapon!");
-#endif
-
-               return;
-       }
-       if (!p_ptr->spell_learned1)
-       {
-#ifdef JP
-msg_print("²¿¤âµ»¤òÃΤé¤Ê¤¤¡£");
-#else
-               msg_print("You don't know any martial arts.");
-#endif
-
-               return;
-       }
-
-       if (p_ptr->special_defense & KATA_MASK)
-       {
-               set_action(ACTION_NONE);
-       }
-
-       /* get power */
-       if (!get_hissatsu_power(&n)) return;
-
-       spell = technic_info[TECHNIC_HISSATSU][n];
-
-       /* Verify "dangerous" spells */
-       if (spell.smana > p_ptr->csp)
-       {
-               if (flush_failure) flush();
-               /* Warning */
-#ifdef JP
-msg_print("£Í£Ð¤¬Â­¤ê¤Þ¤»¤ó¡£");
-#else
-               msg_print("You do not have enough mana to use this power.");
-#endif
-               msg_print(NULL);
-               return;
-       }
-
-       sound(SOUND_ZAP);
-
-       /* Cast the spell */
-       cast = cast_hissatsu_spell(n);
-
-       if (!cast) return;
-
-       /* Take a turn */
-       energy_use = 100;
-
-       /* Use some mana */
-       p_ptr->csp -= spell.smana;
-
-       /* Limit */
-       if (p_ptr->csp < 0) p_ptr->csp = 0;
-
-       /* Redraw mana */
-       p_ptr->redraw |= (PR_MANA);
-
-       /* Window stuff */
-       p_ptr->window |= (PW_PLAYER);
-       p_ptr->window |= (PW_SPELL);
-}
-
-
-void do_cmd_gain_hissatsu(void)
-{
-       int item, i, j;
-
-       object_type *o_ptr;
-       cptr q, s;
+       if (mult > 150) mult = 150;
 
-       bool gain = FALSE;
-
-       if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
-       {
-               set_action(ACTION_NONE);
-       }
-
-       if (p_ptr->blind || no_lite())
-       {
-#ifdef JP
-msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡ª");
-#else
-               msg_print("You cannot see!");
-#endif
-
-               return;
-       }
-
-       if (p_ptr->confused)
-       {
-#ifdef JP
-msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
-#else
-               msg_print("You are too confused!");
-#endif
-
-               return;
-       }
-
-       if (!(p_ptr->new_spells))
-       {
-#ifdef JP
-msg_print("¿·¤·¤¤É¬»¦µ»¤ò³Ð¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡ª");
-#else
-               msg_print("You cannot learn any new special attacks!");
-#endif
-
-               return;
-       }
-
-#ifdef JP
-       if( p_ptr->new_spells < 10 ){
-               msg_format("¤¢¤È %d ¤Ä¤Îɬ»¦µ»¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells);
-       }else{
-               msg_format("¤¢¤È %d ¸Ä¤Îɬ»¦µ»¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells);
-       }
-#else
-       msg_format("You can learn %d new special attack%s.", p_ptr->new_spells,
-               (p_ptr->new_spells == 1?"":"s"));
-#endif
-
-       item_tester_tval = TV_HISSATSU_BOOK;
-
-       /* Get an item */
-#ifdef JP
-q = "¤É¤Î½ñ¤«¤é³Ø¤Ó¤Þ¤¹¤«? ";
-#else
-       q = "Study which book? ";
-#endif
-
-#ifdef JP
-s = "Æɤá¤ë½ñ¤¬¤Ê¤¤¡£";
-#else
-       s = "You have no books that you can read.";
-#endif
-
-       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
-       /* Get the item (in the pack) */
-       if (item >= 0)
-       {
-               o_ptr = &inventory[item];
-       }
-
-       /* Get the item (on the floor) */
-       else
-       {
-               o_ptr = &o_list[0 - item];
-       }
-
-       for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
-       {
-               if (p_ptr->spell_learned1 & (1L << i)) continue;
-               if (technic_info[TECHNIC_HISSATSU][i].slevel > p_ptr->lev) continue;
-
-               p_ptr->spell_learned1 |= (1L << i);
-               p_ptr->spell_worked1 |= (1L << i);
-#ifdef JP
-               msg_format("%s¤Îµ»¤ò³Ð¤¨¤¿¡£", spell_names[technic2magic(REALM_HISSATSU)-1][i]);
-#else
-               msg_format("You have learned the special attack of %s.", spell_names[technic2magic(REALM_HISSATSU)-1][i]);
-#endif
-               for (j = 0; j < 64; j++)
-               {
-                       /* Stop at the first empty space */
-                       if (p_ptr->spell_order[j] == 99) break;
-               }
-               p_ptr->spell_order[j] = i;
-               gain = TRUE;
-       }
-       if (!gain)
-#ifdef JP
-               msg_print("²¿¤â³Ð¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
-#else
-               msg_print("You were not able to learn any special attacks.");
-#endif
-
-       p_ptr->update |= (PU_SPELLS);
+       return mult;
 }