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