From 773e68d7601410c41d98076f76b96713dc6522c1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 25 Apr 2013 00:27:00 +0200 Subject: [PATCH] [Minor] formatting. --- .../src/mage/sets/avacynrestored/Outwit.java | 175 +++++++++--------- .../EntersBattlefieldAllTriggeredAbility.java | 4 +- 2 files changed, 89 insertions(+), 90 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java b/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java index cdeaf2a9c2..89d401085c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Outwit.java @@ -75,110 +75,109 @@ public class Outwit extends CardImpl { return new Outwit(this); } - private class CustomTargetSpell extends TargetObject { protected FilterSpell filter; - public CustomTargetSpell() { - this(1, 1, new FilterSpell()); - } - - public CustomTargetSpell(FilterSpell filter) { - this(1, 1, filter); - } - - public CustomTargetSpell(int numTargets, FilterSpell filter) { - this(numTargets, numTargets, filter); - } - - public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Constants.Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } - - public CustomTargetSpell(final CustomTargetSpell target) { - super(target); - this.filter = target.filter.copy(); - } - - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } - - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - if (super.canTarget(id, source, game)) { - if (targetsPlayer(id, game)) { - return true; + public CustomTargetSpell() { + this(1, 1, new FilterSpell()); } - } - return false; - } - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { - if (targetsPlayer(stackObject.getId(), game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } + public CustomTargetSpell(FilterSpell filter) { + this(1, 1, filter); } - } - return false; - } - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { - if (targetsPlayer(stackObject.getId(), game)) { - possibleTargets.add(stackObject.getId()); - } + public CustomTargetSpell(int numTargets, FilterSpell filter) { + this(numTargets, numTargets, filter); } + + public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Constants.Zone.STACK; + this.filter = filter; + this.targetName = filter.getMessage(); + } + + public CustomTargetSpell(final CustomTargetSpell target) { + super(target); + this.filter = target.filter.copy(); + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + if (super.canTarget(id, source, game)) { + if (targetsPlayer(id, game)) { + return true; } - return possibleTargets; - } + } + return false; + } - @Override - public Filter getFilter() { - return filter; - } - - private boolean targetsPlayer(UUID id, Game game) { - StackObject spell = game.getStack().getStackObject(id); - if (spell != null) { - Ability ability = spell.getStackAbility(); - if (ability != null && !ability.getTargets().isEmpty()) { - for (Target target : ability.getTargets()) { - for (UUID playerId : target.getTargets()) { - Player player = game.getPlayer(playerId); - if (player != null) { + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + int count = 0; + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { + if (targetsPlayer(stackObject.getId(), game)) { + count++; + if (count >= this.minNumberOfTargets) return true; + } + } + } + return false; + } + + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) { + if (targetsPlayer(stackObject.getId(), game)) { + possibleTargets.add(stackObject.getId()); + } + } + } + return possibleTargets; + } + + @Override + public Filter getFilter() { + return filter; + } + + private boolean targetsPlayer(UUID id, Game game) { + StackObject spell = game.getStack().getStackObject(id); + if (spell != null) { + Ability ability = spell.getStackAbility(); + if (ability != null && !ability.getTargets().isEmpty()) { + for (Target target : ability.getTargets()) { + for (UUID playerId : target.getTargets()) { + Player player = game.getPlayer(playerId); + if (player != null) { + return true; + } } } } } - } - return false; - } + return false; + } - @Override - public CustomTargetSpell copy() { - return new CustomTargetSpell(this); - } + @Override + public CustomTargetSpell copy() { + return new CustomTargetSpell(this); + } } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java index fb2906c4dc..aea3f50ac9 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java @@ -117,9 +117,9 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { StringBuilder sb = new StringBuilder("Whenever ").append(filter.getMessage()); sb.append(" enters the battlefield"); if (controlled) { - sb.append("under your control,"); + sb.append("under your control, "); } else { - sb.append(","); + sb.append(", "); } sb.append(super.getRule()); return sb.toString();