diff --git a/Scarb.toml b/Scarb.toml index cbb275236..af8bfcaf1 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -15,8 +15,8 @@ dojo = { git = "https://github.com/dojoengine/dojo.git" } # Katana -#rpc_url = "https://api.cartridge.gg/x/rollyourown/katana" -rpc_url = "http://localhost:5050" +rpc_url = "https://api.cartridge.gg/x/rollyourown/katana" +#rpc_url = "http://localhost:5050" account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" private_key = "0x1800000000300000180000000000030000000000003006001800006600" diff --git a/scripts/default_auth.sh b/scripts/default_auth.sh index 328ffb57a..5729198c5 100755 --- a/scripts/default_auth.sh +++ b/scripts/default_auth.sh @@ -2,8 +2,8 @@ set -euo pipefail pushd $(dirname "$0")/.. -export RPC_URL="http://localhost:5050"; -#export RPC_URL="https://api.cartridge.gg/x/rollyourown/katana"; +#export RPC_URL="http://localhost:5050"; +export RPC_URL="https://api.cartridge.gg/x/rollyourown/katana"; export WORLD_ADDRESS="0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5"; # enable system -> component authorizations 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/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 {