WIP cards
This commit is contained in:
12
core/src/alteration.ts
Normal file
12
core/src/alteration.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { EntityInfo } from './entity';
|
||||
import { CardInfo } from './card';
|
||||
|
||||
export type AlerationInfo = {
|
||||
card: CardInfo;
|
||||
level: number;
|
||||
xp: number;
|
||||
};
|
||||
|
||||
export type Ateration = AlerationInfo & EntityInfo;
|
||||
|
||||
export type AlerationCtor = Partial<Ateration>;
|
40
core/src/card.ts
Normal file
40
core/src/card.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import { EntityInfo } from './entity';
|
||||
|
||||
export enum CardRarity {
|
||||
COMMON = 'COMMON',
|
||||
RARE = 'RARE',
|
||||
EPIC = 'EPIC',
|
||||
LEGENDARY = 'LEGENDARY',
|
||||
}
|
||||
|
||||
export type CombatStats = {
|
||||
baseAtk: number;
|
||||
baseDef: number;
|
||||
baseCrit: number;
|
||||
multAtk: number;
|
||||
multDef: number;
|
||||
multCrit: number;
|
||||
};
|
||||
|
||||
export type CardInfo = {
|
||||
uuid: string;
|
||||
name: string;
|
||||
rarity: keyof typeof CardRarity;
|
||||
stats: CombatStats;
|
||||
thumbnail: string;
|
||||
model: string;
|
||||
};
|
||||
|
||||
export type CreateCardBody = {
|
||||
name: string;
|
||||
rarity: keyof typeof CardRarity;
|
||||
stats: CombatStats;
|
||||
thumbnail: string;
|
||||
model: string;
|
||||
};
|
||||
|
||||
export type Card = CardInfo & EntityInfo;
|
||||
|
||||
export type CardCtor = Partial<Card>;
|
||||
|
||||
export type UpdateCardBody = Partial<Omit<CardInfo, 'uuid'>>;
|
@ -1,2 +1,4 @@
|
||||
export * from './alteration';
|
||||
export * from './card';
|
||||
export * from './user';
|
||||
export * from './entity';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { EntityInfo } from './entity';
|
||||
import { CardInfo } from './card';
|
||||
|
||||
export enum UserRoles {
|
||||
ADMIN = 'ADMIN',
|
||||
@ -9,6 +10,7 @@ export type UserInfo = {
|
||||
uuid: string;
|
||||
username: string;
|
||||
role: keyof typeof UserRoles;
|
||||
cards: CardInfo[];
|
||||
};
|
||||
|
||||
export type User = UserInfo & EntityInfo;
|
||||
|
Reference in New Issue
Block a user