summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-11-08 23:32:42 -0800
committerStefan O'Rear <stefanor@cox.net>2009-11-08 23:36:10 -0800
commitdce267d966c2a6466ebc57f84dccda7fa5012a75 (patch)
treed010174f4b02d66485305c426503c3b72dc48aed
parent6521776b1fc7b68f7cb025397797cd8cad5a32e0 (diff)
downloadcrawl-ref-dce267d966c2a6466ebc57f84dccda7fa5012a75.tar.gz
crawl-ref-dce267d966c2a6466ebc57f84dccda7fa5012a75.zip
Reform SH to be more transparent
Before: SH was a function of items and skills. Blocking was a function of SH, skills, and stats. Now: SH is a function of items, skills, and stats. Blocking is a function of SH and SH alone. Your ability to block attacks in given equipment should be more or less the same, although there will be small differences. Condensation Shield was doubled (since nobody uses it), Divine Shield was made to not use intelligence. SH values have been rescaled to be on approximately the same scale as AC and EV. This meant increasing the max enchant of shields to +3.
-rw-r--r--crawl-ref/source/art-data.h6
-rw-r--r--crawl-ref/source/art-data.txt6
-rw-r--r--crawl-ref/source/itemprop.cc11
-rw-r--r--crawl-ref/source/player.cc67
4 files changed, 48 insertions, 42 deletions
diff --git a/crawl-ref/source/art-data.h b/crawl-ref/source/art-data.h
index 665c5149ab..e7fdec34a3 100644
--- a/crawl-ref/source/art-data.h
+++ b/crawl-ref/source/art-data.h
@@ -862,7 +862,7 @@
/* 45: UNRAND_IGNORANCE */
{
"shield of Ignorance", "dull large shield",
- OBJ_ARMOUR, ARM_LARGE_SHIELD, +5, 0, BROWN, 0,
+ OBJ_ARMOUR, ARM_LARGE_SHIELD, +8, 0, BROWN, 0,
UNRAND_FLAG_NONE,
{
SPARM_NORMAL, 2, 2, 0, -6, 0,
@@ -919,7 +919,7 @@
/* 48: UNRAND_BULLSEYE */
{
"shield \"Bullseye\"", "round shield",
- OBJ_ARMOUR, ARM_SHIELD, +10, 0, RED, 0,
+ OBJ_ARMOUR, ARM_SHIELD, +15, 0, RED, 0,
UNRAND_FLAG_NONE,
{
SPARM_NORMAL, 0, -5, 0, 0, 0,
@@ -1109,7 +1109,7 @@
/* 58: UNRAND_RESISTANCE */
{
"shield of Resistance", "bronze shield",
- OBJ_ARMOUR, ARM_SHIELD, +3, 0, LIGHTRED, 0,
+ OBJ_ARMOUR, ARM_SHIELD, +5, 0, LIGHTRED, 0,
UNRAND_FLAG_NONE,
{
SPARM_NORMAL, 0, 0, 0, 0, 0,
diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt
index 25d5956f0f..95b381db10 100644
--- a/crawl-ref/source/art-data.txt
+++ b/crawl-ref/source/art-data.txt
@@ -708,7 +708,7 @@ DESC_END: Presumably this relic led to the invention of the famous spell, or may
NAME: shield of Ignorance
APPEAR: dull large shield
OBJ: OBJ_ARMOUR/ARM_LARGE_SHIELD
-PLUS: +5
+PLUS: +8
COLOUR: BROWN
TILE: urand_ignorance
TILE_EQ: shield_of_ignorance
@@ -747,7 +747,7 @@ DESC_END: It allows its wearer to excel in the arts of thievery.
NAME: shield "Bullseye"
APPEAR: round shield
OBJ: OBJ_ARMOUR/ARM_SHIELD
-PLUS: +10
+PLUS: +15
COLOUR: RED
TILE: urand_bullseye
TILE_EQ: bullseye
@@ -866,7 +866,7 @@ DAM: 3
NAME: shield of Resistance
APPEAR: bronze shield
OBJ: OBJ_ARMOUR/ARM_SHIELD
-PLUS: +3
+PLUS: +5
COLOUR: LIGHTRED
TILE: urand_resistance
TILE_EQ: shield_of_resistance
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 96a3f4d3ed..755078c862 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -142,11 +142,11 @@ static armour_def Armour_prop[NUM_ARMOURS] =
true, EQ_BOOTS, SIZE_MEDIUM, SIZE_LARGE },
// Note: shields use ac-value as sh-value, EV pen is used for heavy_shield.
- { ARM_BUCKLER, "buckler", 3, 0, 90,
+ { ARM_BUCKLER, "buckler", 5, 0, 90,
true, EQ_SHIELD, SIZE_LITTLE, SIZE_MEDIUM },
- { ARM_SHIELD, "shield", 5, -1, 150,
+ { ARM_SHIELD, "shield", 8, -1, 150,
false, EQ_SHIELD, SIZE_SMALL, SIZE_BIG },
- { ARM_LARGE_SHIELD, "large shield", 7, -2, 230,
+ { ARM_LARGE_SHIELD, "large shield", 13, -2, 230,
false, EQ_SHIELD, SIZE_MEDIUM, SIZE_GIANT },
};
@@ -1017,6 +1017,11 @@ int armour_max_enchant( const item_def &item )
max_plus = MAX_ARM_ENCHANT;
}
+ if (eq_slot == EQ_SHIELD)
+ {
+ max_plus = 3;
+ }
+
return (max_plus);
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index fe7b7bca31..4340a1c6ab 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2301,37 +2301,59 @@ int player_mag_abil(bool is_weighted)
int player_shield_class(void) //jmf: changes for new spell
{
- int base_shield = 0;
+ int shield = 0;
+ int stat = 0;
+
+ if (you.incapacitated())
+ return (0);
if (player_wearing_slot(EQ_SHIELD))
{
const item_def& item = you.inv[you.equip[EQ_SHIELD]];
- base_shield = property(item, PARM_AC);
+ int base_shield = property(item, PARM_AC);
- int racial_bonus = _player_armour_racial_bonus(item) * 2 / 3;
+ int racial_bonus = _player_armour_racial_bonus(item);
// bonus applied only to base, see above for effect:
- base_shield *= (20 + you.skills[SK_SHIELDS] + racial_bonus);
- base_shield /= 20;
+ shield += base_shield * 100;
+ shield += base_shield * 5 * you.skills[SK_SHIELDS];
+ shield += base_shield * racial_bonus * 10 / 3;
- base_shield += item.plus;
+ shield += item.plus * 100;
+
+ if (item.sub_type == ARM_BUCKLER)
+ stat = you.dex * 38;
+ else if (item.sub_type == ARM_LARGE_SHIELD)
+ stat = you.dex * 12 + you.strength * 26;
+ else
+ stat = you.dex * 19 + you.strength * 19;
}
else
{
if (you.duration[DUR_MAGIC_SHIELD])
- base_shield = 2 + you.skills[SK_EVOCATIONS] / 6;
+ {
+ stat = 600 + you.skills[SK_EVOCATIONS] * 50;
+ shield += 300 + you.skills[SK_EVOCATIONS] * 25;
+ }
if (!you.duration[DUR_FIRE_SHIELD]
&& you.duration[DUR_CONDENSATION_SHIELD])
{
- base_shield += 2 + (you.skills[SK_ICE_MAGIC] / 6); // max 6
+ shield += 300 + (you.skills[SK_ICE_MAGIC] * 25);
+ stat = std::max(stat, you.intel * 38);
}
}
if (you.duration[DUR_DIVINE_SHIELD])
- base_shield += you.attribute[ATTR_DIVINE_SHIELD];
+ {
+ shield += you.attribute[ATTR_DIVINE_SHIELD] * 150;
+ stat = std::max(stat, int(you.attribute[ATTR_DIVINE_SHIELD] * 300));
+ }
+
+ if (shield + stat > 0)
+ shield += skill_bump(SK_SHIELDS) * 38;
- return (base_shield);
+ return (shield + stat + 50) / 100;
}
int player_sust_abil(bool calc_unid)
@@ -6097,31 +6119,10 @@ int player::shield_block_penalty() const
int player::shield_bonus() const
{
const int shield_class = player_shield_class();
- if (!shield_class)
+ if (shield_class <= 0)
return (-100);
- // Note that 0 is not quite no-blocking.
- if (incapacitated())
- return (0);
-
- int stat = 0;
- if (const item_def *sh = const_cast<player*>(this)->shield())
- {
- stat =
- sh->sub_type == ARM_BUCKLER? dex :
- sh->sub_type == ARM_LARGE_SHIELD? (3 * strength + dex) / 4:
- (dex + strength) / 2;
- }
- else
- {
- // Magical and divine shields are governed by the mind.
- stat = intel / 2;
- }
-
- return (random2(shield_class)
- + (random2(stat) / 4)
- + (random2(skill_bump(SK_SHIELDS)) / 4)
- - 1);
+ return random2avg(shield_class * 2, 2) / 3 - 1;
}
int player::shield_bypass_ability(int tohit) const