Implemented Lost Order of Jarkeld

This commit is contained in:
Evan Kranzler 2019-01-30 17:32:00 -05:00
parent 24a7bd4b37
commit 56cc912bbf
3 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.l;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ChooseOpponentEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class LostOrderOfJarkeld extends CardImpl {
public LostOrderOfJarkeld(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// As Lost Order of Jarkeld enters the battlefield, choose an opponent.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment)));
// Lost Order of Jarkeld's power and toughness are each equal to 1 plus the number of creatures the chosen player controls.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerToughnessSourceEffect(
LostOrderOfJarkeldValue.instance, Duration.Custom, SubLayer.CharacteristicDefining_7a
)
));
}
private LostOrderOfJarkeld(final LostOrderOfJarkeld card) {
super(card);
}
@Override
public LostOrderOfJarkeld copy() {
return new LostOrderOfJarkeld(this);
}
}
enum LostOrderOfJarkeldValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
if (game.getPermanent(sourceAbility.getSourceId()) == null) {
return 1;
}
Object obj = game.getState().getValue(sourceAbility.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY);
if (!(obj instanceof UUID)) {
return 1;
}
return 1 + game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, (UUID) obj, game).size();
}
@Override
public DynamicValue copy() {
return instance;
}
@Override
public String getMessage() {
return "1 plus the number of creatures the chosen player controls.";
}
}

View file

@ -215,6 +215,7 @@ public final class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Lightning Blow", 42, Rarity.RARE, mage.cards.l.LightningBlow.class));
cards.add(new SetCardInfo("Lim-Dul's Cohort", 145, Rarity.COMMON, mage.cards.l.LimDulsCohort.class));
cards.add(new SetCardInfo("Lim-Dul's Hex", 146, Rarity.UNCOMMON, mage.cards.l.LimDulsHex.class));
cards.add(new SetCardInfo("Lost Order of Jarkeld", 43, Rarity.RARE, mage.cards.l.LostOrderOfJarkeld.class));
cards.add(new SetCardInfo("Lure", 253, Rarity.UNCOMMON, mage.cards.l.Lure.class));
cards.add(new SetCardInfo("Magus of the Unseen", 82, Rarity.RARE, mage.cards.m.MagusOfTheUnseen.class));
cards.add(new SetCardInfo("Malachite Talisman", 328, Rarity.UNCOMMON, mage.cards.m.MalachiteTalisman.class));

View file

@ -152,6 +152,7 @@ public final class MastersEditionII extends ExpansionSet {
cards.add(new SetCardInfo("Leaping Lizard", 171, Rarity.COMMON, mage.cards.l.LeapingLizard.class));
cards.add(new SetCardInfo("Lim-Dul's High Guard", 103, Rarity.UNCOMMON, mage.cards.l.LimDulsHighGuard.class));
cards.add(new SetCardInfo("Lodestone Bauble", 213, Rarity.RARE, mage.cards.l.LodestoneBauble.class));
cards.add(new SetCardInfo("Lost Order of Jarkeld", 24, Rarity.RARE, mage.cards.l.LostOrderOfJarkeld.class));
cards.add(new SetCardInfo("Magus of the Unseen", 53, Rarity.RARE, mage.cards.m.MagusOfTheUnseen.class));
cards.add(new SetCardInfo("Mana Crypt", 214, Rarity.RARE, mage.cards.m.ManaCrypt.class));
cards.add(new SetCardInfo("Marjhan", 54, Rarity.RARE, mage.cards.m.Marjhan.class));