{"size": 947, "ext": "js", "max_stars_repo_path": "server/game/cards/11.2-TMoW/MarchOnWinterfell.js", "max_stars_repo_name": "Bullgator351/throneteki", "max_stars_repo_stars_event_min_datetime": "2016-11-06T15:14:28.000Z", "max_stars_repo_stars_event_max_datetime": "2018-05-14T21:12:36.000Z", "max_issues_repo_path": "server/game/cards/11.2-TMoW/MarchOnWinterfell.js", "max_issues_repo_name": "Bullgator351/throneteki", "max_issues_repo_issues_event_min_datetime": "2016-11-07T01:07:55.000Z", "max_issues_repo_issues_event_max_datetime": "2018-05-16T09:12:57.000Z", "max_forks_repo_path": "server/game/cards/11.2-TMoW/MarchOnWinterfell.js", "max_forks_repo_name": "Bullgator351/throneteki", "max_forks_repo_forks_event_min_datetime": "2016-11-06T15:14:38.000Z", "max_forks_repo_forks_event_max_datetime": "2018-04-23T10:34:19.000Z"}
{"max_stars_count": 49, "max_issues_count": 831, "max_forks_count": 54, "avg_line_length": 35.0740740741, "max_line_length": 121, "alphanum_fraction": 0.5776135164}
const DrawCard = require('../../drawcard');

class MarchOnWinterfell extends DrawCard {
    setupCardAbilities() {
        this.action({
            title: 'End the challenge',
            condition: () => this.game.isDuringChallenge({ attackingPlayer: this.controller }),
            handler: context => {
                this.game.currentChallenge.cancelChallenge();

                this.untilEndOfPhase(ability => ({
                    targetController: 'current',
                    effect: ability.effects.mayInitiateAdditionalChallenge('power')
                }));

                this.game.addMessage('{0} plays {1} to end this challenge with no winner or loser',
                    context.player, this);
                this.game.addMessage('{0} may initiate an additional {1} challenge this phase', context.player, 'power');
            }
        });
    }
}

MarchOnWinterfell.code = '11028';

module.exports = MarchOnWinterfell;
