sorcery  Diff

Differences From Artifact [569b7fff67]:

To Artifact [c83bd974f4]:


171
172
173
174
175
176
177
178


179
180
181
182
183
184
185
	sorcery.enchant.strength = function(stack,id)
		-- this functions should be used whenever you need to
		-- determine the power of a particular enchantment on
		-- an enchanted item.
		local e = sorcery.enchant.get(stack)
		local p = 0.0
		local ct = 0
		local slots = sorcery.matreg.lookup[stack:get_name()].data.slots


		-- TODO handle strength-boosting spells!
		for _,s in pairs(e.spells) do
			if s.id == id then
				p = p + ((s.boost * slots[s.slot].confluence)/10)
				ct = ct + 1
			end
		end







|
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
	sorcery.enchant.strength = function(stack,id)
		-- this functions should be used whenever you need to
		-- determine the power of a particular enchantment on
		-- an enchanted item.
		local e = sorcery.enchant.get(stack)
		local p = 0.0
		local ct = 0
		local slots = sorcery.matreg.lookup[stack:get_name()]
		if not (slots and slots.data and slots.data.slots) then return p, ct end
		slots = slots.data.slots
		-- TODO handle strength-boosting spells!
		for _,s in pairs(e.spells) do
			if s.id == id then
				p = p + ((s.boost * slots[s.slot].confluence)/10)
				ct = ct + 1
			end
		end