1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-28 16:32:27 +01:00

Add support for monsters finding other monsters by the "noise" they make.

Probably lots of cases uncovered at the moment, this was focused on combat.
This commit is contained in:
ChrisANG 2022-01-11 20:06:18 -05:00
parent 5d5eb43af4
commit 4d71d87b60
4 changed files with 10 additions and 2 deletions

View file

@ -157,7 +157,8 @@ struct monst {
Bitfield(mpetitioner,1);/* already dead (shouldn't leave a corpse) */ /*92*/
Bitfield(mdoubt,1);/* clerical spellcasting blocked */ /*93*/
Bitfield(menvy,1);/* wants only others stuff */ /*94*/
Bitfield(deadmonster,1); /* is DEADMONSTER */ /*95*/
Bitfield(deadmonster,1); /* is DEADMONSTER */ /*113*/
Bitfield(mnoise,1); /* is DEADMONSTER */ /*114*/
char mbdrown; /* drowning in blood */
char mtaneggs; /* tannin eggs */

View file

@ -2373,7 +2373,11 @@ mon_can_see_mon(looker, lookie)
return FALSE;
//can't feel target adjacent
}
/* Monsters that have recently made noise can be targeted by other monsters */
if(lookie->mnoise && !is_deaf(looker) && distmin(looker->mx,looker->my,lookie->mx,lookie->my) <= BOLT_LIM)
return TRUE;
/* 1/8 chance to stumble onto adjacent targets. Ish. */
if(distmin(looker->mx,looker->my,lookie->mx,lookie->my) <= 1 && !rn2(8))
return TRUE;
@ -5863,6 +5867,7 @@ register struct monst *mtmp;
if(mtmp->data->msound == MS_SHRIEK) {
if(flags.soundok) {
pline("%s shrieks.", Monnam(mtmp));
mtmp->mnoise = TRUE;
stop_occupation();
}
if (!rn2(10)) {

View file

@ -969,6 +969,7 @@ register struct monst *mtmp;
mdat = mtmp->data;
mtmp->mattackedu = 0; /*Clear out attacked bit*/
mtmp->mnoise = 0; /*Clear out noise bit*/
if(mdat->mtyp == PM_GNOLL_MATRIARCH){
if(!rn2(20)){

View file

@ -771,6 +771,7 @@ boolean chatting;
if (!canspotmon(mtmp) && distmin(u.ux,u.uy,mtmp->mx,mtmp->my) < 2 && ptr->msound != MS_SONG &&
ptr->msound != MS_INTONE && ptr->msound != MS_FLOWER && ptr->msound != MS_OONA
) map_invisible(mtmp->mx, mtmp->my);
mtmp->mnoise = TRUE;
if(mtmp->ispriest){
priest_talk(mtmp);