Skip to content

Silent Exception when a unit guarding captured units is exploited away #2209

@moyerr

Description

@moyerr

Description

The recent bugfix (#2140) regarding captured units seems to have introduced a regression where Exploiting a unit guarding captured units causes a silent exception.

Test Setup

{
    "phase": "action",
    "attackRulesVersion": "cr6",
    "player1": {
        "leader": "count-dooku#face-of-the-confederacy",
        "base": "alliance-outpost",
        "hand": [
            "confederate-courier"
        ],
        "groundArena": [
            {
                "card": "cad-bane#hostage-taker",
                "capturedUnits": [
                    "hk47#exclamation-die-meatbag"
                ]
            }
        ]
    }
}

Failing Test case

it('When a unit guarding captured units is exploited, the captured units return to play', async function() {
    await contextRef.setupTestAsync({
      phase: 'action',
      player1: {
        leader: 'count-dooku#face-of-the-confederacy',
        resources: 3,
        hand: ['confederate-courier'],
        groundArena: [
          {
            card: 'cad-bane#hostage-taker',
            capturedUnits: ['hk47#exclamation-die-meatbag']
          }
        ]
      }
    });

    const { context } = contextRef;

    // Use Count Dooku's leader ability play Confederate Courier with Exploit 1
    context.player1.clickCard(context.countDooku);
    context.player1.clickCard(context.confederateCourier);
    context.player1.clickPrompt('Trigger Exploit');

    // Select Cad Bane as the exploit target
    context.player1.clickCard(context.cadBane);
    context.player1.clickDone();

    // Cad Bane is defeated and Vanguard Infantry is rescued
    expect(context.cadBane).toBeInZone('discard', context.player1);
    expect(context.confederateCourier).toBeInZone('spaceArena', context.player1);
    expect(context.hk47ExclamationDieMeatbag).toBeInZone('groundArena', context.player2);
    expect(context.p1Base.damage).toBe(0); // HK should not trigger from its own captor's defeat event
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions