terrain coeffs

This commit is contained in:
tresabhi committed 2026-10-11 01:03:35 -05:00
1 parent 62da186a25
commit 9a66fb5115
6 files changed
+113 -8

No files matched your search

+61 -1
View File
@@ -10,6 +10,7 @@ import {
type Characteristic,
type CharacteristicContext,
} from "../types/characteristics";
import { rawTerrainCoefficient } from "../tankopedia/rawTerrainCoefficient";
function intraClipCoefficient({
script,
@@ -621,7 +622,66 @@ export const characteristics = {
},
// brake_force: unavailable,
// terrain_coefficient: unavailable,
hard_terrain_coefficient_raw: {
type: CharacteristicType.Number,
compute({ track, degressive, script }) {
return rawTerrainCoefficient(
track.resistance_hard,
"firmGroundPassabilityIncrease",
degressive("driver"),
script,
);
},
},
hard_terrain_coefficient: {
type: CharacteristicType.Number,
compute({ characteristic }) {
const raw = characteristic("hard_terrain_coefficient_raw") as number;
return 100 / raw;
},
},
medium_terrain_coefficient_raw: {
type: CharacteristicType.Number,
compute({ track, degressive, script }) {
return rawTerrainCoefficient(
track.resistance_medium,
"mediumGroundPassabilityIncrease",
degressive("driver"),
script,
);
},
},
medium_terrain_coefficient: {
type: CharacteristicType.Number,
compute({ characteristic }) {
const raw = characteristic("medium_terrain_coefficient_raw") as number;
return 100 / raw;
},
},
soft_terrain_coefficient_raw: {
type: CharacteristicType.Number,
compute({ track, degressive, script }) {
return rawTerrainCoefficient(
track.resistance_soft,
"softGroundPassabilityIncrease",
degressive("driver"),
script,
);
},
},
soft_terrain_coefficient: {
type: CharacteristicType.Number,
compute({ characteristic }) {
const raw = characteristic("soft_terrain_coefficient_raw") as number;
return 100 / raw;
},
},
hull_traverse_speed: {
type: CharacteristicType.Number,
@@ -163,7 +163,12 @@ export const characteristicsGroups: CharacteristicsGroup[] = [
{ name: "power_to_weight", decimals: 1, units: "bhp_t" },
{ name: "brake_force", decimals: 1, units: "kN" },
{ name: "terrain_coefficient", decimals: 2 },
{ name: "hard_terrain_coefficient", decimals: 0 },
{ name: "medium_terrain_coefficient", decimals: 0 },
{ name: "soft_terrain_coefficient", decimals: 0 },
{ name: "hard_terrain_coefficient_raw", decimals: 2 },
{ name: "medium_terrain_coefficient_raw", decimals: 2 },
{ name: "soft_terrain_coefficient_raw", decimals: 2 },
{ name: "hull_traverse_speed", units: "deg_s" },
{ name: "turret_traverse_speed", units: "deg_s" },