sorcery  Check-in [1ee0f58037]

Overview
Comment:fix many bugs, rebalance & update alchemy recipes, more helpful display of extracts in recipes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1ee0f5803776fcccd86ae517f18e57d40e4d39f24a0a37b28bae2626efec7d82
User & Date: lexi on 2021-07-07 11:35:54
Other Links: manifest | tags
Context
2021-07-07
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
08:23
bug fixes check-in: 612f10a00d user: lexi tags: trunk
Changes

Modified cookbook.lua from [fac511da65] to [4b9992727f].

    49     49   	local props = minetest.registered_items[item]._sorcery
    50     50   	if props and props.recipe then
    51     51   		return props.recipe
    52     52   	end
    53     53   	return {}
    54     54   end
    55     55   local modofname = function(id)
    56         -	local sep = string.find(id,':')
    57         -	if sep == nil then return nil end -- uh oh
    58         -	return string.sub(id, 1, sep - 1)
           56  +	local item = minetest.registered_nodes[id]
           57  +	if item == nil or item.mod_origin == '??' or not item.mod_origin then
           58  +		local sep = string.find(id,':')
           59  +		if sep == nil then return nil end -- uh oh
           60  +		return string.sub(id, 1, sep - 1)
           61  +	end
           62  +	return item.mod_origin
    59     63   end
    60     64   local item_restrict_eval = function(name, restrict)
    61     65   	for _,n in pairs(constants.exclude_names) do
    62     66   		if string.find(name,n) ~= nil then
    63     67   			return false
    64     68   		end
    65     69   	end
................................................................................
   277    281   			end
   278    282   		end;
   279    283   	};
   280    284   	grind = {
   281    285   		name = 'Milling Guide';
   282    286   		node = 'sorcery:mill';
   283    287   		booksuf = 'Manual';
   284         -		chance = 1;
          288  +		chance = 4;
   285    289   		w = 1, h = 2;
   286    290   		pick = function(restrict)
   287    291   			cache:populate_grindables()
   288    292   			if restrict then
   289    293   				local t = {}
   290    294   				for _, i in pairs(cache.grindables) do
   291    295   					local pd = sorcery.itemclass.get(i, 'grindable')
................................................................................
   324    328   						end
   325    329   					end
   326    330   					return {v,''} -- !!
   327    331   				end
   328    332   			end
   329    333   		end;
   330    334   	};
   331         -	-- wand = {
   332         -	--	booksuf = 'Grimoire';
   333         -	-- }
   334    335   	enchant = {
   335    336   		name = 'Enchantment Matrix';
   336    337   		node = 'sorcery:enchanter';
   337    338   		booksuf = 'Grimoire';
   338    339   		drawslots = false;
   339         -		chance = 6;
          340  +		chance = 4;
   340    341   		w = 2, h = 2;
   341    342   		pick = function(restrict)
   342    343   			-- TODO make sure affinity restrictions match
   343    344   			local names = {}
   344    345   			for k,v in pairs(sorcery.data.enchants) do
   345    346   				if v.recipe then names[#names+1] = k end
   346    347   			end
................................................................................
   454    455   	local props = k.props(result)
   455    456   	for i=1,#k.slots do
   456    457   		local ing = ingredients[i]
   457    458   		local x, y = k.slots[i][1], k.slots[i][2]
   458    459   		if ing and ing ~= '' then
   459    460   			local tt
   460    461   			if k.indesc then tt = k.indesc(ing) else tt = desc_builtin(ing) end
          462  +			local overlay = ''
          463  +			if minetest.get_item_group(ing, 'sorcery_extract') ~= 0 then
          464  +				overlay = string.format('item_image[%f,%f;0.6,0.6;%s]', x+0.5, y+0.5, ing)
          465  +				ing = minetest.registered_nodes[ing]._sorcery.extract.of
          466  +			end
   461    467   			t = t .. string.format([[
   462         -				item_image[%f,%f;1,1;%s]
          468  +				item_image[%f,%f;1,1;%s]%s
   463    469   				tooltip[%f,%f;1,1;%s]
   464         -			]], x,y, minetest.formspec_escape(group_eval(ing)),
          470  +			]], x,y, minetest.formspec_escape(group_eval(ing)), overlay,
   465    471   			    x,y, minetest.formspec_escape(tt))
   466    472   		else
   467    473   			if k.drawslots == nil or k.drawslots then
   468    474   				t = string.format('box[%f,%f;0.1,0.1;#00000060]',x+0.45,y+0.45) .. t
   469    475   			end
   470    476   		end
   471    477   	end

Modified data/draughts.lua from [0a84465667] to [91c2fdbd59].

   179    179   	-- 	infusion = 'sorcery:grease_war';
   180    180   	-- 	basis = 'sorcery:potion_soft';
   181    181   	-- 	desc = 'Amplify the power of your blows and crack steel armor with the force of your bare hands';
   182    182   	-- };
   183    183   	resilient = {
   184    184   		name = 'Resilient';
   185    185   		color = {124,124,124}; style = 'dull';
          186  +		infusion = 'sorcery:liquid_sap_pine_bottle';
   186    187   		basis = 'sorcery:potion_soft';
   187    188   		desc = 'Withstand greater damage and hold your ground even in face of tremendous force';
   188    189   		quals = { force = true, duration = true };
   189    190   	};
   190    191   	hover = {
   191    192   		name = 'Hover';
   192    193   		color = {164,252,55}; style = 'sparkle';

Modified data/elixirs.lua from [c432830d8f] to [c6ee9bea3b].

    24     24   	};
    25     25   	Rapidity = {
    26     26   		color = {183,28,238}; qual = 'speed';
    27     27   		apply = inc('speed');
    28     28   		describe = function(potion)
    29     29   			return 'good', 'quickened', 'This potion will take effect more quickly and easily'
    30     30   		end;
    31         -		infusion = 'sorcery:liquid_sap_acacia_bottle';
           31  +		infusion = 'sorcery:oil_wind';
    32     32   	};
    33     33   	Purity = {
    34     34   		color = {244,255,255}; qual = 'purity';
    35     35   		apply = inc('purity');
    36     36   		describe = function(potion)
    37     37   			return 'good', 'purified', 'This potion\'s impurities and undesirable qualities are diminished or eliminated'
    38     38   		end;

Modified data/extracts.lua from [442aef28cd] to [ee1be18d2d].

     1      1   return {
     2      2   	rice = {"farming:seed_rice", {255,255,235}};
     3      3   	cotton = {"farming:seed_cotton", {210,210,210}};
     4      4   	wheat = {"farming:seed_wheat", {255,255,150}};
     5      5   	rye = {"farming:seed_rye", {255,245,180}};
     6      6   	oat = {"farming:seed_oat", {144,81,29}};
     7      7   	barley = {"farming:seed_barley", {239,255,157}};
            8  +	parsley = {"farming:parsley", {248,255,142}};
     8      9   	mint = {"farming:seed_mint", {190,255,190}};
     9     10   	hemp = {"farming:seed_hemp", {247,255,46}};
    10     11   	garlic = {"farming:garlic_clove", {225,167,31}};
    11     12   	onion = {"farming:onion", {247,189,78}};
    12     13   	blueberry = {"group:food_blueberries", {63,38,194}};
    13     14   	raspberry = {"group:food_raspberries", {228,51,210}};
           15  +	blackberry = {"group:food_blackberries", {113,0,101}};
           16  +	strawberry = {"group:food_strawberry", {255,30,78}};
           17  +	pepper = {"group:food_pepper", {220,236,142}};
           18  +	banana = {"group:food_banana", {238,255,30}};
           19  +	carrot = {"group:food_carrot", {255,183,30}};
           20  +	melon = {"farming:melon_slice", {180,255,30}};
           21  +	cucumber = {"group:food_cucumber", {109,224,22}};
    14     22   	chili = {"farming:chili_pepper", {243,75,49}};
    15     23   	pine = {"default:pine_sapling", {41,166,80}};
    16     24   	cocoa = {"farming:cocoa_beans", {146,38,0}};
    17     25   	grape = {"farming:grapes", {206,56,214}};
    18     26   	kelp = {"default:sand_with_kelp", {109,185,145}};
    19     27   	fern = {"default:fern_1", {164,238,47}};
    20     28   	greengrass = {"default:grass_1", {185,255,115}};
    21     29   	marram = {"default:marram_grass_1", {127,255,210}};
    22     30   	shrub = {"default:dry_shrub", {187,149,76}};
    23     31   };

Modified data/greases.lua from [60224ad0aa] to [f41def3541].

    25     25   			'sorcery:extract_onion';
    26     26   		};
    27     27   	};
    28     28   	pine = {
    29     29   		color = {58,194,89};
    30     30   		core = { 'sorcery:oil_wind' };
    31     31   		mix = {
    32         -			'sorcery:extract_pine',
    33         -			'default:pine_needles', 'default:pine_needles',
    34         -			'default:pine_needles', 'default:pine_needles';
           32  +			'sorcery:extract_pine';
           33  +			'sorcery:liquid_sap_pine_bottle';
    35     34   		};
    36     35   	};
    37     36   	whisper = {
    38     37   		color = {148,226,215};
    39     38   		style = 'sparkle';
    40     39   	};
    41     40   	war = {
................................................................................
    67     66   	};
    68     67   	neutralizing = {
    69     68   		color = {221,148,95};
    70     69   		core = { 'sorcery:oil_dawn', 'sorcery:oil_berry' };
    71     70   		mix = {
    72     71   			'sorcery:powder_aluminum';
    73     72   			'sorcery:powder_vidrium';
    74         -			'sorcery:extract_pine';
           73  +			'sorcery:liquid_sap_aspen_bottle';
    75     74   		};
    76     75   	};
    77     76   	lift = {
    78     77   		color = {219,73,210};
    79     78   		style = 'sparkle';
    80     79   		core = { 'sorcery:oil_wind', 'sorcery:oil_stone' };
    81     80   		mix = {
    82     81   			'sorcery:powder_levitanium';
    83     82   			'sorcery:extract_fern';
    84     83   		};
    85     84   	};
    86     85   }

Modified data/oils.lua from [003a3c5f62] to [8c84c471a8].

    43     43   			'farming:salt';
    44     44   		};
    45     45   	};
    46     46   	sanguine = { -- healing
    47     47   		color = {243,66,66};
    48     48   		style = 'sparkle';
    49     49   		mix = {
    50         -			'flowers:mushroom_red';
    51         -			'sorcery:extract_raspberry';
           50  +			'sorcery:extract_strawberry';
    52     51   			'sorcery:blood';
    53     52   			'farming:beetroot';
    54     53   		};
    55     54   	};
    56     55   	flame = {
    57     56   		color = {243,57,49};
    58     57   		style = 'sparkle';
    59     58   		mix = {
    60     59   			'sorcery:extract_chili';
    61         -			'farming:beetroot';
           60  +			'farming:pepper_red';
    62     61   			'sorcery:extract_chili';
           62  +			'sorcery:liquid_sap_acacia_bottle';
    63     63   		};
    64     64   	};
    65     65   	stone = {
    66     66   		color = { 68, 68, 68 };
    67     67   		style = 'sparkle';
    68     68   		mix = {
    69         -			'farming:grapes';
    70         -			'farming:grapes';
    71         -			'farming:grapes';
    72         -			'sorcery:extract_cocoa';
           69  +			'farming:pepper_ground';
           70  +			'farming:parsley';
    73     71   			'sorcery:extract_cocoa';
    74     72   			'sorcery:extract_oat';
    75     73   		};
    76     74   	};
    77     75   	dawn = {
    78     76   		color = {255,255,255};
    79     77   		mix = {
................................................................................
    84     82   			'sorcery:extract_raspberry';
    85     83   			'sorcery:extract_onion';
    86     84   		};
    87     85   	};
    88     86   	bleak = {
    89     87   		color = {155,78,56};
    90     88   		mix = {
    91         -			'farming:salt';
    92         -			'sorcery:extract_raspberry';
    93         -			'sorcery:extract_raspberry';
    94         -			'sorcery:extract_onion';
    95         -			'farming:peas';
    96         -			'farming:peas';
    97         -			'farming:peas';
           89  +			'sorcery:liquid_sap_jungle_bottle';
           90  +			'farming:blackberry';
           91  +			'farming:soy_sauce';
    98     92   		};
    99     93   	};
   100     94   	luscious = {
   101     95   		color = {10,255,10};
   102     96   		mix = {
   103     97   			'farming:hemp_oil';
   104         -			'farming:grapes';
           98  +			'group:food_strawberry';
   105     99   			'farming:cocoa_beans';
   106         -			'farming:cocoa_beans';
   107         -			'farming:sugar';
   108         -			'farming:sugar';
          100  +			'farming:caramel';
   109    101   		};
   110    102   	};
   111    103   	luck = {
   112    104   		color = {156,54,255};
   113    105   		style = 'sparkle';
   114    106   		mix = {
   115    107   			'sorcery:extract_marram';
   116    108   			'farming:hemp_leaf';
   117    109   			'xdecor:honey';
   118         -			'farming:salt';
   119    110   			'farming:salt';
   120    111   		};
   121    112   	};
   122    113   }

Modified data/philters.lua from [6fff6fb29a] to [67b62e2890].

     1      1   return {
     2      2   	dark = {
     3      3   		color = {86,16,42};
     4         -		infusion = "default:obsidian_shard";
            4  +		infusion = "sorcery:liquid_sap_pine_bottle";
     5      5   	};
     6      6   	shimmering = {
     7      7   		color = {224,255,155};
     8      8   		infusion = "default:mese_crystal_fragment";
     9      9   	};
    10     10   	silent = {
    11     11   		color = {249,193,42};
    12     12   		infusion = "sorcery:extract_cotton";
    13     13   	};
    14     14   	verdant = {
    15         -		infusion = "default:sapling";
           15  +		infusion = "sorcery:liquid_sap_apple_bottle";
    16     16   		color = {78,222,113};
    17     17   	};
    18     18   	blazing = {
    19     19   		infusion = "sorcery:oil_flame";
    20     20   		color = {229,32,53};
    21     21   	};
    22     22   }

Modified data/potions.lua from [018fbedf8a] to [d785900359].

    10     10   		infusion = 'sorcery:oil_mystic';
    11     11   		basis = 'sorcery:holy_water';
    12     12   		substitutes = 'Serene';
    13     13   		glow = 8;
    14     14   	};
    15     15   	Misty = {
    16     16   		color = {186,241,233};
    17         -		infusion = 'sorcery:grease_fog';
           17  +		infusion = 'sorcery:liquid_sap_aspen_bottle';
    18     18   	};
    19     19   	Luminous = {
    20     20   		color = {255,237,160};
    21     21   		style = 'dull';
    22     22   		glow = 12;
    23     23   		infusion = 'sorcery:gem_luxite';
    24     24   	};

Modified data/trees.lua from [66384fbe7c] to [4c4b931a13].

    33     33   	acacia = {
    34     34   		desc = 'Acacia';
    35     35   		node = 'default:acacia_tree';
    36     36   		sapling = 'default:acacia_sapling';
    37     37   		leaves = 'default:acacia_leaves';
    38     38   		sap = 'Acacia Sap';
    39     39   		color = {217, 51, 22};
           40  +		sapglow = 7;
    40     41   	};
    41     42   	jungle = {
    42     43   		desc = 'Jungle';
    43     44   		node = 'default:jungletree';
    44     45   		sapling = 'default:junglesapling';
    45     46   		leaves = 'default:jungleleaves';
    46     47   		sap = 'Tropical Syrup';
    47     48   		color = {86, 39, 71};
    48     49   		imgvariant = 'dull';
    49     50   	};
    50     51   }

Modified potions.lua from [22f82424c6] to [13f2ff2455].

   286    286   	local desc = u.str.capitalize(n) .. ' Extract'
   287    287   	sorcery.register_potion(name, desc, nil, color, 'sparkle', false, {
   288    288   		groups = {
   289    289   			sorcery_extract = 1;
   290    290   			sorcery_container = 2;
   291    291   		};
   292    292   		_sorcery = {
          293  +			extract = {
          294  +				of = item;
          295  +				proto = v;
          296  +			};
   293    297   			container = {
   294    298   				type = 'vessel';
   295    299   				hold = 'liquid';
   296    300   				charge = 3;
   297    301   				has = liqid;
   298    302   				empty = 'vessels:glass_bottle';
   299    303   			};

Modified tap.lua from [4e48d35701] to [eb69eaaf9d].

    13     13   	tiles = {
    14     14   		'default_copper_block.png';
    15     15   		'default_steel_block.png';
    16     16   	};
    17     17   	groups = {
    18     18   		dig_immediate = 2;
    19     19   		attached_node = 1;
           20  +		sorcery_instantiate = 1;
    20     21   	};
    21     22   	sunlight_propagates = true;
    22     23   	paramtype = 'light', paramtype2 = 'wallmounted';
    23     24   	selection_box = { type='fixed', fixed = {-0.2,-0.5,-0.35; 0.3,0.1,0.4} };
    24     25   	collision_box = { type='fixed', fixed = {-0.2,-0.5,-0.35; 0.3,0.1,0.4} };
    25     26   	node_placement_prediction = '';
    26     27   	on_place = function(stack,who,where)
................................................................................
    47     48   		return stack
    48     49   	end;
    49     50   	on_rotate = function() return false end;
    50     51   	_sorcery = {
    51     52   		recipe = {
    52     53   			note = 'Extract syrups and oils from trees';
    53     54   		};
           55  +		on_load = function(pos,node)
           56  +			local tpos = pos + minetest.wallmounted_to_dir(node.param2)
           57  +			local tree = sorcery.tree.get(tpos)
           58  +			if not tree or tree.def.sap == false then return end;
           59  +			tapdrip(tree.def.sapliq, pos)
           60  +		end;
    54     61   	};
    55     62   })
    56     63   
    57     64   minetest.register_craft {
    58     65   	output = 'sorcery:tap';
    59     66   	recipe = {
    60     67   		{'','sorcery:screw_steel','basic_materials:steel_bar'};

Modified tree.lua from [be6e1c803c] to [9824222a51].

    39     39   			name = sapdesc;
    40     40   			kind = 'sorcery:sap';
    41     41   			color = t.sapcolor or t.color or {119,24,30};
    42     42   			autogen = true;
    43     43   			imgvariant = 'sparkle';
    44     44   			measure = sorcery.liquid.units.pint;
    45     45   			usetrough = t.sap ~= false;
           46  +			glow = t.sapglow;
    46     47   		}
    47     48   	end
    48     49   
    49     50   end)
    50     51   
    51     52   sorcery.tree.get = function(what)
    52     53   	local name, pos