]> git.lizzy.rs Git - mt.git/blob - itemdef.go
a761b659e7dcf6c7bd3bca5492a9319e9b635333
[mt.git] / itemdef.go
1 package mt
2
3 import "image/color"
4
5 type ItemType uint8
6
7 const (
8         _ ItemType = iota
9         NodeItem
10         CraftItem
11         ToolItem
12 )
13
14 // An ItemDef defines the properties of an item.
15 type ItemDef struct {
16         //mt:lenhdr 16
17
18         // Version.
19         //mt:const uint8(6)
20
21         Type ItemType
22
23         Name, Desc string
24
25         InvImg, WieldImg Texture
26         WieldScale       [3]float32
27
28         StackMax uint16
29
30         Usable          bool
31         CanPointLiquids bool
32
33         ToolCaps ToolCaps
34
35         Groups []Group
36
37         PlacePredict string
38
39         PlaceSnd, PlaceFailSnd SoundDef
40
41         PointRange float32
42
43         // Set index in Palette with "palette_index" item meta field,
44         // this overrides Color.
45         Palette Texture
46         Color   color.NRGBA
47
48         // Texture overlays.
49         InvOverlay, WieldOverlay Texture
50
51         ShortDesc string
52
53         PlaceParam2 byte
54
55         //mt:end
56 }