Implemented Skilled Animator

This commit is contained in:
Evan Kranzler 2018-06-15 21:05:54 -04:00
parent 1ad1c313e6
commit 74f45220d7
2 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,107 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.SubLayer;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TokenImpl;
import mage.target.TargetPermanent;
/**
*
* @author TheElk801
*/
public final class SkilledAnimator extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public SkilledAnimator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// When Skilled Animator enters the battlefield, target artifact you control becomes an artifact creature with base power and toughness 5/5 for as long as Skilled Animator remains on the battlefield.
Ability ability = new EntersBattlefieldTriggeredAbility(new SkilledAnimatorBecomesCreatureEffect(), false);
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public SkilledAnimator(final SkilledAnimator card) {
super(card);
}
@Override
public SkilledAnimator copy() {
return new SkilledAnimator(this);
}
}
class SkilledAnimatorBecomesCreatureEffect extends BecomesCreatureTargetEffect {
public SkilledAnimatorBecomesCreatureEffect() {
super(new SkilledAnimatorToken(), false, false, Duration.WhileOnBattlefield);
}
public SkilledAnimatorBecomesCreatureEffect(final SkilledAnimatorBecomesCreatureEffect effect) {
super(effect);
}
@Override
public SkilledAnimatorBecomesCreatureEffect copy() {
return new SkilledAnimatorBecomesCreatureEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent == null) {
this.discard();
return false;
}
return super.apply(layer, sublayer, source, game);
}
@Override
public String getText(Mode mode) {
return "target artifact you control becomes an artifact creature with base power and toughness 5/5 for as long as {this} remains on the battlefield";
}
}
class SkilledAnimatorToken extends TokenImpl {
public SkilledAnimatorToken() {
super("", "5/5 artifact creature as long as {this} is on the battlefield");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
power = new MageInt(5);
toughness = new MageInt(5);
}
public SkilledAnimatorToken(final SkilledAnimatorToken token) {
super(token);
}
public SkilledAnimatorToken copy() {
return new SkilledAnimatorToken(this);
}
}

View file

@ -121,6 +121,7 @@ public final class CoreSet2019 extends ExpansionSet {
cards.add(new SetCardInfo("Shock", 156, Rarity.COMMON, mage.cards.s.Shock.class));
cards.add(new SetCardInfo("Silverbeak Griffin", 285, Rarity.COMMON, mage.cards.s.SilverbeakGriffin.class));
cards.add(new SetCardInfo("Skeleton Archer", 118, Rarity.COMMON, mage.cards.s.SkeletonArcher.class));
cards.add(new SetCardInfo("Skilled Animator", 73, Rarity.UNCOMMON, mage.cards.s.SkilledAnimator.class));
cards.add(new SetCardInfo("Skymarch Bloodletter", 119, Rarity.COMMON, mage.cards.s.SkymarchBloodletter.class));
cards.add(new SetCardInfo("Skyscanner", 245, Rarity.COMMON, mage.cards.s.Skyscanner.class));
cards.add(new SetCardInfo("Sleep", 74, Rarity.UNCOMMON, mage.cards.s.Sleep.class));