Phyrexian Dreadnought - fixed that it can’t use itself for sacrifice cost (#13552)

This commit is contained in:
Callumvl 2025-04-18 16:23:17 +10:00 committed by GitHub
parent 817fb03b72
commit b87c22da6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,6 @@ import mage.constants.SubType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
@ -56,10 +55,6 @@ class PhyrexianDreadnoughtSacrificeCost extends CostImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("any number of creatures with total power 12 or greater");
static {
filter.add(AnotherPredicate.instance);
}
public PhyrexianDreadnoughtSacrificeCost() {
this.addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, filter, true));
this.text = "sacrifice any number of creatures with total power 12 or greater";
@ -89,9 +84,7 @@ class PhyrexianDreadnoughtSacrificeCost extends CostImpl {
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
int sumPower = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game)) {
if (!permanent.getId().equals(source.getSourceId())) {
sumPower += permanent.getPower().getValue();
}
sumPower += permanent.getPower().getValue();
}
return sumPower >= 12;
}