* Dromoka's Command - Fixed that the first mode could target Dromoka's Command itself.

This commit is contained in:
LevelX2 2015-11-27 16:31:46 +01:00
parent f23756c20b
commit 5a2febc385

View file

@ -40,14 +40,12 @@ import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterStackObject;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.common.FilterInstantOrSorcerySpell;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPlayer;
import mage.target.TargetStackObject;
import mage.target.TargetSpell;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -57,15 +55,11 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class DromokasCommand extends CardImpl {
private static final FilterStackObject filterInstantOrSorcery = new FilterStackObject("instant or sorcery spell");
private static final FilterEnchantmentPermanent filterEnchantment = new FilterEnchantmentPermanent("an enchantment");
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature to put a +1/+1 counter on it");
private static final FilterCreaturePermanent filterUncontrolledCreature = new FilterCreaturePermanent("creature you don't control");
static {
filterInstantOrSorcery.add(Predicates.or(new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
filterUncontrolledCreature.add(new ControllerPredicate(TargetController.NOT_YOU));
}
@ -79,9 +73,9 @@ public class DromokasCommand extends CardImpl {
// Prevent all damage target instant or sorcery spell would deal this turn;
this.getSpellAbility().getEffects().add(new PreventDamageByTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().getTargets().add(new TargetStackObject(filterInstantOrSorcery));
this.getSpellAbility().getTargets().add(new TargetSpell(new FilterInstantOrSorcerySpell()));
// or Target player sacrifices an enchantment;
// or Target player sacrifices an enchantment;
Mode mode = new Mode();
Effect effect = new SacrificeEffect(filterEnchantment, 1, "target player");
effect.setText("Target player sacrifices an enchantment");