diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-09 13:59:30 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-09 13:59:30 +0000 |
commit | 1c7e145a0a082b50c22ce53b6db7fccfc6ad9e31 (patch) | |
tree | 8ab3a0be1e727a6584d4727c0df5ff5a10c17918 /crawl-ref/source/traps.cc | |
parent | cd08ab62d681ee480339a2f26d833bf9d4104dda (diff) | |
download | crawl-ref-1c7e145a0a082b50c22ce53b6db7fccfc6ad9e31.tar.gz crawl-ref-1c7e145a0a082b50c22ce53b6db7fccfc6ad9e31.zip |
Rewrite of beam.cc: put all beam data in one place. Might be buggy.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7201 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r-- | crawl-ref/source/traps.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index 59fb01cfd7..6283c59aa5 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -857,12 +857,12 @@ static int damage_or_escape_net(int hold) int damage = -escape; // your weapon may damage the net, max. bonus of 2 - if (you.equip[EQ_WEAPON] != -1) + if (you.weapon()) { - if (can_cut_meat(you.inv[you.equip[EQ_WEAPON]])) + if (can_cut_meat(*you.weapon())) damage++; - - int brand = get_weapon_brand( you.inv[you.equip[EQ_WEAPON]] ); + + int brand = get_weapon_brand(*you.weapon()); if (brand == SPWPN_FLAMING || brand == SPWPN_VORPAL) damage++; } @@ -947,9 +947,9 @@ void free_self_from_net() { // For previously undamaged nets this takes at least 2 and at most // 8 turns. - bool can_slice = you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS - || you.equip[EQ_WEAPON] != -1 - && can_cut_meat(you.inv[you.equip[EQ_WEAPON]]); + bool can_slice = + (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS) + || (you.weapon() && can_cut_meat(*you.weapon())); int damage = -do_what; |