2 * @brief 読むことができるアイテム群の内、中つ国ガイドを読んだ時の効果や処理を記述する.
7 #include "object-use/read/parchment-read-executor.h"
8 #include "core/show-file.h"
9 #include "flavor/flavor-describer.h"
10 #include "flavor/object-flavor-types.h"
11 #include "io/files-util.h"
12 #include "system/angband.h"
13 #include "system/item-entity.h"
14 #include "system/player-type-definition.h"
15 #include "term/screen-processor.h"
16 #include "util/angband-files.h"
20 ParchmentReadExecutor::ParchmentReadExecutor(PlayerType *player_ptr, ItemEntity *o_ptr)
21 : player_ptr(player_ptr)
26 bool ParchmentReadExecutor::is_identified() const
31 bool ParchmentReadExecutor::read()
35 ss << "book-" << std::setfill('0') << std::right << std::setw(3) << this->o_ptr->bi_key.sval().value();
36 ss << "_" << _("jp", "en") << ".txt";
37 const auto item_name = describe_flavor(this->player_ptr, this->o_ptr, OD_NAME_ONLY);
38 auto path = path_build(ANGBAND_DIR_FILE, "books");
39 path.append(ss.str());
40 const auto &filename = path.string();
41 (void)show_file(this->player_ptr, true, filename.data(), item_name.data(), 0, 0);