sorcery  Check-in [b82a675e76]

Overview
Comment:bug fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b82a675e76340555689858cbce9105007d547988793edc5031862feff7c2451a
User & Date: lexi on 2021-07-06 19:26:16
Other Links: manifest | tags
Context
2021-07-06
21:15
fixed recipes check-in: ac4c799281 user: lexi tags: trunk
19:26
bug fixes check-in: b82a675e76 user: lexi tags: trunk
17:35
disassembler no longer disintegrates glass bottles check-in: e8e42c6029 user: lexi tags: trunk
Changes

Modified cookbook.lua from [aae72d93b8] to [fac511da65].

473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
	if props.note then
		local nx, ny, nw, nh
		if notes_right then
			nx = 5.25 - (3 - k.w) -- :/
			ny = 0
			nw = 4 nh = k.h
		else
			nx = 0 ny = 3
			nw = 4 nh = k,h
		end
		t = t .. string.format([[
			hypertext[%f,%f;%f,%f;note;<global valign=middle halign=justify size=20>%s]
		]], nx,ny,nw,nh, minetest.formspec_escape(props.note))
	end
	if k.icon then img = k.icon(result) end
	if k.outdesc then ot = k.outdesc(result) else ot = desc_builtin(result) end







|
|







473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
	if props.note then
		local nx, ny, nw, nh
		if notes_right then
			nx = 5.25 - (3 - k.w) -- :/
			ny = 0
			nw = 4 nh = k.h
		else
			nx = 0 ny = 2
			nw = 4 nh = k.h
		end
		t = t .. string.format([[
			hypertext[%f,%f;%f,%f;note;<global valign=middle halign=justify size=20>%s]
		]], nx,ny,nw,nh, minetest.formspec_escape(props.note))
	end
	if k.icon then img = k.icon(result) end
	if k.outdesc then ot = k.outdesc(result) else ot = desc_builtin(result) end

Modified keg.lua from [59c6df911a] to [b24c7d1147].

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
						frame_length = (0.5/14) + 0.02;
					}
				}
				minetest.after(0.2, function()
					minetest.add_particlespawner {
						amount = math.random(5,11) * chg, time = 0.13 * chg;
						texture = drop:render();
						minpos = vector.offset(minnoz, 0,-0.05,0);
						maxpos = vector.offset(maxnoz, 0,-0.05,0);
						minvel = vector.new(0,-0.1,0);
						maxvel = vector.new(0,-0.4,0);
						minacc = vector.new(0,-0.15,0);
						maxacc = vector.new(0,-0.18,0);
						minsize = 0.3, maxsize = 0.5;
						glow = 14; -- FIXME liquid glow prop
						minexptime = 1, maxexptime = 1.5;







|
|







154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
						frame_length = (0.5/14) + 0.02;
					}
				}
				minetest.after(0.2, function()
					minetest.add_particlespawner {
						amount = math.random(5,11) * chg, time = 0.13 * chg;
						texture = drop:render();
						minpos = minnoz;
						maxpos = maxnoz;
						minvel = vector.new(0,-0.1,0);
						maxvel = vector.new(0,-0.4,0);
						minacc = vector.new(0,-0.15,0);
						maxacc = vector.new(0,-0.18,0);
						minsize = 0.3, maxsize = 0.5;
						glow = 14; -- FIXME liquid glow prop
						minexptime = 1, maxexptime = 1.5;

Modified lib/color.lua from [9a1b399926] to [914583aeb0].

207
208
209
210
211
212
213





214
215
216
217
218
219
220
		}
		if g == nil then
			if type(r) == 'string' then
				assert(false) -- TODO parse color string
			elseif type(r) == 'table' then
				if r.hue then
					return from_hsl(r, r.alpha or g)





				else
					new.red = r[1]
					new.green = r[2]
					new.blue = r[3]
					new.alpha = r[4]
				end
			else assert(false) end







>
>
>
>
>







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
		}
		if g == nil then
			if type(r) == 'string' then
				assert(false) -- TODO parse color string
			elseif type(r) == 'table' then
				if r.hue then
					return from_hsl(r, r.alpha or g)
				elseif r.r and r.g and r.b then
					new.red = r.r
					new.green = r.g
					new.blue = r.b
					new.alpha = r.a
				else
					new.red = r[1]
					new.green = r[2]
					new.blue = r[3]
					new.alpha = r[4]
				end
			else assert(false) end

Modified potions.lua from [1dfd3579b4] to [715b9ce25c].

114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
295
296
297
298
299
300
301
302

303
304
305

306
307
308
309

310
311
312
313
314
315
316
	local glow = v.glow
	local id = 'potion_' .. string.lower(n)
	local desc = 'A ' .. ((glow and 'glowing ') or '') ..
		'bottle of ' .. string.lower(n) .. 
		((kind == 'sparkle' and ', fiercely bubbling') or '') ..
		' liquid'
	local fullname = n .. ' Potion'

	sorcery.register.liquid.link('sorcery:'..id, {
		name = fullname;
		color = v.color;
		proto = v;
		kind = 'sorcery:potion';
		measure = function(amt) return string.format('%s draughts', amt / 3) end;
		containers = {
			['vessels:glass_bottle'] = 'sorcery:' .. id;
		};
	})
	v.kind = kind_potion;
	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
		groups = {
			sorcery_potion = 1;
			sorcery_magical = 1;
		};
		_proto = v;
................................................................................
				charge = 3;
				has = liqid;
				empty = 'vessels:glass_bottle';
			};
		};
	})

	sorcery.register.liquid.link(liqid, {

		name = desc;
		kind = 'sorcery:extract';
		proto = v;

		containers = {
			['vessels:glass_bottle'] = name;
		};
	})


	local add_alcohol = function(booze)
		minetest.register_craft {
			type = "shapeless";
			recipe = {
				booze;
				item, item, item;







>
|








|







 







|
>



>

|

<
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
...
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311

312
313
314
315
316
317
318
319
	local glow = v.glow
	local id = 'potion_' .. string.lower(n)
	local desc = 'A ' .. ((glow and 'glowing ') or '') ..
		'bottle of ' .. string.lower(n) .. 
		((kind == 'sparkle' and ', fiercely bubbling') or '') ..
		' liquid'
	local fullname = n .. ' Potion'
	sorcery.liquid.register{
		id = 'sorcery:'..id;
		name = fullname;
		color = v.color;
		proto = v;
		kind = 'sorcery:potion';
		measure = function(amt) return string.format('%s draughts', amt / 3) end;
		containers = {
			['vessels:glass_bottle'] = 'sorcery:' .. id;
		};
	}
	v.kind = kind_potion;
	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
		groups = {
			sorcery_potion = 1;
			sorcery_magical = 1;
		};
		_proto = v;
................................................................................
				charge = 3;
				has = liqid;
				empty = 'vessels:glass_bottle';
			};
		};
	})

	sorcery.liquid.register {
		id = liqid;
		name = desc;
		kind = 'sorcery:extract';
		proto = v;
		color = v[2];
		containers = {
			['vessels:glass_bottle'] = liqid;
		};

	}

	local add_alcohol = function(booze)
		minetest.register_craft {
			type = "shapeless";
			recipe = {
				booze;
				item, item, item;