-
Notifications
You must be signed in to change notification settings - Fork 895
[SOS] Implement Antiquities on the Loose #14731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+86
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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())) { | ||
| new AddCountersAllEffect(CounterType.P1P1.createInstance(2), filter).apply(game, source); | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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