aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-06-12 15:43:31 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-06-12 15:43:31 +0200
commit89ff03d8eb042fd952136b03c6de849602190064 (patch)
treedac6458dfa08caa8b141b1e7d2c997887fae3243
parentb9cf8ace0e8ded49f4af1d2679c1aa9411c5419c (diff)
downloadtacticians-server-89ff03d8eb042fd952136b03c6de849602190064.zip
tacticians-server-89ff03d8eb042fd952136b03c6de849602190064.tar.bz2
Still needs more testing...
-rw-r--r--src/battle/mechanic/action/btl_action_attack.erl4
-rw-r--r--src/battle/mechanic/action/btl_action_move.erl7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/battle/mechanic/action/btl_action_attack.erl b/src/battle/mechanic/action/btl_action_attack.erl
index bfeafcc..47bdd93 100644
--- a/src/battle/mechanic/action/btl_action_attack.erl
+++ b/src/battle/mechanic/action/btl_action_attack.erl
@@ -115,11 +115,11 @@ get_character_abilities (Action, Character, TargetCharacter) ->
(
IsNotOpportunistic
and (TargetDefenseRange == 0)
- and (TargetAttackRange =< RequiredRange)
+ and (TargetAttackRange >= RequiredRange)
),
(
IsNotOpportunistic
- and (TargetAttackRange =< RequiredRange)
+ and (TargetAttackRange >= RequiredRange)
)
}.
diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl
index f4ef7da..643912c 100644
--- a/src/battle/mechanic/action/btl_action_move.erl
+++ b/src/battle/mechanic/action/btl_action_move.erl
@@ -40,7 +40,12 @@ generate_attacks_of_opportunity_candidates
orddict:fold
(
fun (CandidateIX, Candidate, Results) ->
- case (btl_character:get_player_index(Candidate) == PlayerIX) of
+ case
+ (
+ (btl_character:get_player_index(Candidate) == PlayerIX)
+ or (not btl_character:get_is_alive(Candidate))
+ )
+ of
true -> Results;
false ->
CandidateWeapon =