digging conjoined pits (trunk only)

This one turned out to be more effort than I had
originally anticipated.

We had a bug report requesting that zapping a wand of digging
laterally while in a pit should dig beside you. That seemed
like a reasonable enough request, but this ended up with
the following results:
- needed to check where this should not be permitted, or at
  least where there should be special-case code because there is
  something such as furniture on the surface above the dig
  point.
- now tracks conjoined pits through new fields in the trap
  structure, hence the pathlevel increment. The array of
  8 boolean values represents each of the 8 directions
  around a pit.
- Previously, pits could be adjacent to each other as two
  individual pits, in which case moving between them
  results in a fall as you went into the next pit. That
  behavior is preserved.
- Pits created either by zapping a wand of digging
  laterally while in a pit, or by "clearing debris"
  between two adjacent pits via a pick-axe, sets the
  conjoined fields for those two pits. You cannot
  create a brand new adjacent pit via pick-axe, only
  with the wand.
- The hero can pass between conjoined pits without
  falling.
- dighole() was hijacked for adjacent pit digging,
  so the ability to pass coordinates to it and
  its downstream functions was added (dig_up_grave()
  for example). dighole() does pretty much everything
  appropriately for this adjacent digging, more so
  than calling digactualhole() directly.
- moving into a conjoined pit that has spikes still
  does damage, but less so that "falling" into the
  spiked pit, and you "step on" the spikes rather
  than falling into them.
- Not done: should pits with the conjoined fields
  set be referred to as 'trenches' rather than pits
  in messages and identifications?
This commit is contained in:
nethack.allison
2006-03-19 23:59:03 +00:00
parent 3299e318ca
commit 6ef8efcefb
9 changed files with 414 additions and 65 deletions

View File

@@ -254,7 +254,7 @@ E int NDECL(dig);
E int NDECL(holetime);
E boolean FDECL(dig_check, (struct monst *, BOOLEAN_P, int, int));
E void FDECL(digactualhole, (int,int,struct monst *,int));
E boolean FDECL(dighole, (BOOLEAN_P));
E boolean FDECL(dighole, (BOOLEAN_P, coord *));
E int FDECL(use_pick_axe, (struct obj *));
E int FDECL(use_pick_axe2, (struct obj *));
E boolean FDECL(mdig_tunnel, (struct monst *));
@@ -268,8 +268,9 @@ E void FDECL(rot_corpse, (genericptr_t, long));
E struct obj *FDECL(buried_ball, (coord *));
E void NDECL(buried_ball_to_punishment);
E void NDECL(buried_ball_to_freedom);
E schar FDECL(fillholetyp, (int, int));
E schar FDECL(fillholetyp, (int,int,BOOLEAN_P));
E void FDECL(liquid_flow, (XCHAR_P,XCHAR_P,SCHAR_P,struct trap *, const char *));
E boolean FDECL(conjoined_pits, (struct trap *,struct trap *,BOOLEAN_P));
#if 0
E void FDECL(bury_monst, (struct monst *));
E void NDECL(bury_you);

View File

@@ -13,7 +13,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 26
#define EDITLEVEL 27
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2006"

View File

@@ -10,6 +10,7 @@
union vlaunchinfo {
short v_launch_otyp; /* type of object to be triggered */
coord v_launch2; /* secondary launch point (for boulders) */
boolean v_conjoined[8]; /* conjoined pit locations */
};
struct trap {
@@ -30,6 +31,7 @@ struct trap {
union vlaunchinfo vl;
#define launch_otyp vl.v_launch_otyp
#define launch2 vl.v_launch2
#define conjoined vl.v_conjoined
};
extern struct trap *ftrap;