reimplement pull request #944 - grave contents
Pull request from entrez: if bones left dead hero's corpse on top of a new grave, don't find a corpse or summon a zombie when digging the grave up. It also removed the chance that a ghoul might be summoned when engraving on a headstone, switching to zombie or mummy instead. Rather than adopting the pull request, this retains summoning a ghoul via engraving and adds the possibly of doing so when kicking a headstone. Having a ghoul prowl around the grave is independent of whether there is a corpse or zombie inside the grave. To achieve this, another flag in 'struct rm' is needed; the single bit for 'disturbed' isn't sufficient. The bigger 'flags' field wasn't in use for graves so commandeer that for new 'emptygrave'. 'disturbed' still uses the 'horizontal' bit in order to have engraving and/or kicking summon at most one ghoul. Closes #944
This commit is contained in:
24
src/dig.c
24
src/dig.c
@@ -908,6 +908,7 @@ static void
|
||||
dig_up_grave(coord *cc)
|
||||
{
|
||||
struct obj *otmp;
|
||||
int what_happens;
|
||||
coordxy dig_x, dig_y;
|
||||
|
||||
if (!cc) {
|
||||
@@ -928,12 +929,15 @@ dig_up_grave(coord *cc)
|
||||
} else if (Role_if(PM_SAMURAI)) {
|
||||
adjalign(-sgn(u.ualign.type));
|
||||
You("disturb the honorable dead!");
|
||||
} else if ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10)) {
|
||||
adjalign(-sgn(u.ualign.type));
|
||||
} else if (u.ualign.type == A_LAWFUL) {
|
||||
if (u.ualign.record > -10)
|
||||
adjalign(-1);
|
||||
You("have violated the sanctity of this grave!");
|
||||
}
|
||||
|
||||
switch (rn2(5)) {
|
||||
/* -1: force default case for empty grave */
|
||||
what_happens = levl[dig_x][dig_y].emptygrave ? -1 : rn2(5);
|
||||
switch (what_happens) {
|
||||
case 0:
|
||||
case 1:
|
||||
You("unearth a corpse.");
|
||||
@@ -942,22 +946,24 @@ dig_up_grave(coord *cc)
|
||||
break;
|
||||
case 2:
|
||||
if (!Blind)
|
||||
pline(Hallucination ? "Dude! The living dead!"
|
||||
: "The grave's owner is very upset!");
|
||||
pline("%s!", Hallucination ? "Dude! The living dead"
|
||||
: "The grave's owner is very upset");
|
||||
(void) makemon(mkclass(S_ZOMBIE, 0), dig_x, dig_y, MM_NOMSG);
|
||||
break;
|
||||
case 3:
|
||||
if (!Blind)
|
||||
pline(Hallucination ? "I want my mummy!"
|
||||
: "You've disturbed a tomb!");
|
||||
pline("%s!", Hallucination ? "I want my mummy"
|
||||
: "You've disturbed a tomb");
|
||||
(void) makemon(mkclass(S_MUMMY, 0), dig_x, dig_y, MM_NOMSG);
|
||||
break;
|
||||
default:
|
||||
/* No corpse */
|
||||
pline_The("grave seems unused. Strange....");
|
||||
pline_The("grave is unoccupied. Strange...");
|
||||
break;
|
||||
}
|
||||
levl[dig_x][dig_y].typ = ROOM, levl[dig_x][dig_y].flags = 0;
|
||||
levl[dig_x][dig_y].typ = ROOM;
|
||||
levl[dig_x][dig_y].emptygrave = 0; /* clear 'flags' */
|
||||
levl[dig_x][dig_y].disturbed = 0; /* clear 'horizontal' */
|
||||
del_engr_at(dig_x, dig_y);
|
||||
newsym(dig_x, dig_y);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user