diff --git a/Mage.Sets/src/mage/cards/v/VoiceOfTheBlessed.java b/Mage.Sets/src/mage/cards/v/VoiceOfTheBlessed.java new file mode 100644 index 00000000000..e7a08e1dfdb --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VoiceOfTheBlessed.java @@ -0,0 +1,88 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class VoiceOfTheBlessed extends CardImpl { + + public VoiceOfTheBlessed(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}"); + + this.subtype.add(SubType.SPIRIT); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you gain life, put a +1/+1 counter on Voice of the Blessed. + this.addAbility(new GainLifeControllerTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + )); + + // As long as Voice of the Blessed has four or more +1/+1 counters on it, it has flying and vigilance. + Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + FlyingAbility.getInstance(), Duration.WhileOnBattlefield + ), VoiceOfTheBlessedCondition.FOUR, "as long as {this} has " + + "four or more +1/+1 counters on it, it has flying" + )); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect( + VigilanceAbility.getInstance(), Duration.WhileOnBattlefield + ), VoiceOfTheBlessedCondition.FOUR, "and vigilance")); + this.addAbility(ability); + + // As long as Voice of the Blessed has ten or more +1/+1 counters on it, it has indestructible. + this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield + ), VoiceOfTheBlessedCondition.TEN, "as long as {this} has " + + "ten or more +1/+1 counters on it, it has indestructible" + ))); + } + + private VoiceOfTheBlessed(final VoiceOfTheBlessed card) { + super(card); + } + + @Override + public VoiceOfTheBlessed copy() { + return new VoiceOfTheBlessed(this); + } +} + +enum VoiceOfTheBlessedCondition implements Condition { + FOUR(4), + TEN(10); + private final int counters; + + VoiceOfTheBlessedCondition(int counters) { + this.counters = counters; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + return permanent != null && permanent.getCounters(game).getCount(CounterType.P1P1) >= counters; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index c7245601fe1..5ff3ccb1a9b 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -166,6 +166,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Valorous Stance", 42, Rarity.UNCOMMON, mage.cards.v.ValorousStance.class)); cards.add(new SetCardInfo("Vampires' Vengeance", 180, Rarity.UNCOMMON, mage.cards.v.VampiresVengeance.class)); cards.add(new SetCardInfo("Vilespawn Spider", 250, Rarity.UNCOMMON, mage.cards.v.VilespawnSpider.class)); + cards.add(new SetCardInfo("Voice of the Blessed", 44, Rarity.RARE, mage.cards.v.VoiceOfTheBlessed.class)); cards.add(new SetCardInfo("Volatile Arsonist", 181, Rarity.MYTHIC, mage.cards.v.VolatileArsonist.class)); cards.add(new SetCardInfo("Voldaren Estate", 267, Rarity.RARE, mage.cards.v.VoldarenEstate.class)); cards.add(new SetCardInfo("Weary Prisoner", 184, Rarity.COMMON, mage.cards.w.WearyPrisoner.class));