Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove modifiers #737

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 0 additions & 5 deletions client/src/game/abilityInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ export type AbilityInput = {
} | {
type: "pitchforkVote"
input: OnePlayerOptionInput,
} | {
type: "hitOrderVote"
input: OnePlayerOptionInput,
} | {
type: "hitOrderMafioso",
} | {
type: "syndicateGunItemShoot",
input: OnePlayerOptionInput,
Expand Down
5 changes: 2 additions & 3 deletions client/src/game/gameState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export type PlayerGameState = {

forfeitVote: boolean,
pitchforkVote: PlayerIndex | null,
hitOrderVote: PlayerIndex | null,
syndicateGunItemData: {
shooter: PlayerIndex | null,
target: PlayerIndex | null,
Expand Down Expand Up @@ -151,8 +150,8 @@ export type Tag =
export const MODIFIERS = [
"obscuredGraves", "randomLoveLinks",
"deadCanChat", "noAbstaining",
"noDeathCause", "mafiaHitOrders",
"syndicateGunItem", "roleSetGraveKillers"
"noDeathCause",
"roleSetGraveKillers"
] as const;
export type ModifierType = (typeof MODIFIERS)[number];

Expand Down
1 change: 0 additions & 1 deletion client/src/game/gameState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export function createPlayerGameState(): PlayerGameState {

forfeitVote: false,
pitchforkVote: null,
hitOrderVote: null,
syndicateGunItemData: {
shooter: null,
target: null,
Expand Down
4 changes: 0 additions & 4 deletions client/src/game/messageListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,6 @@ export default function messageListener(packet: ToClientPacket){
if(GAME_MANAGER.state.stateType === "game" && GAME_MANAGER.state.clientState.type === "player")
GAME_MANAGER.state.clientState.pitchforkVote = packet.player;
break;
case "yourHitOrderVote":
if(GAME_MANAGER.state.stateType === "game" && GAME_MANAGER.state.clientState.type === "player")
GAME_MANAGER.state.clientState.hitOrderVote = packet.player;
break;
case "yourSyndicateGunItemData":
if(GAME_MANAGER.state.stateType === "game" && GAME_MANAGER.state.clientState.type === "player"){
GAME_MANAGER.state.clientState.syndicateGunItemData.shooter = packet.shooter;
Expand Down
3 changes: 0 additions & 3 deletions client/src/game/packet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ export type ToClientPacket = {
} | {
type: "yourPitchforkVote",
player: PlayerIndex | null
} | {
type: "yourHitOrderVote",
player: PlayerIndex | null
} | {
type: "yourSyndicateGunItemData",
shooter: PlayerIndex | null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useGameState, usePlayerState } from "../../../../components/useHooks";
import OldSelectionType from "./AbilitySelectionTypes/OldSelectionType";
import ForfeitVote from "./ForfeitVote";
import Pitchfork from "./Pitchfork";
import HitOrder from "./HitOrder";
import SyndicateGunItemMenu from "./SyndicateGunItemMenu";

export default function AbilityMenu(): ReactElement {
Expand Down Expand Up @@ -41,7 +40,6 @@ export default function AbilityMenu(): ReactElement {
<OldSelectionType/>
</details>
<Pitchfork/>
<HitOrder/>
<SyndicateGunItemMenu/>
</>
}
Expand Down
76 changes: 0 additions & 76 deletions client/src/menu/game/gameScreenContent/AbilityMenu/HitOrder.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactElement } from "react"
import { usePlayerState } from "../../../../../components/useHooks";
import { RoleState } from "../../../../../game/roleState.d";
import { useGameState, usePlayerState } from "../../../../../components/useHooks";
import { getSingleRoleJsonData, RoleState } from "../../../../../game/roleState.d";
import GAME_MANAGER from "../../../../..";
import React from "react";
import RoleOptionSelectionMenu from "../AbilitySelectionTypes/RoleOptionSelectionMenu";
Expand All @@ -14,12 +14,20 @@ export default function ProfessorMenu(props: Readonly<{
return gameState.players[playerState.myIndex].alive
},
["playerAlive", "gamePlayers", "yourPlayerIndex"]
)
);

const enabledSyndicateSupportRoles = useGameState(
(gameState) => {
return gameState.enabledRoles.filter((role) => getSingleRoleJsonData(role).roleSets.includes("mafiaSupport"))
},
["enabledRoles"]
);

return <>
{alive && <>
<RoleOptionSelectionMenu
selection={props.roleState.convertRole}
enabledRoles={enabledSyndicateSupportRoles}
onChoose={(role)=>{
GAME_MANAGER.sendAbilityInput({
type: "disguiser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export default function SyndicateGunItemMenu(props: Readonly<{}>): ReactElement
["gamePlayers", "playerAlive"]
)!;

const enabledModifiers = useGameState(
gameState => gameState.enabledModifiers,
["enabledModifiers"]
)!;
const phaseState = useGameState(
gameState => gameState.phaseState,
["phase", "playerOnTrial"]
Expand Down Expand Up @@ -73,7 +69,6 @@ export default function SyndicateGunItemMenu(props: Readonly<{}>): ReactElement
const [open, setOpen] = useState<boolean>(true);

if(
!enabledModifiers.includes("syndicateGunItem") ||
phaseState.type !== "night" ||
dayNumber === 1 ||
!insiderGroups.includes("mafia")
Expand Down
Loading