sorcery  Check-in [d08d3d2bd8]

Overview
Comment:remove debugging shim oops
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d08d3d2bd8029117a50575104ec9c30cbd1f26b9add789e8645dd6a0572e9ab5
User & Date: lexi on 2021-07-05 19:17:56
Other Links: manifest | tags
Context
2021-07-05
20:43
add support for instantiation callbacks, god tweaks and bug fixes check-in: 3354e2aa29 user: lexi tags: trunk
19:17
remove debugging shim oops check-in: d08d3d2bd8 user: lexi tags: trunk
16:47
add new god, add idol crafting recipes, fix bugs check-in: 6e7b450ec7 user: lexi tags: trunk
Changes

Modified altar.lua from [235fbb7fc6] to [e0cdcfa7d5].

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
			-- can't mutate table while we're iterating it
			if not minetest.registered_nodes[g] then bad[#bad+1] = g end
		end
		for _, g in ipairs(bad) do god.gifts[g] = nil end
	end
end)

local god_interval = 1

for name, god in pairs(sorcery.data.gods) do
	local hitbox = {
		0-(god.idol.width / 2.0), 0-(god.idol.height / 2.0), -0.15,
		   god.idol.width / 2.0,     god.idol.height / 2.0,   0.15
	} -- {xmin, ymin, zmin,
	  -- xmax, ymax, zmax} in nodes from node center.
................................................................................
	paramtype = "light";
	if god.idol.craft then
		minetest.register_craft {
			output = 'sorcery:idol_' .. name;
			recipe = god.idol.craft;
		};
	end

	sorcery.lib.node.reg_autopreserve('sorcery:idol_' .. name, {
		description = god.idol.desc;
		drawtype = "mesh";
		mesh = 'sorcery-idol-' .. name .. '.obj';
		paramtype = 'light';
		paramtype2 = 'facedir';
		sunlight_propagates = true;







|







 







>







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
			-- can't mutate table while we're iterating it
			if not minetest.registered_nodes[g] then bad[#bad+1] = g end
		end
		for _, g in ipairs(bad) do god.gifts[g] = nil end
	end
end)

local std_god_interval = 70

for name, god in pairs(sorcery.data.gods) do
	local hitbox = {
		0-(god.idol.width / 2.0), 0-(god.idol.height / 2.0), -0.15,
		   god.idol.width / 2.0,     god.idol.height / 2.0,   0.15
	} -- {xmin, ymin, zmin,
	  -- xmax, ymax, zmax} in nodes from node center.
................................................................................
	paramtype = "light";
	if god.idol.craft then
		minetest.register_craft {
			output = 'sorcery:idol_' .. name;
			recipe = god.idol.craft;
		};
	end
	local god_interval = std_god_interval * (god.freq or 1)
	sorcery.lib.node.reg_autopreserve('sorcery:idol_' .. name, {
		description = god.idol.desc;
		drawtype = "mesh";
		mesh = 'sorcery-idol-' .. name .. '.obj';
		paramtype = 'light';
		paramtype2 = 'facedir';
		sunlight_propagates = true;

Modified data/gods.lua from [a732e194a1] to [6a04c7ee36].

7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

55
56
57
58
59
60
61
62
63
64
65
...
136
137
138
139
140
141
142

143
144
145
146
147
148
149
			legend tells that a foolish mortal king once conspired to steal away Sulavri's staff, knowing it to be the apex of the sorcerer's art and desirous of its might. wise Sulavri however saw the warnings on the wind and in the dances of the birds, and so on the fateful day he fashioned an imitation staff that held no power at all, his wife concealing his true staff by turning into a shawl and casting it about her shoulders. sure enough, when Sulavri laid down to rest at his favored mountain stream, a master thief in the employ of the king stole away the false staff, bringing it to his master. at first delighted, the king found the staff would not answer his will, and soon went mad seeking to unlock the secrets of its power.

			Sulavri is the patron of elders, men, and Wand-Working.
		]];
		laziness = 7;
		generosity = 4;
		stinginess = 1;

		color = {255,34,123};
		idol = {
			desc = 'Mystic Idol';
			width = 0.7;
			height = 1;
			tex = {
				"default_obsidian.png";
................................................................................
			["sorcery:potion_water"] = {4, "sorcery:holy_water"};
			["default:paper"] = function(ctx)
				local stack = ItemStack('sorcery:recipe')
				local mode = select(2,L.tbl.pick{'cook','craft','infuse','grind','enchant'})
				sorcery.cookbook.setrecipe(stack, mode, nil, {
					pred = function(c)
						local me = ctx.god
						if mode == 'enchant' or
							minetest.get_item_group(c.item, 'sorcery_magical') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_magitech') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_ley_device') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_tech') ~= 0 or
							minetest.get_item_group(c.item, 'crafttool') ~= 0 or
							me.sacrifice [c.item] or
							me.consecrate[c.item]

								then return true end
					end;
				})
				return 1, stack
			end;
			-- ["default:gold_ingot"] = {15, "sorcery:holy_token_magic"};
		};
		sacrifice = {
			['sorcery:essence_frost'] = 25;
			['sorcery:essence_flame'] = 25;
			['sorcery:essence_force'] = 30;
................................................................................
			legend says that a barbarian lord high on opium once wandered into a temple of Irix and left the severed head of a local shepherd on the her altar. this desecration so enraged the goddess that the barbarian's entire tribe soon starved horribly to death, their crops refusing to take root, and their stolen breads turning to ash in their mouths.

			Irix is the patron of maidens, mothers, and Alchemy. it is said that Irix Irimentari herself invented alchemy when she brewed the first mead.
		]];
		laziness = 5;
		stinginess = 3;
		generosity = 10;

		color = {214, 255, 146};
		idol = {
			desc = "Harvest Idol";
			width = 0.7;
			height = 1;
			tex = {
				"default_grass.png",







>







 







|






|
>



|







 







>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
...
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
			legend tells that a foolish mortal king once conspired to steal away Sulavri's staff, knowing it to be the apex of the sorcerer's art and desirous of its might. wise Sulavri however saw the warnings on the wind and in the dances of the birds, and so on the fateful day he fashioned an imitation staff that held no power at all, his wife concealing his true staff by turning into a shawl and casting it about her shoulders. sure enough, when Sulavri laid down to rest at his favored mountain stream, a master thief in the employ of the king stole away the false staff, bringing it to his master. at first delighted, the king found the staff would not answer his will, and soon went mad seeking to unlock the secrets of its power.

			Sulavri is the patron of elders, men, and Wand-Working.
		]];
		laziness = 7;
		generosity = 4;
		stinginess = 1;
		freq = 1.2;
		color = {255,34,123};
		idol = {
			desc = 'Mystic Idol';
			width = 0.7;
			height = 1;
			tex = {
				"default_obsidian.png";
................................................................................
			["sorcery:potion_water"] = {4, "sorcery:holy_water"};
			["default:paper"] = function(ctx)
				local stack = ItemStack('sorcery:recipe')
				local mode = select(2,L.tbl.pick{'cook','craft','infuse','grind','enchant'})
				sorcery.cookbook.setrecipe(stack, mode, nil, {
					pred = function(c)
						local me = ctx.god
						if (mode == 'enchant' or
							minetest.get_item_group(c.item, 'sorcery_magical') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_magitech') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_ley_device') ~= 0 or
							minetest.get_item_group(c.item, 'sorcery_tech') ~= 0 or
							minetest.get_item_group(c.item, 'crafttool') ~= 0 or
							me.sacrifice [c.item] or
							me.consecrate[c.item]) and
							mod ~= 'farming'
								then return true end
					end;
				})
				return 6, stack
			end;
			-- ["default:gold_ingot"] = {15, "sorcery:holy_token_magic"};
		};
		sacrifice = {
			['sorcery:essence_frost'] = 25;
			['sorcery:essence_flame'] = 25;
			['sorcery:essence_force'] = 30;
................................................................................
			legend says that a barbarian lord high on opium once wandered into a temple of Irix and left the severed head of a local shepherd on the her altar. this desecration so enraged the goddess that the barbarian's entire tribe soon starved horribly to death, their crops refusing to take root, and their stolen breads turning to ash in their mouths.

			Irix is the patron of maidens, mothers, and Alchemy. it is said that Irix Irimentari herself invented alchemy when she brewed the first mead.
		]];
		laziness = 5;
		stinginess = 3;
		generosity = 10;
		freq = 1;
		color = {214, 255, 146};
		idol = {
			desc = "Harvest Idol";
			width = 0.7;
			height = 1;
			tex = {
				"default_grass.png",