1 #include "world/world-movement-processor.h"
2 #include "cmd-io/cmd-save.h"
3 #include "dungeon/dungeon.h"
4 #include "dungeon/quest.h"
5 #include "game-option/birth-options.h"
6 #include "game-option/play-record-options.h"
7 #include "game-option/special-options.h"
8 #include "io/write-diary.h"
9 #include "main/sound-definitions-table.h"
10 #include "main/sound-of-music.h"
11 #include "monster-race/race-flags1.h"
12 #include "player/player-move.h"
13 #include "view/display-main-window.h"
14 #include "world/world.h"
17 * @brief 10ゲームターンが進行するごとに帰還の残り時間カウントダウンと発動を処理する。
18 * / Handle involuntary movement once every 10 game turns
19 * @param creature_ptr プレーヤーへの参照ポインタ
22 * Autosave BEFORE resetting the recall counter (rr9)
23 * The player is yanked up/down as soon as he loads the autosaved game.
25 void execute_recall(player_type *creature_ptr)
27 if (creature_ptr->word_recall == 0)
30 if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
31 do_cmd_save_game(creature_ptr, TRUE);
33 creature_ptr->word_recall--;
34 creature_ptr->redraw |= (PR_STATUS);
35 if (creature_ptr->word_recall != 0)
38 disturb(creature_ptr, FALSE, TRUE);
39 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
40 if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon) {
41 msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
42 if (creature_ptr->dungeon_idx)
43 creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
45 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
47 floor_ptr->dun_level = 0;
48 creature_ptr->dungeon_idx = 0;
49 leave_quest_check(creature_ptr);
50 leave_tower_check(creature_ptr);
51 creature_ptr->current_floor_ptr->inside_quest = 0;
52 creature_ptr->leaving = TRUE;
57 msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
58 creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
60 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
62 floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
63 if (floor_ptr->dun_level < 1)
64 floor_ptr->dun_level = 1;
65 if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)) {
66 if (floor_ptr->dun_level < 50) {
67 floor_ptr->dun_level *= 2;
68 } else if (floor_ptr->dun_level < 99) {
69 floor_ptr->dun_level = (floor_ptr->dun_level + 99) / 2;
70 } else if (floor_ptr->dun_level > 100) {
71 floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
75 if (creature_ptr->wild_mode) {
76 creature_ptr->wilderness_y = creature_ptr->y;
77 creature_ptr->wilderness_x = creature_ptr->x;
79 creature_ptr->oldpx = creature_ptr->x;
80 creature_ptr->oldpy = creature_ptr->y;
83 creature_ptr->wild_mode = FALSE;
86 * Clear all saved floors
87 * and create a first saved floor
89 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
90 creature_ptr->leaving = TRUE;
92 if (creature_ptr->dungeon_idx != DUNGEON_ANGBAND) {
97 for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) {
98 quest_type *const q_ptr = &quest[i];
99 if ((q_ptr->type == QUEST_TYPE_RANDOM) && (q_ptr->status == QUEST_STATUS_TAKEN) && (q_ptr->level < floor_ptr->dun_level)) {
100 q_ptr->status = QUEST_STATUS_FAILED;
101 q_ptr->complev = (byte)creature_ptr->lev;
103 q_ptr->comptime = current_world_ptr->play_time;
104 r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
108 sound(SOUND_TPLEVEL);
112 * @brief 10ゲームターンが進行するごとにフロア・リセット/現実変容の残り時間カウントダウンと発動を処理する。
113 * / Handle involuntary movement once every 10 game turns
114 * @param creature_ptr プレーヤーへの参照ポインタ
117 void execute_floor_reset(player_type *creature_ptr)
119 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
120 if (creature_ptr->alter_reality == 0)
123 if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
124 do_cmd_save_game(creature_ptr, TRUE);
126 creature_ptr->alter_reality--;
127 creature_ptr->redraw |= (PR_STATUS);
128 if (creature_ptr->alter_reality != 0)
131 disturb(creature_ptr, FALSE, TRUE);
132 if (!quest_number(creature_ptr, floor_ptr->dun_level) && floor_ptr->dun_level) {
133 msg_print(_("世界が変わった!", "The world changes!"));
136 * Clear all saved floors
137 * and create a first saved floor
139 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
140 creature_ptr->leaving = TRUE;
142 msg_print(_("世界が少しの間変化したようだ。", "The world seems to change for a moment!"));
145 sound(SOUND_TPLEVEL);