Require Vercingetorix to precede the Rapid Recruitment action
This commit is contained in:
parent
5cf89f4ceb
commit
d99781634d
5 changed files with 26 additions and 23 deletions
|
|
@ -147,7 +147,11 @@ fn rapid_recruitment(mut b: LeaderAbilityBuilder) -> LeaderAbilityBuilder {
|
|||
|e| &mut e.recruit,
|
||||
40 - i as i32,
|
||||
move |game, p, r| {
|
||||
if r.city_position != leader_position(p.get(game)) {
|
||||
// Recruitment places all units before these listeners run. A newly
|
||||
// recruited leader did not occupy the city when the action began.
|
||||
if r.units.leader == Some(Leader::Vercingetorix)
|
||||
|| r.city_position != leader_position(p.get(game))
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let first = p.get(game).next_unit_id - r.units.amount() as u32;
|
||||
|
|
@ -200,7 +204,7 @@ fn rapid_recruitment(mut b: LeaderAbilityBuilder) -> LeaderAbilityBuilder {
|
|||
fn vercingetorix() -> LeaderInfo {
|
||||
LeaderInfo::new(Leader::Vercingetorix,"Vercingetorix",
|
||||
LeaderAbility::builder("Warrior People","Vercingetorix adds +1 combat value per friendly Settler within 2 spaces.").add_combat_strength_listener(116,|game,c,s,r|{if c.has_leader(r,game){let p=game.player(c.player(r));let n=p.units.iter().filter(|u|u.is_settler()&&u.position.distance(leader_position(p))<=2).count() as i8;s.extra_combat_value+=n;if n>0{s.roll_log.push(format!("Warrior People adds +{n} combat value"));}}}).build(),
|
||||
rapid_recruitment(LeaderAbility::builder("Rapid Recruitment","When recruiting in Vercingetorix's city, each new land unit may be placed directly on adjacent revealed land without enemy units or cities.")).build())
|
||||
rapid_recruitment(LeaderAbility::builder("Rapid Recruitment","When recruiting in a city Vercingetorix already occupied before this action, each new land unit may be placed directly on adjacent revealed land without enemy units or cities.")).build())
|
||||
}
|
||||
fn boudica() -> LeaderInfo {
|
||||
LeaderInfo::new(
|
||||
|
|
|
|||
|
|
@ -363,3 +363,5 @@ Viewer 0.1.121 keeps civilization selection beside chat on screens at least 1100
|
|||
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.
|
||||
|
||||
Viewer 0.1.124 / engine 0.4.88 corrects Rapid Recruitment timing: recruiting Vercingetorix does not trigger his own ability for him or accompanying units. A later Recruit action in his city, including in the same turn, remains eligible. Clarifies the ability text and tests both cases. Community timing discussion (not an official designer ruling): https://boardgamegeek.com/thread/2814396.
|
||||
|
|
|
|||
4
web-client/package-lock.json
generated
4
web-client/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.123",
|
||||
"version": "0.1.124",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.123",
|
||||
"version": "0.1.124",
|
||||
"dependencies": {
|
||||
"@boardgamers/protocol": "0.9.0",
|
||||
"lucide-svelte": "^0.577.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.123",
|
||||
"version": "0.1.124",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -1436,24 +1436,21 @@ test('Navigator remains unavailable when all ships in Hanno’s space already mo
|
|||
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 () => {
|
||||
for (const infantry of [0, 1]) {
|
||||
test(`Rapid Recruitment does not trigger when recruiting Vercingetorix with ${infantry} 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);
|
||||
}
|
||||
const recruited = move(g, query(g, { kind: 'recruit', city, units: { infantry, leader: 'Vercingetorix' }, replaced: [] }).action);
|
||||
assert.ok(!view(recruited).decision);
|
||||
assert.equal(recruited.players[index].units.find((u: any) => u.unit_type?.Leader === 'Vercingetorix').position, city);
|
||||
assert.equal(recruited.actions_left, g.actions_left - 1);
|
||||
if (infantry) assert.equal(recruited.players[index].units.find((u: any) => u.unit_type === 'Infantry').position, city);
|
||||
const later = move(recruited, query(recruited, { kind: 'recruit', city, units: { infantry: 1 }, replaced: [] }).action);
|
||||
assert.match(view(later).decision.description, /Rapid Recruitment/);
|
||||
const target = view(later).decision.options[0].position;
|
||||
const done = move(later, { Response: { SelectPositions: [target] } });
|
||||
assert.ok(!view(done).decision);
|
||||
assert.ok(done.players[index].units.some((u: any) => u.unit_type === 'Infantry' && u.position === target));
|
||||
assert.equal(done.players[index].units.find((u: any) => u.unit_type?.Leader === 'Vercingetorix').position, city);
|
||||
assert.equal(done.actions_left, g.actions_left - 2);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue