Blame hero for broken digging wand shop damage
This commit is contained in:
@@ -560,16 +560,15 @@ void
|
|||||||
digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
||||||
{
|
{
|
||||||
struct obj *oldobjs, *newobjs;
|
struct obj *oldobjs, *newobjs;
|
||||||
register struct trap *ttmp;
|
struct trap *ttmp;
|
||||||
const char *surface_type, *tname, *in_thru;
|
const char *surface_type, *tname, *in_thru;
|
||||||
char furniture[BUFSZ];
|
char furniture[BUFSZ];
|
||||||
struct rm *lev = &levl[x][y];
|
struct rm *lev = &levl[x][y];
|
||||||
boolean shopdoor;
|
|
||||||
struct monst *mtmp = m_at(x, y); /* may be madeby */
|
struct monst *mtmp = m_at(x, y); /* may be madeby */
|
||||||
boolean madeby_u = (madeby == BY_YOU);
|
boolean madeby_u = (madeby == BY_YOU), madeby_obj = (madeby == BY_OBJECT),
|
||||||
boolean madeby_obj = (madeby == BY_OBJECT);
|
/* BY_OBJECT means the hero broke a wand, so blame her for it */
|
||||||
boolean at_u = u_at(x, y);
|
heros_fault = (madeby_u || madeby_obj);
|
||||||
boolean wont_fall = Levitation || Flying;
|
boolean shopdoor, at_u = u_at(x, y), wont_fall = Levitation || Flying;
|
||||||
int old_typ, old_aligntyp = A_NONE;
|
int old_typ, old_aligntyp = A_NONE;
|
||||||
|
|
||||||
if (at_u && u.utrap) {
|
if (at_u && u.utrap) {
|
||||||
@@ -611,7 +610,7 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
if (!ttmp)
|
if (!ttmp)
|
||||||
return;
|
return;
|
||||||
newobjs = gl.level.objects[x][y];
|
newobjs = gl.level.objects[x][y];
|
||||||
ttmp->madeby_u = madeby_u;
|
ttmp->madeby_u = heros_fault;
|
||||||
ttmp->tseen = 0;
|
ttmp->tseen = 0;
|
||||||
if (cansee(x, y))
|
if (cansee(x, y))
|
||||||
seetrap(ttmp);
|
seetrap(ttmp);
|
||||||
@@ -634,18 +633,17 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
if (IS_FURNITURE(old_typ) && cansee(x, y))
|
if (IS_FURNITURE(old_typ) && cansee(x, y))
|
||||||
pline_The("%s falls into the %s!", furniture, tname);
|
pline_The("%s falls into the %s!", furniture, tname);
|
||||||
/* wrath should immediately follow altar destruction message */
|
/* wrath should immediately follow altar destruction message */
|
||||||
if ((madeby_u || madeby_obj) && old_typ == ALTAR)
|
if (heros_fault && old_typ == ALTAR)
|
||||||
desecrate_altar(FALSE, old_aligntyp);
|
desecrate_altar(FALSE, old_aligntyp);
|
||||||
|
|
||||||
/* now deal with actual post-trap creation effects */
|
/* now deal with actual post-trap creation effects */
|
||||||
if (ttyp == PIT) {
|
if (ttyp == PIT) {
|
||||||
if (madeby_u) {
|
if (shopdoor && heros_fault)
|
||||||
if (shopdoor)
|
pay_for_damage("ruin", FALSE);
|
||||||
pay_for_damage("ruin", FALSE);
|
else
|
||||||
else
|
add_damage(x, y, heros_fault ? SHOP_PIT_COST : 0L);
|
||||||
add_damage(x, y, SHOP_PIT_COST);
|
if (madeby_u)
|
||||||
wake_nearby();
|
wake_nearby();
|
||||||
}
|
|
||||||
/* in case we're digging down while encased in solid rock
|
/* in case we're digging down while encased in solid rock
|
||||||
which is blocking levitation or flight */
|
which is blocking levitation or flight */
|
||||||
switch_terrain();
|
switch_terrain();
|
||||||
@@ -691,18 +689,15 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
impact_drop((struct obj *) 0, x, y, 0);
|
impact_drop((struct obj *) 0, x, y, 0);
|
||||||
if (oldobjs != newobjs)
|
if (oldobjs != newobjs)
|
||||||
(void) pickup(1);
|
(void) pickup(1);
|
||||||
if (shopdoor && madeby_u)
|
if (shopdoor && heros_fault)
|
||||||
pay_for_damage("ruin", FALSE);
|
pay_for_damage("ruin", FALSE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
d_level newlevel;
|
d_level newlevel;
|
||||||
|
|
||||||
if (*u.ushops && madeby_u)
|
if (*u.ushops && heros_fault)
|
||||||
shopdig(1); /* shk might snatch pack */
|
shopdig(1); /* shk might snatch pack */
|
||||||
/* handle earlier damage, eg breaking wand of digging */
|
else /* handle any earlier hero-caused damage */
|
||||||
else if (!madeby_u)
|
|
||||||
pay_for_damage("dig into", TRUE);
|
pay_for_damage("dig into", TRUE);
|
||||||
|
|
||||||
You("fall through...");
|
You("fall through...");
|
||||||
/* Earlier checks must ensure that the destination
|
/* Earlier checks must ensure that the destination
|
||||||
* level exists and is in the present dungeon.
|
* level exists and is in the present dungeon.
|
||||||
@@ -714,7 +709,7 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
spoteffects(FALSE);
|
spoteffects(FALSE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (shopdoor && madeby_u)
|
if (shopdoor && heros_fault)
|
||||||
pay_for_damage("ruin", FALSE);
|
pay_for_damage("ruin", FALSE);
|
||||||
if (newobjs)
|
if (newobjs)
|
||||||
impact_drop((struct obj *) 0, x, y, 0);
|
impact_drop((struct obj *) 0, x, y, 0);
|
||||||
|
|||||||
@@ -3774,7 +3774,7 @@ add_damage(
|
|||||||
tmp_dam->flags = levl[x][y].flags;
|
tmp_dam->flags = levl[x][y].flags;
|
||||||
tmp_dam->next = gl.level.damagelist;
|
tmp_dam->next = gl.level.damagelist;
|
||||||
gl.level.damagelist = tmp_dam;
|
gl.level.damagelist = tmp_dam;
|
||||||
/* If player saw damage, display as a wall forever */
|
/* If player saw damage, display walls post-repair as walls, not stone */
|
||||||
if (cansee(x, y))
|
if (cansee(x, y))
|
||||||
levl[x][y].seenv = SVALL;
|
levl[x][y].seenv = SVALL;
|
||||||
}
|
}
|
||||||
@@ -4478,7 +4478,7 @@ makekops(coord* mm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pay_for_damage(const char* dmgstr, boolean cant_mollify)
|
pay_for_damage(const char *dmgstr, boolean cant_mollify)
|
||||||
{
|
{
|
||||||
register struct monst *shkp = (struct monst *) 0;
|
register struct monst *shkp = (struct monst *) 0;
|
||||||
char shops_affected[5];
|
char shops_affected[5];
|
||||||
|
|||||||
Reference in New Issue
Block a user