-
Notifications
You must be signed in to change notification settings - Fork 0
/
Types.elm
66 lines (50 loc) · 1.24 KB
/
Types.elm
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module Types where
import Dict exposing (Dict)
import Random exposing (Seed)
type Dir = Left|Down|Up|Right
type alias Point = (Int,Int)
type Action = Idle|Fetch|Move Dir|Restart
type alias Item = {name:String, value:Int}
type alias Monster = {
cooldown:Int,
currentCooldown:Int,
name:String,
maxHP: Int,
currentHP: Int
}
type Ability = Tough
type alias Class = {
abilities: List Ability,
name: String
}
type StatusType = Stun
type alias Status = {duration:Int, statusType:StatusType}
type alias PC = {
class:Class,
name:String,
statuses:List Status,
xp:Int
}
type alias Square = {
item: Maybe Item,
monster: Maybe Monster,
pcs: List PC
}
type alias Player = {
carrying: Maybe Item,
position: Point,
points: Int,
alive: Bool
}
type alias Grid = Dict Point Square
type alias Model = {
grid: Grid,
player: Player,
seed: Seed,
soundToPlay: String
}
-- TODO this is used in a few places to get around proper control flow,
-- and not just as a model initializer.
-- Remove these uses.
emptySquare : Square
emptySquare = {item=Nothing, monster=Nothing, pcs=[]}