Compose paired Nexus Skills with original Tech and Strongholds
This commit is contained in:
1 parent
449e27b415
commit
2d24f43721
14 files changed
+1709
-21
No files matched your search
@@ -102,7 +102,18 @@ export function nextNativeSkillsStrongholdStep(game: Game): StrongholdFactionsNa
|
||||
}
|
||||
function act(game: Game, next: StrongholdFactionsNativeStep, actions?: StrongholdFactionsNativeStep[]): Game {
|
||||
actions?.push(structuredClone(next));
|
||||
return applyAction(game, next.actor, next.action);
|
||||
const descriptor = Object.getOwnPropertyDescriptor(crypto, 'getRandomValues');
|
||||
const native = crypto.getRandomValues.bind(crypto);
|
||||
crypto.getRandomValues = <V extends ArrayBufferView | null>(array: V): V => {
|
||||
if (array instanceof Uint32Array) array.fill(0xffffffff);
|
||||
else Reflect.apply(native, crypto, [array]);
|
||||
return array;
|
||||
};
|
||||
try { return applyAction(game, next.actor, next.action); }
|
||||
finally {
|
||||
if (descriptor) Object.defineProperty(crypto, 'getRandomValues', descriptor);
|
||||
else Reflect.deleteProperty(crypto, 'getRandomValues');
|
||||
}
|
||||
}
|
||||
export function advanceNativeSkillsStronghold(state: Game, until: (g: Game) => boolean,
|
||||
actions?: StrongholdFactionsNativeStep[], firstDial = 0): Game {
|
||||
@@ -197,7 +208,8 @@ export function createNativeSkillsStrongholdFixture(options: NativeSkillsStrongh
|
||||
if (!game.strongholdCards) game = applyAction(game, game.host, { type: 'strongholdCards', enabled: true });
|
||||
if (options.optionalTech && !game.techTokens) game = applyAction(game, game.host, { type: 'techTokens', enabled: true });
|
||||
if (game.techTokens) assert.ok(game.players.length >= 3);
|
||||
const initial = structuredClone(game), actions: StrongholdFactionsNativeStep[] = [], staging: string[] = [];
|
||||
const initial = structuredClone(game), actions: StrongholdFactionsNativeStep[] = [],
|
||||
staging: string[] = ['Scoped original scalar action entropy keeps native source programs reproducible; UUID byte arrays remain native.'];
|
||||
const native: AdvancedNativeSkillsOptions = { family, skillOwner: ownerFaction, requestedSkill: 'suk-graduate', initial: game };
|
||||
game = initializeAdvancedNativeSkillsSetup(native);
|
||||
const offered = structuredClone(game);
|
||||
|
||||
Reference in new issue
Block a user