dominionator/src/types.ts

162 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;
2025-01-06 22:14:58 -05:00
cost: DominionText;
2025-01-07 22:25:44 -08:00
expansionIcon: string;
2024-12-29 23:00:38 -05:00
preview?: DominionText;
}
| {
orientation: "landscape";
title: string;
description: DominionText;
types: Array<DominionLandscapeType>;
image: string;
artist: string;
author: string;
version: string;
2025-01-06 22:14:58 -05:00
cost: DominionText;
2024-12-29 23:00:38 -05:00
};
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: "#ffe076",
2023-12-27 11:37:37 -08:00
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: "#b3e5ad",
2023-12-27 11:37:37 -08:00
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: "#81adff",
2023-12-27 11:37:37 -08:00
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: "#ffbc55",
2023-12-27 11:37:37 -08:00
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: "Reserve",
2023-12-27 11:37:37 -08:00
color: {
value: "#e5c28b",
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: {
2025-01-08 19:08:40 -08:00
value: "#485058",
2023-12-27 11:37:37 -08:00
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,
};