diff --git a/packages/website/src/config/characteristics.ts b/packages/website/src/config/characteristics.ts index 9621aaf19..b8d568ba2 100644 --- a/packages/website/src/config/characteristics.ts +++ b/packages/website/src/config/characteristics.ts @@ -26,22 +26,15 @@ export const characteristics = { damage: { type: CharacteristicType.Number, - compute({ characteristic, gun, shell, environment }) { - let coefficient = 1; + compute({ shell }) { + return shell.armor_damage; + }, + }, - if (gun.assault_ranges && gun.assault_ranges.types.includes(shell.type)) { - const match = gun.assault_ranges.ranges.find( - ({ distance }) => distance >= environment.assault_distance, - ); - - if (match !== undefined) { - coefficient *= match.factor; - } - } - - // coefficient *= equalizer.damage; - - return coefficient * shell.armor_damage; + module_damage: { + type: CharacteristicType.Number, + compute({ shell }) { + return shell.module_damage; }, }, } satisfies Record; diff --git a/packages/website/src/config/characteristicsGroups.ts b/packages/website/src/config/characteristicsGroups.ts index e0ec09157..b99e0ca45 100644 --- a/packages/website/src/config/characteristicsGroups.ts +++ b/packages/website/src/config/characteristicsGroups.ts @@ -1,18 +1,199 @@ import type { CharacteristicsGroup } from "../types/characteristics"; export const characteristicsGroups: CharacteristicsGroup[] = [ + // { + // group: "meta", + // render: CharacteristicsGroupRender.Flashy, + // order: [ + // { + // name: "name", + // strings: "TankEntity", + // render({ output, gameStrings }) { + // return gameStrings[output as string]; + // }, + // }, + // { + // name: "class", + // render({ output, strings }) { + // return strings.classes.full[output as TankClass]; + // }, + // }, + // { + // name: "type", + // render({ output, strings }) { + // return strings.types[output as TankType]; + // }, + // }, + // { + // name: "nation", + // render({ output, strings }) { + // return strings.nations[output as Nation]; + // }, + // }, + // { + // name: "tier", + // render({ output, strings }) { + // const name = output as string; + + // if (name == "vintage") { + // return ; + // } + + // return strings.tiers[name as keyof typeof strings.tiers]; + // }, + // }, + // { name: "id" }, + // { name: "slug" }, + // ], + // }, + + // { + // group: "economics", + // // render: CharacteristicsGroupRender.Statistical, + // order: [ + // { name: "purchase_price" }, + // { name: "compensation" }, + // { name: "upgrade_price" }, + // { name: "research_level" }, + // { name: "crew_xp_multiplier" }, + + // // TODO: investigate ATTRIBUTE_NAME_CREW_XP_MULTIPLIER + // ], + // }, + { - name: "firepower", + name: "gun", + // render: CharacteristicsGroupRender.Statistical, order: [ { name: "gun_type", + render({ output }) { + return GunType[output as GunType]; + }, }, - { - name: "damage", - }, - { - name: "clip_size", - }, + { name: "dpm", decimals: 0, units: "hp", localize: true }, + { name: "damage", units: "hp", localize: true }, + { name: "module_damage", units: "hp", localize: true }, + { name: "reload", decimals: 1, units: "s" }, + { name: "reloads", decimals: 1, units: "s" }, + + { toy: "reload" }, + ], + }, + + { + name: "clip", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "clipping_potential", localize: true, units: "hp" }, + { name: "clip_size" }, + { name: "optimal_shell" }, + { name: "intra_clip", decimals: 2, units: "s" }, + { name: "burst_size" }, + { name: "intra_burst", decimals: 2, units: "s" }, + + // TODO: investigate ATTRIBUTE_NAME_SHELLS_SLOTS + // TODO: investigate ATTRIBUTE_NAME_RELOAD_SPEED_SCALE + // TODO: investigate ATTRIBUTE_NAME_AVERAGE_THICKNESS + // TODO: investigate ATTRIBUTE_NAME_TRACER_SHELLS_OBSERVATION_TIMEOUT + ], + }, + + { + name: "shell", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "penetration", units: "mm" }, + { name: "penetration_loss_by_distance" }, + { name: "penetration_loss_after_ricochet" }, + { name: "shell_velocity", units: "m_s" }, + { name: "shell_range", units: "m" }, + { name: "shell_capacity" }, + { name: "caliber", units: "mm" }, + { name: "ricochet", units: "deg" }, + { name: "normalization", units: "deg" }, + + { toy: "ricochet" }, + ], + }, + + { + name: "accuracy", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "aim_time", decimals: 1, units: "s" }, + { name: "dispersion", decimals: 3, units: "m" }, + { name: "dispersion_angle", decimals: 3, units: "deg" }, + { toy: "aim_time" }, + ], + }, + + { + name: "flexibility", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "gun_depression", decimals: 0, units: "deg" }, + { name: "gun_elevation", decimals: 0, units: "deg" }, + { name: "azimuth_left", decimals: 0, units: "deg" }, + { name: "azimuth_right", decimals: 0, units: "deg" }, + + { toy: "flexibility" }, + ], + }, + + { + name: "maneuverability", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "speed_forward", units: "km_h" }, + { name: "speed_backward", units: "km_h" }, + + { name: "weight", decimals: 1, units: "t" }, + { name: "engine_power", units: "bhp" }, + { name: "power_to_weight", decimals: 1, units: "bhp_t" }, + { name: "brake_force", decimals: 1, units: "kN" }, + + { name: "terrain_coefficient", decimals: 2 }, + + { name: "hull_traverse_speed", units: "deg_s" }, + { name: "turret_traverse_speed", units: "deg_s" }, + { name: "gun_traverse_speed", units: "deg_s" }, + + { toy: "traverse" }, + + // TODO: investigate ATTRIBUTE_NAME_TERRAIN_SIDE_FRICTION + // TODO: investigate ATTRIBUTE_NAME_TERRAIN_FORWARD_FRICTION + // TODO: investigate ATTRIBUTE_NAME_RESERVE_TRACK_BACKWARD_SPEED + ], + }, + + { + name: "survivability", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "health", units: "hp" }, + { name: "fire_chance", units: "%" }, + { name: "fire_rate", units: "hp_s" }, + { name: "ramming_resistance", units: "%" }, + + { toy: "fire_health_burn" }, + + // TODO: investigate ATTRIBUTE_NAME_MAX_FIRE_DURATION + ], + }, + + { + name: "concealment", + // render: CharacteristicsGroupRender.Statistical, + order: [ + { name: "view_range", units: "m" }, + { name: "camouflage", decimals: 0, units: "%" }, + + { toy: "view_range" }, + + { name: "width", units: "m" }, + { name: "height", units: "m" }, + { name: "length", units: "m" }, ], }, ];