summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-06-13 13:32:43 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-06-13 13:32:43 +0200 |
commit | 499c0981df958643097f96365138df689432e5b4 (patch) | |
tree | 4ad005b50aa261612e6a46f4549c1046134d3644 /src/shared/battle-map/BattleMap/Struct/Marker.elm | |
parent | 9eaf4c0a006e2a08fdd1e2248978c4ac5cdaef3b (diff) |
Adds AoO pathfinding & temporary representation.
The animation manager does not work correctly though: when a move action
has been interrupted, it will rewind like if there was only the last
movement part, yet play back all parts, landing the character at the
wrong location.
Diffstat (limited to 'src/shared/battle-map/BattleMap/Struct/Marker.elm')
-rw-r--r-- | src/shared/battle-map/BattleMap/Struct/Marker.elm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/shared/battle-map/BattleMap/Struct/Marker.elm b/src/shared/battle-map/BattleMap/Struct/Marker.elm index 53204cb..7012e4b 100644 --- a/src/shared/battle-map/BattleMap/Struct/Marker.elm +++ b/src/shared/battle-map/BattleMap/Struct/Marker.elm @@ -3,8 +3,10 @@ module BattleMap.Struct.Marker exposing Type, DataType, new, + new_melee_attack, get_locations, set_locations, + is_dangerous, get_data, is_in_locations, decoder, @@ -80,6 +82,13 @@ new = data = None } +new_melee_attack : Int -> (Set.Set BattleMap.Struct.Location.Ref) -> Type +new_melee_attack char_ix locations = + { + locations = locations, + data = (MeleeAttackZone {character_ix = char_ix}) + } + get_locations : Type -> (Set.Set BattleMap.Struct.Location.Ref) get_locations marker = marker.locations @@ -159,3 +168,9 @@ encode marker = ) ] ) + +is_dangerous : Type -> Bool +is_dangerous marker = + case marker.data of + (MeleeAttackZone _) -> True + _ -> False |