aboutsummaryrefslogtreecommitdiff
blob: b0be220d7f4e8ac6e9304fbdfa64c44ff4b34b7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Character exposing
   (
      Type,
      Ref,
      get_ref,
      get_location,
      set_location,
      get_movement_points,
      get_attack_range
   )

import Battlemap.Location

type alias Type =
   {
      id : String,
      name : String,
      icon : String,
      portrait : String,
      location : Battlemap.Location.Type,
      movement_points : Int,
      atk_dist : Int
   }

type alias Ref = String

get_ref : Type -> Ref
get_ref c =
   c.id

get_location : Type -> Battlemap.Location.Type
get_location t = t.location

set_location : Battlemap.Location.Type -> Type -> Type
set_location location char = {char | location = location}

get_movement_points : Type -> Int
get_movement_points char = char.movement_points

get_attack_range : Type -> Int
get_attack_range char = char.atk_dist