summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Kozlov <zaba@thorium.homeunix.org>2009-11-14 11:56:37 +0300
committerVsevolod Kozlov <zaba@thorium.homeunix.org>2009-11-14 12:05:16 +0300
commite7c8daa764478faeadb05f074819c64c6cf3c36e (patch)
treeec9b7f7b921ffec9f401c1bf50148d10e83ff0a4
parent793840497955f01f4d2dbc9abde6fed7c4c83402 (diff)
downloadcrawl-ref-e7c8daa764478faeadb05f074819c64c6cf3c36e.tar.gz
crawl-ref-e7c8daa764478faeadb05f074819c64c6cf3c36e.zip
Move player_can_smell to player::can_smell.
-rw-r--r--crawl-ref/source/art-func.h4
-rw-r--r--crawl-ref/source/beam.cc6
-rw-r--r--crawl-ref/source/describe.cc2
-rw-r--r--crawl-ref/source/effects.cc6
-rw-r--r--crawl-ref/source/l_you.cc2
-rw-r--r--crawl-ref/source/player.cc10
-rw-r--r--crawl-ref/source/player.h2
-rw-r--r--crawl-ref/source/spells2.cc2
-rw-r--r--crawl-ref/source/spl-mis.cc14
9 files changed, 24 insertions, 24 deletions
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index 83ba5264ad..1fc84ad220 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -202,7 +202,7 @@ static void _olgreb_pluses(item_def *item)
static void _OLGREB_equip(item_def *item, bool *show_msgs, bool unmeld)
{
- if (player_can_smell())
+ if (you.can_smell())
_equip_mpr(show_msgs, "You smell chlorine.");
else
_equip_mpr(show_msgs, "The staff glows a sickly green.");
@@ -212,7 +212,7 @@ static void _OLGREB_equip(item_def *item, bool *show_msgs, bool unmeld)
static void _OLGREB_unequip(const item_def *item, bool *show_msgs)
{
- if (player_can_smell())
+ if (you.can_smell())
_equip_mpr(show_msgs, "The smell of chlorine vanishes.");
else
_equip_mpr(show_msgs, "The staff's sickly green glow vanishes.");
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 3d3c6bc1d8..a5cdbe3cc3 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1780,7 +1780,7 @@ void bolt::fire_wall_effect()
emit_message(MSGCH_PLAIN,
"The wax appears to soften slightly.");
}
- else if (player_can_smell())
+ else if (you.can_smell())
emit_message(MSGCH_PLAIN, "You smell warm wax.");
}
}
@@ -1790,7 +1790,7 @@ void bolt::fire_wall_effect()
grd(pos()) = DNGN_FLOOR;
if (you.see_cell(pos()))
emit_message(MSGCH_PLAIN, "The wax bubbles and burns!");
- else if (player_can_smell())
+ else if (you.can_smell())
emit_message(MSGCH_PLAIN, "You smell burning wax.");
place_cloud(CLOUD_FIRE, pos(), random2(10)+15, whose_kill(), killer());
obvious_effect = true;
@@ -1804,7 +1804,7 @@ void bolt::fire_wall_effect()
grd(pos()) = DNGN_FLOOR;
if (you.see_cell(pos()))
emit_message(MSGCH_PLAIN, "The tree burns like a torch!");
- else if (player_can_smell())
+ else if (you.can_smell())
emit_message(MSGCH_PLAIN, "You smell burning wood.");
if (whose_kill() == KC_YOU)
did_god_conduct(DID_KILL_PLANT, 1, effect_known);
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 248d59df2c..6b2283fd3d 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -663,7 +663,7 @@ static std::string _describe_demon(const monsters &mons)
if (x_chance_in_y(3, 40))
{
- if (player_can_smell())
+ if (you.can_smell())
{
switch (random2(3))
{
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 2f23cb2309..45d30acaaf 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -971,7 +971,7 @@ void random_uselessness(int scroll_slot)
case 3:
if (you.species == SP_MUMMY)
mpr("Your bandages flutter.");
- else // if (player_can_smell())
+ else // if (you.can_smell())
mprf("You smell %s.", weird_smell().c_str());
break;
@@ -2791,7 +2791,7 @@ static void _hell_effects()
(temp_rand == 5) ? "\"Leave now, before it is too late!\"" :
(temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
- (temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone."
+ (temp_rand == 7) ? (you.can_smell()) ? "You smell brimstone."
: "Brimstone rains from above." :
(temp_rand == 8) ? "You feel lost and a long, long way from home..." :
(temp_rand == 9) ? "You shiver with fear." :
@@ -3557,7 +3557,7 @@ static void _rot_inventory_food(long time_delta)
// Races that can't smell don't care, and trolls are stupid and
// don't care.
- if (player_can_smell() && you.species != SP_TROLL)
+ if (you.can_smell() && you.species != SP_TROLL)
{
int temp_rand = 0; // Grr.
int level = player_mutation_level(MUT_SAPROVOROUS);
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index a41c25c87f..473ad41bf9 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -104,7 +104,7 @@ LUARET1(you_taking_stairs, boolean,
current_delay_action() == DELAY_ASCENDING_STAIRS
|| current_delay_action() == DELAY_DESCENDING_STAIRS)
LUARET1(you_turns, number, you.num_turns)
-LUARET1(you_can_smell, boolean, player_can_smell())
+LUARET1(you_can_smell, boolean, you.can_smell())
LUARET1(you_has_claws, number, you.has_claws(false))
void lua_push_floor_items(lua_State *ls);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 1deed6be73..a56b9ffcb2 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1246,11 +1246,6 @@ int player_spell_levels(void)
return (sl);
}
-bool player_can_smell()
-{
- return (you.species != SP_MUMMY);
-}
-
bool player_likes_chunks(bool permanently)
{
return (player_mutation_level(MUT_GOURMAND) > 0
@@ -7012,6 +7007,11 @@ bool player::can_throw_large_rocks() const
return (player_genus(GENPC_OGRE) || species == SP_TROLL);
}
+bool player::can_smell() const
+{
+ return (species != SP_MUMMY);
+}
+
void player::hibernate(int)
{
ASSERT(!crawl_state.arena);
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index e060e3fd14..a82d4dc9c6 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -483,6 +483,7 @@ public:
void check_awaken(int disturbance);
bool can_throw_large_rocks() const;
+ bool can_smell() const;
int armour_class() const;
int melee_evasion(const actor *attacker,
@@ -615,7 +616,6 @@ bool player_item_conserve(bool calc_unid = true);
int player_mental_clarity(bool calc_unid = true, bool items = true);
int player_spirit_shield(bool calc_unid = true);
-bool player_can_smell();
bool player_likes_chunks(bool permanently = false);
bool player_likes_water(bool permanently = false);
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 4e0a3c366f..14cd3f19ec 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -239,7 +239,7 @@ void corpse_rot()
}
}
- if (player_can_smell())
+ if (you.can_smell())
mpr("You smell decay.");
// Should make zombies decay into skeletons?
diff --git a/crawl-ref/source/spl-mis.cc b/crawl-ref/source/spl-mis.cc
index 511426ec09..78882d374c 100644
--- a/crawl-ref/source/spl-mis.cc
+++ b/crawl-ref/source/spl-mis.cc
@@ -830,7 +830,7 @@ void MiscastEffect::_conjuration(int severity)
// care of elsewhere.
break;
case 9:
- if (player_can_smell())
+ if (you.can_smell())
all_msg = "You smell something strange.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";
@@ -1576,7 +1576,7 @@ void MiscastEffect::_necromancy(int severity)
switch (random2(10))
{
case 0:
- if (player_can_smell())
+ if (you.can_smell())
all_msg = "You smell decay.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";
@@ -1653,7 +1653,7 @@ void MiscastEffect::_necromancy(int severity)
case 2:
if (target->res_rotting() == 0)
{
- if (player_can_smell())
+ if (you.can_smell())
{
// identical to a harmless message
all_msg = "You smell decay.";
@@ -1850,7 +1850,7 @@ void MiscastEffect::_transmutation(int severity)
// care of elsewhere.
break;
case 9:
- if (player_can_smell())
+ if (you.can_smell())
all_msg = "You smell something strange.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";
@@ -1990,7 +1990,7 @@ void MiscastEffect::_fire(int severity)
// Monster messages needed.
break;
case 4:
- if (player_can_smell())
+ if (you.can_smell())
all_msg = "You smell smoke.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";
@@ -2489,7 +2489,7 @@ void MiscastEffect::_air(int severity)
msg_ch = MSGCH_SOUND;
sound_loudness = 10;
}
- else if (player_can_smell())
+ else if (you.can_smell())
all_msg = "You smell ozone.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";
@@ -2505,7 +2505,7 @@ void MiscastEffect::_air(int severity)
msg_ch = MSGCH_SOUND;
sound_loudness = 10;
}
- else if (player_can_smell())
+ else if (you.can_smell())
all_msg = "You smell something musty.";
else if (you.species == SP_MUMMY)
you_msg = "Your bandages flutter.";