mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Untap All Lands Effect - Added Filter
This commit is contained in:
parent
c4081c8020
commit
1132bb8eb2
1 changed files with 12 additions and 4 deletions
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.constants.Outcome;
|
||||
|
@ -40,23 +39,32 @@ import mage.players.Player;
|
|||
*
|
||||
* @author Viserion
|
||||
*/
|
||||
|
||||
public class UntapAllLandsControllerEffect extends OneShotEffect {
|
||||
|
||||
private final FilterLandPermanent filter;
|
||||
|
||||
public UntapAllLandsControllerEffect() {
|
||||
super(Outcome.Untap);
|
||||
staticText = "Untap all lands you control";
|
||||
filter = new FilterLandPermanent();
|
||||
}
|
||||
|
||||
public UntapAllLandsControllerEffect(final UntapAllLandsControllerEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
public UntapAllLandsControllerEffect(FilterLandPermanent filter) {
|
||||
super(Outcome.Untap);
|
||||
staticText = "Untap all " + filter.getMessage() + " you control";
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (Permanent land: game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), player.getId(), game)) {
|
||||
for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
land.untap(game);
|
||||
}
|
||||
return true;
|
||||
|
@ -69,4 +77,4 @@ public class UntapAllLandsControllerEffect extends OneShotEffect {
|
|||
return new UntapAllLandsControllerEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue