summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battle/mechanic/action')
-rw-r--r-- | src/battle/mechanic/action/btl_action_attack.erl | 5 | ||||
-rw-r--r-- | src/battle/mechanic/action/btl_action_move.erl | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/battle/mechanic/action/btl_action_attack.erl b/src/battle/mechanic/action/btl_action_attack.erl index ef4d9d3..8dc9d5c 100644 --- a/src/battle/mechanic/action/btl_action_attack.erl +++ b/src/battle/mechanic/action/btl_action_attack.erl @@ -108,7 +108,10 @@ get_character_abilities (Action, Character, TargetCharacter) -> btl_character:get_location(TargetCharacter) ), - true = (AttackRange >= RequiredRange), + case (AttackRange >= RequiredRange) of + true -> ok; + _ -> error({attack, range, AttackRange, RequiredRange}) + end, { (DefenseRange == 0), diff --git a/src/battle/mechanic/action/btl_action_move.erl b/src/battle/mechanic/action/btl_action_move.erl index ebc79db..97cec25 100644 --- a/src/battle/mechanic/action/btl_action_move.erl +++ b/src/battle/mechanic/action/btl_action_move.erl @@ -191,7 +191,10 @@ cross NextRemainingStepsCount = (RemainingStepsCount - 1), IsForbidden = sets:is_element(NextLocation, ForbiddenLocations), - false = IsForbidden, + case IsForbidden of + true -> error({forbidden, tile, NextLocation}); + false -> ok + end, {NextAttacksOfOpportunityCandidates, Attackers} = detect_attacks_of_opportunity @@ -461,7 +464,10 @@ handle (Action, Character, S0Update) -> MovementPoints = get_movement_points(Action, Character), - true = (MovementPoints >= PathCost), + case (MovementPoints >= PathCost) of + true -> ok; + _ -> error({movement, MovementPoints, PathCost}) + end, % [FIXME][IMPORTANT]: 'Path' will not be correct if there is an interruption. S1Update = |