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

class MaesterOfSunspear extends DrawCard {
    setupCardAbilities() {
        this.reaction({
            when: {
                afterChallenge: (event, challenge) => this.controller === challenge.loser && challenge.isParticipating(this)
            },
            target: {
                activePromptTitle: 'Select an attachment',
                cardCondition: card => card.location === 'play area' && card.getType() === 'attachment'
            },
            handler: context => {
                context.target.owner.returnToHand(context.target);
                this.game.addMessage('{0} uses {1} to return {2} to its owner\'s hand',
                                      this.controller, this, context.target);
            }
        });
    }
}

MaesterOfSunspear.code = '06055';

module.exports = MaesterOfSunspear;<commit_msg>Fix Maester of Sunspear (#995)<commit_after>const DrawCard = require('../../../drawcard.js');

class MaesterOfSunspear extends DrawCard {
    setupCardAbilities() {
        this.reaction({
            when: {
                afterChallenge: (event, challenge) => this.controller === challenge.loser && challenge.isParticipating(this)
            },
            target: {
                activePromptTitle: 'Select an attachment',
                cardCondition: card => card.location === 'play area' && card.getType() === 'attachment'
            },
            handler: context => {
                context.target.owner.returnCardToHand(context.target);
                this.game.addMessage('{0} uses {1} to return {2} to its owner\'s hand',
                                      this.controller, this, context.target);
            }
        });
    }
}

MaesterOfSunspear.code = '06055';

module.exports = MaesterOfSunspear;
{'fraction_non_alphanumeric': 0.13067249863313285, 'fraction_numerical': 0.01038819026790596, 'mean_word_length': 1.9001584786053882, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2554818', 'n_tokens_mistral': 508, 'n_tokens_neox': 480, 'n_words': 99}