{"size": 1582, "ext": "js", "max_stars_repo_path": "server/game/cards/04.4-TEaF/DeceptiveOffer.js", "max_stars_repo_name": "CodeBaboon/ringteki", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/game/cards/04.4-TEaF/DeceptiveOffer.js", "max_issues_repo_name": "CodeBaboon/ringteki", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/game/cards/04.4-TEaF/DeceptiveOffer.js", "max_forks_repo_name": "CodeBaboon/ringteki", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.5853658537, "max_line_length": 144, "alphanum_fraction": 0.4791403287}
const DrawCard = require('../../drawcard.js');

class DeceptiveOffer extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Increase a character\'s military and political skill or take an honor from your opponent',
            targets: {
                character: {
                    cardType: 'character',
                    controller: 'self',
                    cardCondition: card => card.isParticipating()
                },
                select: {
                    mode: 'select',
                    dependsOn: 'character',
                    player: 'opponent',
                    choices: {
                        'Allow your opponent\'s character to gain military and political skill': ability.actions.cardLastingEffect(context => ({
                            target: context.targets.character,
                            duration: 'untilEndOfConflict',
                            effect: ability.effects.modifyBothSkills(2)
                        })),
                        'Give your opponent 1 honor': ability.actions.takeHonor()
                    }
                }
            },
            effect: '{1}{2}',
            effectArgs: context => {
                if(context.selects.select.choice === 'Give your opponent 1 honor') {
                    return ['take 1 honor from ', context.player.opponent];
                }
                return ['give +2/+2 to ', context.targets.character];
            }
        });
    }
}

DeceptiveOffer.id = 'deceptive-offer';

module.exports = DeceptiveOffer;
