Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Keeper of Secret Names couldn't trigger if the province was already t…
Browse files Browse the repository at this point in the history
…riggered
  • Loading branch information
The-Outcast committed Dec 12, 2019
1 parent 6eae0de commit 4d7f608
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/game/GameActions/ResolveAbilityAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ResolveAbilityActionResolver extends AbilityResolver {
card: this.context.source,
context: this.context
}));
}
}
this.game.openEventWindow(events);
}

Expand Down Expand Up @@ -83,7 +83,7 @@ export interface ResolveAbilityProperties extends CardActionProperties {

export class ResolveAbilityAction extends CardGameAction {
name = 'resolveAbility';
defaultProperties: ResolveAbilityProperties = {
defaultProperties: ResolveAbilityProperties = {
ability: null,
ignoredRequirements: [],
subResolution: false
Expand All @@ -106,7 +106,7 @@ export class ResolveAbilityAction extends CardGameAction {
return false;
}
let newContext = ability.createContext(player, newContextEvent);
let ignoredRequirements = properties.ignoredRequirements.concat('player', 'location');
let ignoredRequirements = properties.ignoredRequirements.concat('player', 'location', 'limit');
return !ability.meetsRequirements(newContext, ignoredRequirements);
}

Expand Down
23 changes: 23 additions & 0 deletions test/server/cards/09.5-aCF/KeeperofSecretNames.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,29 @@ describe('Keeper of Secret Names', function() {
expect(this.player2.fate).toBe(p2fate - 2);
});

it('Should be able to trigger after province has been triggered', function() {
this.player1.passConflict();
this.noMoreActions();
this.initiateConflict({
type: 'military',
attackers: [this.p2Keeper],
defenders: [this.p1Keeper],
province: this.vassalFields
});

let p2fate = this.player2.fate;

this.player1.clickCard(this.vassalFields);
expect(this.player2.fate).toBe(p2fate - 1);

this.player2.pass();

this.player1.clickCard(this.p1Keeper);
expect(this.player1).toBeAbleToSelect(this.vassalFields);
this.player1.clickCard(this.vassalFields);
expect(this.player2.fate).toBe(p2fate - 2);
});

it('Riot in the Streets (province has a triggering condition)', function() {
this.initiateConflict({
type: 'military',
Expand Down

0 comments on commit 4d7f608

Please sign in to comment.