Initial commit
This commit is contained in:
commit
8c709fb52f
771 files changed
+222983
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type { Leader } from './cards';
|
||||
import type { FactionId } from './catalog';
|
||||
/** Original identity is permanent; capture temporarily overrides ghola control. */
|
||||
export function controlsLeader(
|
||||
player: { id: string; faction: FactionId },
|
||||
leader: Leader,
|
||||
) {
|
||||
if (leader.capturedBy) return leader.capturedBy === player.id;
|
||||
if (leader.gholaBy) return leader.gholaBy === player.id;
|
||||
if (leader.controller !== undefined) return leader.controller === player.id;
|
||||
return leader.faction === player.faction;
|
||||
}
|
||||
export function nativeAvailable(leader: Leader) {
|
||||
return !leader.dead && !leader.capturedBy && !leader.gholaBy;
|
||||
}
|
||||
Reference in new issue
Block a user