summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2019-05-14 17:38:27 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2019-05-14 17:38:27 +0200 |
commit | f3f09c301fdb1acf9fb7e77db92bfed3147ab215 (patch) | |
tree | afb2430509cf7868c220be3c891b240cc3add727 /src/shared/battle-map/BattleMap/Struct/Map.elm | |
parent | beceea45a9840c306f8db79d4d02db400bd6426c (diff) |
Updates Dijkstra's to avoid attacks of opportunity.
Diffstat (limited to 'src/shared/battle-map/BattleMap/Struct/Map.elm')
-rw-r--r-- | src/shared/battle-map/BattleMap/Struct/Map.elm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/battle-map/BattleMap/Struct/Map.elm b/src/shared/battle-map/BattleMap/Struct/Map.elm index fb3f8fb..31333f8 100644 --- a/src/shared/battle-map/BattleMap/Struct/Map.elm +++ b/src/shared/battle-map/BattleMap/Struct/Map.elm @@ -6,7 +6,7 @@ module BattleMap.Struct.Map exposing get_height, get_markers, set_markers, - get_movement_cost_function, + get_tile_data_function, get_omnimods_at, get_tiles, get_width, @@ -179,22 +179,22 @@ decoder = (Json.Decode.field "w" Json.Decode.int) ) -get_movement_cost_function : ( +get_tile_data_function : ( Type -> (List BattleMap.Struct.Location.Type) -> BattleMap.Struct.Location.Type -> BattleMap.Struct.Location.Type -> - Int + (Int, Int) ) -get_movement_cost_function bmap occupied_tiles start_loc loc = +get_tile_data_function bmap occupied_tiles start_loc loc = if (has_location loc bmap) then case (Array.get (location_to_index loc bmap) bmap.content) of (Just tile) -> if ((loc /= start_loc) && (List.member loc occupied_tiles)) - then Constants.Movement.cost_when_occupied_tile - else (BattleMap.Struct.TileInstance.get_cost tile) + then (Constants.Movement.cost_when_occupied_tile, 0) + else ((BattleMap.Struct.TileInstance.get_cost tile), 0) - Nothing -> Constants.Movement.cost_when_out_of_bounds + Nothing -> (Constants.Movement.cost_when_out_of_bounds, 0) else - Constants.Movement.cost_when_out_of_bounds + (Constants.Movement.cost_when_out_of_bounds, 0) |