summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/target.h
diff options
context:
space:
mode:
authorgammafunk <gammafunk@gmail.com>2013-06-15 23:23:16 -0500
committerNeil Moore <neil@s-z.org>2013-10-01 21:27:12 -0400
commitc80f2bed60bcbdc9a3a2ad46c0059d02e45869c6 (patch)
tree55123de15bea34fb5fd6e9665ede697741ade46c /crawl-ref/source/target.h
parente7b95c8c9b3bd68a43ba0da89221226cd41dcc80 (diff)
downloadcrawl-ref-c80f2bed60bcbdc9a3a2ad46c0059d02e45869c6.tar.gz
crawl-ref-c80f2bed60bcbdc9a3a2ad46c0059d02e45869c6.zip
Evokable Jump attack ability
* Player chooses a monster target within range where there's at least one valid landing site adjacent to the target. * There must be a monster to target to use the ability, but the monster can be friendly or neutral. * A random valid landing site is chosen, the player is moved to that square, and weapon melee occurs against the target at the landing site. * Jump attacks are melee with the wielded weapon and get a 20% damage bonus * Valid landing sites are always habitable squares with no monster and no thing that's dangerous to the player. * Flying monsters or giant monsters not standing in deep water or lava can 'block' the path of a landing site by being in the ray path from the player to the landing site. * If a visible monster blocks the path to a landing site, it won't be considered as a valid landing site. * If something invisible blocks a landing site, the site will be shown as valid and can be randomly chosen, in which case the player 'rebounds off something unseen' and never leaves the starting square, but wastes a turn (delay 10aut). * If the player is adjacent to the monster, sites adjacent to the player are not valid; you have to 'jump over' the monster in this case. * Player can't jump if exhausted or standing in water/lava/liquefied ground * Exhaustion duration is set after jump (regardless of success) to prevent a second jump, with a duration formula that's the same as the breath duration. * The usual melee checks wielded weapon/friendly etc. checks are performed for the jump melee. * If any of the valid landing sites would cause problems with self-electrocution or sanctuary violation, the player is warned first. * Range is determined by evocations training; starting attack range is 3 (movement 2), and it increases by one at evocations 5 and 10. * The cost of the jump is 2MP and a hunger cost using the same calculation as for flame breath. * The delay of a successful jump is the same as melee delay. * Fail rate for the ability calculation based on evoke taken from breath fail rate code
Diffstat (limited to 'crawl-ref/source/target.h')
-rw-r--r--crawl-ref/source/target.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/crawl-ref/source/target.h b/crawl-ref/source/target.h
index 0ec6882cd7..d2aa80019d 100644
--- a/crawl-ref/source/target.h
+++ b/crawl-ref/source/target.h
@@ -12,6 +12,7 @@ enum aff_type // sign and non-zeroness matters
AFF_YES, // intended/likely to affect
// If you want to extend this to pass the probability somehow, feel free to,
// just keep AFF_YES the minimal "bright" value.
+ AFF_LANDING, // Valid jump attack landing site
};
class targetter
@@ -30,6 +31,7 @@ public:
virtual bool can_affect_walls();
virtual aff_type is_affected(coord_def loc) = 0;
+ virtual bool has_additional_sites(coord_def a, bool allow_harmful);
protected:
bool anyone_there(coord_def loc);
};
@@ -188,4 +190,39 @@ private:
int range2;
};
+enum jump_block_reason
+{
+ BLOCKED_NONE,
+ BLOCKED_OCCUPIED,
+ BLOCKED_FLYING,
+ BLOCKED_GIANT,
+ BLOCKED_MOVE,
+ BLOCKED_PATH,
+};
+
+class targetter_jump : public targetter
+{
+public:
+ targetter_jump(const actor* act, int range);
+
+ bool valid_aim(coord_def a);
+ bool set_aim(coord_def a);
+ bool jump_is_blocked;
+ aff_type is_affected(coord_def loc);
+ bool has_additional_sites(coord_def a, bool allow_harmful);
+ set<coord_def> additional_sites;
+ coord_def landing_site;
+private:
+ void set_additional_sites(coord_def a);
+ void get_additional_sites(coord_def a);
+ bool valid_landing(coord_def a, bool check_invis = true);
+ jump_block_reason no_landing_reason;
+ jump_block_reason blocked_landing_reason;
+ set<coord_def> temp_sites;
+ int _range;
+ int range2;
+};
+
+
+
#endif