diff options
author | DracoOmega <draco_omega@live.com> | 2014-02-12 18:02:50 -0330 |
---|---|---|
committer | DracoOmega <draco_omega@live.com> | 2014-02-12 20:44:57 -0330 |
commit | 1d5a4174a97d9874fbca1bd299af56e9d4620288 (patch) | |
tree | a34c1c0d86ec0d93b2c22fb03d06e968f76df00f /crawl-ref/source/mon-behv.h | |
parent | f635930c6cd4e98905a6c7f676c5dd09db77b8d8 (diff) | |
download | crawl-ref-1d5a4174a97d9874fbca1bd299af56e9d4620288.tar.gz crawl-ref-1d5a4174a97d9874fbca1bd299af56e9d4620288.zip |
Allow nearly created allies to automatically choose appropriate foes
Having to repeatedly pause to tw after summoning new allies in a
battle-in-progress (lest they simply stand around doing nothing)
makes the pure summoner playstyle a bit more tedious than necessary.
Also, it is not always intuitive to new players why allied monsters
will sometimes appear to engage on their own and other times ignore
obvious threats (say, if those threats simply missed you with their
attacks on the previous turn).
This adds the capacity for newly created summons to automatically
choose valid nearby foes similar to if tw had been used just after
making them. If there are no valid nearby foes, they will simply
follow alongside the player as normal (no change to their general
AI behavior has been made).
(I did this by repurposing the apparently unused M_PLAYER_MADE flag.
Hopefully there wasn't some reason for its existence that was not
clear to me.)
There is one caveat that is slightly different from tw: they will
choose only foes that the player is also in los of (so as to not
run off after monsters the player is not yet even aware of) and will
even choose a foe that they are not in los of, but the player is, if
no other one is available). This last property is particularly because
often summons will be created slightly more distant from a monster
you are fighting than the player is, and it is often very unclear
that the monster cannot actually see the target from that spot. So
when they do not engage and simply stand around the player, it
appears moreso that the AI has failed to work properly, rather than
the monster cannot see any target. We will assume that the player
passes along some indication of its foes' positions that allies can
use - in practice, the fact that this is even happening is not obvious;
things simply just appear to move towards obvious enemies.
Diffstat (limited to 'crawl-ref/source/mon-behv.h')
-rw-r--r-- | crawl-ref/source/mon-behv.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-behv.h b/crawl-ref/source/mon-behv.h index 87114a1c6b..9da719caa7 100644 --- a/crawl-ref/source/mon-behv.h +++ b/crawl-ref/source/mon-behv.h @@ -45,6 +45,8 @@ bool summon_can_attack(const monster* mons, const actor* targ); void shake_off_monsters(const actor* target); +void set_nearest_monster_foe(monster* mon, bool near_player = false); + // For Zotdef: the target position of MHITYOU monsters is // the orb. #define PLAYER_POS (crawl_state.game_is_zotdef() ? env.orb_pos : you.pos()) |