From eaa52e83a89d49475ee00812ebcf0fe7caa89980 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 12 Mar 2009 20:12:49 +0000 Subject: FR 2093461: add player + allies FRIENDLY_PICKUP mode Make Roxanne immune to disintegration (like ice statues). Move rock worms a bit lower in the dungeon and increase their damage (a tiny bit). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9428 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/options_guide.txt | 8 +++++--- crawl-ref/source/acr.cc | 16 +++++++++++----- crawl-ref/source/beam.cc | 2 +- crawl-ref/source/enum.h | 1 + crawl-ref/source/initfile.cc | 2 ++ crawl-ref/source/mon-data.h | 2 +- crawl-ref/source/mon-pick.cc | 2 +- crawl-ref/source/mon-util.cc | 18 ++++++++++++------ crawl-ref/source/mon-util.h | 2 +- 9 files changed, 35 insertions(+), 18 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index 20eecd3b14..d3c11bc623 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -509,15 +509,17 @@ drop_filter = set/clear selection of items that match the filter expression(s). -default_friendly_pickup = (friend | none | all) +default_friendly_pickup = (friend | player | none | all) Using an in-game toggle, you can control what types of items your allies will pick up: none = They won't pick up anything at all. (This is the old friendly pick up behaviour.) - friend = They will pick up anything they or another ally + friend = They may pick up anything they or another ally dropped, e.g. if another ally dies. (This is the default setting.) - all = They will pick up anything they want to have. + player = Like 'friend', but they may also pick up anything + you've dropped or thrown. + all = They may pick up anything they want to have. (This is how it works for hostile monsters.) This option controls which is the default setting for this toggle diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index b8dfd911bc..06cde2fdfe 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1306,14 +1306,18 @@ static void _print_friendly_pickup_setting(bool was_changed) mprf("Your intelligent allies may %sonly pick up items dropped by allies.", now.c_str()); } + else if (you.friendly_pickup == FRIENDLY_PICKUP_PLAYER) + { + mprf("Your intelligent allies may %sonly pick up items dropped by you " + "and your allies.", now.c_str()); + } else if (you.friendly_pickup == FRIENDLY_PICKUP_ALL) { - mprf("Your intelligent allies may %spick up anything they need.", now.c_str()); + mprf("Your intelligent allies may %spick up anything they need.", + now.c_str()); } else - { mprf(MSGCH_ERROR, "Your allies%s are collecting bugs!", now.c_str()); - } } // Note that in some actions, you don't want to clear afterwards. @@ -1444,8 +1448,8 @@ void process_command( command_type cmd ) // Toggle pickup mode for friendlies. _print_friendly_pickup_setting(false); - mpr("Change to (d)efault, (n)othing, (f)riend-dropped, or (a)ll? ", - MSGCH_PROMPT); + mpr("Change to (d)efault, (n)othing, (f)riend-dropped, (p)layer, " + "or (a)ll? ", MSGCH_PROMPT); char type = (char) getchm(KC_DEFAULT); type = tolower(type); @@ -1456,6 +1460,8 @@ void process_command( command_type cmd ) you.friendly_pickup = FRIENDLY_PICKUP_NONE; else if (type == 'f') you.friendly_pickup = FRIENDLY_PICKUP_FRIEND; + else if (type == 'p') + you.friendly_pickup = FRIENDLY_PICKUP_PLAYER; else if (type == 'a') you.friendly_pickup = FRIENDLY_PICKUP_ALL; else diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index fe701dc282..eb51cc6112 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4319,7 +4319,7 @@ bool bolt::handle_statue_disintegration(monsters* mon) { bool rc = false; if ((flavour == BEAM_DISINTEGRATION || flavour == BEAM_NUKE) - && mons_is_statue(mon->type) && !mons_is_icy(mon->type)) + && mons_is_statue(mon->type, true)) { rc = true; // Disintegrate the statue. diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 727579cf10..a505667027 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2980,6 +2980,7 @@ enum friendly_pickup_type { FRIENDLY_PICKUP_NONE = 0, FRIENDLY_PICKUP_FRIEND, + FRIENDLY_PICKUP_PLAYER, FRIENDLY_PICKUP_ALL }; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 4bee7a894b..dc2ce6daaa 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -2107,6 +2107,8 @@ void game_options::read_option_line(const std::string &str, bool runscript) default_friendly_pickup = FRIENDLY_PICKUP_NONE; else if (field == "friend") default_friendly_pickup = FRIENDLY_PICKUP_FRIEND; + else if (field == "player") + default_friendly_pickup = FRIENDLY_PICKUP_PLAYER; else if (field == "all") default_friendly_pickup = FRIENDLY_PICKUP_ALL; } diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index a10c814f17..ac236ddfd5 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -3036,7 +3036,7 @@ static monsterentry mondata[] = { M_NO_FLAGS, MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC, 0, 10, MONS_WORM, MONS_ROCK_WORM, MH_NATURAL, -3, - { {AT_BITE, AF_PLAIN, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { {AT_BITE, AF_PLAIN, 22}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 5, 5, 5, 0 }, 3, 12, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_PLANT, HT_ROCK, 12, DEFAULT_ENERGY, MONUSE_NOTHING, SIZE_LARGE diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc index 2ce6a53505..b02a6e2871 100644 --- a/crawl-ref/source/mon-pick.cc +++ b/crawl-ref/source/mon-pick.cc @@ -665,7 +665,6 @@ int mons_standard_level(int mcls) case MONS_WRAITH: case MONS_UNSEEN_HORROR: case MONS_TRAPDOOR_SPIDER: - case MONS_ROCK_WORM: return 14; case MONS_ARMOUR_MIMIC: @@ -704,6 +703,7 @@ int mons_standard_level(int mcls) case MONS_WIZARD: case MONS_SIMULACRUM_SMALL: case MONS_SIMULACRUM_LARGE: + case MONS_ROCK_WORM: return 17; case MONS_DRAGON: diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 373af34708..2e7f88c2fd 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -641,12 +641,15 @@ bool invalid_monster_index(int i) return (i < 0 || i >= MAX_MONSTERS); } -bool mons_is_statue(int mc) +bool mons_is_statue(int mc, bool allow_disintegrate) { - return (mc == MONS_ORANGE_STATUE - || mc == MONS_SILVER_STATUE - || mc == MONS_ICE_STATUE - || mc == MONS_ROXANNE); + if (mc == MONS_ORANGE_STATUE || mc == MONS_SILVER_STATUE) + return (true); + + if (!allow_disintegrate) + return (mc == MONS_ICE_STATUE || mc == MONS_ROXANNE); + + return (false); } bool mons_is_mimic(int mc) @@ -5103,7 +5106,10 @@ bool monsters::pickup_item(item_def &item, int near, bool force) // pick up anything, or only stuff dropped by (other) allies. if (you.friendly_pickup == FRIENDLY_PICKUP_NONE || you.friendly_pickup == FRIENDLY_PICKUP_FRIEND - && !testbits(item.flags, ISFLAG_DROPPED_BY_ALLY)) + && !testbits(item.flags, ISFLAG_DROPPED_BY_ALLY) + || you.friendly_pickup == FRIENDLY_PICKUP_PLAYER + && !(item.flags & (ISFLAG_DROPPED | ISFLAG_THROWN + | ISFLAG_DROPPED_BY_ALLY))) { return (false); } diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index 8ad2d0da56..0454c7fc83 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -565,7 +565,7 @@ mon_holy_type mons_class_holiness(int mc); mon_holy_type mons_holiness(const monsters *mon); bool mons_is_mimic( int mc ); -bool mons_is_statue( int mc ); +bool mons_is_statue( int mc, bool allow_disintegrate = false ); bool mons_is_demon( int mc ); bool mons_class_wields_two_weapons(int mc); -- cgit v1.2.3-54-g00ecf