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

class UndergroundVault extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Kneel this card to gain gold',
            phase: 'marshal',
            cost: ability.costs.kneelSelf(),
            handler: context => {
                let opponent = this.game.getOtherPlayer(this.controller);
                let gold = opponent && opponent.activePlot.getIncome() >= 5 ? 2 : 1;

                this.game.addGold(context.player, gold);
                this.game.addMessage('{0} kneels {1} to gain {2} gold', context.player, this, gold);
            }
        });
    }
}

UndergroundVault.code = '06046';

module.exports = UndergroundVault;<commit_msg>make Undeground Vault work in solo games (#1037)<commit_after>const DrawCard = require('../../../drawcard.js');

class UndergroundVault extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Kneel this card to gain gold',
            phase: 'marshal',
            cost: ability.costs.kneelSelf(),
            handler: context => {
                let opponent = this.game.getOtherPlayer(this.controller);
                if(!opponent) {
                    return;
                }
                let gold = opponent && opponent.activePlot.getIncome() >= 5 ? 2 : 1;

                this.game.addGold(context.player, gold);
                this.game.addMessage('{0} kneels {1} to gain {2} gold', context.player, this, gold);
            }
        });
    }
}

UndergroundVault.code = '06046';

module.exports = UndergroundVault;
{'fraction_non_alphanumeric': 0.12968653964351567, 'fraction_numerical': 0.015980331899200985, 'mean_word_length': 1.9708029197080292, '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': '3308322', 'n_tokens_mistral': 485, 'n_tokens_neox': 446, 'n_words': 104}