summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-06-03 18:12:10 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-06-03 18:18:19 -0700
commit0c40c516c2a8f9b7e4864639efbdf274490b77fd (patch)
tree9aa086e30e28c5d5f044460b0075d8576ab9f2a7
parent15b4f579188e88ad9cd5512b9a71bcc3cc43a130 (diff)
downloadcrawl-ref-0c40c516c2a8f9b7e4864639efbdf274490b77fd.tar.gz
crawl-ref-0c40c516c2a8f9b7e4864639efbdf274490b77fd.zip
Halve displayed SH values (crate)
So that shield enchantments are back to giving 1 (displayed) SH, and SH generally is somewhat more in line with AC/EV; 1 SH should be very roughly as good as 1 EV, against things they affect. This also tweaks the 'bone plates' mutation slightly, for rounding reasons; the first level is buffed very slightly, and the third is very slightly nerfed.
-rw-r--r--crawl-ref/source/hiscores.cc2
-rw-r--r--crawl-ref/source/mutation-data.h6
-rw-r--r--crawl-ref/source/output.cc6
-rw-r--r--crawl-ref/source/player.cc21
-rw-r--r--crawl-ref/source/player.h1
-rw-r--r--crawl-ref/source/tileweb.cc3
6 files changed, 29 insertions, 10 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 7c57c4f646..9009efb3ae 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -1555,7 +1555,7 @@ void scorefile_entry::init(time_t dt)
ac = you.armour_class();
ev = player_evasion();
- sh = player_shield_class();
+ sh = player_displayed_shield_class();
god = you.religion;
if (!you_worship(GOD_NO_GOD))
diff --git a/crawl-ref/source/mutation-data.h b/crawl-ref/source/mutation-data.h
index 03c1e3067a..8d4303ca5c 100644
--- a/crawl-ref/source/mutation-data.h
+++ b/crawl-ref/source/mutation-data.h
@@ -1403,9 +1403,9 @@ static const mutation_def mut_data[] =
{ MUT_LARGE_BONE_PLATES, 2, 3, false, true,
"large bone plates",
- {"You are partially covered in large bone plates (AC +2, SH +3).",
- "You are mostly covered in large bone plates (AC +3, SH +6).",
- "You are completely covered in large bone plates (AC +4, SH +9)."},
+ {"You are partially covered in large bone plates (AC +2, SH +2).",
+ "You are mostly covered in large bone plates (AC +3, SH +3).",
+ "You are completely covered in large bone plates (AC +4, SH +4)."},
{"Large bone plates grow over parts of your arms.",
"Large bone plates spread over more of your arms.",
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index a69ceeed15..0250d57ed2 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -804,7 +804,7 @@ static void _print_stats_ac(int x, int y)
}
else
textcolor(HUD_VALUE_COLOUR);
- CPRINTF("%2d ", player_shield_class());
+ CPRINTF("%2d ", player_displayed_shield_class());
}
static void _print_stats_ev(int x, int y)
@@ -2130,10 +2130,10 @@ static vector<formatted_string> _get_overview_stats()
if (boosted_sh)
{
snprintf(buf, sizeof buf, "SH <lightblue>%2d</lightblue>",
- player_shield_class());
+ player_displayed_shield_class());
}
else
- snprintf(buf, sizeof buf, "SH %2d", player_shield_class());
+ snprintf(buf, sizeof buf, "SH %2d", player_displayed_shield_class());
cols1.add_formatted(1, buf, false);
const char* str_col = colour_to_str(_get_stat_colour(STAT_STR)).c_str();
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index e052c6df1a..5ba1691b51 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2627,6 +2627,12 @@ int player_wizardry()
+ you.wearing(EQ_STAFF, STAFF_WIZARDRY);
}
+/**
+ * Calculate the SH value used internally.
+ *
+ * Exactly twice the value displayed to players, for legacy reasons.
+ * @return The player's current SH value.
+ */
int player_shield_class()
{
int shield = 0;
@@ -2685,9 +2691,9 @@ int player_shield_class()
}
// mutations
- // +3, +6, +9
+ // +2, +4, +6 (displayed)
shield += (player_mutation_level(MUT_LARGE_BONE_PLATES) > 0
- ? player_mutation_level(MUT_LARGE_BONE_PLATES) * 300
+ ? player_mutation_level(MUT_LARGE_BONE_PLATES) * 200 + 200
: 0);
stat += qazlal_sh_boost() * 100;
@@ -2695,6 +2701,17 @@ int player_shield_class()
return (shield + stat + 50) / 100;
}
+/**
+ * Calculate the SH value that should be displayed to players.
+ *
+ * Exactly half the internal value, for legacy reasons.
+ * @return The SH value to be displayed.
+ */
+int player_displayed_shield_class()
+{
+ return player_shield_class() / 2;
+}
+
bool player_sust_abil(bool calc_unid)
{
return you.wearing(EQ_RINGS, RING_SUSTAIN_ABILITIES, calc_unid)
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index e82a1b5dad..3bf40c5a89 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -892,6 +892,7 @@ int player_res_magic(bool calc_unid = true, bool temp = true);
bool player_control_teleport(bool temp = true);
int player_shield_class();
+int player_displayed_shield_class();
int player_spec_air();
int player_spec_cold();
diff --git a/crawl-ref/source/tileweb.cc b/crawl-ref/source/tileweb.cc
index 06d75d7589..a0d005d3d7 100644
--- a/crawl-ref/source/tileweb.cc
+++ b/crawl-ref/source/tileweb.cc
@@ -748,7 +748,8 @@ void TilesFramework::_send_player(bool force_full)
_update_int(force_full, c.armour_class, you.armour_class(), "ac");
_update_int(force_full, c.evasion, player_evasion(), "ev");
- _update_int(force_full, c.shield_class, player_shield_class(), "sh");
+ _update_int(force_full, c.shield_class, player_displayed_shield_class(),
+ "sh");
_update_int(force_full, c.strength, (int8_t) you.strength(false), "str");
_update_int(force_full, c.strength_max, (int8_t) you.max_strength(), "str_max");