mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: remaining stagers
This commit is contained in:
1 parent
2b0180dce2
commit
cf8fa4ffb4
1 file changed
+38
@@ -2,11 +2,13 @@ import { StandardSinglePrice } from "@protos/blitz_static_standard_single_price"
|
|||||||
import { PenetrationGroup } from "@protos/blitz_static_tank_penetration_group";
|
import { PenetrationGroup } from "@protos/blitz_static_tank_penetration_group";
|
||||||
import {
|
import {
|
||||||
PenetrationGroupUpgrade,
|
PenetrationGroupUpgrade,
|
||||||
|
PitchLimit,
|
||||||
ShellUpgrade,
|
ShellUpgrade,
|
||||||
ShellUpgrageSingleChange,
|
ShellUpgrageSingleChange,
|
||||||
StageParameters,
|
StageParameters,
|
||||||
TankAttributeChange_AttributeName,
|
TankAttributeChange_AttributeName,
|
||||||
TankAttributeChange_Modifier,
|
TankAttributeChange_Modifier,
|
||||||
|
VisualChanges,
|
||||||
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||||
import { times } from "lodash-es";
|
import { times } from "lodash-es";
|
||||||
|
|
||||||
@@ -139,6 +141,42 @@ function patch(change: StageParameters, base: StageParameters) {
|
|||||||
? undefined
|
? undefined
|
||||||
: StandardSinglePrice.create(changedShellUpgrades.silver_price);
|
: StandardSinglePrice.create(changedShellUpgrades.silver_price);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (change.pump_reload_times.length > 0) {
|
||||||
|
throw new Error("Pump reload times not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (change.pitch_limits_up.length > 0 && base.pitch_limits_up.length > 0) {
|
||||||
|
throw new Error("Pitch limits not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const changePitchLimitUp of change.pitch_limits_up) {
|
||||||
|
base.pitch_limits_up.push(PitchLimit.create(changePitchLimitUp));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
change.pitch_limits_down.length > 0 &&
|
||||||
|
base.pitch_limits_down.length > 0
|
||||||
|
) {
|
||||||
|
throw new Error("Pitch limits not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const changePitchLimitDown of change.pitch_limits_down) {
|
||||||
|
base.pitch_limits_down.push(PitchLimit.create(changePitchLimitDown));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const changeVisualChange of change.visual_changes) {
|
||||||
|
const baseVisualChange = base.visual_changes.find(
|
||||||
|
(baseVisualChange) =>
|
||||||
|
baseVisualChange.tank_part === changeVisualChange.tank_part
|
||||||
|
);
|
||||||
|
|
||||||
|
if (baseVisualChange) {
|
||||||
|
baseVisualChange.name = changeVisualChange.name;
|
||||||
|
} else {
|
||||||
|
base.visual_changes.push(VisualChanges.create(changeVisualChange));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function aggregateStages(
|
export function aggregateStages(
|
||||||
|
|||||||
Reference in new issue
Block a user