feat: power_to_weight

This commit is contained in:
TrèsAbhi committed 2025-12-24 20:10:06 -06:00
1 parent c5785c7ae6
commit 7281b9fed0
2 files changed
+10 -5

No files matched your search

@@ -279,7 +279,9 @@ export const characteristics = {
},
weight({ attribute }) {
return attribute(TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MASS);
return (
attribute(TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MASS) / 1000
);
},
terrain_coefficient({ attribute, state }) {
@@ -303,8 +305,11 @@ export const characteristics = {
return attribute(name);
},
power_to_weight() {
return -Infinity;
power_to_weight({ characteristic }) {
const power = characteristic("engine_power") as number;
const weight = characteristic("weight") as number;
const terrainCoefficient = characteristic("terrain_coefficient") as number;
return power / weight / terrainCoefficient;
},
turret_traverse_speed({ attribute }) {
@@ -66,10 +66,10 @@ export const characteristicsOrder: CharacteristicsOrder = [
{ name: "speed_backward", units: "km_h" },
{ name: "engine_power", units: "bhp" },
{ name: "weight", units: "t" },
{ name: "weight", decimals: 1, units: "t" },
{ name: "terrain_coefficient" },
{ name: "power_to_weight", units: "bhp_t" },
{ name: "power_to_weight", decimals: 1, units: "bhp_t" },
{ name: "hull_traverse_speed", units: "deg_s" },
{ name: "turret_traverse_speed", units: "deg_s" },