mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
[KTK] added 8 golden cards.
This commit is contained in:
parent
da64b8757a
commit
a42a03355e
11 changed files with 831 additions and 8 deletions
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -43,11 +43,19 @@ import mage.players.Player;
|
|||
|
||||
public class UntapAllControllerEffect extends OneShotEffect {
|
||||
|
||||
private FilterPermanent filter;
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public UntapAllControllerEffect(FilterPermanent filter) {
|
||||
this(filter, null);
|
||||
}
|
||||
|
||||
public UntapAllControllerEffect(FilterPermanent filter, String rule) {
|
||||
super(Outcome.Untap);
|
||||
staticText = rule;
|
||||
if (rule == null || rule.isEmpty()) {
|
||||
staticText = "untap all " + filter.getMessage() + " you control";
|
||||
} else {
|
||||
staticText = rule;
|
||||
}
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
|
|
@ -60,8 +68,8 @@ public class UntapAllControllerEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (Permanent land: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
land.untap(game);
|
||||
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -73,4 +81,4 @@ public class UntapAllControllerEffect extends OneShotEffect {
|
|||
return new UntapAllControllerEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEff
|
|||
public UntapAllDuringEachOtherPlayersUntapStepEffect(FilterPermanent filter) {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Untap);
|
||||
this.filter = filter;
|
||||
staticText = new StringBuilder("Untap all ").append(filter.getMessage()).append(" during each other player's untap step").toString();
|
||||
staticText = setStaticText();
|
||||
}
|
||||
|
||||
public UntapAllDuringEachOtherPlayersUntapStepEffect(final UntapAllDuringEachOtherPlayersUntapStepEffect effect) {
|
||||
|
|
@ -100,4 +100,14 @@ public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEff
|
|||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.RulesEffects;
|
||||
}
|
||||
|
||||
private String setStaticText() {
|
||||
StringBuilder sb = new StringBuilder("Untap ");
|
||||
if (!filter.getMessage().startsWith("each")) {
|
||||
sb.append("all ");
|
||||
}
|
||||
sb.append(filter.getMessage());
|
||||
sb.append(" during each other player's untap step");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue