This commit is contained in:
BetaSteward 2010-09-01 03:01:43 +00:00
parent df642c2bd5
commit 3fa0e8b8f4
544 changed files with 13327 additions and 3074 deletions

View file

@ -29,6 +29,7 @@
package mage.abilities.effects.common;
import mage.Constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.filter.FilterPermanent;
import mage.game.Game;
@ -38,7 +39,7 @@ import mage.game.permanent.Permanent;
*
* @author BetaSteward_at_googlemail.com
*/
public class DestroyAllControlledTargetEffect extends OneShotEffect {
public class DestroyAllControlledTargetEffect extends OneShotEffect<DestroyAllControlledTargetEffect> {
private FilterPermanent filter;
@ -47,16 +48,26 @@ public class DestroyAllControlledTargetEffect extends OneShotEffect {
this.filter = filter;
}
public DestroyAllControlledTargetEffect(final DestroyAllControlledTargetEffect effect) {
super(effect);
this.filter = effect.filter.copy();
}
@Override
public boolean apply(Game game) {
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, this.source.getFirstTarget())) {
permanent.destroy(this.source.getSourceId(), game, false);
public DestroyAllControlledTargetEffect copy() {
return new DestroyAllControlledTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget())) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;
}
@Override
public String getText() {
public String getText(Ability source) {
return "Destroy all " + filter.getMessage() + " controlled by target player";
}