mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: fixed he-based rounds behind spaced armor
This commit is contained in:
1 parent
2acee91524
commit
103c1b4338
3 files changed
+9
-9
No files matched your search
@@ -570,7 +570,10 @@ export async function buildDefinitions() {
|
|||||||
normalization: shell.normalizationAngle,
|
normalization: shell.normalizationAngle,
|
||||||
ricochet: shell.ricochetAngle,
|
ricochet: shell.ricochetAngle,
|
||||||
type: blitzShellKindToBLitzkrieg[shell.kind],
|
type: blitzShellKindToBLitzkrieg[shell.kind],
|
||||||
explosionRadius: shell.explosionRadius,
|
explosionRadius:
|
||||||
|
shell.kind === 'HIGH_EXPLOSIVE'
|
||||||
|
? shell.explosionRadius ?? 0
|
||||||
|
: undefined,
|
||||||
icon: shell.icon,
|
icon: shell.icon,
|
||||||
penetration:
|
penetration:
|
||||||
penetrationRaw[0] === penetrationRaw[1]
|
penetrationRaw[0] === penetrationRaw[1]
|
||||||
|
|||||||
@@ -44,9 +44,8 @@ void main() {
|
|||||||
bool coreArmorThreeCalibersRule = caliber > 3.0 * thickness;
|
bool coreArmorThreeCalibersRule = caliber > 3.0 * thickness;
|
||||||
float spacedArmorNominalThickness = spacedArmorMaskColor.g * maxThickness;
|
float spacedArmorNominalThickness = spacedArmorMaskColor.g * maxThickness;
|
||||||
bool spacedArmorThreeCalibersRule = isUnderSpacedArmor && caliber > 3.0 * spacedArmorNominalThickness;
|
bool spacedArmorThreeCalibersRule = isUnderSpacedArmor && caliber > 3.0 * spacedArmorNominalThickness;
|
||||||
bool hasRicochetedSpacedArmor = !isExplosive && isUnderSpacedArmor && !spacedArmorThreeCalibersRule && spacedArmorAngle >= ricochetAngle;
|
bool hasRicochetedSpacedArmor = isUnderSpacedArmor && !spacedArmorThreeCalibersRule && spacedArmorAngle >= ricochetAngle;
|
||||||
bool isUnderAnything = isUnderExternalModule || isUnderSpacedArmor;
|
bool hasRicochetedCoreArmor = !hasRicochetedSpacedArmor && !isUnderExternalModule && !isExplosive && !coreArmorThreeCalibersRule && coreArmorangle >= ricochetAngle;
|
||||||
bool hasRicochetedCoreArmor = !isExplosive && !isUnderAnything && !coreArmorThreeCalibersRule && coreArmorangle >= ricochetAngle;
|
|
||||||
|
|
||||||
if (hasRicochetedCoreArmor || hasRicochetedSpacedArmor) {
|
if (hasRicochetedCoreArmor || hasRicochetedSpacedArmor) {
|
||||||
penetrationChance = 0.0;
|
penetrationChance = 0.0;
|
||||||
@@ -57,10 +56,9 @@ void main() {
|
|||||||
|
|
||||||
if (isUnderExternalModule) {
|
if (isUnderExternalModule) {
|
||||||
// external modules don't care about angle, they'll reduce penetration by their thickness
|
// external modules don't care about angle, they'll reduce penetration by their thickness
|
||||||
float externalModuleThickness = externalModuleMaskColor.g * maxThickness;
|
float externalModuleThickness = externalModuleMaskColor.r * maxThickness;
|
||||||
remainingPenetration -= externalModuleThickness;
|
remainingPenetration -= externalModuleThickness;
|
||||||
}
|
}
|
||||||
remainingPenetration = max(remainingPenetration, 0.0);
|
|
||||||
|
|
||||||
if (isUnderSpacedArmor) {
|
if (isUnderSpacedArmor) {
|
||||||
// spaced armor on the other hand, does care about angle
|
// spaced armor on the other hand, does care about angle
|
||||||
@@ -77,7 +75,6 @@ void main() {
|
|||||||
// there is a 50% penetration loss per meter for HE based shells
|
// there is a 50% penetration loss per meter for HE based shells
|
||||||
remainingPenetration -= 0.5 * remainingPenetration * distanceFromSpacedArmor;
|
remainingPenetration -= 0.5 * remainingPenetration * distanceFromSpacedArmor;
|
||||||
}
|
}
|
||||||
remainingPenetration = max(remainingPenetration, 0.0);
|
|
||||||
|
|
||||||
bool coreArmorTwoCalibersRule = caliber > 2.0 * thickness;
|
bool coreArmorTwoCalibersRule = caliber > 2.0 * thickness;
|
||||||
float finalNormalization = coreArmorTwoCalibersRule ? (normalization * 1.4 * caliber) / (2.0 * thickness) : normalization;
|
float finalNormalization = coreArmorTwoCalibersRule ? (normalization * 1.4 * caliber) / (2.0 * thickness) : normalization;
|
||||||
@@ -98,7 +95,8 @@ void main() {
|
|||||||
|
|
||||||
if (canSplash) {
|
if (canSplash) {
|
||||||
// only allow splasing if the damage equation deals more than 0 damage
|
// only allow splasing if the damage equation deals more than 0 damage
|
||||||
float finalDamage = 0.5 * damage * (1.0 - distanceFromSpacedArmor / explosionRadius) - 1.1 * finalCoreArmorThickness;
|
float nominalArmorThickness = finalCoreArmorThickness - remainingPenetration;
|
||||||
|
float finalDamage = 0.5 * damage * (1.0 - distanceFromSpacedArmor / explosionRadius) - 1.1 * nominalArmorThickness;
|
||||||
splashChance = finalDamage > 0.0 ? 1.0 : 0.0;
|
splashChance = finalDamage > 0.0 ? 1.0 : 0.0;
|
||||||
} else {
|
} else {
|
||||||
splashChance = 0.0;
|
splashChance = 0.0;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ export function ArmorMeshSpacedArmorDepth(
|
|||||||
<mesh {...props} renderOrder={1}>
|
<mesh {...props} renderOrder={1}>
|
||||||
<ThreeCustomShaderMaterial
|
<ThreeCustomShaderMaterial
|
||||||
silent
|
silent
|
||||||
depthWrite={false}
|
|
||||||
baseMaterial={MeshStandardMaterial}
|
baseMaterial={MeshStandardMaterial}
|
||||||
fragmentShader={fragmentShader}
|
fragmentShader={fragmentShader}
|
||||||
vertexShader={vertexShader}
|
vertexShader={vertexShader}
|
||||||
|
|||||||
Reference in new issue
Block a user