summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-07 14:37:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-07 14:37:54 +0000
commit8933fdc219f04d51aa604c71dbb9d76ad20eefe5 (patch)
tree56719429df48d0cf61fd159b22d834849d0884bc /crawl-ref/source/traps.cc
parent3cedc3206bdc043b1dec15cb2ae86ed4f6f88536 (diff)
downloadcrawl-ref-8933fdc219f04d51aa604c71dbb9d76ad20eefe5.tar.gz
crawl-ref-8933fdc219f04d51aa604c71dbb9d76ad20eefe5.zip
latest net improvement (make switching damage -> escape rarer) for trunk
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2783 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc42
1 files changed, 23 insertions, 19 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 8f281ebd36..299f5d277b 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -628,12 +628,6 @@ static int damage_or_escape_net(int hold)
int damage = -escape;
- if (escape == 0) // middle-sized creatures are at a disadvantage
- {
- escape += coinflip();
- damage += coinflip();
- }
-
// your weapon may damage the net, max. bonus of 2
if (you.equip[EQ_WEAPON] != -1)
{
@@ -660,13 +654,6 @@ static int damage_or_escape_net(int hold)
if (you.duration[DUR_BERSERKER])
damage += 2;
- // damaged nets are easier to slip out of
- if (hold < 0)
- {
- escape += random2(-hold/2) + 1;
- damage += random2(-hold/3) + 1; // ... and easier to destroy
- }
-
// check stats
if (you.strength > random2(18))
damage++;
@@ -681,7 +668,7 @@ static int damage_or_escape_net(int hold)
damage++;
escape++;
}
-
+
// confusion makes the whole thing somewhat harder
// (less so for trying to escape)
if (you.duration[DUR_CONF])
@@ -692,10 +679,20 @@ static int damage_or_escape_net(int hold)
damage -= 2;
}
+ // damaged nets are easier to destroy
+ if (hold < 0)
+ {
+ damage += random2(-hold/3 + 1);
+
+ // ... and easier to slip out of (but only if escape looks feasible)
+ if (you.attribute[ATTR_HELD] < 5 || escape >= damage)
+ escape += random2(-hold/2) + 1;
+ }
+
// if undecided, choose damaging approach (it's quicker)
if (damage >= escape)
return (-damage); // negate value
-
+
return (escape);
}
@@ -727,12 +724,17 @@ void free_self_from_net()
&& can_cut_meat(you.inv[you.equip[EQ_WEAPON]]);
int damage = -do_what;
+
if (damage < 1)
damage = 1;
-
+
if (you.duration[DUR_BERSERKER])
damage *= 2;
+ // medium sized characters are at disadvantage and sometimes get a bonus
+ if (you.body_size(PSIZE_BODY) == SIZE_MEDIUM)
+ damage += coinflip();
+
if (damage > 5)
damage = 5;
@@ -776,9 +778,11 @@ void free_self_from_net()
if (you.duration[DUR_HASTE]) // extra bonus, also Berserk
escape++;
- if (escape < 1)
- escape = 1;
- else if (escape > 4)
+ // medium sized characters are at disadvantage and sometimes get a bonus
+ if (you.body_size(PSIZE_BODY) == SIZE_MEDIUM)
+ escape += coinflip();
+
+ if (escape > 4)
escape = 4;
if (escape >= you.attribute[ATTR_HELD])