Merge remote-tracking branch 'refs/remotes/magefree/master'

This commit is contained in:
CountAndromalius 2016-07-13 08:10:54 -03:00
commit 7d036967bd
6 changed files with 46 additions and 10 deletions

View file

@ -60,7 +60,7 @@ public class FurybladeVampire extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// At the beginning of combat on your turn, you may discard a card. If you do, Furyblade Vampire gets +3/+0 until end of turn.
Ability ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD,
new DoIfCostPaid(new BoostSourceEffect(3, 0, Duration.EndOfTurn), new DiscardCardCost(), "Discard a card to get {this} +3/+0 until end of turn?", true), TargetController.YOU, false, false);
new DoIfCostPaid(new BoostSourceEffect(3, 0, Duration.EndOfTurn), new DiscardCardCost(), "Discard a card for {this} to get +3/+0 until end of turn?", true), TargetController.YOU, false, false);
this.addAbility(ability);
}

View file

@ -32,7 +32,7 @@ import mage.abilities.effects.common.DamageMultiEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayerAmount;
import mage.target.common.TargetCreaturePermanent;
/**
*
@ -46,7 +46,7 @@ public class SpreadingFlames extends CardImpl {
// Spreading Flames deals 6 damage divided as you choose among any number of target creatures.
this.getSpellAbility().addEffect(new DamageMultiEffect(6));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(6));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(6));
}
public SpreadingFlames(final SpreadingFlames card) {

View file

@ -29,6 +29,7 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
@ -49,7 +50,7 @@ public class StensiaBanquet extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Vampires you control");
static {
filter.add(new SubtypePredicate("Vampires"));
filter.add(new SubtypePredicate("Vampire"));
filter.add(new ControllerPredicate(TargetController.YOU));
}
@ -58,7 +59,9 @@ public class StensiaBanquet extends CardImpl {
this.expansionSetCode = "EMN";
// Stensia Banquet deals damage to target opponent equal to the number of Vampires you control.
this.getSpellAbility().addEffect(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)));
Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter));
effect.setText("{this} deals damage to target opponent equal to the number of Vampires you control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetOpponent());
// Draw a card.

View file

@ -2,7 +2,10 @@ package mage.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
@ -12,6 +15,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.target.common.TargetCardInGraveyard;
public class GraveScrabbler extends CardImpl {
@ -29,9 +33,9 @@ public class GraveScrabbler extends CardImpl {
//When Grave Scrabbler enters the battlefield, if its madness cost was paid,
//you may return target creature card from a graveyard to its owner's hand.
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
this.addAbility(new ConditionalTriggeredAbility(ability, MadnessAbility.GetCondition(),
this.addAbility(new ConditionalTriggeredAbility(ability, MadnessPaidCondition.getInstance(),
"When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand."));
}
@ -45,3 +49,32 @@ public class GraveScrabbler extends CardImpl {
}
}
class MadnessPaidCondition implements Condition {
private static MadnessPaidCondition fInstance = null;
private MadnessPaidCondition() {
}
public static Condition getInstance() {
if (fInstance == null) {
fInstance = new MadnessPaidCondition();
}
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof MadnessAbility) {
return ((MadnessAbility) ability).getCosts().isPaid();
}
}
}
return false;
}
}

View file

@ -988,11 +988,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, String targetName, String spellOnStack, StackClause clause) {
if (StackClause.WHILE_ON_STACK.equals(clause)) {
player.addAction(turnNum, step, "activate:Cast " + cardName
+ "$" + (targetName.startsWith("target") ? targetName : "target=" + targetName)
+ "$" + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName)
+ "$spellOnStack=" + spellOnStack);
} else {
player.addAction(turnNum, step, "activate:Cast " + cardName
+ "$" + (targetName.startsWith("target") ? targetName : "target=" + targetName)
+ "$" + (targetName != null && targetName.startsWith("target") ? targetName : "target=" + targetName)
+ "$!spellOnStack=" + spellOnStack);
}
}

View file

@ -25,7 +25,7 @@ public class SacrificeAllTriggeredAbility extends TriggeredAbilityImpl {
private final TargetController sacrificingPlayer;
public SacrificeAllTriggeredAbility(Effect effect, FilterPermanent filter, TargetController sacrificingPlayer, boolean optional) {
super(Zone.ALL, effect, optional);
super(Zone.BATTLEFIELD, effect, optional);
this.filter = filter;
this.sacrificingPlayer = sacrificingPlayer;
}