mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Rework Cephalid Snitch. Fixes #8520
This commit is contained in:
parent
743f9e4b3b
commit
f1390faf58
2 changed files with 41 additions and 41 deletions
|
|
@ -15,7 +15,6 @@ import mage.game.stack.StackObject;
|
|||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -29,6 +28,7 @@ public class ProtectionAbility extends StaticAbility {
|
|||
protected boolean removeAuras;
|
||||
protected boolean removeEquipment;
|
||||
protected boolean doesntRemoveControlled;
|
||||
protected ObjectColor fromColor;
|
||||
protected UUID auraIdNotToBeRemoved; // defines an Aura objectId that will not be removed from this protection ability
|
||||
|
||||
public ProtectionAbility(Filter filter) {
|
||||
|
|
@ -37,6 +37,7 @@ public class ProtectionAbility extends StaticAbility {
|
|||
this.removeAuras = true;
|
||||
this.removeEquipment = true;
|
||||
this.doesntRemoveControlled = false;
|
||||
this.fromColor = new ObjectColor();
|
||||
this.auraIdNotToBeRemoved = null;
|
||||
}
|
||||
|
||||
|
|
@ -46,19 +47,25 @@ public class ProtectionAbility extends StaticAbility {
|
|||
this.removeAuras = ability.removeAuras;
|
||||
this.removeEquipment = ability.removeEquipment;
|
||||
this.doesntRemoveControlled = ability.doesntRemoveControlled;
|
||||
this.fromColor = ability.fromColor;
|
||||
this.auraIdNotToBeRemoved = ability.auraIdNotToBeRemoved;
|
||||
}
|
||||
|
||||
public static ProtectionAbility from(ObjectColor color) {
|
||||
FilterObject filter = new FilterObject(getFilterText(color));
|
||||
filter.add(new ColorPredicate(color));
|
||||
return new ProtectionAbility(filter);
|
||||
ProtectionAbility ability = new ProtectionAbility(filter);
|
||||
ability.getFromColor().addColor(color);
|
||||
return ability;
|
||||
}
|
||||
|
||||
public static ProtectionAbility from(ObjectColor color1, ObjectColor color2) {
|
||||
FilterObject filter = new FilterObject(color1.getDescription() + " and from " + color2.getDescription());
|
||||
filter.add(Predicates.or(new ColorPredicate(color1), new ColorPredicate(color2)));
|
||||
return new ProtectionAbility(filter);
|
||||
ProtectionAbility ability = new ProtectionAbility(filter);
|
||||
ability.getFromColor().addColor(color1);
|
||||
ability.getFromColor().addColor(color2);
|
||||
return ability;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -167,6 +174,10 @@ public class ProtectionAbility extends StaticAbility {
|
|||
return doesntRemoveControlled;
|
||||
}
|
||||
|
||||
public ObjectColor getFromColor() {
|
||||
return fromColor;
|
||||
}
|
||||
|
||||
public UUID getAuraIdNotToBeRemoved() {
|
||||
return auraIdNotToBeRemoved;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue