Implemented Zegana, Utopian Speaker

This commit is contained in:
Evan Kranzler 2018-12-19 18:33:12 -05:00
parent 02406e2c7c
commit 9c1b4b9f60
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.z;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.effects.keyword.AdaptEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.CounterPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ZeganaUtopianSpeaker extends CardImpl {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent();
private static final FilterPermanent filter2 = new FilterControlledCreaturePermanent();
static {
filter.add(new CounterPredicate(CounterType.P1P1));
filter.add(new AnotherPredicate());
filter2.add(new CounterPredicate(CounterType.P1P1));
}
public ZeganaUtopianSpeaker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.MERFOLK);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Zegana, Utopian Speaker enters the battlefield, if you control another creature with a +1/+1 counter on it, draw a card.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(
new DrawCardSourceControllerEffect(1), false
), new PermanentsOnTheBattlefieldCondition(filter),
"When {this} enters the battlefield, " +
"if you control another creature " +
"with a +1/+1 counter on it, draw a card."
));
// {4}{G}{U}: Adapt 4.
this.addAbility(new SimpleActivatedAbility(
new AdaptEffect(4), new ManaCostsImpl("{4}{G}{U}")
));
// Each creature you control with a +1/+1 counter on it has trample.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new GainAbilityAllEffect(
TrampleAbility.getInstance(), Duration.WhileOnBattlefield,
filter2, "Each creature you control with a +1/+1 counter on it has trample"
)
));
}
public ZeganaUtopianSpeaker(final ZeganaUtopianSpeaker card) {
super(card);
}
@Override
public ZeganaUtopianSpeaker copy() {
return new ZeganaUtopianSpeaker(this);
}
}

View file

@ -42,6 +42,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Rafter Demon", 196, Rarity.COMMON, mage.cards.r.RafterDemon.class));
cards.add(new SetCardInfo("Rix Maadi Reveler", 109, Rarity.RARE, mage.cards.r.RixMaadiReveler.class));
cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class));
cards.add(new SetCardInfo("Zegana, Utopian Speaker", 214, Rarity.RARE, mage.cards.z.ZeganaUtopianSpeaker.class));
}
@Override