avoitishin / xray-16

XRAY 16 Engine Modifications
Other
10 stars 6 forks source link

Armor piercing #20

Open ghost opened 9 years ago

ghost commented 9 years ago

This is more of a question than an issue or bug.

I was searching through the code to see how k_ap is calculated against people. To my surprise, it looks as though there is no such function, there is only a function to get the material type from gamemtl.xr This is based on looking at lines 416 - 425 in Level_bullet_manager_firetrace.cpp.

I tried testing this theory in game by setting a gun to 0.25 damage, and then with the ammo I set the FMJ's and JHP's to have the same stats, except k_ap, which was 0.02 for the FMJ and 0.8 for the JHP. It appeared from my testing (shooting mercs in the torso) that they would go down in the same number of shots.

It appears that armor is done on NPC's through values in damages.ltx and immunities.ltx, but that k_ap has no actual affect on body armor at all. It's only there for materials (wood, brick, etc.).

Am I correct or am I missing something? I'm not asking you to fix this, just curious if I have come to the correct conclusion?

ghost commented 9 years ago

Never mind, I'm dumb and didn't search hard enough.

It's handled in ai_stalker_fire.cpp I do believe in the CAI_Stalker::Hit function.