diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-07 14:27:25 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-07 14:27:25 +0000 |
commit | 78b92459956de8de4e93b9faf55879b08bcfc5d5 (patch) | |
tree | 80a21052ceb32988870cd94e76c7d6f563661484 | |
parent | b4f8ae64d6253f03df570388edd5d55d1b0553f1 (diff) | |
download | crawl-ref-78b92459956de8de4e93b9faf55879b08bcfc5d5.tar.gz crawl-ref-78b92459956de8de4e93b9faf55879b08bcfc5d5.zip |
Yet another change to escape/damage calculation for nets.
This one makes it less likely that a character switches from
damaging a net to trying to slip out of it (which would take
overall longer).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2782 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/traps.cc | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index c6b9f0cf54..d8e1043695 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -565,12 +565,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) { @@ -597,13 +591,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++; @@ -618,7 +605,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]) @@ -629,10 +616,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); } @@ -664,12 +661,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; @@ -713,9 +715,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]) |