Skip to content

Commit

Permalink
Merge pull request #40 from JollyGrin/bug/clears-board-on-mana-gain
Browse files Browse the repository at this point in the history
Bug/clears board on mana gain
  • Loading branch information
JollyGrin authored Sep 29, 2024
2 parents e527dd6 + a1abd82 commit 741545a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ Find instructions if you wish to setup your own game server.
- [ ] support battlebox (shared deck)

## Bugs
- [x] updating mana or rolling dice causes board state to clear
- [ ] graveyard sorting. Ensure that in the handle drag it ignores ordering conditions
- [ ] firefox maybe shows context menu on right click
- [x] right click modal, taps card



## Feedback
- [ ]



## Recently finished
- [x] roll dice (d6/d20)
- [x] spawn card/token modal
- cache the sorcery api data on cards.army
Expand All @@ -39,10 +45,6 @@ Find instructions if you wish to setup your own game server.
- [x] add numbers to grid: numbers 1-20
- [x] add counters on cards
- [x] add remaining / total mana



## Recently finished
- [x] add websocket for multiplayer
- [x] landing page
- [x] setup pages for solo play (1p, 2p rotate self)
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Online/CreateLobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const CreateLobby = () => {
onClick={onSubmit}
style={{ width: "100%" }}
>
Create lobby
Create/Join lobby
</button>
{fields.gid && (
<HStack
Expand Down
15 changes: 8 additions & 7 deletions src/pages/online.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ const Body = () => {
});
}

function setData(data: PlayerData) {
setPlayerState()({
state: myState?.state ?? initGameState,
data,
});
}

const socketPlayers =
gameState?.content?.players ?? ({} as Record<string, PlayerState>);

Expand Down Expand Up @@ -88,6 +81,14 @@ const Body = () => {
return [...combineGameStates(), ...localState.slice(GRIDS.HAND)];
}, [socketPlayers]);

function setData(data: PlayerData) {
setPlayerState()({
state: state ?? initGameState,
data,
timestamp: Date.now(),
});
}

if (myState?.state === undefined && name) {
return (
<LoadDeck
Expand Down

0 comments on commit 741545a

Please sign in to comment.