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

class TheWatchHasNeed extends DrawCard {
    setupCardAbilities() {
        this.action({
            title: 'Search for a character',
            handler: () => {
                this.game.promptWithMenu(this.controller, this, {
                    activePrompt: {
                        menuTitle: 'Select a trait',
                        buttons: [
                            { text: 'Builder', method: 'setTrait', arg: 'Builder' },
                            { text: 'Ranger', method: 'setTrait', arg: 'Ranger' },
                            { text: 'Steward', method: 'setTrait', arg: 'Steward' },
                            { text: 'Cancel', method: 'cancelTraitSelection' }
                        ]
                    },
                    source: this
                });
            }
        });
    }

    setTrait(player, trait) {
        let reserve = player.getTotalReserve();<commit_msg>Prevent Watch Has Need when player has 0 reserve (#2439)<commit_after>const DrawCard = require('../../drawcard.js');

class TheWatchHasNeed extends DrawCard {
    setupCardAbilities() {
        this.action({
            title: 'Search for a character',
            condition: () => this.controller.getTotalReserve() > 0,
            handler: () => {
                this.game.promptWithMenu(this.controller, this, {
                    activePrompt: {
                        menuTitle: 'Select a trait',
                        buttons: [
                            { text: 'Builder', method: 'setTrait', arg: 'Builder' },
                            { text: 'Ranger', method: 'setTrait', arg: 'Ranger' },
                            { text: 'Steward', method: 'setTrait', arg: 'Steward' },
                            { text: 'Cancel', method: 'cancelTraitSelection' }
                        ]
                    },
                    source: this
                });
            }
        });
    }

    setTrait(player, trait) {
        let reserve = player.getTotalReserve();
{'fraction_non_alphanumeric': 0.12348079727758872, 'fraction_numerical': 0.002916869227029655, 'mean_word_length': 1.271523178807947, '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': '4143965', 'n_tokens_mistral': 527, 'n_tokens_neox': 500, 'n_words': 115}