From d976570ee5fbcc53481d76b2d55d389908968bd5 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 15 Jul 2008 13:39:46 +0000 Subject: Apply commits r6556 and r6557 to 0.4. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6558 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/settings/menu_colours.txt | 2 +- crawl-ref/source/acr.cc | 36 ++++++++++++++---------------------- crawl-ref/source/output.cc | 27 ++++++++++++++++----------- crawl-ref/source/output.h | 3 +++ crawl-ref/source/religion.cc | 15 --------------- 5 files changed, 34 insertions(+), 49 deletions(-) diff --git a/crawl-ref/settings/menu_colours.txt b/crawl-ref/settings/menu_colours.txt index fe3636919b..f6a2e00982 100644 --- a/crawl-ref/settings/menu_colours.txt +++ b/crawl-ref/settings/menu_colours.txt @@ -54,7 +54,7 @@ menu = lightred:.*bad_item.* menu = magenta:.*dangerous_item.* # Evil items -inv = $evil:.*evil_item.* +menu = $evil:.*evil_item.* # Defaults for normal items # diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 043182e73a..fbc4d3fd50 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1778,21 +1778,21 @@ static void _print_friendly_pickup_setting(bool was_changed) if (you.friendly_pickup == FRIENDLY_PICKUP_NONE) { - mprf("Your allies are %sforbidden to pick up anything at all.", + mprf("Your intelligent, permanent allies are %sforbidden to pick up anything at all.", now.c_str()); } else if (you.friendly_pickup == FRIENDLY_PICKUP_FRIEND) { - mprf("Your allies may %sonly pick up items dropped by allies.", + mprf("Your intelligent, permanent allies may %sonly pick up items dropped by allies.", now.c_str()); } else if (you.friendly_pickup == FRIENDLY_PICKUP_ALL) { - mprf("Your allies may %spick up anything they need.", now.c_str()); + mprf("Your intelligent, permanent allies may %spick up anything they need.", now.c_str()); } else { - mprf("Your allies%s are collecting bugs!", now.c_str()); + mprf(MSGCH_ERROR, "Your allies%s are collecting bugs!", now.c_str()); } } @@ -1954,23 +1954,17 @@ void process_command( command_type cmd ) case CMD_TOGGLE_FRIENDLY_PICKUP: { -#ifndef WIZARD - if (!god_gives_permanent_followers(you.religion)) - { - mpr("I'm sorry, your allies won't ever be able to pick up items."); - if (Options.tutorial_left) - { - mpr("Only intelligent permanent allies may equip themselves, " - "and these two restrictions are only met by allies of the " - "followers of four gods in the pantheon: the Shining " - "One, Yredelemnul, Kikubaaqudgha, and Beogh.", - MSGCH_TUTORIAL); - } - break; - } -#endif // Toggle pickup mode for friendlies. _print_friendly_pickup_setting(false); + + if (Options.tutorial_left + && !god_gives_permanent_followers(you.religion)) + { + mpr("Only intelligent, permanent allies may equip themselves, " + "which excludes all types of zombies as well as enslaved and " + "summoned monsters.", MSGCH_TUTORIAL); + } + mpr("Change to (d)efault, (n)othing, (f)riend-dropped, or (a)ll? ", MSGCH_PROMPT); @@ -4098,9 +4092,7 @@ static bool _initialise(void) if (newc) // start a new game { - you.friendly_pickup = FRIENDLY_PICKUP_NONE; - if (god_gives_permanent_followers(you.religion)) - you.friendly_pickup = Options.default_friendly_pickup; + you.friendly_pickup = Options.default_friendly_pickup; // Mark items in inventory as of unknown origin. origin_set_inventory(origin_set_unknown); diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 8c7fdaf49d..2d5b9a6e97 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1195,14 +1195,17 @@ monster_pane_info::monster_pane_info(const monsters *m) if (m->has_ench(ENCH_BERSERK)) m_brands |= 4; } -// Sort monsters by: -// attitude -// difficulty -// type -// brand -bool // static -monster_pane_info::less_than(const monster_pane_info& m1, - const monster_pane_info& m2, bool zombified) +// Needed because gcc 4.3 sort does not like comparison functions that take +// more than 2 arguments. +bool monster_pane_info::less_than_wrapper(const monster_pane_info& m1, + const monster_pane_info& m2) +{ + return monster_pane_info::less_than(m1, m2, true); +} + +// Sort monsters by (in that order): attitude, difficulty, type, brand +bool monster_pane_info::less_than(const monster_pane_info& m1, + const monster_pane_info& m2, bool zombified) { if (m1.m_attitude < m2.m_attitude) return (true); @@ -1473,7 +1476,7 @@ void get_monster_pane_info(std::vector& mons) mons.push_back(monster_pane_info(visible[i])); } } - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); } #define BOTTOM_JUSTIFY_MONSTER_LIST 0 @@ -1489,7 +1492,7 @@ int update_monster_pane() std::vector mons; get_monster_pane_info(mons); - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); // Count how many groups of monsters there are unsigned int lines_needed = mons.size(); @@ -1506,7 +1509,9 @@ int update_monster_pane() // "rat zombie") in order to take up less lines. for (unsigned int i = 0; i < mons.size(); i++) mons[i].m_fullname = false; - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + + std::sort(mons.begin(), mons.end(), + monster_pane_info::less_than_wrapper); lines_needed = mons.size(); for (unsigned int i = 1; i < mons.size(); i++) diff --git a/crawl-ref/source/output.h b/crawl-ref/source/output.h index abb0b72722..61e524a732 100644 --- a/crawl-ref/source/output.h +++ b/crawl-ref/source/output.h @@ -74,6 +74,9 @@ class monster_pane_info static bool less_than(const monster_pane_info& m1, const monster_pane_info& m2, bool zombified = true); + static bool less_than_wrapper(const monster_pane_info& m1, + const monster_pane_info& m2); + monster_pane_info(const monsters* m); void to_string(int count, std::string& desc, int& desc_color) const; diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 46d6e633d1..8d7ba6d663 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -5493,21 +5493,6 @@ void god_pitch(god_type which_god) you.gift_timeout = 0; } - if (god_gives_permanent_followers(you.religion)) - { - // Enable ally pickup control for gods that give you permanent - // followers. - you.friendly_pickup = Options.default_friendly_pickup; - } - else - { - // With other gods, you can only get stupid (zombies!), - // summoned, or charmed allies, so pickup control makes no - // sense. Sorry about that! - you.friendly_pickup = FRIENDLY_PICKUP_NONE; - } - - set_god_ability_slots(); // remove old god's slots, reserve new god's #ifdef DGL_WHEREIS whereis_record(); -- cgit v1.2.3-54-g00ecf