sorcery  Check-in [119981d2d8]

Overview
Comment:fix multiply bug
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 119981d2d8ab75556652651919933d86bfaf60b09ca900cb65460c8aa614c164
User & Date: lexi on 2021-07-07 11:39:49
Other Links: manifest | tags
Context
2021-07-07
12:05
update harvest god gifts check-in: 18f3f28aa2 user: lexi tags: trunk
11:39
fix multiply bug check-in: 119981d2d8 user: lexi tags: trunk
11:35
fix many bugs, rebalance & update alchemy recipes, more helpful display of extracts in recipes check-in: 1ee0f58037 user: lexi tags: trunk
Changes

Modified vfx.lua from [659d5f0d60] to [e1c11d0a7c].

     1      1   sorcery.vfx = {}
            2  +local L = sorcery.lib
     2      3   
     3      4   sorcery.vfx.glowspark = function(color)
     4         -	local spark = sorcery.lib.image('sorcery_spark.png')
            5  +	local spark = L.image('sorcery_spark.png')
     5      6   	return spark:blit(spark:multiply(color))
     6      7   end
     7      8   
     8      9   sorcery.vfx.cast_sparkle = function(caster,color,strength,duration,pos)
     9     10   	local ofs = pos
    10     11   		and function(x) return vector.add(pos,x) end
    11     12   		or  function(x) return x end
    12     13   	local height = caster:get_properties().eye_height
    13     14   	minetest.add_particlespawner {
    14     15   		amount = 70 * strength;
    15     16   		time = duration or 1.5;
    16     17   		attached = caster;
    17         -		-- texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
           18  +		-- texture = L.image('sorcery_spark.png'):multiply(color):render();
    18     19   		texture = sorcery.vfx.glowspark(color):render();
    19     20   		minpos = ofs({ x =  0.0, z =  0.6, y =  height*0.7});
    20     21   		maxpos = ofs({ x =  0.4, z =  0.2, y =  height*1.1});
    21     22   		minvel = { x = -0.5, z = -0.5, y = -0.5};
    22     23   		maxvel = { x =  0.5, z =  0.5, y =  0.5};
    23     24   		minacc = { x =  0.0, z =  0.0, y =  0.5};
    24     25   		maxacc = { x =  0.0, z =  0.0, y =  0.5};
................................................................................
    31     32   			aspect_h = 16;
    32     33   			length = 1.1;
    33     34   		};
    34     35   	}
    35     36   end
    36     37   
    37     38   sorcery.vfx.body_sparkle = function(body,color,str,pos)
    38         -	local img = sorcery.lib.image
    39         -	local tex = img('sorcery_spark.png')
           39  +	local tex = L.image('sorcery_spark.png')
    40     40   	local pi = tex:blit(tex:multiply(color)):render()
    41     41   	local ofs = pos
    42     42   		and function(x) return vector.add(pos,x) end
    43     43   		or  function(x) return x end
    44     44   	return minetest.add_particlespawner {
    45     45   		amount = 25 * str;
    46     46   		time = 0.5;
................................................................................
    76     76   		amount = 50;
    77     77   		time = 0.5;
    78     78   		minpos = vector.subtract(tgt.under, 0.5);
    79     79   		maxpos = vector.add(tgt.under, 0.5);
    80     80   		minvel = minvel, maxvel = maxvel;
    81     81   		minexptime = 1, maxexptime = 2;
    82     82   		minsize = 0.5, maxsize = 2;
    83         -		texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
           83  +		texture = L.image('sorcery_spark.png'):multiply(color):render();
    84     84   		animation = {
    85     85   			type = 'vertical_frames';
    86     86   			aspect_w = 16, aspect_h = 16;
    87     87   			length = 2;
    88     88   		};
    89     89   		glow = 14;
    90     90   	}
................................................................................
   140    140   		end
   141    141   		local et = math.floor((far/vel)*10)*.1
   142    142   		minetest.add_particle {
   143    143   			pos = ppos;
   144    144   			velocity = vector.multiply(dir,vel);
   145    145   			expirationtime = 0.4;
   146    146   			size = math.random()*2.4 + 0.6;
   147         -			texture = sorcery.lib.image('sorcery_sputter.png'):glow(col):render();
          147  +			texture = L.image('sorcery_sputter.png'):glow(col):render();
   148    148   			glow = 14;
   149    149   			animation = {
   150    150   				type = 'vertical_frames', length = 0.4;
   151    151   				aspect_w = 16, aspect_h = 16
   152    152   			};
   153    153   		}
   154    154   	end
   155    155   end
   156    156   
   157    157   function sorcery.vfx.drip(liquid, noz, amt, time, exp)
   158    158   	if type(liquid) == 'string' then liquid = sorcery.register.liquid.db[liquid] end
   159    159   	local minnoz = vector.offset(noz, -0.03, 0.0, -0.03);
   160    160   	local maxnoz = vector.offset(noz,  0.03, 0.0,  0.03);
   161         -	local drop = sorcery.lib.image('sorcery_drop.png'):multiply(liquid.color)
          161  +	local drop = L.image('sorcery_drop.png'):multiply(L.color(liquid.color))
   162    162   	return minetest.add_particlespawner {
   163    163   		amount = amt, time = time;
   164    164   		texture = drop:render();
   165    165   		minpos = minnoz, maxpos = maxnoz;
   166    166   		minvel = vector.new(0,0,0);
   167    167   		maxvel = vector.new(0,-0.2,0);
   168    168   		minacc = vector.new(0,-0.2,0);