mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: migrated tankopedia pages
This commit is contained in:
1 parent
135dd85a82
commit
9ae8b0ac49
30 files changed
+77
-19
No files matched your search
@@ -1,3 +0,0 @@
|
||||
export function degressiveStat(crew: number) {
|
||||
return 0.875 / (0.00375 * 100 * crew + 0.5) - 1;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { BoundingBox } from '@blitzkit/core/src/blitzkit/modelDefinitions';
|
||||
import { Vector3Tuple } from 'three';
|
||||
|
||||
export function normalizeBoundingBox(boundingBox: BoundingBox) {
|
||||
return boundingBox.max.map(
|
||||
(max, index) => max - boundingBox.min[index],
|
||||
) as Vector3Tuple;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { EventManager } from '@blitzkit/core/src/blitzkit/eventManager';
|
||||
|
||||
export enum Pose {
|
||||
HullDown,
|
||||
FaceHug,
|
||||
Default,
|
||||
}
|
||||
|
||||
export const poseEvent = new EventManager<Pose>();
|
||||
@@ -1,3 +0,0 @@
|
||||
export function progressiveStat(crew: number) {
|
||||
return (0.00375 * 100 * crew + 0.5) / 0.875 - 1;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import { GunDefinition, ShellDefinition } from './tankDefinitions';
|
||||
|
||||
export function resolveDpm(
|
||||
gun: GunDefinition,
|
||||
shell: ShellDefinition,
|
||||
damageCoefficient = 1,
|
||||
reloadCoefficient = 1,
|
||||
intraClipCoefficient = 1,
|
||||
) {
|
||||
const alpha = shell.damage.armor * damageCoefficient;
|
||||
let dps: number;
|
||||
|
||||
if (gun.type === 'regular') {
|
||||
dps = alpha / (reloadCoefficient * gun.reload);
|
||||
} else if (gun.type === 'autoLoader') {
|
||||
dps =
|
||||
(alpha * gun.count) /
|
||||
(gun.reload * reloadCoefficient +
|
||||
(gun.count - 1) * gun.intraClip * intraClipCoefficient);
|
||||
} else {
|
||||
const mostOptimalShell = gun.reload.reduce<null | {
|
||||
index: number;
|
||||
reload: number;
|
||||
}>((current, reloadRaw, index) => {
|
||||
const reload =
|
||||
reloadRaw * reloadCoefficient +
|
||||
(index > 0 ? gun.intraClip * intraClipCoefficient : 0);
|
||||
|
||||
if (current === null || reload < current.reload) {
|
||||
return { index, reload };
|
||||
}
|
||||
return current;
|
||||
}, null)!;
|
||||
|
||||
dps = alpha / mostOptimalShell?.reload;
|
||||
}
|
||||
|
||||
return dps * 60;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { BoundingBox } from '@blitzkit/core/src/blitzkit/modelDefinitions';
|
||||
import { Vector3Tuple } from 'three';
|
||||
|
||||
export function unionBoundingBox(a: BoundingBox, b: BoundingBox) {
|
||||
return {
|
||||
min: a.min.map((a, index) => Math.min(a, b.min[index])) as Vector3Tuple,
|
||||
max: a.max.map((a, index) => Math.max(a, b.max[index])) as Vector3Tuple,
|
||||
} satisfies BoundingBox;
|
||||
}
|
||||
Reference in new issue
Block a user