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 "io/write-diary.h"
8 #include "main/sound-definitions-table.h"
9 #include "monster-race/race-flags1.h"
10 #include "player/player-move.h"
11 #include "view/display-main-window.h"
12 #include "world/world.h"
15 * @brief 10ゲームターンが進行するごとに帰還の残り時間カウントダウンと発動を処理する。
16 * / Handle involuntary movement once every 10 game turns
17 * @param creature_ptr プレーヤーへの参照ポインタ
20 * Autosave BEFORE resetting the recall counter (rr9)
21 * The player is yanked up/down as soon as he loads the autosaved game.
23 void execute_recall(player_type *creature_ptr)
25 if (creature_ptr->word_recall == 0)
28 if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
29 do_cmd_save_game(creature_ptr, TRUE);
31 creature_ptr->word_recall--;
32 creature_ptr->redraw |= (PR_STATUS);
33 if (creature_ptr->word_recall != 0)
36 disturb(creature_ptr, FALSE, TRUE);
37 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
38 if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon) {
39 msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
40 if (creature_ptr->dungeon_idx)
41 creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
43 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
45 floor_ptr->dun_level = 0;
46 creature_ptr->dungeon_idx = 0;
47 leave_quest_check(creature_ptr);
48 leave_tower_check(creature_ptr);
49 creature_ptr->current_floor_ptr->inside_quest = 0;
50 creature_ptr->leaving = TRUE;
55 msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
56 creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
58 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
60 floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
61 if (floor_ptr->dun_level < 1)
62 floor_ptr->dun_level = 1;
63 if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)) {
64 if (floor_ptr->dun_level < 50) {
65 floor_ptr->dun_level *= 2;
66 } else if (floor_ptr->dun_level < 99) {
67 floor_ptr->dun_level = (floor_ptr->dun_level + 99) / 2;
68 } else if (floor_ptr->dun_level > 100) {
69 floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
73 if (creature_ptr->wild_mode) {
74 creature_ptr->wilderness_y = creature_ptr->y;
75 creature_ptr->wilderness_x = creature_ptr->x;
77 creature_ptr->oldpx = creature_ptr->x;
78 creature_ptr->oldpy = creature_ptr->y;
81 creature_ptr->wild_mode = FALSE;
84 * Clear all saved floors
85 * and create a first saved floor
87 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
88 creature_ptr->leaving = TRUE;
90 if (creature_ptr->dungeon_idx != DUNGEON_ANGBAND) {
95 for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) {
96 quest_type *const q_ptr = &quest[i];
97 if ((q_ptr->type == QUEST_TYPE_RANDOM) && (q_ptr->status == QUEST_STATUS_TAKEN) && (q_ptr->level < floor_ptr->dun_level)) {
98 q_ptr->status = QUEST_STATUS_FAILED;
99 q_ptr->complev = (byte)creature_ptr->lev;
101 q_ptr->comptime = current_world_ptr->play_time;
102 r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
106 sound(SOUND_TPLEVEL);
110 * @brief 10ゲームターンが進行するごとにフロア・リセット/現実変容の残り時間カウントダウンと発動を処理する。
111 * / Handle involuntary movement once every 10 game turns
112 * @param creature_ptr プレーヤーへの参照ポインタ
115 void execute_floor_reset(player_type *creature_ptr)
117 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
118 if (creature_ptr->alter_reality == 0)
121 if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
122 do_cmd_save_game(creature_ptr, TRUE);
124 creature_ptr->alter_reality--;
125 creature_ptr->redraw |= (PR_STATUS);
126 if (creature_ptr->alter_reality != 0)
129 disturb(creature_ptr, FALSE, TRUE);
130 if (!quest_number(creature_ptr, floor_ptr->dun_level) && floor_ptr->dun_level) {
131 msg_print(_("世界が変わった!", "The world changes!"));
134 * Clear all saved floors
135 * and create a first saved floor
137 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
138 creature_ptr->leaving = TRUE;
140 msg_print(_("世界が少しの間変化したようだ。", "The world seems to change for a moment!"));
143 sound(SOUND_TPLEVEL);