Implement Kyscu Drake

This commit is contained in:
jmharmon 2019-04-14 14:03:23 -07:00 committed by GitHub
parent 034ea931ce
commit 32bbcc6b53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,67 @@
package mage.cards.k;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class KyscuDrake extends CardImpl {
private static final FilterCard filter = new FilterCard("card named Viashivan Dragon");
private static final FilterControlledCreaturePermanent filterSpitting = new FilterControlledCreaturePermanent("creature named Spitting Drake");
static {
filter.add(new NamePredicate("Viashivan Dragon"));
filterSpitting.add(new NamePredicate("Spitting Drake"));
}
public KyscuDrake(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.DRAKE);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {G}: Kyscu Drake gets +0/+1 until end of turn. Activate this ability only once each turn.
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{G}")));
// Sacrifice Kyscu Drake and a creature named Spitting Drake: Search your library for a card named Viashivan Dragon and put that card onto the battlefield. Then shuffle your library.
TargetCardInLibrary target = new TargetCardInLibrary(1, 1, new FilterCard(filter));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target,true,true, Outcome.PutCardInPlay), new SacrificeSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filterSpitting, false)));
this.addAbility(ability);
}
public KyscuDrake(final KyscuDrake card) {
super(card);
}
@Override
public KyscuDrake copy() {
return new KyscuDrake(this);
}
}