sorcery  Diff

Differences From Artifact [63249807d4]:

  • File data/resonance.lua — part of check-in [3f6a913e4e] at 2020-09-29 12:40:28 on branch trunk — * remove former hacky registration system, replace with consistent and flexible API; rewrite metal/gem generation to take advantage of this new API; tweaks to init system to enable world-local tweaks to lore and sorcery behavior * initial documentation commit * initial steps towards calendar - add default date format, astrolabe; prepare infra for division/melding/transmutation spells, various tweaks and fixes (user: lexi, size: 128) [annotate] [blame] [check-ins using]

To Artifact [17afb80492]:

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

     1         --- resonance is a mechanic whereby items which 'resonate' can be
            1  +-- resonance is a mechanic whereby give which 'resonate' can be
     2      2   -- transformed into each other by use of the divide/meld wands
            3  +
            4  +local function
            5  +undersign(signs) return function(ctx)
            6  +	local stars = sorcery.calendar.stars(ctx.today);
            7  +	for _,s in pairs(signs) do
            8  +		if stars.sign.id == s then return true end
            9  +	end
           10  +	return false
           11  +end end
           12  +
           13  +local function
           14  +undermoon(min,max) return function(ctx)
           15  +	local date = sorcery.calendar.date(ctx.today);
           16  +	return date.lunar_phase >= min and date.lunar_phase <= max
           17  +end end
           18  +
           19  +-- TODO: add value annotations, make high spell power prefer items of higher value
           20  +return {
           21  +	divide = {
           22  +		-- remember to check for leftovers!
           23  +		['sorcery:flame_oil'] = {
           24  +			mode = 'random';
           25  +			give = {
           26  +				'sorcery:ash';
           27  +				'sorcery:essence_flame';
           28  +			};
           29  +		};
           30  +		['bucket:bucket_lava'] = {
           31  +			mode = 'random';
           32  +			replacement = 'bucket:bucket_empty';
           33  +			give = {
           34  +				'sorcery:essence_flame';
           35  +				'sorcery:powder_firestorm';
           36  +			};
           37  +		};
           38  +		['sorcery:inferno_crystal'] = {
           39  +			mode = 'set';
           40  +			give = {
           41  +				'sorcery:essence_flame';
           42  +				'sorcery:essence_flame';
           43  +				'sorcery:gem_ruby';
           44  +			};
           45  +		};
           46  +		['default:mese_crystal'] = {
           47  +			mode = 'random';
           48  +			give = {
           49  +				'default:mese_fragment';
           50  +				'sorcery:essence_force';
           51  +			};
           52  +		};
           53  +	};
           54  +
           55  +	meld = {
           56  +		{
           57  +			set = { 'sorcery:gem_ruby', 'sorcery:ingot_lithium', 'tnt:gunpowder' };
           58  +			restrict = undersign {'wyvern','wserpent'};
           59  +			results = { 'sorcery:inferno_crystal' };
           60  +		};
           61  +		{
           62  +			set = {
           63  +				'default:snow', 'default:ice', {
           64  +					take = 'bucket:bucket_water';
           65  +					replacement = 'bucket:bucket_empty';
           66  +				};
           67  +			};
           68  +			results = { 'sorcery:essence_frost' };
           69  +		};
           70  +		-- {
           71  +		-- 	set = { 'sorcery:essence_flame', 'sorcery:essence_frost', 'sorcery:essence_force' };
           72  +		-- 	restrict = undersign {'wolfprince'};
           73  +		-- 	results = (something very powerful?) "Elemental? Dynamo"
           74  +		-- };
           75  +	};
           76  +};