Merge origin/master

Conflicts:
	Mage.Sets/src/mage/sets/AetherRevolt.java
This commit is contained in:
LevelX2 2017-01-06 21:57:18 +01:00
commit 7ec9394a83
23 changed files with 1349 additions and 294 deletions

View file

@ -0,0 +1,47 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author Styxo
*/
public class ExileAttachedEffect extends OneShotEffect {
public ExileAttachedEffect() {
super(Outcome.Exile);
staticText = "Exile enchanted creature";
}
public ExileAttachedEffect(final ExileAttachedEffect effect) {
super(effect);
}
@Override
public ExileAttachedEffect copy() {
return new ExileAttachedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null) {
controller.moveCardsToExile(creature, source, game, true, null, "");
}
}
return false;
}
}

View file

@ -0,0 +1,43 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
*
* @author Styxo
*/
public class ExileUntilSourceLeavesEffect extends OneShotEffect {
public ExileUntilSourceLeavesEffect(String targetName) {
super(Outcome.Benefit);
this.staticText = "exile target " + targetName + " an opponent controls until {this} leaves the battlefield";
}
public ExileUntilSourceLeavesEffect(final ExileUntilSourceLeavesEffect effect) {
super(effect);
}
@Override
public ExileUntilSourceLeavesEffect copy() {
return new ExileUntilSourceLeavesEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source);
}
return false;
}
}

View file

@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class StaticFilters {
public static final FilterArtifactCreaturePermanent FILTER_ARTIFACT_CREATURE_PERMANENT = new FilterArtifactCreaturePermanent();
public static final FilterCreaturePermanent FILTER_ARTIFACT_CREATURE_PERMANENT = new FilterArtifactCreaturePermanent();
public static final FilterPermanent FILTER_PERMANENT_ARTIFACT_OR_CREATURE = new FilterPermanent("artifact or creature");
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE = new FilterControlledPermanent("artifact or creature you control");
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_ARTIFACT = new FilterControlledArtifactPermanent();

View file

@ -34,7 +34,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*
* @author LevelX2
*/
public class FilterArtifactCreaturePermanent extends FilterArtifactPermanent {
public class FilterArtifactCreaturePermanent extends FilterCreaturePermanent {
public FilterArtifactCreaturePermanent() {
this("artifact creature");
@ -42,7 +42,7 @@ public class FilterArtifactCreaturePermanent extends FilterArtifactPermanent {
public FilterArtifactCreaturePermanent(String name) {
super(name);
this.add(new CardTypePredicate(CardType.CREATURE));
this.add(new CardTypePredicate(CardType.ARTIFACT));
}
public FilterArtifactCreaturePermanent(final FilterArtifactCreaturePermanent filter) {