diff --git a/docs/data/corespace-data.json b/docs/data/corespace-data.json index 27e3fe7..1c9da63 100644 --- a/docs/data/corespace-data.json +++ b/docs/data/corespace-data.json @@ -294,13 +294,7 @@ ] }, { - "id": "machine", - "availableSkills": [ - { - "skillId": "impervious", - "maxLevel": 3 - } - ] + "id": "tech" } ], "notes": "Balcor starts with Brutal Assault at level 2 and builds additional resilience and close combat tricks through Support or Marine class boards." diff --git a/docs/js/character-page.js b/docs/js/character-page.js index 11f50ed..c21dec3 100644 --- a/docs/js/character-page.js +++ b/docs/js/character-page.js @@ -113,15 +113,42 @@ return fallbackClasses; } - return boards.map((board) => { - const global = state.globalClasses.get(board.id) || {}; - return { - ...global, - ...board, - availableSkills: board.availableSkills || global.availableSkills || [], - description: board.description || global.description || '', - flavorText: board.flavorText || global.flavorText || '', - }; + // Check if this is a machine-only character (only has machine/machineTech classes) + const isMachineOnly = boards.every(board => + board.id === 'machine' || board.id === 'machineTech' + ); + + // Machine characters only get their restricted class options + if (isMachineOnly) { + return boards.map((board) => { + const global = state.globalClasses.get(board.id) || {}; + return { + ...global, + ...board, + availableSkills: board.availableSkills || global.availableSkills || [], + description: board.description || global.description || '', + flavorText: board.flavorText || global.flavorText || '', + }; + }); + } + + // Non-machine characters get all classes, with character-specific customizations merged in + const customBoards = new Map(boards.map(board => [board.id, board])); + + return fallbackClasses.map((globalClass) => { + const customBoard = customBoards.get(globalClass.id); + if (customBoard) { + // Merge character-specific customizations with global class + return { + ...globalClass, + ...customBoard, + availableSkills: customBoard.availableSkills || globalClass.availableSkills || [], + description: customBoard.description || globalClass.description || '', + flavorText: customBoard.flavorText || globalClass.flavorText || '', + }; + } + // Use global class definition as-is + return globalClass; }); }