[svn] Vitality status effect reduction

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

[svn] Vitality status effect reduction

#1 Post by lukep »

Code: Select all

        if self:knowTalent(self.T_VITALITY) and e.status == "detrimental" and (e.subtype.wound or e.subtype.poison or e.subtype.disease) then
-               local t = self:getTalentFromId(self.T_VITALITY)
+               local t = util.bound(self:getTalentFromId(self.T_VITALITY), 0, 1)
                p.dur = math.ceil(p.dur * (1 - t.getWoundReduction(self, t)))
        end
Should be:

Code: Select all

        if self:knowTalent(self.T_VITALITY) and e.status == "detrimental" and (e.subtype.wound or e.subtype.poison or e.subtype.disease) then
               local t = self:getTalentFromId(self.T_VITALITY)
-               p.dur = math.ceil(p.dur * (1 - t.getWoundReduction(self, t)))
+               p.dur = math.ceil(p.dur * (1 - util.bound(t.getWoundReduction(self, t), 0, 1)))
        end
?
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

Post Reply