From 499c0981df958643097f96365138df689432e5b4 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Thu, 13 Jun 2019 13:32:43 +0200 Subject: 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. --- src/shared/battle-map/BattleMap/Struct/Marker.elm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/shared/battle-map/BattleMap/Struct/Marker.elm') 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 -- cgit v1.2.3-70-g09d2