Does anybody know how the "Oops! hit the wrong target" thing works mechanically?

JimTheDinosaur

Vault Dweller
Modder
Sorry for the long thread title, but basically that. As far as I know there's two ways for it to takes place: a critical failure resulting in a "random hit", and a miss resulting in a different target getting hit regularly. I'm mostly interested in how the latter works. For one, is it included in the to hit formula? I seem to remember seeing lower THC values when someone is standing between you and the target, but then again I can't recall anything about that in the THC pseudocode. Further, is the critter getting hit based on some kind of cone? I think it is, but it's probably a pretty wide one given that I remember hitting critters way off the path of the target.

I'm making my own overriding mechanic of the "oops" mechanic, but I'd also like to know how the original worked.
 
I don't recall exactly how this works but it definitely takes line of sight into account, and I think it chose a random friendly. You might go digging in the attack / hit procedures.

As for the hit chance, yeah, tohit.c:

Code:
if (!target_invalid && !attack_with_norange_argument) tohit-=10*objects_between_attacker_and_target;

So, -10% for every object in the path to the target. I believe this is a straight-line path (as used in LOS).
 
I don't recall exactly how this works but it definitely takes line of sight into account, and I think it chose a random friendly. You might go digging in the attack / hit procedures.

As for the hit chance, yeah, tohit.c:

Code:
if (!target_invalid && !attack_with_norange_argument) tohit-=10*objects_between_attacker_and_target;

So, -10% for every object in the path to the target. I believe this is a straight-line path (as used in LOS).
Kind of weird when I accidently hit a corpse
 
Back
Top