1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-02-18 12:54:22 +00:00

[BRC] Implement March of Progress ()

This commit is contained in:
PurpleCrowbar 2022-10-30 17:57:08 +00:00 committed by GitHub
parent 38149715f1
commit fd99b5b464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,87 @@
package mage.cards.m;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.abilities.keyword.OverloadAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author PurpleCrowbar
*/
public final class MarchOfProgress extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("artifact creature you control");
static {
filter.add(CardType.ARTIFACT.getPredicate());
}
public MarchOfProgress(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
// Choose target artifact creature you control. For each creature chosen this way, create a token that's a copy of it.
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addEffect(new CreateTokenCopyTargetEffect()
.setText("Choose target artifact creature you control. For each creature chosen this way, create a token that's a copy of it."));
// Overload {6}{U}
this.addAbility(new OverloadAbility(this, new MarchOfProgressOverloadEffect(), new ManaCostsImpl<>("{6}{U}")));
}
private MarchOfProgress(final MarchOfProgress card) {
super(card);
}
@Override
public MarchOfProgress copy() {
return new MarchOfProgress(this);
}
}
class MarchOfProgressOverloadEffect extends OneShotEffect {
public MarchOfProgressOverloadEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Choose each artifact creature you control. For each creature chosen this way, create a token that's a copy of it";
}
public MarchOfProgressOverloadEffect(final MarchOfProgressOverloadEffect effect) {
super(effect);
}
@Override
public MarchOfProgressOverloadEffect copy() {
return new MarchOfProgressOverloadEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("each artifact creature you control");
filter.add(CardType.ARTIFACT.getPredicate());
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
if (permanent != null) {
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
}
}
return true;
}
return false;
}
}

View file

@ -85,6 +85,7 @@ public final class TheBrothersWarCommander extends ExpansionSet {
cards.add(new SetCardInfo("Liquimetal Torque", 145, Rarity.UNCOMMON, mage.cards.l.LiquimetalTorque.class));
cards.add(new SetCardInfo("Lithoform Engine", 146, Rarity.MYTHIC, mage.cards.l.LithoformEngine.class));
cards.add(new SetCardInfo("Losheel, Clockwork Scholar", 73, Rarity.RARE, mage.cards.l.LosheelClockworkScholar.class));
cards.add(new SetCardInfo("March of Progress", 8, Rarity.RARE, mage.cards.m.MarchOfProgress.class));
cards.add(new SetCardInfo("Marionette Master", 109, Rarity.RARE, mage.cards.m.MarionetteMaster.class));
cards.add(new SetCardInfo("Master Transmuter", 87, Rarity.RARE, mage.cards.m.MasterTransmuter.class));
cards.add(new SetCardInfo("Master of Etherium", 86, Rarity.RARE, mage.cards.m.MasterOfEtherium.class));