#include "object-enchant/item-apply-magic.h"
#include "object-enchant/trg-types.h"
#include "object/object-generator.h"
-#include "player/player-personalities-types.h"
+#include "player-status/player-energy.h"
+#include "player/player-personality-types.h"
#include "player/player-status.h"
#include "system/artifact-type-definition.h"
#include "system/floor-type-definition.h"
-#include "system/system-variables.h"
+#include "system/monster-race-definition.h"
+#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "world/world.h"
}
/*!
+ * @brief クエストの最終状態を記録する(成功or失敗、時間)
+ * @param player_type プレイヤー情報への参照ポインタ
+ * @param q_ptr クエスト情報への参照ポインタ
+ * @param stat ステータス(成功or失敗)
+ * @return なし
+ */
+void record_quest_final_status(quest_type *q_ptr, PLAYER_LEVEL lev, QUEST_STATUS stat)
+{
+ q_ptr->status = stat;
+ q_ptr->complev = lev;
+ update_playtime();
+ q_ptr->comptime = current_world_ptr->play_time;
+}
+
+/*!
* @brief クエストを達成状態にする /
* @param player_ptr プレーヤーへの参照ポインタ
* @param quest_num 達成状態にしたいクエストのID
break;
}
- q_ptr->status = QUEST_STATUS_COMPLETED;
- q_ptr->complev = player_ptr->lev;
- update_playtime();
- q_ptr->comptime = current_world_ptr->play_time;
+ record_quest_final_status(q_ptr, player_ptr->lev, QUEST_STATUS_COMPLETED);
if (q_ptr->flags & QUEST_FLAG_SILENT)
return;
}
msg_print(_("この階は以前は誰かによって守られていたようだ…。", "It seems that this level was protected by someone before..."));
- quest[q_idx].status = QUEST_STATUS_FINISHED;
- q_ptr->complev = 0;
- update_playtime();
- q_ptr->comptime = current_world_ptr->play_time;
+ record_quest_final_status(q_ptr, 0, QUEST_STATUS_FINISHED);
}
/*!
if (!is_one_time_quest)
return;
- q_ptr->status = QUEST_STATUS_FAILED;
- q_ptr->complev = player_ptr->lev;
- update_playtime();
- q_ptr->comptime = current_world_ptr->play_time;
+ record_quest_final_status(q_ptr, player_ptr->lev, QUEST_STATUS_FAILED);
/* Additional settings */
switch (q_ptr->type) {
if (player_ptr->wild_mode)
return;
- take_turn(player_ptr, 100);
+ update_player_turn_energy(player_ptr, 100, update_turn_type::ENERGY_SUBSTITUTION);
if (!cave_has_flag_bold(player_ptr->current_floor_ptr, player_ptr->y, player_ptr->x, FF_QUEST_ENTER)) {
msg_print(_("ここにはクエストの入口はない。", "You see no quest level here."));