From ceb51161c896f17a951b0ba2bbd4b48f8fead13a Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 6 Nov 2009 20:39:11 +0100 Subject: Replace global see_cell by observe_cell and disambiguate old uses. Calls to plain see_cell(pos) were replaced with either observe_cell(pos) or you.see_cell(pos). observe_cell where related to drawing the interface and messaging, you.see_cell for game mechanics, and one or the other in less clear cases (targetting, say). --- crawl-ref/source/acr.cc | 2 +- crawl-ref/source/beam.cc | 48 ++++++++++++++++++++++---------------------- crawl-ref/source/cloud.cc | 2 +- crawl-ref/source/coordit.cc | 2 +- crawl-ref/source/directn.cc | 14 ++++++------- crawl-ref/source/dungeon.cc | 2 +- crawl-ref/source/effects.cc | 8 ++++---- crawl-ref/source/fight.cc | 10 ++++----- crawl-ref/source/l_you.cc | 4 ++-- crawl-ref/source/los.cc | 7 ++++--- crawl-ref/source/los.h | 17 +--------------- crawl-ref/source/mon-act.cc | 16 +++++++-------- crawl-ref/source/mon-behv.cc | 4 ++-- crawl-ref/source/mon-cast.cc | 4 ++-- crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/monplace.cc | 4 ++-- crawl-ref/source/monster.cc | 10 ++++----- crawl-ref/source/monstuff.cc | 8 ++++---- crawl-ref/source/ouch.cc | 2 +- crawl-ref/source/player.cc | 5 +++-- crawl-ref/source/religion.cc | 4 ++-- crawl-ref/source/show.cc | 2 +- crawl-ref/source/spells1.cc | 4 ++-- crawl-ref/source/spells2.cc | 12 +++++------ crawl-ref/source/spells3.cc | 22 ++++++++++---------- crawl-ref/source/spells4.cc | 4 ++-- crawl-ref/source/stash.cc | 2 +- crawl-ref/source/state.cc | 2 +- crawl-ref/source/teleport.cc | 4 ++-- crawl-ref/source/terrain.cc | 20 +++++++++--------- crawl-ref/source/tilepick.cc | 4 ++-- crawl-ref/source/tilereg.cc | 6 +++--- crawl-ref/source/traps.cc | 8 ++++---- crawl-ref/source/travel.cc | 2 +- crawl-ref/source/tutorial.cc | 2 +- crawl-ref/source/view.cc | 14 ++++++------- crawl-ref/source/viewmap.cc | 4 ++-- crawl-ref/source/xom.cc | 14 ++++++------- 38 files changed, 144 insertions(+), 157 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index e31464f555..5ed7364a32 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1941,7 +1941,7 @@ void process_command( command_type cmd ) } else if (cme.right_clicked()) { - if (see_cell(dest)) + if (observe_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 7d20454b35..afede6aa9d 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -149,7 +149,7 @@ static void _zap_animation(int colour, const monsters *mon = NULL, p = mon->pos(); } - if (!see_cell(p)) + if (!observe_cell(p)) return; const coord_def drawp = grid2view(p); @@ -1579,7 +1579,7 @@ void bolt::initialise_fire() message_cache.clear(); // seen might be set by caller to supress this. - if (!seen && see_cell(source) && range > 0 && !invisible() ) + if (!seen && observe_cell(source) && range > 0 && !invisible() ) { seen = true; const monsters* mon = monster_at(source); @@ -1597,7 +1597,7 @@ void bolt::initialise_fire() // Visible self-targeted beams are always seen, even though they don't // leave a path. - if (see_cell(source) && target == source && !invisible()) + if (observe_cell(source) && target == source && !invisible()) seen = true; // Scale draw_delay to match change in arena_delay. @@ -1650,7 +1650,7 @@ void bolt::choose_ray() // Draw the bolt at p if needed. void bolt::draw(const coord_def& p) { - if (is_tracer || is_enchantment() || !see_cell(p)) + if (is_tracer || is_enchantment() || !observe_cell(p)) return; // We don't clean up the old position. @@ -1772,7 +1772,7 @@ void bolt::fire_wall_effect() // No actual effect. if (flavour != BEAM_HELLFIRE && feat == DNGN_WAX_WALL) { - if (see_cell(pos())) + if (observe_cell(pos())) { emit_message(MSGCH_PLAIN, "The wax appears to soften slightly."); @@ -1785,7 +1785,7 @@ void bolt::fire_wall_effect() { // Destroy the wall. grd(pos()) = DNGN_FLOOR; - if (see_cell(pos())) + if (observe_cell(pos())) emit_message(MSGCH_PLAIN, "The wax bubbles and burns!"); else if (player_can_smell()) emit_message(MSGCH_PLAIN, "You smell burning wax."); @@ -1799,7 +1799,7 @@ void bolt::fire_wall_effect() { // Destroy the wall. grd(pos()) = DNGN_FLOOR; - if (see_cell(pos())) + if (observe_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."); @@ -1850,7 +1850,7 @@ void bolt::nuke_wall_effect() if (player_can_hear(pos())) { - if (!see_cell(pos())) + if (!observe_cell(pos())) mpr("You hear a hideous screaming!", MSGCH_SOUND); else { @@ -1858,7 +1858,7 @@ void bolt::nuke_wall_effect() MSGCH_SOUND); } } - else if (see_cell(pos())) + else if (observe_cell(pos())) mpr("The idol twists and shakes as its substance crumbles away!"); if (beam_source == NON_MONSTER) @@ -1906,7 +1906,7 @@ void bolt::hit_wall() if (is_tracer && YOU_KILL(thrower) && in_bounds(target) && !passed_target && pos() != target && pos() != source && foe_info.count == 0 && flavour != BEAM_DIGGING && flavour <= BEAM_LAST_REAL - && bounces == 0 && reflections == 0 && see_cell(target) + && bounces == 0 && reflections == 0 && you.see_cell(target) && !feat_is_solid(grd(target))) { // Okay, with all those tests passed, this is probably an instance @@ -2176,7 +2176,7 @@ void bolt::do_fire() || is_tracer && affects_wall(grd(pos()))); const bool was_seen = seen; - if (!was_seen && range > 0 && !invisible() && see_cell(pos())) + if (!was_seen && range > 0 && !invisible() && observe_cell(pos())) seen = true; if (flavour != BEAM_VISUAL && !was_seen && seen && !is_tracer) @@ -3044,7 +3044,7 @@ void bolt::drop_object() // Summoned creatures' thrown items disappear. if (item->flags & ISFLAG_SUMMONED) { - if (see_cell(pos())) + if (observe_cell(pos())) { mprf("%s %s!", item->name(DESC_CAP_THE).c_str(), @@ -3113,7 +3113,7 @@ void bolt::affect_ground() MHITNOT, MG_FORCE_PLACE)); - if (rc != -1 && see_cell(pos())) + if (rc != -1 && observe_cell(pos())) mpr("A fungus suddenly grows."); } @@ -4317,7 +4317,7 @@ bool bolt::determine_damage(monsters* mon, int& preac, int& postac, int& final, // Electricity is ineffective. if (flavour == BEAM_ELECTRICITY) { - if (!is_tracer && see_cell(mon->pos())) + if (!is_tracer && observe_cell(mon->pos())) mprf("The %s arcs harmlessly into the water.", name.c_str()); finish_beam(); return (false); @@ -4417,8 +4417,8 @@ void bolt::tracer_nonenchantment_affect_monster(monsters* mon) void bolt::tracer_affect_monster(monsters* mon) { // Ignore unseen monsters. - if (!can_see_invis && mon->invisible() - || (YOU_KILL(thrower) && !see_cell(mon->pos()))) + if (!mon->visible_to(&you) + || (YOU_KILL(thrower) && !you.see_cell(mon->pos()))) { return; } @@ -4578,7 +4578,7 @@ bool bolt::attempt_block(monsters* mon) shield->name(DESC_PLAIN).c_str()); _ident_reflector(shield); } - else if (see_cell(pos())) + else if (observe_cell(pos())) mprf("The %s bounces off of thin air!", name.c_str()); reflect(); @@ -4608,7 +4608,7 @@ bool bolt::handle_statue_disintegration(monsters* mon) // Disintegrate the statue. if (!silenced(you.pos())) { - if (!see_cell(mon->pos())) + if (!observe_cell(mon->pos())) mpr("You hear a hideous screaming!", MSGCH_SOUND); else { @@ -4616,7 +4616,7 @@ bool bolt::handle_statue_disintegration(monsters* mon) MSGCH_SOUND); } } - else if (see_cell(mon->pos())) + else if (observe_cell(mon->pos())) { mpr("The statue twists and shakes as its substance " "crumbles away!"); @@ -5493,7 +5493,7 @@ void bolt::refine_for_explosion() { heard = player_can_hear(target); // Check for see/hear/no msg. - if (see_cell(target) || target == you.pos()) + if (observe_cell(target) || target == you.pos()) mpr(seeMsg); else { @@ -5559,7 +5559,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle) if (is_sanctuary(pos())) { - if (!is_tracer && see_cell(pos()) && !name.empty()) + if (!is_tracer && observe_cell(pos()) && !name.empty()) { mprf(MSGCH_GOD, "By Zin's power, the %s is contained.", name.c_str()); @@ -5581,7 +5581,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() && !you.see_cell(pos())) + if (heard_expl && !noise_msg.empty() && !observe_cell(pos())) mprf(MSGCH_SOUND, "%s", noise_msg.c_str()); } @@ -5647,7 +5647,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle) if (exp_map(delta + centre) < INT_MAX) { - if (see_cell(delta + pos())) + if (observe_cell(delta + pos())) ++cells_seen; explosion_affect_cell(delta + pos()); @@ -5679,7 +5679,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle) void bolt::explosion_draw_cell(const coord_def& p) { - if (see_cell(p)) + if (observe_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 c6b1b5aa09..12c64462cb 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -156,7 +156,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 (see_cell(*ai)) + if (observe_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/coordit.cc b/crawl-ref/source/coordit.cc index b93b4aad98..52593eda76 100644 --- a/crawl-ref/source/coordit.cc +++ b/crawl-ref/source/coordit.cc @@ -128,7 +128,7 @@ bool radius_iterator::on_valid_square() const return (false); if (require_los) { - if (!losgrid && !see_cell(location)) + if (!losgrid && !you.see_cell(location)) return (false); if (losgrid && !see_cell(*losgrid, center, location)) return (false); diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index abd2fc1b13..a182b19556 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -308,7 +308,7 @@ static bool _mon_submerged_in_water(const monsters *mon) return (false); return (grd(mon->pos()) == DNGN_SHALLOW_WATER - && see_cell(mon->pos()) + && you.see_cell(mon->pos()) && !mon->visible_to(&you) && !mons_flies(mon)); } @@ -390,7 +390,7 @@ static void _direction_again(dist& moves, targetting_type restricts, if (you.prev_grd_targ != coord_def(0, 0)) { - if (!see_cell(you.prev_grd_targ)) + if (!you.see_cell(you.prev_grd_targ)) { moves.isCancel = true; @@ -924,7 +924,7 @@ bool _dist_ok(const dist& moves, int range, targ_mode_type mode, { if (!moves.isCancel && moves.isTarget) { - if (!see_cell(moves.target)) + if (!you.see_cell(moves.target)) { mpr("Sorry, you can't target what you can't see.", MSGCH_EXAMINE_FILTER); @@ -1773,7 +1773,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 (!see_cell(gc)) + else if (!observe_cell(gc)) { if (is_terrain_seen(gc)) { @@ -1809,7 +1809,7 @@ std::string get_terse_square_desc(const coord_def &gc) void terse_describe_square(const coord_def &c, bool in_range) { - if (!see_cell(c)) + if (!observe_cell(c)) _describe_oos_square(c); else if (in_bounds(c) ) _describe_cell(c, in_range); @@ -1821,7 +1821,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 (!see_cell(c)) + if (!observe_cell(c)) return; const monsters* mons = monster_at(c); @@ -1864,7 +1864,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 (!see_cell(c)) + if (!observe_cell(c)) return; const monsters* mons = monster_at(c); diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 997d571e6d..d818a7f5ea 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4293,7 +4293,7 @@ bool dgn_place_map(const map_def *mdef, bool clobber, bool make_no_exits, for (int i = 0, size = markers.size(); i < size; ++i) markers[i]->activate(); - if (!see_cell(x, y)) + if (!you.see_cell(coord_def(x, y))) set_terrain_changed(x, y); } diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index ca1839fd75..feabc71add 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -4335,7 +4335,7 @@ int place_ring(std::vector &ring_points, if (mushroom != -1) { spawned_count++; - if (see_cell(ring_points.at(i))) + if (observe_cell(ring_points.at(i))) seen_count++; } } @@ -4522,7 +4522,7 @@ int spawn_corpse_mushrooms(item_def &corpse, { corpse.special = 0; - if (see_cell(corpse.pos)) + if (observe_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."); @@ -4593,7 +4593,7 @@ int spawn_corpse_mushrooms(item_def &corpse, } placed_targets++; - if (see_cell(current)) + if (observe_cell(current)) seen_targets++; } else @@ -4701,7 +4701,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, see_cell(corpse.pos) ? 1 : 0); + mushroom_spawn_message(seen_spawns, observe_cell(corpse.pos) ? 1 : 0); } //--------------------------------------------------------------- diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 29715af093..d1b2549c27 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -395,10 +395,10 @@ void melee_attack::init_attack() water_attack = is_water_attack(attacker, defender); attacker_visible = attacker->observable(); - attacker_invisible = (!attacker_visible && see_cell(attacker->pos())); + attacker_invisible = (!attacker_visible && observe_cell(attacker->pos())); defender_visible = defender && defender->observable(); defender_invisible = (!defender_visible && defender - && see_cell(defender->pos())); + && observe_cell(defender->pos())); needs_message = (attacker_visible || defender_visible); if (defender && defender->atype() == ACT_MONSTER) @@ -1912,7 +1912,7 @@ bool melee_attack::player_monattk_final_hit_effects(bool mondied) switch (final_effects[i].flavor) { case FINEFF_LIGHTNING_DISCHARGE: - if (see_cell(final_effects[i].location)) + if (observe_cell(final_effects[i].location)) mpr("Electricity arcs through the water!"); conduct_electricity(final_effects[i].location, attacker); break; @@ -2366,7 +2366,7 @@ void melee_attack::chaos_affects_defender() miscast_chance *= 2; // Inform player that something is up. - if (see_cell(defender->pos())) + if (observe_cell(defender->pos())) { if (defender->atype() == ACT_PLAYER) mpr("You give off a flash of multicoloured light!"); @@ -2602,7 +2602,7 @@ static bool _move_stairs(const actor* attacker, const actor* defender) // Don't move around notable terrain the player is aware of if it's // out of sight. if (is_notable_terrain(stair_feat) - && is_terrain_known(orig_pos.x, orig_pos.y) && !see_cell(orig_pos)) + && is_terrain_known(orig_pos.x, orig_pos.y) && !you.see_cell(orig_pos)) { return (false); } diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc index 836c82b508..70d165ee0d 100644 --- a/crawl-ref/source/l_you.cc +++ b/crawl-ref/source/l_you.cc @@ -226,9 +226,9 @@ LUARET1(you_y_pos, number, you.pos().y) LUARET2(you_pos, number, you.pos().x, you.pos().y) LUARET1(you_see_cell, boolean, - see_cell(luaL_checkint(ls, 1), luaL_checkint(ls, 2))) + you.see_cell(coord_def(luaL_checkint(ls, 1), luaL_checkint(ls, 2)))) LUARET1(you_see_cell_no_trans, boolean, - see_cell_no_trans(luaL_checkint(ls, 1), luaL_checkint(ls, 2))) + see_cell_no_trans(coord_def(luaL_checkint(ls, 1), luaL_checkint(ls, 2)))) LUAFN(you_moveto) { diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 5d93a9ef90..543e71b0de 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -1031,8 +1031,9 @@ bool see_cell(const env_show_grid &show, return (false); } -// Answers the question: "Is a cell within character's line of sight?" -bool see_cell(const coord_def &p) +// Answers the question: Is the cell visible to the observer? +// Usually the same as player LOS. +bool observe_cell(const coord_def &p) { return (((crawl_state.arena || crawl_state.arena_suspended) && crawl_view.in_grid_los(p)) @@ -1049,5 +1050,5 @@ bool see_cell_no_trans(const coord_def &p) // Is the cell visible, but a translucent wall is in the way? bool trans_wall_blocking(const coord_def &p) { - return see_cell(p) && !see_cell_no_trans(p); + return you.see_cell(p) && !see_cell_no_trans(p); } diff --git a/crawl-ref/source/los.h b/crawl-ref/source/los.h index eec4d13909..441ec0c0d1 100644 --- a/crawl-ref/source/los.h +++ b/crawl-ref/source/los.h @@ -71,23 +71,8 @@ void calc_show_los(); bool see_cell(const env_show_grid &show, const coord_def &c, const coord_def &pos ); -bool see_cell(const coord_def &p); +bool observe_cell(const coord_def &p); bool see_cell_no_trans( const coord_def &p ); bool trans_wall_blocking( const coord_def &p ); -inline bool see_cell(int grx, int gry) -{ - return see_cell(coord_def(grx, gry)); -} - -inline bool see_cell_no_trans(int x, int y) -{ - return see_cell_no_trans(coord_def(x, y)); -} - -inline bool trans_wall_blocking(int x, int y) -{ - return trans_wall_blocking(coord_def(x, y)); -} - #endif diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 03b8c1eed9..088774e2a1 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -653,7 +653,7 @@ static void _handle_movement(monsters *monster) } // We're already staying in the player's LOS. - if (see_cell(old_pos + mmov)) + if (you.see_cell(old_pos + mmov)) return; // Try to find a move that brings us closer to the player while @@ -671,7 +671,7 @@ static void _handle_movement(monsters *monster) delta.set(i - 1, j - 1); coord_def tmp = old_pos + delta; - if (grid_distance(you.pos(), tmp) < old_dist && see_cell(tmp)) + if (grid_distance(you.pos(), tmp) < old_dist && you.see_cell(tmp)) { if (one_chance_in(++matches)) mmov = delta; @@ -2632,13 +2632,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 && see_cell(dc)) + if (grd(dc) == DNGN_SECRET_DOOR && observe_cell(dc)) { grid = grid_secret_door_appearance(dc); was_secret = true; } - if (see_cell(dc)) + if (observe_cell(dc)) was_seen = true; else set_terrain_changed(dc); @@ -2813,7 +2813,7 @@ static bool _mon_can_move_to_pos(const monsters *monster, } // Wandering mushrooms don't move while you are looking. - if (monster->type == MONS_WANDERING_MUSHROOM && see_cell(targ)) + if (monster->type == MONS_WANDERING_MUSHROOM && you.see_cell(targ)) return (false); // Water elementals avoid fire and heat. @@ -3070,10 +3070,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 && !see_cell(f)) + if (monster->seen_context == _just_seen && !observe_cell(f)) simple_monster_message(monster, " moves out of view."); else if (Options.tutorial_left && (monster->flags & MF_WAS_IN_VIEW) - && !see_cell(f)) + && !observe_cell(f)) { learned_something_new(TUT_MONSTER_LEFT_LOS, monster->pos()); } @@ -3274,7 +3274,7 @@ static bool _monster_move(monsters *monster) _jelly_grows(monster); - if (see_cell(newpos)) + if (observe_cell(newpos)) { viewwindow(true, false); diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc index 62b3a68a82..cf65f76b01 100644 --- a/crawl-ref/source/mon-behv.cc +++ b/crawl-ref/source/mon-behv.cc @@ -1788,7 +1788,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, // XXX: Should this be done in _handle_behaviour()? if (src == MHITYOU && src_pos == you.pos() - && !see_cell(mon->pos())) + && !you.see_cell(mon->pos())) { const dungeon_feature_type can_move = (mons_amphibious(mon)) ? DNGN_DEEP_WATER @@ -1839,7 +1839,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, else if (mon->friendly() && !crawl_state.arena) mon->foe = MHITYOU; - if (see_cell(mon->pos())) + if (observe_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 25d217e1dc..1878967d44 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -2085,7 +2085,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 || see_cell(foe->pos())); + const bool need_more = foe && (foe == &you || observe_cell(foe->pos())); pbolt.in_explosion_phase = false; pbolt.explode(need_more); } @@ -2323,7 +2323,7 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast) { target = "DEAD FOE"; } - else if (in_bounds(pbolt.target) && see_cell(pbolt.target)) + else if (in_bounds(pbolt.target) && observe_cell(pbolt.target)) { if (const monsters* mtarg = monster_at(pbolt.target)) { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 15f533452b..ba3ef8fe00 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3147,7 +3147,7 @@ std::string do_mon_str_replacements(const std::string &in_msg, msg = replace_all(msg, "@The_monster@", "Your @the_monster@"); } - if (see_cell(monster->pos())) + if (observe_cell(monster->pos())) { dungeon_feature_type feat = grd(monster->pos()); if (feat < DNGN_MINMOVE || feat >= NUM_FEATURES) diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 942e4ac4af..14451f56c1 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -918,7 +918,7 @@ int place_monster(mgen_data mg, bool force_pos) } // Message to player from stairwell/gate appearance. - if (see_cell(mg.pos) && mg.proximity == PROX_NEAR_STAIRS) + if (observe_cell(mg.pos) && mg.proximity == PROX_NEAR_STAIRS) { std::string msg; @@ -2693,7 +2693,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 && see_cell(mg.pos)) + if (fail_msg && summd == -1 && observe_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/monster.cc b/crawl-ref/source/monster.cc index 1cd5129676..27cd5113e2 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -4850,7 +4850,7 @@ void monsters::apply_enchantment(const mon_enchant &me) // If you are no longer dying, you must be dead. if (decay_enchantment(me)) { - if (::see_cell(position)) + if (observe_cell(position)) { mprf("A nearby %s withers and dies.", this->name(DESC_PLAIN, false).c_str()); @@ -4890,7 +4890,7 @@ void monsters::apply_enchantment(const mon_enchant &me) { env.mons[rc].behaviour = BEH_WANDER; - if (::see_cell(adjacent) && ::see_cell(pos())) + if (observe_cell(adjacent) && observe_cell(pos())) mpr("A nearby fungus spawns a giant spore."); } break; @@ -5245,8 +5245,8 @@ bool monsters::has_action_energy() const void monsters::check_redraw(const coord_def &old) const { - const bool see_new = ::see_cell(pos()); - const bool see_old = ::see_cell(old); + const bool see_new = observe_cell(pos()); + const bool see_old = observe_cell(old); if ((see_new || see_old) && !view_update()) { if (see_new) @@ -5300,7 +5300,7 @@ void monsters::apply_location_effects(const coord_def &oldpos) if (genus == MONS_JELLY || genus == MONS_GIANT_SLUG) { prop &= ~FPROP_BLOODY; - if (see_cell(pos()) && !visible_to(&you)) + if (observe_cell(pos()) && !visible_to(&you)) { std::string desc = feature_description(pos(), false, DESC_NOCAP_THE, false); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index c5722b2121..7a7ea35dc2 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -473,7 +473,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 (see_cell(monster->pos())) + if (observe_cell(monster->pos())) { if (force && !silent) { @@ -822,7 +822,7 @@ static bool _slime_vault_in_los() { if ((grd[x][y] == DNGN_STONE_WALL || grd[x][y] == DNGN_CLEAR_STONE_WALL) - && see_cell(x, y)) + && observe_cell(coord_def(x, y))) { in_los = true; break; @@ -1928,7 +1928,7 @@ int monster_die(monsters *monster, killer_type killer, monster->foe = killer_index; } - if (!silent && !wizard && see_cell(monster->pos())) + if (!silent && !wizard && observe_cell(monster->pos())) { // Make sure that the monster looks dead. if (monster->alive() && !in_transit && (!summoned || duration > 0)) @@ -2031,7 +2031,7 @@ int monster_die(monsters *monster, killer_type killer, monster_cleanup(monster); // Force redraw for monsters that die. - if (see_cell(mwhere)) + if (observe_cell(mwhere)) { view_update_at(mwhere); update_screen(); diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 70b6e2a9d6..f8cc5d73f9 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -564,7 +564,7 @@ bool expose_items_to_element(beam_type flavour, const coord_def& where, if (flavour == BEAM_STEAL_FOOD) return (true); - if (see_cell(where)) + if (observe_cell(where)) { switch (target_class) { diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e5e9333d51..01713f190d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2661,7 +2661,7 @@ void forget_map(unsigned char chance_forgotten, bool force) : 25*25; for (rectangle_iterator ri(0); ri; ++ri) { - if (!see_cell(*ri) + if (!you.see_cell(*ri) && (force || x_chance_in_y(chance_forgotten, 100) || use_lab_check && (you.pos()-*ri).abs() > radius)) { @@ -6905,7 +6905,8 @@ bool player::visible_to(const actor *looker) const bool player::see_cell(const coord_def &c) const { - return (::see_cell(c)); + // TODO: give player own LOS. + return (observe_cell(c)); } bool player::backlit(bool check_haloed) const diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 797cf347ef..efb602bae9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -6749,7 +6749,7 @@ int get_tension(god_type god, bool count_travelling) if (!mons->alive()) continue; - if (see_cell(mons->pos())) + if (you.see_cell(mons->pos())) { // Monster is nearby. if (!nearby_monster && !mons_wont_attack(mons)) @@ -6771,7 +6771,7 @@ int get_tension(god_type god, bool count_travelling) target = mons->target; // Monster is neither nearby nor trying to get near us. - if (!in_bounds(target) || !see_cell(target)) + if (!in_bounds(target) || !you.see_cell(target)) continue; } diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc index 6a7ab95dbc..1f1c1cc2fe 100644 --- a/crawl-ref/source/show.cc +++ b/crawl-ref/source/show.cc @@ -219,6 +219,6 @@ void show_def::init() const coord_def &lr = crawl_view.glos2; // Lower right for (rectangle_iterator ri(ul, lr); ri; ++ri) - if (see_cell(*ri)) + if (observe_cell(*ri)) update_at(*ri, grid2show(*ri)); } diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index a2ab4089cf..e3dc153adb 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -433,8 +433,8 @@ void cast_chain_lightning(int pow, const actor *caster) } } - const bool see_source = see_cell( source ); - const bool see_targ = see_cell( target ); + const bool see_source = observe_cell( source ); + const bool see_targ = observe_cell( target ); if (target.x == -1) { diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index e91d251949..bbeb789948 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -151,7 +151,7 @@ static bool _mark_detected_creature(coord_def where, const monsters *mon, // If the player would be able to see a monster at this location // don't place it there. - if (see_cell(place)) + if (you.see_cell(place)) continue; // Try not to overwrite another detected monster. @@ -1829,7 +1829,7 @@ int fungal_bloom() destroy_item(j->index()); } - if (corpse_on_pos && see_cell(*i)) + if (corpse_on_pos && observe_cell(*i)) seen_corpses++; } } @@ -1863,7 +1863,7 @@ int create_plant(coord_def & target) if (plant != -1) { env.mons[plant].flags |= MF_ATT_CHANGE_ATTEMPT; - if (see_cell(target)) + if (observe_cell(target)) mpr("A plant grows up from the ground."); } @@ -1932,7 +1932,7 @@ bool sunlight() if (grd(target) != ftype) { grd(target) = ftype; - if (see_cell(target)) + if (observe_cell(target)) evap_count++; } @@ -1967,7 +1967,7 @@ bool sunlight() MG_FORCE_PLACE, GOD_FEAWN)); - if (plant != -1 && see_cell(target)) + if (plant != -1 && observe_cell(target)) plant_count++; } } @@ -2030,7 +2030,7 @@ void path_distance(coord_def & origin, for (adjacent_iterator adj_it(current.first); adj_it; ++adj_it) { idx = adj_it->x + adj_it->y * X_WIDTH; - if (see_cell(*adj_it) + if (you.see_cell(*adj_it) && !feat_is_solid(env.grid(*adj_it)) && exclusion.insert(idx).second) { diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 6d49fae5d7..139e177bdc 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -947,7 +947,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 (see_cell(pos)) + if (observe_cell(pos)) { mpr("The zero-headed hydra corpse sways and immediately " "collapses!"); @@ -1036,7 +1036,7 @@ int animate_remains(const coord_def &a, corpse_type class_allowed, : "attack"); } - if (!quiet && see_cell(a)) + if (!quiet && observe_cell(a)) mpr("The dead are walking!"); if (was_butchering) @@ -1082,7 +1082,7 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting, actual, true) > 0) { number_raised++; - if (see_cell(*ri)) + if (observe_cell(*ri)) number_seen++; } } @@ -1513,7 +1513,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area) if (is_controlled) { - if (!see_cell(pos)) + if (!you.see_cell(pos)) large_change = true; // Merfolk should be able to control-tele into deep water. @@ -1581,9 +1581,9 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area) || need_distance_check && (newpos - centre).abs() < 34*34 || testbits(env.map(newpos).property, FPROP_NO_RTELE_INTO)); - if ( newpos == you.pos() ) + if (newpos == you.pos()) mpr("Your surroundings flicker for a moment."); - else if ( see_cell(newpos) ) + else if (you.see_cell(newpos)) mpr("Your surroundings seem slightly different."); else { @@ -1750,7 +1750,7 @@ bool remove_sanctuary(bool did_attack) if (is_sanctuary(*ri)) { _remove_sanctuary_property(*ri); - if (see_cell(*ri)) + if (observe_cell(*ri)) seen_change = true; } } @@ -1811,7 +1811,7 @@ void decrease_sanctuary_radius() if (!size) { _remove_sanctuary_property(env.sanctuary_pos); - if (see_cell(env.sanctuary_pos)) + if (observe_cell(env.sanctuary_pos)) mpr("The sanctuary disappears.", MSGCH_DURATION); } } @@ -1862,7 +1862,7 @@ bool cast_sanctuary(const int power) continue; const coord_def pos = *ri; - if (testbits(env.map(pos).property, FPROP_BLOODY) && see_cell(pos)) + if (testbits(env.map(pos).property, FPROP_BLOODY) && observe_cell(pos)) blood_count++; if (trap_def* ptrap = find_trap(pos)) @@ -1943,7 +1943,7 @@ bool cast_sanctuary(const int power) if (!is_harmless_cloud(cloud_type_at(pos))) { delete_cloud(env.cgrid(pos)); - if (see_cell(pos)) + if (observe_cell(pos)) cloud_count++; } } // radius loop @@ -2061,7 +2061,7 @@ bool project_noise(void) if (success) { mprf(MSGCH_SOUND, "You hear a %svoice call your name.", - (!see_cell( pos ) ? "distant " : "") ); + (!observe_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 f08a824b89..b9d528b703 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -223,7 +223,7 @@ static int _shatter_walls(coord_def where, int pow, int, actor *) switch (grid) { case DNGN_SECRET_DOOR: - if (see_cell(where)) + if (observe_cell(where)) mpr("A secret door shatters!"); chance = 100; break; @@ -231,7 +231,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 (see_cell(where)) + if (observe_cell(where)) mpr("A door shatters!"); chance = 100; break; diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 284659e1d9..d5f999c097 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -1548,7 +1548,7 @@ void StashTracker::update_visible_stashes( for (int cy = crawl_view.glos1.y; cy <= crawl_view.glos2.y; ++cy) for (int cx = crawl_view.glos1.x; cx <= crawl_view.glos2.x; ++cx) { - if (!in_bounds(cx, cy) || !see_cell(cx, cy)) + if (!in_bounds(cx, cy) || !you.see_cell(coord_def(cx, cy))) continue; const dungeon_feature_type grid = grd[cx][cy]; diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc index 59a3061920..066b5e0dbb 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, - see_cell(mon->pos())? "yes" : "no"); + observe_cell(mon->pos())? "yes" : "no"); formatted_mpr(fs, MSGCH_WARN); #endif diff --git a/crawl-ref/source/teleport.cc b/crawl-ref/source/teleport.cc index c2c1829d4a..cae5bfa1d2 100644 --- a/crawl-ref/source/teleport.cc +++ b/crawl-ref/source/teleport.cc @@ -58,7 +58,7 @@ bool random_near_space(const coord_def& origin, coord_def& target, continue; if (!in_bounds(target) - || restrict_los && !see_cell(target) + || restrict_los && !you.see_cell(target) || grd(target) < DNGN_SHALLOW_WATER || actor_at(target) || !allow_adjacent && distance(origin, target) <= 2 @@ -92,7 +92,7 @@ bool random_near_space(const coord_def& origin, coord_def& target, // away from the player, since in the absence of translucent // walls monsters can blink to places which are not in either // the monster's nor the player's LOS. - if (!origin_is_player && !see_cell(target)) + if (!origin_is_player && !you.see_cell(target)) return (true); // Player can't randomly pass through translucent walls. diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 75b60c41c0..a094d03537 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -722,7 +722,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) && see_cell(pos)) + if (is_notable_terrain(nfeat) && observe_cell(pos)) seen_notable_thing(nfeat, pos); // Don't destroy a trap which was just placed. @@ -745,7 +745,7 @@ static void _announce_swap_real(coord_def orig_pos, coord_def dest_pos) const std::string orig_name = feature_description(dest_pos, false, - see_cell(orig_pos) ? DESC_CAP_THE : DESC_CAP_A, + observe_cell(orig_pos) ? DESC_CAP_THE : DESC_CAP_A, false); std::string prep = feat_preposition(orig_feat, false); @@ -769,13 +769,13 @@ static void _announce_swap_real(coord_def orig_pos, coord_def dest_pos) std::ostringstream str; str << orig_name << " "; - if (see_cell(orig_pos) && !see_cell(dest_pos)) + if (observe_cell(orig_pos) && !observe_cell(dest_pos)) { str << "suddenly disappears"; if (!orig_actor.empty()) str << " from " << prep << " " << orig_actor; } - else if (!see_cell(orig_pos) && see_cell(dest_pos)) + else if (!observe_cell(orig_pos) && observe_cell(dest_pos)) { str << "suddenly appears"; if (!dest_actor.empty()) @@ -795,7 +795,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 (!see_cell(pos1) && !see_cell(pos2)) + if (!observe_cell(pos1) && !observe_cell(pos2)) return; const dungeon_feature_type feat1 = grd(pos1); @@ -804,8 +804,8 @@ static void _announce_swap(coord_def pos1, coord_def pos2) if (feat1 == feat2) return; - const bool notable_seen1 = is_notable_terrain(feat1) && see_cell(pos1); - const bool notable_seen2 = is_notable_terrain(feat2) && see_cell(pos2); + const bool notable_seen1 = is_notable_terrain(feat1) && observe_cell(pos1); + const bool notable_seen2 = is_notable_terrain(feat2) && observe_cell(pos2); coord_def orig_pos, dest_pos; if (notable_seen1 && notable_seen2) @@ -817,7 +817,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 (see_cell(pos2)) + else if (observe_cell(pos2)) _announce_swap_real(pos1, pos2); else _announce_swap_real(pos2, pos1); @@ -835,13 +835,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) && !see_cell(pos1) + if (is_notable_terrain(feat1) && !observe_cell(pos1) && is_terrain_known(pos1)) { return (false); } - if (is_notable_terrain(feat2) && !see_cell(pos2) + if (is_notable_terrain(feat2) && !observe_cell(pos2) && is_terrain_known(pos2)) { return (false); diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 54677b59de..a2517e8cd6 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 && see_cell(gc)) + if (orig >= TILE_DNGN_LAVA && orig < TILE_BLOOD && observe_cell(gc)) env.tile_flv(gc).special = random2(256); (*tile) = orig + (special_flv % tile_dngn_count(orig)); @@ -4766,7 +4766,7 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) if (inside_halo(gc)) { monsters *mon = monster_at(gc); - if (see_cell(gc) && mon) + if (observe_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 c4c0801739..e6559e97b5 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -970,8 +970,8 @@ void DungeonRegion::pack_buffers() } pack_cursor(CURSOR_TUTORIAL, TILE_TUTORIAL_CURSOR); - pack_cursor(CURSOR_MOUSE, see_cell(m_cursor[CURSOR_MOUSE]) ? TILE_CURSOR - : TILE_CURSOR2); + pack_cursor(CURSOR_MOUSE, observe_cell(m_cursor[CURSOR_MOUSE]) ? TILE_CURSOR + : TILE_CURSOR2); if (m_cursor[CURSOR_TUTORIAL] != NO_CURSOR && on_screen(m_cursor[CURSOR_TUTORIAL])) @@ -1496,7 +1496,7 @@ bool DungeonRegion::update_alt_text(std::string &alt) return (false); describe_info inf; - if (see_cell(gc)) + if (observe_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 25a56cfa3e..b8230dfdff 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -311,7 +311,7 @@ void check_net_will_hold_monster(monsters *mons) if (net != NON_ITEM) destroy_item(net); - if (see_cell(mons->pos())) + if (observe_cell(mons->pos())) { if (mons->visible_to(&you)) { @@ -351,7 +351,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 = see_cell(this->pos); + const bool in_sight = observe_cell(this->pos); // If set, the trap will be removed at the end of the // triggering process. @@ -1139,7 +1139,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) && see_cell(this->pos)) + else if (player_can_hear(this->pos) && observe_cell(this->pos)) mpr("You hear a soft click."); this->disarm(); @@ -1228,7 +1228,7 @@ void trap_def::shoot_ammo(actor& act, bool was_known) // Determine whether projectile hits. bool hit = (trap_hit >= act.melee_evasion(NULL)); - if (see_cell(act.pos())) + if (observe_cell(act.pos())) { mprf("%s %s %s%s!", shot.name(DESC_CAP_A).c_str(), diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 8dfb9a2a96..191f7d480a 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -1658,7 +1658,7 @@ void find_travel_pos(const coord_def& youpos, { coord_def unseen = coord_def(); for (adjacent_iterator ai(dest); ai; ++ai) - if (!see_cell(*ai) + if (!you.see_cell(*ai) && (!is_terrain_seen(*ai) || !feat_is_wall(grd(*ai)))) { unseen = *ai; diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index c8d46ca4c3..c2bd7df2c7 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -4461,7 +4461,7 @@ static bool _water_is_disturbed(int x, int y) const coord_def c(x,y); const monsters *mon = monster_at(c); - if (!mon || grd(c) != DNGN_SHALLOW_WATER || !see_cell(c)) + if (!mon || grd(c) != DNGN_SHALLOW_WATER || !you.see_cell(c)) return (false); return (!mon->visible_to(&you) && !mons_flies(mon)); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 3fcf4a2a90..3ab8041efa 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -677,7 +677,7 @@ void blood_smell( int strength, const coord_def& where ) #endif you.check_awaken(range - player_distance); // Don't message if you can see the square. - if (!see_cell(where)) + if (!you.see_cell(where)) { mprf("You smell fresh blood%s.", _player_vampire_smells_blood(player_distance)); @@ -994,7 +994,7 @@ bool mons_near(const monsters *monster) { if (crawl_state.arena || crawl_state.arena_suspended) return (true); - return (see_cell(monster->pos())); + return (you.see_cell(monster->pos())); } bool mon_enemies_around(const monsters *monster) @@ -1298,7 +1298,7 @@ void viewwindow(bool draw_it, bool do_updates) const coord_def gc(view2grid(coord_def(count_x, count_y))); const coord_def ep = view2show(grid2view(gc)); - if (in_bounds(gc) && see_cell(gc)) + if (in_bounds(gc) && you.see_cell(gc)) maybe_remove_autoexclusion(gc); // Print tutorial messages for features in LOS. @@ -1497,16 +1497,16 @@ void viewwindow(bool draw_it, bool do_updates) if (flash_colour && buffy[bufcount]) { buffy[bufcount + 1] = - see_cell(gc) ? real_colour(flash_colour) - : DARKGREY; + observe_cell(gc) ? real_colour(flash_colour) + : DARKGREY; } else if (Options.target_range > 0 && buffy[bufcount] && (grid_distance(you.pos(), gc) > Options.target_range - || !see_cell(gc))) + || !observe_cell(gc))) { buffy[bufcount + 1] = DARKGREY; #ifdef USE_TILE - if (see_cell(gc)) + if (observe_cell(gc)) tileb[bufcount + 1] |= TILE_FLAG_OOR; #endif } diff --git a/crawl-ref/source/viewmap.cc b/crawl-ref/source/viewmap.cc index 33a2e92a2b..2ceb2a1a76 100644 --- a/crawl-ref/source/viewmap.cc +++ b/crawl-ref/source/viewmap.cc @@ -49,7 +49,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(where).object && !see_cell(where)) + if (!env.map(where).object && !observe_cell(where)) return (false); dungeon_feature_type grid = grd(where); @@ -1106,7 +1106,7 @@ screen_buffer_t colour_code_map(const coord_def& p, bool item_colour, #endif dungeon_feature_type feat_value = grd(p); - if (!see_cell(p)) + if (!observe_cell(p)) { const show_type remembered = get_envmap_obj(p); if (remembered.cls == SH_FEATURE) diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 3298631d85..4f2fadc827 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -1548,7 +1548,7 @@ static int _xom_swap_weapons(bool debug = false) if (!m->alive()) continue; - if (!see_cell(m->pos())) + if (!you.see_cell(m->pos())) continue; if (!wpn || mons_wont_attack(m) || mons_is_summoned(m) @@ -1684,7 +1684,7 @@ static int _xom_rearrange_pieces(int sever, bool debug = false) if (!m->alive()) continue; - if (!see_cell(m->pos())) + if (!you.see_cell(m->pos())) continue; mons.push_back(m); @@ -1748,7 +1748,7 @@ static int _xom_animate_monster_weapon(int sever, bool debug = false) if (!m->alive()) continue; - if (!see_cell(m->pos())) + if (!you.see_cell(m->pos())) continue; if (mons_wont_attack(m) || mons_is_summoned(m) @@ -1993,7 +1993,7 @@ static int _xom_change_scenery(bool debug = false) std::vector candidates; for (radius_iterator ri(you.pos(), LOS_RADIUS, false, true); ri; ++ri) { - if (!in_bounds(*ri) || !see_cell(*ri)) + if (!in_bounds(*ri) || !you.see_cell(*ri)) continue; dungeon_feature_type feat = grd(*ri); @@ -2021,7 +2021,7 @@ static int _xom_change_scenery(bool debug = false) { if ((random_near_space(you.pos(), place) || random_near_space(you.pos(), place, true)) - && grd(place) == DNGN_FLOOR && see_cell(place)) + && grd(place) == DNGN_FLOOR && you.see_cell(place)) { if (debug) return (XOM_GOOD_SCENERY); @@ -2959,7 +2959,7 @@ bool move_stair(coord_def stair_pos, bool away, bool allow_under) bool found_stairs = false; int past_stairs = 0; - while (in_bounds(ray.pos()) && see_cell(ray.pos()) + while (in_bounds(ray.pos()) && you.see_cell(ray.pos()) && !cell_is_solid(ray.pos()) && ray.pos() != you.pos()) { if (ray.pos() == stair_pos) @@ -2996,7 +2996,7 @@ bool move_stair(coord_def stair_pos, bool away, bool allow_under) if (!in_bounds(ray.pos()) || ray.pos() == you.pos()) ray.regress(); - while (!see_cell(ray.pos()) || grd(ray.pos()) != DNGN_FLOOR) + while (!you.see_cell(ray.pos()) || grd(ray.pos()) != DNGN_FLOOR) { ray.regress(); if (!in_bounds(ray.pos()) || ray.pos() == you.pos() -- cgit v1.2.3-54-g00ecf