WIP cards

This commit is contained in:
2022-11-10 00:30:52 +01:00
parent 1415da72df
commit 51a95f9bf1
18 changed files with 372 additions and 23 deletions

12
core/src/alteration.ts Normal file
View 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
View 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'>>;

View File

@ -1,2 +1,4 @@
export * from './alteration';
export * from './card';
export * from './user';
export * from './entity';

View File

@ -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;