diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-26 15:50:39 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-26 15:50:39 +0000 |
commit | 1aa4f83dcacb9e6c03758649d50e3c79b64b9afa (patch) | |
tree | 6dacad3fa8743cfee295e0babc1f5f2b8a5b50d6 /crawl-ref/source/acr.cc | |
parent | d230622af89d8fd4de219103eb051a227467a94d (diff) | |
download | crawl-ref-1aa4f83dcacb9e6c03758649d50e3c79b64b9afa.tar.gz crawl-ref-1aa4f83dcacb9e6c03758649d50e3c79b64b9afa.zip |
Change friendly pickup from a toggle to a more userfriendly, easily
abortable prompt, and move orc names into a file of their own.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4670 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 48aff3f09b..ab8e70afb7 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1849,9 +1849,32 @@ static void _mpr_monsters() } -/* note that in some actions, you don't want to clear afterwards. - e.g. list_jewellery, etc. */ +static void _print_friendly_pickup_setting(bool was_changed) +{ + std::string now = (was_changed? "now " : ""); + if (Options.friendly_pickup == -1) + { + mprf("Your allies are %sforbidden to pick up anything at all.", + now.c_str()); + } + else if (Options.friendly_pickup == 0) + { + mprf("Your allies may %sonly pick up items dropped by allies.", + now.c_str()); + } + else if (Options.friendly_pickup == 1) + { + mprf("Your allies may %spick up anything they need.", now.c_str()); + } + else + { + mprf("Your allies are %scollecting bugs!", now.c_str()); + } +} + +// note that in some actions, you don't want to clear afterwards. +// e.g. list_jewellery, etc. void process_command( command_type cmd ) { apply_berserk_penalty = true; @@ -2016,24 +2039,28 @@ void process_command( command_type cmd ) break; case CMD_TOGGLE_FRIENDLY_PICKUP: + { // Toggle pickup mode for friendlies. - if (Options.friendly_pickup == -1) - { + _print_friendly_pickup_setting(false); + mpr("Change to (n)othing, (f)riend-dropped, or (a)ll? ", MSGCH_PROMPT); + + char type = (char) getchm(KC_DEFAULT); + type = tolower(type); + + if (type == 'n') + Options.friendly_pickup = -1; + else if (type == 'f') Options.friendly_pickup = 0; - mpr("Your allies may now only pick up items dropped by allies."); - } - else if (Options.friendly_pickup == 0) - { + else if (type == 'a') Options.friendly_pickup = 1; - mpr("Your allies may now pick up anything they need."); - } else { - Options.friendly_pickup = -1; - mpr("Your allies are now forbidden to pick up anything at all."); + canned_msg( MSG_OK ); + break; } + _print_friendly_pickup_setting(true); break; - + } case CMD_MAKE_NOTE: make_user_note(); break; |