OSDN Git Service

[Refactor] #39964 Moved autopick_load_pref() from autopick.c/h to autopick-reader...
[hengband/hengband.git] / src / core.c
index 1caa5d1..421a22b 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-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 +47,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"
@@ -51,7 +59,9 @@
 #include "object-ego.h"
 #include "object-curse.h"
 #include "object-flavor.h"
-#include "store.h"
+#include "knowledge/knowledge-autopick.h"
+#include "knowledge/knowledge-quests.h"
+#include "market/store.h"
 #include "spells.h"
 #include "spells-summon.h"
 #include "spells-object.h"
@@ -61,6 +71,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"
@@ -75,7 +87,7 @@
 #include "player-effects.h"
 #include "cmd-spell.h"
 #include "realm-hex.h"
-#include "objectkind.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-reader-writer.h"
 #include "save.h"
 #include "realm.h"
 #include "realm-song.h"
@@ -2226,35 +2239,10 @@ static void process_world_aux_mutation(player_type *creature_ptr)
 
        if ((creature_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
        {
-               INVENTORY_IDX slot = 0;
-               object_type *o_ptr = NULL;
-
                disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
                take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->wt / 6), _("転倒", "tripping"), -1);
-
-               msg_print(NULL);
-               if (has_melee_weapon(creature_ptr, INVEN_RARM))
-               {
-                       slot = INVEN_RARM;
-                       o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
-
-                       if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
-                       {
-                               o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
-                               slot = INVEN_LARM;
-                       }
-               }
-               else if (has_melee_weapon(creature_ptr, INVEN_LARM))
-               {
-                       o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
-                       slot = INVEN_LARM;
-               }
-               if (slot && !object_is_cursed(o_ptr))
-               {
-                       msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
-                       drop_from_inventory(creature_ptr, slot, 1);
-               }
+               drop_weapons(creature_ptr);
        }
 }
 
@@ -2941,7 +2929,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;
        }
 
@@ -2973,7 +2961,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;
        }
 
@@ -3532,7 +3520,7 @@ static void process_command(player_type *creature_ptr)
        }
        case ')':
        {
-               do_cmd_save_screen(creature_ptr);
+               do_cmd_save_screen(creature_ptr, handle_stuff);
                break;
        }
        case ']':
@@ -3636,7 +3624,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))
                {
@@ -4407,7 +4395,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なので互換性は打ち切ってもいいのでは?
@@ -4501,7 +4489,7 @@ 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);
        }
 
@@ -4649,18 +4637,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;
                        }
                }
        }