summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 00:34:40 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 00:34:40 +0000
commit97fb0d78f692cb36873006a79446d011b4a3fb6b (patch)
treeacf34c7a52d8a7795a76f72f4fab9674c14ebbfa /crawl-ref/source
parent845cc22c3950d9e3e1e8b27a11e4557b3bb0fddb (diff)
downloadcrawl-ref-97fb0d78f692cb36873006a79446d011b4a3fb6b.tar.gz
crawl-ref-97fb0d78f692cb36873006a79446d011b4a3fb6b.zip
* Rename beheld -> mesmerised.
* Fix forget_map routine for Tiles. There are two problems remaining: a) Calling forget_map every ~20 turns is fine for ASCII since it mostly happens outside vision range anyway but looks really odd and spurious when watched in the minimap. Potential solution: Call the function more often. b) The minimap currently does not recenter but of course it should from time to time. The problem with this is that this is likely to look wobbly. Potential solution: Disable the minimap entirely while in labyrinths. I don't like the solutions I came up with, so if anyone has a better idea please speak up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7698 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc26
-rw-r--r--crawl-ref/source/delay.cc4
-rw-r--r--crawl-ref/source/directn.cc8
-rw-r--r--crawl-ref/source/effects.cc55
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/externs.h2
-rw-r--r--crawl-ref/source/misc.cc6
-rw-r--r--crawl-ref/source/monstuff.cc56
-rw-r--r--crawl-ref/source/output.cc7
-rw-r--r--crawl-ref/source/player.cc99
-rw-r--r--crawl-ref/source/player.h2
-rw-r--r--crawl-ref/source/spells1.cc6
-rw-r--r--crawl-ref/source/spells3.cc14
-rw-r--r--crawl-ref/source/spells4.cc6
-rw-r--r--crawl-ref/source/tags.cc8
-rw-r--r--crawl-ref/source/view.cc22
16 files changed, 191 insertions, 132 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index bce6474961..79ddec8867 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -662,10 +662,10 @@ static void _do_wizard_command(int wiz_command, bool silent_fail)
case 'H': // super-heal
you.magic_contamination = 0;
you.duration[DUR_LIQUID_FLAMES] = 0;
- if (you.duration[DUR_BEHELD])
+ if (you.duration[DUR_MESMERISED])
{
- you.duration[DUR_BEHELD] = 0;
- you.beheld_by.clear();
+ you.duration[DUR_MESMERISED] = 0;
+ you.mesmerised_by.clear();
}
inc_hp( 10, true );
// intentional fall-through
@@ -1666,12 +1666,12 @@ static bool _toggle_flag( bool* flag, const char* flagname )
return *flag;
}
-static bool _stairs_check_beheld()
+static bool _stairs_check_mesmerised()
{
- if (you.duration[DUR_BEHELD] && !you.confused())
+ if (you.duration[DUR_MESMERISED] && !you.confused())
{
mprf("You cannot move away from %s!",
- menv[you.beheld_by[0]].name(DESC_NOCAP_THE, true).c_str());
+ menv[you.mesmerised_by[0]].name(DESC_NOCAP_THE, true).c_str());
return (true);
}
@@ -1688,7 +1688,7 @@ static void _go_upstairs()
{
const dungeon_feature_type ygrd = grd(you.pos());
- if (_stairs_check_beheld())
+ if (_stairs_check_mesmerised())
return;
if (you.attribute[ATTR_HELD])
@@ -1731,7 +1731,7 @@ static void _go_downstairs()
bool shaft = (get_trap_type(you.pos()) == TRAP_SHAFT
&& grd(you.pos()) != DNGN_UNDISCOVERED_TRAP);
- if (_stairs_check_beheld())
+ if (_stairs_check_mesmerised())
return;
if (shaft && you.flight_mode() == FL_LEVITATE)
@@ -2774,10 +2774,10 @@ static void _decrement_durations()
_decrement_a_duration(DUR_SURE_BLADE,
"The bond with your blade fades away." );
- if ( _decrement_a_duration(DUR_BEHELD, "You break out of your daze.",
+ if ( _decrement_a_duration(DUR_MESMERISED, "You break out of your daze.",
-1, 0, NULL, MSGCH_RECOVERY ))
{
- you.beheld_by.clear();
+ you.mesmerised_by.clear();
}
dec_slow_player();
@@ -4056,11 +4056,11 @@ static void _move_player(coord_def move)
// You cannot move away from a mermaid but you CAN fight monsters on
// neighbouring squares.
monsters *beholder = NULL;
- if (you.duration[DUR_BEHELD] && !you.confused())
+ if (you.duration[DUR_MESMERISED] && !you.confused())
{
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- monsters& mon = menv[you.beheld_by[i]];
+ monsters& mon = menv[you.mesmerised_by[i]];
int olddist = grid_distance(you.pos(), mon.pos());
int newdist = grid_distance(targ, mon.pos());
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 3f3c62a1cc..7514ffa44d 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -393,6 +393,10 @@ void stop_delay( bool stop_stair_travel )
"back to %s.", butcher_verb.c_str(),
(multiple_corpses ? "s" : ""), weapon.c_str());
+ // Maybe we should do precisely that, but that would entirely
+ // defeat the purpose of the weapon swap.
+// you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0;
+
if (Options.swap_when_safe)
{
// Use weapon slot + 1, so weapon slot 'a' (== 0) doesn't
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 6e86640ed7..276b60266c 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -533,8 +533,8 @@ void full_describe_view()
std::vector<formatted_string> fss;
std::string str = get_monster_desc(list_mons[i], true, DESC_CAP_A,
true);
- if (player_beheld_by(list_mons[i]))
- str += ", beholding you";
+ if (player_mesmerised_by(list_mons[i]))
+ str += ", keeping you mesmerised";
if (dam_level != MDAM_OKAY)
str += ", " + wound_str;
@@ -2772,8 +2772,8 @@ static void _describe_monster(const monsters *mon)
std::string text = get_monster_desc(mon) + ".";
print_formatted_paragraph(text, numcols);
- if (player_beheld_by(mon))
- mpr("You are beheld by her song.", MSGCH_EXAMINE);
+ if (player_mesmerised_by(mon))
+ mpr("You are mesmerised by her song.", MSGCH_EXAMINE);
print_wounds(mon);
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 2d6da14541..8bddb089fd 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2608,11 +2608,33 @@ void change_labyrinth(bool msg)
env.map(p).property |= FPROP_HIGHLIGHT;
#endif
+ // Shift blood some most of the time.
+ if (is_bloodcovered(c))
+ {
+ if (one_chance_in(4))
+ {
+ int wall_count = 0;
+ coord_def old_adj(c);
+ for (adjacent_iterator ai(c); ai; ++ai)
+ if (grid_is_wall(grd(*ai)) && one_chance_in(++wall_count))
+ old_adj = *ai;
+
+ if (old_adj != c)
+ {
+ if (!is_bloodcovered(old_adj))
+ env.map(old_adj).property |= FPROP_BLOODY;
+ env.map(c).property &= (~FPROP_BLOODY);
+ }
+ }
+ }
+ else if (one_chance_in(750))
+ {
+ // Sometimes (rarely) add blood randomly, accumulating with time...
+ env.map(p).property |= FPROP_BLOODY;
+ }
+
// Rather than use old_grid directly, replace with an adjacent
// wall type, preferably stone, rock, or metal.
- // TODO: Blood is currently left on the grid even though it turned
- // into a wall or floor. Rather, it should be nudged aside to
- // a grid of similar type.
old_grid = grd[p.x-1][p.y];
if (!grid_is_wall(old_grid))
{
@@ -2638,6 +2660,31 @@ void change_labyrinth(bool msg)
old_grid = grd[p.x+1][p.y];
}
grd(p) = old_grid;
+
+ // Shift blood some of the time.
+ if (is_bloodcovered(p))
+ {
+ if (one_chance_in(4))
+ {
+ int floor_count = 0;
+ coord_def new_adj(p);
+ for (adjacent_iterator ai(c); ai; ++ai)
+ if (_is_floor(grd(*ai)) && one_chance_in(++floor_count))
+ new_adj = *ai;
+
+ if (new_adj != p)
+ {
+ if (!is_bloodcovered(new_adj))
+ env.map(new_adj).property |= FPROP_BLOODY;
+ env.map(p).property &= (~FPROP_BLOODY);
+ }
+ }
+ }
+ else if (one_chance_in(150))
+ {
+ // Occasionally add blood randomly, accumulating with time...
+ env.map(p).property |= FPROP_BLOODY;
+ }
}
// The directions are used to randomly decide where to place items that
@@ -3464,7 +3511,7 @@ void update_corpses(double elapsedTime)
// dry fountains may start flowing again
if (fountain_checks > 0)
{
- for ( rectangle_iterator ri(1); ri; ++ri )
+ for (rectangle_iterator ri(1); ri; ++ri)
{
if (grd(*ri) >= DNGN_DRY_FOUNTAIN_BLUE
&& grd(*ri) < DNGN_PERMADRY_FOUNTAIN)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 0cfadf8153..361764cb82 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1090,7 +1090,7 @@ enum duration_type
DUR_CONF,
DUR_PARALYSIS,
DUR_SLOW,
- DUR_BEHELD,
+ DUR_MESMERISED,
DUR_HASTE,
DUR_MIGHT,
DUR_LEVITATION,
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index d1f48cd3e1..4b61bbc9b8 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -695,7 +695,7 @@ public:
bool banished;
std::string banished_by;
- std::vector<int> beheld_by; // monsters beholding player
+ std::vector<int> mesmerised_by; // monsters mesmerising player
int friendly_pickup; // pickup setting for allies
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 7e4dd3fdd0..58bca496ba 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2408,10 +2408,10 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
new_level();
// Clear list of beholding monsters.
- if (you.duration[DUR_BEHELD])
+ if (you.duration[DUR_MESMERISED])
{
- you.beheld_by.clear();
- you.duration[DUR_BEHELD] = 0;
+ you.mesmerised_by.clear();
+ you.duration[DUR_MESMERISED] = 0;
}
if (you.skills[SK_TRANSLOCATIONS] > 0 && !allow_control_teleport( true ))
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 02d7a29157..9e145e35f8 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2861,8 +2861,12 @@ static bool _find_siren_water_target(monsters *mon)
{
mpr("in _find_siren_water_target");
ASSERT(mon->type == MONS_SIREN);
- if (mon->travel_target == MTRAV_SIREN && !one_chance_in(8))
- return (true);
+ if (mon->travel_target == MTRAV_SIREN)
+ {
+ coord_def targ_pos(mon->travel_path[mon->travel_path.size()-1]);
+ if ((mon->pos() - targ_pos).rdist() > 2)
+ return (true);
+ }
int water_count;
int best_water_count = 0;
@@ -3409,7 +3413,7 @@ static void _handle_behaviour(monsters *mon)
// The foe is the player.
if (mon->type == MONS_SIREN)
{
- if (player_beheld_by(mon)
+ if (player_mesmerised_by(mon)
&& (mon->pos() - you.pos()).rdist() < 6
&& _find_siren_water_target(mon))
{
@@ -4220,7 +4224,7 @@ static void _handle_nearby_ability(monsters *monster)
// Okay then, don't speak.
if (monster_can_submerge(monster, grd(monster->pos()))
- && !player_beheld_by(monster) // No submerging if player entranced.
+ && !player_mesmerised_by(monster) // No submerging if player entranced.
&& !mons_is_lurking(monster) // Handled elsewhere.
&& monster->wants_submerge())
{
@@ -4693,10 +4697,10 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
break;
}
- bool already_beheld = player_beheld_by(monster);
+ bool already_mesmerised = player_mesmerised_by(monster);
if (one_chance_in(5)
- || monster->foe == MHITYOU && !already_beheld && coinflip())
+ || monster->foe == MHITYOU && !already_mesmerised && coinflip())
{
noisy(12, monster->pos(), NULL, true);
@@ -4704,14 +4708,14 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
{
simple_monster_message(monster,
make_stringf(" chants %s song.",
- already_beheld ? "her luring" : "a haunting").c_str(),
+ already_mesmerised ? "her luring" : "a haunting").c_str(),
spl);
}
else
{
- // If you're already beheld by an invisible mermaid she can
- // still prolong the enchantment; otherwise you "resist".
- if (already_beheld)
+ // If you're already mesmerised by an invisible mermaid she
+ // can still prolong the enchantment; otherwise you "resist".
+ if (already_mesmerised)
mpr("You hear a luring song.", MSGCH_SOUND);
else
{
@@ -4728,30 +4732,32 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
}
}
- // Once beheld by a particular monster, you cannot resist anymore.
- if (!already_beheld
+ // Once mesmerised by a particular monster, you cannot resist
+ // anymore.
+ if (!already_mesmerised
&& (you.species == SP_MERFOLK || you_resist_magic(100)))
{
canned_msg(MSG_YOU_RESIST);
break;
}
- if (!you.duration[DUR_BEHELD])
+ if (!you.duration[DUR_MESMERISED])
{
- you.duration[DUR_BEHELD] = 7;
- you.beheld_by.push_back(monster_index(monster));
- mpr("You are beheld!", MSGCH_WARN);
+ you.duration[DUR_MESMERISED] = 7;
+ you.mesmerised_by.push_back(monster_index(monster));
+ mprf(MSGCH_WARN, "You are mesmerised by %s!",
+ monster->name(DESC_NOCAP_THE));
}
else
{
- you.duration[DUR_BEHELD] += 5;
- if (!already_beheld)
- you.beheld_by.push_back(monster_index(monster));
+ you.duration[DUR_MESMERISED] += 5;
+ if (!already_mesmerised)
+ you.mesmerised_by.push_back(monster_index(monster));
}
used = true;
- if (you.duration[DUR_BEHELD] > 12)
- you.duration[DUR_BEHELD] = 12;
+ if (you.duration[DUR_MESMERISED] > 12)
+ you.duration[DUR_MESMERISED] = 12;
}
break;
}
@@ -6509,11 +6515,11 @@ void handle_monsters()
// If the player got banished, discard pending monster actions.
if (you.banished)
{
- // Clear list of beholding monsters.
- if (you.duration[DUR_BEHELD])
+ // Clear list of mesmerisinging monsters.
+ if (you.duration[DUR_MESMERISED])
{
- you.beheld_by.clear();
- you.duration[DUR_BEHELD] = 0;
+ you.mesmerised_by.clear();
+ you.duration[DUR_MESMERISED] = 0;
}
break;
}
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 1d5d53e637..76058d803b 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -543,7 +543,7 @@ struct status_light
// Prints burden, hunger,
// pray, holy, teleport, regen, insulation, fly/lev, invis, silence,
// conf. touch, bargain, sage
-// confused, beheld, fire, poison, disease, rot, held, glow, swift,
+// confused, mesmerised, fire, poison, disease, rot, held, glow, swift,
// fast, slow, breath
//
// Note the usage of bad_ench_colour() correspond to levels that
@@ -688,8 +688,9 @@ static void _get_status_lights(std::vector<status_light>& out)
if (you.duration[DUR_LOWERED_MR])
out.push_back(status_light(RED, "-MR"));
- if (you.duration[DUR_BEHELD])
- out.push_back(status_light(RED, "Bhld"));
+ // TODO: Differentiate between mermaids and sirens!
+ if (you.duration[DUR_MESMERISED])
+ out.push_back(status_light(RED, "Mesm"));
if (you.duration[DUR_LIQUID_FLAMES])
out.push_back(status_light(RED, "Fire"));
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index e6b32d5e37..f9dac8ce42 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2617,10 +2617,10 @@ bool player_monster_visible( const monsters *mon )
return (true);
}
-// Returns true if player is beheld by a given monster.
-bool player_beheld_by( const monsters *mon )
+// Returns true if player is mesmerised by a given monster.
+bool player_mesmerised_by( const monsters *mon )
{
- if (!you.duration[DUR_BEHELD])
+ if (!you.duration[DUR_MESMERISED])
return (false);
// Can this monster even behold you?
@@ -2628,20 +2628,20 @@ bool player_beheld_by( const monsters *mon )
return (false);
#ifdef DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "beheld_by.size: %d, DUR_BEHELD: %d, current mon: %d",
- you.beheld_by.size(), you.duration[DUR_BEHELD],
- monster_index(mon));
+ mprf(MSGCH_DIAGNOSTICS, "mesmerised_by.size: %d, DUR_MESMERISED: %d, "
+ "current mon: %d", you.mesmerised_by.size(),
+ you.duration[DUR_MESMERISED], monster_index(mon));
#endif
- if (you.beheld_by.empty()) // shouldn't happen
+ if (you.mesmerised_by.empty()) // shouldn't happen
{
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
return (false);
}
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- unsigned int which_mon = you.beheld_by[i];
+ unsigned int which_mon = you.mesmerised_by[i];
if (monster_index(mon) == which_mon)
return (true);
}
@@ -2653,7 +2653,7 @@ bool player_beheld_by( const monsters *mon )
// (e.g. monster dead) or one of several cases is met.
void update_beholders(const monsters *mon, bool force)
{
- if (!player_beheld_by(mon)) // Not in list?
+ if (!player_mesmerised_by(mon)) // Not in list?
return;
// Is an update even necessary?
@@ -2661,46 +2661,46 @@ void update_beholders(const monsters *mon, bool force)
|| mon->has_ench(ENCH_CONFUSION) || mons_cannot_move(mon)
|| mon->asleep() || silenced(you.pos()) || silenced(mon->pos()))
{
- const std::vector<int> help = you.beheld_by;
- you.beheld_by.clear();
+ const std::vector<int> help = you.mesmerised_by;
+ you.mesmerised_by.clear();
for (unsigned int i = 0; i < help.size(); i++)
{
unsigned int which_mon = help[i];
if (monster_index(mon) != which_mon)
- you.beheld_by.push_back(i);
+ you.mesmerised_by.push_back(i);
}
- if (you.beheld_by.empty())
+ if (you.mesmerised_by.empty())
{
mpr("You are no longer entranced.", MSGCH_RECOVERY);
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
}
}
}
void check_beholders()
{
- for (int i = you.beheld_by.size() - 1; i >= 0; i--)
+ for (int i = you.mesmerised_by.size() - 1; i >= 0; i--)
{
- const monsters* mon = &menv[you.beheld_by[i]];
+ const monsters* mon = &menv[you.mesmerised_by[i]];
if (!mon->alive() || mons_genus(mon->type) != MONS_MERMAID)
{
#if DEBUG
if (!mon->alive())
- mpr("Dead mermaid still beholding?", MSGCH_DIAGNOSTICS);
+ mpr("Dead mermaid/siren still mesmerising?", MSGCH_DIAGNOSTICS);
else
{
- mprf(MSGCH_DIAGNOSTICS, "Non-mermaid '%s' beholding?",
+ mprf(MSGCH_DIAGNOSTICS, "Non-mermaid/siren '%s' mesmerising?",
mon->name(DESC_PLAIN, true).c_str());
}
#endif
- you.beheld_by.erase(you.beheld_by.begin() + i);
- if (you.beheld_by.empty())
+ you.mesmerised_by.erase(you.mesmerised_by.begin() + i);
+ if (you.mesmerised_by.empty())
{
mpr("You are no longer entranced.", MSGCH_RECOVERY);
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
break;
}
continue;
@@ -2712,28 +2712,28 @@ void check_beholders()
if (walls > 0)
{
#if DEBUG
- mprf(MSGCH_DIAGNOSTICS, "%d walls between beholding '%s' "
+ mprf(MSGCH_DIAGNOSTICS, "%d walls between mesmerising '%s' "
"and player", walls, mon->name(DESC_PLAIN, true).c_str());
#endif
- you.beheld_by.erase(you.beheld_by.begin() + i);
- if (you.beheld_by.empty())
+ you.mesmerised_by.erase(you.mesmerised_by.begin() + i);
+ if (you.mesmerised_by.empty())
{
mpr("You are no longer entranced.", MSGCH_RECOVERY);
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
break;
}
continue;
}
}
- if (you.duration[DUR_BEHELD] > 0 && you.beheld_by.empty())
+ if (you.duration[DUR_MESMERISED] > 0 && you.mesmerised_by.empty())
{
#if DEBUG
- mpr("Beheld with no mermaids left?", MSGCH_DIAGNOSTICS);
+ mpr("Mesmerised with no mermaids/sirens left?", MSGCH_DIAGNOSTICS);
#endif
mpr("You are no longer entranced.", MSGCH_RECOVERY);
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
}
}
@@ -2853,27 +2853,27 @@ void forget_map(unsigned char chance_forgotten, bool force)
if (force && !yesno("Really forget level map?", true, 'n'))
return;
- int radius = 25*25;
- if (chance_forgotten < 100 && you.level_type == LEVEL_LABYRINTH
- && you.species == SP_MINOTAUR)
+ // The radius is only used in labyrinths.
+ const bool use_lab_check = (!force && you.level_type == LEVEL_LABYRINTH
+ && chance_forgotten < 100);
+ const int radius = (use_lab_check && you.species == SP_MINOTAUR) ? 40*40
+ : 25*25;
+ for (rectangle_iterator ri(1); ri; ++ri)
{
- radius = 40*40;
- }
- for (unsigned char xcount = 0; xcount < GXM; xcount++)
- for (unsigned char ycount = 0; ycount < GYM; ycount++)
+ if (!see_grid(*ri)
+ && (force || x_chance_in_y(chance_forgotten, 100)
+ || use_lab_check && (you.pos()-*ri).abs() > radius))
{
- const coord_def c(xcount, ycount);
- if (!see_grid(c)
- && (force || x_chance_in_y(chance_forgotten, 100)
- || chance_forgotten < 100 && (you.pos()-c).abs() > radius))
- {
- env.map[xcount][ycount].clear();
- }
- }
-
+ env.map(*ri).clear();
#ifdef USE_TILE
- tiles.clear_minimap();
+ set_envmap_obj(*ri, 0);
+ tiles.update_minimap(ri->x, ri->y);
+ env.tile_bk_fg[ri->x][ri->y] = 0;
+ env.tile_bk_bg[ri->x][ri->y]
+ = tileidx_feature(DNGN_UNSEEN, ri->x, ri->y);
#endif
+ }
+ }
}
void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
@@ -3920,8 +3920,9 @@ void display_char_status()
if (you.confused())
mpr("You are confused.");
- if (you.duration[DUR_BEHELD])
- mpr("You are beheld.");
+ // TODO: Distinguish between mermaids and sirens!
+ if (you.duration[DUR_MESMERISED])
+ mpr("You are mesmerised.");
// How exactly did you get to show the status?
if (you.duration[DUR_PARALYSIS])
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index c405b0b8b0..22e916f6dc 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -278,7 +278,7 @@ int slaying_bonus(char which_affected);
int player_see_invis(bool calc_unid = true);
bool player_monster_visible( const monsters *mon );
-bool player_beheld_by( const monsters *mon );
+bool player_mesmerised_by( const monsters *mon );
void update_beholders( const monsters *mon, bool force = false);
void check_beholders();
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 7d850ba0b5..1c17ae78d8 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -111,12 +111,12 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink)
return (-1); // early return {dlb}
}
- if (!wizard_blink && you.duration[DUR_BEHELD])
+ if (!wizard_blink && you.duration[DUR_MESMERISED])
{
bool blocked_movement = false;
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- monsters& mon = menv[you.beheld_by[i]];
+ monsters& mon = menv[you.mesmerised_by[i]];
const int olddist = grid_distance(you.pos(), mon.pos());
const int newdist = grid_distance(beam.target, mon.pos());
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 289a6e8159..959ae1bc95 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1275,12 +1275,12 @@ static bool _teleport_player( bool allow_control, bool new_abyss_area )
mprf(MSGCH_DIAGNOSTICS, "Target square (%d,%d)", pos.x, pos.y );
#endif
- if (you.duration[DUR_BEHELD])
+ if (you.duration[DUR_MESMERISED])
{
bool blocked_movement = false;
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- monsters& mon = menv[you.beheld_by[i]];
+ monsters& mon = menv[you.mesmerised_by[i]];
const int olddist = grid_distance(you.pos(), mon.pos());
const int newdist = grid_distance(pos, mon.pos());
@@ -1492,9 +1492,9 @@ bool entomb(int powc)
{
mpr("Walls emerge from the floor!");
- for (int i = you.beheld_by.size() - 1; i >= 0; i--)
+ for (int i = you.mesmerised_by.size() - 1; i >= 0; i--)
{
- const monsters* mon = &menv[you.beheld_by[i]];
+ const monsters* mon = &menv[you.mesmerised_by[i]];
int walls = num_feats_between(you.pos(), mon->pos(),
DNGN_UNSEEN, DNGN_MAXWALL,
true, true);
@@ -1502,9 +1502,9 @@ bool entomb(int powc)
if (walls > 0)
{
update_beholders(mon, true);
- if (you.beheld_by.empty())
+ if (you.mesmerised_by.empty())
{
- you.duration[DUR_BEHELD] = 0;
+ you.duration[DUR_MESMERISED] = 0;
break;
}
continue;
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 4b6a01b03b..f53ee2db66 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -766,11 +766,11 @@ void cast_silence(int pow)
if (you.duration[DUR_SILENCE] > 100)
you.duration[DUR_SILENCE] = 100;
- if (you.duration[DUR_BEHELD])
+ if (you.duration[DUR_MESMERISED])
{
mpr("You break out of your daze!", MSGCH_RECOVERY);
- you.duration[DUR_BEHELD] = 0;
- you.beheld_by.clear();
+ you.duration[DUR_MESMERISED] = 0;
+ you.mesmerised_by.clear();
}
}
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 88e68d9120..e7af317cb2 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1027,9 +1027,9 @@ static void tag_construct_you(writer &th)
// be recalculated on game start.
// List of currently beholding monsters (usually empty).
- marshallByte(th, you.beheld_by.size());
- for (unsigned int k = 0; k < you.beheld_by.size(); k++)
- marshallByte(th, you.beheld_by[k]);
+ marshallByte(th, you.mesmerised_by.size());
+ for (unsigned int k = 0; k < you.mesmerised_by.size(); k++)
+ marshallByte(th, you.mesmerised_by[k]);
// minorVersion 2 starts here
marshallByte(th, you.piety_hysteresis);
@@ -1437,7 +1437,7 @@ static void tag_read_you(reader &th, char minorVersion)
// List of currently beholding monsters (usually empty).
count_c = unmarshallByte(th);
for (i = 0; i < count_c; i++)
- you.beheld_by.push_back(unmarshallByte(th));
+ you.mesmerised_by.push_back(unmarshallByte(th));
if (minorVersion >= TAG_MINOR_PIETY)
you.piety_hysteresis = unmarshallByte(th);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 9e63c2b43a..9da30c2414 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -413,13 +413,13 @@ static void _get_symbol( const coord_def& where,
bool blocked_movement = false;
if (!excluded_stairs
&& object < NUM_FEATURES && object >= DNGN_MINMOVE
- && you.duration[DUR_BEHELD])
+ && you.duration[DUR_MESMERISED])
{
// Colour grids that cannot be reached due to beholders
// dark grey.
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- monsters& mon = menv[you.beheld_by[i]];
+ monsters& mon = menv[you.mesmerised_by[i]];
const int olddist = grid_distance(you.pos(), mon.pos());
const int newdist = grid_distance(where, mon.pos());
@@ -687,16 +687,16 @@ screen_buffer_t colour_code_map( const coord_def& p, bool item_colour,
if (feature_colour != DARKGREY)
tc = feature_colour;
- else if (you.duration[DUR_BEHELD])
+ else if (you.duration[DUR_MESMERISED])
{
- // If beheld, colour the few grids that can be reached anyway
+ // If mesmerised, colour the few grids that can be reached anyway
// lightgrey.
if (grd(p) >= DNGN_MINMOVE && mgrd(p) == NON_MONSTER)
{
bool blocked_movement = false;
- for (unsigned int i = 0; i < you.beheld_by.size(); i++)
+ for (unsigned int i = 0; i < you.mesmerised_by.size(); i++)
{
- monsters& mon = menv[you.beheld_by[i]];
+ monsters& mon = menv[you.mesmerised_by[i]];
const int olddist = grid_distance(you.pos(), mon.pos());
const int newdist = grid_distance(p, mon.pos());
@@ -1590,13 +1590,13 @@ bool noisy(int loudness, const coord_def& where, const char *msg, bool mermaid)
you.check_awaken(dist - player_distance);
- if (!mermaid && loudness >= 20 && you.duration[DUR_BEHELD])
+ if (!mermaid && loudness >= 20 && you.duration[DUR_MESMERISED])
{
mprf("For a moment, you cannot hear the mermaid%s!",
- you.beheld_by.size() == 1? "" : "s");
+ you.mesmerised_by.size() == 1? "" : "s");
mpr("You break out of your daze!", MSGCH_DURATION);
- you.duration[DUR_BEHELD] = 0;
- you.beheld_by.clear();
+ you.duration[DUR_MESMERISED] = 0;
+ you.mesmerised_by.clear();
}
ret = true;