OSDN Git Service

[Refactor] #38662 Moved util.* to util/
[hengband/hengband.git] / src / cmd / cmd-spell.c
index 343fc43..b7ebd72 100644 (file)
@@ -6,32 +6,36 @@
     2013 Deskull rearranged comment for Doxygen.
  */
 
-#include "angband.h"
-#include "core.h"
-#include "util.h"
+#include "system/angband.h"
+#include "core/stuff-handler.h"
+#include "util/util.h"
 #include "main/sound-definitions-table.h"
 #include "cmd/cmd-spell.h"
 
 #include "io/write-diary.h"
 #include "cmd/cmd-dump.h"
-#include "selfinfo.h"
-#include "spells.h"
-#include "spells-summon.h"
-#include "realm-hex.h"
-#include "mind.h"
-#include "avatar.h"
-#include "player-damage.h"
-#include "player-status.h"
-#include "player-effects.h"
-#include "player-skill.h"
-#include "player-class.h"
-#include "player-inventory.h"
-#include "object-hook.h"
+#include "player/selfinfo.h"
+#include "spell/technic-info-table.h"
+#include "spell/spells2.h"
+#include "spell/spells3.h"
+#include "spell/spells-summon.h"
+#include "realm/realm-hex.h"
+#include "mind/mind.h"
+#include "player/avatar.h"
+#include "player/player-damage.h"
+#include "player/player-status.h"
+#include "player/player-effects.h"
+#include "player/player-skill.h"
+#include "player/player-class.h"
+#include "inventory/player-inventory.h"
+#include "object/object-hook.h"
 #include "cmd-basic.h"
 #include "view/display-main-window.h"
-#include "floor.h"
+#include "floor/floor.h"
 #include "autopick/autopick-reader-writer.h"
-#include "japanese.h"
+#include "locale/japanese.h"
+#include "spell/spells-util.h"
+#include "spell/spells-execution.h"
 
  /*!
   * 魔法領域フラグ管理テーブル /
@@ -597,6 +601,7 @@ void do_cmd_browse(player_type *caster_ptr)
        object_type *o_ptr;
 
        concptr q, s;
+       OBJECT_TYPE_VALUE tval = 0;
 
        /* Warriors are illiterate */
        if (!(caster_ptr->realm1 || caster_ptr->realm2) && (caster_ptr->pclass != CLASS_SORCERER) && (caster_ptr->pclass != CLASS_RED_MAGE))
@@ -620,15 +625,14 @@ void do_cmd_browse(player_type *caster_ptr)
        }
 
        /* Restrict choices to "useful" books */
-       if (caster_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
+       if (caster_ptr->realm2 == REALM_NONE) tval = mp_ptr->spell_book;
        else item_tester_hook = item_tester_learn_spell;
 
        q = _("どの本を読みますか? ", "Browse which book? ");
        s = _("読める本がない。", "You have no books that you can read.");
 
-       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (caster_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (caster_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), tval);
 
-       item_tester_tval = 0;
        item_tester_hook = NULL;
        if (!o_ptr)
        {
@@ -763,6 +767,8 @@ void do_cmd_study(player_type *caster_ptr)
        concptr p = spell_category_name(mp_ptr->spell_book);
        object_type *o_ptr;
        concptr q, s;
+       OBJECT_TYPE_VALUE tval = 0;
+
 
        if (!caster_ptr->realm1)
        {
@@ -800,15 +806,14 @@ void do_cmd_study(player_type *caster_ptr)
 
 
        /* Restrict choices to "useful" books */
-       if (caster_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
+       if (caster_ptr->realm2 == REALM_NONE) tval = mp_ptr->spell_book;
        else item_tester_hook = item_tester_learn_spell;
 
        q = _("どの本から学びますか? ", "Study which book? ");
        s = _("読める本がない。", "You have no books that you can read.");
 
-       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), tval);
 
-       item_tester_tval = 0;
        if (!o_ptr) return;
 
        /* Access the item's sval */