diff options
Diffstat (limited to 'src/q_library.cc')
-rw-r--r-- | src/q_library.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/q_library.cc b/src/q_library.cc index 52a67291..48c9d0cf 100644 --- a/src/q_library.cc +++ b/src/q_library.cc @@ -18,11 +18,10 @@ #include "z-rand.hpp" #include <cassert> +#include <format.h> #define cquest (quest[QUEST_LIBRARY]) -#define print_hook(fmt,...) do { fprintf(hook_file, fmt, ##__VA_ARGS__); } while (0) - #define MONSTER_LICH 518 #define MONSTER_MONASTIC_LICH 611 #define MONSTER_FLESH_GOLEM 256 @@ -482,25 +481,23 @@ void quest_library_building(bool_ *paid, bool_ *recreate) } } -bool_ quest_library_describe(FILE *hook_file) +std::string quest_library_describe() { + fmt::MemoryWriter w; + if (cquest.status == QUEST_STATUS_TAKEN) { - print_hook("#####yAn Old Mages Quest! (Danger Level: 35)\n"); - print_hook("Make the library safe for the old mage in Minas Anor.\n"); - print_hook("\n"); + w.write("#####yAn Old Mages Quest! (Danger Level: 35)\n"); + w.write("Make the library safe for the old mage in Minas Anor."); } else if (cquest.status == QUEST_STATUS_COMPLETED) { - /* Quest done, book not gotten yet */ - print_hook("#####yAn Old Mages Quest!\n"); - print_hook("You have made the library safe for the old mage in Minas Anor.\n"); - print_hook("Perhaps you should see about a reward.\n"); - print_hook("\n"); + w.write("#####yAn Old Mages Quest!\n"); + w.write("You have made the library safe for the old mage in Minas Anor.\n"); + w.write("Perhaps you should see about a reward."); } - /* Normal processing */ - return TRUE; + return w.str(); } bool_ quest_library_init_hook(int q) |