summaryrefslogtreecommitdiff
path: root/itemdef.go
blob: 62c019eff0fe59c76f1a856e545215a2fc975803 (plain) (blame)
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
package mt

import "image/color"

type ItemType uint8

const (
	_ ItemType = iota
	NodeItem
	CraftItem
	ToolItem
)

//go:generate stringer -type ItemType

// An ItemDef defines the properties of an item.
type ItemDef struct {
	//mt:lenhdr 16

	// Version.
	//mt:const uint8(6)

	Type ItemType

	Name, Desc string

	InvImg, WieldImg Texture
	WieldScale       [3]float32

	StackMax uint16

	Usable          bool
	CanPointLiquids bool

	ToolCaps ToolCaps

	Groups []Group

	PlacePredict string

	PlaceSnd, PlaceFailSnd SoundDef

	PointRange float32

	// Set index in Palette with "palette_index" item meta field,
	// this overrides Color.
	Palette Texture
	Color   color.NRGBA

	// Texture overlays.
	InvOverlay, WieldOverlay Texture

	ShortDesc string

	PlaceParam2 uint8

	SoundUse    SoundDef
	SoundUseAir SoundDef

	//mt:end
}