dominionator/src/types.ts

161 lines
3.1 KiB
TypeScript
Raw Normal View History

2023-12-27 11:37:37 -08:00
export type DominionText = string;
2023-12-18 21:58:27 -08:00
2023-12-27 11:37:37 -08:00
export type DominionColor = {
value: string;
2023-12-18 21:58:27 -08:00
priority: number; // highest priority is "primary", second highest is "secondary".
2023-12-27 11:37:37 -08:00
overridesAction?: boolean;
onConflictDescriptionOnly?: boolean;
2023-12-18 21:58:27 -08:00
};
2023-12-27 11:37:37 -08:00
export type DominionBasicCardType = {
2023-12-18 21:58:27 -08:00
typeType: "basic";
2024-12-29 23:00:38 -05:00
name:
| "Action"
| "Treasure"
| "Victory"
| "Reaction"
| "Duration"
| "Reserve"
| "Night"
| "Attack"
| "Command";
2023-12-18 21:58:27 -08:00
color: null | DominionColor;
};
2023-12-27 11:37:37 -08:00
export type DominionBasicLandscapeType = {
2023-12-18 21:58:27 -08:00
typeType: "basic";
name: "Event" | "Landmark" | "Project" | "Way" | "Trait";
color: null | DominionColor;
};
2023-12-27 11:37:37 -08:00
export type DominionCardType = DominionBasicCardType | DominionCustomCardType;
2024-12-29 23:00:38 -05:00
export type DominionLandscapeType =
| DominionBasicLandscapeType
| DominionCustomLandscapeType;
export type DominionCard =
| {
orientation: "card";
title: string;
description: DominionText;
types: Array<DominionCardType>;
image: string;
artist: string;
author: string;
version: string;
price: DominionText;
preview?: DominionText;
}
| {
orientation: "landscape";
title: string;
description: DominionText;
types: Array<DominionLandscapeType>;
image: string;
artist: string;
author: string;
version: string;
price: DominionText;
};
2023-12-18 21:58:27 -08:00
2023-12-27 11:37:37 -08:00
export type DominionCustomSymbol = {
2023-12-18 21:58:27 -08:00
image: string;
};
2023-12-27 11:37:37 -08:00
export type DominionCustomCardType = {
2023-12-18 21:58:27 -08:00
typeType: "custom";
name: string;
2024-12-29 23:00:38 -05:00
color: DominionColor;
2023-12-18 21:58:27 -08:00
};
2023-12-27 11:37:37 -08:00
export type DominionCustomLandscapeType = {
2023-12-18 21:58:27 -08:00
typeType: "custom";
name: string;
2024-12-29 23:00:38 -05:00
color: DominionColor;
2023-12-18 21:58:27 -08:00
};
2023-12-27 11:37:37 -08:00
export type DominionExpansion = {
2023-12-18 21:58:27 -08:00
cards: Array<DominionCard>;
icon: string;
customSymbols: Array<DominionCustomSymbol>;
customCardTypes: Array<DominionCustomCardType>;
customLandscapeTypes: Array<DominionCustomLandscapeType>;
2024-12-29 23:00:38 -05:00
};
2023-12-27 11:37:37 -08:00
export const TYPE_ACTION: DominionBasicCardType = {
typeType: "basic",
name: "Action",
color: {
value: "white",
priority: 6,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_TREASURE: DominionBasicCardType = {
typeType: "basic",
name: "Treasure",
color: {
value: "yellow",
priority: 5,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_VICTORY: DominionBasicCardType = {
typeType: "basic",
name: "Victory",
color: {
value: "green",
priority: 4,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_REACTION: DominionBasicCardType = {
typeType: "basic",
name: "Reaction",
color: {
value: "blue",
priority: 1,
overridesAction: true,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_DURATION: DominionBasicCardType = {
typeType: "basic",
name: "Duration",
color: {
value: "orange",
priority: 3,
overridesAction: true,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_RESERVE: DominionBasicCardType = {
typeType: "basic",
name: "Duration",
color: {
2024-12-29 23:00:38 -05:00
value: "brown",
2023-12-27 11:37:37 -08:00
priority: 2, // unknown whether this should be above or below reaction/duration?
overridesAction: true,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_NIGHT: DominionBasicCardType = {
typeType: "basic",
name: "Night",
color: {
value: "black",
priority: 6,
onConflictDescriptionOnly: true,
2024-12-29 23:00:38 -05:00
},
};
2023-12-27 11:37:37 -08:00
export const TYPE_ATTACK: DominionBasicCardType = {
typeType: "basic",
name: "Attack",
2024-12-29 23:00:38 -05:00
color: null,
};
2023-12-27 11:37:37 -08:00
export const TYPE_COMMAND: DominionBasicCardType = {
typeType: "basic",
name: "Command",
2024-12-29 23:00:38 -05:00
color: null,
};