Page 1 of 1

new potions/scrolls - temporary talents

Posted: Mon Oct 18, 2010 11:51 pm
by Shoob
I decided to make a base case for temporary talents, all that is needed now is more cases, and maybe some tweaking. I was thinking that there could be scrolls that let you know a talent for a few turns as well (such as stunning blow or other stuff), but the effect wears off after a bit.

Code: Select all

newEntity{ base = "BASE_POTION",
	name = "dragon's blood",
	color = colors.LIGHT_RED, image="object/potion-0x3.png",
	level_range = {30, 50},
	rarity = 7,
	cost = 20,

	use_simple = { name="brings out the dragon in you", use = function(self, who)
		self:setEffect(self.EFF_DRAGONS_FIRE, self:getWil()+15, {})
		return "destroy", true
	end}
}


newEffect{
	name = "DRAGONS_FIRE",
	desc = "Your throat feels like it is burning.",
	type = "magical",
	status = "beneficial",
	parameters = {},
	on_gain = function(self, err) return "#Target#'s throat seems to be burning.", "+Dragon's fire" end,
	on_lose = function(self, err) return "#Target#'s throat seems to cool down.", "-Dragon's fire" end,
	activate = function(self, eff)
		self.talents.T_FIRE_BREATH = (self.talents.T_FIRE_BREATH or 0) + 2
	end,
	deactivate = function(self, eff)
		self.talents.T_FIRE_BREATH = self.talents.T_FIRE_BREATH - 2
		if self.talents.T_FIRE_BREATH == 0 then self.talents.T_FIRE_BREATH = nil end
	end,
}
I purposely left out the math.min on the adjustments, allowing the max to temporarily go above the normal player max.

Re: new potions/scrolls - temporary talents

Posted: Tue Oct 19, 2010 10:06 am
by Mithril
Nice! Great way to greatly increase item variety.

Re: new potions/scrolls - temporary talents

Posted: Tue Oct 19, 2010 2:52 pm
by yufra
I like it!

Re: new potions/scrolls - temporary talents

Posted: Wed Oct 20, 2010 6:20 pm
by darkgod
Fun!
Fixed & added; )