summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-13 15:00:57 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-13 15:22:16 +0100
commit310d0430888db20093a862e7921511076a486c6b (patch)
treeda21a4f3e17b5bba68a0ce3fc31aceb4429fe775 /crawl-ref/source
parentd4189cb0308511fc5d7e12790993f6844974e0c7 (diff)
downloadcrawl-ref-310d0430888db20093a862e7921511076a486c6b.tar.gz
crawl-ref-310d0430888db20093a862e7921511076a486c6b.zip
Replace observe_cell by you.see_cell.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc2
-rw-r--r--crawl-ref/source/beam.cc42
-rw-r--r--crawl-ref/source/cloud.cc2
-rw-r--r--crawl-ref/source/directn.cc8
-rw-r--r--crawl-ref/source/effects.cc8
-rw-r--r--crawl-ref/source/fight.cc8
-rw-r--r--crawl-ref/source/godabil.cc8
-rw-r--r--crawl-ref/source/los.cc7
-rw-r--r--crawl-ref/source/los.h1
-rw-r--r--crawl-ref/source/mon-act.cc10
-rw-r--r--crawl-ref/source/mon-behv.cc2
-rw-r--r--crawl-ref/source/mon-cast.cc4
-rw-r--r--crawl-ref/source/mon-place.cc4
-rw-r--r--crawl-ref/source/mon-stuff.cc6
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/monster.cc10
-rw-r--r--crawl-ref/source/ouch.cc2
-rw-r--r--crawl-ref/source/show.cc2
-rw-r--r--crawl-ref/source/spells1.cc4
-rw-r--r--crawl-ref/source/spells3.cc16
-rw-r--r--crawl-ref/source/spells4.cc4
-rw-r--r--crawl-ref/source/state.cc2
-rw-r--r--crawl-ref/source/terrain.cc20
-rw-r--r--crawl-ref/source/tilepick.cc6
-rw-r--r--crawl-ref/source/tilereg.cc4
-rw-r--r--crawl-ref/source/traps.cc8
-rw-r--r--crawl-ref/source/view.cc6
-rw-r--r--crawl-ref/source/viewmap.cc4
28 files changed, 97 insertions, 105 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index fe11c6612f..bb8bd1ba16 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1963,7 +1963,7 @@ void process_command( command_type cmd )
}
else if (cme.right_clicked())
{
- if (observe_cell(dest))
+ if (you.see_cell(dest))
full_describe_square(dest);
else
mpr("You can't see that place.");
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 4d4d2526f6..6cadc87f16 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -152,7 +152,7 @@ static void _zap_animation(int colour, const monsters *mon = NULL,
p = mon->pos();
}
- if (!observe_cell(p))
+ if (!you.see_cell(p))
return;
const coord_def drawp = grid2view(p);
@@ -1581,7 +1581,7 @@ void bolt::initialise_fire()
message_cache.clear();
// seen might be set by caller to supress this.
- if (!seen && observe_cell(source) && range > 0 && !invisible() )
+ if (!seen && you.see_cell(source) && range > 0 && !invisible() )
{
seen = true;
const monsters* mon = monster_at(source);
@@ -1599,7 +1599,7 @@ void bolt::initialise_fire()
// Visible self-targeted beams are always seen, even though they don't
// leave a path.
- if (observe_cell(source) && target == source && !invisible())
+ if (you.see_cell(source) && target == source && !invisible())
seen = true;
// Scale draw_delay to match change in arena_delay.
@@ -1652,7 +1652,7 @@ void bolt::choose_ray()
// Draw the bolt at p if needed.
void bolt::draw(const coord_def& p)
{
- if (is_tracer || is_enchantment() || !observe_cell(p))
+ if (is_tracer || is_enchantment() || !you.see_cell(p))
return;
// We don't clean up the old position.
@@ -1774,7 +1774,7 @@ void bolt::fire_wall_effect()
// No actual effect.
if (flavour != BEAM_HELLFIRE && feat == DNGN_WAX_WALL)
{
- if (observe_cell(pos()))
+ if (you.see_cell(pos()))
{
emit_message(MSGCH_PLAIN,
"The wax appears to soften slightly.");
@@ -1787,7 +1787,7 @@ void bolt::fire_wall_effect()
{
// Destroy the wall.
grd(pos()) = DNGN_FLOOR;
- if (observe_cell(pos()))
+ if (you.see_cell(pos()))
emit_message(MSGCH_PLAIN, "The wax bubbles and burns!");
else if (player_can_smell())
emit_message(MSGCH_PLAIN, "You smell burning wax.");
@@ -1801,7 +1801,7 @@ void bolt::fire_wall_effect()
{
// Destroy the wall.
grd(pos()) = DNGN_FLOOR;
- if (observe_cell(pos()))
+ if (you.see_cell(pos()))
emit_message(MSGCH_PLAIN, "The tree burns like a torch!");
else if (player_can_smell())
emit_message(MSGCH_PLAIN, "You smell burning wood.");
@@ -1852,7 +1852,7 @@ void bolt::nuke_wall_effect()
if (player_can_hear(pos()))
{
- if (!observe_cell(pos()))
+ if (!you.see_cell(pos()))
mpr("You hear a hideous screaming!", MSGCH_SOUND);
else
{
@@ -1860,7 +1860,7 @@ void bolt::nuke_wall_effect()
MSGCH_SOUND);
}
}
- else if (observe_cell(pos()))
+ else if (you.see_cell(pos()))
mpr("The idol twists and shakes as its substance crumbles away!");
if (beam_source == NON_MONSTER)
@@ -2186,7 +2186,7 @@ void bolt::do_fire()
|| is_tracer && affects_wall(grd(pos())));
const bool was_seen = seen;
- if (!was_seen && range > 0 && !invisible() && observe_cell(pos()))
+ if (!was_seen && range > 0 && !invisible() && you.see_cell(pos()))
seen = true;
if (flavour != BEAM_VISUAL && !was_seen && seen && !is_tracer)
@@ -3049,7 +3049,7 @@ void bolt::drop_object()
// Summoned creatures' thrown items disappear.
if (item->flags & ISFLAG_SUMMONED)
{
- if (observe_cell(pos()))
+ if (you.see_cell(pos()))
{
mprf("%s %s!",
item->name(DESC_CAP_THE).c_str(),
@@ -3140,7 +3140,7 @@ void bolt::affect_ground()
MHITNOT,
MG_FORCE_PLACE));
- if (rc != -1 && observe_cell(pos()))
+ if (rc != -1 && you.see_cell(pos()))
mpr("A fungus suddenly grows.");
}
@@ -4405,7 +4405,7 @@ bool bolt::determine_damage(monsters* mon, int& preac, int& postac, int& final,
// Electricity is ineffective.
if (flavour == BEAM_ELECTRICITY)
{
- if (!is_tracer && observe_cell(mon->pos()))
+ if (!is_tracer && you.see_cell(mon->pos()))
mprf("The %s arcs harmlessly into the water.", name.c_str());
finish_beam();
return (false);
@@ -4667,7 +4667,7 @@ bool bolt::attempt_block(monsters* mon)
shield->name(DESC_PLAIN).c_str());
_ident_reflector(shield);
}
- else if (observe_cell(pos()))
+ else if (you.see_cell(pos()))
mprf("The %s bounces off of thin air!", name.c_str());
reflect();
@@ -4697,7 +4697,7 @@ bool bolt::handle_statue_disintegration(monsters* mon)
// Disintegrate the statue.
if (!silenced(you.pos()))
{
- if (!observe_cell(mon->pos()))
+ if (!you.see_cell(mon->pos()))
mpr("You hear a hideous screaming!", MSGCH_SOUND);
else
{
@@ -4705,7 +4705,7 @@ bool bolt::handle_statue_disintegration(monsters* mon)
MSGCH_SOUND);
}
}
- else if (observe_cell(mon->pos()))
+ else if (you.see_cell(mon->pos()))
{
mpr("The statue twists and shakes as its substance "
"crumbles away!");
@@ -5623,7 +5623,7 @@ void bolt::refine_for_explosion()
{
heard = player_can_hear(target);
// Check for see/hear/no msg.
- if (observe_cell(target) || target == you.pos())
+ if (you.see_cell(target) || target == you.pos())
mpr(seeMsg);
else
{
@@ -5689,7 +5689,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
if (is_sanctuary(pos()))
{
- if (!is_tracer && observe_cell(pos()) && !name.empty())
+ if (!is_tracer && you.see_cell(pos()) && !name.empty())
{
mprf(MSGCH_GOD, "By Zin's power, the %s is contained.",
name.c_str());
@@ -5711,7 +5711,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
bool heard_expl = noisy(loudness, pos(), beam_source);
heard = heard || heard_expl;
- if (heard_expl && !noise_msg.empty() && !observe_cell(pos()))
+ if (heard_expl && !noise_msg.empty() && !you.see_cell(pos()))
mprf(MSGCH_SOUND, "%s", noise_msg.c_str());
}
@@ -5777,7 +5777,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
if (exp_map(delta + centre) < INT_MAX)
{
- if (observe_cell(delta + pos()))
+ if (you.see_cell(delta + pos()))
++cells_seen;
explosion_affect_cell(delta + pos());
@@ -5809,7 +5809,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
void bolt::explosion_draw_cell(const coord_def& p)
{
- if (observe_cell(p))
+ if (you.see_cell(p))
{
const coord_def drawpos = grid2view(p);
#ifdef USE_TILE
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index b1a6069c50..43bbf8d4fe 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -155,7 +155,7 @@ static void _spread_fire(const cloud_struct &cloud)
// every neighbouring square gets a separate roll
if (grd(*ai) == DNGN_TREES && one_chance_in(20))
{
- if (observe_cell(*ai))
+ if (you.see_cell(*ai))
mpr("The forest fire spreads!");
grd(*ai) = DNGN_FLOOR;
_place_new_cloud( cloud.type, *ai, random2(30)+25, cloud.whose,
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 3d225bfd6c..abca5f8fd4 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1756,7 +1756,7 @@ std::string get_terse_square_desc(const coord_def &gc)
desc = you.your_name;
else if (!map_bounds(gc))
desc = unseen_desc;
- else if (!observe_cell(gc))
+ else if (!you.see_cell(gc))
{
if (is_terrain_seen(gc))
{
@@ -1792,7 +1792,7 @@ std::string get_terse_square_desc(const coord_def &gc)
void terse_describe_square(const coord_def &c, bool in_range)
{
- if (!observe_cell(c))
+ if (!you.see_cell(c))
_describe_oos_square(c);
else if (in_bounds(c) )
_describe_cell(c, in_range);
@@ -1804,7 +1804,7 @@ void get_square_desc(const coord_def &c, describe_info &inf,
// NOTE: Keep this function in sync with full_describe_square.
// Don't give out information for things outside LOS
- if (!observe_cell(c))
+ if (!you.see_cell(c))
return;
const monsters* mons = monster_at(c);
@@ -1847,7 +1847,7 @@ void full_describe_square(const coord_def &c)
// NOTE: Keep this function in sync with get_square_desc.
// Don't give out information for things outside LOS
- if (!observe_cell(c))
+ if (!you.see_cell(c))
return;
const monsters* mons = monster_at(c);
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index f0160ef846..ba5001f64c 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -4319,7 +4319,7 @@ int place_ring(std::vector<coord_def> &ring_points,
if (mushroom != -1)
{
spawned_count++;
- if (observe_cell(ring_points.at(i)))
+ if (you.see_cell(ring_points.at(i)))
seen_count++;
}
}
@@ -4505,7 +4505,7 @@ int spawn_corpse_mushrooms(item_def &corpse,
{
corpse.special = 0;
- if (observe_cell(corpse.pos))
+ if (you.see_cell(corpse.pos))
mpr("A ring of toadstools grows before your very eyes.");
else if (ring_seen > 1)
mpr("Some toadstools grow in a peculiar arc.");
@@ -4577,7 +4577,7 @@ int spawn_corpse_mushrooms(item_def &corpse,
}
placed_targets++;
- if (observe_cell(current))
+ if (you.see_cell(current))
seen_targets++;
}
else
@@ -4685,7 +4685,7 @@ static void _maybe_spawn_mushroom(item_def & corpse, int rot_time)
int seen_spawns;
spawn_corpse_mushrooms(corpse, success_count, seen_spawns);
- mushroom_spawn_message(seen_spawns, observe_cell(corpse.pos) ? 1 : 0);
+ mushroom_spawn_message(seen_spawns, you.see_cell(corpse.pos) ? 1 : 0);
}
//---------------------------------------------------------------
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index ada19b5efc..6787287ba1 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -410,10 +410,10 @@ void melee_attack::init_attack()
water_attack = is_water_attack(attacker, defender);
attacker_visible = attacker->observable();
- attacker_invisible = (!attacker_visible && observe_cell(attacker->pos()));
+ attacker_invisible = (!attacker_visible && you.see_cell(attacker->pos()));
defender_visible = defender && defender->observable();
defender_invisible = (!defender_visible && defender
- && observe_cell(defender->pos()));
+ && you.see_cell(defender->pos()));
needs_message = (attacker_visible || defender_visible);
if (defender && defender->atype() == ACT_MONSTER)
@@ -1970,7 +1970,7 @@ bool melee_attack::player_monattk_final_hit_effects(bool mondied)
switch (final_effects[i].flavor)
{
case FINEFF_LIGHTNING_DISCHARGE:
- if (observe_cell(final_effects[i].location))
+ if (you.see_cell(final_effects[i].location))
mpr("Electricity arcs through the water!");
conduct_electricity(final_effects[i].location, attacker);
break;
@@ -2434,7 +2434,7 @@ void melee_attack::chaos_affects_defender()
miscast_chance *= 2;
// Inform player that something is up.
- if (observe_cell(defender->pos()))
+ if (you.see_cell(defender->pos()))
{
if (defender->atype() == ACT_PLAYER)
mpr("You give off a flash of multicoloured light!");
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index 48876a0a2c..d7c635b2c6 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -437,7 +437,7 @@ int fungal_bloom()
destroy_item(j->index());
}
- if (corpse_on_pos && observe_cell(*i))
+ if (corpse_on_pos && you.see_cell(*i))
seen_corpses++;
}
}
@@ -470,7 +470,7 @@ static int _create_plant(coord_def & target)
if (plant != -1)
{
env.mons[plant].flags |= MF_ATT_CHANGE_ATTEMPT;
- if (observe_cell(target))
+ if (you.see_cell(target))
mpr("A plant grows up from the ground.");
}
@@ -539,7 +539,7 @@ bool sunlight()
if (grd(target) != ftype)
{
dungeon_terrain_changed(target, ftype);
- if (observe_cell(target))
+ if (you.see_cell(target))
evap_count++;
}
@@ -570,7 +570,7 @@ bool sunlight()
MG_FORCE_PLACE,
GOD_FEDHAS));
- if (plant != -1 && observe_cell(target))
+ if (plant != -1 && you.see_cell(target))
plant_count++;
}
}
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index bb4ce58d29..0931802478 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -905,13 +905,6 @@ void calc_show_los()
you.update_los();
}
-// Answers the question: Is the cell visible to the observer?
-// Usually the same as player LOS.
-bool observe_cell(const coord_def &p)
-{
- return (you.see_cell(p));
-}
-
// Is the cell visible, but a translucent wall is in the way?
bool trans_wall_blocking(const coord_def &p)
{
diff --git a/crawl-ref/source/los.h b/crawl-ref/source/los.h
index 60ff4de674..35ce06ed54 100644
--- a/crawl-ref/source/los.h
+++ b/crawl-ref/source/los.h
@@ -48,7 +48,6 @@ void losight(los_grid& sh, const coord_def& center,
void losight(los_grid& sh, const los_param& param);
void calc_show_los();
-bool observe_cell(const coord_def &p);
bool trans_wall_blocking( const coord_def &p );
#endif
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index d58b1fc1d2..8b1a108830 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -2645,13 +2645,13 @@ static void _mons_open_door(monsters* monster, const coord_def &pos)
i != all_door.end(); ++i)
{
const coord_def& dc = *i;
- if (grd(dc) == DNGN_SECRET_DOOR && observe_cell(dc))
+ if (grd(dc) == DNGN_SECRET_DOOR && you.see_cell(dc))
{
grid = grid_secret_door_appearance(dc);
was_secret = true;
}
- if (observe_cell(dc))
+ if (you.see_cell(dc))
was_seen = true;
else
set_terrain_changed(dc);
@@ -3083,10 +3083,10 @@ static bool _do_move_monster(monsters *monster, const coord_def& delta)
// The monster gave a "comes into view" message and then immediately
// moved back out of view, leaing the player nothing to see, so give
// this message to avoid confusion.
- if (monster->seen_context == _just_seen && !observe_cell(f))
+ if (monster->seen_context == _just_seen && !you.see_cell(f))
simple_monster_message(monster, " moves out of view.");
else if (Options.tutorial_left && (monster->flags & MF_WAS_IN_VIEW)
- && !observe_cell(f))
+ && !you.see_cell(f))
{
learned_something_new(TUT_MONSTER_LEFT_LOS, monster->pos());
}
@@ -3291,7 +3291,7 @@ static bool _monster_move(monsters *monster)
_jelly_grows(monster);
- if (observe_cell(newpos))
+ if (you.see_cell(newpos))
{
viewwindow(false);
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index 25045c6546..4d5321ae18 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1846,7 +1846,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
else if (mon->friendly() && !crawl_state.arena)
mon->foe = MHITYOU;
- if (observe_cell(mon->pos()))
+ if (you.see_cell(mon->pos()))
learned_something_new(TUT_FLEEING_MONSTER);
break;
diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc
index 80d395cbf8..519429db9b 100644
--- a/crawl-ref/source/mon-cast.cc
+++ b/crawl-ref/source/mon-cast.cc
@@ -2126,7 +2126,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
if (spell_is_direct_explosion(spell_cast))
{
const actor *foe = monster->get_foe();
- const bool need_more = foe && (foe == &you || observe_cell(foe->pos()));
+ const bool need_more = foe && (foe == &you || you.see_cell(foe->pos()));
pbolt.in_explosion_phase = false;
pbolt.explode(need_more);
}
@@ -2364,7 +2364,7 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
{
target = "DEAD FOE";
}
- else if (in_bounds(pbolt.target) && observe_cell(pbolt.target))
+ else if (in_bounds(pbolt.target) && you.see_cell(pbolt.target))
{
if (const monsters* mtarg = monster_at(pbolt.target))
{
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index dbf488e6a5..3e082e74f5 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -920,7 +920,7 @@ int place_monster(mgen_data mg, bool force_pos)
}
// Message to player from stairwell/gate appearance.
- if (observe_cell(mg.pos) && mg.proximity == PROX_NEAR_STAIRS)
+ if (you.see_cell(mg.pos) && mg.proximity == PROX_NEAR_STAIRS)
{
std::string msg;
@@ -2743,7 +2743,7 @@ int create_monster(mgen_data mg, bool fail_msg)
// Determine whether creating a monster is successful (summd != -1) {dlb}:
// then handle the outcome. {dlb}:
- if (fail_msg && summd == -1 && observe_cell(mg.pos))
+ if (fail_msg && summd == -1 && you.see_cell(mg.pos))
mpr("You see a puff of smoke.");
// The return value is either -1 (failure of some sort)
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index d507a7d7f8..c9d389fddc 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -485,7 +485,7 @@ int place_monster_corpse(const monsters *monster, bool silent,
// Don't care if 'o' is changed, and it shouldn't be (corpses don't
// stack).
move_item_to_grid(&o, monster->pos());
- if (observe_cell(monster->pos()))
+ if (you.see_cell(monster->pos()))
{
if (force && !silent)
{
@@ -2042,7 +2042,7 @@ int monster_die(monsters *monster, killer_type killer,
monster->foe = killer_index;
}
- if (!silent && !wizard && observe_cell(monster->pos()))
+ if (!silent && !wizard && you.see_cell(monster->pos()))
{
// Make sure that the monster looks dead.
if (monster->alive() && !in_transit && (!summoned || duration > 0))
@@ -2158,7 +2158,7 @@ int monster_die(monsters *monster, killer_type killer,
monster_cleanup(monster);
// Force redraw for monsters that die.
- if (observe_cell(mwhere))
+ if (you.see_cell(mwhere))
{
view_update_at(mwhere);
update_screen();
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index d891ed2b50..d175381d19 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3083,7 +3083,7 @@ std::string do_mon_str_replacements(const std::string &in_msg,
msg = replace_all(msg, "@The_monster@", "Your @the_monster@");
}
- if (observe_cell(monster->pos()))
+ if (you.see_cell(monster->pos()))
{
dungeon_feature_type feat = grd(monster->pos());
if (feat < DNGN_MINMOVE || feat >= NUM_FEATURES)
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index d82093bee9..4d574000e8 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -4980,7 +4980,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
// If you are no longer dying, you must be dead.
if (decay_enchantment(me))
{
- if (observe_cell(position))
+ if (you.see_cell(position))
{
mprf("A nearby %s withers and dies.",
this->name(DESC_PLAIN, false).c_str());
@@ -5023,7 +5023,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
env.mons[rc].behaviour = BEH_WANDER;
env.mons[rc].number = 20;
- if (observe_cell(adjacent) && observe_cell(pos()))
+ if (you.see_cell(adjacent) && you.see_cell(pos()))
mpr("A ballistomycete spawns a giant spore.");
deactivate_ballistos();
@@ -5429,8 +5429,8 @@ bool monsters::has_action_energy() const
void monsters::check_redraw(const coord_def &old) const
{
- const bool see_new = observe_cell(pos());
- const bool see_old = observe_cell(old);
+ const bool see_new = you.see_cell(pos());
+ const bool see_old = you.see_cell(old);
if ((see_new || see_old) && !view_update())
{
if (see_new)
@@ -5495,7 +5495,7 @@ void monsters::apply_location_effects(const coord_def &oldpos)
if (genus == MONS_JELLY || genus == MONS_GIANT_SLUG)
{
prop &= ~FPROP_BLOODY;
- if (observe_cell(pos()) && !visible_to(&you))
+ if (you.see_cell(pos()) && !visible_to(&you))
{
std::string desc =
feature_description(pos(), false, DESC_NOCAP_THE, false);
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index b3912a3e1f..d2ae6e0de7 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -573,7 +573,7 @@ bool expose_items_to_element(beam_type flavour, const coord_def& where,
if (flavour == BEAM_STEAL_FOOD)
return (true);
- if (observe_cell(where))
+ if (you.see_cell(where))
{
switch (target_class)
{
diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc
index 09812deac3..ca595e2ff8 100644
--- a/crawl-ref/source/show.cc
+++ b/crawl-ref/source/show.cc
@@ -216,6 +216,6 @@ void show_def::init()
const coord_def &lr = crawl_view.glos2; // Lower right
for (rectangle_iterator ri(ul, lr); ri; ++ri)
- if (observe_cell(*ri))
+ if (you.see_cell(*ri))
update_at(*ri, grid2show(*ri));
}
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 9ba939477d..da3b065aea 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -434,8 +434,8 @@ void cast_chain_lightning(int pow, const actor *caster)
}
}
- const bool see_source = observe_cell( source );
- const bool see_targ = observe_cell( target );
+ const bool see_source = you.see_cell( source );
+ const bool see_targ = you.see_cell( target );
if (target.x == -1)
{
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index a14535c98f..246fda1f8a 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -950,7 +950,7 @@ static bool _raise_remains(const coord_def &pos, int corps, beh_type beha,
// Headless hydras cannot be raised, sorry.
if (zombie_type == MONS_HYDRA && number == 0)
{
- if (observe_cell(pos))
+ if (you.see_cell(pos))
{
mpr("The zero-headed hydra corpse sways and immediately "
"collapses!");
@@ -1047,7 +1047,7 @@ int animate_remains(const coord_def &a, corpse_type class_allowed,
: "attack");
}
- if (!quiet && observe_cell(a))
+ if (!quiet && you.see_cell(a))
mpr("The dead are walking!");
if (was_butchering)
@@ -1087,7 +1087,7 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting,
actual, true) > 0)
{
number_raised++;
- if (observe_cell(*ri))
+ if (you.see_cell(*ri))
number_seen++;
}
}
@@ -1755,7 +1755,7 @@ bool remove_sanctuary(bool did_attack)
if (is_sanctuary(*ri))
{
_remove_sanctuary_property(*ri);
- if (observe_cell(*ri))
+ if (you.see_cell(*ri))
seen_change = true;
}
}
@@ -1812,7 +1812,7 @@ void decrease_sanctuary_radius()
if (!size)
{
_remove_sanctuary_property(env.sanctuary_pos);
- if (observe_cell(env.sanctuary_pos))
+ if (you.see_cell(env.sanctuary_pos))
mpr("The sanctuary disappears.", MSGCH_DURATION);
}
}
@@ -1863,7 +1863,7 @@ bool cast_sanctuary(const int power)
continue;
const coord_def pos = *ri;
- if (testbits(env.pgrid(pos), FPROP_BLOODY) && observe_cell(pos))
+ if (testbits(env.pgrid(pos), FPROP_BLOODY) && you.see_cell(pos))
blood_count++;
if (trap_def* ptrap = find_trap(pos))
@@ -1944,7 +1944,7 @@ bool cast_sanctuary(const int power)
if (!is_harmless_cloud(cloud_type_at(pos)))
{
delete_cloud(env.cgrid(pos));
- if (observe_cell(pos))
+ if (you.see_cell(pos))
cloud_count++;
}
} // radius loop
@@ -2043,7 +2043,7 @@ bool project_noise(void)
if (success)
{
mprf(MSGCH_SOUND, "You hear a %svoice call your name.",
- (!observe_cell(pos) ? "distant " : "") );
+ (!you.see_cell(pos) ? "distant " : "") );
}
else
mprf(MSGCH_SOUND, "You hear a dull thud.");
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 86d344f25d..83840ea20d 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -224,7 +224,7 @@ static int _shatter_walls(coord_def where, int pow, int, actor *)
switch (grid)
{
case DNGN_SECRET_DOOR:
- if (observe_cell(where))
+ if (you.see_cell(where))
mpr("A secret door shatters!");
chance = 100;
break;
@@ -232,7 +232,7 @@ static int _shatter_walls(coord_def where, int pow, int, actor *)
case DNGN_CLOSED_DOOR:
case DNGN_DETECTED_SECRET_DOOR:
case DNGN_OPEN_DOOR:
- if (observe_cell(where))
+ if (you.see_cell(where))
mpr("A door shatters!");
chance = 100;
break;
diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc
index 734da875af..d2a9ee44e6 100644
--- a/crawl-ref/source/state.cc
+++ b/crawl-ref/source/state.cc
@@ -227,7 +227,7 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai,
fs.add_glyph( mon );
fs.cprintf(") in view: (%d,%d), see_cell: %s",
mon->pos().x, mon->pos().y,
- observe_cell(mon->pos())? "yes" : "no");
+ you.see_cell(mon->pos())? "yes" : "no");
formatted_mpr(fs, MSGCH_WARN);
#endif
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 45ea54fafe..8e757aade9 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -723,7 +723,7 @@ void dungeon_terrain_changed(const coord_def &pos,
unnotice_feature(level_pos(level_id::current(), pos));
grd(pos) = nfeat;
env.grid_colours(pos) = BLACK;
- if (is_notable_terrain(nfeat) && observe_cell(pos))
+ if (is_notable_terrain(nfeat) && you.see_cell(pos))
seen_notable_thing(nfeat, pos);
// Don't destroy a trap which was just placed.
@@ -746,7 +746,7 @@ static void _announce_swap_real(coord_def orig_pos, coord_def dest_pos)
const std::string orig_name =
feature_description(dest_pos, false,
- observe_cell(orig_pos) ? DESC_CAP_THE : DESC_CAP_A,
+ you.see_cell(orig_pos) ? DESC_CAP_THE : DESC_CAP_A,
false);
std::string prep = feat_preposition(orig_feat, false);
@@ -770,13 +770,13 @@ static void _announce_swap_real(coord_def orig_pos, coord_def dest_pos)
std::ostringstream str;
str << orig_name << " ";
- if (observe_cell(orig_pos) && !observe_cell(dest_pos))
+ if (you.see_cell(orig_pos) && !you.see_cell(dest_pos))
{
str << "suddenly disappears";
if (!orig_actor.empty())
str << " from " << prep << " " << orig_actor;
}
- else if (!observe_cell(orig_pos) && observe_cell(dest_pos))
+ else if (!you.see_cell(orig_pos) && you.see_cell(dest_pos))
{
str << "suddenly appears";
if (!dest_actor.empty())
@@ -796,7 +796,7 @@ static void _announce_swap_real(coord_def orig_pos, coord_def dest_pos)
static void _announce_swap(coord_def pos1, coord_def pos2)
{
- if (!observe_cell(pos1) && !observe_cell(pos2))
+ if (!you.see_cell(pos1) && !you.see_cell(pos2))
return;
const dungeon_feature_type feat1 = grd(pos1);
@@ -805,8 +805,8 @@ static void _announce_swap(coord_def pos1, coord_def pos2)
if (feat1 == feat2)
return;
- const bool notable_seen1 = is_notable_terrain(feat1) && observe_cell(pos1);
- const bool notable_seen2 = is_notable_terrain(feat2) && observe_cell(pos2);
+ const bool notable_seen1 = is_notable_terrain(feat1) && you.see_cell(pos1);
+ const bool notable_seen2 = is_notable_terrain(feat2) && you.see_cell(pos2);
coord_def orig_pos, dest_pos;
if (notable_seen1 && notable_seen2)
@@ -818,7 +818,7 @@ static void _announce_swap(coord_def pos1, coord_def pos2)
_announce_swap_real(pos2, pos1);
else if (notable_seen2)
_announce_swap_real(pos1, pos2);
- else if (observe_cell(pos2))
+ else if (you.see_cell(pos2))
_announce_swap_real(pos1, pos2);
else
_announce_swap_real(pos2, pos1);
@@ -836,13 +836,13 @@ bool swap_features(const coord_def &pos1, const coord_def &pos2,
const dungeon_feature_type feat1 = grd(pos1);
const dungeon_feature_type feat2 = grd(pos2);
- if (is_notable_terrain(feat1) && !observe_cell(pos1)
+ if (is_notable_terrain(feat1) && !you.see_cell(pos1)
&& is_terrain_known(pos1))
{
return (false);
}
- if (is_notable_terrain(feat2) && !observe_cell(pos2)
+ if (is_notable_terrain(feat2) && !you.see_cell(pos2)
&& is_terrain_known(pos2))
{
return (false);
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 561d790dd1..411e01a9c9 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -2995,7 +2995,7 @@ static inline void _finalise_tile(unsigned int *tile,
else if (orig < TILE_DNGN_MAX)
{
// Some tiles may change from turn to turn, but only if in view.
- if (orig >= TILE_DNGN_LAVA && orig < TILE_BLOOD && observe_cell(gc))
+ if (orig >= TILE_DNGN_LAVA && orig < TILE_BLOOD && you.see_cell(gc))
env.tile_flv(gc).special = random2(256);
(*tile) = orig + (special_flv % tile_dngn_count(orig));
@@ -4535,7 +4535,7 @@ void tile_draw_floor()
const coord_def gc = show2grid(ep);
int bg = TILE_DNGN_UNSEEN | tile_unseen_flag(gc);
- if (observe_cell(gc))
+ if (you.see_cell(gc))
{
dungeon_feature_type feat = grid_appearance(gc);
bg = tileidx_feature(feat, gc.x, gc.y);
@@ -4766,7 +4766,7 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy)
if (you.halo_contains(gc))
{
monsters *mon = monster_at(gc);
- if (observe_cell(gc) && mon)
+ if (you.see_cell(gc) && mon)
{
if (!mons_class_flag(mon->type, M_NO_EXP_GAIN)
&& (!mons_is_mimic(mon->type)
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 4ddabc8b67..76ff924364 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -966,7 +966,7 @@ void DungeonRegion::pack_buffers()
}
pack_cursor(CURSOR_TUTORIAL, TILE_TUTORIAL_CURSOR);
- pack_cursor(CURSOR_MOUSE, observe_cell(m_cursor[CURSOR_MOUSE]) ? TILE_CURSOR
+ pack_cursor(CURSOR_MOUSE, you.see_cell(m_cursor[CURSOR_MOUSE]) ? TILE_CURSOR
: TILE_CURSOR2);
if (m_cursor[CURSOR_TUTORIAL] != NO_CURSOR
@@ -1492,7 +1492,7 @@ bool DungeonRegion::update_alt_text(std::string &alt)
return (false);
describe_info inf;
- if (observe_cell(gc))
+ if (you.see_cell(gc))
get_square_desc(gc, inf, true);
else if (grd(gc) != DNGN_FLOOR)
get_feature_desc(gc, inf);
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 47b245f71d..18e601e1c6 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -312,7 +312,7 @@ void check_net_will_hold_monster(monsters *mons)
if (net != NON_ITEM)
destroy_item(net);
- if (observe_cell(mons->pos()))
+ if (you.see_cell(mons->pos()))
{
if (mons->visible_to(&you))
{
@@ -352,7 +352,7 @@ void trap_def::trigger(actor& triggerer, bool flat_footed)
const bool trig_knows = !flat_footed && this->is_known(&triggerer);
const bool you_trigger = (triggerer.atype() == ACT_PLAYER);
- const bool in_sight = observe_cell(this->pos);
+ const bool in_sight = you.see_cell(this->pos);
// If set, the trap will be removed at the end of the
// triggering process.
@@ -1140,7 +1140,7 @@ void trap_def::shoot_ammo(actor& act, bool was_known)
{
if (was_known && act.atype() == ACT_PLAYER)
mpr("The trap is out of ammunition!");
- else if (player_can_hear(this->pos) && observe_cell(this->pos))
+ else if (player_can_hear(this->pos) && you.see_cell(this->pos))
mpr("You hear a soft click.");
this->disarm();
@@ -1229,7 +1229,7 @@ void trap_def::shoot_ammo(actor& act, bool was_known)
// Determine whether projectile hits.
bool hit = (trap_hit >= act.melee_evasion(NULL));
- if (observe_cell(act.pos()))
+ if (you.see_cell(act.pos()))
{
mprf("%s %s %s%s!",
shot.name(DESC_CAP_A).c_str(),
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 7756df3d32..d9bff577fe 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -938,7 +938,7 @@ void viewwindow(bool do_updates)
{
draw_player(&buffy[bufcount], gc, ep);
}
- else if (observe_cell(gc))
+ else if (you.see_cell(gc))
draw_los(&buffy[bufcount], gc, ep);
else
draw_los_backup(&buffy[bufcount], gc, ep);
@@ -947,7 +947,7 @@ void viewwindow(bool do_updates)
if (flash_colour)
{
#ifndef USE_TILE
- buffy[bufcount + 1] = observe_cell(gc) ? real_colour(flash_colour)
+ buffy[bufcount + 1] = you.see_cell(gc) ? real_colour(flash_colour)
: DARKGREY;
#endif
}
@@ -956,7 +956,7 @@ void viewwindow(bool do_updates)
bool out_of_range = Options.target_range > 0
&& (grid_distance(you.pos(), gc) > Options.target_range);
#ifndef USE_TILE
- if (!observe_cell(gc) || out_of_range)
+ if (!you.see_cell(gc) || out_of_range)
buffy[bufcount + 1] = DARKGREY;
#else
if (out_of_range)
diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc
index 3369147e66..361d61034f 100644
--- a/crawl-ref/source/viewmap.cc
+++ b/crawl-ref/source/viewmap.cc
@@ -50,7 +50,7 @@ unsigned get_magicmap_char(dungeon_feature_type feat)
// 5. Anything else will look for the exact same character in the level map.
bool is_feature(int feature, const coord_def& where)
{
- if (!env.map_knowledge(where).object && !observe_cell(where))
+ if (!env.map_knowledge(where).object && !you.see_cell(where))
return (false);
dungeon_feature_type grid = grd(where);
@@ -1118,7 +1118,7 @@ screen_buffer_t colour_code_map(const coord_def& p, bool item_colour,
#endif
dungeon_feature_type feat_value = grd(p);
- if (!observe_cell(p))
+ if (!you.see_cell(p))
{
const show_type remembered = get_map_knowledge_obj(p);
if (remembered.cls == SH_FEATURE)