--Unveil Talent newTalent{ name = "Unveil", shortname = "UNVEIL", type = {"spell/vile-tactics", 4}, require = make_require(4), no_energy = "false", points = 5, cooldown = 10, mana = 30, hate = 5, range = 0, radius = function(self, t) return math.floor(self:combatTalentScale(t, 3, 7)) end, target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), friendlyfire=false, talent=t} end, -- IMPLEMENT DURATION OF UNVEIL EFFECT HERE. getDuration = function(self, t) return ??? end, -- IMPLEMENT POWER OF UNVEIL EFFECT HERE. getPower = function(self, t) return ??? end, -- IMPLEMENT CONFUSION % CHANCE HERE getConfusion = function(self, t) return ??? end, action = function(self, t) tg = self:getTalentTarget(t) local projector = function(x, y) -- make sure this is at the top of the file above NewTalentType: local Map = require "engine.Map" target = game.level.MAP(x, y, map.ACTOR) -- Get Damage dam = self:mindCrit(self:combatTalentStatDamage(t, "cun", 40, 400)) -- Double damage for hidden foes if target and target:attr("stealth") or target:attr("invisible") then dam = dam * 2 end -- Deal Darkness Damage DamageType:get(DamageType.DARKNESS).projector(src, x, y, DamageType.DARKNESS, dam) -- Cause status effects to target target:setEffect(target.EFF_LUMINESCENCE, t.getDuration(self, t), {apply_power=t.getPower(self, t)}) target:setEffect(target.EFF_CONFUSED, t.getDuration(self, t), {power = t.getConfusion(self, t), apply_power=t.getPower(self, t)}) end -- Do "projector" function on everything in range self.project(tg, self.x, self.y, projector) game.level.map:particleEmitter(self.x, self.y, self:getTalentRadius(t), "shout", {additive=true, life=10, size=3, distorion_factor=0.5, radius=self:getTalentRadius(t), nb_circles=8, rm=0.8, rM=1, gm=0, gM=0, bm=0.1, bM=0.2, am=0.4, aM=0.6}) return true end, info = function(self, t) local radius = self:getTalentRadius(t) return ([[None can hide from you. Deals %d darkness damage in a radius of %d. This reveals hidden targets, and does double damage to them. The sudden display of your power confuses enemies(Power %d%%) for %d turns. The damage will scaling with your cunning]]): format(self.damDesc(self, DamageType.DARKNESS, self:combatTalentStatDamage(t, "cun", 40, 400)), radius, util.bound(math.floor(t.getConfusion(self, t)), 0, 50), t.getDuration(self, t)) end, end }