diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java new file mode 100644 index 0000000000..d27a887421 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.mirrodinbesieged; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Viserion + */ +public class PistusStrike extends CardImpl { + + private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + } + + public PistusStrike(UUID ownerId) { + super(ownerId, 86, "Pistus Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "MBS"; + this.color.setGreen(true); + + TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter); + this.getSpellAbility().addTarget(target1); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new PoisonControllerTargetCreatureEffect(1)); + } + + public PistusStrike(final PistusStrike card) { + super(card); + } + + @Override + public PistusStrike copy() { + return new PistusStrike(this); + } +} + +class PoisonControllerTargetCreatureEffect extends OneShotEffect { + + protected int amount; + + public PoisonControllerTargetCreatureEffect(int amount) { + super(Outcome.Damage); + this.amount = amount; + } + + public PoisonControllerTargetCreatureEffect(final PoisonControllerTargetCreatureEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public PoisonControllerTargetCreatureEffect copy() { + return new PoisonControllerTargetCreatureEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent p = game.getBattlefield().getPermanent(source.getFirstTarget()); + if (p == null) { + p = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + } + if (p != null) { + Player player = game.getPlayer(p.getControllerId()); + if (player != null) { + player.getCounters().addCounter(CounterType.POISON.createInstance(amount)); + } + } + return false; + } + + @Override + public String getText(Ability source) { + StringBuilder sb = new StringBuilder(); + sb.append("That creature's controller gets ").append(Integer.toString(amount)).append(" poison counter"); + sb.append((amount == 1?"":"s")); + return sb.toString(); + } + +} diff --git a/Mage.Sets/src/mage/sets/zendikar/Harrow.java b/Mage.Sets/src/mage/sets/zendikar/Harrow.java new file mode 100644 index 0000000000..d6304b3358 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/Harrow.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterControlledPermanent; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author Viserion + */ +public class Harrow extends CardImpl { + + static FilterControlledPermanent filter = new FilterControlledPermanent("a land."); + + static{ + filter.getCardType().add(CardType.LAND); + } + + public Harrow(UUID ownerId){ + super(ownerId, 165, "Harrow", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); + + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay)); + } + + public Harrow(final Harrow card) { + super(card); + } + + @Override + public Harrow copy() { + return new Harrow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java new file mode 100644 index 0000000000..c6e2eb1352 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.zendikar; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.ActivatedAbilityImpl; +import mage.abilities.common.LandfallAbility; +import mage.abilities.costs.Costs; +import mage.abilities.costs.CostsImpl; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Viserion + */ +public class KhalniHeartExpedition extends CardImpl { + + public KhalniHeartExpedition(UUID ownerId) { + super(ownerId, 167, "Khalni Heart Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "ZEN"; + this.color.setGreen(true); + + this.addAbility(new LandfallAbility(new AddCountersSourceEffect("quest", 1), true)); + this.addAbility(new KhalniHeartExpeditionAbility()); + } + + public KhalniHeartExpedition(final KhalniHeartExpedition card) { + super(card); + } + + @Override + public KhalniHeartExpedition copy() { + return new KhalniHeartExpedition(this); + } +} + +class KhalniHeartExpeditionAbility extends ActivatedAbilityImpl { + + public KhalniHeartExpeditionAbility() { + super(Zone.BATTLEFIELD, null); + + Costs additionalCosts = new CostsImpl(); + additionalCosts.add(new RemoveCountersSourceCost("quest", 3)); + additionalCosts.add(new SacrificeSourceCost()); + costs.add(additionalCosts); + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); + } + + public KhalniHeartExpeditionAbility(final KhalniHeartExpeditionAbility ability) { + super(ability); + } + + @Override + public KhalniHeartExpeditionAbility copy() { + return new KhalniHeartExpeditionAbility(this); + } + + @Override + public String getRule() { + return "Remove three quest counters from Khalni Heart Expedition and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library."; + } + +}