feat: Implement deck builder magnified card view, land advice, basic land integration, and unlimited time for deck construction.

This commit is contained in:
2025-12-17 16:15:20 +01:00
parent e5750d9729
commit e13aa16766
18 changed files with 672 additions and 264 deletions

View File

@@ -190,7 +190,8 @@ export class DraftManager extends EventEmitter {
}
} else if (draft.status === 'deck_building') {
// Check global deck building timer (e.g., 120 seconds)
const DECK_BUILDING_Duration = 120000;
// Disabling timeout as per request. Set to ~11.5 days.
const DECK_BUILDING_Duration = 999999999;
if (draft.startTime && (now > draft.startTime + DECK_BUILDING_Duration)) {
draft.status = 'complete'; // Signal that time is up
updates.push({ roomId, draft });

View File

@@ -12,6 +12,9 @@ interface CardInstance {
position: { x: number; y: number; z: number }; // For freeform placement
counters: { type: string; count: number }[];
ptModification: { power: number; toughness: number };
typeLine?: string;
oracleText?: string;
manaCost?: string;
}
interface PlayerState {

View File

@@ -21,6 +21,7 @@ interface Room {
hostId: string;
players: Player[];
packs: any[]; // Store generated packs (JSON)
basicLands?: any[];
status: 'waiting' | 'drafting' | 'deck_building' | 'playing' | 'finished';
messages: ChatMessage[];
maxPlayers: number;
@@ -29,13 +30,14 @@ interface Room {
export class RoomManager {
private rooms: Map<string, Room> = new Map();
createRoom(hostId: string, hostName: string, packs: any[], socketId?: string): Room {
createRoom(hostId: string, hostName: string, packs: any[], basicLands: any[] = [], socketId?: string): Room {
const roomId = Math.random().toString(36).substring(2, 8).toUpperCase();
const room: Room = {
id: roomId,
hostId,
players: [{ id: hostId, name: hostName, isHost: true, role: 'player', ready: false, socketId, isOffline: false }],
packs,
basicLands,
status: 'waiting',
messages: [],
maxPlayers: 8