Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1.     function Actor:psiStealthPower()
  2.         if not self.psi_stealth_add and not self.psi_stealth_mult then return end
  3.         return self:combatMindpower(self.psi_stealth_mult, self.psi_stealth_add)
  4.     end
  5.  
  6.     function Actor:psiStealthMimic()
  7.         return self.psi_stealth_mimic
  8.     end
  9.  
  10.     local canSeeNoCache = Actor.canSeeNoCache
  11.     function Actor:canSeeNoCache(actor, def, def_pct)
  12.         local see, chance = canSeeNoCache(self, actor, def, def_pct)
  13.         if not see then return see, chance end
  14.         if actor == self then return see, chance end
  15.  
  16.         local psi_stealth = actor.psiStealthPower and actor:psiStealthPower()
  17.         if psi_stealth then
  18.             local hit, psi_chance = self:checkHit(self:combatMentalResist(), psi_stealth)
  19.             -- Only do mimics if it's the player trying to see them.
  20.             if self.player and actor:psiStealthMimic() then
  21.                 game:onTickEnd(function() actor:setMimicState(not hit) end)
  22.                 return true, 100
  23.             else
  24.                 return hit, chance * psi_chance * 0.01
  25.             end
  26.         end
  27.  
  28.         return see, chance
  29.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement