Add more missing copy constructors. (#10758)

This commit is contained in:
Susucre 2023-08-06 02:53:32 +02:00 committed by GitHub
parent 3bf2b0aac3
commit fa77261e3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 8 deletions

View file

@ -1,9 +1,6 @@
package mage.abilities.effects.common.combat;
import java.util.Locale;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.RequirementEffect;
import mage.constants.AttachmentType;
@ -11,20 +8,20 @@ import mage.constants.Duration;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.Locale;
import java.util.UUID;
/**
* @author LevelX2
*/
public class MustBeBlockedByAllAttachedEffect extends RequirementEffect {
protected AttachmentType attachmentType;
public MustBeBlockedByAllAttachedEffect(AttachmentType attachmentType) {
this(Duration.WhileOnBattlefield, attachmentType);
}
public MustBeBlockedByAllAttachedEffect(Duration duration, AttachmentType attachmentType) {
super(duration);
this.attachmentType = attachmentType;
staticText = "All creatures able to block " + attachmentType.verb().toLowerCase(Locale.ENGLISH) + " creature do so";
}

View file

@ -44,4 +44,13 @@ class AddPoisonCountersEffect extends AddCountersTargetEffect {
setText(n == 1 ? "that player gets a poison counter"
: String.format("that player gets %d poison counters", n));
}
private AddPoisonCountersEffect(final AddPoisonCountersEffect effect) {
super(effect);
}
@Override
public AddPoisonCountersEffect copy() {
return new AddPoisonCountersEffect(this);
}
}