sorcery  Diff

Differences From Artifact [36308ba599]:

  • File itemclass.lua — part of check-in [ea6e475e44] at 2020-10-19 09:52:11 on branch trunk — continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes (user: lexi, size: 4530) [annotate] [blame] [check-ins using]

To Artifact [ba9d479786]:

  • File itemclass.lua — part of check-in [96c5289a2a] at 2020-10-21 03:35:35 on branch trunk — add rune forges, runes, amulet frames, write sacrifice spell, touch up amulet graphics, enable enchantment of amulets (though spells cannot yet be cast), defuckulate syncresis core icon, unfuckitize sneaky leycalc bug that's probably been the cause of some long-standing wackiness, add item classes, add some more textures, disbungle various other asstastrophes, remove sneaky old debug code, improve library code, add utility for uploading merge requests (user: lexi, size: 5018) [annotate] [blame] [check-ins using]

75
76
77
78
79
80
81
82


83
84
85
86
87
88
89
90



91
92
93
94
95
96
97
...
103
104
105
106
107
108
109
110















111
112
113
114
115
116
117
			end;
		};
		metallic = {
			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
				-- from instant_ores and we have more control over the items
				-- we generate
................................................................................
						return { metal = true, id = iname }
					elseif sorcery.data.gems[iname] then
						return { gem = true, id = iname }
					end
				end
			end;
		};
		-- fuel = {};















	};
	get = function(name,class)
		local c = sorcery.itemclass.classes[class]
		local o
		if not c then return false end
		if type(name) ~= 'string' then name = name:get_name() end








|
>
>








>
>
>







 







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
			end;
		};
		metallic = {
			subclass = {'metal'};
			predicate = function(name)
				-- matreg is a registry binding crafted items,
				-- like armors and tools, to the material they
				-- are made out of. it's necessary because not
				-- all items we want to interact with have
				-- definitions under our control
				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;
		};
		material = {
			subclass = {'metallic','crystalline'};
		};
		ore = {
			groups = { 'ore' };
			compat = 'ore';
			predicate = function(name)
				-- maybe revise this at some point once sorcery is extricated
				-- from instant_ores and we have more control over the items
				-- we generate
................................................................................
						return { metal = true, id = iname }
					elseif sorcery.data.gems[iname] then
						return { gem = true, id = iname }
					end
				end
			end;
		};
		fuel = {
			groups = {'fuel','flammable'};
			predicate = function(name)
				local c,di = minetest.get_craft_result {
					method = 'fuel';
					width = 1;
					items = { ItemStack(name) };
				}
				if c.time and c.time > 0 then
					return {
						burntime = c.time;
						leftover = di and di[1];
					}
				end
			end;
		};
	};
	get = function(name,class)
		local c = sorcery.itemclass.classes[class]
		local o
		if not c then return false end
		if type(name) ~= 'string' then name = name:get_name() end