Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/js/botc/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const RoleTypes = [
"minion",
"demon",
"fabled",
"loric",
"travellers",
] as const;
Comment on lines 28 to 36
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RoleTypes now includes "loric", but there are other role-type unions hardcoded elsewhere (e.g. Override.homebrew.roleType in src/js/botc/overrides.ts) that still only allow townsfolk/outsider/minion/demon/fabled/travellers. This makes the type surface inconsistent and prevents defining homebrew overrides with the new role type. Prefer reusing the shared RoleType type (or at least add "loric" to the union) so the codebase stays in sync when role types evolve.

Copilot uses AI. Check for mistakes.
export type RoleType = (typeof RoleTypes)[number];
Expand Down Expand Up @@ -70,7 +71,7 @@ export class CharacterInfo {
}

get special(): boolean {
return ["travellers", "fabled"].includes(this.roleType);
return ["travellers", "fabled", "loric"].includes(this.roleType);
}

nightDetails(firstNight: boolean): NightAction | null {
Expand Down
3 changes: 2 additions & 1 deletion src/js/botc/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export function onlyBaseThree(characters: CharacterInfo[]): boolean {
(c) =>
c.edition != "other" ||
c.roleType == "travellers" ||
c.roleType == "fabled",
c.roleType == "fabled" ||
c.roleType == "loric",
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/botc/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const SetupChanges: { [key: string]: SetupModification } = {
};

export function goesInBag(withLordOfTyphon: boolean, char: CardInfo): boolean {
if (char.roleType == "fabled") {
if (char.roleType == "fabled" || char.roleType == "loric") {
return false;
}
if (withLordOfTyphon && char.roleType == "minion") {
Expand Down
2 changes: 1 addition & 1 deletion src/js/randomizer/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function requiredSelection(characters: CharacterInfo[]): Set<string> {
required.add(demons[0].id);
}
for (const c of characters) {
if (c.roleType == "fabled") {
if (c.roleType == "fabled" || c.roleType == "loric") {
required.add(c.id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/roles/character_sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function Character(props: {
}

function pluralRole(roleType: string): string {
return ["townsfolk", "fabled", "travellers"].includes(roleType)
return ["townsfolk", "fabled", "loric", "travellers"].includes(roleType)
? roleType
: roleType + "s";
Comment on lines 118 to 121
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pluralRole takes roleType: string, but this function is only intended to handle known role types and RoleType is already imported in this file. Typing the parameter as RoleType (or RoleType | string if needed) would prevent accidental calls with arbitrary strings and make future additions like "loric" safer to roll out consistently.

Copilot uses AI. Check for mistakes.
}
Expand Down
Loading