Skip to content

Commit

Permalink
Fix for wand of digging/grave interaction:
Browse files Browse the repository at this point in the history
"If you dig downwards on a grave, you may dig up a corpse or a zombie or whatever. If you zap a wand of digging downwards on a hard-floored level, the same thing happens. But if you BREAK the wand of digging instead, it just creates pits."
  • Loading branch information
Chris-plus-alphanumericgibberish committed Jan 26, 2014
1 parent 469a398 commit 661f1f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions dnethack-3.4.3/include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ E void FDECL(bury_objs, (int,int));
E void FDECL(unearth_objs, (int,int));
E void FDECL(rot_organic, (genericptr_t, long));
E void FDECL(rot_corpse, (genericptr_t, long));
E void FDECL(dig_up_grave, (int, int));
#if 0
E void FDECL(bury_monst, (struct monst *));
E void NDECL(bury_you);
Expand Down
5 changes: 5 additions & 0 deletions dnethack-3.4.3/src/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -3122,10 +3122,15 @@ do_break_wand(obj)
watch_dig((struct monst *)0, x, y, TRUE);
if (*in_rooms(x,y,SHOPBASE)) shop_damage = TRUE;
}
if(IS_GRAVE(levl[x][y].typ)){
digactualhole(x, y, BY_OBJECT, PIT);
dig_up_grave(x,y);
} else{
digactualhole(x, y, BY_OBJECT,
(rn2(obj->spe) < 3 || !Can_dig_down(&u.uz)) ?
PIT : HOLE);
}
}
continue;
} else if(obj->otyp == WAN_CREATE_MONSTER) {
/* u.ux,u.uy creates it near you--x,y might create it in rock */
Expand Down
20 changes: 10 additions & 10 deletions dnethack-3.4.3/src/dig.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ STATIC_DCL void FDECL(mkcavearea, (BOOLEAN_P));
STATIC_DCL int FDECL(dig_typ, (struct obj *,XCHAR_P,XCHAR_P));
STATIC_DCL int NDECL(dig);
STATIC_DCL schar FDECL(fillholetyp, (int, int));
STATIC_DCL void NDECL(dig_up_grave);

/* Indices returned by dig_typ() */
#define DIGTYP_UNDIGGABLE 0
Expand Down Expand Up @@ -747,7 +746,7 @@ boolean pit_only;

} else if (IS_GRAVE(lev->typ)) {
digactualhole(u.ux, u.uy, BY_YOU, PIT);
dig_up_grave();
dig_up_grave(u.ux, u.uy);
return TRUE;
} else if (lev->typ == DRAWBRIDGE_UP) {
/* must be floor or ice, other cases handled above */
Expand Down Expand Up @@ -809,8 +808,9 @@ boolean pit_only;
return FALSE;
}

STATIC_OVL void
dig_up_grave()
void
dig_up_grave(x,y)
int x, y;
{
struct obj *otmp;

Expand All @@ -835,27 +835,27 @@ dig_up_grave()
case 0:
case 1:
You("unearth a corpse.");
if (!!(otmp = mk_tt_object(CORPSE, u.ux, u.uy)))
if (!!(otmp = mk_tt_object(CORPSE, x, y)))
otmp->age -= 100; /* this is an *OLD* corpse */;
break;
case 2:
if (!Blind) pline(Hallucination ? "Dude! The living dead!" :
"The grave's owner is very upset!");
(void) makemon(mkclass(S_ZOMBIE, Inhell ? G_HELL : G_NOHELL), u.ux, u.uy, NO_MM_FLAGS);
(void) makemon(mkclass(S_ZOMBIE, Inhell ? G_HELL : G_NOHELL), x, y, NO_MM_FLAGS);
break;
case 3:
if (!Blind) pline(Hallucination ? "I want my mummy!" :
"You've disturbed a tomb!");
(void) makemon(mkclass(S_MUMMY, Inhell ? G_HELL : G_NOHELL), u.ux, u.uy, NO_MM_FLAGS);
(void) makemon(mkclass(S_MUMMY, Inhell ? G_HELL : G_NOHELL), x, y, NO_MM_FLAGS);
break;
default:
/* No corpse */
pline_The("grave seems unused. Strange....");
break;
}
levl[u.ux][u.uy].typ = ROOM;
del_engr_ward_at(u.ux, u.uy);
newsym(u.ux,u.uy);
levl[x][y].typ = ROOM;
del_engr_ward_at(x, y);
newsym(x,y);
return;
}

Expand Down

0 comments on commit 661f1f3

Please sign in to comment.