feat: Improve attacker/blocker declaration by adding client-side creature validation, enforcing correct player priority, and enhancing server-side error logging.
This commit is contained in:
@@ -82,7 +82,7 @@ define(['./workbox-5a5d9309'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.vopjl6fp8f"
|
||||
"revision": "0.inrr5fp7a9"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -706,6 +706,14 @@ export const GameView: React.FC<GameViewProps> = ({ gameState, currentPlayerId }
|
||||
onDragStart={() => { }}
|
||||
onClick={(id) => {
|
||||
if (gameState.step === 'declare_attackers') {
|
||||
// Validate Creature Type
|
||||
const types = card.types || [];
|
||||
const typeLine = card.typeLine || '';
|
||||
if (!types.includes('Creature') && !typeLine.includes('Creature')) {
|
||||
// Optional: Shake effect or visual feedback that it's invalid
|
||||
return;
|
||||
}
|
||||
|
||||
const newSet = new Set(proposedAttackers);
|
||||
if (newSet.has(id)) newSet.delete(id);
|
||||
else newSet.add(id);
|
||||
|
||||
Reference in New Issue
Block a user