summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-05-12 04:14:27 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-05-15 14:11:50 +0100
commitcbb52e4a65af5f84a7be74ce032b9a1da90da469 (patch)
tree9945356565adba40ee19624ffd2f9398745c31f2
parent5487ac093f68aeb255a6fe379f966b22b08e474e (diff)
downloadcrawl-ref-cbb52e4a65af5f84a7be74ce032b9a1da90da469.tar.gz
crawl-ref-cbb52e4a65af5f84a7be74ce032b9a1da90da469.zip
Cap sustain abilities at 1 level
Two levels of sustain abilities is very rarely relevant, and isn't something that makes for an interesting multi-level resist.
-rw-r--r--crawl-ref/source/l_you.cc2
-rw-r--r--crawl-ref/source/output.cc2
-rw-r--r--crawl-ref/source/player.cc13
-rw-r--r--crawl-ref/source/player.h2
4 files changed, 6 insertions, 13 deletions
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index bc94c22573..d2de07d67d 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -115,7 +115,7 @@ LUARET1(you_res_fire, number, player_res_fire(false))
LUARET1(you_res_cold, number, player_res_cold(false))
LUARET1(you_res_draining, number, player_prot_life(false))
LUARET1(you_res_shock, number, player_res_electricity(false))
-LUARET1(you_res_statdrain, number, player_sust_abil(false))
+LUARET1(you_res_statdrain, boolean, player_sust_abil(false))
LUARET1(you_res_mutation, number, you.rmut_from_item(false) ? 1 : 0)
LUARET1(you_see_invisible, boolean, you.can_see_invisible(false))
// Returning a number so as not to break existing scripts.
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 2ef6b85cbc..aa35531ce5 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -2329,7 +2329,7 @@ static vector<formatted_string> _get_overview_resistances(
out += _resist_composer("rElec", cwidth, relec) + "\n";
const int rsust = player_sust_abil(calc_unid);
- out += _resist_composer("SustAb", cwidth, rsust, 2) + "\n";
+ out += _resist_composer("SustAb", cwidth, rsust) + "\n";
const int rmuta = (you.rmut_from_item(calc_unid)
|| player_mutation_level(MUT_MUTATION_RESISTANCE) == 3);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index b3cd35967c..69ee59f597 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2719,17 +2719,10 @@ int player_shield_class(void)
return (shield + stat + 50) / 100;
}
-int player_sust_abil(bool calc_unid)
+bool player_sust_abil(bool calc_unid)
{
- int sa = 0;
-
- sa += you.wearing(EQ_RINGS, RING_SUSTAIN_ABILITIES, calc_unid);
- sa += you.scan_artefacts(ARTP_SUSTAB);
-
- if (sa > 2)
- sa = 2;
-
- return sa;
+ return you.wearing(EQ_RINGS, RING_SUSTAIN_ABILITIES, calc_unid)
+ || you.scan_artefacts(ARTP_SUSTAB);
}
int carrying_capacity(burden_state_type bs)
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 9e1ec38c91..a69a950afe 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -913,7 +913,7 @@ int player_speed(void);
int player_spell_levels(void);
-int player_sust_abil(bool calc_unid = true);
+bool player_sust_abil(bool calc_unid = true);
int player_teleport(bool calc_unid = true);