sorcery  Diff

Differences From Artifact [fc0276bae8]:

To Artifact [f457c3868d]:


    54     54   	minetest.register_craftitem('sorcery:' .. name, extra)
    55     55   end
    56     56   
    57     57   sorcery.register_potion('blood', 'Blood', 'A bottle of sacrificial blood, imbued\nwith stolen life force', u.color(219,19,14))
    58     58   sorcery.register_potion('potion_water', 'Water Bottle', 'A bottle of plain water', u.color(43,90,162))
    59     59   sorcery.register_potion('holy_water', 'Holy Water','A bottle of consecrated water',u.color(94,138,206),'sparkle',6)
    60     60   
    61         -local create_infusion_recipe = function(id,potion,default_basis)
           61  +local create_infusion_recipe = function(id,potion,default_basis,proto)
    62     62   	if potion.infusion then
    63     63   		sorcery.data.register.infusion {
    64     64   			infuse = potion.infusion;
    65     65   			into = potion.basis or default_basis;
    66     66   			output = 'sorcery:' .. id;
           67  +			_proto = proto;
    67     68   		}
    68     69   	end
    69     70   end
    70     71   
    71     72   for n,v in pairs(sorcery.data.potions) do
    72     73   	local color = u.color(v.color)
    73     74   	local kind = v.style
    74     75   	local glow = v.glow
    75     76   	local id = 'potion_' .. string.lower(n)
    76     77   	local desc = 'A ' .. ((glow and 'glowing ') or '') ..
    77     78   		'bottle of ' .. string.lower(n) .. 
    78     79   		((kind == 'sparkle' and ', fiercely bubbling') or '') ..
    79     80   		' liquid'
    80         -	sorcery.register_potion(id, n .. ' Potion', desc, color, kind, glow, {
           81  +	local fullname = n .. ' Potion'
           82  +	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
    81     83   		_proto = v;
    82     84   		groups = {
    83     85   			sorcery_potion = 1;
    84     86   			sorcery_magical = 1;
    85     87   		};
    86     88   	})
    87         -	create_infusion_recipe(id,v,'sorcery:potion_serene')
           89  +	create_infusion_recipe(id,v,'sorcery:potion_serene',{data=v,name=fullname})
    88     90   end
    89     91   
    90     92   for n,potion in pairs(sorcery.data.draughts) do
    91     93   	local name = 'draught_' .. n
    92     94   	local behavior = {
    93     95   		_proto = potion;
    94     96   		groups = {
................................................................................
   129    131   				else
   130    132   					minetest.add_item(user.get_pos(), ret)
   131    133   				end
   132    134   			end
   133    135   			return stack
   134    136   		end
   135    137   	}
   136         -	sorcery.register_potion(name, potion.name .. ' Draught',
          138  +	local fullname = potion.name .. ' Draught'
          139  +	sorcery.register_potion(name, fullname,
   137    140   		potion.desc,
   138    141   		u.color(potion.color),
   139    142   		potion.style or 'dull',
   140    143   		potion.glow or 0,
   141    144   		behavior)
   142         -	create_infusion_recipe(name,potion,'sorcery:potion_luminous')
          145  +	create_infusion_recipe(name,potion,'sorcery:potion_luminous',{data=potion,name=fullname})
   143    146   end
   144    147   
   145    148   for n,elixir in pairs(sorcery.data.elixirs) do
   146    149   	local color = u.color(elixir.color)
   147    150   	local id = 'elixir_' .. string.lower(n)
   148         -	sorcery.register_potion(id, 'Elixir of ' .. n, nil, color, 'dull', false, {
          151  +	local fullname = 'Elixir of ' .. n
          152  +	sorcery.register_potion(id, fullname, nil, color, 'dull', false, {
   149    153   		_proto = elixir;
   150    154   		groups = {
   151    155   			sorcery_elixir = 1;
   152    156   			sorcery_magical = 1;
   153    157   		};
   154    158   	})
   155         -	create_infusion_recipe(id,elixir,'sorcery:potion_misty')
          159  +	create_infusion_recipe(id,elixir,'sorcery:potion_misty',{data=elixir,name=fullname})
   156    160   end
   157    161   
   158    162   for n,v in pairs(sorcery.data.oils) do
   159    163   	local color = u.color(v.color)
   160    164   	local kind = v.style
   161    165   	local id = 'oil_' .. n
   162    166   	n = v.name or u.str.capitalize(n)
................................................................................
   165    169   	})
   166    170   end
   167    171   
   168    172   for n,v in pairs(sorcery.data.greases) do
   169    173   	local color = u.color(v.color)
   170    174   	local kind = v.style
   171    175   	sorcery.register_oil('grease_' .. n, u.str.capitalize(n) .. ' Grease', nil, color, kind, {
   172         -		groups = { sorcery_grease = 2 }
          176  +		groups = { sorcery_grease = 1 }
   173    177   	})
   174    178   end
   175    179   
   176    180   for n,v in pairs(sorcery.data.philters) do
   177    181   	local color = u.color(v.color)
   178    182   	local id = 'philter_' .. n
   179    183   	local name = v.name or u.str.capitalize(n)
   180         -	sorcery.register_potion(id, name .. ' Philter', v.desc, color, 'sparkle',v.glow or 4, {
          184  +	local fullname = name .. ' Philter'
          185  +	sorcery.register_potion(id, fullname, v.desc, color, 'sparkle',v.glow or 4, {
   181    186   		_proto = v;
   182    187   		_protoname = n;
   183    188   		groups = {
   184    189   			sorcery_magical = 1;
   185    190   			sorcery_philter = 1;
   186    191   		};
   187    192   	})
   188         -	create_infusion_recipe(id,v,'sorcery:potion_viscous')
          193  +	create_infusion_recipe(id,v,'sorcery:potion_viscous',{data=v,name=fullname})
   189    194   end
   190    195   
   191    196   for n,v in pairs(sorcery.data.extracts) do
   192    197   	local item = v[1]
   193    198   	local color = u.color(v[2])
   194    199   	local name = 'extract_' .. n
   195         -	sorcery.register_potion(name, u.str.capitalize(n) .. ' Extract', nil, color, 'sparkle', false)
          200  +	sorcery.register_potion(name, u.str.capitalize(n) .. ' Extract', nil, color, 'sparkle', false, {
          201  +		groups = {
          202  +			sorcery_extracts = 1;
          203  +		};
          204  +	})
   196    205   
   197    206   	local add_alcohol = function(booze)
   198    207   		minetest.register_craft {
   199    208   			type = "shapeless";
   200    209   			recipe = {
   201    210   				booze;
   202    211   				item, item, item;