This feature is originally from SliceHack, but the original code directly edited the monmove code, whereas I thought it was cleaner to use the existing mtrapseen code. Thus, this commit just marks trapdoors as "seen" for all non-mindless monsters generated in the Castle level (the same way all monsters in Sokoban are marked aware of pits and holes). This change prevents these Castle monsters from moving onto trapdoors 97.5% of the time. (A determined player can still patiently sit and wait for everyone in the castle to plunge like lemmings into the trapdoors, but it will now take 40 times as long.) Also unlike SliceHack, this only excludes mindless monsters - not all non-humanoids. There are plenty of intelligent non-humanoid monsters generated right next to the trapdoors, after all. This is aimed at better flavor (the inhabitants of the castle should know about the traps in their own area) and better scenery in the Valley (doesn't seem as much of a valley of the dead if there are hordes of soldiers milling around down there). I considered sticking an in_mklev condition onto this if statement, so that monsters spawned into the Castle after its creation will fall down the trapdoors, but ultimately decided against it.
78 KiB
78 KiB