diff --git a/Mage.Sets/src/mage/cards/m/MarchOfTheCanonized.java b/Mage.Sets/src/mage/cards/m/MarchOfTheCanonized.java new file mode 100644 index 00000000000..e12aff77d4f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MarchOfTheCanonized.java @@ -0,0 +1,62 @@ +package mage.cards.m; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.IntCompareCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.DevotionCount; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.token.IxalanVampireToken; +import mage.game.permanent.token.VampireDemonToken; + +/** + * @author arcox + */ +public final class MarchOfTheCanonized extends CardImpl { + + public MarchOfTheCanonized(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{W}{W}"); + + // When March of the Canonized enters the battlefield, create X 1/1 white Vampire creature tokens with lifelink. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new IxalanVampireToken(), ManacostVariableValue.ETB))); + + // At the beginning of your upkeep, if your devotion to white and black is seven or greater, create a 4/3 white and black Vampire Demon creature token with flying. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new VampireDemonToken()), TargetController.YOU, false), + new MarchOfTheCanonizedCondition(), + "At the beginning of your upkeep, " + + "if your devotion to white and black is seven or greater, " + + "create a 4/3 white and black Vampire Demon creature token with flying." + ).addHint(DevotionCount.WB.getHint())); + } + + private MarchOfTheCanonized(final MarchOfTheCanonized card) { + super(card); + } + + @Override + public MarchOfTheCanonized copy() { + return new MarchOfTheCanonized(this); + } +} + +class MarchOfTheCanonizedCondition extends IntCompareCondition { + + MarchOfTheCanonizedCondition() { + super(ComparisonType.OR_GREATER, 7); + } + + @Override + protected int getInputValue(Game game, Ability source) { + return DevotionCount.WB.calculate(game, source, null); + } +} diff --git a/Mage.Sets/src/mage/sets/LostCavernsOfIxalanCommander.java b/Mage.Sets/src/mage/sets/LostCavernsOfIxalanCommander.java index dea407e1e70..0f818be2a84 100644 --- a/Mage.Sets/src/mage/sets/LostCavernsOfIxalanCommander.java +++ b/Mage.Sets/src/mage/sets/LostCavernsOfIxalanCommander.java @@ -164,6 +164,7 @@ public final class LostCavernsOfIxalanCommander extends ExpansionSet { cards.add(new SetCardInfo("Majestic Heliopterus", 131, Rarity.UNCOMMON, mage.cards.m.MajesticHeliopterus.class)); cards.add(new SetCardInfo("Malcolm, Keen-Eyed Navigator", 161, Rarity.UNCOMMON, mage.cards.m.MalcolmKeenEyedNavigator.class)); cards.add(new SetCardInfo("Marauding Raptor", 228, Rarity.RARE, mage.cards.m.MaraudingRaptor.class)); + cards.add(new SetCardInfo("March of the Canonized", 73, Rarity.RARE, mage.cards.m.MarchOfTheCanonized.class)); cards.add(new SetCardInfo("Martyr of Dusk", 132, Rarity.COMMON, mage.cards.m.MartyrOfDusk.class)); cards.add(new SetCardInfo("Master of Dark Rites", 83, Rarity.RARE, mage.cards.m.MasterOfDarkRites.class)); cards.add(new SetCardInfo("Master of the Pearl Trident", 162, Rarity.RARE, mage.cards.m.MasterOfThePearlTrident.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/IntCompareCondition.java b/Mage/src/main/java/mage/abilities/condition/IntCompareCondition.java index aabd0c8cd01..7c64f61920a 100644 --- a/Mage/src/main/java/mage/abilities/condition/IntCompareCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/IntCompareCondition.java @@ -1,4 +1,3 @@ - package mage.abilities.condition; import mage.abilities.Ability; @@ -6,7 +5,6 @@ import mage.constants.ComparisonType; import mage.game.Game; /** - * * @author LevelX2 */ public abstract class IntCompareCondition implements Condition { @@ -14,7 +12,7 @@ public abstract class IntCompareCondition implements Condition { protected final ComparisonType type; protected final int value; - public IntCompareCondition(ComparisonType type, int value) { + protected IntCompareCondition(ComparisonType type, int value) { this.type = type; this.value = value; } @@ -24,7 +22,7 @@ public abstract class IntCompareCondition implements Condition { @Override public final boolean apply(Game game, Ability source) { int inputValue = getInputValue(game, source); - return ComparisonType.compare(inputValue , type, value); + return ComparisonType.compare(inputValue, type, value); } @Override diff --git a/Mage/src/main/java/mage/game/permanent/token/IxalanVampireToken.java b/Mage/src/main/java/mage/game/permanent/token/IxalanVampireToken.java index bb67ff67c34..357862be37d 100644 --- a/Mage/src/main/java/mage/game/permanent/token/IxalanVampireToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/IxalanVampireToken.java @@ -20,7 +20,7 @@ public final class IxalanVampireToken extends TokenImpl { addAbility(LifelinkAbility.getInstance()); } - protected IxalanVampireToken(final IxalanVampireToken token) { + private IxalanVampireToken(final IxalanVampireToken token) { super(token); }