Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions Mage.Sets/src/mage/cards/a/AntiquitiesOnTheLoose.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package mage.cards.a;

import java.util.Optional;
import java.util.UUID;

import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.token.Spirit22RedWhiteToken;
import mage.game.stack.Spell;

/**
*
* @author muz
*/
public final class AntiquitiesOnTheLoose extends CardImpl {

public AntiquitiesOnTheLoose(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");

// Create two 2/2 red and white Spirit creature tokens. Then if this spell was cast from anywhere other than your hand, put a +1/+1 counter on each Spirit you control.
this.getSpellAbility().addEffect(new CreateTokenEffect(new Spirit22RedWhiteToken(), 2));
this.getSpellAbility().addEffect(new AntiquitiesOnTheLooseEffect());

// Flashback {4}{W}{W}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{W}{W}")));
}

private AntiquitiesOnTheLoose(final AntiquitiesOnTheLoose card) {
super(card);
}

@Override
public AntiquitiesOnTheLoose copy() {
return new AntiquitiesOnTheLoose(this);
}
}

class AntiquitiesOnTheLooseEffect extends OneShotEffect {

private static final FilterPermanent filter = new FilterControlledPermanent(SubType.SPIRIT, "Spirit you control");

AntiquitiesOnTheLooseEffect() {
super(Outcome.Benefit);
staticText = "then if this spell was cast from anywhere other than your hand, "
+ "put two +1/+1 counters on each Spirit you control";
}

private AntiquitiesOnTheLooseEffect(final AntiquitiesOnTheLooseEffect effect) {
super(effect);
}

@Override
public AntiquitiesOnTheLooseEffect copy() {
return new AntiquitiesOnTheLooseEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Spell spell = Optional
.ofNullable(source.getSourceObjectIfItStillExists(game))
.filter(Spell.class::isInstance)
.map(Spell.class::cast)
.orElse(null);
if (spell != null && !Zone.HAND.match(spell.getFromZone())) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably use a condition like 'CastFromGraveyardSourceCondition' instead of a custom effect

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think any of the existing conditions are appropriate, because technically one could exile this and cast it from there; and still get this effect with how it's worded currently.

We have conditions that explicitly check it was cast from hand, or from graveyard.

In terms of cards that use the cast rom anywhere other than your hand, I count only 3; this, Otterball Antics, and See the Truth

new AddCountersAllEffect(CounterType.P1P1.createInstance(2), filter).apply(game, source);
}

return true;
}
}
2 changes: 2 additions & 0 deletions Mage.Sets/src/mage/sets/SecretsOfStrixhaven.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private SecretsOfStrixhaven() {
cards.add(new SetCardInfo("Ambitious Augmenter", 140, Rarity.RARE, mage.cards.a.AmbitiousAugmenter.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Ambitious Augmenter", 337, Rarity.RARE, mage.cards.a.AmbitiousAugmenter.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Ancestral Anger", 106, Rarity.COMMON, mage.cards.a.AncestralAnger.class));
cards.add(new SetCardInfo("Antiquities on the Loose", 7, Rarity.RARE, mage.cards.a.AntiquitiesOnTheLoose.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Antiquities on the Loose", 308, Rarity.RARE, mage.cards.a.AntiquitiesOnTheLoose.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Applied Geometry", 172, Rarity.RARE, mage.cards.a.AppliedGeometry.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Applied Geometry", 343, Rarity.RARE, mage.cards.a.AppliedGeometry.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Arcane Omens", 73, Rarity.UNCOMMON, mage.cards.a.ArcaneOmens.class));
Expand Down
Loading