mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: consumables
This commit is contained in:
1 parent
12cf05cb50
commit
9d7c60e92d
6 files changed
+76
-54
No files matched your search
@@ -25,7 +25,6 @@ export type TankFilterDefinition =
|
||||
export interface ConsumableEntry {
|
||||
id: number;
|
||||
name: string;
|
||||
effects?: Record<string, number>;
|
||||
include: TankFilterDefinition[];
|
||||
exclude?: TankFilterDefinition[];
|
||||
}
|
||||
@@ -37,3 +36,5 @@ export interface ConsumableDefinitions {
|
||||
export const consumableDefinitions = fetchCdonLz4<ConsumableDefinitions>(
|
||||
asset('definitions/consumables.cdon.lz4'),
|
||||
);
|
||||
|
||||
consumableDefinitions.then(console.log);
|
||||
@@ -4,13 +4,15 @@ export function resolveDpm(
|
||||
gun: GunDefinition,
|
||||
shell: ShellDefinition,
|
||||
hasRammer = false,
|
||||
hasShellReloadBoost = false,
|
||||
) {
|
||||
if (gun.type === 'regular') {
|
||||
return (shell.damage.armor / ((hasRammer ? 0.93 : 1) * gun.reload)) * 60;
|
||||
} else if (gun.type === 'autoLoader') {
|
||||
return (
|
||||
((shell.damage.armor * gun.count) /
|
||||
(gun.reload + (gun.count - 1) * gun.interClip)) *
|
||||
(gun.reload +
|
||||
(gun.count - 1) * gun.interClip * (hasShellReloadBoost ? 0.7 : 1))) *
|
||||
60
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
||||
|
||||
export function useConsumable(id: number) {
|
||||
const consumables = useTankopediaTemporary((state) => state.consumables);
|
||||
return consumables.includes(id);
|
||||
}
|
||||
File renamed without changes.
Reference in new issue
Block a user