summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2014-03-12 18:10:22 -0230
committerDracoOmega <draco_omega@live.com>2014-03-12 19:52:16 -0230
commitb7d8f5a35a2be79f042381b88304f83e77aa769c (patch)
tree8edca68a554da9a9f5afadcc389bebb1a79c29bf /crawl-ref/source/traps.cc
parentcd79464d151ff210f3dc0d83870b6f604f355554 (diff)
downloadcrawl-ref-b7d8f5a35a2be79f042381b88304f83e77aa769c.tar.gz
crawl-ref-b7d8f5a35a2be79f042381b88304f83e77aa769c.zip
Remove throwing net degradation, instead mulch probabilistically
Instead of throwing nets accumulating persistent damage as monsters struggled against them (and then becoming impossible to stack in your inventory afterward), they are either outright destroyed by the struggle or remain in normal condition. This should make them a little less cumbersome to use. This commit doesn't actually touch any of the escape formulas (which are an impressive snarl that could definitely use tending to), since probably they would need rewriting from scratch and I didn't want to undertake that so close to 0.14, with various other things still in the air.
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 8671563b74..270b529c91 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -436,7 +436,7 @@ void check_net_will_hold_monster(monster* mons)
{
const int net = get_trapping_net(mons->pos());
if (net != NON_ITEM)
- remove_item_stationary(mitm[net]);
+ free_stationary_net(net);
if (mons->is_insubstantial())
{
@@ -1409,7 +1409,7 @@ void free_self_from_net()
you.attribute[ATTR_HELD] = 0;
you.redraw_quiver = true;
you.redraw_evasion = true;
- remove_item_stationary(mitm[net]);
+ free_stationary_net(net);
return;
}
@@ -1422,6 +1422,23 @@ void free_self_from_net()
}
}
+void free_stationary_net(int item_index)
+{
+ item_def &item = mitm[item_index];
+ if (item.base_type == OBJ_MISSILES && item.sub_type == MI_THROWING_NET)
+ {
+ // Probabilistically mulch net based on damage done, otherwise
+ // reset damage counter (ie: item.plus).
+ if (x_chance_in_y(-item.plus, 9))
+ destroy_item(item_index);
+ else
+ {
+ item.plus = 0;
+ item.plus2 = 0;
+ }
+ }
+}
+
void clear_trapping_net()
{
if (!you.attribute[ATTR_HELD])
@@ -1432,7 +1449,7 @@ void clear_trapping_net()
const int net = get_trapping_net(you.pos());
if (net != NON_ITEM)
- remove_item_stationary(mitm[net]);
+ free_stationary_net(net);
you.attribute[ATTR_HELD] = 0;
you.redraw_quiver = true;