implement [EOE] Seedship Impact

This commit is contained in:
Susucre 2025-07-09 21:25:15 +02:00
parent a75a95a7f1
commit 5b58f07196
4 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,53 @@
package mage.cards.s;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.SourceTargetsPermanentCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.permanent.token.LanderToken;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author Susucr
*/
public final class SeedshipImpact extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(new ManaValuePredicate(ComparisonType.OR_LESS, 2));
}
private static final Condition condition = new SourceTargetsPermanentCondition(filter);
public SeedshipImpact(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Destroy target artifact or enchantment. If its mana value was 2 or less, create a Lander token.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new CreateTokenEffect(new LanderToken()), condition,
"If its mana value was 2 or less, create a Lander token. " + LanderToken.getReminderText()
));
}
private SeedshipImpact(final SeedshipImpact card) {
super(card);
}
@Override
public SeedshipImpact copy() {
return new SeedshipImpact(this);
}
}

View file

@ -112,6 +112,7 @@ public final class EdgeOfEternities extends ExpansionSet {
cards.add(new SetCardInfo("Sami, Ship's Engineer", 225, Rarity.UNCOMMON, mage.cards.s.SamiShipsEngineer.class)); cards.add(new SetCardInfo("Sami, Ship's Engineer", 225, Rarity.UNCOMMON, mage.cards.s.SamiShipsEngineer.class));
cards.add(new SetCardInfo("Sami, Wildcat Captain", 226, Rarity.MYTHIC, mage.cards.s.SamiWildcatCaptain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sami, Wildcat Captain", 226, Rarity.MYTHIC, mage.cards.s.SamiWildcatCaptain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Sami, Wildcat Captain", 301, Rarity.MYTHIC, mage.cards.s.SamiWildcatCaptain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sami, Wildcat Captain", 301, Rarity.MYTHIC, mage.cards.s.SamiWildcatCaptain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Seedship Impact", 205, Rarity.UNCOMMON, mage.cards.s.SeedshipImpact.class));
cards.add(new SetCardInfo("Shattered Wings", 206, Rarity.COMMON, mage.cards.s.ShatteredWings.class)); cards.add(new SetCardInfo("Shattered Wings", 206, Rarity.COMMON, mage.cards.s.ShatteredWings.class));
cards.add(new SetCardInfo("Singularity Rupture", 228, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Singularity Rupture", 228, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Singularity Rupture", 350, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Singularity Rupture", 350, Rarity.RARE, mage.cards.s.SingularityRupture.class, NON_FULL_USE_VARIOUS));

View file

@ -0,0 +1,53 @@
package org.mage.test.cards.single.eoe;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class SeedshipImpactTest extends CardTestPlayerBase {
/**
* {@link mage.cards.s.SeedshipImpact Seedship Impact} {1}{G}
* Instant
* Destroy target artifact or enchantment. If its mana value was 2 or less, create a Lander token.
* (It's an artifact with "{2}, {T}, Sacrifice this token: Search your library for a basic land card,
* put it onto the battlefield tapped, then shuffle.")
*/
private static final String impact = "Seedship Impact";
@Test
public void test_NoLander() {
addCard(Zone.HAND, playerA, impact);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerB, "Crucible of Worlds"); // {3}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, impact, "Crucible of Worlds");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setStrictChooseMode(true);
execute();
assertGraveyardCount(playerB, "Crucible of Worlds", 1);
assertPermanentCount(playerA, "Lander Token", 0);
}
@Test
public void test_Lander() {
addCard(Zone.HAND, playerA, impact);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerB, "Anthem of Champions"); // {W}{G}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, impact, "Anthem of Champions");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setStrictChooseMode(true);
execute();
assertGraveyardCount(playerB, "Anthem of Champions", 1);
assertPermanentCount(playerA, "Lander Token", 1);
}
}

View file

@ -16,6 +16,12 @@ import mage.target.common.TargetCardInLibrary;
*/ */
public final class LanderToken extends TokenImpl { public final class LanderToken extends TokenImpl {
public static String getReminderText() {
return "<i>(It's an artifact with \"{2}, {T}, Sacrifice this token: "
+ "Search your library for a basic land card, put it onto the "
+ "battlefield tapped, then shuffle.\")</i>";
}
public LanderToken() { public LanderToken() {
super("Lander Token", "Lander token"); super("Lander Token", "Lander token");
cardType.add(CardType.ARTIFACT); cardType.add(CardType.ARTIFACT);