summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-summoning.h
diff options
context:
space:
mode:
authorEd Gonzalez <ed.gonzalez3@gmail.com>2013-06-13 00:00:02 -0700
committerEd Gonzalez <ed.gonzalez3@gmail.com>2013-06-13 00:00:02 -0700
commitf9943bac0633d03bcce482265762326e1dd2a3f9 (patch)
treed5d0d4c217b186d4b4b344b3f83df94dbbd3570a /crawl-ref/source/spl-summoning.h
parentf77dbd77ca64423747624ade6cd1b4bf5de8522c (diff)
downloadcrawl-ref-f9943bac0633d03bcce482265762326e1dd2a3f9.tar.gz
crawl-ref-f9943bac0633d03bcce482265762326e1dd2a3f9.zip
Rework spectral weapon AI to attack on its own turn.
The spectral weapon no longer attacks immediately following its owner's attack. On its own turn, it attempts to path towards the target and attacks exactly once when first able. (Internally, its owner attacking triggers a "ready" flag, which is consumed on attack.) This should better mirror battlesphere, and fixes a number of issues with non-player spectral weapon (not) attacking when it wasn't supposed to. It seems to work properly for: * player SW attacking monster * allied non-player SW attacking monster * monster SW attacking player There are issues (see below) with: * monster SW attacking (or at least signaled to attack) allied monster Known issues: * Sometimes an enemy spectral weapon that is told to target an ally will path towards the player instead. * Spectral weapon still attributes all its kills and damage to the player. * Spectral weapon doesn't listen to charm/end charm on its owner. * Spectral weapon needs to be reset at an appropriate time. * Allied spectral weapon with an invisible target might leak information in summon_can_attack?
Diffstat (limited to 'crawl-ref/source/spl-summoning.h')
-rw-r--r--crawl-ref/source/spl-summoning.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/spl-summoning.h b/crawl-ref/source/spl-summoning.h
index 17ea4c32ad..4d6c89cb16 100644
--- a/crawl-ref/source/spl-summoning.h
+++ b/crawl-ref/source/spl-summoning.h
@@ -94,5 +94,7 @@ spret_type cast_fulminating_prism(int pow, const coord_def& where, bool fail);
monster* find_spectral_weapon(const actor* agent);
spret_type cast_spectral_weapon(actor *agent, int pow, god_type god, bool fail);
void end_spectral_weapon(monster* mons, bool killed, bool quiet=false);
-bool trigger_spectral_weapon(actor* agent, actor* target);
+bool trigger_spectral_weapon(actor* agent, const actor* target);
+bool check_target_spectral_weapon(const actor* mons, const actor *defender);
+bool confirm_attack_spectral_weapon(monster* mons, const actor *defender);
#endif