sorcery  Check-in [612f10a00d]

Overview
Comment:bug fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 612f10a00d9742ff0bf8e55526efdfa0820cb572087ed54c29d1591013278f9f
User & Date: lexi on 2021-07-07 08:23:24
Other Links: manifest | tags
Context
2021-07-07
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
07:56
tweak interval check-in: b79f4e8611 user: lexi tags: trunk
Changes

Modified data/trees.lua from [85c10552c5] to [66384fbe7c].

    23     23   	};
    24     24   	aspen = {
    25     25   		desc = 'Aspen';
    26     26   		node = 'default:aspen_tree';
    27     27   		sapling = 'default:aspen_sapling';
    28     28   		sap = 'Aspen Sap';
    29     29   		leaves = 'default:aspen_leaves';
    30         -		color = {242, 241, 221};
           30  +		color = {255, 251, 172};
    31     31   		imgvariant = 'dull';
    32     32   	};
    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         -		color = {245, 40, 40};
           39  +		color = {217, 51, 22};
    40     40   	};
    41     41   	jungle = {
    42     42   		desc = 'Jungle';
    43     43   		node = 'default:jungletree';
    44     44   		sapling = 'default:junglesapling';
    45     45   		leaves = 'default:jungleleaves';
    46     46   		sap = 'Tropical Syrup';
    47     47   		color = {86, 39, 71};
    48     48   		imgvariant = 'dull';
    49     49   	};
    50     50   }

Modified liquid.lua from [db73c43862] to [b7e36caf54].

    89     89   		local geom = {
    90     90   			pxl {2,0,2; 14, 2, 14};
    91     91   			pxl {2,2,2; 4,h,14};
    92     92   			pxl {2,2,2; 14,h,4};
    93     93   
    94     94   			pxl {12,2,2; 14,h,14};
    95     95   			pxl {2,2,12; 14,h,14};
    96         -
    97     96   		}
    98     97   		if lvl > 0 then
    99     98   			local fac = lvl / M
   100     99   			return L.tbl.append({
   101    100   				pxl {4,2,4; 12, 2 + ((h-3)*fac), 12};
   102    101   			}, geom)
   103    102   		else return geom end
................................................................................
   106    105   	for i = 1*f,M*f do
   107    106   		local top = L.image('sorcery_trough_top_overlay.png')
   108    107   		if liq then top = top:blit( 
   109    108   			L.image('sorcery_node_liquid.png'):multiply(L.color(liq.color))
   110    109   		) else top=top:blit(
   111    110   			L.image('sorcery_trough_bottom.png')
   112    111   		) end
   113         -		local trough_title = liq and string.format('%s Trough', L.str.capitalize(liq.name))
   114         -		local trough_content = liq and string.format('%s of %s', liq.measure(i * Q), liq.name)
   115         -		local function trough_caption(pos,i) 
          112  +		local ttlc = function(liq) return
          113  +			liq and string.format('%s Trough', L.str.capitalize(liq.name)),
          114  +			liq and string.format('%s of %s', liq.measure(i * Q), liq.name)
          115  +		end
          116  +		local trough_title, trough_content = ttlc(liq)
          117  +		local function trough_caption(pos,i,l) 
          118  +			local trough_title, trough_content = ttlc(l or liq)
   116    119   			minetest.get_meta(pos):set_string('infotext', i > 0 and string.format(
   117    120   				'%s\n(%s)', trough_title, trough_content
   118    121   			) or 'Empty Trough')
   119    122   		end
   120    123   		sorcery.register.residue.link(lid(i),lid(0))
   121    124   		minetest.register_node(':'..lid(i), {
   122    125   			description = liq and L.ui.tooltip {
................................................................................
   174    177   						trough_caption(pos, vol)
   175    178   					end;
   176    179   					set_node_liq = function(pos, liq, vol)
   177    180   						log.act('adding', vol, 'to trough at', liq)
   178    181   						vol = vol or Q * i
   179    182   						local idx = math.min(M, math.floor(vol/Q))
   180    183   						minetest.swap_node(pos, {name = trough_mkid(liq, idx)})
   181         -						trough_caption(pos, idx)
          184  +						trough_caption(pos, idx, liq)
   182    185   					end
   183    186   				}
   184    187   			};
   185    188   		})
   186    189   	end
   187    190   end
   188    191   sorcery.liquid.mktrough()