OSDN Git Service

[Refactor] #40482 Separated spells-perception.c/h from spells3.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 13:28:07 +0000 (22:28 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 13:28:07 +0000 (22:28 +0900)
30 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/cmd-building/cmd-building.c
src/cmd-item/cmd-activate.c
src/cmd-item/cmd-item.c
src/cmd-item/cmd-quaff.c
src/cmd-item/cmd-read.c
src/cmd-item/cmd-usestaff.c
src/cmd-item/cmd-zaprod.c
src/effect/effect-item.c
src/market/building-recharger.c
src/mind/mind.c
src/mind/racial.c
src/player/player-move.c
src/realm/realm-arcane.c
src/realm/realm-craft.c
src/realm/realm-death.c
src/realm/realm-hissatsu.c
src/realm/realm-life.c
src/realm/realm-nature.c
src/realm/realm-sorcery.c
src/realm/realm-trump.c
src/spell-kind/spells-perception.c [new file with mode: 0644]
src/spell-kind/spells-perception.h [new file with mode: 0644]
src/spell/spells-object.c
src/spell/spells3.c
src/spell/spells3.h
src/store/store.c
src/wizard/wizard-special-process.c

index e0dabb4..0825bcf 100644 (file)
     <ClCompile Include="..\..\src\mind\stances-table.c" />\r
     <ClCompile Include="..\..\src\player\bad-status-setter.c" />\r
     <ClCompile Include="..\..\src\spell-kind\spells-curse-removal.c" />\r
+    <ClCompile Include="..\..\src\spell-kind\spells-perception.c" />\r
     <ClCompile Include="..\..\src\spell-kind\spells-recall.c" />\r
     <ClCompile Include="..\..\src\spell-realm\spells-chaos.c" />\r
     <ClCompile Include="..\..\src\view\display-map.c" />\r
     <ClInclude Include="..\..\src\player\bad-status-setter.h" />\r
     <ClInclude Include="..\..\src\player\special-defense-types.h" />\r
     <ClInclude Include="..\..\src\spell-kind\spells-curse-removal.h" />\r
+    <ClInclude Include="..\..\src\spell-kind\spells-perception.h" />\r
     <ClInclude Include="..\..\src\spell-kind\spells-recall.h" />\r
     <ClInclude Include="..\..\src\spell-realm\spells-chaos.h" />\r
     <ClInclude Include="..\..\src\system\alloc-entries.h" />\r
index f7bffa7..b572d75 100644 (file)
     <ClCompile Include="..\..\src\spell-kind\spells-curse-removal.c">
       <Filter>spell-kind</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\spell-kind\spells-perception.c">
+      <Filter>spell-kind</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\spell-kind\spells-curse-removal.h">
       <Filter>spell-kind</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\spell-kind\spells-perception.h">
+      <Filter>spell-kind</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 38ba6e8..3030032 100644 (file)
@@ -527,6 +527,7 @@ hengband_SOURCES = \
        spell-kind/spells-lite.c spell-kind/spells-lite.h \
        spell-kind/spells-neighbor.c spell-kind/spells-neighbor.h \
        spell-kind/spells-pet.c spell-kind/spells-pet.h \
+       spell-kind/spells-perception.c spell-kind/spells-perception.h \
        spell-kind/spells-random.c spell-kind/spells-random.h \
        spell-kind/spells-recall.c spell-kind/spells-recall.h \
        spell-kind/spells-sight.c spell-kind/spells-sight.h \
index b512273..9014de6 100644 (file)
@@ -13,8 +13,8 @@
 
 #include "cmd-building/cmd-building.h"
 #include "cmd-action/cmd-spell.h"
-#include "cmd-io/cmd-dump.h"
 #include "cmd-building/cmd-inn.h"
+#include "cmd-io/cmd-dump.h"
 #include "core/asking-player.h"
 #include "core/scores.h"
 #include "core/show-file.h"
 #include "player/avatar.h"
 #include "player/player-personalities-types.h"
 #include "player/player-status.h"
-#include "spell/spells-status.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-teleport.h"
-#include "spell/spells3.h"
+#include "spell/spells-status.h"
 #include "system/building-type-definition.h"
 #include "term/screen-processor.h"
 #include "util/bit-flags-calculator.h"
index 41ed21c..3e7586d 100644 (file)
@@ -61,6 +61,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-random.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
index 03ff5bc..9868d9b 100644 (file)
@@ -64,7 +64,7 @@
 #include "realm/realm-hex-numbers.h"
 #include "realm/realm-names-table.h"
 #include "realm/realm-types.h"
-#include "spell/spells3.h"
+#include "spell-kind/spells-perception.h"
 #include "sv-definition/sv-lite-types.h"
 #include "term/screen-processor.h"
 #include "util/int-char-converter.h"
index 0a2887c..b0b4549 100644 (file)
@@ -37,6 +37,7 @@
 #include "realm/realm-hex-numbers.h"
 #include "spell-kind/spells-detection.h"
 #include "spell-kind/spells-floor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-realm/spells-hex.h"
 #include "spell/spells-status.h"
 #include "spell/spells3.h"
index af0340e..4ae4336 100644 (file)
@@ -38,6 +38,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
index 0134ff2..1044573 100644 (file)
 #include "spell-kind/spells-genocide.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-staff-only.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
-#include "spell/spells3.h"
 #include "sv-definition/sv-staff-types.h"
 #include "term/screen-processor.h"
 #include "view/display-messages.h"
index 65b7907..7de2467 100644 (file)
@@ -23,6 +23,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-random.h"
 #include "spell-kind/spells-sight.h"
@@ -30,7 +31,6 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-status.h"
 #include "spell/spell-types.h"
-#include "spell/spells3.h"
 #include "sv-definition/sv-other-types.h"
 #include "sv-definition/sv-rod-types.h"
 #include "term/screen-processor.h"
index 3330c47..f6c0bbc 100644 (file)
@@ -11,8 +11,8 @@
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
 #include "perception/object-perception.h"
+#include "spell-kind/spells-perception.h"
 #include "spell/spell-types.h"
-#include "spell/spells3.h"
 #include "sv-definition/sv-other-types.h"
 #include "sv-definition/sv-scroll-types.h"
 #include "util/bit-flags-calculator.h"
index e998deb..971435c 100644 (file)
@@ -9,7 +9,7 @@
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object-enchant/special-object-flags.h"
-#include "spell/spells3.h"
+#include "spell-kind/spells-perception.h"
 #include "term/screen-processor.h"
 #include "view/display-messages.h"
 
index 549fd8f..d1c2c68 100644 (file)
@@ -56,6 +56,7 @@
 #include "spell-kind/spells-grid.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell/spells-status.h"
index 87ae5fc..470d0d2 100644 (file)
@@ -55,6 +55,7 @@
 #include "spell-kind/spells-grid.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
index 1870565..56583e1 100644 (file)
 #include "player/player-status.h"
 #include "realm/realm-song-numbers.h"
 #include "spell-kind/spells-floor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell/process-effect.h"
 #include "spell/spell-types.h"
-#include "spell/spells3.h"
 #include "term/screen-processor.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
index 597c286..c2c8a13 100644 (file)
 #include "spell-kind/spells-floor.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell/spells-object.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spell-types.h"
-#include "spell/spells3.h"
 #include "view/display-messages.h"
 
 /*!
index 964d5bb..a8809e4 100644 (file)
@@ -7,6 +7,7 @@
 #include "player/player-status.h"
 #include "player/selfinfo.h"
 #include "spell-kind/spells-curse-removal.h"
+#include "spell-kind/spells-perception.h"
 #include "spell/range-calc.h"
 #include "spell/spells-object.h"
 #include "spell/spells-status.h"
index b99f060..1459af5 100644 (file)
@@ -13,6 +13,7 @@
 #include "spell-kind/spells-genocide.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-specific-bolt.h"
 #include "spell/process-effect.h"
@@ -21,7 +22,6 @@
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
 #include "spell/spell-types.h"
-#include "spell/spells3.h"
 
 /*!
 * @brief 暗黒領域魔法の各処理を行う
index 43186b8..2931445 100644 (file)
 #include "spell-kind/earthquake.h"
 #include "spell-kind/spells-detection.h"
 #include "spell-kind/spells-launcher.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spell-types.h"
 #include "spell/spells-util.h"
-#include "spell/spells3.h"
 #include "spell/technic-info-table.h"
 #include "term/screen-processor.h"
 #include "util/bit-flags-calculator.h"
index 6b6d3cd..c5b794f 100644 (file)
@@ -13,6 +13,7 @@
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell/spells-status.h"
index eeb3be1..f815af7 100644 (file)
@@ -23,6 +23,7 @@
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
 #include "spell-kind/spells-neighbor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
 #include "spell/process-effect.h"
 #include "spell/spells-diceroll.h"
index 881187d..1077421 100644 (file)
@@ -11,6 +11,7 @@
 #include "spell-kind/spells-grid.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
index a5ef839..2397789 100644 (file)
@@ -11,6 +11,7 @@
 #include "spell-kind/spells-detection.h"
 #include "spell-kind/spells-floor.h"
 #include "spell-kind/spells-launcher.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-recall.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
diff --git a/src/spell-kind/spells-perception.c b/src/spell-kind/spells-perception.c
new file mode 100644 (file)
index 0000000..37c3530
--- /dev/null
@@ -0,0 +1,188 @@
+#include "spell-kind/spells-perception.h"
+#include "autopick/autopick.h"
+#include "core/stuff-handler.h"
+#include "game-option/auto-destruction-options.h"
+#include "game-option/play-record-options.h"
+#include "inventory/player-inventory.h"
+#include "io/write-diary.h"
+#include "object-enchant/special-object-flags.h"
+#include "object/item-use-flags.h"
+#include "object/object-flavor.h"
+#include "object/object-hook.h"
+#include "object/object-info.h"
+#include "object/object-mark-types.h"
+#include "perception/identification.h"
+#include "perception/object-perception.h"
+#include "player/avatar.h"
+#include "system/object-type-definition.h"
+#include "view/display-messages.h"
+#include "world/world.h"
+
+/*!
+ * @brief 全所持アイテム鑑定処理 /
+ * Identify everything being carried.
+ * Done by a potion of "self knowledge".
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @return なし
+ */
+void identify_pack(player_type *target_ptr)
+{
+    for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
+        object_type *o_ptr = &target_ptr->inventory_list[i];
+        if (!o_ptr->k_idx)
+            continue;
+
+        identify_item(target_ptr, o_ptr);
+        autopick_alter_item(target_ptr, i, FALSE);
+    }
+}
+
+/*!
+ * @brief アイテム鑑定処理 /
+ * Identify an object
+ * @param owner_ptr プレーヤーへの参照ポインタ
+ * @param o_ptr 鑑定されるアイテムの情報参照ポインタ
+ * @return 実際に鑑定できたらTRUEを返す
+ */
+bool identify_item(player_type *owner_ptr, object_type *o_ptr)
+{
+    GAME_TEXT o_name[MAX_NLEN];
+    object_desc(owner_ptr, o_name, o_ptr, 0);
+
+    bool old_known = FALSE;
+    if (o_ptr->ident & IDENT_KNOWN)
+        old_known = TRUE;
+
+    if (!object_is_fully_known(o_ptr)) {
+        if (object_is_artifact(o_ptr) || one_in_(5))
+            chg_virtue(owner_ptr, V_KNOWLEDGE, 1);
+    }
+
+    object_aware(owner_ptr, o_ptr);
+    object_known(o_ptr);
+    o_ptr->marked |= OM_TOUCHED;
+
+    owner_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
+    owner_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+
+    strcpy(record_o_name, o_name);
+    record_turn = current_world_ptr->game_turn;
+
+    object_desc(owner_ptr, o_name, o_ptr, OD_NAME_ONLY);
+
+    if (record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
+        exe_write_diary(owner_ptr, DIARY_ART, 0, o_name);
+    if (record_rand_art && !old_known && o_ptr->art_name)
+        exe_write_diary(owner_ptr, DIARY_ART, 0, o_name);
+
+    return old_known;
+}
+
+/*!
+ * @brief アイテム鑑定のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
+ * This routine does *not* automatically combine objects.
+ * Returns TRUE if something was identified, else FALSE.
+ */
+bool ident_spell(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval)
+{
+    if (only_equip)
+        item_tester_hook = item_tester_hook_identify_weapon_armour;
+    else
+        item_tester_hook = item_tester_hook_identify;
+
+    concptr q;
+    if (can_get_item(caster_ptr, item_tester_tval)) {
+        q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
+    } else {
+        if (only_equip)
+            item_tester_hook = object_is_weapon_armour_ammo;
+        else
+            item_tester_hook = NULL;
+
+        q = _("すべて鑑定済みです。 ", "All items are identified. ");
+    }
+
+    concptr s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
+    OBJECT_IDX item;
+    object_type *o_ptr;
+    o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+    if (!o_ptr)
+        return FALSE;
+
+    bool old_known = identify_item(caster_ptr, o_ptr);
+
+    GAME_TEXT o_name[MAX_NLEN];
+    object_desc(caster_ptr, o_name, o_ptr, 0);
+    if (item >= INVEN_RARM) {
+        msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(caster_ptr, item), o_name, index_to_label(item));
+    } else if (item >= 0) {
+        msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
+    } else {
+        msg_format(_("床上: %s。", "On the ground: %s."), o_name);
+    }
+
+    autopick_alter_item(caster_ptr, item, (bool)(destroy_identify && !old_known));
+    return TRUE;
+}
+
+/*!
+ * @brief アイテム*鑑定*のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
+ * Fully "identify" an object in the inventory -BEN-
+ * This routine returns TRUE if an item was identified.
+ */
+bool identify_fully(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval)
+{
+    if (only_equip)
+        item_tester_hook = item_tester_hook_identify_fully_weapon_armour;
+    else
+        item_tester_hook = item_tester_hook_identify_fully;
+
+    concptr q;
+    if (can_get_item(caster_ptr, item_tester_tval)) {
+        q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
+    } else {
+        if (only_equip)
+            item_tester_hook = object_is_weapon_armour_ammo;
+        else
+            item_tester_hook = NULL;
+
+        q = _("すべて*鑑定*済みです。 ", "All items are *identified*. ");
+    }
+
+    concptr s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
+
+    OBJECT_IDX item;
+    object_type *o_ptr;
+    o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+    if (!o_ptr)
+        return FALSE;
+
+    bool old_known = identify_item(caster_ptr, o_ptr);
+
+    o_ptr->ident |= (IDENT_FULL_KNOWN);
+    handle_stuff(caster_ptr);
+
+    GAME_TEXT o_name[MAX_NLEN];
+    object_desc(caster_ptr, o_name, o_ptr, 0);
+    if (item >= INVEN_RARM) {
+        msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(caster_ptr, item), o_name, index_to_label(item));
+    } else if (item >= 0) {
+        msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
+    } else {
+        msg_format(_("床上: %s。", "On the ground: %s."), o_name);
+    }
+
+    (void)screen_object(caster_ptr, o_ptr, 0L);
+    autopick_alter_item(caster_ptr, item, (bool)(destroy_identify && !old_known));
+    return TRUE;
+}
diff --git a/src/spell-kind/spells-perception.h b/src/spell-kind/spells-perception.h
new file mode 100644 (file)
index 0000000..71b0d6f
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "system/angband.h"
+#include "object/tval-types.h"
+
+void identify_pack(player_type *target_ptr);
+bool identify_item(player_type *owner_ptr, object_type *o_ptr);
+bool ident_spell(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval);
+bool identify_fully(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval);
index 8017409..b5c52a1 100644 (file)
@@ -43,7 +43,7 @@
 #include "player/player-damage.h"
 #include "player/player-effects.h"
 #include "player/player-status.h"
-#include "spell/spells3.h"
+#include "spell-kind/spells-perception.h"
 #include "sv-definition/sv-food-types.h"
 #include "sv-definition/sv-lite-types.h"
 #include "sv-definition/sv-other-types.h"
index 6bb8c81..78c10cf 100644 (file)
 #include "view/display-messages.h"
 #include "world/world.h"
 
-// todo コピペ感が強くなったので関数化
-static bool update_player(player_type *caster_ptr);
-static bool redraw_player(player_type *caster_ptr);
-
 /*!
  * @brief プレイヤーの装備劣化処理 /
  * Apply disenchantment to the player's stuff
@@ -325,25 +321,6 @@ void reserve_alter_reality(player_type *caster_ptr)
 }
 
 /*!
- * @brief 全所持アイテム鑑定処理 /
- * Identify everything being carried.
- * Done by a potion of "self knowledge".
- * @param target_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void identify_pack(player_type *target_ptr)
-{
-    for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
-        object_type *o_ptr = &target_ptr->inventory_list[i];
-        if (!o_ptr->k_idx)
-            continue;
-
-        identify_item(target_ptr, o_ptr);
-        autopick_alter_item(target_ptr, i, FALSE);
-    }
-}
-
-/*!
  * @brief アイテムの価値に応じた錬金術処理 /
  * Turns an object into gold, gain some of its value in a shop
  * @param caster_ptr プレーヤーへの参照ポインタ
@@ -499,99 +476,6 @@ bool artifact_scroll(player_type *caster_ptr)
 }
 
 /*!
- * @brief アイテム鑑定処理 /
- * Identify an object
- * @param owner_ptr プレーヤーへの参照ポインタ
- * @param o_ptr 鑑定されるアイテムの情報参照ポインタ
- * @return 実際に鑑定できたらTRUEを返す
- */
-bool identify_item(player_type *owner_ptr, object_type *o_ptr)
-{
-    GAME_TEXT o_name[MAX_NLEN];
-    object_desc(owner_ptr, o_name, o_ptr, 0);
-
-    bool old_known = FALSE;
-    if (o_ptr->ident & IDENT_KNOWN)
-        old_known = TRUE;
-
-    if (!object_is_fully_known(o_ptr)) {
-        if (object_is_artifact(o_ptr) || one_in_(5))
-            chg_virtue(owner_ptr, V_KNOWLEDGE, 1);
-    }
-
-    object_aware(owner_ptr, o_ptr);
-    object_known(o_ptr);
-    o_ptr->marked |= OM_TOUCHED;
-
-    owner_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
-    owner_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
-
-    strcpy(record_o_name, o_name);
-    record_turn = current_world_ptr->game_turn;
-
-    object_desc(owner_ptr, o_name, o_ptr, OD_NAME_ONLY);
-
-    if (record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
-        exe_write_diary(owner_ptr, DIARY_ART, 0, o_name);
-    if (record_rand_art && !old_known && o_ptr->art_name)
-        exe_write_diary(owner_ptr, DIARY_ART, 0, o_name);
-
-    return old_known;
-}
-
-/*!
- * @brief アイテム鑑定のメインルーチン処理 /
- * Identify an object in the inventory (or on the floor)
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @param only_equip 装備品のみを対象とするならばTRUEを返す
- * @return 実際に鑑定を行ったならばTRUEを返す
- * @details
- * This routine does *not* automatically combine objects.
- * Returns TRUE if something was identified, else FALSE.
- */
-bool ident_spell(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval)
-{
-    if (only_equip)
-        item_tester_hook = item_tester_hook_identify_weapon_armour;
-    else
-        item_tester_hook = item_tester_hook_identify;
-
-    concptr q;
-    if (can_get_item(caster_ptr, item_tester_tval)) {
-        q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
-    } else {
-        if (only_equip)
-            item_tester_hook = object_is_weapon_armour_ammo;
-        else
-            item_tester_hook = NULL;
-
-        q = _("すべて鑑定済みです。 ", "All items are identified. ");
-    }
-
-    concptr s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
-    OBJECT_IDX item;
-    object_type *o_ptr;
-    o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
-    if (!o_ptr)
-        return FALSE;
-
-    bool old_known = identify_item(caster_ptr, o_ptr);
-
-    GAME_TEXT o_name[MAX_NLEN];
-    object_desc(caster_ptr, o_name, o_ptr, 0);
-    if (item >= INVEN_RARM) {
-        msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(caster_ptr, item), o_name, index_to_label(item));
-    } else if (item >= 0) {
-        msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
-    } else {
-        msg_format(_("床上: %s。", "On the ground: %s."), o_name);
-    }
-
-    autopick_alter_item(caster_ptr, item, (bool)(destroy_identify && !old_known));
-    return TRUE;
-}
-
-/*!
  * @brief アイテム凡庸化のメインルーチン処理 /
  * Identify an object in the inventory (or on the floor)
  * @param owner_ptr プレーヤーへの参照ポインタ
@@ -640,60 +524,22 @@ bool mundane_spell(player_type *owner_ptr, bool only_equip)
     return TRUE;
 }
 
-/*!
- * @brief アイテム*鑑定*のメインルーチン処理 /
- * Identify an object in the inventory (or on the floor)
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @param only_equip 装備品のみを対象とするならばTRUEを返す
- * @return 実際に鑑定を行ったならばTRUEを返す
- * @details
- * Fully "identify" an object in the inventory -BEN-
- * This routine returns TRUE if an item was identified.
- */
-bool identify_fully(player_type *caster_ptr, bool only_equip, tval_type item_tester_tval)
+static bool update_player(player_type *caster_ptr)
 {
-    if (only_equip)
-        item_tester_hook = item_tester_hook_identify_fully_weapon_armour;
-    else
-        item_tester_hook = item_tester_hook_identify_fully;
-
-    concptr q;
-    if (can_get_item(caster_ptr, item_tester_tval)) {
-        q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
-    } else {
-        if (only_equip)
-            item_tester_hook = object_is_weapon_armour_ammo;
-        else
-            item_tester_hook = NULL;
-
-        q = _("すべて*鑑定*済みです。 ", "All items are *identified*. ");
-    }
-
-    concptr s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
-
-    OBJECT_IDX item;
-    object_type *o_ptr;
-    o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
-    if (!o_ptr)
-        return FALSE;
-
-    bool old_known = identify_item(caster_ptr, o_ptr);
-
-    o_ptr->ident |= (IDENT_FULL_KNOWN);
-    handle_stuff(caster_ptr);
+    caster_ptr->update |= PU_COMBINE | PU_REORDER;
+    caster_ptr->window |= PW_INVEN;
+    return TRUE;
+}
 
-    GAME_TEXT o_name[MAX_NLEN];
-    object_desc(caster_ptr, o_name, o_ptr, 0);
-    if (item >= INVEN_RARM) {
-        msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(caster_ptr, item), o_name, index_to_label(item));
-    } else if (item >= 0) {
-        msg_format(_("ザック中: %s(%c)。", "In your pack: %s (%c)."), o_name, index_to_label(item));
-    } else {
-        msg_format(_("床上: %s。", "On the ground: %s."), o_name);
+static bool redraw_player(player_type *caster_ptr)
+{
+    if (caster_ptr->csp > caster_ptr->msp) {
+        caster_ptr->csp = caster_ptr->msp;
     }
 
-    (void)screen_object(caster_ptr, o_ptr, 0L);
-    autopick_alter_item(caster_ptr, item, (bool)(destroy_identify && !old_known));
+    caster_ptr->redraw |= PR_MANA;
+    caster_ptr->update |= PU_COMBINE | PU_REORDER;
+    caster_ptr->window |= PW_INVEN;
     return TRUE;
 }
 
@@ -1804,32 +1650,25 @@ bool fetch_monster(player_type *caster_ptr)
             tx = nx;
         }
     }
-    /* Update the old location */
-    caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx = 0;
 
-    /* Update the new location */
+    caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx = 0;
     caster_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
-
-    /* Move the monster */
     m_ptr->fy = ty;
     m_ptr->fx = tx;
-
-    /* Wake the monster up */
     (void)set_monster_csleep(caster_ptr, m_idx, 0);
-
     update_monster(caster_ptr, m_idx, TRUE);
     lite_spot(caster_ptr, target_row, target_col);
     lite_spot(caster_ptr, ty, tx);
-
     if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
         caster_ptr->update |= (PU_MON_LITE);
 
     if (m_ptr->ml) {
-        /* Auto-Recall if possible and visible */
         if (!caster_ptr->image)
             monster_race_track(caster_ptr, m_ptr->ap_r_idx);
+
         health_track(caster_ptr, m_idx);
     }
+
     return TRUE;
 }
 
@@ -2106,22 +1945,3 @@ bool tele_town(player_type *caster_ptr)
     screen_load();
     return TRUE;
 }
-
-static bool update_player(player_type *caster_ptr)
-{
-    caster_ptr->update |= PU_COMBINE | PU_REORDER;
-    caster_ptr->window |= PW_INVEN;
-    return TRUE;
-}
-
-static bool redraw_player(player_type *caster_ptr)
-{
-    if (caster_ptr->csp > caster_ptr->msp) {
-        caster_ptr->csp = caster_ptr->msp;
-    }
-
-    caster_ptr->redraw |= PR_MANA;
-    caster_ptr->update |= PU_COMBINE | PU_REORDER;
-    caster_ptr->window |= PW_INVEN;
-    return TRUE;
-}
index 3c21118..f49a15c 100644 (file)
@@ -8,13 +8,9 @@ bool eat_magic(player_type *caster_ptr, int power);
 bool apply_disenchant(player_type* target_ptr, BIT_FLAGS mode);
 void fetch(player_type* caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los);
 void reserve_alter_reality(player_type* caster_ptr);
-void identify_pack(player_type* target_ptr);
 bool alchemy(player_type* caster_ptr);
 bool artifact_scroll(player_type* caster_ptr);
-bool ident_spell(player_type* caster_ptr, bool only_equip, tval_type item_tester_tval);
 bool mundane_spell(player_type* ownner_ptr, bool only_equip);
-bool identify_item(player_type* owner_ptr, object_type* o_ptr);
-bool identify_fully(player_type* caster_ptr, bool only_equip, tval_type item_tester_tval);
 bool recharge(player_type* caster_ptr, int power);
 void display_spell_list(player_type* caster_ptr);
 EXP experience_of_spell(player_type* caster_ptr, SPELL_IDX spell, REALM_IDX use_realm);
index dd7cfd5..b66b0b2 100644 (file)
@@ -72,7 +72,7 @@
 #include "player/player-effects.h"
 #include "player/player-status.h"
 #include "player/race-info-table.h"
-#include "spell/spells3.h"
+#include "spell-kind/spells-perception.h"
 #include "store/black-market.h"
 #include "store/rumor.h"
 #include "store/say-comments.h"
index e1cb214..4bd4e28 100644 (file)
 #include "player/selfinfo.h"
 #include "spell-kind/spells-detection.h"
 #include "spell-kind/spells-floor.h"
+#include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-object.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
 #include "spell/spells-util.h"
-#include "spell/spells3.h"
 #include "system/alloc-entries.h"
 #include "system/angband-version.h"
 #include "term/screen-processor.h"