Skip to content

Commit

Permalink
Players' non-opaque clouds instavanish outside LOS
Browse files Browse the repository at this point in the history
They previously dissapated at 4x speed to discourage abuses, which
was (a) ineffective and (b) hard to notice unless you already knew
about it. ("Spoilery!") Better to make a hard-and-fast rule.

Opaque clouds are exempt so that e.g. large amounts of fog or
steam doesn't end up insta-dissipating; possibly this should be
revisited later.
  • Loading branch information
PleasingFungus committed Jun 12, 2016
1 parent 4b2eec1 commit 7e89378
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crawl-ref/source/cloud.cc
Expand Up @@ -400,9 +400,13 @@ static int _cloud_dissipation_rate(const cloud_struct &cloud)
{
int dissipate = you.time_taken;

// If a player-created cloud is out of LOS, it dissipates much faster.
if (cloud.source == MID_PLAYER && !you.see_cell_no_trans(cloud.pos))
dissipate *= 4;
// Player-created non-opaque clouds vanish instantly when outside LOS.
// (Opaque clouds don't to prevent cloud suicide.)
if (cloud.source == MID_PLAYER && !you.see_cell_no_trans(cloud.pos)
&& !is_opaque_cloud(cloud.type))
{
return cloud.decay;
}

switch (cloud.type)
{
Expand All @@ -422,7 +426,7 @@ static int _cloud_dissipation_rate(const cloud_struct &cloud)
// Ink cloud shouldn't appear outside of water.
case CLOUD_INK:
if (!feat_is_watery(grd(cloud.pos)))
return dissipate * 40;
return cloud.decay;
break;
default:
break;
Expand Down

0 comments on commit 7e89378

Please sign in to comment.