Fixes a lot of things related to disappearing mobs, including going upstairs/downstairs.
If you went up/down stairs, the mobs around you would vanish when you come back.
If you load the game, the monsters that loaded around you wouldn’t be stored to the map buffer and would eventually disappear when you went off screen.
If you teleport, the monsters in your current grid aren’t saved to the map buffer, so will disappear when you go back.
The above three issues are fixed.
Also fixes the stair buffer, so mobs can actually use stairs and won’t disappear, and saves it to file so they don’t vanish when they’re using the stairs.
Mobs will also now come out of the stairs they should. Previously they came out of the first stairs found by looping from a random location in the submap… which meant zombies could come out stairs from other houses’ basements instead of the one the player is in.
Plus, improved functionality:
Mobs can block you from using the stairs. You can try to slip past using a dex roll, or push past with a strength roll.
The mobs will still be stored in the stair buffer so they’ll pop out again. Before, the stair buffer was being wiped so they’d get lost in the stairs.
Because stairs are now fixed, the player can potentially block mobs infinitely by standing on the exit.
Now, I’ve allowed zombies to try and push you back. There’s a chance for you to stumble, meaning you won’t be able to simply go back on the stair tile.
This means the zombie will be able to get out, and prevents a potential exploit.
If the zombie can’t push you back for whatever reason (e.g. surrounded by obstacles), he will attack you instead, giving incentive for the player to try to slip past instead, or to unblock the stairs.