@@ -207,12 +207,14 @@ local potions = inv:get_list('potions') local elixir = infusion[1]:get_definition() local probe = sorcery.spell.probe(pos) local fx = infuser_mods(pos) + local sparkle_color = {sorcery.lib.color(255, 0, 145)}; if probe.disjunction then return true end local potionct = 0 + local cancel = true do local ingredient -- *eyeroll* if infusion[1]:is_empty() then goto cancel end ingredient = infusion[1]:get_name() @@ -223,20 +225,26 @@ local potion = potions[i]:get_definition() if elixir_can_apply(elixir._proto,potion) then -- at least one combination makes a valid potion; -- we can start the infuser - goto start + if elixir._proto.color then + sparkle_color[#sparkle_color+1] = sorcery.lib.color(elixir._proto.color) + end + cancel = false 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 + if v.output.data and v.output.data.color then + sparkle_color[#sparkle_color+1] = sorcery.lib.color(v.output.data.color) + end + cancel = false end end ::skip:: end - ::cancel:: do + ::cancel:: if cancel then infuser_stop(pos) return false end @@ -271,15 +279,17 @@ length = 4.1; }; } end - -- for i=0,4 do - spawn('sorcery_spark.png^[multiply:#FF8FDD', 1, 32 * 4) - -- end - -- for i=0,4 do - spawn('sorcery_spark.png^[multiply:#FFB1F6', 0.5, 64 * 4) - -- end - + local spark = sorcery.lib.image('sorcery_spark.png') + for i = 1,4 do + local fac = 1 / i + local _, spc = sorcery.lib.tbl.pick(sparkle_color) + local sp = spark:glow(spc) + + spawn(sp:render(), fac, (32/fac) * 4) + end + local discharge = sorcery.lib.node.discharger(pos) if newtime >= infusion_time then -- finished