I glanced at the code a bit ago but couldn't fully figure it out as it didn't seem to work in practice as how I read it. What it seems to do at some points do a checkHitOld between stealth power and the detection power. checkHitOld is a logarithmic function, not the simple linear power check formula of checkHit, so there will always be at least some chance of detection regardless of relative powers as long as the scaled detection power is above 0.
If the stealth check fails then the enemy will catch sight of you and know precisely where you are for at least a turn, not sure exactly how long. If detection fails but has been woken up it'll start trying to guess where you are, and target a square in your vicinity. That seems to work like an enemy losing track of you in general, and they can fire projectiles and beams at empty squares or even allies.
When you attack out of stealth with something that hits immediately (not a projectile, that'll break stealth before it hits) it does a stealth check immediately, and if the detection fails you get the automatic critical from shadowstrike. There are also some unseen attacks bonuses you get regardless of the talent too, which I didn't see documented anywhere, and I'm guessing you get those on blinded enemies too.
Edit: looking again, it seems spells and mind abilities will auto crit from stealth, while only physical attacks do the stealth check right before the attack and break on detection.
Edit 2: the distance modifier I first put in is for activating the stealth talent proper in the tree, it's easier to activate stealth in the first place if stuff is farther away.
Last edited by Aesthete on Wed Mar 14, 2018 7:37 am, edited 1 time in total.
|