[ONE]Implement Against All Odds (#9919)

* Added Against All Odds

* Added Against All Odds

* Card tested and works as intended

* Filter text changed and min/max modes added.

---------

Co-authored-by: AhmadYProjects <yousufa@kean.edu>
Co-authored-by: Evan Kranzler <theelk801@gmail.com>
This commit is contained in:
AhmadYProjects 2023-04-19 09:54:13 -04:00 committed by GitHub
parent c99350554e
commit bbc41317eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,67 @@
package mage.cards.a;
import mage.abilities.Mode;
import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
*
* @author AhmadYProjects
*/
public final class AgainstAllOdds extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact or creature card you control");
private static final FilterCard filter2 = new FilterCard("artifact or creature card with mana value 3 or less from your graveyard");
static{
filter.add(Predicates.or(
CardType.CREATURE.getPredicate(),
CardType.ARTIFACT.getPredicate()
));
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, 4));
filter2.add(new ManaValuePredicate(ComparisonType.FEWER_THAN,4));
filter2.add(Predicates.or(
CardType.CREATURE.getPredicate(),
CardType.ARTIFACT.getPredicate()
));
}
public AgainstAllOdds(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}");
// Choose one or both --
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
// * Exile target artifact or creature you control, then return it to the battlefield under its owner's control.
this.getSpellAbility().addTarget(new TargetControlledPermanent(filter));
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect());
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false,
false,"it").concatBy(", then"));
// * Return target artifact or creature card with mana value 3 or less from your graveyard to the battlefield.
Mode mode2 = new Mode(new ReturnFromGraveyardToBattlefieldTargetEffect());
mode2.addTarget(new TargetCardInYourGraveyard(filter2));
this.getSpellAbility().addMode(mode2);
}
private AgainstAllOdds(final AgainstAllOdds card) {
super(card);
}
@Override
public AgainstAllOdds copy() {
return new AgainstAllOdds(this);
}
}

View file

@ -21,6 +21,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
this.hasBoosters = false; // temporary
cards.add(new SetCardInfo("Adaptive Sporesinger", 157, Rarity.COMMON, mage.cards.a.AdaptiveSporesinger.class));
cards.add(new SetCardInfo("Against All Odds", 1, Rarity.UNCOMMON, mage.cards.a.AgainstAllOdds.class));
cards.add(new SetCardInfo("All Will Be One", 118, Rarity.MYTHIC, mage.cards.a.AllWillBeOne.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("All Will Be One", 352, Rarity.MYTHIC, mage.cards.a.AllWillBeOne.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Ambulatory Edifice", 79, Rarity.UNCOMMON, mage.cards.a.AmbulatoryEdifice.class));