Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newTalent{
- name = "Insanity", shortname = "INSANITY"
- type = {"cursed/horror", 3},
- points = 5,
- mode = "passive",
- require = cursed_wil_req2,
- on_learn = function(self, t)
- local lev = self:getTalentLevelRaw(t)
- if lev == 1 then
- self:learnTalent(self.T_TYRANT), true, nil, {no_unlearn=true})
- elseif lev == 2 then
- self:learnTalent(self.TYRANT), true, nil, {no_unlearn=true})
- elseif lev == 3 then
- self:learnTalent(self.T_TYRANT), true, nil, {no_unlearn=true})
- elseif lev == 4 then
- self:learnTalent(self.T_TYRANT), true, nil, {no_unlearn=true})
- elseif lev == 5 then
- self:learnTalent(self.T_TYRANT), true, nil, {no_unlearn=true})
- end
- end,
- on_unlearn = function(self, t)
- local lev = self:getTalentLevelRaw(t)
- if lev == 0 then
- self:unlearnTalent(self.T_TYRANT)
- elseif lev == 1 then
- self:unlearnTalent(self.T_TYRANT)
- elseif lev == 2 then
- self:unlearnTalent(self.T_TYRANT)
- elseif lev == 3 then
- self:unlearnTalent(self.T_TYRANT)
- elseif lev == 4 then
- self:unlearnTalent(self.T_TYRANT)
- end
- end,
- getChance = function(self, t) return self:combatLimit(self:getTalentLevel(t)^0.5, 100, 8, 1, 17.9, 2.23) end, -- Limit < 100%
- getMindResistChange = function(self, t) return -self:combatTalentLimit(t, 50, 15, 35) end, -- Limit < 50%
- doMadness = function(target, t, src)
- local chance = t.getChance(src, t)
- if target and src and target:reactionToward(src) < 0 and src:checkHit(src:combatMindpower(), target:combatMentalResist(), 0, chance, 5) then
- local mindResistChange = t.getMindResistChange(src, t)
- local effect = rng.range(1, 3)
- if effect == 1 then
- -- confusion
- if target:canBe("confusion") and not target:hasEffect(target.EFF_MADNESS_CONFUSED) then
- target:setEffect(target.EFF_MADNESS_CONFUSED, 3, {power=50, mindResistChange=mindResistChange}) -- Consistent with other confusion
- end
- elseif effect == 2 then
- -- stun
- if target:canBe("stun") and not target:hasEffect(target.EFF_MADNESS_STUNNED) then
- target:setEffect(target.EFF_MADNESS_STUNNED, 3, {mindResistChange=mindResistChange})
- end
- elseif effect == 3 then
- -- slow
- if target:canBe("slow") and not target:hasEffect(target.EFF_MADNESS_SLOW) then
- target:setEffect(target.EFF_MADNESS_SLOW, 3, {power=0.3, mindResistChange=mindResistChange})
- end
- end
- end
- end,
- info = function(self, t)
- local chance = t.getChance(self, t)
- local mindResistChange = t.getMindResistChange(self, t)
- return ([[Every time you inflict mental damage, there is a %d%% chance that your foe must save against your Mindpower or go mad. Madness can cause them to become confused, slowed or stunned for 3 turns, and lowers resistance to darkness damage by %d%%.
- Additionally, you learn Tyrant at this talent's level.]]):format(chance, -mindResistChange)
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment