[DMU] Implemented Jhoira, Ageless Innovator

This commit is contained in:
Daniel Bomar 2022-08-21 15:27:35 -05:00
parent 6cfefba1c0
commit 39a6ce42e5
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.counters.CounterType;
import mage.filter.common.FilterArtifactCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
* @author weirddan455
*/
public final class JhoiraAgelessInnovator extends CardImpl {
public JhoiraAgelessInnovator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// {T}: Put two ingenuity counters on Jhoira, Ageless Innovator, then you may put an artifact card with mana value X or less from your hand onto the battlefield, where X is the number of ingenuity counters on Jhoira.
Ability ability = new SimpleActivatedAbility(new AddCountersSourceEffect(CounterType.INGENUITY.createInstance(2)), new TapSourceCost());
ability.addEffect(new JhoiraAgelessInnovatorEffect());
this.addAbility(ability);
}
private JhoiraAgelessInnovator(final JhoiraAgelessInnovator card) {
super(card);
}
@Override
public JhoiraAgelessInnovator copy() {
return new JhoiraAgelessInnovator(this);
}
}
class JhoiraAgelessInnovatorEffect extends OneShotEffect {
public JhoiraAgelessInnovatorEffect() {
super(Outcome.PutCardInPlay);
this.staticText = ", then you may put an artifact card with mana value X or less from your hand onto the battlefield, where X is the number of ingenuity counters on Jhoira.";
}
private JhoiraAgelessInnovatorEffect(final JhoiraAgelessInnovatorEffect effect) {
super(effect);
}
@Override
public JhoiraAgelessInnovatorEffect copy() {
return new JhoiraAgelessInnovatorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
if (sourcePermanent == null) {
return false;
}
int numCounters = sourcePermanent.getCounters(game).getCount(CounterType.INGENUITY);
FilterArtifactCard filter = new FilterArtifactCard("artifact card with mana value " + numCounters + " or less from your hand");
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, numCounters + 1));
TargetCardInHand target = new TargetCardInHand(filter);
if (!target.canChoose(controller.getId(), source, game) || !controller.chooseUse(outcome, "Put an artifact with mana value " + numCounters + " or less into play?", source, game)) {
return false;
}
controller.chooseTarget(outcome, target, source, game);
Card card = game.getCard(target.getFirstTarget());
return card != null && controller.moveCards(card, Zone.BATTLEFIELD, source, game);
}
}

View file

@ -44,6 +44,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Impede Momentum", 54, Rarity.COMMON, mage.cards.i.ImpedeMomentum.class));
cards.add(new SetCardInfo("Island", 265, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jaya, Fiery Negotiator", 133, Rarity.MYTHIC, mage.cards.j.JayaFieryNegotiator.class));
cards.add(new SetCardInfo("Jhoira, Ageless Innovator", 202, Rarity.RARE, mage.cards.j.JhoiraAgelessInnovator.class));
cards.add(new SetCardInfo("Join Forces", 21, Rarity.UNCOMMON, mage.cards.j.JoinForces.class));
cards.add(new SetCardInfo("Karplusan Forest", 250, Rarity.RARE, mage.cards.k.KarplusanForest.class));
cards.add(new SetCardInfo("Lightning Strike", 137, Rarity.COMMON, mage.cards.l.LightningStrike.class));

View file

@ -95,6 +95,7 @@ public enum CounterType {
INCARNATION("incarnation"),
INDESTRUCTIBLE("indestructible"),
INFECTION("infection"),
INGENUITY("ingenuity"),
INTERVENTION("intervention"),
INVITATION("invitation"),
ISOLATION("isolation"),