summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/random.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-23 20:07:12 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-24 01:53:09 +0530
commit29850c7c4740a653704157be9218272aa085a71d (patch)
treeb2faad92b38f92a83f28913a9d2303bb2b59ba37 /crawl-ref/source/random.cc
parent7149ab91fba371cc0e02526e8a31b4fe1cce1b10 (diff)
downloadcrawl-ref-29850c7c4740a653704157be9218272aa085a71d.tar.gz
crawl-ref-29850c7c4740a653704157be9218272aa085a71d.zip
AC/EV changes as outlined on CDO wiki.
The first iteration of AC/EV changes as described on http://crawl.develz.org/wiki/doku.php?id=dcss:brainstorm:misc:ac Although the distinction between heavy and light armour has been removed for the actual AC and EV calculations, the heavy/light armour distinction is still in place for skill training. Skill training is not modified in any way by this change. Change details follow, with Armour = armour skill, Dodge = Dodging skill: New total AC = base_AC * (23 + effective_armour_skill) / 23 + enchantments + modifiers Where - effective_armour_skill = armour skill + racial armour skill bonus. - enchantments = armour enchantments - modifiers = transforms, mutations, etc. affecting AC. New guaranteed damage reduction: = body_base_AC*(13+Armour)/17 * max_dam/100 New total EV: = 10 + size + (7 * Dodge * Dex) / (20 * AEVP - size) - AEVP - ASP + bonuses Where size = 2 * (medium - body_size) having: body_size be one of: tiny = 0 little = 1 small = 2 medium = 3 large = 4 big = 5 giant = 6 huge = 7 For ref: halfling = small, human = medium, ogre = large, dragon = huge AEVP (adjusted evasion penalty for armour): = body_AEVP + piece_EVP Where body_AEVP is for the body armour, calculated as: = (EVP + MAX(0, 3*EVP - Str)) * (45 - Armour) /45 where EVP = base evasion penalty of the armour piece_EVP is the sum of the base evasion penalties of the non-body armour worn, excluding shields. Currently this is only applicable to bardings (EVP of 2). ASP (adjusted shield evasion penalty): = SP - (1 + Shields) / (2 * (5 + size)) where SP = 1 for buckler, 3 for shield, 5 for large shield New spellcasting penalty: = 25 * (body_AEVP + ASP) - 20 - race_mod where race_mod = 25 for elven, -15 for dwarven, 15 for races in their native armour. New combat penalties: - to-hit penalty = 1d(body_AEVP) + 1d(ASP) - to-hit penalty for 1.5 hand weapons = 1d(body_AEVP) + 2d(ASP) - to-dam penalty for 1.5 hand = 1d(ASP) - base_delay is unchanged if body_AEVP is 0, otherwise: - base_delay = max(base_delay, 1d10 + 1d(body_AEVP)) - base_delay for unarmed = max(base_delay, 1d10 + 2d(body_AEVP)) - final_delay += min(1d(body_AEVP), 1d(body_AEVP)) - final_delay for 1.5 hand += min(1d(body_AEVP) + 1dASP, 1d(body_AEVP) + 1dASP) 1.5-hand weapons now receive penalties when wearing shields, whereas before they had bonuses handed out when *not* wearing shields. To compensate for this, more or less, I've changed existing hand-and-halfer stats as follows (dam/hit/attack delay): - katana 13/2/13 -> 14/3/12 - blessed katana 14/1/13 -> 15/2/12 - double sword 15/-2/16 -> 16/-1/15 - blessed dbl swd 15/-2/15 -> 16/-1/14 - broad axe 14/-2/17 -> 14/-2/16 (axes don't need help :P) - spear 6/3/12 -> 7/4/11 - trident 9/2/14 -> 10/3/13 - demon trident 13/0/14 -> 14/1/13 These changes do not match the old 1.5 hander behaviour - they make hand and halfers stronger, because the boost is to base damage, whereas the old behaviour was to boost damage after weapon skill was applied. The 1.5 hander changes will probably need to be discussed and revisited.
Diffstat (limited to 'crawl-ref/source/random.cc')
-rw-r--r--crawl-ref/source/random.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/random.cc b/crawl-ref/source/random.cc
index eb6f8d95dc..4a156ede7f 100644
--- a/crawl-ref/source/random.cc
+++ b/crawl-ref/source/random.cc
@@ -122,6 +122,14 @@ int maybe_random2(int x, bool random_factor)
return (x / 2);
}
+int maybe_roll_dice(int num, int size, bool random)
+{
+ if (random)
+ return (roll_dice(num, size));
+ else
+ return ((num + num * size) / 2);
+}
+
int roll_dice(int num, int size)
{
int ret = 0;