diff options
Diffstat (limited to 'src/q_thief.cc')
-rw-r--r-- | src/q_thief.cc | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/src/q_thief.cc b/src/q_thief.cc index e471aeab..a4505d2a 100644 --- a/src/q_thief.cc +++ b/src/q_thief.cc @@ -22,18 +22,23 @@ #define cquest (quest[QUEST_THIEVES]) -static bool_ quest_thieves_gen_hook(void *, void *, void *) +static bool quest_thieves_gen_hook(void *, void *, void *) { int x, y; int xstart = 2; int ystart = 2; bool_ again = TRUE; - if (p_ptr->inside_quest != QUEST_THIEVES) return FALSE; + if (p_ptr->inside_quest != QUEST_THIEVES) + { + return false; + } /* Just in case we didnt talk the the mayor */ if (cquest.status == QUEST_STATUS_UNTAKEN) + { cquest.status = QUEST_STATUS_TAKEN; + } /* Start with perm walls */ for (y = 0; y < cur_hgt; y++) @@ -65,9 +70,15 @@ static bool_ quest_thieves_gen_hook(void *, void *, void *) { object_type *o_ptr = &p_ptr->inventory[x]; - if (!o_ptr->k_idx) continue; + if (!o_ptr->k_idx) + { + continue; + } - if ((x >= INVEN_WIELD) && cursed_p(o_ptr)) continue; + if ((x >= INVEN_WIELD) && cursed_p(o_ptr)) + { + continue; + } inven_drop(x, 99, 4, 24, TRUE); @@ -83,11 +94,14 @@ static bool_ quest_thieves_gen_hook(void *, void *, void *) return TRUE; } -static bool_ quest_thieves_hook(void *, void *, void *) +static bool quest_thieves_hook(void *, void *, void *) { int i, mcnt = 0; - if (p_ptr->inside_quest != QUEST_THIEVES) return FALSE; + if (p_ptr->inside_quest != QUEST_THIEVES) + { + return false; + } /* ALARM !!! */ if ((cave[17][22].feat == FEAT_OPEN) || @@ -132,19 +146,22 @@ static bool_ quest_thieves_hook(void *, void *, void *) process_hooks_restart = TRUE; cmsg_print(TERM_YELLOW, "You stopped the thieves and saved Bree!"); - return (FALSE); + return false; } - return FALSE; + return false; } -static bool_ quest_thieves_finish_hook(void *, void *in_, void *) +static bool quest_thieves_finish_hook(void *, void *in_, void *) { auto const &s_info = game->s_info; struct hook_quest_finish_in *in = static_cast<struct hook_quest_finish_in *>(in_); s32b q_idx = in->q_idx; - if (q_idx != QUEST_THIEVES) return FALSE; + if (q_idx != QUEST_THIEVES) + { + return false; + } c_put_str(TERM_YELLOW, "Thank you for killing the band of thieves!", 8, 0); c_put_str(TERM_YELLOW, "You can use the hideout as your house as a reward.", 9, 0); @@ -159,21 +176,28 @@ static bool_ quest_thieves_finish_hook(void *, void *in_, void *) else { if (s_info[SKILL_COMBAT].value > s_info[SKILL_MAGIC].value) + { *(quest[q_idx].plot) = QUEST_TROLL; + } else + { *(quest[q_idx].plot) = QUEST_WIGHT; + } } quest[*(quest[q_idx].plot)].init(); del_hook_new(HOOK_QUEST_FINISH, quest_thieves_finish_hook); process_hooks_restart = TRUE; - return TRUE; + return true; } -static bool_ quest_thieves_feeling_hook(void *, void *, void *) +static bool quest_thieves_feeling_hook(void *, void *, void *) { - if (p_ptr->inside_quest != QUEST_THIEVES) return FALSE; + if (p_ptr->inside_quest != QUEST_THIEVES) + { + return false; + } msg_print("You wake up in a prison cell."); msg_print("All your possessions have been stolen!"); @@ -181,10 +205,10 @@ static bool_ quest_thieves_feeling_hook(void *, void *, void *) del_hook_new(HOOK_FEELING, quest_thieves_feeling_hook); process_hooks_restart = TRUE; - return TRUE; + return true; } -bool_ quest_thieves_init_hook() +void quest_thieves_init_hook() { if ((cquest.status >= QUEST_STATUS_UNTAKEN) && (cquest.status < QUEST_STATUS_FINISHED)) { @@ -193,5 +217,4 @@ bool_ quest_thieves_init_hook() add_hook_new(HOOK_GEN_QUEST, quest_thieves_gen_hook, "thieves_geb", NULL); add_hook_new(HOOK_FEELING, quest_thieves_feeling_hook, "thieves_feel", NULL); } - return (FALSE); } |