Implement Brown Ouphe

This commit is contained in:
Evan Kranzler 2017-08-05 17:26:38 -04:00
parent 03ace22662
commit eea04a2ad3
3 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,101 @@
/*
* 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.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterStackObject;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.stack.StackAbility;
import mage.target.common.TargetActivatedOrTriggeredAbility;
/**
*
* @author TheElk801
*/
public class BrownOuphe extends CardImpl {
private final static FilterStackObject filter = new FilterStackObject("ability from an artifact source");
static {
filter.add(new ArtifactSourcePredicate());
}
public BrownOuphe(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
this.subtype.add("Ouphe");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {1}{G}, {tap}: Counter target activated ability from an artifact source.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl<>("{1}{G}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetActivatedOrTriggeredAbility(filter));
this.addAbility(ability);
}
public BrownOuphe(final BrownOuphe card) {
super(card);
}
@Override
public BrownOuphe copy() {
return new BrownOuphe(this);
}
}
class ArtifactSourcePredicate implements Predicate<Ability> {
public ArtifactSourcePredicate() {
}
@Override
public boolean apply(Ability input, Game game) {
if (input instanceof StackAbility) {
return input.getSourceObject(game).isArtifact() && input.getAbilityType() == AbilityType.ACTIVATED;
}
return false;
}
@Override
public String toString() {
return "Source(Artifact)";
}
}

View file

@ -75,6 +75,7 @@ public class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Blue Scarab", 233, Rarity.UNCOMMON, mage.cards.b.BlueScarab.class));
cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class));
cards.add(new SetCardInfo("Brand of Ill Omen", 177, Rarity.RARE, mage.cards.b.BrandOfIllOmen.class));
cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class));
cards.add(new SetCardInfo("Brushland", 327, Rarity.RARE, mage.cards.b.Brushland.class));
cards.add(new SetCardInfo("Burnt Offering", 4, Rarity.COMMON, mage.cards.b.BurntOffering.class));
cards.add(new SetCardInfo("Caribou Range", 235, Rarity.RARE, mage.cards.c.CaribouRange.class));

View file

@ -47,6 +47,7 @@ public class Mirrodin extends ExpansionSet {
cards.add(new SetCardInfo("Bosh, Iron Golem", 147, Rarity.RARE, mage.cards.b.BoshIronGolem.class));
cards.add(new SetCardInfo("Bottle Gnomes", 148, Rarity.UNCOMMON, mage.cards.b.BottleGnomes.class));
cards.add(new SetCardInfo("Broodstar", 31, Rarity.RARE, mage.cards.b.Broodstar.class));
cards.add(new SetCardInfo("Brown Ouphe", 115, Rarity.UNCOMMON, mage.cards.b.BrownOuphe.class));
cards.add(new SetCardInfo("Cathodion", 149, Rarity.UNCOMMON, mage.cards.c.Cathodion.class));
cards.add(new SetCardInfo("Chalice of the Void", 150, Rarity.RARE, mage.cards.c.ChaliceOfTheVoid.class));
cards.add(new SetCardInfo("Chimney Imp", 59, Rarity.COMMON, mage.cards.c.ChimneyImp.class));