Hostile monsters wandering across a grid they consider "interesting" may note it down as patrolling point to return to. There's currently no way of deleting such a patrol point short of enslaving the monster. As before, patrolling only applies while wandering. Other behaviour modes (chasing the player etc.) take precedence.
For now interesting grids are:
To test these changes, I've modified the stealth checks for wizard mode: If you set the Stealth skill to a value greater than 27 (possible in wizmode) hostile monsters will ignore you, i.e. not set MHITYOU if you are nearby. Noises will still wake monsters, and they'll hit you if they walk into you (or vice versa), but they won't target you.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5313 c06c8d41-db1a-0410-9941-cceddc491573
3OFG2YD2UOHC6UA7H7LWKOWCNFFSTDOXAA6L3KC335OF5RV3YOYQC
WQLOHSNCA3VOMDJF6IINJYKSYVYZEBPJJWBB33QSNE4RP5HEXPMAC
ARP25R4B66WPY56X77RRYLHDTIVGZCG2GQGV5WX2UX3DUAS2SAAQC
OREY5XZ7FHN4UHDW4E6EQKGZHQUGK26LOGVHLKFN3YJI3B2734BAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
I2B33Z7NZGC33AMDSSK446AZZYWKPHWLAGULVHKKZU4MVB4BNJOAC
HH3HFWVXABJ4IRMN22PPJCREMULZSN6DA7VYKOGECGMNUQTZ5QNQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
X5WLJCJVW55SXZVP7IKP7ADCJIGNKN4PKAXFECVR6TNK7XSMZR7QC
GXXYPBFEWKRZQ6OBGYNS2EXZN52NGNV3UU3WM6S5R74CMJBAKGTAC
INWKDE6QMV7PUWMZ65IZTUF4WB2G2OR2Q2NPTNID4Y3NVD7JWN3AC
JM7UAK777RAVDAVLQLEOBRTGNW2B47S5G55XITJXO243IUNZHVYQC
UWMN4HLG6YA2YFQEVIVMDISD6APKEPIZXMMPMNUYCBQDSAUYSXPQC
// critters that are wandering still have MHITYOU as their foe are
// still actively on guard for the player, even if they can't see
// him. Give them a large bonus (handle_behaviour() will nuke 'foe'
// after a while, removing this bonus.
// Critters that are wandering but still have MHITYOU as their foe are
// still actively on guard for the player, even if they can't see you.
// Give them a large bonus -- handle_behaviour() will nuke 'foe' after
// a while, removing this bonus.
// If prefer_named is true, named monsters (including uniques) are twice as
// likely to get chosen compared with non-named ones.
// If prefer_named is true, named monsters (including uniques) are twice
// as likely to get chosen compared to non-named ones.
// Altars as well as branch entrances are considered interesting
// for some monster types.
static bool _mon_on_interesting_grid(monsters *mon)
{
// Patrolling shouldn't happen all the time.
if (one_chance_in(4))
return (false);
const dungeon_feature_type feat = grd[mon->x][mon->y];
switch (feat)
{
// Holy beings will tend to patrol around altars to the good gods.
case DNGN_ALTAR_ELYVILON:
if (!one_chance_in(3))
return (false);
// else fall through
case DNGN_ALTAR_ZIN:
case DNGN_ALTAR_SHINING_ONE:
return (mons_holiness(mon) == MH_HOLY);
// Orcs will tend to patrol around altars to Beogh, and guard the
// stairway from and to the Orcish Mines.
case DNGN_ALTAR_BEOGH:
case DNGN_ENTER_ORCISH_MINES:
case DNGN_RETURN_FROM_ORCISH_MINES:
return (mons_species(mon->type) == MONS_ORC);
// Same for elves and the Elven Halls.
case DNGN_ENTER_ELVEN_HALLS:
case DNGN_RETURN_FROM_ELVEN_HALLS:
return (mons_species(mon->type) == MONS_ELF);
// Killer bees always return to their hive.
case DNGN_ENTER_HIVE:
return (mons_species(mon->type == MONS_KILLER_BEE)
|| mons_species(mon->type == MONS_KILLER_BEE_LARVA));
default:
return (false);
}
}
// If a hostile monster finds itself on a grid of an "interesting" feature,
// while unoccupied, it will remain in that area, and try to return to it
// if it left it for fighting, seeking etc.
static void _maybe_set_patrol_route(monsters *monster)
{
if (monster->behaviour == BEH_WANDER
&& !mons_friendly(monster)
&& !monster->is_patrolling()
&& _mon_on_interesting_grid(monster))
{
monster->patrol_point = coord_def(monster->x, monster->y);
}
}