mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
armor groups
This commit is contained in:
1 parent
a97b1383d8
commit
7767481633
1 file changed
+28
-231
@@ -1,9 +1,10 @@
|
|||||||
import { Grade } from "@blitzkit/closed/protos/game/proto/legacy/blitz_static_standard_grades_enum";
|
import { Grade } from "@blitzkit/closed/protos/game/proto/legacy/blitz_static_standard_grades_enum";
|
||||||
|
import { PenetrationGroup_CommonData } from "@blitzkit/closed/protos/game/proto/legacy/blitz_static_tank_penetration_group";
|
||||||
import {
|
import {
|
||||||
|
PenetrationGroupUpgrade_TankPart,
|
||||||
StageParameters_StageType,
|
StageParameters_StageType,
|
||||||
TankAttributeChange_AttributeName,
|
TankAttributeChange_AttributeName,
|
||||||
} from "@blitzkit/closed/protos/game/proto/legacy/blitz_static_tank_upgrade_single_stage";
|
} from "@blitzkit/closed/protos/game/proto/legacy/blitz_static_tank_upgrade_single_stage";
|
||||||
import { Suspense } from "react";
|
|
||||||
import { api } from "../../../../core/api/dynamic";
|
import { api } from "../../../../core/api/dynamic";
|
||||||
import { aggregateParameters } from "../../../../core/tankopedia/aggregateParameters";
|
import { aggregateParameters } from "../../../../core/tankopedia/aggregateParameters";
|
||||||
import { useAwait } from "../../../../hooks/useAwait";
|
import { useAwait } from "../../../../hooks/useAwait";
|
||||||
@@ -26,12 +27,6 @@ export function Page({ id, locale }: PageProps) {
|
|||||||
<Content />
|
<Content />
|
||||||
</LocaleProvider>
|
</LocaleProvider>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<Content />
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Content() {
|
function Content() {
|
||||||
@@ -165,230 +160,32 @@ function Content() {
|
|||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
<h3>penetration groups</h3>
|
||||||
|
|
||||||
|
{parameters.penetration_groups_upgrades.map((upgrade) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h4>{PenetrationGroupUpgrade_TankPart[upgrade.tank_part]}</h4>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
primary armor ({upgrade.primary_armor.length}):{" "}
|
||||||
|
{upgrade.primary_armor}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
{upgrade.penetration_groups.map((group) => {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{group.group_name}: {group.armor} (
|
||||||
|
{PenetrationGroup_CommonData[group.common_data]})
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
// const compare = Tankopedia.use((state) => state.compare);
|
|
||||||
// const characteristics = useMemo(
|
|
||||||
// () => computeCharacteristics(id, tank, protagonist),
|
|
||||||
// [protagonist],
|
|
||||||
// );
|
|
||||||
// // const otherCharacteristics = useMemo(
|
|
||||||
// // () =>
|
|
||||||
// // tankList.list
|
|
||||||
// // .filter((tank) => tank.id !== id)
|
|
||||||
// // .map(({ id }) => {
|
|
||||||
// // const state = { ...protagonist };
|
|
||||||
// // const tank = otherTanks.tanks[id];
|
|
||||||
|
|
||||||
// // return computeCharacteristics(
|
|
||||||
// // id,
|
|
||||||
// // tank.tank!,
|
|
||||||
// // tank.compensation!,
|
|
||||||
// // state
|
|
||||||
// // );
|
|
||||||
// // }),
|
|
||||||
// // [protagonist]
|
|
||||||
// // );
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <>
|
|
||||||
// <h1>{id}</h1>
|
|
||||||
|
|
||||||
// <div style={{ display: "flex", flexWrap: "wrap", gap: "1rem" }}>
|
|
||||||
// {tank.tank?.feature_screens?.tags.map((tag) => (
|
|
||||||
// <span>{tag.value}</span>
|
|
||||||
// ))}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div style={{ display: "flex", flexWrap: "wrap" }}>
|
|
||||||
// {times(tank.tank!.upgrade_stages.length + 1, (index) => (
|
|
||||||
// <button
|
|
||||||
// key={index}
|
|
||||||
// onClick={() => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.stage = index;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// Stage {index} {index === protagonist.stage && "(selected)"}
|
|
||||||
// </button>
|
|
||||||
// ))}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div style={{ display: "flex", flexWrap: "wrap" }}>
|
|
||||||
// {characteristics.parameters.shells_upgrades.map((shell) => (
|
|
||||||
// <button
|
|
||||||
// key={shell.shell_id}
|
|
||||||
// onClick={() => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.shell = shell.shell_id;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// Shell {shell.shell_id}{" "}
|
|
||||||
// {shell.shell_id === protagonist.shell && "(selected)"}
|
|
||||||
// </button>
|
|
||||||
// ))}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>speed (0 - {characteristics.characteristics.speed_forward})</span>
|
|
||||||
// <input
|
|
||||||
// type="range"
|
|
||||||
// min={0}
|
|
||||||
// max={characteristics.characteristics.speed_forward as number}
|
|
||||||
// value={protagonist.speed}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.speed = event.target.valueAsNumber;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>isHullTraversing</span>
|
|
||||||
// <input
|
|
||||||
// type="checkbox"
|
|
||||||
// value={`${protagonist.isHullTraversing}`}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.isHullTraversing = event.target.checked;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>isTurretTraversing</span>
|
|
||||||
// <input
|
|
||||||
// type="checkbox"
|
|
||||||
// value={`${protagonist.isTurretTraversing}`}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.isTurretTraversing = event.target.checked;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>isShooting</span>
|
|
||||||
// <input
|
|
||||||
// type="checkbox"
|
|
||||||
// value={`${protagonist.isShooting}`}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.isShooting = event.target.checked;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>isGunDamaged</span>
|
|
||||||
// <input
|
|
||||||
// type="checkbox"
|
|
||||||
// value={`${protagonist.isGunDamaged}`}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.isGunDamaged = event.target.checked;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div style={{ display: "flex", flexWrap: "wrap" }}>
|
|
||||||
// {Object.values(TerrainHardness).map(
|
|
||||||
// (hardness) =>
|
|
||||||
// typeof hardness === "number" && (
|
|
||||||
// <button
|
|
||||||
// key={hardness}
|
|
||||||
// onClick={() => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.terrainHardness = hardness;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// {TerrainHardness[hardness]}{" "}
|
|
||||||
// {hardness === protagonist.terrainHardness && "(selected)"}
|
|
||||||
// </button>
|
|
||||||
// ),
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div>
|
|
||||||
// <span>isCaughtOnFire</span>
|
|
||||||
// <input
|
|
||||||
// type="checkbox"
|
|
||||||
// value={`${protagonist.isCaughtOnFire}`}
|
|
||||||
// onChange={(event) => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.protagonist.isCaughtOnFire = event.target.checked;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// <div style={{ display: "flex", flexWrap: "wrap" }}>
|
|
||||||
// {Object.values(TankopediaCompare).map(
|
|
||||||
// (c) =>
|
|
||||||
// typeof c === "number" && (
|
|
||||||
// <button
|
|
||||||
// key={c}
|
|
||||||
// onClick={() => {
|
|
||||||
// Tankopedia.mutate((draft) => {
|
|
||||||
// draft.compare = c;
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// {TankopediaCompare[c]} {c === compare && "(selected)"}
|
|
||||||
// </button>
|
|
||||||
// ),
|
|
||||||
// )}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// <br />
|
|
||||||
|
|
||||||
// {characteristicsOrder.map(({ group, order }) => (
|
|
||||||
// <>
|
|
||||||
// <h2 key={group}>{group}</h2>
|
|
||||||
|
|
||||||
// {order.map((config) =>
|
|
||||||
// "toy" in config ? (
|
|
||||||
// <TankopediaToy key={`toy-${config.toy}`} toy={config.toy} />
|
|
||||||
// ) : (
|
|
||||||
// <TankopediaCharacteristic
|
|
||||||
// key={`characteristic-${config.name}`}
|
|
||||||
// characteristic={characteristics.characteristics[config.name]}
|
|
||||||
// others={[]}
|
|
||||||
// config={config}
|
|
||||||
// />
|
|
||||||
// ),
|
|
||||||
// )}
|
|
||||||
// </>
|
|
||||||
// ))}
|
|
||||||
// </>
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user