<commit_before>const DrawCard = require('../../../drawcard.js');

class PlazaOfPride extends DrawCard {

    setupCardAbilities(ability) {
        this.action({
            title: 'Stand a character',
            cost: [
                ability.costs.kneelSelf(),
                ability.costs.discardFromHand()
            ],
            handler: context => {
                this.game.promptForSelect(this.controller, {
                    activePromptTitle: 'Select character',
                    source: this,
                    cardCondition: card =>
                        card.location === 'play area'
                        && card.getType() === 'character'
                        && card.kneeled
                        && card.getCost() <= context.discardCostCard.getCost() + 3,
                    onSelect: (player, card) => this.onCardSelected(player, card, context.discardCardCost)
                });
            }
        });
    }

    onCardSelected(player, card, discardedCard) {
        player.standCard(card);

        this.game.addMessage('{0} kneels {1} and discard {2} to stand {3}',
                             this.controller, this, discardedCard, card);

        return true;
    }

}

PlazaOfPride.code = '07036';

module.exports = PlazaOfPride;<commit_msg>bug fix: avoid null discarded card in Plaza of Pride message (#888)<commit_after>const DrawCard = require('../../../drawcard.js');

class PlazaOfPride extends DrawCard {

    setupCardAbilities(ability) {
        this.action({
            title: 'Stand a character',
            cost: [
                ability.costs.kneelSelf(),
                ability.costs.discardFromHand()
            ],
            handler: context => {
                this.game.promptForSelect(this.controller, {
                    activePromptTitle: 'Select character',
                    source: this,
                    cardCondition: card =>
                        card.location === 'play area'
                        && card.getType() === 'character'
                        && card.kneeled
                        && card.getCost() <= context.discardCostCard.getCost() + 3,
                    onSelect: (player, card) => this.onCardSelected(player, card, context.discardCostCard)
                });
            }
        });
    }

    onCardSelected(player, card, discardedCard) {
        player.standCard(card);

        this.game.addMessage('{0} kneels {1} and discard {2} to stand {3}',
                             this.controller, this, discardedCard, card);

        return true;
    }

}

PlazaOfPride.code = '07036';

module.exports = PlazaOfPride;
{'fraction_non_alphanumeric': 0.11836115326251896, 'fraction_numerical': 0.008725341426403643, 'mean_word_length': 1.5355769230769232, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425834', 'n_tokens_mistral': 725, 'n_tokens_neox': 668, 'n_words': 138}