Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Sep 16, 2023
1 parent c8551ff commit c606c7e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/[gameId]/event/decision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function Decision() {

setStatus(playerEntity.status);
}
}, [playerEntity]);
}, [playerEntity, isSubmitting]);

const canPay = useMemo(() => {
if (playerEntity && playerEntity.status == PlayerStatus.BeingArrested) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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%);}
Expand Down
21 changes: 0 additions & 21 deletions web/src/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@ import { Outcome } from "./dojo/types";
type Encounter = "initial" | "repeat";

const muggerResponses: Record<Outcome, Record<Encounter, string[]>> = {
[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.",
Expand Down Expand Up @@ -117,11 +101,6 @@ const copResponses: Record<Outcome, Record<Encounter, string[]>> = {
initial: [],
repeat: [],
},
// Not needed
[Outcome.Fought]: {
initial: [],
repeat: [],
},
};

function getRandomIdx(length: number): number {
Expand Down

0 comments on commit c606c7e

Please sign in to comment.