Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Solipsism speed effects; calculated before the actor gets energy
- local current_psi_percentage = self:getPsi() / self:getMaxPsi()
- local clarity
- if self:knowTalent(self.T_CLARITY) then
- clarity = self:callTalent(self.T_CLARITY,"getClarityThreshold")
- end
- local eff_solipsis = math.min(self:attr("solipsism_threshold") or 0,clarity or 1) -- effective solipsism_threshold
- if self:attr("solipsism_threshold") and current_psi_percentage < eff_solipsis then
- local solipsism_power = eff_solipsis - current_psi_percentage
- if self:hasEffect(self.EFF_CLARITY) then
- self:removeEffect(self.EFF_CLARITY)
- end
- local p = self:hasEffect(self.EFF_SOLIPSISM)
- if (p and p.power ~= solipsism_power) or not p then
- self:setEffect(self.EFF_SOLIPSISM, 1, {power = solipsism_power})
- end
- elseif clarity and current_psi_percentage > clarity then
- local clarity_power = math.min(1, current_psi_percentage - clarity)
- if self:hasEffect(self.EFF_SOLIPSISM) then
- self:removeEffect(self.EFF_SOLIPSISM)
- end
- local p = self:hasEffect(self.EFF_CLARITY)
- if (p and p.power ~= clarity_power) or not p then
- self:setEffect(self.EFF_CLARITY, 1, {power = math.min(1, current_psi_percentage - clarity)})
- end
- elseif self:hasEffect(self.EFF_SOLIPSISM) then
- self:removeEffect(self.EFF_SOLIPSISM)
- elseif self:hasEffect(self.EFF_CLARITY) then
- self:removeEffect(self.EFF_CLARITY)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement