Differences From
Artifact [a4fa9f9b09]:
52 52
53 53 sorcery.register_oil = function(name,label,desc,color,imgvariant,extra)
54 54 local image = 'xdecor_bowl.png^(sorcery_oil_' .. (imgvariant or 'dull') .. '.png^[colorize:'..tostring(color)..':140)'
55 55 sorcery.register.residue.link('sorcery:' .. name, 'xdecor:bowl')
56 56 extra.description = label;
57 57 extra.inventory_image = image;
58 58 if not extra.groups then extra.groups = {} end
59 + extra.groups.sorcery_oil = 1
59 60 minetest.register_craftitem('sorcery:' .. name, extra)
60 61 end
61 62
62 63 sorcery.register_potion('blood', 'Blood', 'A bottle of sacrificial blood, imbued with stolen (or perhaps donated) life force', u.color(219,19,14), nil, nil, {
63 64 _sorcery = {
64 65 life_store = 4;
65 66 container = {
................................................................................
102 103 output = 'sorcery:' .. id;
103 104 _proto = proto;
104 105 }
105 106 end
106 107 end
107 108
108 109 -- for n,v in pairs(sorcery.data.potions) do
110 +local kind_potion = {
111 + label = 'Potion';
112 + kind = 'A mystical liquid crucial to the art of alchemy';
113 +}
109 114 sorcery.register.potions.foreach('sorcery:mknodes',{},function(n,v)
110 115 local color = u.color(v.color)
111 116 local kind = v.style
112 117 local glow = v.glow
113 118 local id = 'potion_' .. string.lower(n)
114 119 local desc = 'A ' .. ((glow and 'glowing ') or '') ..
115 120 'bottle of ' .. string.lower(n) ..
116 121 ((kind == 'sparkle' and ', fiercely bubbling') or '') ..
117 122 ' liquid'
118 123 local fullname = n .. ' Potion'
119 124 sorcery.register.liquid.link('sorcery:'..id, {
120 - name = 'Serene Potion';
125 + name = fullname;
121 126 color = v.color;
122 127 proto = v;
123 128 kind = 'sorcery:potion';
124 129 measure = function(amt) return string.format('%s draughts', amt / 3) end;
125 130 containers = {
126 131 ['vessels:glass_bottle'] = 'sorcery:' .. id;
127 132 };
128 133 })
134 + v.kind = kind_potion;
129 135 sorcery.register_potion(id, fullname, desc, color, kind, glow, {
130 136 groups = {
131 137 sorcery_potion = 1;
132 138 sorcery_magical = 1;
133 139 };
134 140 _proto = v;
135 141 _sorcery = {
................................................................................
142 148 };
143 149 };
144 150 })
145 151 create_infusion_recipe(id,v,'sorcery:potion_serene',{data=v,name=fullname})
146 152 end)
147 153
148 154 -- for n,potion in pairs(sorcery.data.draughts) do
155 +local kind_draught = {
156 + label = 'Draught';
157 + desc = 'A drink that will suffuse your body and spirit with mystic energies';
158 +}
149 159 sorcery.register.draughts.foreach('sorcery:mknodes',{},function(n,potion)
150 160 local name = 'draught_' .. n
161 + potion.kind = kind_draught
151 162 local behavior = {
152 163 _proto = potion;
153 164 groups = {
154 165 sorcery_potion = 2;
155 166 sorcery_draught = 1;
156 167 sorcery_magical = 1;
157 168 sorcery_usable_magic = 1;
................................................................................
201 212 potion.style or 'dull',
202 213 potion.glow or 0,
203 214 behavior)
204 215 create_infusion_recipe(name,potion,'sorcery:potion_luminous',{data=potion,name=fullname})
205 216 end)
206 217
207 218 -- for n,elixir in pairs(sorcery.data.elixirs) do
219 +local kind_elixir = {
220 + label = 'Elixir';
221 + desc = 'A special kind of potion that enhances the particular qualities of other alchemical brews';
222 +}
208 223 sorcery.register.elixirs.foreach('sorcery:mknodes',{},function(n,elixir)
209 224 local color = u.color(elixir.color)
210 225 local id = 'elixir_' .. string.lower(n)
211 226 local fullname = 'Elixir of ' .. n
227 + elixir.kind = kind_elixir;
212 228 sorcery.register_potion(id, fullname, nil, color, 'dull', false, {
213 229 _proto = elixir;
214 230 groups = {
215 231 sorcery_elixir = 1;
216 232 sorcery_magical = 1;
217 233 };
218 234 })
................................................................................
236 252 local kind = v.style
237 253 sorcery.register_oil('grease_' .. n, u.str.capitalize(n) .. ' Grease', nil, color, kind, {
238 254 groups = { sorcery_grease = 1 }
239 255 })
240 256 end)
241 257
242 258 -- for n,v in pairs(sorcery.data.philters) do
259 +local kind_philter = {
260 + label = 'Philter';
261 + desc = 'A special kind of potion that wooden rods can be soaked in to imbue them with special powers and transform them into wands';
262 +}
243 263 sorcery.register.philters.foreach('sorcery:mknodes',{},function(n,v)
244 264 local color = u.color(v.color)
245 265 local id = 'philter_' .. n
246 266 local name = v.name or u.str.capitalize(n)
267 + if not v.name then v.name = name end
247 268 local fullname = name .. ' Philter'
269 + v.kind = kind_philter
248 270 sorcery.register_potion(id, fullname, v.desc, color, 'sparkle',v.glow or 4, {
249 271 _proto = v;
250 272 _protoname = n;
251 273 groups = {
252 274 sorcery_magical = 1;
253 275 sorcery_philter = 1;
254 276 };
255 277 })
278 + v.quals = {force = true};
256 279 create_infusion_recipe(id,v,'sorcery:potion_viscous',{data=v,name=fullname})
257 280 end)
258 281
259 282 -- for n,v in pairs(sorcery.data.extracts) do
260 283 sorcery.register.extracts.foreach('sorcery:mknodes',{},function(n,v)
261 284 local item = v[1]
262 285 local color = u.color(v[2])
................................................................................
302 325 {"farming:mortar_pestle", "farming:mortar_pestle"};
303 326 };
304 327 }
305 328 end
306 329 -- need a relatively pure alcohol for this, tho other alcohols can be used
307 330 -- for potionmaking in other ways
308 331 add_alcohol('farming:bottle_ethanol')
309 - add_alcohol('wine:glass_vodka')
332 + if minetest.get_modpath('wine') then
333 + add_alcohol('wine:glass_vodka')
334 + end
310 335 end)