mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
track repair time
This commit is contained in:
6 files changed
+43
-1
No files matched your search
@@ -5,4 +5,5 @@ export const permanentSkills = [
|
||||
"smooth_turret",
|
||||
"virtuoso",
|
||||
"camouflage",
|
||||
"repair",
|
||||
];
|
||||
@@ -17,6 +17,19 @@ export abstract class ServerBlitzKitAPI8 extends ServerBlitzKitAPI7 {
|
||||
] = { skills: skills.split(" ") };
|
||||
}
|
||||
|
||||
for (const name in this.tankmenAvatar!.root.skills) {
|
||||
const skill = this.tankmenAvatar!.root.skills[name];
|
||||
const values: Record<string, number> = {};
|
||||
|
||||
for (const key in skill) {
|
||||
const value = skill[key as keyof typeof skill];
|
||||
|
||||
if (typeof value === "number") values[key] = value;
|
||||
}
|
||||
|
||||
skillDefinitions.constants[name] = { values };
|
||||
}
|
||||
|
||||
return skillDefinitions;
|
||||
}
|
||||
}
|
||||
@@ -415,6 +415,7 @@
|
||||
"fire_rate": "Fire rate",
|
||||
"ramming_resistance": "Ramming resistance",
|
||||
"crew_count": "Crew count",
|
||||
"track_repair_time": "Track repair time",
|
||||
"view_range": "View range",
|
||||
"camouflages": "Camouflage",
|
||||
"camouflage": "Still",
|
||||
|
||||
@@ -5,8 +5,14 @@ package blitzkit;
|
||||
message SkillDefinitions {
|
||||
// enums are disallowed as keys so using uint32; convert run-time
|
||||
map<uint32, Skill> classes = 1;
|
||||
// each skill's numeric constants by the client's tag name, like repairSpeedFactorPerLevel
|
||||
map<string, SkillConstants> constants = 2;
|
||||
}
|
||||
|
||||
message Skill {
|
||||
repeated string skills = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message SkillConstants {
|
||||
map<string, float> values = 1;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from "@blitzkit/core";
|
||||
import { ShellType, TankClass, type GunDefinition } from "@blitzkit/protos";
|
||||
import type { Vector2Tuple } from "three";
|
||||
import { api } from "../api/dynamic";
|
||||
import { shellSlot } from "../tankopedia/augments";
|
||||
import { hullTraverseSpeed } from "../tankopedia/hullTraverseSpeed";
|
||||
import { rawTerrainCoefficient } from "../tankopedia/rawTerrainCoefficient";
|
||||
@@ -51,6 +52,8 @@ function intraClipOf(gun: GunDefinition) {
|
||||
*/
|
||||
const PEEKABOO_MIN_CYCLE = 10;
|
||||
|
||||
const skills = await api.skills();
|
||||
|
||||
// characteristics prefixed with an underscore are compute time only; they are never rendered
|
||||
export const characteristics = {
|
||||
gun_type: {
|
||||
@@ -1266,6 +1269,18 @@ export const characteristics = {
|
||||
},
|
||||
},
|
||||
|
||||
track_repair_time: {
|
||||
type: CharacteristicType.Number,
|
||||
compute({ track, environment }) {
|
||||
const skill =
|
||||
1 +
|
||||
(environment.skills.repair ?? 0) *
|
||||
skills.constants.repair.values.repairSpeedFactorPerLevel;
|
||||
|
||||
return track.repair_time / skill;
|
||||
},
|
||||
},
|
||||
|
||||
// fire_rate: unavailable,
|
||||
// ramming_resistance: unavailable,
|
||||
|
||||
|
||||
@@ -654,6 +654,12 @@ export const characteristicsGroups: CharacteristicsGroup[] = [
|
||||
units: "percentage",
|
||||
},
|
||||
{ name: "crew_count" },
|
||||
{
|
||||
name: "track_repair_time",
|
||||
ranking: CharacteristicRanking.LowerIsBetter,
|
||||
decimals: 1,
|
||||
units: "s",
|
||||
},
|
||||
// { name: "fire_rate", units: "hp_s" },
|
||||
// { name: "ramming_resistance", units: "percentage" },
|
||||
|
||||
|
||||
Reference in new issue
Block a user