summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/battle-map/BattleMap/Struct/Marker.elm')
-rw-r--r--src/shared/battle-map/BattleMap/Struct/Marker.elm15
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