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

Commit

Permalink
BotK: Shiotome Encampment (#2070)
Browse files Browse the repository at this point in the history
* Implements Shiotome Encampment

* Removed debugging
  • Loading branch information
NoahTheDuke authored and jeremylarner committed Jun 26, 2018
1 parent b4639aa commit a99cef6
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
@@ -1,7 +1,7 @@
{
"env": {
"node": true,
"es6": true
"es6": true
},
"extends": "eslint:recommended",
"rules": {
Expand Down
19 changes: 17 additions & 2 deletions server/game/cards/04.1-BotK/ShiotomeEncampment.js
@@ -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;
1 change: 0 additions & 1 deletion test/server/cards/01-Core/Ambush.spec.js
Expand Up @@ -28,7 +28,6 @@ describe('Ambush', function() {
describe('When playing Ambush', function() {
beforeEach(function() {
this.player2.clickCard(this.ambush, 'hand');

});

it('should not allow the player to select more than 2 characters', function() {
Expand Down
55 changes: 55 additions & 0 deletions test/server/cards/04.1-BotK/ShiotomeEncampment.spec.js
@@ -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);
});
});
});
});
2 changes: 1 addition & 1 deletion tsconfig.json
Expand Up @@ -11,7 +11,7 @@
"allowJs": true,
"checkJs": true,
"lib": [
"es2016"
"es2017"
]
},
"exclude": [
Expand Down

0 comments on commit a99cef6

Please sign in to comment.