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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
			local base = potions[i]:get_name()
			local potion = potions[i]:get_definition()
			if elixir_can_apply(elixir,potion) then
				-- at least one combination makes a valid potion;
				-- we can start the infuser
				goto start
			end
			for _,v in pairs(sorcery.data.infusions) do
				if v.infuse == ingredient and v.into == base then
					-- at least one combination makes a valid
					-- potion; we can start the infuser
					goto start
				end
			end
		::skip:: end
................................................................................
					title = potion._proto.name .. ' Draught';
					desc = potion._proto.desc;
					color = sorcery.lib.color(potion._proto.color):readable();
					props = effects_table(newstack);
				});
				inv:set_stack('potions',i,discharge(newstack))
			else
				for _,v in pairs(sorcery.data.infusions) do
					if v.infuse == ingredient and v.into == base then
						-- transform the base into the infusion
						inv:set_stack('potions',i,discharge(ItemStack(v.output)))
					end
				end
			end
		::skip:: end

		inv:set_stack('infusion',1,ItemStack(sorcery.data.infusion_leftovers[ingredient]))

		infuser_stop(pos)
		return false
	else
		meta:set_float('runtime', newtime)
		meta:set_string('formspec', infuser_formspec(percent))
		meta:set_string('infotext', 'Infuser (active)')







|







 







|








|







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

		inv:set_stack('infusion',1,ItemStack(sorcery.register.residue.db[ingredient]))

		infuser_stop(pos)
		return false
	else
		meta:set_float('runtime', newtime)
		meta:set_string('formspec', infuser_formspec(percent))
		meta:set_string('infotext', 'Infuser (active)')