diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-29 21:53:19 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-29 21:53:19 +0000 |
commit | c7d7127e04437181a909dc4c7bbbc5e408e7f798 (patch) | |
tree | a2c99f92832734172185bd78d359ebad2875a036 /crawl-ref/source/view.h | |
parent | bfed89c67c7d64c104481af653aa8082470a5151 (diff) | |
download | crawl-ref-c7d7127e04437181a909dc4c7bbbc5e408e7f798.tar.gz crawl-ref-c7d7127e04437181a909dc4c7bbbc5e408e7f798.zip |
Diversify patrol behaviour for monsters of different intelligence.
* I_NORMAL, I_HIGH: as before
* I_ANIMAL: try to only move within LOS of the patrol point
* I_INSECT: as animal, but patrol radius is 5
* I_PLANT : patrol radius is also 5, but there are some other
differences:
If the patrol point gets out of sight, zombies don't even attempt to
get back. Instead they become confused (not literally, though) and
reset their patrol point to 0 (if hostile, thus stop patrolling) or
to their current position (to continue "waiting" if friendly).
Also, while patrolling, if they reach their target there's a 50%
chance of not moving this turn, and 50% the next turn, etc.
Especially the latter needs testing. If it looks *too* stupid even
for zombies I'll take it out again.
These changes should also help to make patrolling a bit more
efficient because for stupid monsters we have:
- one los calculation instead of two (patrol point, monster)
- smaller radius
- no calculation at all if success is unlikely (distance check)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5335 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.h')
-rw-r--r-- | crawl-ref/source/view.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index 9994707b12..b2251d13cf 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -256,6 +256,7 @@ public: // public methods void set_monster(monsters *mon); void set_los_centre(int x, int y); + void set_los_range(int r); void fill_los_field(void); bool in_sight(int x, int y); @@ -287,6 +288,9 @@ protected: // Else, any monster trying to move around within this los field. monsters *mons; + // Range may never be greater than LOS_RADIUS! + int range; + // The array to store the LOS values. int los_field[LSIZE][LSIZE]; }; |