summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-09-30 18:12:54 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-09-30 18:12:54 +0200 |
commit | 3db4177ebf2d3c8cca27e352644c1efa1a1a3580 (patch) | |
tree | 2f7d66934b9491879d01384b487a83bb1809f328 /src/battle/mechanic | |
parent | 4f4987582ee41e2c68aad3b467b40eaed2ae9111 (diff) |
Ensure same char can do multiple AoOs.
Diffstat (limited to 'src/battle/mechanic')
-rw-r--r-- | src/battle/mechanic/action/btl_action_move.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl index 97cec25..eed7add 100644 --- a/src/battle/mechanic/action/btl_action_move.erl +++ b/src/battle/mechanic/action/btl_action_move.erl @@ -21,7 +21,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --spec generate_attacks_of_opportunity_candidates +-spec generate_attack_of_opportunity_candidates ( btl_character:either(), shr_location:type(), @@ -29,7 +29,7 @@ non_neg_integer() ) -> list(attack_candidate_ref()). -generate_attacks_of_opportunity_candidates +generate_attack_of_opportunity_candidates ( Character, Location, @@ -103,9 +103,12 @@ detect_attacks_of_opportunity (Location, Candidates, RemainingStepsCount) -> - CandidateAttackRange ), if - (Range =< 0) -> {FutureCandidates, [CandidateIX|Attackers]}; + (Range =< 0) -> + {[Candidate|FutureCandidates], [CandidateIX|Attackers]}; + (Range =< RemainingStepsCount) -> {[Candidate|FutureCandidates], Attackers}; + true -> {FutureCandidates, Attackers} end end, @@ -343,7 +346,7 @@ get_path_cost_and_destination (CharacterIX, Character, Update, Path) -> ForbiddenLocations = generate_forbidden_locations(CharacterIX, Characters), AttacksOfOpportunityCandidates = - generate_attacks_of_opportunity_candidates + generate_attack_of_opportunity_candidates ( Character, Location, |