diff options
Diffstat (limited to 'src/q_betwen.cc')
-rw-r--r-- | src/q_betwen.cc | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/q_betwen.cc b/src/q_betwen.cc index ca8243b4..d14c32d8 100644 --- a/src/q_betwen.cc +++ b/src/q_betwen.cc @@ -3,10 +3,12 @@ #include "cave.hpp" #include "dungeon_flag.hpp" #include "cave_type.hpp" +#include "game.hpp" #include "hook_chardump_in.hpp" #include "hook_init_quest_in.hpp" #include "hook_move_in.hpp" #include "hook_quest_finish_in.hpp" +#include "hook_quest_gen_in.hpp" #include "hooks.hpp" #include "init1.hpp" #include "monster2.hpp" @@ -16,9 +18,18 @@ #include "tables.hpp" #include "util.hpp" #include "variable.hpp" +#include "z-term.hpp" #define cquest (quest[QUEST_BETWEEN]) +static std::shared_ptr<object_kind> get_golden_horn() +{ + static auto &k_info = game->edit_data.k_info; + static auto &k_golden_horn = k_info[test_item_name("& Golden Horn~ of the Thunderlords")]; + + return k_golden_horn; +} + static bool quest_between_move_hook(void *, void *in_, void *) { struct hook_move_in *in = static_cast<struct hook_move_in *>(in_); @@ -66,11 +77,11 @@ static bool quest_between_move_hook(void *, void *in_, void *) } /* Mark as entered */ - cquest.data[0] = TRUE; + cquest.data[0] = true; - p_ptr->wild_mode = FALSE; + p_ptr->wild_mode = false; p_ptr->inside_quest = QUEST_BETWEEN; - p_ptr->leaving = TRUE; + p_ptr->leaving = true; cmsg_print(TERM_YELLOW, "Looks like a full wing of thunderlords ambushes you!"); cmsg_print(TERM_YELLOW, "Trone steps forth and speaks: 'The secret of the Void Jumpgates"); @@ -79,8 +90,10 @@ static bool quest_between_move_hook(void *, void *in_, void *) return false; } -static bool quest_between_gen_hook(void *, void *, void *) +static bool quest_between_gen_hook(void *, void *in_, void *) { + auto in = static_cast<hook_quest_gen_in *>(in_); + int x, y; int xstart = 2; int ystart = 2; @@ -101,18 +114,18 @@ static bool quest_between_gen_hook(void *, void *, void *) dun_level = quest[p_ptr->inside_quest].level; /* Set the correct monster hook */ - set_mon_num_hook(); + reset_get_monster_hook(); /* Prepare allocation table */ get_mon_num_prep(); init_flags = INIT_CREATE_DUNGEON; - process_dungeon_file("between.map", &ystart, &xstart, cur_hgt, cur_wid, TRUE, TRUE); + process_dungeon_file("between.map", &ystart, &xstart, cur_hgt, cur_wid, true, true); /* Otherwise instadeath */ energy_use = 0; - dungeon_flags |= DF_NO_GENO; + in->dungeon_flags_ref |= DF_NO_GENO; return true; } @@ -137,20 +150,18 @@ static bool quest_between_finish_hook(void *, void *in_, void *) /* Mega-Hack -- Actually create the Golden Horn of the Thunderlords */ - k_allow_special[test_item_name("& Golden Horn~ of the Thunderlords")] = TRUE; - apply_magic(q_ptr, -1, TRUE, TRUE, TRUE); - k_allow_special[test_item_name("& Golden Horn~ of the Thunderlords")] = FALSE; - object_aware(q_ptr); - object_known(q_ptr); + get_golden_horn()->allow_special = true; + apply_magic(q_ptr, -1, true, true, true); + get_golden_horn()->allow_special = false; + q_ptr->discount = 100; - q_ptr->ident |= IDENT_STOREB; - inven_carry(q_ptr, FALSE); + inven_carry(q_ptr, false); /* Continue the plot */ *(quest[q_idx].plot) = QUEST_NULL; del_hook_new(HOOK_QUEST_FINISH, quest_between_finish_hook); - process_hooks_restart = TRUE; + process_hooks_restart = true; return true; } @@ -206,7 +217,7 @@ static bool quest_between_forbid_hook(void *, void *in_, void *) hook_init_quest_in *in = static_cast<struct hook_init_quest_in *>(in_); s32b q_idx = in->q_idx; - if (q_idx != QUEST_BETWEEN) return (FALSE); + if (q_idx != QUEST_BETWEEN) return false; if (p_ptr->lev < 45) { |