sorcery  Diff

Differences From Artifact [92db18c27d]:

To Artifact [b47d0e6fa4]:


898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
...
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
....
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
									if sorcery.lib.node.is_clear(sum) then
										vp[#vp+1] = sum
									end
								end
								if #vp > 0 then npos=vp[math.random(#vp)] end
							end
							if npos then
								minetest.set_node(npos, minetest.get_node(ctx.target.under))
								if minetest.registered_nodes[ty].on_construct then
									minetest.registered_nodes[ty].on_construct(npos)
								end
								minetest.get_meta(npos):from_table(origmeta)
								return npos, true
							else
								local nstack = ItemStack(ty)
								nstack:get_meta():from_table(origmeta)
								local leftover = ctx.caster:get_inventory():add_item('main',nstack)
								if leftover and not leftover.is_empty() then
................................................................................
			};
		};
	};
	luminate = {
		name = 'Luminate';
		tone = {255,194,0};
		minpower = 1;
		rarity = 5;
		amulets = {
			luxite = {
				name = 'Glow';
				desc = 'Swathe yourself in an aura of sparkling radiance, casting light upon all the dark places where you voyage';
				cast = function(ctx)
					local fac = (ctx.stats.power * 0.1)
					local radius = 2 + 5*fac
................................................................................
								if sorcery.lib.str.beginswith(minetest.get_node(n).name,'sorcery:air_glimmer_') then
									minetest.remove_node(n)
								end
							end
						end;
						intervals = {
							{period = period, after = {whence=0,secs=0.7}, fn = function(c)
								print('cycling!')
								for _,sub in pairs(c.spell.subjects) do
									local ox, oy, oz = math.random(-radius,radius),
													   math.random(-radius,radius),
													   math.random(-radius,radius)
									local pos = vector.offset(sub.player:get_pos(), ox,oy,oz)
									print('pos',minetest.pos_to_string(pos),'player',minetest.pos_to_string(sub.player:get_pos()))
									if sorcery.lib.node.is_air(pos) then
										print('is air!')
										local power = math.random(4,minetest.LIGHT_MAX)
										minetest.set_node(pos, {
											name = 'sorcery:air_glimmer_' .. tostring(power);
										})
										c.spell.nodes[#c.spell.nodes + 1] = pos
										local d = glowduration * (0.5 + math.random()*0.5)
										local m = minetest.get_meta(pos)
										m:set_float('duration', d)
										m:set_float('timeleft', d)
										m:set_int('power', power)
									else
										print('not air!', dump(minetest.get_node(pos)))
									end
								end
							end};
						};
					}
				end;
				iridium = {







|
|
|
|







 







|







 







<





|

<










|
|







898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
...
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
....
1013
1014
1015
1016
1017
1018
1019

1020
1021
1022
1023
1024
1025
1026

1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
									if sorcery.lib.node.is_clear(sum) then
										vp[#vp+1] = sum
									end
								end
								if #vp > 0 then npos=vp[math.random(#vp)] end
							end
							if npos then
								minetest.place_node(npos, minetest.get_node(ctx.target.under))
								-- if minetest.registered_nodes[ty].on_construct then
								-- 	minetest.registered_nodes[ty].on_construct(npos)
								-- end
								minetest.get_meta(npos):from_table(origmeta)
								return npos, true
							else
								local nstack = ItemStack(ty)
								nstack:get_meta():from_table(origmeta)
								local leftover = ctx.caster:get_inventory():add_item('main',nstack)
								if leftover and not leftover.is_empty() then
................................................................................
			};
		};
	};
	luminate = {
		name = 'Luminate';
		tone = {255,194,0};
		minpower = 1;
		rarity = 8;
		amulets = {
			luxite = {
				name = 'Glow';
				desc = 'Swathe yourself in an aura of sparkling radiance, casting light upon all the dark places where you voyage';
				cast = function(ctx)
					local fac = (ctx.stats.power * 0.1)
					local radius = 2 + 5*fac
................................................................................
								if sorcery.lib.str.beginswith(minetest.get_node(n).name,'sorcery:air_glimmer_') then
									minetest.remove_node(n)
								end
							end
						end;
						intervals = {
							{period = period, after = {whence=0,secs=0.7}, fn = function(c)

								for _,sub in pairs(c.spell.subjects) do
									local ox, oy, oz = math.random(-radius,radius),
													   math.random(-radius,radius),
													   math.random(-radius,radius)
									local pos = vector.offset(sub.player:get_pos(), ox,oy,oz)
									-- print('pos',minetest.pos_to_string(pos),'player',minetest.pos_to_string(sub.player:get_pos()))
									if sorcery.lib.node.is_air(pos) then

										local power = math.random(4,minetest.LIGHT_MAX)
										minetest.set_node(pos, {
											name = 'sorcery:air_glimmer_' .. tostring(power);
										})
										c.spell.nodes[#c.spell.nodes + 1] = pos
										local d = glowduration * (0.5 + math.random()*0.5)
										local m = minetest.get_meta(pos)
										m:set_float('duration', d)
										m:set_float('timeleft', d)
										m:set_int('power', power)
									-- else
									-- 	print('not air!', dump(minetest.get_node(pos)))
									end
								end
							end};
						};
					}
				end;
				iridium = {