sorcery  Artifact [442f0f3bcd]

Artifact 442f0f3bcd466061489f2907b60f2266978d337e218add6232b3e657724bbe89:


return {
	-- survival
	regen = {
		name = 'Regeneration';
		color = {243,106,44};
		style = 'sparkle';
		desc = "A potion that amps up your body's natural\nhealing abilities, causing you to heal rapidly\neven if you're starving";
		infusion = 'sorcery:blood';
		basis = 'sorcery:potion_luminous';
		effect = function(self, user)
			local meta = self:get_meta()
			local force = 1 + meta:get_int('force')
			local duration = 10 + meta:get_int('duration')*2
			late.new_effect(user, {
				duration = duration;
				raise = 4; fall = 4;
				impacts = {
					damage = {0-force, 0.5};
				};
			})
		end;
	};
	waterbreathing = {
		name = 'Waterbreathing';
		color = {79,228,243}; style = 'sparkle';
		basis = 'sorcery:potion_luminous';
		desc = "Conserve your precious supply of oxygen when diving down into the ocean's depths";
		infusion = 'sorcery:extract_kelp';
		duration = function(self,meta)
			return 20 + meta:get_int('duration')*30
		end;
		effect = function(self,user)
			local meta = self:get_meta()
			local force = 1 + 2 * (meta:get_int('force'))
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				raise = 2; fall = 5;
				impacts = {
					breath = {1 * force, 5}
				};
			})
		end;
	};
	heal = {
		name = 'Healing';
		color = {243,44,58};
		style = 'sparkle';
		no_duration = true;
		desc = 'This blood-red liquid glitters with an\nenchantment that rapidly knits torn flesh and broken\nbones';
		infusion = 'sorcery:oil_sanguine';
		basis = 'sorcery:potion_luminous';
		effect = function(self, user)
			local meta = self:get_meta()
			user:set_hp(user:get_hp() + (2 * (2 + meta:get_int('force'))))
		end;
	};

	-- status effects

	stealth = {
		name = 'Stealth';
		color = {184,106,224}; style = 'sparkle';
		infusion = 'default:coal_lump';
		basis = 'sorcery:potion_soft';
		desc = 'Drinking this dark, swirling draught will shelter you from the power of mortal perception for a time, even rendering you entirely invisible at full strength.';
		duration = function(self,meta)
			return 30 + meta:get_int('duration')*30
		end;
		effect = function(self,user)
			local meta = self:get_meta()
			local force = 1 + 1 * (meta:get_int('force'))
			local opacity = 1.0 - (1.0 * (force / 4)) 
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				raise = 10; fall = 15;
				impacts = {
					texture = { nil, opacity };
					nametag = { nil, opacity };
				};
			})
		end;
	};
	nightsight = {
		name = 'Nightsight';
		color = {91,0,200}; style = 'sparkle';
		desc = 'While this potion flows through your veins, your vision will be strengthened against the darkness of the night';
		maxforce = 3;
		infusion = 'sorcery:oil_dawn';
		basis = 'sorcery:potion_soft';
		duration = function(self,meta)
			return 50 + meta:get_int('duration')*70
		end;
		effect = function(self,user)
			--TODO ensure it can only be drunk at night
			--TODO ensure it can't last more than one night
			local meta = self:get_meta()
			local force = 0.3 * (1+meta:get_int('force'))
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				raise = 15; fall = 30;
				impacts = {
					daylight = force;
				};
			})
		end;
	};
	antigravity = {
		name = 'Antigravity';
		color = {240,59,255}; style = 'sparkle';
		desc = 'Loosen the crushing grip of the earth upon your tender mortal form with a few sips from this glittering phial.';
		infusion = 'sorcery:oil_stone';
		basis = 'sorcery:potion_soft';
		duration = function(self,meta)
			return 20 + meta:get_int('duration')*25
		end;
		effect = function(self,user)
			local meta = self:get_meta()
			local force = 1 - 0.3 * (meta:get_int('force') + 1)
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				raise = 2; fall = 15;
				impacts = {
					gravity = force;
				};
			})
		end;
	};
	gale = {
		name = 'Gale';
		color = {187,176,203};
		desc = 'Move and strike with the speed of a hurricane as this enchanted fluid courses through your veins';
		infusion = 'sorcery:grease_storm';
		basis = 'sorcery:potion_soft';
		duration = function(self,meta)
			return 10 + meta:get_int('duration')*15
		end;
		effect = function(self,user)
			local meta = self:get_meta()
			local force = 2 + 0.7 * (meta:get_int('force'))
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				raise = 5; fall = 5;
				impacts = {
					speed = force;
				};
			})
		end;
	};
	obsidian = {
		name = 'Obsidian';
		infusion = 'default:obsidian_shard';
		color = {76,0,121}; style = 'sparkle';
		desc = 'Walk untroubled through volleys of arrows and maelstroms of swinging blades, for all will batter uselessly against skin protected by spellwork mightier than the doughtiest armor';
		infusion = 'default:obsidian_shard';
		basis = 'sorcery:potion_soft';
		no_force = true;
		duration = function(self,meta)
			return 5 + meta:get_int('duration')*7
		end;
	};
	lavabreathing = {
		name = 'Lavabreathing';
		color = {243,118,79}; style = 'sparkle'; glow = 12;
		basis = 'sorcery:potion_soft';
		desc = "Wade through seas of roiling lava as easily as though it were but a babbling brook";
	};
	-- mighty = {
	-- 	name = 'Mighty';
	-- 	color = {255,0,119}; style = 'sparkle'; glow = 5;
	-- 	infusion = 'sorcery:grease_war';
	-- 	basis = 'sorcery:potion_soft';
	-- 	desc = 'Amplify the power of your blows and crack steel armor with the force of your bare hands';
	-- };
	resilient = {
		name = 'Resilient';
		color = {124,124,124}; style = 'dull';
		basis = 'sorcery:potion_soft';
		desc = 'Withstand greater damage and hold your ground even in face of tremendous force';
	};
	hover = {
		name = 'Hover';
		color = {164,252,55}; style = 'sparkle';
		desc = 'Rise into the air for a time and stay there until the potion wears off';
		basis = 'sorcery:potion_soft';
	}; 
	flight = {
		name = 'Flight';
		color = {143,35,255}; style = 'sparkle';
		desc = 'Free yourself totally from the shackles of gravity';
		basis = 'sorcery:potion_soft';
	};
	leap = {
		name = 'Leap';
		color = {164,252,55};
		desc = 'Soar high into the air each time you jump (but may risk damage if used without a Feather Potion)';
		infusion = 'sorcery:oil_wind';
		basis = 'sorcery:potion_soft';
		duration = function(self,meta)
			 return 5 + meta:get_int('duration')*7
		end;
		effect = function(self,user)
			local meta = self:get_meta()
			local force = 2 + (0.5 * meta:get_int('force'))
			late.new_effect(user, {
				duration = self:get_definition()._proto:duration(meta);
				fall = 3;
				impacts = {
					jump = force;
				};
			})
		end
	};
}