Resolve ambiguous Stone battles with sealed physical totals
Add a provisional post-reveal physical-count commitment for new outcome-changing Basic/Advanced Stone and copied Mirror battles. Keep all original sides sealed until complete and retain matching later typed losses. Preserve legacy, ordinary and invariant-winner timing. Carry the same constraint through card cleanup and native casualty consumers. Validation: frozen 16 files146/146, types/lint/build and14 original-action/rendered-control programmes; four minimal policies make both owned choices legally. Source timing is explicitly provisional. Wider combinations, assurance and deployed acceptance remain open. No saved-game, reset, restart or deployment operation.
This commit is contained in:
1 parent
677ad7aa3c
commit
6ccfaa1b4d
22 files changed
+1247
-83
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { casualtyOptions, type CombatForces } from './combat';
|
||||
|
||||
/** Printed physical commitments survive later card disposal and native aftercare. */
|
||||
export type BattleCasualtyConstraint = {
|
||||
fullyCommitted?: true;
|
||||
physicalLossCount?: number;
|
||||
};
|
||||
|
||||
export function casualtyConstraintFields(constraint: BattleCasualtyConstraint) {
|
||||
return {
|
||||
...(constraint.fullyCommitted ? {fullyCommitted:true as const} : {}),
|
||||
...(constraint.physicalLossCount !== undefined ? {physicalLossCount:constraint.physicalLossCount} : {}),
|
||||
};
|
||||
}
|
||||
|
||||
export function committedCasualtyOptions(forces: CombatForces, dial: number, support: number,
|
||||
constraint: BattleCasualtyConstraint = {}) {
|
||||
const {fullyCommitted, physicalLossCount} = constraint;
|
||||
if ((fullyCommitted !== undefined && fullyCommitted !== true) ||
|
||||
(physicalLossCount !== undefined && (!Number.isSafeInteger(physicalLossCount) ||
|
||||
physicalLossCount < 0 || physicalLossCount > forces.normal + forces.elite))) return [];
|
||||
return casualtyOptions(forces, dial, support).filter(option =>
|
||||
(!fullyCommitted || option.normal === forces.normal && option.elite === forces.elite) &&
|
||||
(physicalLossCount === undefined || option.normal + option.elite === physicalLossCount));
|
||||
}
|
||||
Reference in new issue
Block a user