@@ -173,14 +173,18 @@ -- 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) end + if s.id == id then + p = p + ((s.boost * slots[s.slot].confluence)/10) + ct = ct + 1 + end end - return p + return p, ct end sorcery.enchant.stackup = function(stack) -- stack update function. this should be called whenever -- the enchantment status of a stack changes; it will @@ -426,9 +430,9 @@ if done[sp.id] then goto skip end done[sp.id] = true local data = sorcery.data.enchants[sp.id] - local strength = sorcery.enchant.strength(tool,sp.id) + local strength, nsp = sorcery.enchant.strength(tool,sp.id) local ch = math.random(1,100) local props = { fail = ch > sp.reliability; user = puncher; @@ -442,14 +446,15 @@ sparks = sparks; cost = data.cost; } if data.on_dig then data.on_dig(props) end - if props.cost ~= 0 then totalcost = totalcost + math.max(1,math.floor(props.cost * strength)) end + if props.cost ~= 0 then totalcost = totalcost + math.max(1,props.cost * nsp) --[[math.max(1,math.floor(props.cost * strength))]] end + -- strength does not increase cost but number of spell slots occupied does -- incentive for the player to be more clever, less brute-force-y if ch > sp.reliability then goto skip end sparks[#sparks + 1] = { color = sorcery.lib.color(data.tone):brighten(1.1); - count = strength * 7; + count = strength * 8; } ::skip::end end if totalcost > 0 then local conservation = math.floor(sorcery.enchant.strength(tool,'conserve') * 6) @@ -486,9 +491,9 @@ z = range(-1.3,1.3); y = range( 0.3,0.9); }; expirationtime = life; - size = range(0.5,1.5); + size = range(0.2,1.5); texture = sorcery.lib.image('sorcery_spark.png'):multiply(s.color):render(); glow = 14; animation = { type = "vertical_frames";