the patrol centre, make it more likely to return to the patrol area if the monster left it somehow but is still nearby, and make friendly monsters move around the player on their way to their target.
Also, highlight wizard commands in the wizard help.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5252 c06c8d41-db1a-0410-9941-cceddc491573
LTX72QGIPNUGWQN5ULPOMFCOPZTK7472DQY4AYX5WM3WHSUVXI5QC
XL76SC3IJRRKWPA6L3BWJWCMZBM4Q5VYOLTWUG3XGM22MO6PFE3AC
P5TRGRH7XMQSPCZKM5IEEO34TY6WMLGHHX7BU6Y453JFRXLUR2VQC
ZGZVOMRXLVC42FV67RBTLBOZWFYRL4UHL54A365BR76OUIYRWQXAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
AUXVWXWIFSTWFA6VZXN2FMG7FQEKRZVV6MD32VQQ7J2RKCXHAVGAC
VJDLV4PF2ZJ46NERO4LZUX5JE2CD5XBOBQCYYPTFWTHLUEYDUOYAC
75M6AVUSS3G5EJECJJRB67V5UYDOIV26FZNB2FFCMBZ33EK7FVIQC
NUYXKJP5YXHRDUQW5QW7UC3D5U3VPANIOZAOHFCPWMSRYGMA3GCAC
R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC
L254F6ZIU2HWGLFFGPIORTN4C3TDQ3E5JZ7Z7GQA5AEDIKL6PKDAC
HCZZLSYJT66RSTFJWQIVTDBDJBSDXNHSC7V5WJZOUD52IF5MJGBQC
DGF6PWWASI5CEJBNZ3S5IU2PTM5CSKUUQXQPZ6A26XFPZIHKGJ5AC
UIRWVLX5LDNWURTZOG7EFLXE5OOEL4XBPSLSUHUQSKHC4A7WCVLQC
ZGUJWUFJ4NFFJ6PGXLFGQWCWBCZHPWGWI44NJHJEVPRG5L36PADQC
LJK4ZQATLSB4MKZG3ARZX5V6RFGTN3N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CJIGNKN4PKAXFECVR6TNK7XSMZR7QC
DBGS3HXMW24VO5GBITT3UI2ZNIISUXUHAEAYUI52QPUT7IO46ITQC
5BJPWUPLJFS34FUTFJVKA4A52YMIGV6EWDXLNSDCWBJWBGVSQFGQC
KQNIGKATHT4YSPJFPJGIGPD6VNR5B753SE2JN2LCXZZJNHCGY3DQC
EJ4GIPFSSQCQASUMRF4CR2WPUQOTEHFRGLOYEZ7BH6YEMIR6DN4QC
5B5DP5S6A6LQMKZYVLQAEMHQZWFWYDHPCKQGRNSCNNYIBQYZ6BIQC
FMBJCM5LJKCG326YRJGOOJU6QNWONXAHK2AB4CP4SAOHKJ5CORXQC
// Usually calculates whether from one grid someone could see the other.
// Depending on the viewer's habitat, 'allowed' can be set to DNGN_FLOOR,
// DNGN_SHALLOW_WATER or DNGN_DEEP_WATER.
// Yes, this ignores lava-loving monsters.
bool grid_see_grid(int posx_1, int posy_1, int posx_2, int posy_2,
dungeon_feature_type allowed)
{
if (distance(posx_1, posy_1, posx_2, posy_2) > LOS_RADIUS * LOS_RADIUS)
return (false);
dungeon_feature_type max_disallowed = DNGN_MAXOPAQUE;
if (allowed != DNGN_UNSEEN)
max_disallowed = static_cast<dungeon_feature_type>(allowed - 1);
// XXX: Ignoring clouds for now.
return (num_feats_between(posx_1, posy_1, posx_2, posy_2, DNGN_UNSEEN,
max_disallowed) == 0);
}
if (grid_see_grid(mon->x, mon->y, patrol_x, patrol_y, habitat))
{
// If the patrol point can be easily (within LOS) reached
// from the current position, it suffices if the target is
// within reach of the patrol point OR the current position:
// we can easily get there.
if (!grid_see_grid(patrol_x, patrol_y, pos_x, pos_y, habitat)
&& !grid_see_grid(mon->x, mon->y, pos_x, pos_y, habitat))
{
continue;
}
}
else
{
// If, however, the patrol point is out of reach, we have to
// make sure the new target brings us into reach of it.
// This means that the target must be reachable BOTH from
// the patrol point AND the current position.
if (!grid_see_grid(patrol_x, patrol_y, pos_x, pos_y, habitat)
|| !grid_see_grid(mon->x, mon->y, pos_x, pos_y, habitat))
{
continue;
}
}
// returns true for monsters that obviously (to the player) feel
// "thematically at home" in a branch
// currently used for native monsters recognizing traps
// Returns true for monsters that obviously (to the player)
// feel "thematically at home" in a branch.
// Currently used for native monsters recognizing traps.
// fleeing monsters that can't move will panic and possibly
// turn to face their attacker
// Fleeing monsters that can't move will panic and possibly
// turn to face their attacker.
"a : acquirement\n"
"A : set all skills to level\n"
"Ctrl-A : generate new Abyss area\n"
"b : controlled blink\n"
"B : banish yourself to the Abyss\n"
"c : card effect\n"
"C : (un)curse item\n"
"g : add a skill\n"
"G : banish all monsters\n"
"Ctrl-G : save ghost (bones file)\n"
"f : player combat damage stats\n"
"F : combat stats with fsim_kit\n"
"Ctrl-F : combat stats (monster vs PC)\n"
"h/H : heal yourself (super-Heal)\n"
"i/I : identify/unidentify inventory\n"
"Ctrl-I : item generation stats\n"
"l : make entrance to labyrinth\n"
"L : place a vault by name\n"
"m/M : create monster by number/name\n"
"o/% : create an object\n"
"p : make entrance to pandemonium\n"
"P : make a portal (i.e., bazaars)\n"
"r : change character's species\n"
"s : gain 20000 skill points\n"
"S : set skill to level\n",
"<w>a</w> : acquirement\n"
"<w>A</w> : set all skills to level\n"
"<w>Ctrl-A</w> : generate new Abyss area\n"
"<w>b</w> : controlled blink\n"
"<w>B</w> : banish yourself to the Abyss\n"
"<w>c</w> : card effect\n"
"<w>C</w> : (un)curse item\n"
"<w>g</w> : add a skill\n"
"<w>G</w> : banish all monsters\n"
"<w>Ctrl-G</w> : save ghost (bones file)\n"
"<w>f</w> : player combat damage stats\n"
"<w>F</w> : combat stats with fsim_kit\n"
"<w>Ctrl-F</w> : combat stats (monster vs PC)\n"
"<w>h</w>/<w>H</w> : heal yourself (super-Heal)\n"
"<w>i</w>/<w>I</w> : identify/unidentify inventory\n"
"<w>Ctrl-I</w> : item generation stats\n"
"<w>l</w> : make entrance to labyrinth\n"
"<w>L</w> : place a vault by name\n"
"<w>m</w>/<w>M</w> : create monster by number/name\n"
"<w>o</w>/<w>%</w> : create an object\n"
"<w>p</w> : make entrance to pandemonium\n"
"<w>P</w> : make a portal (i.e., bazaars)\n"
"<w>r</w> : change character's species\n"
"<w>s</w> : gain 20000 skill points\n"
"<w>S</w> : set skill to level\n",
"t : tweak object properties\n"
"T : make a trap\n"
"v : show gold value of an item\n"
"x : gain an experience level\n"
"Ctrl-X : change experience level\n"
"X : make Xom do something now\n"
"z/Z : cast spell by number/name\n"
"$ : get 1000 gold\n"
"</> : create up/down staircase\n"
"u/d : shift up/down one level\n"
"~ : go to a specific level\n"
"(/) : make feature by number/name\n"
"] : get a mutation\n"
"[ : get a demonspawn mutation\n"
": : find branches in the dungeon\n"
"{ : magic mapping\n"
"^ : gain piety\n"
"_ : gain religion\n"
"' : list items\n"
"\" : list monsters\n"
"? : list wizard commands\n"
"| : make unrand/fixed artefacts\n"
"+ : make randart from item\n"
"@ : set Str Int Dex\n"
"\\ : make a shop\n",
"<w>t</w> : tweak object properties\n"
"<w>T</w> : make a trap\n"
"<w>v</w> : show gold value of an item\n"
"<w>x</w> : gain an experience level\n"
"<w>Ctrl-X</w> : change experience level\n"
"<w>X</w> : make Xom do something now\n"
"<w>z</w>/<w>Z</w> : cast spell by number/name\n"
"<w>$</w> : get 1000 gold\n"
"<w><<</w>/<w>></w> : create up/down staircase\n"
"<w>u</w>/<w>d</w> : shift up/down one level\n"
"<w>~</w> : go to a specific level\n"
"<w>(</w>/<w>)</w> : make feature by number/name\n"
"<w>]</w> : get a mutation\n"
"<w>[</w> : get a demonspawn mutation\n"
"<w>:</w> : find branches in the dungeon\n"
"<w>{</w> : magic mapping\n"
"<w>^</w> : gain piety\n"
"<w>_</w> : gain religion\n"
"<w>'</w> : list items\n"
"<w>\"</w> : list monsters\n"
"<w>?</w> : list wizard commands\n"
"<w>|</w> : create all unrand/fixed artefacts\n"
"<w>+</w> : make randart from item\n"
"<w>@</w> : set Str Int Dex\n"
"<w>\\</w> : make a shop\n",