[minor] formatting

This commit is contained in:
LevelX2 2013-05-30 15:25:51 +02:00
parent 6fe49fff2d
commit 6aee547572
3 changed files with 26 additions and 16 deletions

View file

@ -27,9 +27,11 @@
*/ */
package mage.sets.scarsofmirrodin; package mage.sets.scarsofmirrodin;
import mage.Constants; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -50,7 +52,6 @@ import mage.sets.tokens.EmptyToken;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.UUID;
/** /**
* @author nantuko * @author nantuko
@ -65,7 +66,7 @@ public class PrototypePortal extends CardImpl<PrototypePortal> {
this.addAbility(new EntersBattlefieldTriggeredAbility(new PrototypePortalEffect(), true)); this.addAbility(new EntersBattlefieldTriggeredAbility(new PrototypePortalEffect(), true));
// {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. // {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new PrototypePortalCreateTokenEffect(), new ManaCostsImpl("{X}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PrototypePortalCreateTokenEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
this.addAbility(ability); this.addAbility(ability);
} }
@ -102,10 +103,10 @@ public class PrototypePortal extends CardImpl<PrototypePortal> {
class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> { class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
private static FilterCard filter = new FilterArtifactCard(); private static final FilterCard filter = new FilterArtifactCard();
public PrototypePortalEffect() { public PrototypePortalEffect() {
super(Constants.Outcome.Benefit); super(Outcome.Benefit);
staticText = "exile an artifact card from your hand"; staticText = "exile an artifact card from your hand";
} }
@ -117,9 +118,9 @@ class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player.getHand().size() > 0) { if (player.getHand().size() > 0) {
TargetCard target = new TargetCard(Constants.Zone.HAND, filter); TargetCard target = new TargetCard(Zone.HAND, filter);
target.setRequired(true); target.setRequired(true);
player.choose(Constants.Outcome.Benefit, player.getHand(), target, game); player.choose(Outcome.Benefit, player.getHand(), target, game);
Card card = player.getHand().get(target.getFirstTarget(), game); Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) { if (card != null) {
card.moveToExile(getId(), "Prototype Portal (Imprint)", source.getSourceId(), game); card.moveToExile(getId(), "Prototype Portal (Imprint)", source.getSourceId(), game);
@ -143,7 +144,7 @@ class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
class PrototypePortalCreateTokenEffect extends OneShotEffect<PrototypePortalCreateTokenEffect> { class PrototypePortalCreateTokenEffect extends OneShotEffect<PrototypePortalCreateTokenEffect> {
public PrototypePortalCreateTokenEffect() { public PrototypePortalCreateTokenEffect() {
super(Constants.Outcome.PutCreatureInPlay); super(Outcome.PutCreatureInPlay);
this.staticText = "Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card"; this.staticText = "Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card";
} }
@ -159,7 +160,9 @@ class PrototypePortalCreateTokenEffect extends OneShotEffect<PrototypePortalCrea
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent == null) return false; if (permanent == null) {
return false;
}
if (permanent.getImprinted().size() > 0) { if (permanent.getImprinted().size() > 0) {
Card card = game.getCard(permanent.getImprinted().get(0)); Card card = game.getCard(permanent.getImprinted().get(0));

View file

@ -403,7 +403,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
game.getPlayer(ownerId).removeFromLibrary(this, game); game.getPlayer(ownerId).removeFromLibrary(this, game);
break; break;
default: default:
//logger.warning("moveToExile, not fully implemented: from="+fromZone); logger.warn("moveToExile, not fully implemented: from="+fromZone);
} }
game.rememberLKI(objectId, event.getFromZone(), this); game.rememberLKI(objectId, event.getFromZone(), this);
} }

View file

@ -28,12 +28,17 @@
package mage.game; package mage.game;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import mage.cards.Card; import mage.cards.Card;
import mage.util.Copyable; import mage.util.Copyable;
import java.io.Serializable;
import java.util.*;
import java.util.Map.Entry;
/** /**
* *
@ -75,7 +80,7 @@ public class Exile implements Serializable, Copyable<Exile> {
return createZone(id, name + " - Exile", false); return createZone(id, name + " - Exile", false);
} }
public ExileZone createZone(UUID id, String name, boolean hidden) { private ExileZone createZone(UUID id, String name, boolean hidden) {
if (!exileZones.containsKey(id)) { if (!exileZones.containsKey(id)) {
ExileZone exile = new ExileZone(id, name, hidden); ExileZone exile = new ExileZone(id, name, hidden);
exileZones.put(id, exile); exileZones.put(id, exile);
@ -89,8 +94,9 @@ public class Exile implements Serializable, Copyable<Exile> {
public Card getCard(UUID cardId, Game game) { public Card getCard(UUID cardId, Game game) {
for (ExileZone exile: exileZones.values()) { for (ExileZone exile: exileZones.values()) {
if (exile.contains(cardId)) if (exile.contains(cardId)) {
return game.getCard(cardId); return game.getCard(cardId);
}
} }
return null; return null;
} }
@ -105,8 +111,9 @@ public class Exile implements Serializable, Copyable<Exile> {
public void removeCard(Card card, Game game) { public void removeCard(Card card, Game game) {
for (ExileZone exile: exileZones.values()) { for (ExileZone exile: exileZones.values()) {
if (exile.contains(card.getId())) if (exile.contains(card.getId())) {
exile.remove(card); exile.remove(card);
}
} }
} }