Monster known traps bit twiddling

This commit is contained in:
Pasi Kallinen
2022-08-21 11:36:39 +03:00
parent 96e9534289
commit 953d43f5ac
10 changed files with 47 additions and 18 deletions

View File

@@ -1252,13 +1252,15 @@ makemon(
else
mtmp->female = femaleok ? rn2(2) : 0;
if (In_sokoban(&u.uz) && !mindless(ptr)) /* know about traps here */
mtmp->mtrapseen = (1L << (PIT - 1)) | (1L << (HOLE - 1));
if (In_sokoban(&u.uz) && !mindless(ptr)) { /* know about traps here */
mon_learns_traps(mtmp, PIT);
mon_learns_traps(mtmp, HOLE);
}
if (Is_stronghold(&u.uz) && !mindless(ptr)) /* know about the trap doors */
mtmp->mtrapseen = (1L << (TRAPDOOR - 1));
mon_learns_traps(mtmp, TRAPDOOR);
/* quest leader and nemesis both know about all trap types */
if (ptr->msound == MS_LEADER || ptr->msound == MS_NEMESIS)
mtmp->mtrapseen = ~0;
mon_learns_traps(mtmp, ALL_TRAPS);
place_monster(mtmp, x, y);
mtmp->mcansee = mtmp->mcanmove = TRUE;