Пример #1
0
  public WheelOfSunAndMoon(UUID ownerId) {
    super(
        ownerId,
        243,
        "Wheel of Sun and Moon",
        Rarity.RARE,
        new CardType[] {CardType.ENCHANTMENT},
        "{G/W}{G/W}");
    this.expansionSetCode = "SHM";
    this.subtype.add("Aura");

    // Enchant player
    TargetPlayer auraTarget = new TargetPlayer();
    this.getSpellAbility().addTarget(auraTarget);
    this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
    this.addAbility(new EnchantAbility(auraTarget.getTargetName()));

    // If a card would be put into enchanted player's graveyard from anywhere, instead that card is
    // revealed and put on the bottom of that player's library.
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WheelOfSunAndMoonEffect()));
  }
Пример #2
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player player = game.getPlayer(source.getControllerId());
   Permanent permanent = game.getPermanent(source.getSourceId());
   if (player != null && permanent != null) {
     TargetPlayer target = new TargetPlayer();
     target.setRequired(true);
     if (player.choose(this.outcome, target, source.getSourceId(), game)) {
       Player chosenPlayer = game.getPlayer(target.getFirstTarget());
       if (chosenPlayer != null) {
         game.informPlayers(
             permanent.getName()
                 + ": "
                 + player.getName()
                 + " has chosen "
                 + chosenPlayer.getName());
         game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget());
         return true;
       }
     }
   }
   return false;
 }
Пример #3
0
  public InfectiousCurse(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.ENCHANTMENT}, "");
    this.subtype.add("Aura");
    this.subtype.add("Curse");
    this.color.setBlack(true);

    this.nightCard = true;
    this.transformable = true;

    // Enchant player
    TargetPlayer auraTarget = new TargetPlayer();
    this.getSpellAbility().addTarget(auraTarget);
    this.getSpellAbility().addEffect(new AttachEffect(Outcome.Damage));
    this.addAbility(new EnchantAbility(auraTarget.getTargetName()));

    // Spells you cast that target enchanted player cost {1} less to cast.
    this.addAbility(
        new SimpleStaticAbility(Zone.BATTLEFIELD, new InfectiousCurseCostReductionEffect()));
    // At the beginning of enchanted player's upkeep, that player loses 1 life and you gain 1 life.
    InfectiousCurseAbility curseAbility = new InfectiousCurseAbility();
    curseAbility.addEffect(new GainLifeEffect(1));
    this.addAbility(curseAbility);
  }