sorcery  Artifact [17afb80492]

Artifact 17afb80492f4a9acfb36b081532d804d458cc8172fc17a0e2573d21f70dadc47:

  • File data/resonance.lua — part of check-in [ea6e475e44] at 2020-10-19 09:52:11 on branch trunk — continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes (user: lexi, size: 1824) [annotate] [blame] [check-ins using]

-- resonance is a mechanic whereby give which 'resonate' can be
-- transformed into each other by use of the divide/meld wands

local function
undersign(signs) return function(ctx)
	local stars = sorcery.calendar.stars(ctx.today);
	for _,s in pairs(signs) do
		if stars.sign.id == s then return true end
	end
	return false
end end

local function
undermoon(min,max) return function(ctx)
	local date = sorcery.calendar.date(ctx.today);
	return date.lunar_phase >= min and date.lunar_phase <= max
end end

-- TODO: add value annotations, make high spell power prefer items of higher value
return {
	divide = {
		-- remember to check for leftovers!
		['sorcery:flame_oil'] = {
			mode = 'random';
			give = {
				'sorcery:ash';
				'sorcery:essence_flame';
			};
		};
		['bucket:bucket_lava'] = {
			mode = 'random';
			replacement = 'bucket:bucket_empty';
			give = {
				'sorcery:essence_flame';
				'sorcery:powder_firestorm';
			};
		};
		['sorcery:inferno_crystal'] = {
			mode = 'set';
			give = {
				'sorcery:essence_flame';
				'sorcery:essence_flame';
				'sorcery:gem_ruby';
			};
		};
		['default:mese_crystal'] = {
			mode = 'random';
			give = {
				'default:mese_fragment';
				'sorcery:essence_force';
			};
		};
	};

	meld = {
		{
			set = { 'sorcery:gem_ruby', 'sorcery:ingot_lithium', 'tnt:gunpowder' };
			restrict = undersign {'wyvern','wserpent'};
			results = { 'sorcery:inferno_crystal' };
		};
		{
			set = {
				'default:snow', 'default:ice', {
					take = 'bucket:bucket_water';
					replacement = 'bucket:bucket_empty';
				};
			};
			results = { 'sorcery:essence_frost' };
		};
		-- {
		-- 	set = { 'sorcery:essence_flame', 'sorcery:essence_frost', 'sorcery:essence_force' };
		-- 	restrict = undersign {'wolfprince'};
		-- 	results = (something very powerful?) "Elemental? Dynamo"
		-- };
	};
};