digging land mines & bear traps (trunk only)

<Someone> suggested that digging down on a land mine with a pick-axe ought
to set if off.  I agree; this implements that and also for bear traps.  In
the bear trap case, if you dig down once trapped, you will destroy that
trap explicitly rather than replace it with a pit, so it's now possible to
escape from one without leaving another trap in your wake.  Once the bear
trap is gone, further digging there will make a pit as usual.  While stuck
in one, digging down poses a modest risk of harming yourself.

|You now wield a pick-axe.
|You start digging downward.  A bear trap closes on your foot!
|You start digging downward.  You destroy the bear trap with your pick-axe.
|You continue digging downward.  You dig a pit in the floor.
|You start digging downward.  You dig a hole through the floor.
|You fall through...

[It seems a bit strange that finishing a pit discards all digging context,
so that resuming within the pit in order to make a hole "starts" digging
rather than "continues" it.]

     Digging down with a wand or spell will disarm these two types of traps
and then leave the corresponding object (which may or may not fall through
the resulting hole, like any other object there).  Digging to the side via
magic while trapped in a pit will also disarm such traps when it encounters
them.  (When not in a pit, a digging beam which simply passes over an armed
bear trap or land mine won't have any effect on the trap.)  Digging to the
side via tool behaves somewhat oddly ("no room for the rubble"?) and will
probably need some tweaking before eventual release; at present it doesn't
reach adjacent traps so didn't need any land mine or bear trap handling.

     I put the fixes entry in the new features section.
This commit is contained in:
nethack.rankin
2006-04-08 06:55:15 +00:00
parent 27dcb8e34a
commit 51d60d9721
5 changed files with 92 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)hack.h 3.5 2006/02/03 */
/* SCCS Id: @(#)hack.h 3.5 2006/04/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -231,10 +231,11 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define PICK_RIGID 1
/* Flags to control dotrap() in trap.c */
#define NOWEBMSG 0x01 /* suppress stumble into web message */
#define FORCEBUNGLE 0x02 /* adjustments appropriate for bungling */
#define RECURSIVETRAP 0x04 /* trap changed into another type this same turn */
#define TOOKPLUNGE 0x08 /* used '>' to enter pit below you */
#define FORCETRAP 0x01 /* triggering not left to chance */
#define NOWEBMSG 0x02 /* suppress stumble into web message */
#define FORCEBUNGLE 0x04 /* adjustments appropriate for bungling */
#define RECURSIVETRAP 0x08 /* trap changed into another type this same turn */
#define TOOKPLUNGE 0x10 /* used '>' to enter pit below you */
/* Flags to control test_move in hack.c */
#define DO_MOVE 0 /* really doing the move */