Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSammyM committed Oct 15, 2024
2 parents a6c59b6 + bec6e5e commit d388ee0
Show file tree
Hide file tree
Showing 94 changed files with 1,149 additions and 445 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"Parris",
"Playerlist",
"Poli",
"Rabblerouser",
"rbed",
"repr",
"Retri",
Expand All @@ -40,7 +41,6 @@
"vigi",
"votee",
"whisperee",
"witchable",
"Worsencroft",
"zealot"
],
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ export function translateChatMessage(message: ChatMessageVariant, playerNames?:
return translate("chatMessage.snoopResult." + (message.townie ? "townie" : "inconclusive"));
case "gossipResult":
return translate("chatMessage.gossipResult." + (message.enemies ? "enemies" : "none"));
case "flowerGirlResult":
return translate("chatMessage.flowerGirlResult", message.evilCount);
case "tallyClerkResult":
return translate("chatMessage.tallyClerkResult", message.evilCount);
case "lookoutResult":
if (message.players.length === 0) {
return translate("chatMessage.lookoutResult.nobody");
Expand Down Expand Up @@ -856,7 +856,7 @@ export type ChatMessageVariant = {
type: "gossipResult",
enemies: boolean
} | {
type: "flowerGirlResult",
type: "tallyClerkResult",
evilCount: number
} | {
type: "lookoutResult",
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/RoleSpecific.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default function RoleSpecificSection(){
return <ImposterMenu/>
case "jailor":
return <JailorRoleSpecificMenu roleState={roleState}/>;
case "kidnapper":
return <JailorRoleSpecificMenu roleState={roleState}/>;
case "medium":
return <MediumRoleSpecificMenu roleState={roleState}/>
case "doctor": {
Expand Down Expand Up @@ -211,7 +213,7 @@ function MarksmanRoleSpecificMenu(props: Readonly<{
}

function JailorRoleSpecificMenu(props: Readonly<{
roleState: RoleState & { type: "jailor" }
roleState: RoleState & { type: "jailor" | "kidnapper" }
}>): ReactElement {
const players = useGameState(
gameState => gameState.players,
Expand All @@ -222,7 +224,7 @@ function JailorRoleSpecificMenu(props: Readonly<{
)!;

const counter = <Counter
max={3}
max={props.roleState.type === "jailor" ? 3 : 1}
current={props.roleState.executionsRemaining}
>
<StyledText>{translate("role.jailor.roleDataText.executionsRemaining", props.roleState.executionsRemaining)}</StyledText>
Expand Down
14 changes: 12 additions & 2 deletions client/src/components/StyledText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { MenuControllerContext } from "../menu/game/GameScreen";
import { Player } from "../game/gameState.d";
import { AnchorControllerContext } from "../menu/Anchor";
import { setWikiSearchPage } from "./Wiki";
import { getRoleSetsFromRole } from "../game/roleListState.d";

export type TokenData = {
style?: string,
Expand Down Expand Up @@ -140,14 +141,23 @@ export function computeKeywordData() {
const KEYWORD_DATA_JSON = require("../resources/keywords.json");
//add role keywords
for(const role of Object.keys(ROLES)){
const data = KEYWORD_DATA_JSON[getFactionFromRole(role as Role)];

let data: KeywordData | undefined = undefined;

const roleSets = getRoleSetsFromRole(role as Role);
if (roleSets.length === 1) {
data = KEYWORD_DATA_JSON[roleSets[0]];
}else if (data === undefined) {
data = KEYWORD_DATA_JSON[getFactionFromRole(role as Role)];
}

if (data === undefined || Array.isArray(data)) {
console.error(`faction.${getFactionFromRole(role as Role)} has malformed keyword data!`);
continue;
}

addTranslatableKeywordData(`role.${role}.name`, [{
...data,
...(data as KeywordData),
link: `role/${role}` as WikiArticleLink,
replacement: translate(`role.${role}.name`) // Capitalize roles
}]);
Expand Down
Binary file added client/src/components/canterbury.regular.ttf
Binary file not shown.
14 changes: 13 additions & 1 deletion client/src/components/styledText.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
.keyword-neutral {
color: rgb(255, 200, 252);
}
.keyword-minions {
color: rgb(163, 71, 255);
}
.keyword-fiends {
color: orange;
}
Expand Down Expand Up @@ -74,7 +77,16 @@
background-size: 100px;
animation: scrolling-rainbow 3s linear infinite;
text-shadow: -.05rem -.05rem .1rem #ffffff66, .1rem .1rem .1rem rgb(0, 0, 0);

}
@font-face {
font-family: 'canterbury-regular';
font-style: normal;
font-weight: 400;
src: url(canterbury.regular.ttf) format('truetype');
}
.keyword-kira {
font-family: 'canterbury-regular', 'Roboto', sans-serif;
font-size: 1.2em;
}
.keyword-trans {
background-image: linear-gradient(to left, cyan, pink, white, pink, cyan);
Expand Down
2 changes: 1 addition & 1 deletion client/src/game/gameState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export type PhaseState = {type: "briefing"} | {type: "dusk"} | {type: "night"} |
playerOnTrial: PlayerIndex
}

export type ChatGroup = "all" | "dead" | "mafia" | "cult" | "jail" | "interview" | "puppeteer";
export type ChatGroup = "all" | "dead" | "mafia" | "cult" | "jail" | "kidnapper" | "interview" | "puppeteer";

export type PhaseTimes = Record<PhaseType, number>;

Expand Down
17 changes: 11 additions & 6 deletions client/src/game/roleListState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function getRolesComplement(roleList: Role[]): Role[] {
export const ROLE_SETS = [
"townInvestigative", "townProtective","townKilling","townSupport",
"mafiaKilling", "mafiaSupport",
"neutralEvil"
"minions"
] as const;
export type RoleSet = typeof ROLE_SETS[number];
export function getRolesFromRoleSet(roleSet: RoleSet): Role[] {
Expand All @@ -50,12 +50,12 @@ export function getRolesFromRoleSet(roleSet: RoleSet): Role[] {
"psychic", "lookout", "detective",
"spy", "tracker", "philosopher",
"snoop", "auditor", "gossip",
"flowerGirl"
"tallyClerk"
];
case "townProtective":
return ["bodyguard", "cop", "doctor", "bouncer", "engineer", "armorsmith", "steward"];
case "townKilling":
return ["vigilante", "veteran", "deputy", "marksman", "rabbleRouser"];
return ["vigilante", "veteran", "deputy", "marksman", "rabblerouser"];
case "townSupport":
return ["medium", "retributionist", "transporter", "escort", "mayor", "journalist"];
case "mafiaKilling":
Expand All @@ -66,12 +66,17 @@ export function getRolesFromRoleSet(roleSet: RoleSet): Role[] {
return [
"blackmailer", "informant", "hypnotist", "consort",
"forger", "framer", "mortician",
"witch", "necromancer", "cupid"
"mafiaWitch", "necromancer", "cupid"
];
case "neutralEvil":
return ["jester", "revolutionary", "politician", "doomsayer", "minion", "scarecrow"];
case "minions":
return ["witch", "scarecrow", "warper", "kidnapper"];
}
}
export function getRoleSetsFromRole(role: Role): RoleSet[] {
return ROLE_SETS.filter((roleSet) => {
return getRolesFromRoleSet(roleSet).includes(role);
})
}


export type RoleOutlineType = RoleOutline["type"];
Expand Down
14 changes: 10 additions & 4 deletions client/src/game/roleState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type RoleState = {
} | {
type: "gossip",
} | {
type: "flowerGirl"
type: "tallyClerk"
} | {
type: "doctor",
selfHealsRemaining: number,
Expand Down Expand Up @@ -76,7 +76,7 @@ export type RoleState = {
} | {
type: "deputy"
} | {
type: "rabbleRouser"
type: "rabblerouser"
} | {
type: "escort"
} | {
Expand Down Expand Up @@ -142,7 +142,7 @@ export type RoleState = {
} | {
type: "framer"
} | {
type: "witch"
type: "mafiaWitch"
} | {
type: "necromancer"
} | {
Expand All @@ -157,9 +157,15 @@ Doomsayer
| {
type: "politician"
} | {
type: "minion"
type: "witch"
} | {
type: "scarecrow"
} | {
type: "warper"
} | {
type: "kidnapper"
executionsRemaining: number,
jailedTargetRef: number | null
} | {
type: "death",
souls: number
Expand Down
3 changes: 2 additions & 1 deletion client/src/menu/game/gameScreenContent/PlayerListMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function useDayTargetedPlayers(): PlayerIndex[] {
if (roleState.backup !== null) return [roleState.backup]
break;
case "jailor":
case "kidnapper":
if (roleState.jailedTargetRef !== null) return [roleState.jailedTargetRef]
break;
case "medium":
Expand Down Expand Up @@ -199,7 +200,7 @@ export default function PlayerListMenu(): ReactElement {
}
{
!GAME_MANAGER.getMySpectator() &&
enabledRoles.includes("rabbleRouser") &&
enabledRoles.includes("rabblerouser") &&
phaseState.type !== "night" &&
phaseState.type !== "obituary" &&
<details className="role-specific-colors small-role-specific-menu" open={pitchforkVoteOpen}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const DOOMSAYER_GUESSES = [
"mafia", "neutral", "fiends", "cult",
"jailor", "villager",
"doctor", "bodyguard", "cop", "bouncer", "engineer", "armorsmith", "steward",
"vigilante", "veteran", "marksman", "deputy", "rabbleRouser",
"vigilante", "veteran", "marksman", "deputy", "rabblerouser",
"escort", "medium", "retributionist", "journalist", "mayor", "transporter",
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export const KIRA_GUESSES = [
"none",
"mafia", "neutral", "fiends", "cult",
"jailor", "villager",
"detective", "lookout", "spy", "tracker", "philosopher", "psychic", "auditor", "snoop", "gossip", "flowerGirl",
"detective", "lookout", "spy", "tracker", "philosopher", "psychic", "auditor", "snoop", "gossip", "tallyClerk",
"doctor", "bodyguard", "cop", "bouncer", "engineer", "armorsmith", "steward",
"vigilante", "veteran", "marksman", "deputy", "rabbleRouser",
"escort", "medium", "retributionist", "journalist", "mayor", "transporter",
"vigilante", "veteran", "marksman", "deputy", "rabblerouser",
"escort", "medium", "retributionist", "journalist", "mayor", "transporter", "warper",
];

export type KiraGuess = typeof KIRA_GUESSES[number];
Expand Down
Loading

0 comments on commit d388ee0

Please sign in to comment.