Skip to content

Commit

Permalink
Monsters summoned via the monster spell CLC_INSECTS will rarely leave…
Browse files Browse the repository at this point in the history
… a corpse.
  • Loading branch information
k21971 committed Sep 19, 2024
1 parent e6105ba commit 242f29f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/evilhack-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3624,4 +3624,6 @@ The following changes to date are:
chests
- Fix: prevent lawful/neutral players from receiving an altar sacrifice
weapon gift with the venom object property
- Monsters summoned via the monster spell CLC_INSECTS will rarely leave
a corpse

3 changes: 2 additions & 1 deletion include/monst.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ struct monst {
Bitfield(mstonebyu, 1); /* you caused the monster to start stoning */
Bitfield(mstone, 3); /* monster is turning to stone */
Bitfield(mberserk, 1); /* monster is berserk */
/* 6 free bits */
Bitfield(minsects, 1); /* monster summoned via CLC_INSECTS spell */
/* 5 free bits */

uchar mwither; /* withering; amount of turns left till recovery */
uchar vuln_fire; /* timeout of temp vulnerability to fire */
Expand Down
2 changes: 2 additions & 0 deletions src/mcastu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ int spellnum;
if ((mtmp2 = makemon(pm, bypos.x, bypos.y, MM_ANGRY)) != 0) {
success = TRUE;
mtmp2->msleeping = mtmp2->mpeaceful = mtmp2->mtame = 0;
mtmp2->minsects = 1;
set_malign(mtmp2);
}
}
Expand Down Expand Up @@ -2547,6 +2548,7 @@ int spellnum;
if ((mtmp2 = makemon(pm, bypos.x, bypos.y, NO_MM_FLAGS)) != 0) {
success = TRUE;
mtmp2->msleeping = 0;
mtmp2->minsects = 1;
if (yours || mattk->mtame)
(void) tamedog(mtmp2, (struct obj *) 0);
else if (mattk->mpeaceful)
Expand Down
5 changes: 5 additions & 0 deletions src/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3742,6 +3742,11 @@ boolean was_swallowed; /* digestion */
struct permonst *mdat = mon->data;
int i, tmp;

/* insects/snakes/spiders brought about by the
monster spell CLC_INSECTS rarely leave a corpse */
if (rn2(50) && mon->minsects)
return FALSE;

if (mdat == &mons[PM_VLAD_THE_IMPALER] || mdat->mlet == S_LICH
|| mdat == &mons[PM_ALHOON] || mdat == &mons[PM_KAS]) {
if (cansee(mon->mx, mon->my) && !was_swallowed)
Expand Down
2 changes: 2 additions & 0 deletions src/zap.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,8 @@ boolean adjacentok; /* False: at obj's spot only, True: nearby is allowed */
mtmp2->mwither = 0;
mtmp2->mdiseased = 0;
mtmp2->msummoned = 0;
mtmp2->mberserk = 0;
mtmp2->minsects = 0;
mtmp2->uexp = 0;
/* when traits are for a shopeekper, dummy monster 'mtmp' won't
have necessary eshk data for replmon() -> replshk() */
Expand Down

0 comments on commit 242f29f

Please sign in to comment.