OSDN Git Service

[Refactor] #39963 Separated spells-execution.c/h and spells-util.h from spells.h...
[hengband/hengband.git] / src / core.c
index d7fe70d..84b2f8c 100644 (file)
  */
 
 #include "angband.h"
-#include "signal-handlers.h"
+#include "io/signal-handlers.h"
 #include "util.h"
+#include "main/music-definitions-table.h"
+#include "main/sound-definitions-table.h"
 #include "core.h"
 #include "inet.h"
-#include "term.h"
+#include "gameterm.h"
 #include "chuukei.h"
 
 #include "creature.h"
 
 #include "birth.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "io/write-diary.h"
 #include "cmd/cmd-activate.h"
+#include "cmd/cmd-autopick.h"
+#include "cmd/cmd-diary.h"
+#include "cmd/cmd-draw.h"
 #include "cmd/cmd-dump.h"
+#include "cmd/cmd-process-screen.h"
 #include "cmd/cmd-eat.h"
 #include "cmd/cmd-help.h"
 #include "cmd/cmd-hissatsu.h"
 #include "cmd/cmd-item.h"
+#include "cmd/cmd-knowledge.h"
 #include "cmd/cmd-magiceat.h"
 #include "cmd/cmd-mane.h"
+#include "cmd/cmd-macro.h"
 #include "cmd/cmd-quaff.h"
 #include "cmd/cmd-read.h"
 #include "cmd/cmd-save.h"
@@ -40,6 +48,7 @@
 #include "cmd/cmd-zapwand.h"
 #include "cmd/cmd-pet.h"
 #include "cmd/cmd-basic.h"
+#include "cmd/cmd-visuals.h"
 #include "racial.h"
 #include "snipe.h"
 #include "dungeon.h"
 #include "object-ego.h"
 #include "object-curse.h"
 #include "object-flavor.h"
-#include "store.h"
-#include "spells.h"
+#include "knowledge/knowledge-autopick.h"
+#include "knowledge/knowledge-quests.h"
+#include "market/store.h"
+#include "spell/technic-info-table.h"
 #include "spells-summon.h"
 #include "spells-object.h"
 #include "spells-status.h"
@@ -61,6 +72,8 @@
 #include "mind.h"
 #include "world.h"
 #include "mutation.h"
+#include "market/arena-info-table.h"
+#include "market/store-util.h"
 #include "quest.h"
 #include "artifact.h"
 #include "avatar.h"
@@ -74,8 +87,8 @@
 #include "player-damage.h"
 #include "player-effects.h"
 #include "cmd-spell.h"
-#include "realm-hex.h"
-#include "objectkind.h"
+#include "realm/realm-hex.h"
+#include "object/object-kind.h"
 #include "object-hook.h"
 #include "wild.h"
 #include "monster-process.h"
 #include "player-skill.h"
 #include "player-inventory.h"
 
-#include "view-mainwindow.h"
+#include "view/display-main-window.h"
 #include "dungeon-file.h"
-#include "uid-checker.h"
+#include "io/uid-checker.h"
 #include "player/process-death.h"
 #include "io/read-pref-file.h"
 #include "files.h"
 #include "scores.h"
-#include "autopick.h"
+#include "autopick/autopick.h"
+#include "autopick/autopick-pref-processor.h"
+#include "autopick/autopick-reader-writer.h"
 #include "save.h"
-#include "realm.h"
-#include "realm-song.h"
+#include "realm/realm.h"
+#include "realm/realm-song.h"
 #include "targeting.h"
+#include "spell/spells-util.h"
+#include "spell/spells-execution.h"
 
  /*!
   * コピーライト情報 /
@@ -2916,7 +2933,7 @@ static bool enter_wizard_mode(player_type *player_ptr)
                        return FALSE;
                }
 
-               exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "give up recording score to enter wizard mode."));
+               exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode."));
                current_world_ptr->noscore |= 0x0002;
        }
 
@@ -2948,7 +2965,7 @@ static bool enter_debug_mode(player_type *player_ptr)
                        return FALSE;
                }
 
-               exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "give up sending score to use debug commands."));
+               exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "gave up sending score to use debug commands."));
                current_world_ptr->noscore |= 0x0008;
        }
 
@@ -3411,18 +3428,18 @@ static void process_command(player_type *creature_ptr)
        }
        case '@':
        {
-               do_cmd_macros(creature_ptr);
+               do_cmd_macros(creature_ptr, process_autopick_file_command);
                break;
        }
        case '%':
        {
-               do_cmd_visuals(creature_ptr);
+               do_cmd_visuals(creature_ptr, process_autopick_file_command);
                do_cmd_redraw(creature_ptr);
                break;
        }
        case '&':
        {
-               do_cmd_colors(creature_ptr);
+               do_cmd_colors(creature_ptr, process_autopick_file_command);
                do_cmd_redraw(creature_ptr);
                break;
        }
@@ -3507,7 +3524,7 @@ static void process_command(player_type *creature_ptr)
        }
        case ')':
        {
-               do_cmd_save_screen(creature_ptr);
+               do_cmd_save_screen(creature_ptr, handle_stuff, process_autopick_file_command);
                break;
        }
        case ']':
@@ -3611,7 +3628,7 @@ static void process_fishing(player_type *creature_ptr)
                MONRACE_IDX r_idx;
                bool success = FALSE;
                get_mon_num_prep(creature_ptr, monster_is_fishing_target, NULL);
-               r_idx = get_mon_num(creature_ptr, creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level);
+               r_idx = get_mon_num(creature_ptr, creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level, 0);
                msg_print(NULL);
                if (r_idx && one_in_(2))
                {
@@ -4213,25 +4230,25 @@ static void load_all_pref_files(player_type *player_ptr)
 {
        char buf[1024];
        sprintf(buf, "user.prf");
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "user-%s.prf", ANGBAND_SYS);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", rp_ptr->title);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", cp_ptr->title);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", player_ptr->base_name);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        if (player_ptr->realm1 != REALM_NONE)
        {
                sprintf(buf, "%s.prf", realm_names[player_ptr->realm1]);
-               process_pref_file(player_ptr, buf);
+               process_pref_file(player_ptr, buf, process_autopick_file_command);
        }
 
        if (player_ptr->realm2 != REALM_NONE)
        {
                sprintf(buf, "%s.prf", realm_names[player_ptr->realm2]);
-               process_pref_file(player_ptr, buf);
+               process_pref_file(player_ptr, buf, process_autopick_file_command);
        }
 
        autopick_load_pref(player_ptr, FALSE);
@@ -4254,7 +4271,7 @@ void play_game(player_type *player_ptr, bool new_game)
 #ifdef CHUUKEI
        if (chuukei_client)
        {
-               reset_visuals();
+               reset_visuals(player_ptr, process_autopick_file_command);
                browse_chuukei();
                return;
        }
@@ -4267,7 +4284,7 @@ void play_game(player_type *player_ptr, bool new_game)
 
        if (browsing_movie)
        {
-               reset_visuals(player_ptr);
+               reset_visuals(player_ptr, process_autopick_file_command);
                browse_movie();
                return;
        }
@@ -4369,7 +4386,7 @@ void play_game(player_type *player_ptr, bool new_game)
                current_world_ptr->seed_flavor = randint0(0x10000000);
                current_world_ptr->seed_town = randint0(0x10000000);
 
-               player_birth(player_ptr);
+               player_birth(player_ptr, process_autopick_file_command);
                counts_write(player_ptr, 2, 0);
                player_ptr->count = 0;
                load = FALSE;
@@ -4382,7 +4399,7 @@ void play_game(player_type *player_ptr, bool new_game)
                write_level = FALSE;
                exe_write_diary(player_ptr, DIARY_GAMESTART, 1,
                        _("                            ----ゲーム再開----",
-                               "                            ---- Restart Game ----"));
+                               "                            --- Restarted Game ---"));
 
                /*
                 * todo もう2.2.Xなので互換性は打ち切ってもいいのでは?
@@ -4476,12 +4493,12 @@ void play_game(player_type *player_ptr, bool new_game)
        if (new_game)
        {
                char buf[80];
-               sprintf(buf, _("%sに降り立った。", "You are standing in the %s."), map_name(player_ptr));
+               sprintf(buf, _("%sに降り立った。", "arrived in %s."), map_name(player_ptr));
                exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, buf);
        }
 
        player_ptr->playing = TRUE;
-       reset_visuals(player_ptr);
+       reset_visuals(player_ptr, process_autopick_file_command);
        load_all_pref_files(player_ptr);
        if (new_game)
        {
@@ -4624,18 +4641,18 @@ void prevent_turn_overflow(player_type *player_ptr)
        {
                for (int j = 0; j < MAX_STORES; j++)
                {
-                       store_type *st_ptr = &town_info[i].store[j];
+                       store_type *store_ptr = &town_info[i].store[j];
 
-                       if (st_ptr->last_visit > -10L * TURNS_PER_TICK * STORE_TICKS)
+                       if (store_ptr->last_visit > -10L * TURNS_PER_TICK * STORE_TICKS)
                        {
-                               st_ptr->last_visit -= rollback_turns;
-                               if (st_ptr->last_visit < -10L * TURNS_PER_TICK * STORE_TICKS) st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
+                               store_ptr->last_visit -= rollback_turns;
+                               if (store_ptr->last_visit < -10L * TURNS_PER_TICK * STORE_TICKS) store_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
                        }
 
-                       if (st_ptr->store_open)
+                       if (store_ptr->store_open)
                        {
-                               st_ptr->store_open -= rollback_turns;
-                               if (st_ptr->store_open < 1) st_ptr->store_open = 1;
+                               store_ptr->store_open -= rollback_turns;
+                               if (store_ptr->store_open < 1) store_ptr->store_open = 1;
                        }
                }
        }