dominionator/src/types.ts

147 lines
3.0 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";
name: "Action" | "Treasure" | "Victory" | "Reaction" | "Duration" | "Reserve" | "Night" | "Attack" | "Command";
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;
export type DominionLandscapeType = DominionBasicLandscapeType | DominionCustomLandscapeType;
2023-12-18 21:58:27 -08:00
2023-12-27 11:37:37 -08:00
export type DominionCard = {
2023-12-18 21:58:27 -08:00
orientation: "card";
title: string;
description: DominionText;
2023-12-27 11:37:37 -08:00
types: Array<DominionCardType>;
2023-12-18 21:58:27 -08:00
image: string;
artist: string;
author: string;
version: string;
price: DominionText;
2023-12-27 11:37:37 -08:00
preview?: DominionText;
2023-12-18 21:58:27 -08:00
} | {
orientation: "landscape";
title: string;
description: DominionText;
2023-12-27 11:37:37 -08:00
types: Array<DominionLandscapeType>;
2023-12-18 21:58:27 -08:00
image: string;
artist: string;
author: string;
version: string;
price: DominionText;
};
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;
color: DominionColor
};
2023-12-27 11:37:37 -08:00
export type DominionCustomLandscapeType = {
2023-12-18 21:58:27 -08:00
typeType: "custom";
name: string;
color: DominionColor
};
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>;
}
2023-12-27 11:37:37 -08:00
export const TYPE_ACTION: DominionBasicCardType = {
typeType: "basic",
name: "Action",
color: {
value: "white",
priority: 6,
}
}
export const TYPE_TREASURE: DominionBasicCardType = {
typeType: "basic",
name: "Treasure",
color: {
value: "yellow",
priority: 5,
}
}
export const TYPE_VICTORY: DominionBasicCardType = {
typeType: "basic",
name: "Victory",
color: {
value: "green",
priority: 4,
}
}
export const TYPE_REACTION: DominionBasicCardType = {
typeType: "basic",
name: "Reaction",
color: {
value: "blue",
priority: 1,
overridesAction: true,
}
}
export const TYPE_DURATION: DominionBasicCardType = {
typeType: "basic",
name: "Duration",
color: {
value: "orange",
priority: 3,
overridesAction: true,
}
}
export const TYPE_RESERVE: DominionBasicCardType = {
typeType: "basic",
name: "Duration",
color: {
value: "orange",
priority: 2, // unknown whether this should be above or below reaction/duration?
overridesAction: true,
}
}
export const TYPE_NIGHT: DominionBasicCardType = {
typeType: "basic",
name: "Night",
color: {
value: "black",
priority: 6,
onConflictDescriptionOnly: true,
}
}
export const TYPE_ATTACK: DominionBasicCardType = {
typeType: "basic",
name: "Attack",
color: null
}
export const TYPE_COMMAND: DominionBasicCardType = {
typeType: "basic",
name: "Command",
color: null
}