mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Phyrexian Dreadnought - fixed that it can’t use itself for sacrifice cost (#13552)
This commit is contained in:
parent
817fb03b72
commit
b87c22da6a
1 changed files with 1 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue