feat: start of derived statistics

This commit is contained in:
TrèsAbhi committed 2025-12-01 16:51:11 -06:00
1 parent 122d65840e
commit 5541eca23d
5 files changed
+75 -11

No files matched your search

@@ -5,9 +5,13 @@ import {
} from "@protos/blitz_static_tank_upgrade_single_stage";
import { times } from "lodash-es";
export type AggregateAttributes = Partial<
Record<TankAttributeChange_AttributeName, number>
>;
function patch(
changes: TankAttributeChange[],
attributes: Partial<Record<TankAttributeChange_AttributeName, number>>
attributes: AggregateAttributes
) {
for (const { attribute_name, value, modifier } of changes) {
switch (modifier) {
@@ -41,8 +45,7 @@ export function aggregateAttributes(
stages: TankAttributeChange[][],
stage: number
) {
const attributes: Partial<Record<TankAttributeChange_AttributeName, number>> =
{};
const attributes: AggregateAttributes = {};
patch(base, attributes);
times(stage, (index) => patch(stages[index], attributes));