sorcery  Check-in [ac4c799281]

Overview
Comment:fixed recipes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ac4c799281c1bda4f70c25a6707b4837b3cd40f3c59fb67613fc7869ccfaf8e4
User & Date: lexi on 2021-07-06 21:15:54
Other Links: manifest | tags
Context
2021-07-06
22:21
correct recipe check-in: 99e19cc14f user: lexi tags: trunk
21:15
fixed recipes check-in: ac4c799281 user: lexi tags: trunk
19:26
bug fixes check-in: b82a675e76 user: lexi tags: trunk
Changes

Modified liquid.lua from [7230727dfc] to [db73c43862].

     1      1   -- liquid.lua
     2      2   -- the liquid registry is used to keep track of abstract liquids,
     3      3   -- their properties, and their representation in-game.
     4      4   
     5      5   sorcery.registry.mk('liquid', false)
            6  +local mkunit = function(unit,fac)
            7  +	return function(amt)
            8  +		-- allow division for more accurate results
            9  +		if fac >= 0 then
           10  +			amt = amt * fac
           11  +		else
           12  +			amt = amt / (-fac)
           13  +		end
           14  +		return string.format('%s %s%s', amt, unit, (amt == 1) and '' or 's')
           15  +	end
           16  +end
     6     17   sorcery.liquid = {
     7     18   	constants = {
     8     19   		drams_per_glass = 64;
           20  +		pints_per_glass = 0.5;
     9     21   		glasses_per_bottle = 3;
    10     22   		bottles_per_bucket = 3;
    11     23   		bottles_per_trough = 6;
    12         -	}
           24  +	};
           25  +	unit = mkunit;
    13     26   }
    14     27   local constants = sorcery.liquid.constants
           28  +sorcery.liquid.units = {
           29  +	dram = mkunit('dram', constants.drams_per_glass);
           30  +	pint = mkunit('pint', constants.pints_per_glass);
           31  +	draught = mkunit('draught', -3);
           32  +	drink = mkunit('drink', 1);
           33  +};
    15     34   
    16     35   local L = sorcery.lib
    17     36   local log = sorcery.logger('liquid')
    18     37   
    19     38   sorcery.liquid.fill_from_basin = function(ctr, liquid, basin)
    20     39   	local liq = sorcery.register.liquid.db[liquid]
    21     40   	local filled
................................................................................
   164    183   				}
   165    184   			};
   166    185   		})
   167    186   	end
   168    187   end
   169    188   sorcery.liquid.mktrough()
   170    189   
   171         -sorcery.liquid.measure_default = function(amt)
   172         -	return string.format('%s drams', amt*constants.drams_per_glass)
   173         -end
          190  +sorcery.liquid.measure_default = sorcery.liquid.units.dram
   174    191   
   175    192   sorcery.liquid.container = function(liq, ctr)
   176    193   	return liq.containers[({
   177    194   		bottle = 'vessels:glass_bottle';
   178    195   		glass = 'vessels:drinking_glass';
   179    196   		keg = 'sorcery:keg';
   180    197   		trough = 'sorcery:trough';

Modified potions.lua from [715b9ce25c] to [22f82424c6].

   120    120   	local fullname = n .. ' Potion'
   121    121   	sorcery.liquid.register{
   122    122   		id = 'sorcery:'..id;
   123    123   		name = fullname;
   124    124   		color = v.color;
   125    125   		proto = v;
   126    126   		kind = 'sorcery:potion';
   127         -		measure = function(amt) return string.format('%s draughts', amt / 3) end;
          127  +		measure = sorcery.liquid.units.draught;
   128    128   		containers = {
   129    129   			['vessels:glass_bottle'] = 'sorcery:' .. id;
   130    130   		};
   131    131   	}
   132    132   	v.kind = kind_potion;
   133    133   	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
   134    134   		groups = {
................................................................................
   302    302   
   303    303   	sorcery.liquid.register {
   304    304   		id = liqid;
   305    305   		name = desc;
   306    306   		kind = 'sorcery:extract';
   307    307   		proto = v;
   308    308   		color = v[2];
          309  +		measure = sorcery.liquid.units.pint;
   309    310   		containers = {
   310    311   			['vessels:glass_bottle'] = liqid;
   311    312   		};
   312    313   	}
   313    314   
   314    315   	local add_alcohol = function(booze)
   315    316   		minetest.register_craft {

Modified recipes.lua from [2f8b7e24c9] to [553d976f64].

   410    410   })
   411    411   
   412    412   
   413    413   regtech('warding_plate', 'Warding Plate', {metal = 1}, {
   414    414   	{'basic_materials:gold_wire','basic_materials:gold_wire','basic_materials:gold_wire'};
   415    415   	{'',mtlp('vidrium','block'),''};
   416    416   	{'basic_materials:gold_wire','basic_materials:gold_wire','basic_materials:gold_wire'};
   417         -}, 4)
          417  +}, 4, {
          418  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          419  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          420  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          421  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          422  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          423  +	{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          424  +})
   418    425   regtech('ley_puncture', 'Ley Puncture', {metal = 1}, {
   419    426   	{'default:flint','sorcery:tungsten_ingot','group:sorcery_ley_cable'};
   420    427   	{'','group:sorcery_ley_cable',''};
   421    428   	{'group:sorcery_ley_cable','sorcery:tungsten_ingot','default:flint'};
   422    429   })
   423    430   regtech('pulse_rectifier', 'Pulse Rectifier', {metal = 1})
   424    431   regtech('current_felicitator', 'Current Felicitator', {metal = 1}, {
   425    432   	{'basic_materials:silver_wire','basic_materials:silver_wire','basic_materials:silver_wire'};
   426    433   	{'sorcery:cobalt_ingot','sorcery:inversion_matrix','sorcery:cobalt_ingot'};
   427    434   	{'default:bronze_ingot','sorcery:platinum_ingot','default:bronze_ingot'};
          435  +},1,{
          436  +	{'basic_materials:silver_wire', 'basic_materials:empty_spool'};
          437  +	{'basic_materials:silver_wire', 'basic_materials:empty_spool'};
          438  +	{'basic_materials:silver_wire', 'basic_materials:empty_spool'};
   428    439   })
   429    440   
   430    441   regtech('conduction_plate', 'Conduction Plate', {metal = 1}, {
   431    442   	{'','default:copper_ingot',''};
   432    443   	{'','stairs:slab_stone',''};
   433    444   	{'basic_materials:copper_wire','basic_materials:steel_bar','basic_materials:copper_wire'};
          445  +}, 1, {
          446  +	{'basic_materials:copper_wire', 'basic_materials:empty_spool'};
          447  +	{'basic_materials:copper_wire', 'basic_materials:empty_spool'};
   434    448   })
   435    449   
   436    450   regtech('catalytic_convector', 'Catalytic Convector', {metal = 1}, {
   437    451   	{'basic_materials:heating_element','default:gold_ingot','basic_materials:heating_element'};
   438    452   	{'default:mese_crystal','default:mese_crystal','default:mese_crystal'};
   439    453   	{'sorcery:tungsten_ingot','sorcery:oil_flame','sorcery:tungsten_ingot'};
   440    454   }, 1, {
................................................................................
   543    557   minetest.register_craft {
   544    558   	output = 'sorcery:inversion_matrix';
   545    559   	recipe = {
   546    560   		{'','sorcery:inverter_coil','basic_materials:gold_wire'};
   547    561   		{'sorcery:inverter_coil','sorcery:leyline_stabilizer','sorcery:inverter_coil'};
   548    562   		{'basic_materials:gold_wire','sorcery:inverter_coil',''};
   549    563   	};
          564  +	replacements = {
          565  +		{'basic_materials:gold_wire', 'basic_materials:empty_spool'};
          566  +	};
   550    567   }
   551    568   
   552    569   
   553    570   minetest.register_craft {
   554    571   	output = 'sorcery:field_emitter';
   555    572   	recipe = {
   556    573   		{'basic_materials:steel_bar','xpanes:pane_flat','basic_materials:steel_bar'};

Modified tree.lua from [e171bc2182] to [be6e1c803c].

     4      4   	sap = 'Sap';
     5      5   	sapliq = 'sorcery:sap';
     6      6   	sapling = 'default:sapling';
     7      7   }
     8      8   local log = sorcery.logger('tree')
     9      9   local L = sorcery.lib
    10     10   
    11         -local measure_sap = function(v) -- v in half-pints
    12         -	return string.format('%s pints', v / 2)
    13         -end
    14         -
    15     11   sorcery.register.trees.foreach('sorcery:treesetup', {}, function(id, t)
    16     12   	-- generates sap and hooks handlers appropriately
    17     13   	if t.node then
    18     14   		local def = minetest.registered_nodes[t.node]
    19     15   		local nextfn = def.on_place
    20     16   		minetest.override_item(t.node, { on_place = function(stack, who, pointed, ...)
    21     17   			if nextfn then nextfn(stack, who, pointed, ...) end
................................................................................
    41     37   		sorcery.liquid.register {
    42     38   			id = t.sapliq;
    43     39   			name = sapdesc;
    44     40   			kind = 'sorcery:sap';
    45     41   			color = t.sapcolor or t.color or {119,24,30};
    46     42   			autogen = true;
    47     43   			imgvariant = 'sparkle';
    48         -			measure = measure_sap;
           44  +			measure = sorcery.liquid.units.pint;
    49     45   			usetrough = t.sap ~= false;
    50     46   		}
    51     47   	end
    52     48   
    53     49   end)
    54     50   
    55     51   sorcery.tree.get = function(what)