From 5e4ca0912ae656b9e2a55b95027ebc6f483a01a6 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 19 Sep 2007 22:54:50 +0000 Subject: Fixing a number of bugs on throwing nets, so it's all in all a net improvement. ;) I'm reusing item.plus2 as a marker for trapping monsters or not. AFAIK, missiles don't need those, and it makes stacking so much easier. Gladiators start with Throwing skill 1, except for Kobolds (don't get a net) who get an additional level at Dodging. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2149 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/traps.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/traps.cc') diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index ba48940ffc..8f08fce842 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -31,6 +31,7 @@ #include "spl-cast.h" #include "spl-util.h" #include "terrain.h" +#include "transfor.h" #include "tutorial.h" #include "view.h" @@ -108,8 +109,8 @@ void monster_caught_in_net(monsters *mon, bolt &pbolt) } const monsters* mons = static_cast(mon); - bool mon_flies = mons->flies(); - if (mon_flies && !mons_is_confused(mons)) + bool mon_flies = mons->flies() == FL_FLY; + if (mon_flies && (!mons_is_confused(mons) || one_chance_in(3))) { simple_monster_message(mon, " darts out from under the net!"); return; @@ -141,7 +142,13 @@ void player_caught_in_net() if (you.body_size(PSIZE_BODY) >= SIZE_GIANT) return; - if (you.flies() && !you.confused()) + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_AIR) + { + mpr("The net passes right through you!"); + return; + } + + if (you.flies() == FL_FLY && (!you.confused() || one_chance_in(3))) { mpr("You dart out from under the net!"); return; @@ -154,13 +161,12 @@ void player_caught_in_net() // I guess levitation works differently, keeping both you // and the net hovering above the floor - if (you.flies()) + if (you.flies() == FL_FLY) { mpr("You fall like a stone!"); fall_into_a_pool(you.x_pos, you.y_pos, false, grd[you.x_pos][you.y_pos]); } } - } static void dart_trap(bool trap_known, int trapped, bolt &pbolt, bool poison) @@ -579,7 +585,7 @@ void free_self_from_net(bool damage_net) if (mitm[net].plus < -7) { mpr("You rip the net and break free!"); - dec_mitm_item_quantity( net, 1 ); + destroy_item(net); you.attribute[ATTR_HELD] = 0; return; -- cgit v1.2.3-54-g00ecf