Skip to content

Commit

Permalink
Increase contam from unequipping an item that's granting you invis (S…
Browse files Browse the repository at this point in the history
…iegurt)

Technically it was still optimal to unequip invis items and then reequip them
to limit the time spent resting off contam. This change makes it always a bad
idea. It also adds a warning message when you try to take this action.
  • Loading branch information
cbuchananhowland committed Jul 15, 2017
1 parent 1d32bfb commit 329daca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions crawl-ref/source/invent.cc
Expand Up @@ -1672,6 +1672,11 @@ bool needs_handle_warning(const item_def &item, operation_types oper,
return true;
}

// If you're invis from an item, warn that you're about to get an extra dose
// of contam from removing it.
if (you.duration[DUR_INVIS] > 1 && !you.attribute[ATTR_INVIS_UNCANCELLABLE])
return true;

return false;
}

Expand Down
7 changes: 6 additions & 1 deletion crawl-ref/source/player-equip.cc
Expand Up @@ -281,7 +281,12 @@ static void _unequip_invis()
&& !you.evokable_invis()
&& !you.attribute[ATTR_INVIS_UNCANCELLABLE])
{
const int invis_duration_left = you.duration[DUR_INVIS];

// scale up contam by 120% just to ensure that ending invis early is
// worse than just resting it off.
mpr("You absorb a burst of magical contamination as your invisibility "
"abruptly ends!");
const int invis_duration_left = you.duration[DUR_INVIS] * 120 / 100;
const int remaining_contam = div_rand_round(
invis_duration_left * INVIS_CONTAM_PER_TURN, BASELINE_DELAY
);
Expand Down

0 comments on commit 329daca

Please sign in to comment.