forked from magefree/mage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MH3] Implement Flare of Cultivation
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,51 @@ | ||
package mage.cards.f; | ||
|
||
import mage.ObjectColor; | ||
import mage.abilities.costs.AlternativeCostSourceAbility; | ||
import mage.abilities.costs.common.SacrificeTargetCost; | ||
import mage.abilities.effects.common.search.SearchLibraryPutOneOntoBattlefieldTappedRestInHandEffect; | ||
import mage.cards.CardImpl; | ||
import mage.cards.CardSetInfo; | ||
import mage.constants.CardType; | ||
import mage.filter.FilterPermanent; | ||
import mage.filter.StaticFilters; | ||
import mage.filter.common.FilterControlledCreaturePermanent; | ||
import mage.filter.predicate.mageobject.ColorPredicate; | ||
import mage.filter.predicate.permanent.TokenPredicate; | ||
import mage.target.common.TargetCardInLibrary; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* @author TheElk801 | ||
*/ | ||
public final class FlareOfCultivation extends CardImpl { | ||
|
||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("nontoken green creature"); | ||
|
||
static { | ||
filter.add(TokenPredicate.FALSE); | ||
filter.add(new ColorPredicate(ObjectColor.GREEN)); | ||
} | ||
|
||
public FlareOfCultivation(UUID ownerId, CardSetInfo setInfo) { | ||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); | ||
|
||
// You may sacrifice a nontoken green creature rather than pay this spell's mana cost. | ||
this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(filter)).setRuleAtTheTop(true)); | ||
|
||
// Search your library for up to two basic land cards, reveal those cards, put one onto the battlefield tapped and the other into your hand, then shuffle. | ||
this.getSpellAbility().addEffect(new SearchLibraryPutOneOntoBattlefieldTappedRestInHandEffect( | ||
new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LANDS) | ||
)); | ||
} | ||
|
||
private FlareOfCultivation(final FlareOfCultivation card) { | ||
super(card); | ||
} | ||
|
||
@Override | ||
public FlareOfCultivation copy() { | ||
return new FlareOfCultivation(this); | ||
} | ||
} |
This file contains 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