mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: consumable definitions
This commit is contained in:
1 parent
3e3ed35fb0
commit
d4e8ec125f
6 files changed
+247
-90
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { asset } from './asset';
|
||||
|
||||
type ConsumableDefinitionFilter =
|
||||
| {
|
||||
type: 'tier';
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
| {
|
||||
type: 'ids';
|
||||
ids: number[];
|
||||
}
|
||||
| {
|
||||
type: 'category';
|
||||
categories: string[];
|
||||
};
|
||||
|
||||
export interface ConsumableDefinitions {
|
||||
[key: string]: {
|
||||
id: number;
|
||||
name: string;
|
||||
effects?: Record<string, number>;
|
||||
include: ConsumableDefinitionFilter[];
|
||||
exclude?: ConsumableDefinitionFilter[];
|
||||
};
|
||||
}
|
||||
|
||||
export const consumableDefinitions = fetch(
|
||||
asset('definitions/consumables.json'),
|
||||
{
|
||||
cache: 'no-cache',
|
||||
},
|
||||
).then(async (response) => response.json() as Promise<ConsumableDefinitions>);
|
||||
Reference in new issue
Block a user