[LCI] Implement Jadeheart Seedstones / Jadeheart Attendant

This commit is contained in:
theelk801 2023-11-05 13:24:22 -05:00
parent 86389b81d9
commit cdc7874b14
3 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,49 @@
package mage.cards.j;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.abilities.keyword.CraftAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetPermanentAmount;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class JadeSeedstones extends CardImpl {
public JadeSeedstones(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}{G}");
this.secondSideCardClazz = mage.cards.j.JadeheartAttendant.class;
// When Jade Seedstones enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures you control.
Ability ability = new EntersBattlefieldTriggeredAbility(new DistributeCountersEffect(
CounterType.P1P1, 3, "one, two, or three target creatures you control"
));
TargetPermanentAmount target = new TargetPermanentAmount(3, StaticFilters.FILTER_CONTROLLED_CREATURES);
target.setMinNumberOfTargets(1);
ability.addTarget(target);
this.addAbility(ability);
// Craft with creature {5}{G}{G}
this.addAbility(new CraftAbility(
"{4}{B}", "creature", "another creature you control " +
"or a creature card in your graveyard", CardType.CREATURE.getPredicate())
);
}
private JadeSeedstones(final JadeSeedstones card) {
super(card);
}
@Override
public JadeSeedstones copy() {
return new JadeSeedstones(this);
}
}

View file

@ -0,0 +1,80 @@
package mage.cards.j;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.ExileZone;
import mage.game.Game;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class JadeheartAttendant extends CardImpl {
public JadeheartAttendant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "");
this.subtype.add(SubType.GOLEM);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
this.nightCard = true;
this.color.setGreen(true);
// When Jadeheart Attendant enters the battlefield, you gain life equal to the mana value of the exiled card used to craft it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(JadeheartAttendantValue.instance)
.setText("you gain life equal to the mana value of the exiled card used to craft it")));
}
private JadeheartAttendant(final JadeheartAttendant card) {
super(card);
}
@Override
public JadeheartAttendant copy() {
return new JadeheartAttendant(this);
}
}
enum JadeheartAttendantValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
ExileZone exileZone = game
.getExile()
.getExileZone(CardUtil.getExileZoneId(game, sourceAbility, -2));
return exileZone != null
? exileZone
.getCards(game)
.stream()
.mapToInt(MageObject::getManaValue)
.sum()
: 0;
}
@Override
public JadeheartAttendantValue copy() {
return this;
}
@Override
public String getMessage() {
return "";
}
@Override
public String toString() {
return "1";
}
}

View file

@ -180,6 +180,8 @@ public final class TheLostCavernsOfIxalan extends ExpansionSet {
cards.add(new SetCardInfo("Itlimoc, Cradle of the Sun", 188, Rarity.RARE, mage.cards.i.ItlimocCradleOfTheSun.class));
cards.add(new SetCardInfo("Itzquinth, Firstborn of Gishath", 230, Rarity.UNCOMMON, mage.cards.i.ItzquinthFirstbornOfGishath.class));
cards.add(new SetCardInfo("Ixalli's Lorekeeper", 194, Rarity.UNCOMMON, mage.cards.i.IxallisLorekeeper.class));
cards.add(new SetCardInfo("Jade Seedstones", 195, Rarity.UNCOMMON, mage.cards.j.JadeSeedstones.class));
cards.add(new SetCardInfo("Jadeheart Attendant", 195, Rarity.UNCOMMON, mage.cards.j.JadeheartAttendant.class));
cards.add(new SetCardInfo("Jadelight Spelunker", 196, Rarity.RARE, mage.cards.j.JadelightSpelunker.class));
cards.add(new SetCardInfo("Join the Dead", 110, Rarity.COMMON, mage.cards.j.JoinTheDead.class));
cards.add(new SetCardInfo("Kaslem's Stonetree", 197, Rarity.COMMON, mage.cards.k.KaslemsStonetree.class));