summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-07-03 14:33:35 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-07-03 14:33:35 +0200
commit16d34a748d62ab59f9b53a52d3e72d5b872efce1 (patch)
treed65351a7b86178f939276135043c4601a9e47b80 /src/battlemap
parent0301c9220b98bde25458702ad4e1331dcd2b03a7 (diff)
Fixes parries.
Diffstat (limited to 'src/battlemap')
-rw-r--r--src/battlemap/struct/bm_attack.erl19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/battlemap/struct/bm_attack.erl b/src/battlemap/struct/bm_attack.erl
index a8f97de..a1ce027 100644
--- a/src/battlemap/struct/bm_attack.erl
+++ b/src/battlemap/struct/bm_attack.erl
@@ -206,9 +206,15 @@ apply_to_healths
)
when
(
- (Attack#attack.order == first)
- or (Attack#attack.order == second)
- or ((Attack#attack.order == counter) and Attack#attack.is_parry)
+ (
+ (not Attack#attack.is_parry)
+ and ((Attack#attack.order == first) or (Attack#attack.order == second))
+ )
+ or
+ (
+ Attack#attack.is_parry
+ and (Attack#attack.order == counter)
+ )
) ->
Damage = Attack#attack.damage,
@@ -225,10 +231,13 @@ apply_to_healths
)
when
(
- (Attack#attack.order == counter)
+ (
+ (not Attack#attack.is_parry)
+ and (Attack#attack.order == counter)
+ )
or
(
- (Attack#attack.is_parry)
+ Attack#attack.is_parry
and ((Attack#attack.order == first) or (Attack#attack.order == second))
)
) ->