Enforce Salusa free Sardaukar revival penalty
This commit is contained in:
1 parent
1f92affea7
commit
533c651b07
24 files changed
+962
-213
No files matched your search
@@ -2,7 +2,7 @@ import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { applyAction, type Action, type Game } from '../game/engine';
|
||||
import {
|
||||
createSalusaGholaTruthFixture as fixture, actSalusaGholaTruth as act,
|
||||
createSalusaGholaTruthFixture as fixture,
|
||||
salusaGholaTruthPlayer as p, salusaGholaTruthInventory as inventory,
|
||||
salusaGholaTruthPlan as plan, finishSalusaGholaTruthBattle as finish,
|
||||
type SalusaGholaTruthFixture,
|
||||
@@ -32,7 +32,7 @@ function done(game: Game, f: SalusaGholaTruthFixture, gholaUsed: boolean) {
|
||||
assert.deepEqual(inventory(game),f.base.original);
|
||||
}
|
||||
|
||||
void test('earned native Truth Yes dial2 permits Salusa Ghola and preserves its original binding through the actual plan', () => {
|
||||
void test('earned native Truth Yes dial2 survives Low Salusa Ghola rejection and the actual plan', () => {
|
||||
const f = fixture();
|
||||
assert.equal(p(f.base.afterSetup,f.opponent).hand[0].id,f.truthCard);
|
||||
assert.equal(f.base.beforeDeal.players.every(p => p.hand.length === 0),true);
|
||||
@@ -42,29 +42,31 @@ void test('earned native Truth Yes dial2 permits Salusa Ghola and preserves its
|
||||
assert.equal(f.sourceCount,f.sourceActions.length);
|
||||
assert.deepEqual(f.game.battle!.plans,{});
|
||||
binding(f.game,f);
|
||||
const game = act(structuredClone(f.game),f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:2});
|
||||
assert.equal(p(game).elites!.tanks,0);
|
||||
const game = structuredClone(f.game);
|
||||
reject(game,f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:1});
|
||||
assert.equal(p(game).elites!.tanks,1);
|
||||
binding(game,f);
|
||||
const result = finish(f,game);
|
||||
assert.equal(result.afterPlan.battle!.plans[f.actor].dial,2);
|
||||
assert.equal(result.afterPlan.battle!.plans[f.actor].support,0);
|
||||
assert.equal(result.revealed.battle!.truthPromises![0].released,undefined);
|
||||
done(result.game,f,true);
|
||||
done(result.game,f,false);
|
||||
});
|
||||
|
||||
void test('earned native Truth No dial1 remains feasible after Salusa Ghola without releasing its aggregate answer', () => {
|
||||
void test('earned native Truth No dial1 remains feasible after Low Salusa rejection', () => {
|
||||
const f = fixture({claim:{kind:'dial',compare:'eq',value:1},answer:'no'});
|
||||
const game = act(structuredClone(f.game),f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:2});
|
||||
const game = structuredClone(f.game);
|
||||
reject(game,f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:1});
|
||||
binding(game,f);
|
||||
const result = finish(f,game,plan(game,2,0));
|
||||
assert.equal(result.revealed.battle!.truthPromises![0].answer,false);
|
||||
assert.equal(result.revealed.battle!.truthPromises![0].released,undefined);
|
||||
done(result.game,f,true);
|
||||
done(result.game,f,false);
|
||||
});
|
||||
|
||||
void test('earned native Truth Yes odd1 rejects Salusa Ghola before cost and can finish dial1 before later printed use', () => {
|
||||
void test('earned native Truth Yes odd1 survives Low Salusa rejection and still prohibits free stars afterward', () => {
|
||||
const f = fixture({claim:{kind:'dial',compare:'eq',value:1}});
|
||||
binding(f.game,f);
|
||||
reject(f.game,f.actor,f.action);
|
||||
@@ -75,10 +77,10 @@ void test('earned native Truth Yes odd1 rejects Salusa Ghola before cost and can
|
||||
const result = finish(f,structuredClone(f.game),plan(f.game,1,0));
|
||||
assert.equal(result.afterPlan.battle!.plans[f.actor].dial,1);
|
||||
done(result.game,f,false);
|
||||
const returned = act(result.game,f.actor,f.action);
|
||||
assert.deepEqual(army(returned),{normal:0,elite:2});
|
||||
assert.equal(returned.discard.filter(c => c.id === f.card).length,1);
|
||||
assert.deepEqual(inventory(returned),f.base.original);
|
||||
reject(result.game,f.actor,f.action);
|
||||
assert.deepEqual(army(result.game),{normal:0,elite:1});
|
||||
assert.equal(result.game.discard.filter(c => c.id === f.card).length,0);
|
||||
assert.deepEqual(inventory(result.game),f.base.original);
|
||||
});
|
||||
|
||||
void test('earned native Truth Yes paid support rejects Salusa Ghola while the original supported plan stays legal', () => {
|
||||
@@ -93,35 +95,33 @@ void test('earned native Truth Yes paid support rejects Salusa Ghola while the o
|
||||
done(result.game,f,false);
|
||||
});
|
||||
|
||||
void test('earned grouped Truth Yes odd1 or even2 keeps its live even alternative after Salusa Ghola', () => {
|
||||
void test('earned grouped Truth Yes odd1 or even2 keeps its live alternative after Low Salusa rejection', () => {
|
||||
const f = fixture({claim:{kind:'or',terms:[
|
||||
{kind:'dial',compare:'eq',value:1},{kind:'dial',compare:'eq',value:2},
|
||||
]}});
|
||||
const game = act(structuredClone(f.game),f.actor,f.action);
|
||||
const game = structuredClone(f.game);
|
||||
reject(game,f.actor,f.action);
|
||||
binding(game,f);
|
||||
assert.deepEqual(army(game),{normal:0,elite:2});
|
||||
assert.deepEqual(army(game),{normal:0,elite:1});
|
||||
const result = finish(f,game,plan(game,2,0));
|
||||
assert.deepEqual(result.revealed.battle!.truthPromises![0].claim,f.claim);
|
||||
assert.equal(result.revealed.battle!.truthPromises![0].released,undefined);
|
||||
done(result.game,f,true);
|
||||
done(result.game,f,false);
|
||||
});
|
||||
|
||||
void test('earned Prescience odd1 and native Truth Yes even2 can renew the inspection through actual Salusa Ghola', () => {
|
||||
const f = fixture({inspectionDial:1});
|
||||
void test('earned Prescience and compatible Truth retain their original dial2 after Low Salusa rejection', () => {
|
||||
const f = fixture({inspectionDial:2});
|
||||
assert.ok(f.base.inspection);
|
||||
assert.equal(f.base.inspection.answered.battle!.prescience!.value,1);
|
||||
assert.equal(f.game.battle!.prescience!.value,1);
|
||||
assert.equal(f.base.inspection.answered.battle!.prescience!.value,2);
|
||||
assert.equal(f.game.battle!.prescience!.value,2);
|
||||
binding(f.game,f);
|
||||
let game = act(structuredClone(f.game),f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:2});
|
||||
const game = structuredClone(f.game);
|
||||
reject(game,f.actor,f.action);
|
||||
assert.deepEqual(army(game),{normal:0,elite:1});
|
||||
binding(game,f);
|
||||
assert.equal(Object.hasOwn(game.battle!.prescience!,'value'),false);
|
||||
assert.equal(game.battle!.preparation?.kind,'prescienceAnswer');
|
||||
assert.equal(game.battle!.preparation?.owner,f.actor);
|
||||
reject(game,f.actor,{type:'prescienceAnswer',value:1});
|
||||
game = act(game,f.actor,{type:'prescienceAnswer',value:2});
|
||||
assert.equal(game.battle!.prescience!.value,2);
|
||||
assert.equal(game.battle!.preparation,undefined);
|
||||
binding(game,f);
|
||||
const result = finish(f,game,plan(game,2,0));
|
||||
done(result.game,f,true);
|
||||
done(result.game,f,false);
|
||||
});
|
||||
Reference in new issue
Block a user