[refactoring][minor] unused imports and formatting

This commit is contained in:
North 2012-05-07 08:19:13 +03:00
parent cad29a2102
commit 67cc42c637
2 changed files with 70 additions and 69 deletions

View file

@ -30,9 +30,7 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
@ -45,7 +43,7 @@ import mage.target.TargetPermanent;
* @author Loki
*/
public class SliceinTwain extends CardImpl<SliceinTwain> {
private static FilterPermanent filter = new FilterPermanent("artifact or enchantment");
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);

View file

@ -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.Duration;
@ -52,6 +51,7 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
this.filter = filter;
this.onlyCombat = onlyCombat;
}
public PreventAllDamageEffect(Duration duration, Boolean onlyCombat) {
super(duration);
this.onlyCombat = onlyCombat;
@ -64,8 +64,9 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
public PreventAllDamageEffect(final PreventAllDamageEffect effect) {
super(effect);
if (effect.filter != null)
if (effect.filter != null) {
this.filter = effect.filter.copy();
}
this.onlyCombat = effect.onlyCombat;
}
@ -92,7 +93,6 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
sourceName.insert(0, "Damage").append(" has been prevented: ").append(damage);
event.setAmount(0);
game.informPlayers(sourceName.toString());
// game.informPlayers("Damage" + sourceName + " has been prevented: " + damage);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
}
return false;
@ -103,21 +103,24 @@ public class PreventAllDamageEffect extends PreventionEffectImpl<PreventAllDamag
if (super.applies(event, source, game) && event instanceof DamageEvent) {
DamageEvent damageEvent = (DamageEvent) event;
if (damageEvent.isCombatDamage() || !onlyCombat) {
if (filter == null)
if (filter == null) {
return true;
}
Permanent permanent = game.getPermanent(damageEvent.getSourceId());
if (permanent != null && filter.match(permanent))
if (permanent != null && filter.match(permanent)) {
return true;
}
}
}
return false;
}
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder("Prevent all ");
if (onlyCombat)
if (onlyCombat) {
sb.append("combat ");
}
sb.append("damage ");
sb.append(duration.toString());
if (filter != null) {