[HOU] Added 4 cards and some fixes.

This commit is contained in:
LevelX2 2017-06-28 17:03:26 +02:00
parent 6a86cb6717
commit 886022fd19
9 changed files with 682 additions and 165 deletions

View file

@ -43,8 +43,15 @@ import mage.util.CardUtil;
*/
public class UntapTargetEffect extends OneShotEffect {
protected boolean useOnlyTargetPointer;
public UntapTargetEffect() {
this(true);
}
public UntapTargetEffect(boolean useOnlyTargetPointer) {
super(Outcome.Untap);
this.useOnlyTargetPointer = useOnlyTargetPointer;
}
public UntapTargetEffect(final UntapTargetEffect effect) {
@ -58,10 +65,21 @@ public class UntapTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
for (UUID target : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.untap(game);
if (!useOnlyTargetPointer && source.getTargets().size() > 1) {
source.getTargets().forEach((target) -> {
for (UUID targetId : target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
permanent.untap(game);
}
}
});
} else {
for (UUID target : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.untap(game);
}
}
}
return true;