This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implements Shiotome Encampment * Removed debugging
- Loading branch information
1 parent
b4639aa
commit a99cef6
Showing
5 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
"es6": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"rules": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
const DrawCard = require('../../drawcard.js'); | ||
|
||
class ShiotomeEncampment extends DrawCard { | ||
setupCardAbilities(ability) { // eslint-disable-line no-unused-vars | ||
setupCardAbilities(ability) { | ||
this.action({ | ||
title: 'Ready a Cavalry character', | ||
effect: 'ready a Cavalry character', | ||
condition: context => | ||
Object.values(this.game.rings).some( | ||
ring => | ||
ring.isConsideredClaimed(context.player) && | ||
ring.isConflictType('military') | ||
), | ||
target: { | ||
cardType: 'character', | ||
cardCondition: card => card.hasTrait('cavalry'), | ||
gameAction: ability.actions.ready() | ||
} | ||
}); | ||
} | ||
} | ||
|
||
ShiotomeEncampment.id = 'shiotome-encampment'; // This is a guess at what the id might be - please check it!!! | ||
ShiotomeEncampment.id = 'shiotome-encampment'; | ||
|
||
module.exports = ShiotomeEncampment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe('Shiotome Encampment', function() { | ||
integration(function() { | ||
beforeEach(function() { | ||
this.setupTest({ | ||
phase: 'conflict', | ||
player1: { | ||
dynastyDeck: ['shiotome-encampment'], | ||
inPlay: ['miya-mystic', 'aggressive-moto'] | ||
} | ||
}); | ||
this.shiotomeEncampment = this.player1.placeCardInProvince( | ||
'shiotome-encampment', | ||
'province 1' | ||
); | ||
this.miyaMystic = this.player1.findCardByName('miya-mystic'); | ||
this.aggressiveMoto = this.player1.findCardByName('aggressive-moto'); | ||
this.miyaMystic.bow(); | ||
this.aggressiveMoto.bow(); | ||
}); | ||
|
||
describe('Using Shiotome Encampment', function() { | ||
it('shouldn\'t work if there is no claimed ring', function() { | ||
this.player1.clickCard(this.shiotomeEncampment); | ||
expect(this.player1).toHavePrompt('Initiate an action'); | ||
}); | ||
|
||
it('shouldn\'t work if the only claimed ring is political', function() { | ||
this.game.rings.earth.claimRing(this.player1); | ||
this.player1.clickCard(this.shiotomeEncampment); | ||
expect(this.player1).toHavePrompt('Initiate an action'); | ||
}); | ||
|
||
it('should work if at least one claimed ring is military', function() { | ||
this.game.rings.air.claimRing(this.player1); | ||
this.game.rings.earth.claimRing(this.player1); | ||
this.player1.clickCard(this.shiotomeEncampment); | ||
expect(this.player1).toHavePrompt('Choose a character'); | ||
}); | ||
|
||
it('should only target cavalry characters', function() { | ||
this.game.rings.air.claimRing(this.player1); | ||
this.player1.clickCard(this.shiotomeEncampment); | ||
expect(this.player1).toBeAbleToSelect(this.aggressiveMoto); | ||
expect(this.player1).not.toBeAbleToSelect(this.miyaMystic); | ||
}); | ||
|
||
it('should ready bowed character', function() { | ||
this.game.rings.air.claimRing(this.player1); | ||
this.player1.clickCard(this.shiotomeEncampment); | ||
this.player1.clickCard(this.aggressiveMoto); | ||
expect(this.aggressiveMoto.bowed).not.toBe(true); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"allowJs": true, | ||
"checkJs": true, | ||
"lib": [ | ||
"es2016" | ||
"es2017" | ||
] | ||
}, | ||
"exclude": [ | ||
|