Merge branch 'master' into add-minimum-rating-option

This commit is contained in:
Aaron Miller 2018-09-29 19:15:46 -07:00
commit 5cd57199c7
348 changed files with 1560 additions and 1096 deletions

View file

@ -33,8 +33,8 @@ public final class Config {
static {
Properties p = new Properties();
try {
p.load(new FileInputStream(new File("config/config.properties")));
try(FileInputStream fis =new FileInputStream(new File("config/config.properties"))) {
p.load(fis);
} catch (IOException ex) {
logger.fatal("Config error ", ex);
}

View file

@ -129,7 +129,10 @@ public enum ScryfallImageSource implements CardImageSource {
supportedSets.add("WWK");
supportedSets.add("DDE");
supportedSets.add("ROE");
// duels of the planewalkers:
supportedSets.add("DPA");
supportedSets.add("DPAP");
//
supportedSets.add("ARC");
supportedSets.add("M11");
supportedSets.add("V10");
@ -231,6 +234,9 @@ public enum ScryfallImageSource implements CardImageSource {
supportedSets.add("M19");
supportedSets.add("GS1");
supportedSets.add("GRN");
//
supportedSets.add("EURO");
supportedSets.add("GPX");
}
@Override
@ -245,6 +251,15 @@ public enum ScryfallImageSource implements CardImageSource {
String baseUrl = null;
String alternativeUrl = null;
// direct links to images (non localization)
if (baseUrl == null) {
String linkCode = card.getSet() + "/" + card.getName();
if (directDownloadLinks.containsKey(linkCode)) {
baseUrl = directDownloadLinks.get(linkCode);
alternativeUrl = null;
}
}
// special card number like "103a" already compatible
if (baseUrl == null && card.isCollectorIdWithStr()) {
baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet()) + "/"
@ -330,6 +345,40 @@ public enum ScryfallImageSource implements CardImageSource {
put("MPS-AKH", "mp2");
put("MBP", "pmei");
put("WMCQ", "pwcq");
put("EURO", "pelp");
put("GPX", "pgpx");
}
};
private static final Map<String, String> directDownloadLinks = new HashMap<String, String>() {
{
// direct links to download images for special cards
// Duels of the Planeswalkers Promos -- xmage uses one set (DPAP), but scryfall store it by years
// 2009 - https://scryfall.com/sets/pdtp
put("DPAP/Garruk Wildspeaker", "https://img.scryfall.com/cards/large/en/pdtp/1.jpg");
// 2010 - https://scryfall.com/sets/pdp10
put("DPAP/Liliana Vess", "https://img.scryfall.com/cards/large/en/pdp10/1.jpg");
put("DPAP/Nissa Revane", "https://img.scryfall.com/cards/large/en/pdp10/2.jpg");
// 2011 - https://scryfall.com/sets/pdp11
put("DPAP/Frost Titan", "https://img.scryfall.com/cards/large/en/pdp11/1.jpg");
put("DPAP/Grave Titan", "https://img.scryfall.com/cards/large/en/pdp11/2.jpg");
put("DPAP/Inferno Titan", "https://img.scryfall.com/cards/large/en/pdp11/3.jpg");
// 2012 - https://scryfall.com/sets/pdp12
put("DPAP/Primordial Hydra", "https://img.scryfall.com/cards/large/en/pdp12/1.jpg");
put("DPAP/Serra Avatar", "https://img.scryfall.com/cards/large/en/pdp12/2.jpg");
put("DPAP/Vampire Nocturnus", "https://img.scryfall.com/cards/large/en/pdp12/3.jpg");
// 2013 - https://scryfall.com/sets/pdp13
put("DPAP/Bonescythe Sliver", "https://img.scryfall.com/cards/large/en/pdp13/1.jpg");
put("DPAP/Ogre Battledriver", "https://img.scryfall.com/cards/large/en/pdp13/2.jpg");
put("DPAP/Scavenging Ooze", "https://img.scryfall.com/cards/large/en/pdp13/3.jpg");
// 2014 - https://scryfall.com/sets/pdp14
put("DPAP/Soul of Ravnica", "https://img.scryfall.com/cards/large/en/pdp14/1.jpg");
put("DPAP/Soul of Zendikar", "https://img.scryfall.com/cards/large/en/pdp14/2.jpg");
// TODO: remove Grand Prix fix after scryfall fix image's link (that's link must be work: https://img.scryfall.com/cards/large/en/pgpx/2016b.jpg )
put("GPX/Sword of Feast and Famine", "https://img.scryfall.com/cards/large/en/pgpx/1%E2%98%85.jpg");
}
};

View file

@ -140,7 +140,7 @@ public enum WizardCardsImageSource implements CardImageSource {
supportedSets.add("WWK");
supportedSets.add("DDE");
supportedSets.add("ROE");
supportedSets.add("DPA");
//supportedSets.add("DPA");
supportedSets.add("ARC");
supportedSets.add("M11");
supportedSets.add("V10");

View file

@ -39,7 +39,7 @@ public class ActionData {
this.gameId = gameId;
}
public class CustomExclusionStrategy implements ExclusionStrategy {
static class CustomExclusionStrategy implements ExclusionStrategy {
// FIXME: Very crude way of whitelisting, as it applies to all levels of the JSON tree.
private final java.util.Set<String> KEEP = new java.util.HashSet<>(

View file

@ -2,6 +2,7 @@ package mage.utils.properties;
import org.apache.log4j.Logger;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
@ -19,39 +20,36 @@ public final class PropertiesUtil {
private static Properties properties = new Properties();
static {
InputStream in = PropertiesUtil.class.getResourceAsStream("/xmage.properties");
if (in != null) {
try {
properties.load(in);
} catch (IOException e) {
logger.error("Couldn't load properties", e);
}
} else {
try (InputStream in = PropertiesUtil.class.getResourceAsStream("/xmage.properties")) {
properties.load(in);
} catch (FileNotFoundException fnfe) {
logger.warn("No xmage.properties were found on classpath");
} catch (IOException e) {
logger.error("Couldn't load properties");
e.printStackTrace();
}
}
/**
* Hide constructor
*/
/**
* Hide constructor
*/
private PropertiesUtil() {
}
public static String getDBLogUrl() {
String url = properties.getProperty(PropertyKeys.KEY_DB_LOG_URL, LOG_JDBC_URL);
if (url != null) {
return url.trim();
}
return null;
}
public static String getDBFeedbackUrl() {
String url = properties.getProperty(PropertyKeys.KEY_DB_FEEDBACK_URL, FEEDBACK_JDBC_URL);
if (url != null) {
return url.trim();
public static String getDBLogUrl () {
String url = properties.getProperty(PropertyKeys.KEY_DB_LOG_URL, LOG_JDBC_URL);
if (url != null) {
return url.trim();
}
return null;
}
public static String getDBFeedbackUrl () {
String url = properties.getProperty(PropertyKeys.KEY_DB_FEEDBACK_URL, FEEDBACK_JDBC_URL);
if (url != null) {
return url.trim();
}
return null;
}
return null;
}
}

View file

@ -686,7 +686,7 @@ public class MageServerImpl implements MageServer {
} catch (Exception ex) {
handleException(ex);
}
return null;
return Optional.empty();
}
@Override

View file

@ -153,15 +153,15 @@ public final class Main {
for (ExtensionPackage pkg : extensions) {
Map<String, Class> draftCubes = pkg.getDraftCubes();
for (String name : draftCubes.keySet()) {
logger.info("Loading extension: [" + name + "] " + draftCubes.get(name).toString());
CubeFactory.instance.addDraftCube(name, draftCubes.get(name));
}
draftCubes.forEach((name, draftCube) -> {
logger.info("Loading extension: [" + name + "] " + draftCube.toString());
CubeFactory.instance.addDraftCube(name, draftCube);
});
Map<String, Class> deckTypes = pkg.getDeckTypes();
for (String name : deckTypes.keySet()) {
logger.info("Loading extension: [" + name + "] " + deckTypes.get(name));
DeckValidatorFactory.instance.addDeckType(name, deckTypes.get(name));
}
deckTypes.forEach((name, deckType) -> {
logger.info("Loading extension: [" + name + "] " + deckType);
DeckValidatorFactory.instance.addDeckType(name, deckType);
});
}
logger.info("Config - max seconds idle: " + config.getMaxSecondsIdle());

View file

@ -26,7 +26,7 @@ public enum SessionManager {
logger.trace("Session with sessionId " + sessionId + " is not found");
return Optional.empty();
}
if (session.getUserId() != null && UserManager.instance.getUser(session.getUserId()) == null) {
if (session.getUserId() != null && !UserManager.instance.getUser(session.getUserId()).isPresent()) {
logger.error("User for session " + sessionId + " with userId " + session.getUserId() + " is missing. Session removed.");
// can happen if user from same host signs in multiple time with multiple clients, after he disconnects with one client
disconnect(sessionId, DisconnectReason.ConnectingOtherInstance);

View file

@ -972,7 +972,7 @@ public class TableController {
if (!(table.getState() == TableState.WAITING || table.getState() == TableState.STARTING || table.getState() == TableState.READY_TO_START)) {
if (match == null) {
logger.warn("- Match table with no match:");
logger.warn("-- matchId:" + match.getId() + " [" + match.getName() + ']');
logger.warn("-- matchId:" + match.getId() + " , table : " + table.getId());
// return false;
} else if (match.isDoneSideboarding() && match.getGame() == null) {
// no sideboarding and not active game -> match seems to hang (maybe the Draw bug)

View file

@ -266,13 +266,13 @@ public class GameController implements GameCallback {
public void join(UUID userId) {
UUID playerId = userPlayerMap.get(userId);
Optional<User> user = UserManager.instance.getUser(userId);
if (userId == null || playerId == null) {
if (playerId == null) {
logger.fatal("Join game failed!");
logger.fatal("- gameId: " + game.getId());
logger.fatal("- userId: " + userId);
return;
}
Optional<User> user = UserManager.instance.getUser(userId);
if (!user.isPresent()) {
logger.fatal("User not found : " + userId);
return;

View file

@ -3,14 +3,14 @@ package mage.server.game;
import java.util.UUID;
import java.util.concurrent.Callable;
import mage.MageException;
import mage.game.Game;
import org.apache.log4j.Logger;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
* @author BetaSteward_at_googlemail.com
*/
public class GameWorker<T> implements Callable {
@ -40,12 +40,7 @@ public class GameWorker<T> implements Callable {
} catch (Exception e) {
LOGGER.fatal("GameWorker general exception [" + game.getId() + "] " + e.getMessage(), e);
if (e instanceof NullPointerException) {
if (e.getStackTrace() == null) {
LOGGER.info("Stack trace is null");
} else {
LOGGER.info("Null-Pointer-Exception: Stack trace");
LOGGER.info(e.getStackTrace());
}
LOGGER.info(e.getStackTrace());
}
} catch (Error err) {
LOGGER.fatal("GameWorker general error [" + game.getId() + "] " + err, err);

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
@ -38,7 +38,7 @@ public final class AjaniAdversaryOfTyrants extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Put a +1/+1 counter on each of up to two target creatures.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.ControllerLifeCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
@ -34,7 +34,7 @@ public final class AjaniCallerOfThePride extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Put a +1/+1 counter on up to one target creature.
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
effect.setText("Put a +1/+1 counter on up to one target creature");

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effects;
@ -22,7 +22,6 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.players.Player;
/**
@ -36,7 +35,7 @@ public final class AjaniGoldmane extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: You gain 2 life.
this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1));

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.abilities.effects.common.counter.DistributeCountersEffect;
@ -46,7 +46,7 @@ public final class AjaniMentorOfHeroes extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Distribute three +1/+1 counters among one, two, or three target creatures you control
Ability ability = new LoyaltyAbility(new DistributeCountersEffect(CounterType.P1P1, 3, false, "one, two, or three target creatures you control"), 1);

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -45,7 +45,7 @@ public final class AjaniSteadfast extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Until end of turn, up to one target creature gets +1/+1 and gains first strike, vigilance, and lifelink.
Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.ExileAndGainLifeEqualPowerTargetEffect;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
@ -43,7 +43,7 @@ public final class AjaniUnyielding extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +2: Reveal the top three cards of your library. Put all nonland permanent cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(3, nonlandPermanentFilter, Zone.LIBRARY), 2));

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.ControllerLifeCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect;
@ -33,7 +33,7 @@ public final class AjaniValiantProtector extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +2: Put two +1/+1 counters on up to one target creature.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), 2);

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DestroyAllControlledTargetEffect;
@ -37,7 +37,7 @@ public final class AjaniVengeant extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Target permanent doesn't untap during its controller's next untap step.
LoyaltyAbility ability1 = new LoyaltyAbility(new DontUntapInControllersNextUntapStepTargetEffect(), 1);

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.ControllerLifeCount;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.GainLifeEffect;
@ -29,7 +29,7 @@ public final class AjaniWiseCounselor extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +2: You gain 1 life for each creature you control.
this.addAbility(new LoyaltyAbility(new GainLifeEffect(

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetForSourceEffect;
@ -48,7 +48,7 @@ public class AminatouTheFateShifter extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AMINATOU);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Draw a card, then put a card from your hand on top of your library.
Ability ability = new LoyaltyAbility(new AminatouPlusEffect(), +1);

View file

@ -62,7 +62,7 @@ class AnZerrinRuinsDontUntapEffect extends DontUntapInControllersUntapStepAllEff
if (super.applies(event, source, game)) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null) {
if (permanent.hasSubtype(ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game), game)) {
if (permanent.hasSubtype(ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game), game)) {
return true;
}
}

View file

@ -4,7 +4,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effects;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
@ -39,7 +39,7 @@ public final class AngrathMinotaurPirate extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ANGRATH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +2: Angrath, Minotaur Pirate deals 1 damage to target opponent and each creature that player controls.
Effects effects1 = new Effects();

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
@ -41,7 +41,7 @@ public final class AngrathTheFlameChained extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ANGRATH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Each opponent discards a card and loses 2 life.
LoyaltyAbility ability = new LoyaltyAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), 1);

View file

@ -64,7 +64,7 @@ class ConspyEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (controller != null && subType != null) {
// Creature cards you own that aren't on the battlefield
// in graveyard

View file

@ -1,9 +1,6 @@
package mage.cards.a;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -15,24 +12,27 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
import mage.cards.Card;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetCard;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInHand;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class ArcaneArtisan extends CardImpl {
@ -46,10 +46,14 @@ public final class ArcaneArtisan extends CardImpl {
this.toughness = new MageInt(3);
// {2}{U}, {T}: Target player draws a card, then exiles a card from their hand. If a creature card is exiled this way, that player creates a token that's a copy of that card.
Ability ability = new SimpleActivatedAbility(new ArcaneArtisanCreateTokenEffect(), new ManaCostsImpl("{2}{U}"));
Ability ability = new SimpleActivatedAbility(
new ArcaneArtisanCreateTokenEffect(),
new ManaCostsImpl("{2}{U}")
);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// When Arcane Artisan leaves the battlefield, exile all tokens created with it at the beginning of the next end step.
this.addAbility(new ArcaneArtisanLeavesBattlefieldTriggeredAbility());
}
@ -66,13 +70,13 @@ public final class ArcaneArtisan extends CardImpl {
class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
ArcaneArtisanCreateTokenEffect() {
public ArcaneArtisanCreateTokenEffect() {
super(Outcome.Benefit);
this.staticText = "Target player draws a card, then exiles a card from their hand. "
+ "If a creature card is exiled this way, that player creates a token that's a copy of that card.";
}
ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) {
public ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) {
super(effect);
}
@ -88,8 +92,8 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
return false;
}
player.drawCards(1, game);
Target target = new TargetCardInHand(1, new FilterCard());
if (!player.chooseTarget(Outcome.Exile, target, source, game)) {
TargetCard target = new TargetCardInHand(1, StaticFilters.FILTER_CARD);
if (!player.chooseTarget(Outcome.Exile, player.getHand(), target, source, game)) {
return false;
}
Card card = game.getCard(target.getFirstTarget());
@ -119,14 +123,14 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility {
ArcaneArtisanLeavesBattlefieldTriggeredAbility() {
public ArcaneArtisanLeavesBattlefieldTriggeredAbility() {
super(Zone.BATTLEFIELD, null,
new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ArcaneArtisanExileEffect())),
"", false
);
}
ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) {
public ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) {
super(ability);
}
@ -143,12 +147,12 @@ class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggered
class ArcaneArtisanExileEffect extends OneShotEffect {
ArcaneArtisanExileEffect() {
public ArcaneArtisanExileEffect() {
super(Outcome.Benefit);
this.staticText = "exile all tokens created with {this}.";
}
ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) {
public ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) {
super(effect);
}

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.TransformSourceEffect;
@ -35,7 +35,7 @@ public final class ArlinnKord extends CardImpl {
this.transformable = true;
this.secondSideCardClazz = ArlinnEmbracedByTheMoon.class;
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Until end of turn, up to one target creature gets +2/+2 and gains vigilance and haste.
Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);

View file

@ -31,7 +31,7 @@ public final class ArtfulTakedown extends CardImpl {
// Tap target creature.
this.getSpellAbility().addEffect(
new TapTargetEffect().setText("tap target creature")
new TapTargetEffect().setText("target creature")
);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter1));

View file

@ -57,7 +57,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(permanent.getId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(permanent.getId(), game);
if (subType != null) {
for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayVariableLoyaltyCost;
import mage.abilities.effects.ContinuousEffectImpl;
@ -35,7 +35,7 @@ public final class AshiokNightmareWeaver extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ASHIOK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Exile the top three cards of target opponent's library.
LoyaltyAbility ability = new LoyaltyAbility(new AshiokNightmareWeaverExileEffect(), 2);

View file

@ -5,7 +5,7 @@ import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageControllerEffect;
@ -37,7 +37,7 @@ public final class AurraSingBaneOfJedi extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}{R}");
this.subtype.add(SubType.AURRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1:You may have {this} deal 2 damage to target creature. If you don't, {this} deals 1 damage to you.
Ability ability = new LoyaltyAbility(new AurraSingBaneOfJediEffect(), +1);

View file

@ -55,7 +55,7 @@ public final class BlowflyInfestation extends CardImpl {
class BlowflyInfestationCondition implements Condition {
private static Permanent permanent;
private Permanent permanent;
@Override
public boolean apply(Game game, Ability source) {

View file

@ -1,6 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
@ -11,13 +10,7 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TokenPredicate;
@ -28,8 +21,9 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import mage.util.functions.EmptyApplyToPermanent;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class BrudicladTelchorEngineer extends CardImpl {
@ -52,7 +46,7 @@ public final class BrudicladTelchorEngineer extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true)));
// At the beginning of combat on your turn, create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token.
this.addAbility(new BeginningOfCombatTriggeredAbility(new BrudicladTelchorCombatffect(), TargetController.YOU, false));
this.addAbility(new BeginningOfCombatTriggeredAbility(new BrudicladTelchorEngineerEffect(), TargetController.YOU, false));
}
public BrudicladTelchorEngineer(final BrudicladTelchorEngineer card) {
@ -65,26 +59,26 @@ public final class BrudicladTelchorEngineer extends CardImpl {
}
}
class BrudicladTelchorCombatffect extends OneShotEffect {
class BrudicladTelchorEngineerEffect extends OneShotEffect {
private static final FilterControlledPermanent filter = new FilterControlledPermanent(" token you control. If you do, each other token you control becomes a copy of that token");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("token you control");
static {
filter.add(new TokenPredicate());
}
public BrudicladTelchorCombatffect() {
public BrudicladTelchorEngineerEffect() {
super(Outcome.Sacrifice);
this.staticText = " create a 2/1 blue Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token";
}
public BrudicladTelchorCombatffect(final BrudicladTelchorCombatffect effect) {
public BrudicladTelchorEngineerEffect(final BrudicladTelchorEngineerEffect effect) {
super(effect);
}
@Override
public BrudicladTelchorCombatffect copy() {
return new BrudicladTelchorCombatffect(this);
public BrudicladTelchorEngineerEffect copy() {
return new BrudicladTelchorEngineerEffect(this);
}
@Override
@ -95,7 +89,8 @@ class BrudicladTelchorCombatffect extends OneShotEffect {
if (effect.apply(game, source)) {
TargetControlledPermanent target = new TargetControlledPermanent(0, 1, filter, true);
target.setNotTarget(true);
if (controller.choose(Outcome.Neutral, target, source.getSourceId(), game)) {
if (controller.chooseUse(outcome, "Select a token to copy?", source, game)
&& controller.choose(Outcome.Neutral, target, source.getSourceId(), game)) {
Permanent toCopyFromPermanent = game.getPermanent(target.getFirstTarget());
if (toCopyFromPermanent != null) {

View file

@ -64,7 +64,7 @@ class CavernOfSoulsManaBuilder extends ConditionalManaBuilder {
@Override
public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (subType != null) {
creatureType = subType;
}

View file

@ -7,7 +7,7 @@ import mage.MageObjectReference;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardAllEffect;
@ -41,7 +41,7 @@ public final class ChandraAblaze extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Discard a card. If a red card is discarded this way, Chandra Ablaze deals 4 damage to any target.
LoyaltyAbility ability = new LoyaltyAbility(new ChandraAblazeEffect1(), 1);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effects;
import mage.abilities.effects.mana.BasicManaEffect;
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
@ -30,7 +30,7 @@ public final class ChandraBoldPyromancer extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Add {R}{R}. Chandra, Bold Pyromancer deals 2 damage to target player.
Ability ability = new LoyaltyAbility(new BasicManaEffect(Mana.RedMana(2)), +1);

View file

@ -5,7 +5,7 @@ import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayVariableLoyaltyCost;
import mage.abilities.dynamicvalue.DynamicValue;
@ -36,7 +36,7 @@ public final class ChandraFlamecaller extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Create two 3/1 red Elemental creature tokens with haste. Exile them at the beginning of the next end step.
this.addAbility(new LoyaltyAbility(new ChandraElementalEffect(), 1));

View file

@ -4,7 +4,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayVariableLoyaltyCost;
import mage.abilities.dynamicvalue.DynamicValue;
@ -33,7 +33,7 @@ public final class ChandraNalaar extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6));
// +1: Chandra Nalaar deals 1 damage to target player or planeswalker.
LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1);

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
@ -31,7 +31,7 @@ public final class ChandraPyrogenius extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +2: Chandra, Pyrogenius deals 2 damage to each opponent.
this.addAbility(new LoyaltyAbility(new DamagePlayersEffect(Outcome.Damage, new StaticValue(2), TargetController.OPPONENT), 2));

View file

@ -8,7 +8,7 @@ import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
@ -38,7 +38,7 @@ public final class ChandraPyromaster extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Chandra, Pyromaster deals 1 damage to target player and 1 damage to up to one target creature that player controls. That creature can't block this turn.
LoyaltyAbility ability1 = new LoyaltyAbility(new ChandraPyromasterEffect1(), 1);

View file

@ -6,7 +6,7 @@ import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
@ -36,7 +36,7 @@ public final class ChandraRoaringFlame extends CardImpl {
this.nightCard = true;
this.transformable = true;
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Chandra, Roaring Flame deals 2 damage to target player.
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -33,7 +33,7 @@ public final class ChandraTheFirebrand extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Chandra, the Firebrand deals 1 damage to any target.
LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1);

View file

@ -6,7 +6,7 @@ import mage.MageObjectReference;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamagePlayersEffect;
@ -37,7 +37,7 @@ public final class ChandraTorchOfDefiance extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CHANDRA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Exile the top card of your library. You may cast that card. If you don't, Chandra, Torch of Defiance deals 2 damage to each opponent.
LoyaltyAbility ability = new LoyaltyAbility(new ChandraTorchOfDefianceEffect(), 1);

View file

@ -1,7 +1,6 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.ObjectColor;
@ -13,13 +12,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterPlayer;
import mage.constants.*;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.ExileZone;
@ -31,8 +24,9 @@ import mage.players.Player;
import mage.target.TargetPlayer;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class CircuDimirLobotomist extends CardImpl {
@ -54,16 +48,16 @@ public final class CircuDimirLobotomist extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// 10/1/2005 The first two abilities target libraries, not players.
// Target Library not supported yet - used as workaround target player
// Whenever you cast a blue spell, exile the top card of target library.
Ability ability = new SpellCastControllerTriggeredAbility(new CircuDimirLobotomistEffect(), filterBlue, false);
ability.addTarget(new TargetPlayer(1, 1, true, new FilterPlayer("target library")));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// Whenever you cast a black spell, exile the top card of target library.
ability = new SpellCastControllerTriggeredAbility(new CircuDimirLobotomistEffect(), filterBlack, false);
ability.addTarget(new TargetPlayer(1, 1, true, new FilterPlayer("target library")));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// Your opponents can't cast nonland cards with the same name as a card exiled with Circu, Dimir Lobotomist.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CircuDimirLobotomistRuleModifyingEffect()));
}
@ -82,7 +76,7 @@ class CircuDimirLobotomistEffect extends OneShotEffect {
public CircuDimirLobotomistEffect() {
super(Outcome.Detriment);
this.staticText = "exile the top card of target library";
this.staticText = "exile the top card of target player's library";
}
public CircuDimirLobotomistEffect(final CircuDimirLobotomistEffect effect) {

View file

@ -66,7 +66,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (controller != null && subType != null) {
// Creature cards you own that aren't on the battlefield
// in graveyard

View file

@ -61,7 +61,7 @@ class FilterCoverOfDarkness extends FilterCreaturePermanent {
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if (super.match(permanent, sourceId, playerId, game)) {
if (subType == null) {
subType = ChooseCreatureTypeEffect.getChoosenCreatureType(sourceId, game);
subType = ChooseCreatureTypeEffect.getChosenCreatureType(sourceId, game);
if (subType == null) {
return false;
}

View file

@ -3,7 +3,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -27,7 +27,7 @@ public final class DackFayden extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DACK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Target player draws two cards, then discards two cards.
LoyaltyAbility ability = new LoyaltyAbility(new DrawCardTargetEffect(2), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
@ -47,7 +47,7 @@ public final class DarettiIngeniousIconoclast extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DARETTI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Create a 1/1 colorless Construct artifact creature token with defender.
LoyaltyAbility ability = new LoyaltyAbility(new CreateTokenEffect(new DarettiConstructToken()), 1);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -44,7 +44,7 @@ public final class DarettiScrapSavant extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DARETTI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Discard up to two cards, then draw that many cards.
this.addAbility(new LoyaltyAbility(new DarettiDiscardDrawEffect(), 2));

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.SacrificeEffect;
@ -38,7 +38,7 @@ public final class DarthSidiousSithLord extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{4}{U}{B}{B}{R}");
this.subtype.add(SubType.SIDIOUS);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +3: Destroy target noncreature permanent.
Ability ability = new LoyaltyAbility(new DestroyTargetEffect(), +3);

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.SearchEffect;
@ -37,7 +37,7 @@ public final class DarthTyranusCountOfSerenno extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{1}{W}{U}{B}");
this.subtype.add(SubType.DOOKU);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Up to one target creature gets -6/-0 until your next turn.
Effect effect = new BoostTargetEffect(-6, 0, Duration.UntilYourNextTurn);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -37,7 +37,7 @@ public final class DomriRade extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DOMRI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Look at the top card of your library. If it's a creature card, you may reveal it and put it into your hand.
this.addAbility(new LoyaltyAbility(new DomriRadeEffect1(), 1));

View file

@ -70,7 +70,7 @@ class DoomCannonFilter extends FilterControlledCreaturePermanent {
@Override
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if (super.match(permanent, sourceId, playerId, game)) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(sourceId, game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(sourceId, game);
if (subType != null && permanent.hasSubtype(subType, game)) {
return true;
}

View file

@ -71,7 +71,7 @@ class AddCounterAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(getSourceId(), game);
if (subType != null) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null

View file

@ -4,7 +4,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -35,7 +35,7 @@ public final class DovinBaan extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DOVIN);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Until your next turn, up to one target creature gets -3/-0 and its activated abilities can't be activated.
Effect effect = new BoostTargetEffect(-3, 0, Duration.UntilYourNextTurn);

View file

@ -3,7 +3,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.CreateTokenEffect;
@ -19,7 +19,6 @@ import mage.constants.Duration;
import mage.constants.SuperType;
import mage.game.command.emblems.ElspethKnightErrantEmblem;
import mage.game.permanent.token.SoldierToken;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
@ -34,7 +33,7 @@ public final class ElspethKnightErrant extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELSPETH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Create a 1/1 white Soldier creature token.
Token token = new SoldierToken();

View file

@ -3,7 +3,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -35,7 +35,7 @@ public final class ElspethSunsChampion extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELSPETH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Create three 1/1 white Soldier creature tokens.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), 1));

View file

@ -4,7 +4,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
@ -31,7 +31,7 @@ public final class ElspethTirel extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELSPETH);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
this.addAbility(new LoyaltyAbility(new ElspethTirelFirstEffect(), 2));
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), -2));

View file

@ -73,6 +73,6 @@ enum HadAnotherCreatureEnterTheBattlefieldCondition implements Condition {
PermanentsEnteredBattlefieldWatcher watcher = (PermanentsEnteredBattlefieldWatcher) game.getState().getWatchers().get(PermanentsEnteredBattlefieldWatcher.class.getSimpleName());
return sourcePermanent != null
&& watcher != null
&& watcher.AnotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(sourcePermanent, game);
&& watcher.anotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(sourcePermanent, game);
}
}

View file

@ -4,7 +4,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect;
@ -47,7 +47,7 @@ public final class EstridTheMasked extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ESTRID);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Untap each enchanted permanent you control.
this.addAbility(new LoyaltyAbility(new UntapAllControllerEffect(

View file

@ -2,6 +2,7 @@ package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyTargetSpellEffect;
@ -79,7 +80,7 @@ class ExplosionEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int xValue = source.getManaCostsToPay().getX();
Effect effect = new DamageTargetEffect(xValue);
Effect effect = new DamageTargetEffect(new StaticValue(xValue), true, "", true);
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
effect.apply(game, source);
Player player = game.getPlayer(source.getTargets().get(1).getFirstTarget());

View file

@ -128,6 +128,6 @@ class ExperimentalFrenzyRestrictionEffect extends ContinuousRuleModifyingEffectI
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(source.getControllerId())
&& event.getZone() == Zone.HAND;
&& game.getState().getZone(event.getSourceId()) == Zone.HAND;
}
}

View file

@ -4,7 +4,7 @@ package mage.cards.f;
import mage.ObjectColor;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
@ -39,7 +39,7 @@ public final class FreyaliseLlanowarsFury extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.FREYALISE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Create a 1/1 green Elf Druid creature token with "{T}: Add {G}."
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FreyaliseLlanowarsFuryToken()), 2));

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
@ -43,7 +43,7 @@ public final class GarrukApexPredator extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Destroy another target planeswalker.
LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
@ -35,7 +35,7 @@ public final class GarrukCallerOfBeasts extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Reveal the top 5 cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("creature cards"), Zone.LIBRARY), 1));

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
@ -36,7 +36,7 @@ public final class GarrukPrimalHunter extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Create a 3/3 green Beast creature token.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), 1));

View file

@ -1,48 +1,44 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author nantuko
*/
public final class GarrukRelentless extends CardImpl {
public GarrukRelentless(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.transformable = true;
this.secondSideCardClazz = GarrukTheVeilCursed.class;
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// When Garruk Relentless has two or fewer loyalty counters on him, transform him.
this.addAbility(new TransformAbility());
this.addAbility(new GarrukRelentlessTriggeredAbility());
this.addAbility(new GarrukRelentlessStateTrigger());
// 0: Garruk Relentless deals 3 damage to target creature. That creature deals damage equal to its power to him
LoyaltyAbility ability1 = new LoyaltyAbility(new GarrukRelentlessDamageEffect(), 0);
@ -64,40 +60,30 @@ public final class GarrukRelentless extends CardImpl {
}
}
class GarrukRelentlessTriggeredAbility extends TriggeredAbilityImpl {
class GarrukRelentlessStateTrigger extends StateTriggeredAbility {
public GarrukRelentlessTriggeredAbility() {
super(Zone.BATTLEFIELD, new TransformSourceEffect(true), false);
public GarrukRelentlessStateTrigger() {
super(Zone.BATTLEFIELD, new TransformSourceEffect(true));
}
public GarrukRelentlessTriggeredAbility(GarrukRelentlessTriggeredAbility ability) {
public GarrukRelentlessStateTrigger(final GarrukRelentlessStateTrigger ability) {
super(ability);
}
@Override
public GarrukRelentlessTriggeredAbility copy() {
return new GarrukRelentlessTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLANESWALKER;
public GarrukRelentlessStateTrigger copy() {
return new GarrukRelentlessStateTrigger(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(sourceId)) {
Permanent permanent = game.getPermanent(sourceId);
if (permanent != null && !permanent.isTransformed() && permanent.getCounters(game).getCount(CounterType.LOYALTY) <= 2) {
return true;
}
}
return false;
Permanent permanent = game.getPermanent(getSourceId());
return permanent != null && permanent.getCounters(game).getCount(CounterType.LOYALTY) < 3;
}
@Override
public String getRule() {
return "When Garruk Relentless has two or fewer loyalty counters on him, transform him.";
return "When {this} has two or fewer loyalty counters on him, transform him.";
}
}
@ -105,7 +91,7 @@ class GarrukRelentlessDamageEffect extends OneShotEffect {
public GarrukRelentlessDamageEffect() {
super(Outcome.Damage);
staticText = "Garruk Relentless deals 3 damage to target creature. That creature deals damage equal to its power to him";
staticText = "{this} deals 3 damage to target creature. That creature deals damage equal to its power to him";
}
public GarrukRelentlessDamageEffect(GarrukRelentlessDamageEffect effect) {

View file

@ -3,7 +3,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.CreateTokenEffect;
@ -34,7 +34,7 @@ public final class GarrukWildspeaker extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GARRUK);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Untap two target lands.
LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -20,7 +20,6 @@ import mage.constants.SuperType;
import mage.game.command.emblems.GideonAllyOfZendikarEmblem;
import mage.game.permanent.token.KnightAllyToken;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
/**
*
@ -33,7 +32,7 @@ public final class GideonAllyOfZendikar extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GIDEON);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), "planeswalker", Duration.EndOfTurn), 1);

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
@ -27,7 +27,6 @@ import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
/**
@ -52,7 +51,7 @@ public final class GideonBattleForged extends CardImpl {
this.nightCard = true;
this.transformable = true;
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.LockedInDynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount;
@ -26,7 +26,6 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.common.TargetOpponent;
/**
@ -40,7 +39,7 @@ public final class GideonChampionOfJustice extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GIDEON);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls.
LoyaltyAbility ability1 = new LoyaltyAbility(

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
@ -43,7 +43,7 @@ public final class GideonJura extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GIDEON);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6));
// +2: During target opponent's next turn, creatures that player controls attack Gideon Jura if able.
LoyaltyAbility ability1 = new LoyaltyAbility(new GideonJuraEffect(), 2);

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
import mage.abilities.effects.common.TapAllEffect;
@ -21,7 +21,6 @@ import mage.constants.SuperType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
/**
*
@ -35,7 +34,7 @@ public final class GideonMartialParagon extends CardImpl {
this.subtype.add(SubType.GIDEON);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +2: Untap all creatures you control. Those creatures get +1/+1 until end of turn.
LoyaltyAbility ability = new LoyaltyAbility(new UntapAllEffect(new FilterControlledCreaturePermanent()), 2);

View file

@ -4,7 +4,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
@ -19,7 +19,6 @@ import mage.constants.Duration;
import mage.constants.SuperType;
import mage.game.command.emblems.GideonOfTheTrialsEmblem;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
/**
@ -34,7 +33,7 @@ public final class GideonOfTheTrials extends CardImpl {
this.subtype.add(SubType.GIDEON);
//Starting Loyalty: 3
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Until your next turn, prevent all damage target permanent would deal.
Effect effect = new PreventDamageByTargetEffect(Duration.UntilYourNextTurn);

View file

@ -1,15 +1,14 @@
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
@ -18,10 +17,10 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class GlowsporeShaman extends CardImpl {
@ -81,9 +80,10 @@ class GlowsporeShamanEffect extends OneShotEffect {
Target target = new TargetCardInYourGraveyard(0, 1, filter, true);
if (player.chooseUse(outcome, "Put a land card on top of your library?", source, game)
&& player.choose(outcome, target, source.getSourceId(), game)) {
Effect effect = new PutOnLibraryTargetEffect(true);
effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game));
effect.apply(game, source);
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
return player.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false);
}
}
return true;
}

View file

@ -32,7 +32,7 @@ public final class GraveScrabbler extends CardImpl {
//you may return target creature card from a graveyard to its owner's hand.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MadnessAbility.GetCondition(),
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MadnessAbility.getCondition(),
"When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand."));
}

View file

@ -4,7 +4,7 @@ package mage.cards.h;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.DamageWithPowerTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
@ -45,7 +45,7 @@ public final class HuatliDinosaurKnight extends CardImpl {
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUATLI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +2: Put two +1/+1 counters on up to one target Dinosaur you control.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))

View file

@ -3,7 +3,7 @@ package mage.cards.h;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -30,7 +30,7 @@ public final class HuatliRadiantChampion extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUATLI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Put a loyalty counter on Huatli, Radiant Champion for each creature you control.
this.addAbility(new LoyaltyAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0),

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.Mode;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayVariableLoyaltyCost;
import mage.abilities.dynamicvalue.DynamicValue;
@ -26,7 +26,6 @@ import mage.constants.SuperType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.DinosaurToken;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanentAmount;
import mage.target.targetpointer.FixedTarget;
@ -43,7 +42,7 @@ public final class HuatliWarriorPoet extends CardImpl {
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUATLI);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: You gain life equal to the greatest power among creatures you control.
this.addAbility(new LoyaltyAbility(new GainLifeEffect(new GreatestPowerAmongControlledCreaturesValue(), "You gain life equal to the greatest power among creatures you control"), 2));

View file

@ -158,7 +158,7 @@ class IceCauldronCastFromExileEffect extends AsThoughEffectImpl {
class IceCauldronNoteManaEffect extends OneShotEffect {
private static String manaUsedString;
private String manaUsedString;
public IceCauldronNoteManaEffect() {
super(Outcome.Benefit);
@ -167,6 +167,7 @@ class IceCauldronNoteManaEffect extends OneShotEffect {
public IceCauldronNoteManaEffect(final IceCauldronNoteManaEffect effect) {
super(effect);
manaUsedString = effect.manaUsedString;
}
@Override
@ -190,8 +191,8 @@ class IceCauldronNoteManaEffect extends OneShotEffect {
class IceCauldronAddManaEffect extends ManaEffect {
private static Mana storedMana;
private static MageObjectReference exiledCardMor;
private Mana storedMana;
private MageObjectReference exiledCardMor;
IceCauldronAddManaEffect() {
super();
@ -200,6 +201,8 @@ class IceCauldronAddManaEffect extends ManaEffect {
IceCauldronAddManaEffect(IceCauldronAddManaEffect effect) {
super(effect);
storedMana = effect.storedMana.copy();
exiledCardMor = effect.exiledCardMor;
}
@Override

View file

@ -71,7 +71,7 @@ class InvertEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
for (UUID targetId : source.getTargets().get(0).getTargets()) {
for (UUID targetId : targetPointer.getTargets(game, source)) {
ContinuousEffect effect = new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(targetId, game));
game.addEffect(effect, source);

View file

@ -8,7 +8,7 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -50,7 +50,7 @@ public final class JaceArchitectOfThought extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn.
this.addAbility(new LoyaltyAbility(new JaceArchitectOfThoughtStartEffect1(), 1));

View file

@ -3,7 +3,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
@ -25,7 +25,7 @@ public final class JaceBeleren extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Each player draws a card.
this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2));

View file

@ -7,7 +7,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
@ -38,7 +38,7 @@ public final class JaceCunningCastaway extends CardImpl {
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +1: Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card.
this.addAbility(new LoyaltyAbility(new JaceCunningCastawayEffect1(), 1));

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
@ -29,7 +29,7 @@ public final class JaceIngeniousMindMage extends CardImpl {
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Draw a card.
this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1));

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.Mode;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
@ -28,7 +28,7 @@ public final class JaceMemoryAdept extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Draw a card. Target player puts the top card of their library into their graveyard.
LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
@ -47,7 +47,7 @@ public final class JaceTelepathUnbound extends CardImpl {
this.nightCard = true;
this.transformable = true;
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Up to one target creature gets -2/-0 until your next turn.
Effect effect = new BoostTargetEffect(-2, 0, Duration.UntilYourNextTurn);

View file

@ -2,7 +2,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -38,7 +38,7 @@ public final class JaceTheLivingGuildpact extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Look at the top two cards of your library. Put one of them into your graveyard.
Effect effect = new LookLibraryAndPickControllerEffect(

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.BrainstormEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
@ -33,7 +33,7 @@ public final class JaceTheMindSculptor extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// +2: Look at the top card of target player's library. You may put that card on the bottom of that player's library.
LoyaltyAbility ability1 = new LoyaltyAbility(new JaceTheMindSculptorEffect1(), 2);

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -31,7 +31,7 @@ public final class JaceUnravelerOfSecrets extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JACE);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Scry 1, then draw a card.
Ability ability = new LoyaltyAbility(new ScryEffect(1), 1);

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.mana.AddConditionalManaEffect;
import mage.abilities.effects.common.GetEmblemEffect;
@ -35,7 +35,7 @@ public final class JayaBallard extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.JAYA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Add {R}{R}{R}. Spend this mana only to cast instant or sorcery spells.
this.addAbility(new LoyaltyAbility(new AddConditionalManaEffect(Mana.RedMana(3), new InstantOrSorcerySpellManaBuilder()), 1));

View file

@ -60,7 +60,7 @@ public final class JeweledAmulet extends CardImpl {
class JeweledAmuletAddCounterEffect extends OneShotEffect {
private static String manaUsedString;
private String manaUsedString;
public JeweledAmuletAddCounterEffect() {
super(Outcome.Benefit);
@ -69,6 +69,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect {
public JeweledAmuletAddCounterEffect(final JeweledAmuletAddCounterEffect effect) {
super(effect);
manaUsedString = effect.manaUsedString;
}
@Override
@ -93,7 +94,7 @@ class JeweledAmuletAddCounterEffect extends OneShotEffect {
class JeweledAmuletAddManaEffect extends ManaEffect {
private static Mana storedMana;
private Mana storedMana;
JeweledAmuletAddManaEffect() {
super();
@ -102,6 +103,7 @@ class JeweledAmuletAddManaEffect extends ManaEffect {
JeweledAmuletAddManaEffect(JeweledAmuletAddManaEffect effect) {
super(effect);
storedMana = effect.storedMana;
}
@Override

View file

@ -4,7 +4,7 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
@ -43,7 +43,7 @@ public final class JiangYanggu extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.YANGGU);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Target creature gets +2/+2 until end of turn.
Ability ability = new LoyaltyAbility(new BoostTargetEffect(2, 2, Duration.EndOfTurn), 1);

View file

@ -8,7 +8,7 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.cards.Card;
@ -44,7 +44,7 @@ public final class KarnLiberated extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{7}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.KARN);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(6));
// +4: Target player exiles a card from their hand.
LoyaltyAbility ability1 = new LoyaltyAbility(new KarnPlayerExileEffect(), 4);

View file

@ -8,7 +8,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.Card;
@ -43,7 +43,7 @@ public final class KarnScionOfUrza extends CardImpl {
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.KARN);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Reveal the top two cards of your library. An opponent chooses one of them. Put that card into your hand and exile the other with a silver counter on it.
LoyaltyAbility ability1 = new LoyaltyAbility(new KarnPlus1Effect(), 1);

View file

@ -4,7 +4,7 @@ package mage.cards.k;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -41,7 +41,7 @@ public final class KayaGhostAssassin extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.KAYA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// 0: Exile Kaya, Ghost Assassin or up to one target creature. Return that card to the battlefield under its owner's control at the beginning of your next upkeep.
// You lose 2 life.

View file

@ -1,7 +1,6 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -12,11 +11,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.FaceDownPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -25,21 +20,22 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class KeeperOfTheLens extends CardImpl {
public KeeperOfTheLens(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{1}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
this.subtype.add(SubType.GOLEM);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// You may look at face-down creatures you don't control.
// TODO: this should be a static abilitie and not use activated abilities (because it could than be restriced)
this.addAbility(new KeeperOfTheLensLookFaceDownAbility());
this.addAbility(new KeeperOfTheLensLookFaceDownAbility());
}
public KeeperOfTheLens(final KeeperOfTheLens card) {
@ -82,7 +78,7 @@ class KeeperOfTheLensLookFaceDownEffect extends OneShotEffect {
public KeeperOfTheLensLookFaceDownEffect() {
super(Outcome.Benefit);
this.staticText = "You may look at face-down creatures you don't control";
this.staticText = "You may look at face-down creatures you don't control any time";
}
public KeeperOfTheLensLookFaceDownEffect(final KeeperOfTheLensLookFaceDownEffect effect) {
@ -96,7 +92,7 @@ class KeeperOfTheLensLookFaceDownEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller= game.getPlayer(source.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getObject(source.getSourceId());
if (controller == null || mageObject == null) {
return false;

View file

@ -69,7 +69,7 @@ class KindredChargeEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (subType != null) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type");
filter.add(new SubtypePredicate(subType));

View file

@ -70,7 +70,7 @@ class KindredSummonsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (subType == null) {
return false;
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
@ -44,7 +44,7 @@ public final class KioraMasterOfTheDepths extends CardImpl {
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.KIORA);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +1: Untap up to one target creature and up to one target land.
LoyaltyAbility ability1 = new LoyaltyAbility(new KioraUntapEffect(), 1);

Some files were not shown because too many files have changed in this diff Show more