<commit_before>const BaseAbility = require('./baseability.js');
const Costs = require('./costs.js');

class PlayAttachmentAction extends BaseAbility {
    constructor() {
        super({
            cost: [
                Costs.payReduceableFateCost('play'),
                Costs.playLimited()
            ] 
        });
        this.title = 'PlayAttachmentAction';
        this.targets = { 
            target: {
                cardCondition: this.cardCondition
            }
        };
    }
    
    cardCondition(card, context) {
        return context.source.owner.canAttach(context.source, card);
    }

    meetsRequirements(context) {
        var {game, player, source} = context;
        let currentPrompt = player.currentPrompt();
        if(currentPrompt.promptTitle === undefined) {
            return false;
        }

        return (
            game.currentPhase !== 'dynasty' &&
            source.getType() === 'attachment' &&
            source.location === 'hand' &&
            currentPrompt.promptTitle.includes('Action Window')
        );
    }

    executeHandler(context) {
        let targetPlayer = context.target.controller;
        targetPlayer.attach(context.player, context.source, context.target, 'play');
    }

    isCardAbility() {
        return false;
    }
}

module.exports = PlayAttachmentAction;
<commit_msg>meetsRequirements change<commit_after>const BaseAbility = require('./baseability.js');
const Costs = require('./costs.js');

class PlayAttachmentAction extends BaseAbility {
    constructor() {
        super({
            cost: [
                Costs.payReduceableFateCost('play'),
                Costs.playLimited()
            ] 
        });
        this.title = 'PlayAttachmentAction';
        this.targets = { 
            target: {
                cardCondition: this.cardCondition
            }
        };
    }
    
    cardCondition(card, context) {
        return context.source.owner.canAttach(context.source, card);
    }

    meetsRequirements(context) {
        var {game, player, source} = context;

        return (
            game.currentPhase !== 'dynasty' &&
            source.getType() === 'attachment' &&
            source.location === 'hand' &&
            game.currentActionWindow &&
            game.currentActionWindow.currentPlayer === player &&
            game.abilityCardStack.length === 1
        );
    }

    executeHandler(context) {
        let targetPlayer = context.target.controller;
        targetPlayer.attach(context.player, context.source, context.target, 'play');
    }

    isCardAbility() {
        return false;
    }
}

module.exports = PlayAttachmentAction;

{'fraction_non_alphanumeric': 0.1176249530251785, 'fraction_numerical': 0.0003757985719654265, 'mean_word_length': 1.9544950055493895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6183464', 'n_tokens_mistral': 711, 'n_tokens_neox': 695, 'n_words': 119}