mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: ricochet incapable shells
This commit is contained in:
1 parent
28a9f9a849
commit
9ed2b79a4b
5 files changed
+71
-22
No files matched your search
@@ -0,0 +1,7 @@
|
||||
import { ShellDefinition } from '../blitzkrieg/tankDefinitions';
|
||||
|
||||
export function canRicochet(
|
||||
type: ShellDefinition['type'],
|
||||
): type is 'ap' | 'ap_cr' {
|
||||
return type === 'ap' || type === 'ap_cr';
|
||||
}
|
||||
@@ -58,6 +58,14 @@ interface GunDefinitionAutoReloader {
|
||||
interClip: number;
|
||||
count: number;
|
||||
}
|
||||
export interface RicochetCapableShell {
|
||||
type: 'ap' | 'ap_cr';
|
||||
normalization: number;
|
||||
ricochet: number;
|
||||
}
|
||||
export interface RicochetIncapableShell {
|
||||
type: 'hc' | 'he';
|
||||
}
|
||||
export type ShellDefinition = {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -66,16 +74,7 @@ export type ShellDefinition = {
|
||||
caliber: number;
|
||||
icon: string;
|
||||
penetration: number | Vector2Tuple;
|
||||
} & (
|
||||
| {
|
||||
type: Omit<ShellType, 'hc' | 'he'>;
|
||||
normalization: number;
|
||||
ricochet: number;
|
||||
}
|
||||
| {
|
||||
type: Omit<ShellType, 'ap' | 'ap_cr'>;
|
||||
}
|
||||
);
|
||||
} & (RicochetCapableShell | RicochetIncapableShell);
|
||||
|
||||
export const tankDefinitions = fetch(asset('definitions/tanks.json'), {
|
||||
cache: 'no-cache',
|
||||
|
||||
Reference in new issue
Block a user