diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2014-04-15 22:04:40 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-04-27 17:02:32 -0600 |
commit | dc91ade0243adba03fa5160dc3f0fb8aac84200c (patch) | |
tree | fe962420245e89f3da8942d4e6b7058f811e9086 /crawl-ref/source/ranged_attack.h | |
parent | 3d16f3b060f7ce54bd74de9037d882316715458f (diff) | |
download | crawl-ref-dc91ade0243adba03fa5160dc3f0fb8aac84200c.tar.gz crawl-ref-dc91ade0243adba03fa5160dc3f0fb8aac84200c.zip |
A skeleton ranged_attack class, derived from attack.
TODO: tie this up to the beam code; move shared code between melee and
ranged to plain attack; write ranged-specific code.
Diffstat (limited to 'crawl-ref/source/ranged_attack.h')
-rw-r--r-- | crawl-ref/source/ranged_attack.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crawl-ref/source/ranged_attack.h b/crawl-ref/source/ranged_attack.h new file mode 100644 index 0000000000..a8c94403ee --- /dev/null +++ b/crawl-ref/source/ranged_attack.h @@ -0,0 +1,35 @@ +#ifndef RANGED_ATTACK_H +#define RANGED_ATTACK_H + +#include "attack.h" + +class ranged_attack : public attack +{ +// Public Methods +public: + ranged_attack(actor *attacker, actor *defender, item_def *projectile); + + int calc_to_hit(bool); + +private: + /* Attack Phases */ + bool handle_phase_attempted(); + bool handle_phase_dodged(); + bool handle_phase_blocked(); + bool handle_phase_hit(); + bool handle_phase_damaged(); + bool handle_phase_killed(); + bool handle_phase_end(); + + /* Combat Calculations */ + bool attack_shield_blocked(bool verbose); + bool apply_damage_brand(); + + /* Weapon Effects */ + bool check_unrand_effects(); + +private: + const item_def *projectile; +}; + +#endif |