diff --git a/web/src/pages/[gameId]/[locationSlug]/[drugSlug]/[tradeDirection].tsx b/web/src/pages/[gameId]/[locationSlug]/[drugSlug]/[tradeDirection].tsx index 1711bba65..085ab1713 100644 --- a/web/src/pages/[gameId]/[locationSlug]/[drugSlug]/[tradeDirection].tsx +++ b/web/src/pages/[gameId]/[locationSlug]/[drugSlug]/[tradeDirection].tsx @@ -48,7 +48,10 @@ export default function Market() { const [quantitySell, setQuantitySell] = useState(0); const [canSell, setCanSell] = useState(false); const [canBuy, setCanBuy] = useState(false); - + const [isSubmitting, setIsSubmitting] = useState(false); + + const { buy, sell, error: txError } = useSystems(); + const { addTrade } = usePlayerStore(); const { account } = useDojo(); const { location: locationEntity } = useLocationEntity({ @@ -76,11 +79,7 @@ export default function Market() { setCanBuy(playerEntity.cash > market.price); setMarket(market); - }, [locationEntity, playerEntity, drug]); - - const [isSubmitting, setIsSubmitting] = useState(false); - const { buy, sell, error: txError } = useSystems(); - const { addTrade } = usePlayerStore(); + }, [locationEntity, playerEntity, drug, isSubmitting]); const onTrade = useCallback(async () => { setIsSubmitting(true); diff --git a/web/src/pages/[gameId]/event/decision.tsx b/web/src/pages/[gameId]/event/decision.tsx index 8961401ce..a7008835b 100644 --- a/web/src/pages/[gameId]/event/decision.tsx +++ b/web/src/pages/[gameId]/event/decision.tsx @@ -57,7 +57,7 @@ export default function Decision() { setStatus(playerEntity.status); } - }, [playerEntity]); + }, [playerEntity, isSubmitting]); const canPay = useMemo(() => { if (playerEntity && playerEntity.status == PlayerStatus.BeingArrested) { diff --git a/web/src/pages/index.tsx b/web/src/pages/index.tsx index f7a23f5d4..b0858ddaf 100644 --- a/web/src/pages/index.tsx +++ b/web/src/pages/index.tsx @@ -32,7 +32,7 @@ import { useEffect, useState } from "react"; // hardcode game params for now const START_TIME = 0; const MAX_PLAYERS = 1; -const NUM_TURNS = 14; +const NUM_TURNS = 9; const floatAnim = keyframes` 0% {transform: translateY(0%);} diff --git a/web/src/responses.ts b/web/src/responses.ts index a24805301..b4337b6d4 100644 --- a/web/src/responses.ts +++ b/web/src/responses.ts @@ -3,22 +3,6 @@ import { Outcome } from "./dojo/types"; type Encounter = "initial" | "repeat"; const muggerResponses: Record> = { - [Outcome.Fought]: { - initial: [ - "You've got some nerve! But this isn't over.", - "Impressive moves, punk. We'll remember that face.", - "You think you've won? We'll be back, and with friends.", - "Lucky punch... next time you won't be so fortunate.", - "You might've won the fight, but the war? It's just beginning.", - ], - repeat: [ - "You again? You won't be lucky every time.", - "Starting to hate that face of yours. We'll get our revenge.", - "Twice now, you've bested us. But third time's the charm.", - "You're making quite a reputation around here. It won't save you forever.", - "How many more times are we gonna dance this dance?", - ], - }, [Outcome.Escaped]: { initial: [ "You might've outrun us this time, but the shadows talk. We'll find you.", @@ -117,11 +101,6 @@ const copResponses: Record> = { initial: [], repeat: [], }, - // Not needed - [Outcome.Fought]: { - initial: [], - repeat: [], - }, }; function getRandomIdx(length: number): number {