public AngrathsFury(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}{R}"); // Destroy target creature. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Angrath's Fury deals 3 damage to target player. this.getSpellAbility().addEffect(new DamageTargetEffect(3).setTargetPointer(new SecondTargetPointer()) .setText("{this} deals 3 damage to target player or planeswalker")); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); // You may search your library and/or graveyard for a card named Angrath, Minotaur Pirate, reveal it, and put it into your hand. If you search your library this way, shuffle it. this.getSpellAbility().addEffect(new SearchLibraryGraveyardPutInHandEffect(filter) .setText("You may search your library and/or graveyard for a card named Angrath, Minotaur Pirate, reveal it, and put it into your hand. If you search your library this way, shuffle it")); }
@Override public boolean apply(Game game, Ability source) { Permanent errantMinion = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (errantMinion == null) { return false; } Permanent enchantedCreature = game.getPermanentOrLKIBattlefield(errantMinion.getAttachedTo()); if (enchantedCreature == null) { return false; } Player controllerOfEnchantedCreature = game.getPlayer(enchantedCreature.getControllerId()); if (controllerOfEnchantedCreature != null) { int manaPaid = playerPaysXGenericMana(controllerOfEnchantedCreature, source, game); PreventDamageToTargetEffect effect = new PreventDamageToTargetEffect(Duration.OneUse, manaPaid); effect.setTargetPointer(new FixedTarget(controllerOfEnchantedCreature.getId())); game.addEffect(effect, source); DamageTargetEffect effect2 = new DamageTargetEffect(2); effect2.setTargetPointer(new FixedTarget(controllerOfEnchantedCreature.getId())); effect2.apply(game, source); return true; } return false; }