forked from External/mage
...
This commit is contained in:
parent
df642c2bd5
commit
3fa0e8b8f4
544 changed files with 13327 additions and 3074 deletions
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue