sorcery  Diff

Differences From Artifact [604c53eb6c]:

To Artifact [e643a56c3c]:


    29     29   		dye    = { caption = 'Any Dye',    cnitem = 'dye:black'      };
    30     30   		bone   = { caption = 'Any Bone',   cnitem = 'bonemeal:bone'  };
    31     31   		vessel = { caption = 'Any Bottle', cnitem = 'vessels:glass_bottle' };
    32     32   		flower = { caption = 'Any Flower', cnitem = 'flowers:rose' };
    33     33   		mushroom = { caption = 'Any Mushroom', cnitem = 'flowers:mushroom_brown' };
    34     34   		water_bucket = { caption = 'Water Bucket', cnitem = 'bucket:bucket_water' };
    35     35   		sorcery_ley_cable = { caption = 'Cable', cnitem = 'sorcery:cable_vidrium' };
           36  +		scissors = { caption = 'Scissors', cnitem = 'sorcery:scissors_steel' };
    36     37   	};
    37     38   }
    38     39   sorcery.cookbook.constants = constants
    39     40   
    40     41   local slot3x3 = {
    41     42   	{0,0}, {1,0}, {2,0};
    42     43   	{0,1}, {1,1}, {2,1};
................................................................................
   152    153   		desc = string.format("%s (%u)",desc,s:get_count())
   153    154   	end
   154    155   	return desc
   155    156   end;
   156    157   
   157    158   local bookadjs = { -- sets are in reverse order!
   158    159   	{'Celestial', 'Divine', 'Inspired', 'Heavenly';
   159         -	 'Mystic', 'Diabolic', 'Luminous', 'Forsaken'};
          160  +	 'Mystic', 'Diabolic', 'Luminous', 'Forsaken',
          161  +	 'Ethereal'};
   160    162   
   161    163   	{'Dark', 'Perfected', 'Flawless', 'Unthinkable';
   162         -	 'Impossible', 'Worrisome', 'Unimpeachable'};
          164  +	 'Impossible', 'Worrisome', 'Unimpeachable', 'Fulsome',
          165  +	 'Wise'};
   163    166   
   164    167   	{'Splendid', 'Magnificent', 'Sublime', 'Grand';
   165    168   	 'Beneficent', 'Mysterious', 'Peculiar', 'Eerie';
   166    169   	 'Fulsome', 'Fearsome', 'Curious', 'Fascinating';
   167         -     'Notorious', 'Infamous'};
          170  +     'Notorious', 'Infamous', 'Wondrous'};
   168    171   }
   169    172   
   170    173   local cache = {
   171    174   	populate_grindables = function(cache)
   172    175   		if not cache.grindables then
   173    176   			cache.grindables = {}
   174    177   			for k,v in pairs(minetest.registered_items) do
................................................................................
   312    315   			local rec = {}
   313    316   			local en = sorcery.data.enchants[name]
   314    317   			if not en then return nil end
   315    318   			en = en.recipe
   316    319   			for i,e in pairs(en) do
   317    320   				if e.lens then
   318    321   					rec[i] = 'sorcery:lens_' .. e.lens .. '_' .. e.gem
          322  +				elseif e.item then
          323  +					rec[i] = e.item
          324  +				end
          325  +				if e.consume or (e.item and not e.dmg) then
          326  +					rec[i] = rec[i] .. ' ' .. tostring(e.consume or 1) -- :/
   319    327   				end
   320    328   			end
   321    329   			return rec
   322    330   		end;
   323    331   		props = function(name)
   324         -			return sorcery.data.enchants[name].info or {}
          332  +			local ench = sorcery.data.enchants[name]
          333  +			local p = ench.info
          334  +			local desc = ''
          335  +			if ench.cost ~= 0 then
          336  +				desc = string.format('%s <b>%i</b> thaum-second%s of charge when tool is used',
          337  +					ench.cost > 0 and 'Consumes' or 'Generates',
          338  +					math.abs(ench.cost),
          339  +					ench.cost ~= 1 and 's' or ''
          340  +				)
          341  +			end
          342  +				
          343  +			if p == nil then return {note = desc} end
          344  +			if p.note   then return p end
          345  +			return sorcery.lib.tbl.proto({note = desc},p)	
   325    346   		end;
   326    347   		slots = {
   327    348   				{0.5,0};
   328    349   			{0,1},   {1,1}
   329    350   		};
   330    351   		title = function(name) return sorcery.data.enchants[name].name end;
   331    352   		outdesc = function(name,suffix)
   332    353   			local e = sorcery.data.enchants[name]
          354  +			local cap = sorcery.lib.str.capitalize
          355  +			local aff = sorcery.data.affinities[e.affinity]
   333    356   			return sorcery.lib.ui.tooltip {
   334    357   				title = e.name;
   335         -				desc = sorcery.lib.str.capitalize(e.desc);
   336         -				color = sorcery.lib.color(e.tone):readable();
          358  +				desc = cap(e.desc);
          359  +				color = sorcery.lib.color(e.tone);
          360  +				props = {
          361  +					{
          362  +						title = string.format('%s affinity', cap(e.affinity));
          363  +						desc = aff.desc;
          364  +						color = sorcery.lib.color(aff.color);
          365  +					};
          366  +				};
   337    367   			}
   338    368   		end;
   339    369   	};
   340    370   	-- spells = {
   341    371   	--  booksuf = 'Spellbook';
   342    372   	--	slots = {
   343    373   	--		{0,0}, {1,0};
................................................................................
   398    428   			end
   399    429   		end
   400    430   	end
   401    431   	local img, ot
   402    432   	if props.note then
   403    433   		local nx, ny, nw, nh
   404    434   		if notes_right then
   405         -			nx = 5.25 ny = 0
   406         -			nw = 4 nh = 3
          435  +			nx = 5.25 - (3 - k.w) -- :/
          436  +			ny = 0
          437  +			nw = 4 nh = k.h
   407    438   		else
   408    439   			nx = 0 ny = 3
   409         -			nw = 4 nh = 1
          440  +			nw = 4 nh = k,h
   410    441   		end
   411    442   		t = t .. string.format([[
   412    443   			hypertext[%f,%f;%f,%f;note;<global valign=middle halign=justify size=20>%s]
   413    444   		]], nx,ny,nw,nh, minetest.formspec_escape(props.note))
   414    445   	end
   415    446   	if k.icon then img = k.icon(result) end
   416    447   	if k.outdesc then ot = k.outdesc(result) else ot = desc_builtin(result) end
   417    448   		-- image[%f,%f;1,1;gui_furnace_arrow_bg.png^[transformR270]
   418    449   	return t .. string.format([[
   419    450   		item_image[%f,%f;1,1;%s]tooltip[%f,%f;1,1;%s]
   420         -		]] --[[box[%f,%f;1,1;#850083A0]] .. [[
          451  +		box[%f,%f;1.1,1.1;#1a001650]
   421    452   		%s[%f,%f;1,1;%s]
   422    453   		tooltip[%f,%f;1,1;%s]
   423    454   	]], k.w, k.h/2 - 0.5, k.node,
   424    455   		k.w, k.h/2 - 0.5, minetest.formspec_escape(minetest.registered_nodes[k.node].description),
   425         -			-- k.w+1, k.h/2 - 0.5,
          456  +			 k.w+1.05, k.h/2 - 0.55,
   426    457   		img and 'image' or 'item_image',
   427    458   			k.w+1.1, k.h/2 - 0.5, minetest.formspec_escape(img or result),
   428    459   			k.w+1.1, k.h/2 - 0.5, minetest.formspec_escape(ot))
   429    460   end;
   430    461   
   431    462   local retrieve_recipe = function(kind,out,notes_right)
   432    463   	local rec = recipe_kinds[kind]