Skip to content

Commit

Permalink
TEST: bonuses from Mantis
Browse files Browse the repository at this point in the history
  • Loading branch information
lsocrate committed Mar 20, 2024
1 parent b708496 commit 63c92dc
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/game/cards/20-Core2/Crane/PatronOfTheTradingCouncil.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Locations } from '../../../Constants';
import AbilityDsl from '../../../abilitydsl';
import DrawCard from '../../../drawcard';
import type { Conflict } from '../../../conflict';

export default class PatronOfTheTradingCouncil extends DrawCard {
static id = 'patron-of-the-trading-council';

setupCardAbilities() {
this.persistentEffect({
condition: (context) =>
context.game.isDuringConflict() &&
context.game.currentConflict.getNumberOfParticipants((card) => card.hasTrait('mantis-clan')) > 0,
((context.game.currentConflict as undefined | Conflict)?.getNumberOfParticipants((card) =>
card.hasTrait('mantis-clan')
) ?? 0) > 0,
effect: AbilityDsl.effects.modifyBothSkills(1)
});

Expand Down Expand Up @@ -54,4 +56,4 @@ export default class PatronOfTheTradingCouncil extends DrawCard {
])
});
}
}
}
53 changes: 53 additions & 0 deletions test/server/cards/20-Core2/Crane/PatronOfTheTradingCouncil.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
describe('Patron of the Trading Council', function () {
integration(function () {
describe('Static skill bonus', function () {
beforeEach(function () {
this.setupTest({
phase: 'conflict',
player1: {
inPlay: ['patron-of-the-trading-council', 'kudaka']
},
player2: {
inPlay: ['mantis-tenkinja']
}
});

this.patron = this.player1.findCardByName('patron-of-the-trading-council');
this.kudaka = this.player1.findCardByName('kudaka');
this.tenkinja = this.player2.findCardByName('mantis-tenkinja');

this.noMoreActions();
});

it('gains +1/+1 while paired with Mantis', function () {
this.initiateConflict({
attackers: [this.patron, this.kudaka],
defenders: []
});

expect(this.patron.militarySkill).toBe(3);
expect(this.patron.politicalSkill).toBe(3);
});

it('gains +1/+1 while against Mantis', function () {
this.initiateConflict({
attackers: [this.patron],
defenders: [this.tenkinja]
});

expect(this.patron.militarySkill).toBe(3);
expect(this.patron.politicalSkill).toBe(3);
});

it('does not gain +1/+1 while no mantis is around', function () {
this.initiateConflict({
attackers: [this.patron],
defenders: []
});

expect(this.patron.militarySkill).toBe(2);
expect(this.patron.politicalSkill).toBe(2);
});
});
});
});

0 comments on commit 63c92dc

Please sign in to comment.