OSDN Git Service

It's not currently used in hengband, but bring over the change to mouse event handlin...
[hengbandforosx/hengbandosx.git] / src / racial.c
index 3d45d97..5a730f9 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "angband.h"
 #include "cmd-magiceat.h"
+#include "cmd-mane.h"
 #include "cmd-zapwand.h"
 #include "cmd-pet.h"
 #include "melee.h"
@@ -21,6 +22,7 @@
 #include "player-status.h"
 #include "spells-status.h"
 #include "spells-object.h"
+#include "spells-floor.h"
 #include "cmd-spell.h"
 #include "realm-hex.h"
 
@@ -49,7 +51,7 @@ static bool choose_kamae(void)
        }
 
        prt("", 1, 0);
-       prt(_("        どの構えをとりますか?", "        Choose Form: "), 1, 14);
+       prt(_("        どの構えをとりますか?", "        Choose Stance: "), 1, 14);
 
        while(1)
        {
@@ -67,7 +69,7 @@ static bool choose_kamae(void)
                                set_action(ACTION_NONE);
                        }
                        else
-                               msg_print(_("もともと構えていない。", "You are not assuming a posture."));
+                               msg_print(_("もともと構えていない。", "You are not in a special stance."));
                        screen_load();
                        return TRUE;
                }
@@ -96,14 +98,14 @@ static bool choose_kamae(void)
 
        if (p_ptr->special_defense & (KAMAE_GENBU << new_kamae))
        {
-               msg_print(_("構え直した。", "You reassume a posture."));
+               msg_print(_("構え直した。", "You reassume a stance."));
        }
        else
        {
                p_ptr->special_defense &= ~(KAMAE_MASK);
                p_ptr->update |= (PU_BONUS);
                p_ptr->redraw |= (PR_STATE);
-               msg_format(_("%sの構えをとった。", "You assume a posture of %s form."),kamae_shurui[new_kamae].desc);
+               msg_format(_("%sの構えをとった。", "You assume the %s stance."),kamae_shurui[new_kamae].desc);
                p_ptr->special_defense |= (KAMAE_GENBU << new_kamae);
        }
        p_ptr->redraw |= PR_STATE;
@@ -142,13 +144,13 @@ static bool choose_kata(void)
        {
                if (p_ptr->lev >= kata_shurui[i].min_level)
                {
-                       sprintf(buf,_(" %c) %sの型    %s", " %c) Form of %-12s  %s"),I2A(i+1), kata_shurui[i].desc, kata_shurui[i].info);
+                       sprintf(buf,_(" %c) %sの型    %s", " %c) Stance of %-12s  %s"),I2A(i+1), kata_shurui[i].desc, kata_shurui[i].info);
                        prt(buf, 3+i, 20);
                }
        }
 
        prt("", 1, 0);
-       prt(_("        どの型で構えますか?", "        Choose Form: "), 1, 14);
+       prt(_("        どの型で構えますか?", "        Choose Stance: "), 1, 14);
 
        while(1)
        {
@@ -166,7 +168,7 @@ static bool choose_kata(void)
                                set_action(ACTION_NONE);
                        }
                        else
-                               msg_print(_("もともと構えていない。", "You are not assuming posture."));
+                               msg_print(_("もともと構えていない。", "You are not in a special stance."));
                        screen_load();
                        return TRUE;
                }
@@ -195,13 +197,13 @@ static bool choose_kata(void)
 
        if (p_ptr->special_defense & (KATA_IAI << new_kata))
        {
-               msg_print(_("構え直した。", "You reassume a posture."));
+               msg_print(_("構え直した。", "You reassume a stance."));
        }
        else
        {
                p_ptr->special_defense &= ~(KATA_MASK);
                p_ptr->update |= (PU_BONUS | PU_MONSTERS);
-               msg_format(_("%sの型で構えた。", "You assume a posture of %s form."),kata_shurui[new_kata].desc);
+               msg_format(_("%sの型で構えた。", "You assume the %s stance."),kata_shurui[new_kata].desc);
                p_ptr->special_defense |= (KATA_IAI << new_kata);
        }
        p_ptr->redraw |= (PR_STATE | PR_STATUS);
@@ -242,7 +244,7 @@ static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
        int i;
        int val;
        int sum = 0;
-       int stat = p_ptr->stat_cur[pd_ptr->stat];
+       BASE_STATUS stat = p_ptr->stat_cur[pd_ptr->stat];
 
        /* No chance for success */
        if ((p_ptr->lev < min_level) || p_ptr->confused)
@@ -283,7 +285,7 @@ static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
 }
 
 
-static int  racial_cost;
+static int racial_cost;
 
 /*!
  * @brief レイシャル・パワーの発動の判定処理
@@ -310,13 +312,13 @@ static int racial_aux(power_desc_type *pd_ptr)
                msg_format(_("この能力を使用するにはレベル %d に達していなければなりません。", 
                                         "You need to attain level %d to use this power."), min_level);
 
-               p_ptr->energy_use = 0;
+               free_turn(p_ptr);
                return FALSE;
        }
 
        if (cmd_limit_confused(p_ptr))
        {
-               p_ptr->energy_use = 0;
+               free_turn(p_ptr);
                return FALSE;
        }
 
@@ -325,7 +327,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        {
                if (!get_check(_("本当に今の衰弱した状態でこの能力を使いますか?", "Really use the power in your weakened state? ")))
                {
-                       p_ptr->energy_use = 0;
+                       free_turn(p_ptr);
                        return FALSE;
                }
        }
@@ -349,7 +351,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        }
 
        /* take time and pay the price */
-       p_ptr->energy_use = 100;
+       take_turn(p_ptr, 100);
 
        /* Success? */
        if (randint1(p_ptr->stat_cur[use_stat]) >= ((difficulty / 2) + randint1(difficulty / 2)))
@@ -451,7 +453,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (!(empty_hands(TRUE) & EMPTY_HAND_RARM))
                        {
-                               msg_print(_("素手じゃないとできません。", "You need to be bare hand."));
+                               msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
                                return FALSE;
                        }
                        if (p_ptr->riding)
@@ -529,7 +531,7 @@ static bool cmd_racial_power_aux(s32b command)
                        /* Singing is already stopped */
                        if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return FALSE;
 
-                       stop_singing();
+                       stop_singing(p_ptr);
                        p_ptr->energy_use = 10;
                        break;
                }
@@ -547,6 +549,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
+                               concentration(p_ptr);
                        }
                        else if (command == -4)
                        {
@@ -570,7 +573,7 @@ static bool cmd_racial_power_aux(s32b command)
                        {
                                set_action(ACTION_LEARN);
                        }
-                       p_ptr->energy_use = 0;
+                       free_turn(p_ptr);
                        break;
                }
                case CLASS_CAVALRY:
@@ -799,7 +802,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                default:
                        msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
-                       p_ptr->energy_use = 0;
+                       free_turn(p_ptr);
        }
        }
        return TRUE;
@@ -834,7 +837,7 @@ void do_cmd_racial_power(void)
 
        if (cmd_limit_confused(p_ptr))
        {
-               p_ptr->energy_use = 0;
+               free_turn(p_ptr);
                return;
        }
 
@@ -858,7 +861,7 @@ void do_cmd_racial_power(void)
        case CLASS_HIGH_MAGE:
        if (p_ptr->realm1 == REALM_HEX)
        {
-               strcpy(power_desc[num].name, _("詠唱をやめる", "Stop spelling"));
+               strcpy(power_desc[num].name, _("詠唱をやめる", "Stop spell casting"));
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
                power_desc[num].stat = A_INT;
@@ -972,7 +975,7 @@ void do_cmd_racial_power(void)
        }
        case CLASS_MONK:
        {
-               strcpy(power_desc[num].name, _("構える", "Assume a Posture"));
+               strcpy(power_desc[num].name, _("構える", "Assume a Stance"));
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
                power_desc[num].stat = A_DEX;
@@ -1098,7 +1101,7 @@ void do_cmd_racial_power(void)
                power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                
-               strcpy(power_desc[num].name, _("型", "Assume a Posture"));
+               strcpy(power_desc[num].name, _("型", "Assume a Stance"));
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
                power_desc[num].stat = A_DEX;
@@ -1803,7 +1806,6 @@ void do_cmd_racial_power(void)
 
 if (!repeat_pull(&i) || i<0 || i>=num) {
        if (use_menu) screen_save();
-        /* Get a spell from the user */
 
        choice = (always_show_list || use_menu) ? ESCAPE:1;
        while (!flag)
@@ -1818,7 +1820,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                                case '0':
                                {
                                        screen_load();
-                                       p_ptr->energy_use = 0;
+                                       free_turn(p_ptr);
                                        return;
                                }
 
@@ -1876,8 +1878,6 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                                TERM_LEN x1, y1;
 
                                strcpy(dummy, "");
-
-                               /* Show list */
                                redraw = TRUE;
                                if (!use_menu) screen_save();
 
@@ -1982,7 +1982,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
        /* Abort if needed */
        if (!flag)
        {
-               p_ptr->energy_use = 0;
+               free_turn(p_ptr);
                return;
        }
        repeat_push(i);
@@ -2018,13 +2018,11 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                        }
                        else p_ptr->csp -= actual_racial_cost;
 
-                       /* Redraw mana and hp */
                        p_ptr->redraw |= (PR_HP | PR_MANA);
-
                        p_ptr->window |= (PW_PLAYER | PW_SPELL);
                }
        }
-       else p_ptr->energy_use = 0;
+       else free_turn(p_ptr);
 
        /* Success */
        return;