Differences From
Artifact [bdb226347b]:
- 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 278 desc = 'Send up sparks of radia to indicate nearness or absence of the blocks whose presence the wand is attuned to';
279 279 };
280 280 verdant = {
281 281 name = 'verdant';
282 282 color = {16,29,255};
283 283 uses = 48;
284 284 leytype = 'imperic';
285 - desc = 'Pour life-energy into the soil, causing flowers and trees to spring up at your command';
285 + desc = 'Pour a fraction of your life-energy into the soil, causing flowers and trees to spring up at your command';
286 286 affinity = {'jungle','verdant'};
287 + -- rubies(?) make it draw life-energy from bottles of blood
288 + -- in inventory rather than your own bodily health points
289 + cast = function(ctx)
290 +
291 + end
287 292 };
288 293 praxic = anchorwand('praxic', 16, {'pine','shimmering','blazing'});
289 294 counterpraxic = anchorwand('counterpraxic',23, {'pine','shimmering','silent'});
290 295 entropic = anchorwand('entropic', 8, {'jungle','dark'});
291 296 syncretic = anchorwand('syncretic', 12, {'aspen','verdant','shimmering','blazing'});
292 297 cognic = anchorwand('cognic', 32, {'acacia','verdant','dark'});
293 298 occlutic = anchorwand('occlutic', 15, {'apple','silent','dark'});
................................................................................
501 506 enchantment_sparkle(ctx,sorcery.lib.color(255,12,0))
502 507 enchantment_sparkle(ctx,sorcery.lib.color(85,18,35))
503 508 enchantment_sparkle(ctx,sorcery.lib.color(0,0,0))
504 509 end
505 510 };
506 511 sacrifice = {
507 512 name = 'sacrifice';
508 - uses = 58;
513 + uses = 24;
509 514 color = {212,6,63};
510 515 affinity = {'aspen','blazing'};
511 516 leytype = 'syncretic';
512 - 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.';
517 + 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.';
518 + cast = function(ctx)
519 + local bitch = function(err)
520 + sorcery.log('data/spells(sacrifice)', err)
521 + return false
522 + end
523 +
524 + local e = get_enchanter(ctx)
525 + if not e then return false end
526 +
527 + local scgroups = {
528 + sorcery_tech = 400;
529 + sorcery_magitech = 600;
530 + shovel = 100;
531 + sword = 200;
532 + pick = 300;
533 + axe = 250;
534 + }
535 +
536 + local rechargee = e:get_stack('item',1)
537 + if rechargee:is_empty() then return false end
538 + local charge, maxcharge = sorcery.ley.getcharge(rechargee)
539 + if not charge then return false end
540 +
541 + local getscval = function(stack)
542 + local name,def = stack:get_name(),stack:get_definition()
543 + local getitemval = function()
544 + if name == 'sorcery:ash' or name == 'new_campfire:ash' then
545 + return 0
546 + end
547 +
548 + do local f = sorcery.itemclass.get(name, 'fuel')
549 + if f then return f.burntime * 3, f.leftover end
550 + end
551 +
552 + if def._sorcery and def._sorcery.material then
553 + local m = def._sorcery.material
554 + if m.sacrifice_value then return m.sacrifice_value end
555 + if m.metal then
556 + return (m.data.level * 120) * (m.value or 1)
557 + end
558 + if m.mass then return m.mass*15 end
559 + if m.value then return m.value*25 end
560 + end
561 +
562 + for g,v in pairs(scgroups) do
563 + if minetest.get_item_group(name,g) ~= 0 then return v end
564 + end
565 +
566 + return 80
567 + end
568 + local v,l = getitemval()
569 + if l then l:set_count(stack:get_count()) end
570 + return v * stack:get_count(), l
571 + end
572 +
573 + local newenergy = 0
574 + for i=1,e:get_size('foci') do
575 + local st = e:get_stack('foci',i)
576 + local val,leftover = getscval(st)
577 + if val > 0 and newenergy + val <= maxcharge then
578 + newenergy = newenergy + val
579 + e:set_stack('foci',i,leftover or ItemStack {
580 + name = 'sorcery:ash', count = st:get_count();
581 + })
582 + end
583 + end
584 + newenergy = math.min(maxcharge, newenergy * (ctx.stats.power or 1))
585 +
586 + sorcery.ley.setcharge(rechargee,charge + newenergy)
587 + e:set_stack('item',1,rechargee)
588 +
589 + enchantment_sparkle(ctx, sorcery.lib.color(212,6,63))
590 + end;
513 591 };
514 592 transfer = {
515 593 name = 'transfer';
516 594 uses = 65;
517 595 color = {6,212,121};
518 596 leytype = 'syncretic';
519 597 affinity = {'aspen','shimmering','silent'};
520 598 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';
521 599 };
522 600 transmute = {
523 601 name = 'transmutation';
524 - uses = 7;
602 + uses = 13;
525 603 color = {255,90,18};
526 604 leytype = 'imperic';
527 605 affinity = {'aspen','shimmering','dark','blazing'};
528 - 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';
606 + 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';
529 607 -- diamond = quantity varies between 1-3
530 608 };
531 609 disjoin = {
532 610 name = 'disjunction';
533 611 uses = 32;
534 612 color = {17,6,212};
535 613 leytype = 'occlutic';