-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitems.odin
48 lines (37 loc) · 1.1 KB
/
items.odin
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
package ruffian
ItemType :: enum {
Weapon_Mace,
Armor_Chain,
Ring_Strength,
Food_Bread,
}
Item :: struct {
name: string,
// can count be > 1?
can_stack: bool,
can_equip: bool,
can_eat: bool,
slot: EquipSlot,
// damage bonus when used during melee attack
melee_damage: int,
// damage bonus when thrown (via bow or otherwise)
ranged_damage: int,
// ability bonuses
ac_bonus: int,
str_bonus: int,
agi_bonus: int,
// TODO: implement these
// int_bonus: int,
// for_bonus: int,
// wil_bonus: int,
// dodge_bonus: int,
}
ITEM_POOL := [ItemType]Item {
.Weapon_Mace = {name = "Mace", can_equip = true, slot = .Hands, melee_damage = 5},
.Armor_Chain = {name = "Chainmail Armor", can_equip = true, slot = .Armor, ac_bonus = 5},
.Ring_Strength = {name = "Ring of Strength", can_equip = true, slot = .Ring, str_bonus = 1},
.Food_Bread = {name = "Bread", can_stack = true, can_eat = true},
}
item_pool_get :: proc(type: ItemType) -> ^Item {
return &ITEM_POOL[type]
}