summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/actor.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2013-11-08 19:04:13 +0000
committerAdam Borowski <kilobyte@angband.pl>2013-11-11 03:54:06 +0100
commit723b4fa0c231dc452cc1ff30a01780d71ac83882 (patch)
treebb422b699919251ff2d60ac7fe0a150de183a38d /crawl-ref/source/actor.cc
parentd12a4ba87f98e8d1ac6495ea9190b97d9c0129bc (diff)
downloadcrawl-ref-723b4fa0c231dc452cc1ff30a01780d71ac83882.tar.gz
crawl-ref-723b4fa0c231dc452cc1ff30a01780d71ac83882.zip
Remove moths of suppression
Suppression is a hugely complicated and inconsistent mechanic. Its original purpose was to be a way of overriding rPois in Spider but there are now plenty of monsters that do this effectively (and much more simply). [1KB: I moved this to trunk, as it made an already extremely hard to review branch massively more so. There's nothing but a single enum to preserve, so compat break doesn't make this removal any easier or harder.]
Diffstat (limited to 'crawl-ref/source/actor.cc')
-rw-r--r--crawl-ref/source/actor.cc63
1 files changed, 12 insertions, 51 deletions
diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc
index 1d9f518431..38e4faa805 100644
--- a/crawl-ref/source/actor.cc
+++ b/crawl-ref/source/actor.cc
@@ -249,31 +249,23 @@ int actor::body_weight(bool base) const
bool actor::inaccuracy() const
{
- return !suppressed() && wearing(EQ_AMULET, AMU_INACCURACY);
+ return wearing(EQ_AMULET, AMU_INACCURACY);
}
bool actor::gourmand(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && wearing(EQ_AMULET, AMU_THE_GOURMAND, calc_unid);
}
bool actor::conservation(bool calc_unid, bool items) const
{
- if (suppressed() || !items)
- return false;
-
- return wearing(EQ_AMULET, AMU_CONSERVATION, calc_unid)
- || wearing_ego(EQ_ALL_ARMOUR, SPARM_PRESERVATION, calc_unid);
+ return items && (wearing(EQ_AMULET, AMU_CONSERVATION, calc_unid)
+ || wearing_ego(EQ_ALL_ARMOUR, SPARM_PRESERVATION,
+ calc_unid));
}
bool actor::res_corr(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && (wearing(EQ_AMULET, AMU_RESIST_CORROSION, calc_unid)
|| wearing_ego(EQ_ALL_ARMOUR, SPARM_PRESERVATION,
calc_unid));
@@ -285,59 +277,38 @@ bool actor::res_corr(bool calc_unid, bool items) const
// item_use.cc for a superset of this function.
bool actor::has_notele_item(bool calc_unid) const
{
- if (suppressed())
- return false;
-
return scan_artefacts(ARTP_PREVENT_TELEPORTATION, calc_unid);
}
bool actor::stasis(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && wearing(EQ_AMULET, AMU_STASIS, calc_unid);
}
// permaswift effects like boots of running and lightning scales
bool actor::run(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && wearing_ego(EQ_BOOTS, SPARM_RUNNING, calc_unid);
}
bool actor::angry(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && scan_artefacts(ARTP_ANGRY, calc_unid);
}
bool actor::clarity(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && (wearing(EQ_AMULET, AMU_CLARITY, calc_unid)
|| scan_artefacts(ARTP_CLARITY, calc_unid));
}
bool actor::faith(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && wearing(EQ_AMULET, AMU_FAITH, calc_unid);
}
bool actor::warding(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
// Note: when adding a new source of warding, please add it to
// melee_attack::attack_warded_off() as well.
return items && (wearing(EQ_AMULET, AMU_WARDING, calc_unid)
@@ -346,7 +317,7 @@ bool actor::warding(bool calc_unid, bool items) const
int actor::archmagi(bool calc_unid, bool items) const
{
- if (suppressed() || !items)
+ if (!items)
return 0;
return wearing_ego(EQ_ALL_ARMOUR, SPARM_ARCHMAGI, calc_unid);
@@ -354,29 +325,25 @@ int actor::archmagi(bool calc_unid, bool items) const
bool actor::no_cast(bool calc_unid, bool items) const
{
- if (suppressed())
- items = false;
-
return items && scan_artefacts(ARTP_PREVENT_SPELLCASTING, calc_unid);
}
bool actor::rmut_from_item(bool calc_unid) const
{
- return !suppressed() && wearing(EQ_AMULET, AMU_RESIST_MUTATION, calc_unid);
+ return wearing(EQ_AMULET, AMU_RESIST_MUTATION, calc_unid);
}
bool actor::evokable_berserk(bool calc_unid) const
{
- return !suppressed() && (wearing(EQ_AMULET, AMU_RAGE, calc_unid)
- || scan_artefacts(ARTP_BERSERK, calc_unid));
+ return wearing(EQ_AMULET, AMU_RAGE, calc_unid)
+ || scan_artefacts(ARTP_BERSERK, calc_unid);
}
bool actor::evokable_invis(bool calc_unid) const
{
- return !suppressed()
- && (wearing(EQ_RINGS, RING_INVISIBILITY, calc_unid)
- || wearing_ego(EQ_CLOAK, SPARM_DARKNESS, calc_unid)
- || scan_artefacts(ARTP_INVISIBLE, calc_unid));
+ return wearing(EQ_RINGS, RING_INVISIBILITY, calc_unid)
+ || wearing_ego(EQ_CLOAK, SPARM_DARKNESS, calc_unid)
+ || scan_artefacts(ARTP_INVISIBLE, calc_unid);
}
// Return an int so we know whether an item is the sole source.
@@ -385,9 +352,6 @@ int actor::evokable_flight(bool calc_unid) const
if (is_player() && you.form == TRAN_TREE)
return 0;
- if (suppressed())
- return 0;
-
return wearing(EQ_RINGS, RING_FLIGHT, calc_unid)
+ wearing_ego(EQ_ALL_ARMOUR, SPARM_FLYING, calc_unid)
+ scan_artefacts(ARTP_FLY, calc_unid);
@@ -395,9 +359,6 @@ int actor::evokable_flight(bool calc_unid) const
int actor::evokable_jump(bool calc_unid) const
{
- if (suppressed())
- return 0;
-
return wearing_ego(EQ_ALL_ARMOUR, SPARM_JUMPING, calc_unid);
}
@@ -405,7 +366,7 @@ int actor::spirit_shield(bool calc_unid, bool items) const
{
int ss = 0;
- if (items && !suppressed())
+ if (items)
{
ss += wearing_ego(EQ_ALL_ARMOUR, SPARM_SPIRIT_SHIELD, calc_unid);
ss += wearing(EQ_AMULET, AMU_GUARDIAN_SPIRIT, calc_unid);