mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: start of stats
This commit is contained in:
1 parent
58c2965c53
commit
a0367af06b
5 files changed
+178
-6
No files matched your search
@@ -0,0 +1,117 @@
|
|||||||
|
import { TankAttributeChange_AttributeName } from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||||
|
|
||||||
|
export const stats = [
|
||||||
|
{
|
||||||
|
name: "firepower",
|
||||||
|
|
||||||
|
attributes: [
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_RELOAD_TIME,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_ANGLE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_AIMING_TIME,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_VEHICLE_MOVEMENT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_VEHICLE_ROTATION,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_TURRET_ROTATION,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_AFTER_SHOT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_DISPERSION_FACTOR_WHILE_GUN_DAMAGED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_PITCH_LIMIT_DOWN,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_PITCH_LIMIT_UP,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_YAW_LIMIT_LEFT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_YAW_LIMIT_RIGHT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CLIP_SIZE,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "maneuverability",
|
||||||
|
|
||||||
|
attributes: [
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_GUN_ROTATION_SPEED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TURRET_ROTATION_SPEED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_HULL_ROTATION_SPEED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_ENGINE_POWER,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_BRAKE_FORCE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MASS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_FORWARD_MAX_SPEED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_BACKWARD_MAX_SPEED,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_HARD,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_MEDIUM,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_TERRAIN_RESISTANCE_SOFT,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "survivability",
|
||||||
|
|
||||||
|
attributes: [
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_MAX_HEALTH,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_HEALTH_BURN_PER_SEC,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CIRCULAR_VISION_RADIUS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_MOVING,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_STILL,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_FIRE_PENALTY,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: TankAttributeChange_AttributeName.ATTRIBUTE_NAME_CONCEALMENT_FACTOR_AT_SHOT,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -5,6 +5,10 @@ import { parse } from "yaml";
|
|||||||
import type { TanksEntry } from "../../protos/tanks";
|
import type { TanksEntry } from "../../protos/tanks";
|
||||||
import { AbstractAPI } from "./abstract";
|
import { AbstractAPI } from "./abstract";
|
||||||
|
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
|
throw new Error("ServerAPI is being evaluated in the browser");
|
||||||
|
}
|
||||||
|
|
||||||
interface LocalizationConfig {
|
interface LocalizationConfig {
|
||||||
namespaces: string[];
|
namespaces: string[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import {
|
||||||
|
TankAttributeChange_AttributeName,
|
||||||
|
TankAttributeChange_Modifier,
|
||||||
|
} from "@protos/blitz_static_tank_upgrade_single_stage";
|
||||||
|
import { use } from "react";
|
||||||
|
import { api } from "../../../core/api/dynamic";
|
||||||
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Page({ id }: Props) {
|
||||||
|
const tank = use(api.tank(id));
|
||||||
|
|
||||||
|
const stage = Tankopedia.use((state) => state.stage);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h1>{tank.name?.value}</h1>
|
||||||
|
|
||||||
|
<h2>Base stats</h2>
|
||||||
|
|
||||||
|
{tank.base_stats!.attributes.map((attribute) => (
|
||||||
|
<p>
|
||||||
|
{TankAttributeChange_AttributeName[attribute.attribute_name]}:{" "}
|
||||||
|
{attribute.value} ({TankAttributeChange_Modifier[attribute.modifier]})
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<h2>Upgrades</h2>
|
||||||
|
|
||||||
|
{tank.upgrade_stages.map((stage, index) => (
|
||||||
|
<>
|
||||||
|
<h3>Stage {index}</h3>
|
||||||
|
|
||||||
|
{stage.attributes.map((attribute) => (
|
||||||
|
<p>
|
||||||
|
{TankAttributeChange_AttributeName[attribute.attribute_name]}:{" "}
|
||||||
|
{attribute.value} (
|
||||||
|
{TankAttributeChange_Modifier[attribute.modifier]})
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import type { GetStaticPaths } from "astro";
|
import type { GetStaticPaths } from "astro";
|
||||||
import { api } from "../../../core/api/dynamic";
|
import { api } from "../../../core/api/dynamic";
|
||||||
|
import { Page } from "./_index";
|
||||||
|
|
||||||
export const getStaticPaths = (async () => {
|
export const getStaticPaths = (async () => {
|
||||||
const { tanks } = await api.tanks();
|
const { tanks } = await api.tanks();
|
||||||
@@ -14,9 +15,4 @@ export const getStaticPaths = (async () => {
|
|||||||
const { id } = Astro.props;
|
const { id } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<h1>Tank {id}</h1>
|
<Page {id} />
|
||||||
|
|
||||||
<code>
|
|
||||||
<pre>{JSON.stringify(await api.tank(id) , null, 2)}</pre>
|
|
||||||
</code>
|
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { Varuna } from "varuna";
|
||||||
|
|
||||||
|
interface Tankopedia {
|
||||||
|
stage: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Tankopedia = new Varuna<Tankopedia>({ stage: 0 });
|
||||||
Reference in new issue
Block a user