text: const DrawCard = require('../../drawcard.js');
  
  class MaidenOfPoisons extends DrawCard {
      setupCardAbilities(ability) {
          this.reaction({
              when: {
                  afterChallenge: event => event.challenge.loser === this.controller && this.isParticipating()
              },
              cost: ability.costs.sacrificeSelf(),
              target: {
                  cardCondition: card => card.location === 'play area' && card.getType() === 'character' &&
                                         card.isParticipating() && card.getNumberOfIcons() < 2
              },
              handler: context => {
                  context.target.owner.returnCardToHand(context.target);
                  this.game.addMessage('{0} sacrifices {1} to return {2} to {3}\'s hand',
                      context.player, this, context.target, context.target.owner);
              }
          });
      }
  }
  
  MaidenOfPoisons.code = '11035';
  
  module.exports = MaidenOfPoisons;
  