diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:12:00 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:12:00 +0100 |
commit | b94e14c35d91ec5c99a208e9ddf84f81f9b84013 (patch) | |
tree | 59adf88b769da15e69daf8cf5a218d708891952e /src/cmd6.cc | |
parent | 6cffbd70646ee66c3b2a2a2fd7fd35c23d88b93e (diff) |
Move cmd6.cc function declarations to separate header file
Diffstat (limited to 'src/cmd6.cc')
-rw-r--r-- | src/cmd6.cc | 154 |
1 files changed, 78 insertions, 76 deletions
diff --git a/src/cmd6.cc b/src/cmd6.cc index 52a0ccf7..0cd052e2 100644 --- a/src/cmd6.cc +++ b/src/cmd6.cc @@ -6,6 +6,8 @@ * included in all such copies. */ +#include "cmd6.hpp" + #include "angband.h" #include "cave.hpp" #include "cmd1.hpp" @@ -2553,84 +2555,9 @@ void do_cmd_quaff_potion(void) /* - * Drink from a fountain - */ -void do_cmd_drink_fountain(void) -{ - cave_type *c_ptr = &cave[p_ptr->py][p_ptr->px]; - - bool_ ident; - - int tval, sval, pval = 0; - - int i; - - char ch; - - - /* Is the fountain empty? */ - if (c_ptr->special2 <= 0) - { - msg_print("The fountain is dried out."); - return; - } - - /* We quaff or we fill ? */ - if (!get_com("Do you want to [Q]uaff or [F]ill from the fountain? ", &ch)) - { - return; - } - - if ((ch == 'F') || (ch == 'f')) - { - do_cmd_fill_bottle(); - - return; - } - - else if ((ch == 'Q') || (ch == 'q')) - { - if (c_ptr->special <= SV_POTION_LAST) - { - tval = TV_POTION; - sval = c_ptr->special; - } - else - { - tval = TV_POTION2; - sval = c_ptr->special - SV_POTION_LAST; - } - - for (i = 0; i < max_k_idx; i++) - { - object_kind *k_ptr = &k_info[i]; - - if (k_ptr->tval != tval) continue; - if (k_ptr->sval != sval) continue; - - pval = k_ptr->pval; - - break; - } - - ident = quaff_potion(tval, sval, pval, 0); - - c_ptr->special2--; - - if (c_ptr->special2 <= 0) - { - cave_set_feat(p_ptr->py, p_ptr->px, FEAT_EMPTY_FOUNTAIN); - } - - if (ident) c_ptr->info |= CAVE_IDNT; - } -} - - -/* * Fill an empty bottle */ -void do_cmd_fill_bottle(void) +static void do_cmd_fill_bottle(void) { cave_type *c_ptr = &cave[p_ptr->py][p_ptr->px]; @@ -2713,6 +2640,81 @@ void do_cmd_fill_bottle(void) /* + * Drink from a fountain + */ +void do_cmd_drink_fountain(void) +{ + cave_type *c_ptr = &cave[p_ptr->py][p_ptr->px]; + + bool_ ident; + + int tval, sval, pval = 0; + + int i; + + char ch; + + + /* Is the fountain empty? */ + if (c_ptr->special2 <= 0) + { + msg_print("The fountain is dried out."); + return; + } + + /* We quaff or we fill ? */ + if (!get_com("Do you want to [Q]uaff or [F]ill from the fountain? ", &ch)) + { + return; + } + + if ((ch == 'F') || (ch == 'f')) + { + do_cmd_fill_bottle(); + + return; + } + + else if ((ch == 'Q') || (ch == 'q')) + { + if (c_ptr->special <= SV_POTION_LAST) + { + tval = TV_POTION; + sval = c_ptr->special; + } + else + { + tval = TV_POTION2; + sval = c_ptr->special - SV_POTION_LAST; + } + + for (i = 0; i < max_k_idx; i++) + { + object_kind *k_ptr = &k_info[i]; + + if (k_ptr->tval != tval) continue; + if (k_ptr->sval != sval) continue; + + pval = k_ptr->pval; + + break; + } + + ident = quaff_potion(tval, sval, pval, 0); + + c_ptr->special2--; + + if (c_ptr->special2 <= 0) + { + cave_set_feat(p_ptr->py, p_ptr->px, FEAT_EMPTY_FOUNTAIN); + } + + if (ident) c_ptr->info |= CAVE_IDNT; + } +} + + +/* * Curse the players armor */ bool_ curse_armor(void) |