Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Actor:psiStealthPower()
- if not self.psi_stealth_add and not self.psi_stealth_mult then return end
- return self:combatMindpower(self.psi_stealth_mult, self.psi_stealth_add)
- end
- function Actor:psiStealthMimic()
- return self.psi_stealth_mimic
- end
- local canSeeNoCache = Actor.canSeeNoCache
- function Actor:canSeeNoCache(actor, def, def_pct)
- local see, chance = canSeeNoCache(self, actor, def, def_pct)
- if not see then return see, chance end
- if actor == self then return see, chance end
- local psi_stealth = actor.psiStealthPower and actor:psiStealthPower()
- if psi_stealth then
- local hit, psi_chance = self:checkHit(self:combatMentalResist(), psi_stealth)
- -- Only do mimics if it's the player trying to see them.
- if self.player and actor:psiStealthMimic() then
- game:onTickEnd(function() actor:setMimicState(not hit) end)
- return true, 100
- else
- return hit, chance * psi_chance * 0.01
- end
- end
- return see, chance
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement