sorcery  Diff

Differences From Artifact [151760f504]:

  • File data/spells.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: 28394) [annotate] [blame] [check-ins using]

To Artifact [16c84d9b57]:


179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
...
491
492
493
494
495
496
497

498
499
500
501
502
503
504
505
506
507
508
509
510
		uses = 32;
		affinity = {'acacia','blazing'};
		leytype = 'praxic';
		desc = 'Conjure a gout of fire to scorch your foes with a flick of this wand';
		cast = function(ctx)
			local speed = 30 -- TODO maybe amethyst tip increases speed?
			local radius = math.random(math.max(1,math.floor((ctx.stats.power or 1) - 0.5)), math.ceil((ctx.stats.power or 1)+0.5))
			print('!! radius',radius)
			local heading = ctx.heading
			heading.pos.y = heading.pos.y + heading.eyeheight*0.9
			local vel = vector.multiply(heading.yaw,speed)
			local bolt = minetest.add_entity(vector.add(heading.pos,vector.multiply(heading.yaw,2.5)),'sorcery:spell_projectile_flamebolt')
			bolt:set_rotation(heading.yaw)
			bolt:get_luaentity()._blastradius = radius
			bolt:set_velocity(vel)
................................................................................
		cast = function(ctx)
			local tgt = target_node(ctx, 'sorcery:enchanter')
			if not tgt then return false end

			local inv = minetest.get_meta(ctx.target.under):get_inventory()
			for _,name in pairs{'foci','item'} do
				for i=1,inv:get_size(name) do

					local stack = 'sorcery:ash'
					if ctx.base.gem == 'sapphire' then
						stack = nil
					end
					inv:set_stack(name,i,ItemStack(stack))
				end
			end

			enchantment_sparkle(ctx,sorcery.lib.color(255,12,0))
			enchantment_sparkle(ctx,sorcery.lib.color(85,18,35))
			enchantment_sparkle(ctx,sorcery.lib.color(0,0,0))
		end
	};







<







 







>





|







179
180
181
182
183
184
185

186
187
188
189
190
191
192
...
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
		uses = 32;
		affinity = {'acacia','blazing'};
		leytype = 'praxic';
		desc = 'Conjure a gout of fire to scorch your foes with a flick of this wand';
		cast = function(ctx)
			local speed = 30 -- TODO maybe amethyst tip increases speed?
			local radius = math.random(math.max(1,math.floor((ctx.stats.power or 1) - 0.5)), math.ceil((ctx.stats.power or 1)+0.5))

			local heading = ctx.heading
			heading.pos.y = heading.pos.y + heading.eyeheight*0.9
			local vel = vector.multiply(heading.yaw,speed)
			local bolt = minetest.add_entity(vector.add(heading.pos,vector.multiply(heading.yaw,2.5)),'sorcery:spell_projectile_flamebolt')
			bolt:set_rotation(heading.yaw)
			bolt:get_luaentity()._blastradius = radius
			bolt:set_velocity(vel)
................................................................................
		cast = function(ctx)
			local tgt = target_node(ctx, 'sorcery:enchanter')
			if not tgt then return false end

			local inv = minetest.get_meta(ctx.target.under):get_inventory()
			for _,name in pairs{'foci','item'} do
				for i=1,inv:get_size(name) do
					if inv:get_stack(name,i):is_empty() then goto skip end
					local stack = 'sorcery:ash'
					if ctx.base.gem == 'sapphire' then
						stack = nil
					end
					inv:set_stack(name,i,ItemStack(stack))
				::skip::end
			end

			enchantment_sparkle(ctx,sorcery.lib.color(255,12,0))
			enchantment_sparkle(ctx,sorcery.lib.color(85,18,35))
			enchantment_sparkle(ctx,sorcery.lib.color(0,0,0))
		end
	};