diff --git a/web/src/components/ArrangePhase.tsx b/web/src/components/ArrangePhase.tsx index 9bc8859..56cca4e 100644 --- a/web/src/components/ArrangePhase.tsx +++ b/web/src/components/ArrangePhase.tsx @@ -8,10 +8,11 @@ interface Props { send: (msg: ClientMessage) => void } -// ArrangePhase lets the player order their deck for battle. Leftmost card -// fights first; food cards buff the next pet to their right... i.e. foods -// apply "down" to the next pet later in the order. Drag cards or use the -// arrow buttons to reorder, then lock in. +// ArrangePhase lets the player order their deck for battle. Rightmost card +// fights first; food cards buff the next pet to their left... i.e. foods +// apply to the next pet later in the play order. Internally `order` stays in +// play order (index 0 fights first) to match the backend; we only reverse for +// display. Drag cards or use the arrow buttons to reorder, then lock in. export function ArrangePhase({ view, you, send }: Props) { const [order, setOrder] = useState(you.deck ?? []) const dragIndex = useRef(null) @@ -79,55 +80,58 @@ export function ArrangePhase({ view, you, send }: Props) { Arrange your battle line

- The leftmost card fights first. Food cards power up the - next pet to their right. + The rightmost card fights first. Food cards power up the + next pet to their left. {trailingFoods > 0 && ( {' '} - ⚠️ {trailingFoods} food card{trailingFoods > 1 ? 's' : ''} at the end - will be wasted! + ⚠️ {trailingFoods} food card{trailingFoods > 1 ? 's' : ''} on the far + left will be wasted! )}

-
⚔️ first
- {order.map((c, i) => ( -
(dragIndex.current = i)} - onDragOver={(e) => { - e.preventDefault() - if (dragIndex.current !== null && dragIndex.current !== i) { - move(dragIndex.current, i) - dragIndex.current = i - } - }} - onDragEnd={() => (dragIndex.current = null)} - > - -
- - + {order + .map((c, i) => ({ c, i })) + .reverse() + .map(({ c, i }) => ( +
(dragIndex.current = i)} + onDragOver={(e) => { + e.preventDefault() + if (dragIndex.current !== null && dragIndex.current !== i) { + move(dragIndex.current, i) + dragIndex.current = i + } + }} + onDragEnd={() => (dragIndex.current = null)} + > + +
+ + +
-
- ))} + ))} +
⚔️ first