Differences From
Artifact [378fef1f36]:
- File
gems.lua
— part of check-in
[3f6a913e4e]
at
2020-09-29 12:40:28
on branch trunk
— * remove former hacky registration system, replace with consistent and flexible API; rewrite metal/gem generation to take advantage of this new API; tweaks to init system to enable world-local tweaks to lore and sorcery behavior
* initial documentation commit
* initial steps towards calendar - add default date format, astrolabe; prepare infra for division/melding/transmutation spells, various tweaks and fixes
(user:
lexi,
size: 6366)
[annotate]
[blame]
[check-ins using]
- File
gems.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: 7479)
[annotate]
[blame]
[check-ins using]
19 19 id = name; data = gem;
20 20 value = c.cost*shards_per_gem;
21 21 }
22 22 end end
23 23 if gem.armor then for a,c in pairs(armors) do
24 24 sorcery.matreg.lookup[(gem.items and gem.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
25 25 gem = true;
26 - id = name; data = gem;
26 + id = name, data = gem;
27 27 value = c.cost*shards_per_gem;
28 28 }
29 29 end end
30 30
31 31 if gem.foreign_shard then
32 32 minetest.clear_craft {output=shardname}
33 33 else
................................................................................
49 49 };
50 50 }
51 51 };
52 52 };
53 53 })
54 54 end
55 55 if not gem.foreign_amulet then
56 + local img = sorcery.lib.image
57 + local img_stone = img('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone))
58 + local img_sparkle = img('sorcery_amulet_sparkle.png')
56 59 minetest.register_craftitem(amuletname, {
57 60 description = sorcery.lib.str.capitalize(name) .. ' amulet';
58 - inventory_image = sorcery.lib.image('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone)):render();
61 + inventory_image = img_sparkle:blit(img_stone):render();
62 + wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
63 + groups = { sorcery_amulet = 1 };
59 64 _sorcery = {
60 65 material = {
61 66 gem = true, id = name, data = gem;
62 67 value = (5 * shards_per_gem) + 4;
63 68 };
69 + amulet = { base = name };
64 70 };
65 71 })
72 + sorcery.register.metals.foreach('sorcery:mk-amulet-frames-'..name,{'sorcery:generate'}, function(metalid,metal)
73 + if not metal.amulet then return end
74 + local framedid = string.format("%s_frame_%s", amuletname, metalid)
75 + local img_frame = img(string.format('sorcery_amulet_frame_%s.png',metalid))
76 + minetest.register_craftitem(framedid, {
77 + description = string.format("%s-framed %s amulet",sorcery.lib.str.capitalize(metalid), name);
78 + inventory_image = img_sparkle:blit(img_frame):blit(img_stone):render();
79 + wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
80 + groups = { sorcery_amulet = 1 };
81 + _sorcery = {
82 + amulet = { base = name, frame = metalid };
83 + };
84 + })
85 + local frag = metal.parts.fragment
86 + minetest.register_craft {
87 + output = framedid;
88 + recipe = {
89 + {'', frag,''};
90 + {frag,amuletname,frag};
91 + {'', frag,''};
92 + };
93 + }
94 + end)
66 95 end
67 96 minetest.register_craft {
68 97 type = 'shapeless';
69 98 recipe = (minetest.get_modpath('xdecor') and {
70 99 'xdecor:hammer', itemname;
71 100 }) or { itemname };
72 101 output = shardname .. ' 9';