sorcery  Check-in [1d0bffea07]

Overview
Comment:fix amulets again
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1d0bffea079626cb9909fd932869f88b35234a0371818823ad2dc328cae06079
User & Date: lexi on 2021-10-17 03:27:23
Other Links: manifest | tags
Context
2021-10-18
12:00
fix misplaced parens check-in: 92e49a62b8 user: lexi tags: trunk
2021-10-17
03:27
fix amulets again check-in: 1d0bffea07 user: lexi tags: trunk
2021-10-16
23:51
continue work on runes, comment out test code in vfx.lua check-in: 967d5006f5 user: lexi tags: trunk
Changes

Modified cookbook.lua from [f442987cb7] to [ecf4e863cd].

32
33
34
35
36
37
38

39
40
41
42
43
44
45
		bone   = { caption = 'Any Bone',   cnitem = 'bonemeal:bone'  };
		vessel = { caption = 'Any Bottle', cnitem = 'vessels:glass_bottle' };
		flower = { caption = 'Any Flower', cnitem = 'flowers:rose' };
		mushroom = { caption = 'Any Mushroom', cnitem = 'flowers:mushroom_brown' };
		water_bucket = { caption = 'Water Bucket', cnitem = 'bucket:bucket_water' };
		sorcery_ley_cable = { caption = 'Cable', cnitem = 'sorcery:cable_vidrium' };
		scissors = { caption = 'Scissors', cnitem = 'sorcery:scissors_steel' };

	};
}
sorcery.cookbook.constants = constants

local slot3x3 = {
	{0,0}, {1,0}, {2,0};
	{0,1}, {1,1}, {2,1};







>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
		bone   = { caption = 'Any Bone',   cnitem = 'bonemeal:bone'  };
		vessel = { caption = 'Any Bottle', cnitem = 'vessels:glass_bottle' };
		flower = { caption = 'Any Flower', cnitem = 'flowers:rose' };
		mushroom = { caption = 'Any Mushroom', cnitem = 'flowers:mushroom_brown' };
		water_bucket = { caption = 'Water Bucket', cnitem = 'bucket:bucket_water' };
		sorcery_ley_cable = { caption = 'Cable', cnitem = 'sorcery:cable_vidrium' };
		scissors = { caption = 'Scissors', cnitem = 'sorcery:scissors_steel' };
		sorcery_screw = { caption = 'Screw', cnitem = 'sorcery:screw_steel' };
	};
}
sorcery.cookbook.constants = constants

local slot3x3 = {
	{0,0}, {1,0}, {2,0};
	{0,1}, {1,1}, {2,1};

Modified gems.lua from [3215634528] to [fa0c620eff].

1
2
3
4
5
6
7

8
9
10
11
12
13
14
..
51
52
53
54
55
56
57

58



59

60
61
62
63
64
65
66
...
119
120
121
122
123
124
125





126
127

128
129
130
131






132






133
134
135
136
137


138
139

140
141
142
143
144
145
146
147
148
149
150
151
152

153
154
155
156
157
158
159
--- gemstones
local shards_per_gem = 9

local register_gem = function(name,gem)
	local itemname = gem.foreign or 'sorcery:gem_' .. name
	local shardname = gem.foreign_shard or 'sorcery:gem_' .. name .. '_shard'
	local amuletname = gem.foreign_amulet or 'sorcery:gem_' .. name .. '_amulet'


	sorcery.data.gems[name].parts = {
		item = itemname;
		shard = shardname;
		amulet = amuletname;
	}

................................................................................
				};
			};
		})
	end
	gem.durability = gem.durability or (gem.hardness or 1) * 100
	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')

		local useamulet = function(stack,user,target)
			local sp = sorcery.amulet.getspell(stack)
			if not sp or not sp.cast then return nil end

			local usedamulet if stack:get_count() == 1 then
				usedamulet = stack
			else
................................................................................
					if leftover and leftover:get_count() > 0 then
						minetest.add_item(user:get_pos(), leftover)
					end
				end
				return stack
			end
		end;





		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 };
			on_use = useamulet;






			_sorcery = {






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


			};
		}) 

		sorcery.lathe.register {
			input = itemname;
			output = amuletname;
			tech = 'intaglio';
			cost = 1;
		}
		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 };
				on_use = useamulet;
				_sorcery = {
					amulet = { base = name, frame = metalid };
				};
			})







>







 







>
|
>
>
>

>







 







>
>
>
>
>


>
|



>
>
>
>
>
>
|
>
>
>
>
>
>
|
<
<
|
<
>
>

<
>


|









|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157


158

159
160
161

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
--- gemstones
local shards_per_gem = 9

local register_gem = function(name,gem)
	local itemname = gem.foreign or 'sorcery:gem_' .. name
	local shardname = gem.foreign_shard or 'sorcery:gem_' .. name .. '_shard'
	local amuletname = gem.foreign_amulet or 'sorcery:gem_' .. name .. '_amulet'
	local polishedname = gem.foreign_polished or 'sorcery:gem_' .. name .. '_polished'

	sorcery.data.gems[name].parts = {
		item = itemname;
		shard = shardname;
		amulet = amuletname;
	}

................................................................................
				};
			};
		})
	end
	gem.durability = gem.durability or (gem.hardness or 1) * 100
	if not gem.foreign_amulet then
		local img = sorcery.lib.image
		local colorized_stone = function(file)
			return img(file):multiply(sorcery.lib.color(gem.tone:brighten(1.1)))
		end
		local img_stone = colorized_stone('sorcery_amulet.png')
		local img_stone_tiny = colorized_stone('sorcery_amulet_embedded.png')
		local img_sparkle = img('sorcery_amulet_sparkle.png')
		local img_necklace = img('sorcery_amulet_necklace.png')
		local useamulet = function(stack,user,target)
			local sp = sorcery.amulet.getspell(stack)
			if not sp or not sp.cast then return nil end

			local usedamulet if stack:get_count() == 1 then
				usedamulet = stack
			else
................................................................................
					if leftover and leftover:get_count() > 0 then
						minetest.add_item(user:get_pos(), leftover)
					end
				end
				return stack
			end
		end;

		local stonematprops = {
			gem = true, id = name, data = gem;
			value = (5 * shards_per_gem) + 4;
		};
		minetest.register_craftitem(amuletname, {
			description = sorcery.lib.str.capitalize(name) .. ' amulet';
			inventory_image = img_sparkle:blit(img_stone):blit(img_necklace):render();
			wield_image = img_sparkle:blit(img_stone):render();
			wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
			groups = { sorcery_amulet = 1 };
			on_use = useamulet;
			_sorcery = { material = stonematprops, amulet = { base=name }};
		})
		minetest.register_craftitem(polishedname, {
			description = 'Polished ' .. name;
			inventory_image = img_sparkle:blit(img_stone):render();
			wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
			_sorcery = { material = stonematprops };
		})
		minetest.register_craft {
			output = amuletname;
			type = 'shapeless';
			recipe = {
				polishedname;
				'basic_materials:silver_wire';


			};

			replacements = {
				{'basic_materials:silver_wire', 'basic_materials:empty_spool'};
			};

		}
		sorcery.lathe.register {
			input = itemname;
			output = polishedname;
			tech = 'intaglio';
			cost = 1;
		}
		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_stone_tiny:blit(img_frame):blit(img_necklace):render();
				wield_image = img_stone_tiny:blit(img_frame):render();
				wield_scale = { x = 0.6, y = 0.6, z = 0.6 };
				groups = { sorcery_amulet = 1 };
				on_use = useamulet;
				_sorcery = {
					amulet = { base = name, frame = metalid };
				};
			})

Modified metal.lua from [fd032c3f0d] to [9d08817e20].

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
	end

	if not metal.no_craftables then
		install(screw, 0.5)
		minetest.register_craftitem(screw, {
			description = sorcery.lib.str.capitalize(name) .. ' Screw';
			inventory_image = sorcery.lib.image('sorcery_screw.png'):multiply(sorcery.lib.color(metal.tone)):render();
			groups = { metal = 1; sorcery_screw = 1; sorcery_tech_component = 1; };
			_sorcery = {
				material = {
					id = name, data = metal;
					powder = powder;
					grindcost = 2, grindvalue = 1;
					value = 0.5;
				};







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
	end

	if not metal.no_craftables then
		install(screw, 0.5)
		minetest.register_craftitem(screw, {
			description = sorcery.lib.str.capitalize(name) .. ' Screw';
			inventory_image = sorcery.lib.image('sorcery_screw.png'):multiply(sorcery.lib.color(metal.tone)):render();
			groups = { metal = 1; screw = 1; sorcery_screw = 1; sorcery_tech_component = 1; };
			_sorcery = {
				material = {
					id = name, data = metal;
					powder = powder;
					grindcost = 2, grindvalue = 1;
					value = 0.5;
				};

Modified recipes.lua from [7c1490fa06] to [db56bcbbba].

709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
		{'bucket:bucket_water','bucket:bucket_empty'};
	};
}
minetest.register_craft {
	output = 'sorcery:writing_stand';
	recipe = {
		{'screwdriver:screwdriver','default:book','default:gold_ingot'};
		{'sorcery:screw_steel','group:wood','sorcery:screw_steel'};
		{'group:wood','default:stick','group:wood'};
	};
	replacements = {
		{'screwdriver:screwdriver','screwdriver:screwdriver'};
	};
};








|







709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
		{'bucket:bucket_water','bucket:bucket_empty'};
	};
}
minetest.register_craft {
	output = 'sorcery:writing_stand';
	recipe = {
		{'screwdriver:screwdriver','default:book','default:gold_ingot'};
		{'group:sorcery_screw','group:wood','group:sorcery_screw'};
		{'group:wood','default:stick','group:wood'};
	};
	replacements = {
		{'screwdriver:screwdriver','screwdriver:screwdriver'};
	};
};

Modified textures/sorcery_amulet.png from [1fec4bee23] to [40cf089c30].

cannot compute difference between binary files

Modified textures/sorcery_amulet_frame_cobalt.png from [03581951d2] to [712d069ef1].

cannot compute difference between binary files

Modified textures/sorcery_amulet_frame_gold.png from [3f4e9ea977] to [63f3443b23].

cannot compute difference between binary files

Modified textures/sorcery_amulet_frame_iridium.png from [1a2fff3d07] to [51f6cad623].

cannot compute difference between binary files

Modified textures/sorcery_amulet_frame_tungsten.png from [22b5ae6c57] to [f984168de7].

cannot compute difference between binary files

Modified textures/sorcery_amulet_sparkle.png from [5b0e4685c3] to [8cee192550].

cannot compute difference between binary files