mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Fix SwitchPowerToughnessTargetEffect to apply to all Targets.
This commit is contained in:
parent
f464dcfc17
commit
db25bc16de
1 changed files with 10 additions and 6 deletions
|
|
@ -10,6 +10,8 @@ import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ayratn
|
* @author ayratn
|
||||||
*/
|
*/
|
||||||
|
|
@ -30,13 +32,15 @@ public class SwitchPowerToughnessTargetEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent target = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
int affectedTargets = 0;
|
||||||
if (target == null) {
|
for (UUID uuid : getTargetPointer().getTargets(game, source)) {
|
||||||
return false;
|
Permanent target = game.getPermanent(uuid);
|
||||||
}
|
if (target != null) {
|
||||||
|
|
||||||
target.switchPowerToughness();
|
target.switchPowerToughness();
|
||||||
return true;
|
affectedTargets++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return affectedTargets > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue