[DMU] Implemented Urborg Repossession

This commit is contained in:
Evan Kranzler 2022-08-31 08:25:48 -04:00
parent 2a87790d5c
commit 41afdb11b9
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.u;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.other.AnotherTargetPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetadjustment.TargetAdjuster;
import mage.target.targetpointer.EachTargetPointer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class UrborgRepossession extends CardImpl {
public UrborgRepossession(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}");
// Kicker {1}{G}
this.addAbility(new KickerAbility("{1}{G}"));
// Return target creature card from your graveyard to your hand. You gain 2 life. If this spell was kicked, return another target permanent card from your graveyard to your hand.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()
.setTargetPointer(new EachTargetPointer())
.setText("return target creature card from your graveyard to your hand"));
this.getSpellAbility().addEffect(new GainLifeEffect(2));
this.getSpellAbility().addEffect(new InfoEffect("If this spell was kicked, " +
"return another target permanent card from your graveyard to your hand"));
this.getSpellAbility().setTargetAdjuster(UrborgRepossessionAdjuster.instance);
}
private UrborgRepossession(final UrborgRepossession card) {
super(card);
}
@Override
public UrborgRepossession copy() {
return new UrborgRepossession(this);
}
}
enum UrborgRepossessionAdjuster implements TargetAdjuster {
instance;
private static final FilterCard filter = new FilterPermanentCard("another permanent card from your graveyard");
static {
filter.add(new AnotherTargetPredicate(2));
}
@Override
public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
if (KickedCondition.ONCE.apply(game, ability)) {
ability.addTarget(new TargetCardInYourGraveyard(filter).setTargetTag(2));
}
}
}

View file

@ -238,6 +238,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Tura Kennerud, Skyknight", 224, Rarity.UNCOMMON, mage.cards.t.TuraKennerudSkyknight.class));
cards.add(new SetCardInfo("Twinferno", 149, Rarity.UNCOMMON, mage.cards.t.Twinferno.class));
cards.add(new SetCardInfo("Urborg Lhurgoyf", 186, Rarity.RARE, mage.cards.u.UrborgLhurgoyf.class));
cards.add(new SetCardInfo("Urborg Repossession", 114, Rarity.COMMON, mage.cards.u.UrborgRepossession.class));
cards.add(new SetCardInfo("Urza Assembles the Titans", 37, Rarity.RARE, mage.cards.u.UrzaAssemblesTheTitans.class));
cards.add(new SetCardInfo("Uurg, Spawn of Turg", 225, Rarity.UNCOMMON, mage.cards.u.UurgSpawnOfTurg.class));
cards.add(new SetCardInfo("Valiant Veteran", 38, Rarity.RARE, mage.cards.v.ValiantVeteran.class));