summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/melee_attack.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-09-15 23:24:07 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-09-15 23:24:29 +0200
commitd66b1aea3f269e2140d79b5d32f7174694f5fb92 (patch)
tree5b514bbd4dda3974dbcf66607a5a662c628be36e /crawl-ref/source/melee_attack.h
parent3fab5e45499609b4aeb6150ad2dda39305a740fe (diff)
downloadcrawl-ref-d66b1aea3f269e2140d79b5d32f7174694f5fb92.tar.gz
crawl-ref-d66b1aea3f269e2140d79b5d32f7174694f5fb92.zip
Cleave effect for Axes.
* Additional targets are acquired by rotating from the main target in both directions but no more than 3 cells. Solid features block cleaving. On open grounds, it attacks 7 cells (all but the opposite one from the main target). A single wall on the side can block one or two targets since it doesn't go all around. * Additional attacks do 75% damage. Main target still takes full damage. * Allies don't block cleaving and are not harmed by it unless attacker is confused. * Monsters wielding axes get cleaving too. * Broad axe, battleaxe and executioner's axe base damage is reduced by 1. More nerfing might be needed for the latter 2. * Cleaving works when attacking empty spaces (useful against invisible monsters) * Monsters dual wielding axes should work. Thanks to LexAckson for helping with this implementation (especially rotate_adjacent).
Diffstat (limited to 'crawl-ref/source/melee_attack.h')
-rw-r--r--crawl-ref/source/melee_attack.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/crawl-ref/source/melee_attack.h b/crawl-ref/source/melee_attack.h
index 0eac7a1ed2..51ef5f136a 100644
--- a/crawl-ref/source/melee_attack.h
+++ b/crawl-ref/source/melee_attack.h
@@ -1,6 +1,8 @@
#ifndef MELEE_ATTACK_H
#define MELEE_ATTACK_H
+#include <list>
+
#include "artefact.h"
#include "attack.h"
#include "fight.h"
@@ -44,6 +46,9 @@ public:
bool stab_attempt;
int stab_bonus;
+ list<actor*> cleave_targets;
+ bool cleaving; // additional attack from cleaving
+
// Miscast to cause after special damage is done. If miscast_level == 0
// the miscast is discarded if special_damage_message isn't empty.
int miscast_level;
@@ -54,7 +59,8 @@ public:
public:
melee_attack(actor *attacker, actor *defender,
- int attack_num = -1, int effective_attack_num = -1);
+ int attack_num = -1, int effective_attack_num = -1,
+ bool is_cleaving = false);
// Applies attack damage and other effects.
bool attack();
@@ -99,6 +105,10 @@ private:
int dam_type,
brand_type wpn_brand);
+ /* Axe cleaving */
+ void cleave_setup();
+ int cleave_damage_mod(int dam);
+
/* Mutation Effects */
void do_spines();
void do_passive_freeze();