mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[minor] formatting
This commit is contained in:
parent
6fe49fff2d
commit
6aee547572
3 changed files with 26 additions and 16 deletions
|
@ -27,9 +27,11 @@
|
|||
*/
|
||||
package mage.sets.scarsofmirrodin;
|
||||
|
||||
import mage.Constants;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -50,7 +52,6 @@ import mage.sets.tokens.EmptyToken;
|
|||
import mage.target.TargetCard;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
|
@ -65,7 +66,7 @@ public class PrototypePortal extends CardImpl<PrototypePortal> {
|
|||
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.
|
||||
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());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -102,10 +103,10 @@ public class PrototypePortal extends CardImpl<PrototypePortal> {
|
|||
|
||||
class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
|
||||
|
||||
private static FilterCard filter = new FilterArtifactCard();
|
||||
private static final FilterCard filter = new FilterArtifactCard();
|
||||
|
||||
public PrototypePortalEffect() {
|
||||
super(Constants.Outcome.Benefit);
|
||||
super(Outcome.Benefit);
|
||||
staticText = "exile an artifact card from your hand";
|
||||
}
|
||||
|
||||
|
@ -117,9 +118,9 @@ class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player.getHand().size() > 0) {
|
||||
TargetCard target = new TargetCard(Constants.Zone.HAND, filter);
|
||||
TargetCard target = new TargetCard(Zone.HAND, filter);
|
||||
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);
|
||||
if (card != null) {
|
||||
card.moveToExile(getId(), "Prototype Portal (Imprint)", source.getSourceId(), game);
|
||||
|
@ -143,7 +144,7 @@ class PrototypePortalEffect extends OneShotEffect<PrototypePortalEffect> {
|
|||
class PrototypePortalCreateTokenEffect extends OneShotEffect<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";
|
||||
}
|
||||
|
||||
|
@ -159,7 +160,9 @@ class PrototypePortalCreateTokenEffect extends OneShotEffect<PrototypePortalCrea
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null) return false;
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (permanent.getImprinted().size() > 0) {
|
||||
Card card = game.getCard(permanent.getImprinted().get(0));
|
||||
|
|
|
@ -403,7 +403,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
game.getPlayer(ownerId).removeFromLibrary(this, game);
|
||||
break;
|
||||
default:
|
||||
//logger.warning("moveToExile, not fully implemented: from="+fromZone);
|
||||
logger.warn("moveToExile, not fully implemented: from="+fromZone);
|
||||
}
|
||||
game.rememberLKI(objectId, event.getFromZone(), this);
|
||||
}
|
||||
|
|
|
@ -28,12 +28,17 @@
|
|||
|
||||
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.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);
|
||||
}
|
||||
|
||||
public ExileZone createZone(UUID id, String name, boolean hidden) {
|
||||
private ExileZone createZone(UUID id, String name, boolean hidden) {
|
||||
if (!exileZones.containsKey(id)) {
|
||||
ExileZone exile = new ExileZone(id, name, hidden);
|
||||
exileZones.put(id, exile);
|
||||
|
@ -89,8 +94,9 @@ public class Exile implements Serializable, Copyable<Exile> {
|
|||
|
||||
public Card getCard(UUID cardId, Game game) {
|
||||
for (ExileZone exile: exileZones.values()) {
|
||||
if (exile.contains(cardId))
|
||||
if (exile.contains(cardId)) {
|
||||
return game.getCard(cardId);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -105,8 +111,9 @@ public class Exile implements Serializable, Copyable<Exile> {
|
|||
|
||||
public void removeCard(Card card, Game game) {
|
||||
for (ExileZone exile: exileZones.values()) {
|
||||
if (exile.contains(card.getId()))
|
||||
if (exile.contains(card.getId())) {
|
||||
exile.remove(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue