90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
local base = potions[i]:get_name()
local potion = potions[i]:get_definition()
if elixir_can_apply(elixir,potion) then
-- at least one combination makes a valid potion;
-- we can start the infuser
goto start
end
for _,v in pairs(sorcery.data.infusions) do
if v.infuse == ingredient and v.into == base then
-- at least one combination makes a valid
-- potion; we can start the infuser
goto start
end
end
::skip:: end
................................................................................
title = potion._proto.name .. ' Draught';
desc = potion._proto.desc;
color = sorcery.lib.color(potion._proto.color):readable();
props = effects_table(newstack);
});
inv:set_stack('potions',i,discharge(newstack))
else
for _,v in pairs(sorcery.data.infusions) do
if v.infuse == ingredient and v.into == base then
-- transform the base into the infusion
inv:set_stack('potions',i,discharge(ItemStack(v.output)))
end
end
end
::skip:: end
inv:set_stack('infusion',1,ItemStack(sorcery.data.infusion_leftovers[ingredient]))
infuser_stop(pos)
return false
else
meta:set_float('runtime', newtime)
meta:set_string('formspec', infuser_formspec(percent))
meta:set_string('infotext', 'Infuser (active)')
|
|
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
local base = potions[i]:get_name()
local potion = potions[i]:get_definition()
if elixir_can_apply(elixir,potion) then
-- at least one combination makes a valid potion;
-- we can start the infuser
goto start
end
for _,v in pairs(sorcery.register.infusions.db) do
if v.infuse == ingredient and v.into == base then
-- at least one combination makes a valid
-- potion; we can start the infuser
goto start
end
end
::skip:: end
................................................................................
title = potion._proto.name .. ' Draught';
desc = potion._proto.desc;
color = sorcery.lib.color(potion._proto.color):readable();
props = effects_table(newstack);
});
inv:set_stack('potions',i,discharge(newstack))
else
for _,v in pairs(sorcery.register.infusions.db) do
if v.infuse == ingredient and v.into == base then
-- transform the base into the infusion
inv:set_stack('potions',i,discharge(ItemStack(v.output)))
end
end
end
::skip:: end
inv:set_stack('infusion',1,ItemStack(sorcery.register.residue.db[ingredient]))
infuser_stop(pos)
return false
else
meta:set_float('runtime', newtime)
meta:set_string('formspec', infuser_formspec(percent))
meta:set_string('infotext', 'Infuser (active)')
|