diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-20 12:23:38 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-20 12:23:38 +0000 |
commit | 5b618acbca35621d699dc4ba3064f2a3228a5131 (patch) | |
tree | d5a68990291723d0252b29dd9193bce34929f50b /crawl-ref/source/acr.cc | |
parent | 7ca7077ed3e60d71c79c22e07fd0d2491b861ca3 (diff) | |
download | crawl-ref-5b618acbca35621d699dc4ba3064f2a3228a5131.tar.gz crawl-ref-5b618acbca35621d699dc4ba3064f2a3228a5131.zip |
Added throwing nets. These still need work, and thus
are not for 0.3. Obviously.
Summary:
New item type MI_THROWING_NET.
The enchantment of a net describes its state, i.e.
whether it's brand-new or almost falling apart
(happens at -8).
New attribute ATTR_CAUGHT (for monsters ENCH_CAUGHT)
that means the victim cannot move and instead
struggles against the net until it manages to wriggle
out of it (takes a while depending on size) or it
is destroyed.
Monsters can still use items and spells when trapped.
New trap type TRAP_NET that currently is the only
source of throwing nets, though Gladiators (and some
types of hunters maybe?) should start with a few, and
David suggested also allowing the creation of nets
for shops.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2020 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index aefa1b1d2b..306a9ab252 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2572,6 +2572,14 @@ static void open_door(int move_x, int move_y, bool check_confused) struct dist door_move; int dx, dy; // door x, door y + if (you.attribute[ATTR_CAUGHT]) + { + // struggles against net, damaging it + free_self_from_net(true); + you.turn_is_over = true; + return; + } + if (check_confused && you.duration[DUR_CONF] && !one_chance_in(3)) { move_x = random2(3) - 1; @@ -2591,6 +2599,22 @@ static void open_door(int move_x, int move_y, bool check_confused) if (mon != NON_MONSTER && player_can_hit_monster(&menv[mon])) { + + if (mons_is_caught(&menv[mon])) + { + + std::string prompt = "Do you want to try to take the net off "; + prompt += (&menv[mon])->name(DESC_NOCAP_THE); + prompt += '?'; + + if (yesno(prompt.c_str(), true, 'n')) + { + remove_net_from(&menv[mon]); + return; + } + + } + you_attack(mgrd[dx][dy], true); you.turn_is_over = true; @@ -2932,6 +2956,14 @@ static void move_player(int move_x, int move_y) bool moving = true; // used to prevent eventual movement (swap) bool swap = false; + if (you.attribute[ATTR_CAUGHT]) + { + // tries to escape from net (without damaging it, takes longer) + free_self_from_net(false); + you.turn_is_over = true; + return; + } + if (you.duration[DUR_CONF]) { if (!one_chance_in(3)) |