2 #include "world/world-movement-processor.h"
3 #include "main/sound-definitions-table.h"
4 #include "io/write-diary.h"
5 #include "dungeon/dungeon.h"
7 #include "world/world.h"
8 #include "cmd/cmd-save.h"
9 #include "player-move.h"
10 #include "view/display-main-window.h"
13 * @brief 10ゲームターンが進行するごとに帰還の残り時間カウントダウンと発動を処理する。
14 * / Handle involuntary movement once every 10 game turns
15 * @param creature_ptr プレーヤーへの参照ポインタ
18 * Autosave BEFORE resetting the recall counter (rr9)
19 * The player is yanked up/down as soon as he loads the autosaved game.
21 void execute_recall(player_type* creature_ptr)
23 if (creature_ptr->word_recall == 0)
26 if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
27 do_cmd_save_game(creature_ptr, TRUE);
29 creature_ptr->word_recall--;
30 creature_ptr->redraw |= (PR_STATUS);
31 if (creature_ptr->word_recall != 0)
34 disturb(creature_ptr, FALSE, TRUE);
35 floor_type* floor_ptr = creature_ptr->current_floor_ptr;
36 if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon) {
37 msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
38 if (creature_ptr->dungeon_idx)
39 creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
41 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
43 floor_ptr->dun_level = 0;
44 creature_ptr->dungeon_idx = 0;
45 leave_quest_check(creature_ptr);
46 leave_tower_check(creature_ptr);
47 creature_ptr->current_floor_ptr->inside_quest = 0;
48 creature_ptr->leaving = TRUE;
53 msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
54 creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
56 exe_write_diary(creature_ptr, DIARY_RECALL, floor_ptr->dun_level, NULL);
58 floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
59 if (floor_ptr->dun_level < 1)
60 floor_ptr->dun_level = 1;
61 if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)) {
62 if (floor_ptr->dun_level < 50) {
63 floor_ptr->dun_level *= 2;
64 } else if (floor_ptr->dun_level < 99) {
65 floor_ptr->dun_level = (floor_ptr->dun_level + 99) / 2;
66 } else if (floor_ptr->dun_level > 100) {
67 floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
71 if (creature_ptr->wild_mode) {
72 creature_ptr->wilderness_y = creature_ptr->y;
73 creature_ptr->wilderness_x = creature_ptr->x;
75 creature_ptr->oldpx = creature_ptr->x;
76 creature_ptr->oldpy = creature_ptr->y;
79 creature_ptr->wild_mode = FALSE;
82 * Clear all saved floors
83 * and create a first saved floor
85 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
86 creature_ptr->leaving = TRUE;
88 if (creature_ptr->dungeon_idx != DUNGEON_ANGBAND) {
93 for (int i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) {
94 quest_type* const q_ptr = &quest[i];
95 if ((q_ptr->type == QUEST_TYPE_RANDOM) && (q_ptr->status == QUEST_STATUS_TAKEN) && (q_ptr->level < floor_ptr->dun_level)) {
96 q_ptr->status = QUEST_STATUS_FAILED;
97 q_ptr->complev = (byte)creature_ptr->lev;
99 q_ptr->comptime = current_world_ptr->play_time;
100 r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
104 sound(SOUND_TPLEVEL);
108 * @brief 10ゲームターンが進行するごとにフロア・リセット/現実変容の残り時間カウントダウンと発動を処理する。
109 * / Handle involuntary movement once every 10 game turns
110 * @param creature_ptr プレーヤーへの参照ポインタ
113 void execute_floor_reset(player_type* creature_ptr)
115 floor_type* floor_ptr = creature_ptr->current_floor_ptr;
116 if (creature_ptr->alter_reality == 0)
119 if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
120 do_cmd_save_game(creature_ptr, TRUE);
122 creature_ptr->alter_reality--;
123 creature_ptr->redraw |= (PR_STATUS);
124 if (creature_ptr->alter_reality != 0)
127 disturb(creature_ptr, FALSE, TRUE);
128 if (!quest_number(creature_ptr, floor_ptr->dun_level) && floor_ptr->dun_level) {
129 msg_print(_("世界が変わった!", "The world changes!"));
132 * Clear all saved floors
133 * and create a first saved floor
135 prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
136 creature_ptr->leaving = TRUE;
138 msg_print(_("世界が少しの間変化したようだ。", "The world seems to change for a moment!"));
141 sound(SOUND_TPLEVEL);