diff --git a/Mage.Sets/src/mage/cards/h/HydroManFluidFelon.java b/Mage.Sets/src/mage/cards/h/HydroManFluidFelon.java new file mode 100644 index 00000000000..a79b76e2aff --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HydroManFluidFelon.java @@ -0,0 +1,116 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterSpell; +import mage.filter.StaticFilters; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.awt.*; +import java.util.UUID; + +/** + * + * @author Jmlundeen + */ +public final class HydroManFluidFelon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a blue spell"); + + private static final Condition condition = new SourceMatchesFilterCondition( + "this {this} is a creature", StaticFilters.FILTER_PERMANENT_CREATURE + ); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public HydroManFluidFelon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ELEMENTAL); + this.subtype.add(SubType.VILLAIN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast a blue spell, if Hydro-Man is a creature, he gets +1/+1 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility( + new BoostSourceEffect(1, 1, Duration.EndOfTurn), filter,false) + .withInterveningIf(condition).withRuleTextReplacement(true)); + + // At the beginning of your end step, untap Hydro-Man. Until your next turn, he becomes a land and gains "{T}: Add {U}." + Ability ability = new BeginningOfEndStepTriggeredAbility(new UntapSourceEffect()); + ability.addEffect(new HydroManFluidFelonEffect()); + this.addAbility(ability); + } + + private HydroManFluidFelon(final HydroManFluidFelon card) { + super(card); + } + + @Override + public HydroManFluidFelon copy() { + return new HydroManFluidFelon(this); + } +} +class HydroManFluidFelonEffect extends ContinuousEffectImpl { + + public HydroManFluidFelonEffect() { + super(Duration.UntilYourNextTurn, Outcome.Neutral); + this.staticText = "Until your next turn, he becomes a land and gains \"{T}: Add {U}.\""; + this.addDependencyType(DependencyType.BecomeNonbasicLand); + } + + protected HydroManFluidFelonEffect(final HydroManFluidFelonEffect effect) { + super(effect); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null) { + return false; + } + switch (layer) { + case TypeChangingEffects_4: + permanent.removeAllCardTypes(game); + permanent.removeAllCreatureTypes(game); + permanent.addCardType(game, CardType.LAND); + break; + case AbilityAddingRemovingEffects_6: + permanent.addAbility(new BlueManaAbility(), source.getSourceId(), game); + break; + } + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 || layer == Layer.AbilityAddingRemovingEffects_6; + } + + @Override + public HydroManFluidFelonEffect copy() { + return new HydroManFluidFelonEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java index 52ccb2b3f10..2718485d3f5 100644 --- a/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java +++ b/Mage.Sets/src/mage/sets/MarvelsSpiderMan.java @@ -78,6 +78,8 @@ public final class MarvelsSpiderMan extends ExpansionSet { cards.add(new SetCardInfo("Gwenom, Remorseless", 56, Rarity.MYTHIC, mage.cards.g.GwenomRemorseless.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Heroes' Hangout", 79, Rarity.UNCOMMON, mage.cards.h.HeroesHangout.class)); cards.add(new SetCardInfo("Hot Dog Cart", 164, Rarity.COMMON, mage.cards.h.HotDogCart.class)); + cards.add(new SetCardInfo("Hydro-Man, Fluid Felon", 250, Rarity.RARE, mage.cards.h.HydroManFluidFelon.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Hydro-Man, Fluid Felon", 33, Rarity.RARE, mage.cards.h.HydroManFluidFelon.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Impostor Syndrome", 251, Rarity.MYTHIC, mage.cards.i.ImpostorSyndrome.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Impostor Syndrome", 34, Rarity.MYTHIC, mage.cards.i.ImpostorSyndrome.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Interdimensional Web Watch", 165, Rarity.RARE, mage.cards.i.InterdimensionalWebWatch.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/spm/HydroManFluidFelonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/spm/HydroManFluidFelonTest.java new file mode 100644 index 00000000000..8be9cf8912b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/spm/HydroManFluidFelonTest.java @@ -0,0 +1,55 @@ +package org.mage.test.cards.single.spm; + +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author Jmlundeen + */ +public class HydroManFluidFelonTest extends CardTestPlayerBase { + + /* + Hydro-Man, Fluid Felon + {U}{U} + Legendary Creature - Elemental Villain + Whenever you cast a blue spell, if Hydro-Man is a creature, he gets +1/+1 until end of turn. + At the beginning of your end step, untap Hydro-Man. Until your next turn, he becomes a land and gains "{T}: Add {U}." + 2/2 + */ + private static final String hydroManFluidFelon = "Hydro-Man, Fluid Felon"; + + /* + Fugitive Wizard + {U} + Creature - Human Wizard + + 1/1 + */ + private static final String fugitiveWizard = "Fugitive Wizard"; + + @Test + public void testHydroManFluidFelon() { + setStrictChooseMode(true); + + addCard(Zone.HAND, playerA, fugitiveWizard); + addCard(Zone.BATTLEFIELD, playerA, hydroManFluidFelon); + addCard(Zone.BATTLEFIELD, playerA, "Island"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, fugitiveWizard, true); + + checkPT("Hydro-Man is boosted", 1, PhaseStep.PRECOMBAT_MAIN, playerA, hydroManFluidFelon, 3, 3); + + attack(1, playerA, hydroManFluidFelon); + + setStopAt(2, PhaseStep.UPKEEP); + execute(); + + assertType(hydroManFluidFelon, CardType.LAND, true); + assertNotType(hydroManFluidFelon, CardType.CREATURE); + assertTapped(hydroManFluidFelon, false); + } +} \ No newline at end of file