Merge pull request #1846 from drmDev/master

Champion bug fixes
This commit is contained in:
Derek M 2016-04-11 17:07:15 -04:00
commit 6775c9bc97
13 changed files with 21 additions and 15 deletions

View file

@ -61,7 +61,7 @@ public class BoggartMob extends CardImpl {
this.toughness = new MageInt(5);
// Champion a Goblin
this.addAbility(new ChampionAbility(this, "Goblin"));
this.addAbility(new ChampionAbility(this, "Goblin", false));
// Whenever a Goblin you control deals combat damage to a player, you may put a 1/1 black Goblin Rogue creature token onto the battlefield.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(

View file

@ -56,7 +56,7 @@ public class ChangelingBerserker extends CardImpl {
this.addAbility(HasteAbility.getInstance());
// Champion a creature
this.addAbility(new ChampionAbility(this, ""));
this.addAbility(new ChampionAbility(this, "", true));
}
public ChangelingBerserker(final ChangelingBerserker card) {

View file

@ -53,7 +53,7 @@ public class ChangelingHero extends CardImpl {
this.addAbility(ChangelingAbility.getInstance());
// Champion a creature
this.addAbility(new ChampionAbility(this, ""));
this.addAbility(new ChampionAbility(this, "", true));
// Lifelink
this.addAbility(LifelinkAbility.getInstance());

View file

@ -52,7 +52,7 @@ public class ChangelingTitan extends CardImpl {
this.addAbility(ChangelingAbility.getInstance());
// Champion a creature
this.addAbility(new ChampionAbility(this, ""));
this.addAbility(new ChampionAbility(this, "", true));
}
public ChangelingTitan(final ChangelingTitan card) {

View file

@ -64,7 +64,7 @@ public class MistbindClique extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Champion a Faerie
this.addAbility(new ChampionAbility(this, "Faerie"));
this.addAbility(new ChampionAbility(this, "Faerie", false));
// When a Faerie is championed with Mistbind Clique, tap all lands target player controls.
this.addAbility(new MistbindCliqueAbility());

View file

@ -53,7 +53,7 @@ public class NovaChaser extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Champion an Elemental
this.addAbility(new ChampionAbility(this, "Elemental"));
this.addAbility(new ChampionAbility(this, "Elemental", false));
}
public NovaChaser(final NovaChaser card) {

View file

@ -60,7 +60,7 @@ public class ThoughtweftTrio extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// Champion a Kithkin
this.addAbility(new ChampionAbility(this, "Kithkin"));
this.addAbility(new ChampionAbility(this, "Kithkin", false));
// Thoughtweft Trio can block any number of creatures.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect(0)));

View file

@ -63,7 +63,7 @@ public class WanderwineProphets extends CardImpl {
this.toughness = new MageInt(4);
// Champion a Merfolk
this.addAbility(new ChampionAbility(this, "Merfolk"));
this.addAbility(new ChampionAbility(this, "Merfolk", false));
// Whenever Wanderwine Prophets deals combat damage to a player, you may sacrifice a Merfolk. If you do, take an extra turn after this one.
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new AddExtraTurnControllerEffect(), true);
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, true)));

View file

@ -70,7 +70,7 @@ public class WrensRunPackmaster extends CardImpl {
this.toughness = new MageInt(5);
// Champion an Elf
this.addAbility(new ChampionAbility(this, "Elf"));
this.addAbility(new ChampionAbility(this, "Elf", false));
// {2}{G}: Put a 2/2 green Wolf creature token onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WolfToken("LRW")), new ManaCostsImpl<>("{2}{G}")));

View file

@ -55,7 +55,7 @@ public class LightningCrafter extends CardImpl {
this.toughness = new MageInt(3);
// Champion a Goblin or Shaman
this.addAbility(new ChampionAbility(this, new String[]{"Goblin", "Shaman"}));
this.addAbility(new ChampionAbility(this, new String[]{"Goblin", "Shaman"}, false));
// {T}: Lightning Crafter deals 3 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new TapSourceCost());

View file

@ -60,7 +60,7 @@ public class SupremeExemplar extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Champion an Elemental
this.addAbility(new ChampionAbility(this, "Elemental"));
this.addAbility(new ChampionAbility(this, "Elemental", false));
}
public SupremeExemplar(final SupremeExemplar card) {

View file

@ -68,7 +68,7 @@ public class UnstoppableAsh extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Champion a Treefolk or Warrior
this.addAbility(new ChampionAbility(this, new String[]{"Treefolk", "Warrior"}));
this.addAbility(new ChampionAbility(this, new String[]{"Treefolk", "Warrior"}, false));
// Whenever a creature you control becomes blocked, it gets +0/+5 until end of turn.
Effect effect = new BoostTargetEffect(0, 5, Duration.EndOfTurn);

View file

@ -39,11 +39,13 @@ import mage.abilities.costs.CostImpl;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
@ -74,8 +76,8 @@ public class ChampionAbility extends StaticAbility {
protected String[] subtypes;
protected String objectDescription;
public ChampionAbility(Card card, String subtype) {
this(card, new String[]{subtype});
public ChampionAbility(Card card, String subtype, boolean requiresCreature) {
this(card, new String[]{subtype}, requiresCreature);
}
/**
@ -85,8 +87,9 @@ public class ChampionAbility extends StaticAbility {
* @param card
* @param subtypes subtypes to champion with, if empty all creatures can be
* used
* @param requiresCreature for cards that specifically require championing another creature
*/
public ChampionAbility(Card card, String[] subtypes) {
public ChampionAbility(Card card, String[] subtypes, boolean requiresCreature) {
super(Zone.BATTLEFIELD, null);
this.subtypes = subtypes;
@ -111,6 +114,9 @@ public class ChampionAbility extends StaticAbility {
if (!subtypesPredicates.isEmpty()) {
filter.add(Predicates.or(subtypesPredicates));
}
if (requiresCreature) {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
filter.add(new AnotherPredicate());
// When this permanent enters the battlefield, sacrifice it unless you exile another [object] you control.