mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: better auto ricochet check for spaced armor
This commit is contained in:
1 parent
3530e8d0f0
commit
3e3ed35fb0
1 file changed
+6
-3
@@ -45,8 +45,13 @@ void main() {
|
|||||||
float penetrationChance = -1.0;
|
float penetrationChance = -1.0;
|
||||||
float splashChance = -1.0;
|
float splashChance = -1.0;
|
||||||
bool threeCalibersRule = caliber > 3.0 * thickness;
|
bool threeCalibersRule = caliber > 3.0 * thickness;
|
||||||
|
float normalizedSpacedArmorThickness = spacedArmorMaskColor.g;
|
||||||
|
float spacedArmorNominalThickness = normalizedSpacedArmorThickness * maxSpacedArmorThickness;
|
||||||
|
bool spadedArmorThreeCalibersRule = isUnderSpacedArmor && caliber > 3.0 * spacedArmorNominalThickness;
|
||||||
|
bool ricochetSpacedArmor = isUnderSpacedArmor && !spadedArmorThreeCalibersRule && spacedArmorAngle >= ricochet;
|
||||||
|
bool ricochetCoreArmor = !ricochetSpacedArmor && !isUnderExternalModule && !isExternalModule && !isExplosive && !threeCalibersRule && angle >= ricochet;
|
||||||
|
|
||||||
if ((!isUnderExternalModule && !isExternalModule && !isExplosive && !threeCalibersRule && angle >= ricochet) || (isUnderSpacedArmor && spacedArmorAngle >= ricochet)) {
|
if (ricochetCoreArmor || ricochetSpacedArmor) {
|
||||||
penetrationChance = 0.0;
|
penetrationChance = 0.0;
|
||||||
splashChance = 0.0;
|
splashChance = 0.0;
|
||||||
} else {
|
} else {
|
||||||
@@ -59,8 +64,6 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isUnderSpacedArmor) {
|
if (isUnderSpacedArmor) {
|
||||||
float normalizedSpacedArmorThickness = spacedArmorMaskColor.g;
|
|
||||||
float spacedArmorNominalThickness = normalizedSpacedArmorThickness * maxSpacedArmorThickness;
|
|
||||||
float spacedArmorThickness = spacedArmorNominalThickness / cos(spacedArmorAngle);
|
float spacedArmorThickness = spacedArmorNominalThickness / cos(spacedArmorAngle);
|
||||||
piercedPenetration -= spacedArmorThickness;
|
piercedPenetration -= spacedArmorThickness;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user