sorcery  Diff

Differences From Artifact [c60971c6b0]:

To Artifact [25dadd17e3]:

  • File itemclass.lua — part of check-in [72eebac4bc] at 2020-09-26 18:49:51 on branch trunk — add writing stand for editing codexes; add scissors, ink, erasure fluid, pens; touch up codex UI; add many recipe notes; add craft divination type for crafttools; defuckulate fucktarded crafttool impl; enhance table library with missing features like lua's table.unpack; many bug fixes and enhancements; blood for the blood god (user: lexi, size: 4425) [annotate] [blame] [check-ins using]

42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60






61
62
63
64
65
66
67
..
71
72
73
74
75
76
77




78
79
80
81
82
83
84
			compat = 'grindables';
			subclass = {'metallic'};
			conform = {
				metallic = function(m)
					if m and m.data and m.data.parts and m.data.parts.powder then
						return {
							hardness = m.data.hardness;

							value = m.value or 1, grindcost = 1;
							powder = m.data.parts.powder;
						}
					end
				end;
			};
			predicate = function(name)
				local def = minetest.registered_items[name]._sorcery
				if not def then return nil end
				def = def.material
				if def and def.grindvalue then
					return def end






			end;
		};
		metal = {
			predicate = function(name)
				-- metallookup is a table of 'primary' metal
				-- items, like ingots, fragments, and powders
				return sorcery.data.metallookup[name]
................................................................................
			subclass = {'metal'};
			predicate = function(name)
				-- matreg is a registry binding crafted items,
				-- like armors and tools, to the material they
				-- are made out of
				local mat = sorcery.matreg.lookup[name]
				if mat and mat.metal then return mat end




			end;
		};
		ore = {
			groups = { 'ore' };
			compat = 'ore';
			predicate = function(name)
				-- maybe revise this at some point once sorcery is extricated







>
|










|
>
>
>
>
>
>







 







>
>
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
			compat = 'grindables';
			subclass = {'metallic'};
			conform = {
				metallic = function(m)
					if m and m.data and m.data.parts and m.data.parts.powder then
						return {
							hardness = m.data.hardness;
							grindcost = 1;
							grindvalue = m.value or 1;
							powder = m.data.parts.powder;
						}
					end
				end;
			};
			predicate = function(name)
				local def = minetest.registered_items[name]._sorcery
				if not def then return nil end
				def = def.material
				if def and def.grindvalue then
					return {
						hardness = def.data.hardness;
						grindcost = def.grindcost or 1;
						grindvalue = def.grindvalue;
						powder = def.powder or def.data.parts.powder;
					}
				end
			end;
		};
		metal = {
			predicate = function(name)
				-- metallookup is a table of 'primary' metal
				-- items, like ingots, fragments, and powders
				return sorcery.data.metallookup[name]
................................................................................
			subclass = {'metal'};
			predicate = function(name)
				-- matreg is a registry binding crafted items,
				-- like armors and tools, to the material they
				-- are made out of
				local mat = sorcery.matreg.lookup[name]
				if mat and mat.metal then return mat end
				local prop = minetest.registered_items[name]._sorcery
				if prop and prop.material and prop.material.metal then
					return prop.material
				end
			end;
		};
		ore = {
			groups = { 'ore' };
			compat = 'ore';
			predicate = function(name)
				-- maybe revise this at some point once sorcery is extricated