| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2018-06-15 15:54:42 +0200 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2018-06-15 15:54:42 +0200 | 
| commit | 705d2b61926b90aa2906dd717edd1a2286a36b96 (patch) | |
| tree | b9bee2d8b288c71d78514967c9bab3835fd7d6c9 /src/battlemap/struct/bm_tile.erl | |
| parent | 9552d3330793d48d196c1b07e69638168c776413 (diff) | |
Uses the existing tiles to make a demo map.
Diffstat (limited to 'src/battlemap/struct/bm_tile.erl')
| -rw-r--r-- | src/battlemap/struct/bm_tile.erl | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/src/battlemap/struct/bm_tile.erl b/src/battlemap/struct/bm_tile.erl index c1dd448..ce04898 100644 --- a/src/battlemap/struct/bm_tile.erl +++ b/src/battlemap/struct/bm_tile.erl @@ -21,7 +21,8 @@  -export  (     [ -      random_id/0 +      random_id/0, +      id_from_int/1     ]  ). @@ -37,11 +38,16 @@ cost_when_oob () -> 255.  -spec get_cost (id()) -> non_neg_integer().  get_cost (N) -> -   if -      (N =< 200) -> (N + 8); -      true -> cost_when_oob() +   case N of +      0 -> 6; +      1 -> 12; +      2 -> 24; +      _ -> cost_when_oob()     end.  -spec random_id () -> id().  random_id () ->     sh_roll:between(0, 15). + +-spec id_from_int (non_neg_integer()) -> id(). +id_from_int (I) -> I.  | 


