refactors: common class for "return all xxx from your graveyard to the battlefield" (#13034)

* refactor: new ReturnFromYourGraveyardToBattlefieldAllEffect

* refactor: new ShuffleYourGraveyardIntoLibraryEffect

also new PutIntoGraveFromLibrarySourceTriggeredAbility
This commit is contained in:
xenohedron 2024-10-26 16:20:31 -04:00 committed by GitHub
parent 001f9e866f
commit 2969ba58be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 308 additions and 1024 deletions

View file

@ -1,4 +1,3 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
@ -13,8 +12,8 @@ import mage.game.permanent.Permanent;
*/
public class DestroyAllEffect extends OneShotEffect {
private FilterPermanent filter;
private boolean noRegen;
private final FilterPermanent filter;
private final boolean noRegen;
public DestroyAllEffect(FilterPermanent filter) {
this(filter, false);
@ -24,11 +23,7 @@ public class DestroyAllEffect extends OneShotEffect {
super(Outcome.DestroyPermanent);
this.filter = filter;
this.noRegen = noRegen;
if (noRegen) {
staticText = "destroy all " + filter.getMessage() + ". They can't be regenerated";
} else {
staticText = "destroy all " + filter.getMessage();
}
this.staticText = "destroy all " + filter.getMessage() + (noRegen ? ". They can't be regenerated" : "");
}
protected DestroyAllEffect(final DestroyAllEffect effect) {