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

class TheTickler extends DrawCard {
    constructor(owner, cardData) {
        super(owner, cardData);

        this.registerEvents(['onDominanceDetermined']);
    }

    onDominanceDetermined(event, player) {
        if(this.kneeled || this.isBlank()) {
            return;
        }

        this.game.promptWithMenu(player, this, {
            activePrompt: {
                menuTitle: 'Trigger ' + this.name + '?',
                buttons: [
                    { text: 'Yes', method: 'kneel' },
                    { text: 'No', method: 'cancel' }
                ]
            },
            waitingPromptTitle: 'Waiting for opponent to use ' + this.name
        });
    }

    kneel(player) {
        player.kneelCard(this);

        var otherPlayer = this.game.getOtherPlayer(player);
        if(!otherPlayer) {
            return true;
        }

        this.topCard = otherPlayer.drawDeck.first();
        otherPlayer.discardFromDraw(1);

        this.game.addMessage('{0} uses {1} to discard the top card of {2}\'s deck', player, this, otherPlayer);

        this.game.promptForSelect(player, {
            activePromptTitle: 'Select a copy of ' + this.topCard.name + ' to discard',
            waitingPromptTitle: 'Waiting for opponent to use ' + this.name,
            cardCondition: card => card.location === 'play area' && card.name === this.topCard.name,
            onSelect: (p, card) => this.onCardSelected(p, card)
        });

        return true;
    }

    onCardSelected(player, card) {
        card.controller.discardCard(card);

        this.game.addMessage('{0} uses {1} to discard a copy of {2} from play', player, this, card);

        return true;
    }

    cancel(player) {
        this.game.addMessage('{0} declines to trigger {1}', player, this);

        return true;
    }
}

TheTickler.code = '01088';

module.exports = TheTickler;
<commit_msg>my controller triggers, not the dominance winner<commit_after>const DrawCard = require('../../../drawcard.js');

class TheTickler extends DrawCard {
    constructor(owner, cardData) {
        super(owner, cardData);

        this.registerEvents(['onDominanceDetermined']);
    }

    onDominanceDetermined(event, player) {
        if(this.kneeled || this.isBlank()) {
            return;
        }

        this.game.promptWithMenu(this.controller, this, {
            activePrompt: {
                menuTitle: 'Trigger ' + this.name + '?',
                buttons: [
                    { text: 'Yes', method: 'kneel' },
                    { text: 'No', method: 'cancel' }
                ]
            },
            waitingPromptTitle: 'Waiting for opponent to use ' + this.name
        });
    }

    kneel(player) {
        player.kneelCard(this);

        var otherPlayer = this.game.getOtherPlayer(player);
        if(!otherPlayer) {
            return true;
        }

        this.topCard = otherPlayer.drawDeck.first();
        otherPlayer.discardFromDraw(1);

        this.game.addMessage('{0} uses {1} to discard the top card of {2}\'s deck', player, this, otherPlayer);

        this.game.promptForSelect(player, {
            activePromptTitle: 'Select a copy of ' + this.topCard.name + ' to discard',
            waitingPromptTitle: 'Waiting for opponent to use ' + this.name,
            cardCondition: card => card.location === 'play area' && card.name === this.topCard.name,
            onSelect: (p, card) => this.onCardSelected(p, card)
        });

        return true;
    }

    onCardSelected(player, card) {
        card.controller.discardCard(card);

        this.game.addMessage('{0} uses {1} to discard a copy of {2} from play', player, this, card);

        return true;
    }

    cancel(player) {
        this.game.addMessage('{0} declines to trigger {1}', player, this);

        return true;
    }
}

TheTickler.code = '01088';

module.exports = TheTickler;

{'fraction_non_alphanumeric': 0.13191273465246067, 'fraction_numerical': 0.007102993404363267, 'mean_word_length': 2.0424382716049383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4730742', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1151, 'n_words': 260}