Differences From
Artifact [c255af4d4e]:
- File
enchanter.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: 16047)
[annotate]
[blame]
[check-ins using]
143 143 ::skip::end
144 144 return sorcery.matreg.lookup[item:get_name()], eligible
145 145 else return nil end
146 146 end
147 147 local key = 'sorcery_enchantment_recs'
148 148 sorcery.enchant.set = function(stack, data, noup)
149 149 local meta = stack:get_meta()
150 - meta:set_string(key, sorcery.lib.str.meta_armor(pack(data),true))
150 + if data then
151 + meta:set_string(key, sorcery.lib.str.meta_armor(pack(data),true))
152 + else
153 + meta:set_string(key, '')
154 + end
151 155 if not noup then stack=sorcery.enchant.stackup(stack) end
152 156 end
153 157 sorcery.enchant.get = function(stack)
154 158 local meta = stack:get_meta()
155 159 if meta:contains(key) then
156 160 local data = sorcery.lib.str.meta_dearmor(meta:get_string(key),true)
157 161 return unpack(data)