OSDN Git Service

[Refactor] #40634 Moved do_cmd_activate() from cmd-activate.c/h to cmd-item.c/h
authorHourier <hourier@users.sourceforge.jp>
Mon, 17 Aug 2020 07:40:31 +0000 (16:40 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 17 Aug 2020 07:40:31 +0000 (16:40 +0900)
src/cmd-item/cmd-activate.c
src/cmd-item/cmd-activate.h
src/cmd-item/cmd-item.c
src/cmd-item/cmd-item.h
src/io/input-key-processor.c

index 67a97e1..d9656eb 100644 (file)
 #include "world/world.h"
 
 /*!
- * @brief 装備を発動するコマンドのメインルーチン /
- * @param user_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void do_cmd_activate(player_type *user_ptr)
-{
-    OBJECT_IDX item;
-    if (user_ptr->wild_mode || cmd_limit_arena(user_ptr))
-        return;
-
-    if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
-        set_action(user_ptr, ACTION_NONE);
-
-    item_tester_hook = item_tester_hook_activate;
-
-    concptr q = _("どのアイテムを始動させますか? ", "Activate which item? ");
-    concptr s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
-    if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
-        return;
-
-    exe_activate(user_ptr, item);
-}
-
-/*!
  * @brief アイテムの発動効果を処理する。
  * @param user_ptr プレーヤーへの参照ポインタ
  * @param o_ptr 対象のオブジェクト構造体ポインタ
index aa5252f..7ae84ef 100644 (file)
@@ -3,5 +3,4 @@
 #include "system/angband.h"
 #include "system/object-type-definition.h"
 
-void do_cmd_activate(player_type *user_ptr);
 bool activate_artifact(player_type *user_ptr, object_type *o_ptr);
index ca590f5..1ff3751 100644 (file)
@@ -913,3 +913,27 @@ void do_cmd_use(player_type *creature_ptr)
         break;
     }
 }
+
+/*!
+ * @brief 装備を発動するコマンドのメインルーチン /
+ * @param user_ptr プレーヤーへの参照ポインタ
+ * @return なし
+ */
+void do_cmd_activate(player_type *user_ptr)
+{
+    OBJECT_IDX item;
+    if (user_ptr->wild_mode || cmd_limit_arena(user_ptr))
+        return;
+
+    if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
+        set_action(user_ptr, ACTION_NONE);
+
+    item_tester_hook = item_tester_hook_activate;
+
+    concptr q = _("どのアイテムを始動させますか? ", "Activate which item? ");
+    concptr s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
+    if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
+        return;
+
+    exe_activate(user_ptr, item);
+}
index 4855d8b..da50ba0 100644 (file)
@@ -16,3 +16,4 @@ void do_cmd_target(player_type *creature_ptr);
 void do_cmd_look(player_type *creature_ptr);
 void do_cmd_locate(player_type *creature_ptr);
 void do_cmd_use(player_type *creature_ptr);
+void do_cmd_activate(player_type *user_ptr);
index 9cb7565..4c8d5a6 100644 (file)
@@ -31,7 +31,6 @@
 #include "cmd-io/cmd-macro.h"
 #include "cmd-io/cmd-process-screen.h"
 #include "cmd-io/cmd-save.h"
-#include "cmd-item/cmd-activate.h"
 #include "cmd-item/cmd-eat.h"
 #include "cmd-item/cmd-item.h"
 #include "cmd-item/cmd-magiceat.h"