Feat : add most token effects
This commit is contained in:
@@ -153,3 +153,59 @@ export async function lockEffect(game: string, effectId: string) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function makeDiscard(
|
||||
game: string,
|
||||
playerId: string,
|
||||
amount: number = 1
|
||||
) {
|
||||
const config = useRuntimeConfig();
|
||||
await $fetch(
|
||||
new URL(
|
||||
`games/${game}/turn/makeDiscard/${playerId}`,
|
||||
config.public.endpoint
|
||||
).href,
|
||||
{
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function damagePlayer(
|
||||
game: string,
|
||||
playerId: string,
|
||||
amount: number = 1
|
||||
) {
|
||||
const config = useRuntimeConfig();
|
||||
await $fetch(
|
||||
new URL(
|
||||
`games/${game}/turn/damagePlayer/${playerId}`,
|
||||
config.public.endpoint
|
||||
).href,
|
||||
{
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: { amount },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function damageChampion(
|
||||
game: string,
|
||||
playerId: string,
|
||||
cardId: string
|
||||
) {
|
||||
const config = useRuntimeConfig();
|
||||
await $fetch(
|
||||
new URL(
|
||||
`games/${game}/turn/damageChampion/${cardId}`,
|
||||
config.public.endpoint
|
||||
).href,
|
||||
{
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: { playerId },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,16 @@ export enum CardEffects {
|
||||
PICK_FACTION = "pick_faction",
|
||||
}
|
||||
|
||||
export enum CardType {
|
||||
HERO = "hero",
|
||||
HERO_ABILITY = "hero_ability",
|
||||
CURRENCY = "currency",
|
||||
WEAPON = "weapon",
|
||||
CHAMPION = "champion",
|
||||
ACTION = "action",
|
||||
ITEM = "item",
|
||||
}
|
||||
|
||||
export interface GameObject {
|
||||
_id: string;
|
||||
}
|
||||
@@ -95,5 +105,6 @@ export interface Effect extends GameObject {
|
||||
}
|
||||
export interface Card extends GameObject {
|
||||
cardId: number;
|
||||
cardType: CardType;
|
||||
effects: Effect[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user