-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtinctures.lua
114 lines (102 loc) · 2.26 KB
/
tinctures.lua
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--Add fast priv on drinking coffee
minetest.override_item("farming:coffee_cup", {on_use =
function(itemstack, user, pointed_thing)
playereffects.apply_effect_type("fast", 600, user)
local hp = user:get_hp()
user:set_hp(hp+2)
itemstack:take_item(1)
itemstack:add_item("farming:drinking_cup")
return itemstack
end,
})
minetest.override_item("farming:coffee_cup_hot", {on_use =
function(itemstack, user, pointed_thing)
playereffects.apply_effect_type("fast", 600, user)
local hp = user:get_hp()
user:set_hp(hp+2)
itemstack:take_item(1)
itemstack:add_item("farming:drinking_cup")
return itemstack
end,
})
--register tinctures
plants = {
"viola",
"geranium",
"cactus",
"dandelion_yellow",
"tulip",
"rose",
"dandelion_white"
}
PLANTS = {
"Viola",
"Geranium",
"Cactus",
"Dandelion",
"Tulip",
"Rose",
"White Dandelion"
}
effects = {
"regenmana",--increase mana
"breath",--give breath
"high_speed",--increase player speed
"antigravity",--antigravity
"degen",--poison
"regen",--increase hp
"invisibility"--makes player invisible inspired by invisible mod
}
images = {
"violet",
"geranium",
"cactus",
"dandelion",
"tulip",
"rose",
"white_dandelion"
}
sources = {
"flowers:",
"flowers:",
"default:",
"flowers:",
"flowers:",
"flowers:",
"flowers:"
}
for number = 1,7 do
local plant = plants[number]
local PLANT = PLANTS[number]
local effect = effects[number]
local source = sources[number]
local image = images[number]
minetest.register_node("herbs:"..plant.."_tincture", {
description = PLANT.." Tincture",
drawtype = "plantlike",
tiles = {image.."_tincture.png"},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = false,
groups = {vessel = 1, oddly_breakable_by_hand = 3},
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
on_use = function(itemstack, user, pointed_thing)
playereffects.apply_effect_type(effect, 30, user)
itemstack:take_item(1)
itemstack:add_item("vessels:glass_bottle")
return itemstack
end,
})
minetest.register_craft({
output = "herbs:"..plant.."_tincture",
recipe = {
{"farming:bottle_ethanol", source..plant, source..plant},
{source..plant, source..plant, source..plant},
{source..plant, source..plant, source..plant}
}
})
end