Fix Rapid Recruitment prompt for newly recruited leaders

This commit is contained in:
coyotte508 2026-10-15 17:11:41 +02:00
commit 5cf89f4ceb
5 changed files with 28 additions and 4 deletions

View file

@ -173,7 +173,7 @@ fn rapid_recruitment(mut b: LeaderAbilityBuilder) -> LeaderAbilityBuilder {
0..=1,
&format!(
"Rapid Recruitment · Deploy {} #{} beside the city",
unit.unit_type.non_leader_name(),
unit.unit_type.name(game),
unit.id + 1
),
))

View file

@ -361,3 +361,5 @@ Viewer 0.1.120 keeps chat accessible during civilization selection: a non-modal
Viewer 0.1.121 keeps civilization selection beside chat on screens at least 1100px wide, switching between panels on smaller screens. Verified both panels remain visible without overlap on desktop. Engine remains 0.4.85.
Viewer 0.1.122 / engine 0.4.86 fixes Bartering to allow an action, objective, or wonder card from hand, including when no action cards remain. Public cards in play are excluded. Updates advance wording and verifies all three discard types, resource reward, action cost, and once-per-turn restriction.
Viewer 0.1.123 / engine 0.4.87 fixes Rapid Recruitment crashing when Vercingetorix is recruited alongside infantry. Leader placement prompts use the leader name. Existing pending recruitment choices can continue without replay or saved-data edits. Regression coverage checks keeping and deploying both newly recruited units.

View file

@ -1,12 +1,12 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.122",
"version": "0.1.123",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@boardgamers/clash-web-client",
"version": "0.1.122",
"version": "0.1.123",
"dependencies": {
"@boardgamers/protocol": "0.9.0",
"lucide-svelte": "^0.577.0",

View file

@ -1,6 +1,6 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.122",
"version": "0.1.123",
"private": true,
"type": "module",
"scripts": {

View file

@ -1435,3 +1435,25 @@ test('Navigator remains unavailable when all ships in Hanno’s space already mo
p.event_info={...p.event_info,'Carthage moved units':'[0]'};
assert(!view(g).specialActions.some((a:any)=>a.name==='Navigator'));
});
for (const deployInfantry of [false, true]) {
test(`Rapid Recruitment handles newly recruited Vercingetorix after ${deployInfantry ? 'deploying' : 'keeping'} infantry`, async () => {
const g = await setup('Celts'), index = seat(g), city = g.players[index].cities[0].position;
const offer = query(g, { kind: 'recruit', city, units: { infantry: 1, leader: 'Vercingetorix' }, replaced: [] });
assert.ok(offer.action);
const recruited = move(g, offer.action);
const infantry = view(recruited).decision;
assert.match(infantry.description, /Deploy infantry/);
const target = infantry.options[0].position;
const afterInfantry = move(recruited, { Response: { SelectPositions: deployInfantry ? [target] : [] } });
assert.match(view(afterInfantry).decision.description, /Deploy Vercingetorix/);
for (const deployLeader of [false, true]) {
const leaderTarget = view(afterInfantry).decision.options[0].position;
const done = move(afterInfantry, { Response: { SelectPositions: deployLeader ? [leaderTarget] : [] } });
assert.ok(!view(done).decision);
assert.equal(done.players[index].units.find((u: any) => u.unit_type?.Leader === 'Vercingetorix').position, deployLeader ? leaderTarget : city);
assert.equal(done.players[index].units.find((u: any) => u.unit_type === 'Infantry').position, deployInfantry ? target : city);
assert.equal(done.actions_left, g.actions_left - 1);
}
});
}