sorcery  Diff

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]

To Artifact [e866e2741b]:

  • 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
49
50
51
52
53
54
55



56
57
58



59
60
61
62
63

64
65























66
67
68
69
70
71
72
			id = name; data = gem;
			value = c.cost*shards_per_gem;
		}
	end end
	if gem.armor then for a,c in pairs(armors) do
		sorcery.matreg.lookup[(gem.items and gem.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
			gem = true;
			id = name; data = gem;
			value = c.cost*shards_per_gem;
		}
	end end

	if gem.foreign_shard then
		minetest.clear_craft {output=shardname}
	else
................................................................................
						};
					}
				};
			};
		})
	end
	if not gem.foreign_amulet then



		minetest.register_craftitem(amuletname, {
			description = sorcery.lib.str.capitalize(name) .. ' amulet';
			inventory_image = sorcery.lib.image('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone)):render();



			_sorcery = {
				material = {
					gem = true, id = name, data = gem;
					value = (5 * shards_per_gem) + 4;
				};

			};
		}) 























	end
	minetest.register_craft {
		type = 'shapeless';
		recipe = (minetest.get_modpath('xdecor') and {
			'xdecor:hammer', itemname;
		}) or { itemname };
		output = shardname .. ' 9';







|







 







>
>
>


<
>
>
>





>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
49
50
51
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
			id = name; data = gem;
			value = c.cost*shards_per_gem;
		}
	end end
	if gem.armor then for a,c in pairs(armors) do
		sorcery.matreg.lookup[(gem.items and gem.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
			gem = true;
			id = name, data = gem;
			value = c.cost*shards_per_gem;
		}
	end end

	if gem.foreign_shard then
		minetest.clear_craft {output=shardname}
	else
................................................................................
						};
					}
				};
			};
		})
	end
	if not gem.foreign_amulet then
		local img = sorcery.lib.image
		local img_stone = img('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone))
		local img_sparkle = img('sorcery_amulet_sparkle.png')
		minetest.register_craftitem(amuletname, {
			description = sorcery.lib.str.capitalize(name) .. ' amulet';

			inventory_image = img_sparkle:blit(img_stone):render();
			wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
			groups = { sorcery_amulet = 1 };
			_sorcery = {
				material = {
					gem = true, id = name, data = gem;
					value = (5 * shards_per_gem) + 4;
				};
				amulet = { base = name };
			};
		}) 
		sorcery.register.metals.foreach('sorcery:mk-amulet-frames-'..name,{'sorcery:generate'}, function(metalid,metal)
			if not metal.amulet then return end
			local framedid = string.format("%s_frame_%s", amuletname, metalid)
			local img_frame = img(string.format('sorcery_amulet_frame_%s.png',metalid))
			minetest.register_craftitem(framedid, {
				description = string.format("%s-framed %s amulet",sorcery.lib.str.capitalize(metalid), name);
				inventory_image = img_sparkle:blit(img_frame):blit(img_stone):render();
				wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
				groups = { sorcery_amulet = 1 };
				_sorcery = {
					amulet = { base = name, frame = metalid };
				};
			})
			local frag = metal.parts.fragment
			minetest.register_craft {
				output = framedid;
				recipe = {
					{'',  frag,''};
					{frag,amuletname,frag};
					{'',  frag,''};
				};
			}
		end)
	end
	minetest.register_craft {
		type = 'shapeless';
		recipe = (minetest.get_modpath('xdecor') and {
			'xdecor:hammer', itemname;
		}) or { itemname };
		output = shardname .. ' 9';