From 746b402561b6b27625c5c1ac33028da9aa846b18 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 4 Sep 2007 10:41:46 +0000 Subject: More general stuff. - Beogh's water walk ability != swimming - monsters won't throw nets at you if you're already caught - Moved a few more messages into MSGCH_EXAMINE_FILTER. - Added information on new options. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2051 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/crawl_options.txt | 15 +++++++++++++++ crawl-ref/source/acr.cc | 4 ++-- crawl-ref/source/describe.cc | 4 ++-- crawl-ref/source/direct.cc | 23 ++++++++++++++++++----- crawl-ref/source/misc.cc | 4 ++++ crawl-ref/source/monstuff.cc | 10 ++++++++++ crawl-ref/source/player.cc | 14 +++++++++----- crawl-ref/source/player.h | 1 + crawl-ref/source/travel.cc | 2 +- 9 files changed, 62 insertions(+), 15 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt index ae075b199b..3a99b7559d 100644 --- a/crawl-ref/docs/crawl_options.txt +++ b/crawl-ref/docs/crawl_options.txt @@ -43,6 +43,7 @@ The contents of this text are: travel_delay, travel_avoid_terrain, travel_stop_message, explore_greedy, explore_stop, runrest_ignore_message, runrest_ignore_poison, + runrest_ignore_monster, trapwalk_safe_hp, tc_reachable, tc_dangerous, tc_excluded, tc_exclude_circle 4-h Stashes. @@ -653,6 +654,16 @@ runrest_ignore_poison = : runrest_ignore_message = You feel.*sick runrest_ignore_poison = 4:100 +runrest_ignore_monster = : + This only works if runrest.lua has been sourced already in init.txt. + Any monster containing the string will only interrupt your activity + if the distance between you and the monster is less than the + specified number. E.g. with + runrest_ingore_monster = fish:3 + all of big fish, jellyfish, giant goldfish and lavafish will be + considered safe for travel, explore and resting as long as the distance + is at least 3. + trapwalk_safe_hp = :, ... This only works if trapwalk.lua has been sourced already in init.txt. Any square containing one of the listed trap types will be considered @@ -1180,6 +1191,10 @@ note_skill_levels = 1,5,13,27 This sets which skill levels are noteworthy. You can have multiple note_skill_levels lines. The default is nothing (no notes.) +note_all_skill_levels = false + This is a shortcut for note_skill_levels = 1,2,..,27. If you set this + to true, all skill levels are noteworthy. + note_skill_max = false Setting this option will cause a note whenever a new maximum in skill levels is reached. If note_skill_max is true and note_skill_levels is diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d934e58972..89f55868d9 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1656,8 +1656,8 @@ void process_command( command_type cmd ) std::string msg = "Unknown command. (For a list of commands type ?.)"; print_formatted_paragraph(msg, get_number_of_cols()); } - else - mpr("Unknown command."); + else // well, not examine, but... + mpr("Unknown command.", MSGCH_EXAMINE_FILTER); break; } diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index cea8925088..f6c02817f8 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2246,8 +2246,8 @@ static const char* describe_potion( const item_def &item ) return "A potion containing the essence of life. Vital for all living " "creatures, as well as some undead ones.$"; case POT_RESISTANCE: - return "A potion which grants you " - "temporary resistance to the elements.$"; + return "A potion which grants you temporary resistance to the elements " + "and poison.$"; case NUM_POTIONS: return "A buggy potion."; } diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index b40e0b5662..c3ea182be1 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -491,7 +491,7 @@ void direction(dist& moves, targeting_type restricts, // Do we have a previous target? if (you.prev_targ == MHITNOT || you.prev_targ == MHITYOU) { - mpr("You haven't got a previous target."); + mpr("You haven't got a previous target.", MSGCH_EXAMINE_FILTER); break; } @@ -502,7 +502,7 @@ void direction(dist& moves, targeting_type restricts, if (!mons_near(montarget) || !player_monster_visible( montarget )) { - mpr("You can't see that creature any more."); + mpr("You can't see that creature any more.", MSGCH_EXAMINE_FILTER); } else { @@ -626,7 +626,7 @@ void direction(dist& moves, targeting_type restricts, } else if ( moves.isTarget && !see_grid(moves.tx, moves.ty) ) { - mpr("Sorry, you can't target what you can't see."); + mpr("Sorry, you can't target what you can't see.", MSGCH_EXAMINE_FILTER); } // Ask for confirmation if we're quitting for some odd reason else if ( moves.isValid || moves.isCancel || @@ -1213,7 +1213,16 @@ void describe_floor() if (feat.empty()) return; - mpr((prefix + feat + suffix).c_str(), MSGCH_EXAMINE); + msg_channel_type channel = MSGCH_EXAMINE; + + // water is not terribly important if you don't mind it + if ((grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER + || grd[you.x_pos][you.y_pos] == DNGN_SHALLOW_WATER) + && player_likes_water()) + { + channel = MSGCH_EXAMINE_FILTER; + } + mpr((prefix + feat + suffix).c_str(), channel); if (grid == DNGN_ENTER_LABYRINTH) mpr("Beware, for starvation awaits!", MSGCH_EXAMINE); } @@ -1837,8 +1846,12 @@ static void describe_cell(int mx, int my) else { msg_channel_type channel = MSGCH_EXAMINE; - if (grd[mx][my] == DNGN_FLOOR) + if (grd[mx][my] == DNGN_FLOOR + || grd[mx][my] == DNGN_SHALLOW_WATER + || grd[mx][my] == DNGN_DEEP_WATER) + { channel = MSGCH_EXAMINE_FILTER; + } mpr(feature_desc.c_str(), channel); } #endif diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index d4212f73aa..ac8efb3947 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2128,6 +2128,10 @@ bool fall_into_a_pool( int entry_x, int entry_y, bool allow_shift, merfolk_start_swimming(); return (false); } + + // sanity check + if (terrain != DNGN_LAVA && beogh_water_walk()) + return (false); mprf("You fall into the %s!", (terrain == DNGN_LAVA) ? "lava" : diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 25f1fc1513..574843070b 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -3538,6 +3538,16 @@ static bool handle_throw(monsters *monster, bolt & beem) if (mon_item == NON_ITEM || !is_valid_item(mitm[mon_item])) return (false); + // throwing a net at a target that is already caught would be + // completely useless, so bail out + if (mitm[mon_item].base_type == OBJ_MISSILES + && mitm[mon_item].sub_type == MI_THROWING_NET + && (beem.target_x == you.x_pos && beem.target_y == you.y_pos + && you.caught())) + { + return (false); + } + // If the attack needs a launcher that we can't wield, bail out. if (launcher) { diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 6cf1695a8e..b6b43e2d62 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -246,7 +246,7 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift, merfolk_start_swimming(); } } - else if ( !player_can_swim() ) + else if ( !player_likes_water() ) { ASSERT( new_grid != DNGN_DEEP_WATER ); @@ -347,7 +347,7 @@ bool is_grid_dangerous(int grid) { return (!player_is_levitating() && (grid == DNGN_LAVA - || (grid == DNGN_DEEP_WATER && !player_can_swim()))); + || (grid == DNGN_DEEP_WATER && !player_likes_water()) )); } bool player_in_mappable_area( void ) @@ -370,10 +370,15 @@ bool player_in_hell( void ) bool player_in_water(void) { - return (!player_is_levitating() + return (!player_is_levitating() && !beogh_water_walk() && grid_is_water(grd[you.x_pos][you.y_pos])); } +bool player_likes_water(void) +{ + return (player_can_swim() || beogh_water_walk()); +} + bool player_is_swimming(void) { return you.swimming(); @@ -5010,8 +5015,7 @@ bool player::in_water() const bool player::can_swim() const { - return (species == SP_MERFOLK || - (you.religion == GOD_BEOGH && you.piety >= piety_breakpoint(4))); + return (species == SP_MERFOLK); } bool player::swimming() const diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 4dff5056a6..fa566a5d9b 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -160,6 +160,7 @@ int player_mental_clarity(bool calc_unid = true); bool player_can_smell(); bool player_can_swim(); +bool player_likes_water(); /* *********************************************************************** * called from: fight - files - ouch diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 11eccfaac5..433e8878a0 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -474,7 +474,7 @@ void init_travel_terrain_check(bool check_race_equip) if (check_race_equip) { // Swimmers get deep water. - signed char water = player_can_swim()? TRAVERSABLE : IMPASSABLE; + signed char water = player_likes_water()? TRAVERSABLE : IMPASSABLE; // If the player has overridden deep water already, we'll respect that. set_pass_feature(DNGN_DEEP_WATER, water); -- cgit v1.2.3-54-g00ecf