Skip to content

Commit 21eb7dd

Browse files
committed
Fix: Druid taking blame for pet killing a tree.
Recently, a player playing as a Druid had this happen to them: they have a pet titan. Pet titan starts attacking other monsters, one of those attacks, it cast the monster spell 'fire bolt' which causes an explosion. A live tree was next to the monster being attacked; the resulting explosion killed the tree. The player took the blame for killing the tree. Ugh. This commit fixes that issue, and while here I noticed a couple other spots could use the same treatment.
1 parent 4a11e79 commit 21eb7dd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3990,4 +3990,5 @@ The following changes to date are:
39903990
- Add clerical spellbook descriptions to the in-game encyclopedia
39913991
- Don't penalize a priest's alignment if they try to use a bladed
39923992
artifact weapon
3993+
- Fix: Druid taking blame for pet killing a tree
39933994

src/zap.c

+12-9
Original file line numberDiff line numberDiff line change
@@ -5311,7 +5311,8 @@ boolean say; /* Announce out of sight hit/miss events if true */
53115311
bhitpos.x = sx, bhitpos.y = sy;
53125312
/* Fireballs only damage when they explode */
53135313
if (type != ZT_SPELL(ZT_FIRE)) {
5314-
range += zap_over_floor(sx, sy, type, &shopdamage, 0, FALSE);
5314+
range += zap_over_floor(sx, sy, type, &shopdamage, 0,
5315+
(type >= 0 ? FALSE : TRUE));
53155316
/* zap with fire -> melt ice -> drown monster, so monster
53165317
found and cached above might not be here any more */
53175318
mon = m_at(sx, sy);
@@ -5723,6 +5724,8 @@ boolean moncast;
57235724
boolean see_it = cansee(x, y), yourzap;
57245725
int rangemod = 0, abstype = BASE_ZT(abs(type));
57255726

5727+
yourzap = (type >= 0 && !exploding_wand_typ && !moncast);
5728+
57265729
if (type == PHYS_EXPL_TYPE) {
57275730
/* this won't have any effect on the floor */
57285731
return -1000; /* not a zap anyway, shouldn't matter */
@@ -5777,7 +5780,7 @@ boolean moncast;
57775780
if (see_it)
57785781
pline("Steam billows from the fountain.");
57795782
rangemod -= 1;
5780-
dryup(x, y, (moncast || type < 0) ? FALSE : TRUE);
5783+
dryup(x, y, yourzap ? TRUE : FALSE);
57815784
} else if (IS_PUDDLE(lev->typ) || IS_SEWAGE(lev->typ)) {
57825785
if (see_it) {
57835786
if (IS_PUDDLE(lev->typ))
@@ -5803,7 +5806,7 @@ boolean moncast;
58035806
lev->typ = DEADTREE;
58045807
if (lev->typ == DEADTREE)
58055808
newsym(x, y);
5806-
if (type >= 0) {
5809+
if (yourzap) {
58075810
if (Role_if(PM_DRUID)) {
58085811
You_feel("very guilty.");
58095812
adjalign(-15);
@@ -5956,8 +5959,8 @@ boolean moncast;
59565959
lev->typ = ROOM, lev->flags = 0;
59575960
if (see_it)
59585961
newsym(x, y);
5959-
add_damage(x, y, (type >= 0) ? SHOP_BARS_COST : 0L);
5960-
if (type >= 0)
5962+
add_damage(x, y, yourzap ? SHOP_BARS_COST : 0L);
5963+
if (yourzap)
59615964
*shopdamage = TRUE;
59625965
} else {
59635966
lev->typ = DOOR, lev->doormask = D_NODOOR;
@@ -5974,7 +5977,6 @@ boolean moncast;
59745977

59755978
/* set up zap text for possible door feedback; for exploding wand, we
59765979
want "the blast" rather than "your blast" even if hero caused it */
5977-
yourzap = (type >= 0 && !exploding_wand_typ && !moncast);
59785980
zapverb = "blast"; /* breath attack or wand explosion */
59795981
if (!exploding_wand_typ) {
59805982
if (abs(type) < ZT_SPELL(0))
@@ -6072,7 +6074,7 @@ boolean moncast;
60726074
}
60736075
if (new_doormask >= 0) { /* door gets broken */
60746076
if (*in_rooms(x, y, SHOPBASE)) {
6075-
if (type >= 0 && !moncast) {
6077+
if (yourzap) {
60766078
add_damage(x, y, SHOP_DOOR_COST);
60776079
*shopdamage = TRUE;
60786080
} else /* caused by monster */
@@ -6095,13 +6097,14 @@ boolean moncast;
60956097
}
60966098

60976099
if (OBJ_AT(x, y) && abstype == ZT_FIRE)
6098-
if (burn_floor_objects(x, y, FALSE, (type > 0 && !moncast)) && couldsee(x, y)) {
6100+
if (burn_floor_objects(x, y, FALSE, yourzap ? TRUE : FALSE)
6101+
&& couldsee(x, y)) {
60996102
newsym(x, y);
61006103
You("%s of smoke.", !Blind ? "see a puff" : "smell a whiff");
61016104
}
61026105
if ((mon = m_at(x, y)) != 0) {
61036106
wakeup(mon, FALSE);
6104-
if (type >= 0 && !moncast) {
6107+
if (yourzap) {
61056108
setmangry(mon, TRUE);
61066109
if (mon->ispriest && *in_rooms(mon->mx, mon->my, TEMPLE))
61076110
ghod_hitsu(mon);

0 commit comments

Comments
 (0)