Index: vfx.lua ================================================================== --- vfx.lua +++ vfx.lua @@ -1,9 +1,10 @@ sorcery.vfx = {} +local L = sorcery.lib sorcery.vfx.glowspark = function(color) - local spark = sorcery.lib.image('sorcery_spark.png') + local spark = L.image('sorcery_spark.png') return spark:blit(spark:multiply(color)) end sorcery.vfx.cast_sparkle = function(caster,color,strength,duration,pos) local ofs = pos @@ -12,11 +13,11 @@ local height = caster:get_properties().eye_height minetest.add_particlespawner { amount = 70 * strength; time = duration or 1.5; attached = caster; - -- texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render(); + -- texture = L.image('sorcery_spark.png'):multiply(color):render(); texture = sorcery.vfx.glowspark(color):render(); minpos = ofs({ x = 0.0, z = 0.6, y = height*0.7}); maxpos = ofs({ x = 0.4, z = 0.2, y = height*1.1}); minvel = { x = -0.5, z = -0.5, y = -0.5}; maxvel = { x = 0.5, z = 0.5, y = 0.5}; @@ -33,12 +34,11 @@ }; } end sorcery.vfx.body_sparkle = function(body,color,str,pos) - local img = sorcery.lib.image - local tex = img('sorcery_spark.png') + local tex = L.image('sorcery_spark.png') local pi = tex:blit(tex:multiply(color)):render() local ofs = pos and function(x) return vector.add(pos,x) end or function(x) return x end return minetest.add_particlespawner { @@ -78,11 +78,11 @@ minpos = vector.subtract(tgt.under, 0.5); maxpos = vector.add(tgt.under, 0.5); minvel = minvel, maxvel = maxvel; minexptime = 1, maxexptime = 2; minsize = 0.5, maxsize = 2; - texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render(); + texture = L.image('sorcery_spark.png'):multiply(color):render(); animation = { type = 'vertical_frames'; aspect_w = 16, aspect_h = 16; length = 2; }; @@ -142,11 +142,11 @@ minetest.add_particle { pos = ppos; velocity = vector.multiply(dir,vel); expirationtime = 0.4; size = math.random()*2.4 + 0.6; - texture = sorcery.lib.image('sorcery_sputter.png'):glow(col):render(); + texture = L.image('sorcery_sputter.png'):glow(col):render(); glow = 14; animation = { type = 'vertical_frames', length = 0.4; aspect_w = 16, aspect_h = 16 }; @@ -156,11 +156,11 @@ function sorcery.vfx.drip(liquid, noz, amt, time, exp) if type(liquid) == 'string' then liquid = sorcery.register.liquid.db[liquid] end local minnoz = vector.offset(noz, -0.03, 0.0, -0.03); local maxnoz = vector.offset(noz, 0.03, 0.0, 0.03); - local drop = sorcery.lib.image('sorcery_drop.png'):multiply(liquid.color) + local drop = L.image('sorcery_drop.png'):multiply(L.color(liquid.color)) return minetest.add_particlespawner { amount = amt, time = time; texture = drop:render(); minpos = minnoz, maxpos = maxnoz; minvel = vector.new(0,0,0);