Resolve definite Orgiz payers and prove native shared Collection
This commit is contained in:
1 parent
388c5fa8d5
commit
bc09ac3cfd
11 files changed
+310
-292
No files matched your search
@@ -16,36 +16,23 @@ export function createOccupiedDiscoveryCollectionFixture(
|
||||
location:typeof CISTERN|typeof ORGIZ_PROCESSING_STATION,
|
||||
advanced=false,
|
||||
) {
|
||||
const fixture=createDiscoveryOccupantsFixture({location,advanced});
|
||||
const fixture=createDiscoveryOccupantsFixture({location,advanced,adjacentBlow:location===ORGIZ_PROCESSING_STATION});
|
||||
const actions:TestingStationContestStep[]=[...fixture.actions];
|
||||
let game=fixture.game;
|
||||
let collector:string|null=null,deposit:string|null=null;
|
||||
if(location===ORGIZ_PROCESSING_STATION) {
|
||||
game=advanceTestingStationContest(game,g=>g.phase===5&&g.turn<=4&&g.active!==null&&
|
||||
(g.movementRemaining?.length??0)===1&&clean(g)&&
|
||||
Object.entries(g.spice).some(([key,amount])=>amount>0&&
|
||||
key!==`${ORGIZ_PROCESSING_STATION}:0`),actions);
|
||||
const shipActor=game.active;
|
||||
assert.ok(shipActor,'A real movement window must have an active seat.');
|
||||
const candidates=Object.entries(game.spice)
|
||||
.filter(([key,amount])=>amount>0&&key!==`${ORGIZ_PROCESSING_STATION}:0`)
|
||||
.sort((left,right)=>right[1]-left[1]);
|
||||
assert.ok(candidates.length,'A real blow must supply a positive desert deposit.');
|
||||
let shipped:Game|null=null,shippedDeposit:string|null=null;
|
||||
for(const [key] of candidates) {
|
||||
const {territory,sector}=splitLocation(key);
|
||||
const shipment:Action={type:'ship',territory,sector,amount:2,elite:0,allyPayment:0};
|
||||
try {
|
||||
const next=applyAction(game,shipActor,shipment);
|
||||
actions.push({actor:shipActor,action:shipment});
|
||||
shipped=advanceTestingStationContest(next,clean,actions);
|
||||
shippedDeposit=key;
|
||||
break;
|
||||
} catch { continue; }
|
||||
}
|
||||
assert.ok(shipped&&shippedDeposit,'A real paid shipment must reach one actual positive deposit.');
|
||||
collector=shipActor; deposit=shippedDeposit;
|
||||
game=shipped;
|
||||
game=advanceTestingStationContest(game,g=>g.turn===2&&g.phase===5&&
|
||||
g.active==='emperor'&&clean(g),actions);
|
||||
const candidate=Object.entries(game.spice).find(([key,amount])=>amount>=2&&
|
||||
splitLocation(key).sector!==game.storm&&game.players.every(p=>(p.forces[key]??0)===0));
|
||||
assert.ok(candidate,'An original printed blow must supply an empty non-storm deposit.');
|
||||
deposit=candidate[0];
|
||||
collector='emperor';
|
||||
const {territory,sector}=splitLocation(deposit);
|
||||
const shipment:Action={type:'ship',territory,sector,amount:2,elite:0,allyPayment:0};
|
||||
game=applyAction(game,collector,shipment);
|
||||
actions.push({actor:collector,action:shipment});
|
||||
game=advanceTestingStationContest(game,clean,actions);
|
||||
assert.equal(game.players.find(p=>p.id===collector)!.forces[deposit],2);
|
||||
}
|
||||
game=advanceTestingStationContest(game,g=>g.phase===5&&g.active!==null&&
|
||||
|
||||
Reference in new issue
Block a user