1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-01 19:07:57 -09:00

[MOC] Implement Gimbal, Gremlin Prodigy

This commit is contained in:
theelk801 2023-04-16 09:44:08 -04:00
parent 1cfe05f38e
commit 89ce5bbc3d
3 changed files with 135 additions and 0 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/game/permanent/token

View file

@ -0,0 +1,104 @@
package mage.cards.g;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.GremlinArtifactToken;
import mage.game.permanent.token.Token;
import java.util.Objects;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GimbalGremlinProdigy extends CardImpl {
public GimbalGremlinProdigy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GREMLIN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Artifact creatures you control have trample.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
TrampleAbility.getInstance(), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENTS_ARTIFACT_CREATURE
)));
// At the beginning of your end step, create a 0/0 red Gremlin artifact creature token. Put X +1/+1 counters on it, where X is the number of differently named artifact tokens you control.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
new GimbalGremlinProdigyEffect(), TargetController.YOU, false
));
}
private GimbalGremlinProdigy(final GimbalGremlinProdigy card) {
super(card);
}
@Override
public GimbalGremlinProdigy copy() {
return new GimbalGremlinProdigy(this);
}
}
class GimbalGremlinProdigyEffect extends OneShotEffect {
GimbalGremlinProdigyEffect() {
super(Outcome.Benefit);
staticText = "create a 0/0 red Gremlin artifact creature token. Put X +1/+1 counters on it, " +
"where X is the number of differently named artifact tokens you control";
}
private GimbalGremlinProdigyEffect(final GimbalGremlinProdigyEffect effect) {
super(effect);
}
@Override
public GimbalGremlinProdigyEffect copy() {
return new GimbalGremlinProdigyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Token token = new GremlinArtifactToken();
token.putOntoBattlefield(1, game, source);
int amount = game
.getBattlefield()
.getActivePermanents(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT,
source.getControllerId(), source, game
)
.stream()
.filter(PermanentToken.class::isInstance)
.map(MageObject::getName)
.filter(Objects::nonNull)
.filter(s -> !s.isEmpty())
.distinct()
.mapToInt(i -> 1)
.sum();
for (UUID tokenId : token.getLastAddedTokenIds()) {
Permanent permanent = game.getPermanent(tokenId);
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
}
}
return true;
}
}

View file

@ -129,6 +129,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
cards.add(new SetCardInfo("Genesis Hydra", 298, Rarity.RARE, mage.cards.g.GenesisHydra.class));
cards.add(new SetCardInfo("Ghirapur Aether Grid", 281, Rarity.UNCOMMON, mage.cards.g.GhirapurAetherGrid.class));
cards.add(new SetCardInfo("Gilded Goose", 299, Rarity.RARE, mage.cards.g.GildedGoose.class));
cards.add(new SetCardInfo("Gimbal, Gremlin Prodigy", 3, Rarity.MYTHIC, mage.cards.g.GimbalGremlinProdigy.class));
cards.add(new SetCardInfo("Go for the Throat", 250, Rarity.UNCOMMON, mage.cards.g.GoForTheThroat.class));
cards.add(new SetCardInfo("Goblin Instigator", 282, Rarity.COMMON, mage.cards.g.GoblinInstigator.class));
cards.add(new SetCardInfo("Goblin Medics", 283, Rarity.COMMON, mage.cards.g.GoblinMedics.class));

View file

@ -0,0 +1,30 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class GremlinArtifactToken extends TokenImpl {
public GremlinArtifactToken() {
super("Gremlin Token", "0/0 red Gremlin artifact creature token");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
this.setOriginalExpansionSetCode("MOC");
subtype.add(SubType.GREMLIN);
color.setRed(true);
power = new MageInt(0);
toughness = new MageInt(0);
}
public GremlinArtifactToken(final GremlinArtifactToken token) {
super(token);
}
public GremlinArtifactToken copy() {
return new GremlinArtifactToken(this);
}
}