OSDN Git Service

[WIP] [Refactor] #39963 Separated spells2.h from spells1.h
[hengband/hengband.git] / src / racial.c
index faad55d..b99fd77 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "angband.h"
-#include "core.h"
+#include "core/stuff-handler.h"
 #include "util.h"
 
 #include "cmd-basic.h"
@@ -21,7 +21,6 @@
 #include "cmd-pet.h"
 #include "melee.h"
 #include "object-hook.h"
-#include "realm-song.h"
 
 #include "mutation.h"
 #include "player-race.h"
 #include "spells-status.h"
 #include "spells-object.h"
 #include "spells-floor.h"
-#include "spells.h"
 #include "cmd-spell.h"
-#include "realm-hex.h"
+#include "realm/realm-hex.h"
 #include "targeting.h"
-#include "view-mainwindow.h"
+#include "view/display-main-window.h"
 #include "player-class.h"
+#include "effect/spells-effect-util.h"
+#include "spell/spells-type.h"
+#include "spell/spells2.h"
 
 /*!
  * @brief 修行僧の構え設定処理
@@ -63,9 +64,9 @@ static bool choose_kamae(player_type *creature_ptr)
        }
 
        prt("", 1, 0);
-       prt(_("        どの構えをとりますか?", "        Choose Form: "), 1, 14);
+       prt(_("        どの構えをとりますか?", "        Choose Stance: "), 1, 14);
 
-       while(1)
+       while (TRUE)
        {
                choice = inkey();
 
@@ -81,7 +82,7 @@ static bool choose_kamae(player_type *creature_ptr)
                                set_action(creature_ptr, ACTION_NONE);
                        }
                        else
-                               msg_print(_("もともと構えていない。", "You are not assuming a posture."));
+                               msg_print(_("もともと構えていない。", "You are not in a special stance."));
                        screen_load();
                        return TRUE;
                }
@@ -110,14 +111,14 @@ static bool choose_kamae(player_type *creature_ptr)
 
        if (creature_ptr->special_defense & (KAMAE_GENBU << new_kamae))
        {
-               msg_print(_("構え直した。", "You reassume a posture."));
+               msg_print(_("構え直した。", "You reassume a stance."));
        }
        else
        {
                creature_ptr->special_defense &= ~(KAMAE_MASK);
                creature_ptr->update |= (PU_BONUS);
                creature_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);
                creature_ptr->special_defense |= (KAMAE_GENBU << new_kamae);
        }
        creature_ptr->redraw |= PR_STATE;
@@ -156,15 +157,15 @@ static bool choose_kata(player_type *creature_ptr)
        {
                if (creature_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)
+       while (TRUE)
        {
                choice = inkey();
 
@@ -180,7 +181,7 @@ static bool choose_kata(player_type *creature_ptr)
                                set_action(creature_ptr, ACTION_NONE);
                        }
                        else
-                               msg_print(_("もともと構えていない。", "You are not assuming posture."));
+                               msg_print(_("もともと構えていない。", "You are not in a special stance."));
                        screen_load();
                        return TRUE;
                }
@@ -209,13 +210,13 @@ static bool choose_kata(player_type *creature_ptr)
 
        if (creature_ptr->special_defense & (KATA_IAI << new_kata))
        {
-               msg_print(_("構え直した。", "You reassume a posture."));
+               msg_print(_("構え直した。", "You reassume a stance."));
        }
        else
        {
                creature_ptr->special_defense &= ~(KATA_MASK);
                creature_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);
                creature_ptr->special_defense |= (KATA_IAI << new_kata);
        }
        creature_ptr->redraw |= (PR_STATE | PR_STATUS);
@@ -225,14 +226,9 @@ static bool choose_kata(player_type *creature_ptr)
 
 
 /*!
- * @brief レイシャル・パワー情報のtypedef
- */
-typedef struct power_desc_type power_desc_type;
-
-/*!
  * @brief レイシャル・パワー情報の構造体定義
  */
-struct power_desc_type
+typedef struct power_desc_type
 {
        GAME_TEXT name[MAX_NLEN];      //!<レイシャル名
        PLAYER_LEVEL level;     //!<体得レベル
@@ -240,7 +236,7 @@ struct power_desc_type
        int stat;
        PERCENTAGE fail;
        int number;
-};
+} power_desc_type;
 
 
 /*!
@@ -261,7 +257,7 @@ static PERCENTAGE racial_chance(player_type *creature_ptr, power_desc_type *pd_p
        /* No chance for success */
        if ((creature_ptr->lev < min_level) || creature_ptr->confused)
        {
-               return (0);
+               return 0;
        }
 
        if (difficulty == 0) return 100;
@@ -405,6 +401,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        if (retval) creature_ptr->energy_use = 10;
                        return (retval);
                }
+                       /* Fall through */
                case CLASS_MAGE:
                /* case CLASS_HIGH_MAGE: */
                case CLASS_SORCERER:
@@ -440,7 +437,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                }
                case CLASS_PALADIN:
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        fire_beam(creature_ptr, is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE,
                                  dir, plev * 3);
                        break;
@@ -466,7 +463,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (!(empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM))
                        {
-                               msg_print(_("素手じゃないとできません。", "You need to be bare hand."));
+                               msg_print(_("素手じゃないとできません。", "You need to be barehanded."));
                                return FALSE;
                        }
                        if (creature_ptr->riding)
@@ -495,19 +492,19 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (command == -3)
                        {
-                               if (!get_aim_dir(&dir)) return FALSE;
+                               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                                project_length = 1;
                                fire_beam(creature_ptr, GF_PHOTO, dir, 1);
                        }
                        else if (command == -4)
                        {
-                               if (!identify_fully(creature_ptr, FALSE)) return FALSE;
+                               if (!identify_fully(creature_ptr, FALSE, 0)) return FALSE;
                        }
                        break;
                }
                case CLASS_IMITATOR:
                {
-                       handle_stuff();
+                       handle_stuff(creature_ptr);
                        if (!do_cmd_mane(creature_ptr, TRUE)) return FALSE;
                        break;
                }
@@ -515,7 +512,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (command == -3)
                        {
-                               if (!get_aim_dir(&dir)) return FALSE;
+                               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                                (void)fire_ball_hide(creature_ptr, GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
                        }
                        else if (command == -4)
@@ -551,9 +548,9 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                case CLASS_RED_MAGE:
                {
                        if (cmd_limit_cast(creature_ptr)) return FALSE;
-                       handle_stuff();
+                       handle_stuff(creature_ptr);
                        do_cmd_cast(creature_ptr);
-                       handle_stuff();
+                       handle_stuff(creature_ptr);
                        if (!creature_ptr->paralyzed && !cmd_limit_cast(creature_ptr))
                                do_cmd_cast(creature_ptr);
                        break;
@@ -602,11 +599,11 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (creature_ptr->lev > 29)
                        {
-                               if (!identify_fully(creature_ptr, TRUE)) return FALSE;
+                               if (!identify_fully(creature_ptr, TRUE, 0)) return FALSE;
                        }
                        else
                        {
-                               if (!ident_spell(creature_ptr, TRUE)) return FALSE;
+                               if (!ident_spell(creature_ptr, TRUE, 0)) return FALSE;
                        }
                        break;
                }
@@ -661,7 +658,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_GNOME:
                        msg_print(_("パッ!", "Blink!"));
-                       teleport_player(creature_ptr, 10, 0L);
+                       teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
                        break;
 
                case RACE_HALF_ORC:
@@ -697,11 +694,11 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_HALF_OGRE:
                        msg_print(_("爆発のルーンを慎重に仕掛けた...", "You carefully set an explosive rune..."));
-                       explosive_rune(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x);
+                       explosive_rune(creature_ptr, creature_ptr->y, creature_ptr->x);
                        break;
 
                case RACE_HALF_GIANT:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
                        break;
 
@@ -711,20 +708,20 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_CYCLOPS:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("巨大な岩を投げた。", "You throw a huge boulder."));
                        fire_bolt(creature_ptr, GF_MISSILE, dir, (3 * plev) / 2);
                        break;
 
                case RACE_YEEK:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
                        (void)fear_monster(creature_ptr, dir, plev);
                        break;
 
                case RACE_KLACKON:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("酸を吐いた。", "You spit acid."));
                        if (plev < 25) fire_bolt(creature_ptr, GF_ACID, dir, plev);
@@ -732,7 +729,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_KOBOLD:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("毒のダーツを投げた。", "You throw a dart of poison."));
                        fire_bolt(creature_ptr, GF_POIS, dir, plev);
                        break;
@@ -745,7 +742,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_DARK_ELF:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
                        fire_bolt_or_beam(creature_ptr, 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4));
                        break;
@@ -755,13 +752,13 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_MIND_FLAYER:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red..."));
                        fire_bolt(creature_ptr, GF_PSI, dir, plev);
                        break;
 
                case RACE_IMP:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        if (plev >= 30)
                        {
                                msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire."));
@@ -789,7 +786,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_SPECTRE:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
                        (void)fear_monster(creature_ptr, dir, plev);
@@ -876,7 +873,7 @@ void do_cmd_racial_power(player_type *creature_ptr)
        case CLASS_HIGH_MAGE:
                if (creature_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;
@@ -884,6 +881,7 @@ void do_cmd_racial_power(player_type *creature_ptr)
                        power_desc[num++].number = -3;
                        break;
                }
+               /* Fall through */
        case CLASS_MAGE:
                /* case CLASS_HIGH_MAGE: */
        case CLASS_SORCERER:
@@ -990,7 +988,7 @@ void do_cmd_racial_power(player_type *creature_ptr)
        }
        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;
@@ -1116,7 +1114,7 @@ void do_cmd_racial_power(player_type *creature_ptr)
                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;