sorcery  Diff

Differences From Artifact [0d2fb4d9eb]:

  • File infuser.lua — part of check-in [72eebac4bc] at 2020-09-26 18:49:51 on branch trunk — add writing stand for editing codexes; add scissors, ink, erasure fluid, pens; touch up codex UI; add many recipe notes; add craft divination type for crafttools; defuckulate fucktarded crafttool impl; enhance table library with missing features like lua's table.unpack; many bug fixes and enhancements; blood for the blood god (user: lexi, size: 7731) [annotate] [blame] [check-ins using]

To Artifact [13d8509748]:

  • File infuser.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: 7741) [annotate] [blame] [check-ins using]

    90     90   			local base = potions[i]:get_name()
    91     91   			local potion = potions[i]:get_definition()
    92     92   			if elixir_can_apply(elixir,potion) then
    93     93   				-- at least one combination makes a valid potion;
    94     94   				-- we can start the infuser
    95     95   				goto start
    96     96   			end
    97         -			for _,v in pairs(sorcery.data.infusions) do
           97  +			for _,v in pairs(sorcery.register.infusions.db) do
    98     98   				if v.infuse == ingredient and v.into == base then
    99     99   					-- at least one combination makes a valid
   100    100   					-- potion; we can start the infuser
   101    101   					goto start
   102    102   				end
   103    103   			end
   104    104   		::skip:: end
................................................................................
   163    163   					title = potion._proto.name .. ' Draught';
   164    164   					desc = potion._proto.desc;
   165    165   					color = sorcery.lib.color(potion._proto.color):readable();
   166    166   					props = effects_table(newstack);
   167    167   				});
   168    168   				inv:set_stack('potions',i,discharge(newstack))
   169    169   			else
   170         -				for _,v in pairs(sorcery.data.infusions) do
          170  +				for _,v in pairs(sorcery.register.infusions.db) do
   171    171   					if v.infuse == ingredient and v.into == base then
   172    172   						-- transform the base into the infusion
   173    173   						inv:set_stack('potions',i,discharge(ItemStack(v.output)))
   174    174   					end
   175    175   				end
   176    176   			end
   177    177   		::skip:: end
   178    178   
   179         -		inv:set_stack('infusion',1,ItemStack(sorcery.data.infusion_leftovers[ingredient]))
          179  +		inv:set_stack('infusion',1,ItemStack(sorcery.register.residue.db[ingredient]))
   180    180   
   181    181   		infuser_stop(pos)
   182    182   		return false
   183    183   	else
   184    184   		meta:set_float('runtime', newtime)
   185    185   		meta:set_string('formspec', infuser_formspec(percent))
   186    186   		meta:set_string('infotext', 'Infuser (active)')