Remove player blood/web sense of out-of-sight monsters
authorChris Campbell <chriscampbell89@gmail.com>
Fri, 14 Mar 2014 21:31:40 +0000 (21:31 +0000)
committerChris Campbell <chriscampbell89@gmail.com>
Fri, 14 Mar 2014 22:13:43 +0000 (22:13 +0000)
It was very unlikely to ever trigger - caused by a monster somehow being
made to bleed just out of your LOS in the blood sense case, or a monster
being caught in a web while you are in spider form in the web sense case,
and even less likely to actually be useful if it did somehow trigger.

crawl-ref/source/shout.cc
crawl-ref/source/shout.h
crawl-ref/source/traps.cc

index b555500..bf60676 100644 (file)
@@ -546,70 +546,6 @@ bool fake_noisy(int loudness, const coord_def& where)
     return noisy(loudness, where, NULL, -1, false, false, true);
 }
 
-static const char* _player_vampire_smells_blood(int dist)
-{
-    // non-thirsty vampires get no clear indication of how close the
-    // smell is
-    if (you.hunger_state >= HS_SATIATED)
-        return "";
-
-    if (dist < 16) // 4*4
-        return " near-by";
-
-    if (you.hunger_state <= HS_NEAR_STARVING && dist > los_radius2)
-        return " in the distance";
-
-    return "";
-}
-
-static const char* _player_spider_senses_web(int dist)
-{
-    if (dist < 4)
-        return " near-by";
-
-    if (dist > LOS_RADIUS)
-        return " in the distance";
-
-    return "";
-}
-
-void check_player_sense(sense_type sense, int range, const coord_def& where)
-{
-    const int player_distance = distance2(you.pos(), where);
-
-    if (player_distance <= range)
-    {
-        switch (sense)
-        {
-        case SENSE_SMELL_BLOOD:
-            dprf("Player smells blood, pos: (%d, %d), dist = %d)",
-                 you.pos().x, you.pos().y, player_distance);
-            you.check_awaken(range - player_distance);
-            // Don't message if you can see the square.
-            if (!you.see_cell(where))
-            {
-                mprf("You smell fresh blood%s.",
-                     _player_vampire_smells_blood(player_distance));
-            }
-            break;
-
-        case SENSE_WEB_VIBRATION:
-            // Spider form
-            if (you.can_cling_to_walls())
-            {
-                you.check_awaken(range - player_distance);
-                // Don't message if you can see the square.
-                if (!you.see_cell(where))
-                {
-                    mprf("You hear a 'twang'%s.",
-                         _player_spider_senses_web(player_distance));
-                }
-            }
-            break;
-        }
-    }
-}
-
 void check_monsters_sense(sense_type sense, int range, const coord_def& where)
 {
     for (monster_iterator mi; mi; ++mi)
@@ -709,18 +645,6 @@ void blood_smell(int strength, const coord_def& where)
     dprf("blood stain at (%d, %d), range of smell = %d",
          where.x, where.y, range);
 
-    // Of the player species, only Vampires can smell blood.
-    if (you.species == SP_VAMPIRE)
-    {
-        // Whether they actually do so, depends on their hunger state.
-        int vamp_strength = strength - 2 * (you.hunger_state - 1);
-        if (vamp_strength > 0)
-        {
-            int vamp_range = vamp_strength * vamp_strength;
-            check_player_sense(SENSE_SMELL_BLOOD, vamp_range, where);
-        }
-    }
-
     check_monsters_sense(SENSE_SMELL_BLOOD, range, where);
 }
 
index 10d0a57..6582798 100644 (file)
@@ -11,7 +11,6 @@ bool fake_noisy(int loudness, const coord_def& where);
 void item_noise(const item_def& item, string msg, int loudness = 25);
 void noisy_equipment();
 
-void check_player_sense(sense_type sense, int range, const coord_def& where);
 void check_monsters_sense(sense_type sense, int range, const coord_def& where);
 
 void blood_smell(int strength, const coord_def& where);
index 270b529..c75327a 100644 (file)
@@ -895,7 +895,6 @@ void trap_def::trigger(actor& triggerer, bool flat_footed)
 
                 // Alert both monsters and player
                 check_monsters_sense(SENSE_WEB_VIBRATION, 100, triggerer.position);
-                check_player_sense(SENSE_WEB_VIBRATION, 100, triggerer.position);
             }
         }
         break;
@@ -2056,6 +2055,5 @@ bool ensnare(actor *fly)
         return true;
 
     check_monsters_sense(SENSE_WEB_VIBRATION, 100, fly->pos());
-    check_player_sense(SENSE_WEB_VIBRATION, 100, fly->pos());
     return true;
 }