sorcery  Diff

Differences From Artifact [bdb226347b]:

To 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]

278
279
280
281
282
283
284
285
286





287
288
289
290
291
292
293
...
501
502
503
504
505
506
507
508
509
510
511
512









































































513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
		desc = 'Send up sparks of radia to indicate nearness or absence of the blocks whose presence the wand is attuned to';
	};
	verdant = {
		name = 'verdant';
		color = {16,29,255};
		uses = 48;
		leytype = 'imperic';
		desc = 'Pour life-energy into the soil, causing flowers and trees to spring up at your command';
		affinity = {'jungle','verdant'};





	};
	praxic        = anchorwand('praxic',       16, {'pine','shimmering','blazing'});
	counterpraxic = anchorwand('counterpraxic',23, {'pine','shimmering','silent'});
	entropic      = anchorwand('entropic',      8, {'jungle','dark'});
	syncretic     = anchorwand('syncretic',    12, {'aspen','verdant','shimmering','blazing'});
	cognic        = anchorwand('cognic',       32, {'acacia','verdant','dark'});
	occlutic      = anchorwand('occlutic',     15, {'apple','silent','dark'});
................................................................................
			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
	};
	sacrifice = {
		name = 'sacrifice';
		uses = 58;
		color = {212,6,63};
		affinity = {'aspen','blazing'};
		leytype = 'syncretic';
		desc = 'Transform the matter of one to three items on an enchanter into energy and empower the item on the center of the enchanter with it. Useful to recharge wands in areas with weak leylines.';









































































	};
	transfer = {
		name = 'transfer';
		uses = 65;
		color = {6,212,121};
		leytype = 'syncretic';
		affinity = {'aspen','shimmering','silent'};
		desc = 'Transfer ley-current from items on an enchanter into the item in the center, but at a 50% loss if they are of mismatched affinities. One third of maximum current is transferred, and when used on items with little power may destroy them or their enchantments';
	};
	transmute = {
		name = 'transmutation';
		uses = 7;
		color = {255,90,18};
		leytype = 'imperic';
		affinity = {'aspen','shimmering','dark','blazing'};
		desc = 'Transmute three ingots into one of a different metal, determined by chance, and influenced by configuration of the wand as well as the stars and the phase of the moon';
		-- diamond = quantity varies between 1-3
	};
	disjoin = {
		name = 'disjunction';
		uses = 32;
		color = {17,6,212};
		leytype = 'occlutic';







|

>
>
>
>
>







 







|



|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>











|



|







278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
...
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
		desc = 'Send up sparks of radia to indicate nearness or absence of the blocks whose presence the wand is attuned to';
	};
	verdant = {
		name = 'verdant';
		color = {16,29,255};
		uses = 48;
		leytype = 'imperic';
		desc = 'Pour a fraction of your life-energy into the soil, causing flowers and trees to spring up at your command';
		affinity = {'jungle','verdant'};
		-- rubies(?) make it draw life-energy from bottles of blood
		-- in inventory rather than your own bodily health points
		cast = function(ctx)

		end
	};
	praxic        = anchorwand('praxic',       16, {'pine','shimmering','blazing'});
	counterpraxic = anchorwand('counterpraxic',23, {'pine','shimmering','silent'});
	entropic      = anchorwand('entropic',      8, {'jungle','dark'});
	syncretic     = anchorwand('syncretic',    12, {'aspen','verdant','shimmering','blazing'});
	cognic        = anchorwand('cognic',       32, {'acacia','verdant','dark'});
	occlutic      = anchorwand('occlutic',     15, {'apple','silent','dark'});
................................................................................
			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
	};
	sacrifice = {
		name = 'sacrifice';
		uses = 24;
		color = {212,6,63};
		affinity = {'aspen','blazing'};
		leytype = 'syncretic';
		desc = 'Transform the matter of one to three items on an enchanter into energy and empower the item on the center of the enchanter with it. Useful to quickly recharge wands in areas with weak leylines or in emergencies.';
		cast = function(ctx)
			local bitch = function(err)
				sorcery.log('data/spells(sacrifice)', err)
				return false
			end

			local e = get_enchanter(ctx)
			if not e then return false end

			local scgroups = {
				sorcery_tech = 400;
				sorcery_magitech = 600;
				shovel = 100;
				sword = 200;
				pick = 300;
				axe = 250;
			}

			local rechargee = e:get_stack('item',1)
			if rechargee:is_empty() then return false end
			local charge, maxcharge = sorcery.ley.getcharge(rechargee)
			if not charge then return false end

			local getscval = function(stack)
				local name,def = stack:get_name(),stack:get_definition()
				local getitemval = function()
					if name == 'sorcery:ash' or name == 'new_campfire:ash' then
						return 0
					end

					do local f = sorcery.itemclass.get(name, 'fuel')
						if f then return f.burntime * 3, f.leftover end
					end

					if def._sorcery and def._sorcery.material then
						local m = def._sorcery.material
						if m.sacrifice_value then return m.sacrifice_value end
						if m.metal then
							return (m.data.level * 120) * (m.value or 1)
						end
						if m.mass then return m.mass*15 end
						if m.value then return m.value*25 end
					end

					for g,v in pairs(scgroups) do
						if minetest.get_item_group(name,g) ~= 0 then return v end
					end

					return 80
				end
				local v,l = getitemval()
				if l then l:set_count(stack:get_count()) end
				return v * stack:get_count(), l
			end

			local newenergy = 0
			for i=1,e:get_size('foci') do
				local st = e:get_stack('foci',i)
				local val,leftover = getscval(st)
				if val > 0 and newenergy + val <= maxcharge then
					newenergy = newenergy + val
					e:set_stack('foci',i,leftover or ItemStack {
						name = 'sorcery:ash', count = st:get_count();
					})
				end
			end
			newenergy = math.min(maxcharge, newenergy * (ctx.stats.power or 1))

			sorcery.ley.setcharge(rechargee,charge + newenergy)
			e:set_stack('item',1,rechargee)

			enchantment_sparkle(ctx, sorcery.lib.color(212,6,63))
		end;
	};
	transfer = {
		name = 'transfer';
		uses = 65;
		color = {6,212,121};
		leytype = 'syncretic';
		affinity = {'aspen','shimmering','silent'};
		desc = 'Transfer ley-current from items on an enchanter into the item in the center, but at a 50% loss if they are of mismatched affinities. One third of maximum current is transferred, and when used on items with little power may destroy them or their enchantments';
	};
	transmute = {
		name = 'transmutation';
		uses = 13;
		color = {255,90,18};
		leytype = 'imperic';
		affinity = {'aspen','shimmering','dark','blazing'};
		desc = 'Transmute three parts of metal into one of a different metal, determined by chance, and influenced by configuration of the wand as well as the stars and the phase of the moon';
		-- diamond = quantity varies between 1-3
	};
	disjoin = {
		name = 'disjunction';
		uses = 32;
		color = {17,6,212};
		leytype = 'occlutic';