blob: a2fd941964dda4e02a9ad44d66d3d2abb7ee8c18 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package types
func InitObjects() {
WEAPON_OLD_FAMILY_SWORD := Weapon{
name: "Mjorrsword",
atk: 10,
meta: WeaponMetadata{
info: "The Mjorrsword is an old sword, a legacy in your family. \nLast used in the Fjolrholmer Revolution, it is now yours to hold on to.",
}
}
}
type Inventory struct {
weapons []Weapon
foods []Food
potions []Potion
}
type Player struct {
name string
inventory Inventory
effects []Effect
wallet []Currency
}
type WeaponMetadata struct {
info string
}
type Weapon struct {
name string
atk int
meta WeaponMetadata
}
type Food struct {
name string
regen_health int
}
type Effect struct {
name string
effect func(p *Player)
}
type Potion struct {
name string
effect Effect
}
type Currency struct {
name string
prefix string
value int
amount int
}
type Consumable interface {
Food | Potion
}
|