Differences From
Artifact [3215634528]:
1 1 --- gemstones
2 2 local shards_per_gem = 9
3 3
4 4 local register_gem = function(name,gem)
5 5 local itemname = gem.foreign or 'sorcery:gem_' .. name
6 6 local shardname = gem.foreign_shard or 'sorcery:gem_' .. name .. '_shard'
7 7 local amuletname = gem.foreign_amulet or 'sorcery:gem_' .. name .. '_amulet'
8 + local polishedname = gem.foreign_polished or 'sorcery:gem_' .. name .. '_polished'
8 9
9 10 sorcery.data.gems[name].parts = {
10 11 item = itemname;
11 12 shard = shardname;
12 13 amulet = amuletname;
13 14 }
14 15
................................................................................
51 52 };
52 53 };
53 54 })
54 55 end
55 56 gem.durability = gem.durability or (gem.hardness or 1) * 100
56 57 if not gem.foreign_amulet then
57 58 local img = sorcery.lib.image
58 - local img_stone = img('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone))
59 + local colorized_stone = function(file)
60 + return img(file):multiply(sorcery.lib.color(gem.tone:brighten(1.1)))
61 + end
62 + local img_stone = colorized_stone('sorcery_amulet.png')
63 + local img_stone_tiny = colorized_stone('sorcery_amulet_embedded.png')
59 64 local img_sparkle = img('sorcery_amulet_sparkle.png')
65 + local img_necklace = img('sorcery_amulet_necklace.png')
60 66 local useamulet = function(stack,user,target)
61 67 local sp = sorcery.amulet.getspell(stack)
62 68 if not sp or not sp.cast then return nil end
63 69
64 70 local usedamulet if stack:get_count() == 1 then
65 71 usedamulet = stack
66 72 else
................................................................................
119 125 if leftover and leftover:get_count() > 0 then
120 126 minetest.add_item(user:get_pos(), leftover)
121 127 end
122 128 end
123 129 return stack
124 130 end
125 131 end;
132 +
133 + local stonematprops = {
134 + gem = true, id = name, data = gem;
135 + value = (5 * shards_per_gem) + 4;
136 + };
126 137 minetest.register_craftitem(amuletname, {
127 138 description = sorcery.lib.str.capitalize(name) .. ' amulet';
128 - inventory_image = img_sparkle:blit(img_stone):render();
139 + inventory_image = img_sparkle:blit(img_stone):blit(img_necklace):render();
140 + wield_image = img_sparkle:blit(img_stone):render();
129 141 wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
130 142 groups = { sorcery_amulet = 1 };
131 143 on_use = useamulet;
132 - _sorcery = {
133 - material = {
134 - gem = true, id = name, data = gem;
135 - value = (5 * shards_per_gem) + 4;
136 - };
137 - amulet = { base = name };
144 + _sorcery = { material = stonematprops, amulet = { base=name }};
145 + })
146 + minetest.register_craftitem(polishedname, {
147 + description = 'Polished ' .. name;
148 + inventory_image = img_sparkle:blit(img_stone):render();
149 + wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
150 + _sorcery = { material = stonematprops };
151 + })
152 + minetest.register_craft {
153 + output = amuletname;
154 + type = 'shapeless';
155 + recipe = {
156 + polishedname;
157 + 'basic_materials:silver_wire';
158 + };
159 + replacements = {
160 + {'basic_materials:silver_wire', 'basic_materials:empty_spool'};
138 161 };
139 - })
162 + }
140 163 sorcery.lathe.register {
141 164 input = itemname;
142 - output = amuletname;
165 + output = polishedname;
143 166 tech = 'intaglio';
144 167 cost = 1;
145 168 }
146 169 sorcery.register.metals.foreach('sorcery:mk-amulet-frames-'..name,{'sorcery:generate'}, function(metalid,metal)
147 170 if not metal.amulet then return end
148 171 local framedid = string.format("%s_frame_%s", amuletname, metalid)
149 172 local img_frame = img(string.format('sorcery_amulet_frame_%s.png',metalid))
150 173 minetest.register_craftitem(framedid, {
151 174 description = string.format("%s-framed %s amulet",sorcery.lib.str.capitalize(metalid), name);
152 - inventory_image = img_sparkle:blit(img_frame):blit(img_stone):render();
175 + inventory_image = img_stone_tiny:blit(img_frame):blit(img_necklace):render();
176 + wield_image = img_stone_tiny:blit(img_frame):render();
153 177 wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
154 178 groups = { sorcery_amulet = 1 };
155 179 on_use = useamulet;
156 180 _sorcery = {
157 181 amulet = { base = name, frame = metalid };
158 182 };
159 183 })