OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / hissatsu.c
index c069347..641cc5c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "angband.h"
 #include "monsterrace-hook.h"
+#include "player-status.h"
 
 #define TECHNIC_HISSATSU (REALM_HISSATSU - MIN_TECHNIC)
 
@@ -45,7 +46,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
        char choice;
        char out_val[160];
        SPELL_IDX sentaku[32];
-       cptr p = _("必殺剣", "special attack");
+       concptr p = _("必殺剣", "special attack");
        COMMAND_CODE code;
        magic_type spell;
        bool flag, redraw;
@@ -312,13 +313,8 @@ void do_cmd_hissatsu(void)
        SPELL_IDX       n = 0;
        magic_type      spell;
 
-       /* not if confused */
-       if (p_ptr->confused)
-       {
-               msg_print(_("混乱していて集中できない!", "You are too confused!"));
-               return;
-       }
-       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+       if (cmd_limit_confused(p_ptr)) return;
+       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
        {
                if (flush_failure) flush();
                msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
@@ -355,7 +351,7 @@ void do_cmd_hissatsu(void)
        /* Cast the spell */
        if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
 
-       p_ptr->energy_use = 100;
+       take_turn(p_ptr, 100);;
 
        /* Use some mana */
        p_ptr->csp -= spell.smana;
@@ -379,7 +375,7 @@ void do_cmd_gain_hissatsu(void)
        int i, j;
 
        object_type *o_ptr;
-       cptr q, s;
+       concptr q, s;
 
        bool gain = FALSE;
 
@@ -394,11 +390,7 @@ void do_cmd_gain_hissatsu(void)
                return;
        }
 
-       if (p_ptr->confused)
-       {
-               msg_print(_("混乱していて読めない!", "You are too confused!"));
-               return;
-       }
+       if (cmd_limit_confused(p_ptr)) return;
 
        if (!(p_ptr->new_spells))
        {
@@ -447,7 +439,7 @@ void do_cmd_gain_hissatsu(void)
                msg_print(_("何も覚えられなかった。", "You were not able to learn any special attacks."));
 
        else
-               p_ptr->energy_use = 100;
+               take_turn(p_ptr, 100);;
 
        p_ptr->update |= (PU_SPELLS);
 }