Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bossk leader #405

Merged
merged 12 commits into from
Jan 2, 2025
Prev Previous commit
Next Next commit
More tests
  • Loading branch information
AMMayberry1 committed Jan 1, 2025
commit da847ae958a15d98e4ab0a6c622b6f83f74af244
100 changes: 80 additions & 20 deletions test/server/cards/03_TWI/leaders/BosskHuntingHisPrey.spec.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@ describe('Bossk, Hunting his Prey', function () {
'guavian-antagonizer',
{ card: 'jyn-erso#stardust', upgrades: ['guild-target'] },
{ card: 'clone-trooper', upgrades: ['death-mark'] },
'wanted-insurgents'
'wanted-insurgents',
{ card: 'trandoshan-hunters', upgrades: ['top-target'] }
],
hand: ['vanquish']
},
@@ -104,24 +105,40 @@ describe('Bossk, Hunting his Prey', function () {
// CASE 6: not collecting the Bounty does not trigger Bossk (bounty with target resolver)
context.player2.clickCard(context.wantedInsurgents);
context.player2.clickCard(context.bossk);
expect(context.player1).toBeAbleToSelectExactly([context.bossk]);
expect(context.player1).toBeAbleToSelectExactly([context.bossk, context.trandoshanHunters]);
context.player1.clickPrompt('Pass ability');
expect(context.player1).toBeActivePlayer();

resetPhase();

// CASE 7: Bossk dies in the attack, his ability does not trigger
context.player1.clickCard(context.bossk);
context.player1.clickCard(context.trandoshanHunters);

expect(context.player1).toBeAbleToSelectExactly([context.p1Base, context.p2Base]);
context.player1.clickCard(context.p2Base);
expect(context.p2Base.damage).toBe(2); // 6 damage - 4 b/c unit is not unique

expect(context.player2).toBeActivePlayer();
});
});

it('should be able to collect a "search for a card" Bounty a second time', function () {
describe('Bossk\'s leader deployed ability', function () {
beforeEach(function () {
contextRef.setupTest({
phase: 'action',
player1: {
leader: { card: 'bossk#hunting-his-prey', deployed: true },
groundArena: ['clone-deserter'],
deck: ['sabine-wren#explosives-artist', 'battlefield-marine', 'waylay', 'protector', 'inferno-four#unforgetting', 'echo-base-defender'],
groundArena: ['wampa'],
deck: ['sabine-wren#explosives-artist', 'battlefield-marine', 'waylay', 'protector', 'snowtrooper-lieutenant', 'inferno-four#unforgetting'],
},
player2: {
groundArena: [{ card: 'clone-trooper', upgrades: ['bounty-hunters-quarry'] }]
groundArena: [{ card: 'clone-trooper', upgrades: ['bounty-hunters-quarry'] }, 'clone-deserter']
},
});
});

it('should be able to collect a "search for a card" Bounty a second time which activates a "when played" ability', function() {
const { context } = contextRef;
const prompt = 'Collect Bounty: Search the top 5 cards of your deck, or 10 cards instead if this unit is unique, for a unit that costs 3 or less and play it for free.';

@@ -130,33 +147,76 @@ describe('Bossk, Hunting his Prey', function () {
context.player1.clickCard(context.cloneTrooper);
expect(context.player1).toHavePassAbilityPrompt(prompt);
context.player1.clickPrompt(prompt);
expect(context.player1).toHaveEnabledPromptButtons([context.battlefieldMarine.title, context.infernoFour.title, context.sabineWren.title, 'Take nothing']);
expect(context.player1).toHaveEnabledPromptButtons([context.battlefieldMarine.title, context.snowtrooperLieutenant.title, context.sabineWren.title, 'Take nothing']);
expect(context.player1).toHaveDisabledPromptButtons([context.waylay, context.protector.title]);

context.player1.clickPrompt(context.battlefieldMarine.title);
expect(context.battlefieldMarine).toBeInZone('groundArena');
expect(context.player1.exhaustedResourceCount).toBe(0);
expect([context.sabineWren, context.waylay, context.snowtrooperLieutenant, context.protector]).toAllBeInBottomOfDeck(context.player1, 4);

expect(context.sabineWren).toBeInBottomOfDeck(context.player1, 4);
expect(context.waylay).toBeInBottomOfDeck(context.player1, 4);
expect(context.infernoFour).toBeInBottomOfDeck(context.player1, 4);
expect(context.protector).toBeInBottomOfDeck(context.player1, 4);

// second Bounty trigger
// second Bounty trigger, play a unit that has a "when played" which triggers an attack
expect(context.player1).toHavePassAbilityPrompt('Collect the Bounty again');
context.player1.clickPrompt('Collect the Bounty again');
expect(context.player1).toHaveEnabledPromptButtons([context.infernoFour.title, context.sabineWren.title, context.echoBaseDefender.title, 'Take nothing']);
expect(context.player1).toHaveEnabledPromptButtons([context.infernoFour.title, context.sabineWren.title, context.snowtrooperLieutenant.title, 'Take nothing']);
expect(context.player1).toHaveDisabledPromptButtons([context.waylay, context.protector.title]);

context.player1.clickPrompt(context.sabineWren.title);
expect(context.sabineWren).toBeInZone('groundArena');
context.player1.clickPrompt(context.snowtrooperLieutenant.title);
expect(context.snowtrooperLieutenant).toBeInZone('groundArena');
expect(context.player1.exhaustedResourceCount).toBe(0);

expect(context.echoBaseDefender).toBeInBottomOfDeck(context.player1, 4);
expect(context.waylay).toBeInBottomOfDeck(context.player1, 4);
expect(context.infernoFour).toBeInBottomOfDeck(context.player1, 4);
expect(context.protector).toBeInBottomOfDeck(context.player1, 4);
// do the attack, trigger _another_ bounty
expect(context.player1).toBeAbleToSelectExactly([context.wampa]);
expect(context.player1).toHavePassAbilityButton();
context.player1.clickCard(context.wampa);
context.player1.clickCard(context.cloneDeserter);
expect([context.sabineWren, context.waylay, context.infernoFour, context.protector]).toAllBeInBottomOfDeck(context.player1, 4);

// resolve the Clone Deserter bounty
expect(context.player1).toHavePassAbilityPrompt('Collect Bounty: Draw a card');
context.player1.clickPrompt('Collect Bounty: Draw a card');
expect(context.player1.handSize).toBe(1);
});

// TODO: waiting on the judge chat for this one
// it('should be able to collect a "search for a card" Bounty a second time', function() {
// const { context } = contextRef;
// const prompt = 'Collect Bounty: Search the top 5 cards of your deck, or 10 cards instead if this unit is unique, for a unit that costs 3 or less and play it for free.';

// // first Bounty trigger: Bounty Hunter's Quarry, play a unit that has a "when played" which triggers an attack
// context.player1.clickCard(context.bossk);
// context.player1.clickCard(context.cloneTrooper);
// expect(context.player1).toHavePassAbilityPrompt(prompt);
// context.player1.clickPrompt(prompt);
// expect(context.player1).toHaveEnabledPromptButtons([context.battlefieldMarine.title, context.snowtrooperLieutenant.title, context.sabineWren.title, 'Take nothing']);
// expect(context.player1).toHaveDisabledPromptButtons([context.waylay, context.protector.title]);

// context.player1.clickPrompt(context.snowtrooperLieutenant.title);
// expect(context.snowtrooperLieutenant).toBeInZone('groundArena');
// expect(context.player1.exhaustedResourceCount).toBe(0);

// // do the attack, trigger _another_ bounty
// expect(context.player1).toBeAbleToSelectExactly([context.wampa]);
// expect(context.player1).toHavePassAbilityButton();
// context.player1.clickCard(context.wampa);
// context.player1.clickCard(context.cloneDeserter);

// // resolve the Clone Deserter bounty
// expect(context.player1).toHavePassAbilityPrompt('Collect Bounty: Draw a card');
// context.player1.clickPrompt('Collect Bounty: Draw a card');
// expect(context.player1.handSize).toBe(1);

// // activate Bossk ability here to re-collect the Clone Deserter bounty, using up the per-round limit so we can't activate BHQ's Bounty again
// expect(context.player1).toHavePassAbilityPrompt('Collect the Bounty again');
// context.player1.clickPrompt('Collect the Bounty again');
// expect(context.player1.handSize).toBe(2);

// expect(context.player2).toBeActivePlayer();
// });
});

// TODO: test Jabba bounty
// TODO: test "resource top card of deck" bounty
// TODO: test can still activate ability if bounty was "collected" but had no effect
});
});