mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Merge origin/master
This commit is contained in:
commit
11de701ee8
28 changed files with 1839 additions and 1794 deletions
|
@ -4,9 +4,10 @@ import com.amazonaws.AmazonClientException;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||||
import com.amazonaws.services.s3.transfer.Upload;
|
import com.amazonaws.services.s3.transfer.Upload;
|
||||||
import java.io.File;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class S3Uploader {
|
public class S3Uploader {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(S3Uploader.class);
|
private static final Logger logger = Logger.getLogger(S3Uploader.class);
|
||||||
|
@ -18,9 +19,9 @@ public class S3Uploader {
|
||||||
String accessKeyId = System.getenv("AWS_ACCESS_ID");
|
String accessKeyId = System.getenv("AWS_ACCESS_ID");
|
||||||
String secretKeyId = System.getenv("AWS_SECRET_KEY");
|
String secretKeyId = System.getenv("AWS_SECRET_KEY");
|
||||||
|
|
||||||
if (accessKeyId == null || "".equals(accessKeyId)
|
if (accessKeyId == null || accessKeyId.isEmpty()
|
||||||
|| secretKeyId == null || "".equals(secretKeyId)
|
|| secretKeyId == null || secretKeyId.isEmpty()
|
||||||
|| existingBucketName == null || "".equals(existingBucketName)) {
|
|| existingBucketName == null || existingBucketName.isEmpty()) {
|
||||||
logger.info("Aborting json log sync.");
|
logger.info("Aborting json log sync.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -476,7 +476,7 @@ public class ScryfallImageSupportCards {
|
||||||
add("SLD"); // Secret Lair Drop
|
add("SLD"); // Secret Lair Drop
|
||||||
add("PMEI"); // Magazine Inserts
|
add("PMEI"); // Magazine Inserts
|
||||||
add("SLU"); // Secret Lair: Ultimate Edition
|
add("SLU"); // Secret Lair: Ultimate Edition
|
||||||
//add("SS3"); // Signature Spellbook: Chandra
|
add("SS3"); // Signature Spellbook: Chandra
|
||||||
add("HA3"); // Historic Anthology 3
|
add("HA3"); // Historic Anthology 3
|
||||||
|
|
||||||
// add("TD0"); // Commander Theme Decks
|
// add("TD0"); // Commander Theme Decks
|
||||||
|
|
|
@ -407,7 +407,6 @@ public final class Main {
|
||||||
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
||||||
try {
|
try {
|
||||||
classLoader.addURL(new File(pluginFolder, plugin.getJar()).toURI().toURL());
|
classLoader.addURL(new File(pluginFolder, plugin.getJar()).toURI().toURL());
|
||||||
logger.debug("Loading tournament type: " + plugin.getClassName());
|
|
||||||
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
logger.warn("Tournament type not found:" + plugin.getName() + " / " + plugin.getJar() + " - check plugin folder", ex);
|
logger.warn("Tournament type not found:" + plugin.getName() + " / " + plugin.getJar() + " - check plugin folder", ex);
|
||||||
|
|
|
@ -10,7 +10,10 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
import mage.abilities.effects.common.DoWhenCostPaid;
|
import mage.abilities.effects.common.DoWhenCostPaid;
|
||||||
import mage.abilities.keyword.MenaceAbility;
|
import mage.abilities.keyword.MenaceAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.Cards;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
|
@ -79,10 +82,10 @@ class CabalTherapistDiscardEffect extends OneShotEffect {
|
||||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (targetPlayer == null || controller == null || sourceObject == null) {
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (targetPlayer == null || controller == null || sourceObject == null || cardName == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
|
||||||
Cards hand = targetPlayer.getHand().copy();
|
Cards hand = targetPlayer.getHand().copy();
|
||||||
targetPlayer.revealCards(source, hand, game);
|
targetPlayer.revealCards(source, hand, game);
|
||||||
hand.removeIf(uuid -> {
|
hand.removeIf(uuid -> {
|
||||||
|
|
|
@ -6,10 +6,14 @@ import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
import mage.abilities.keyword.FlashbackAbility;
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.Cards;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
@ -17,7 +21,6 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.filter.StaticFilters;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jonubuu
|
* @author jonubuu
|
||||||
|
@ -64,10 +67,10 @@ class CabalTherapyEffect extends OneShotEffect {
|
||||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (targetPlayer == null || controller == null || sourceObject == null) {
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (targetPlayer == null || controller == null || sourceObject == null || cardName == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
|
||||||
Cards hand = targetPlayer.getHand().copy();
|
Cards hand = targetPlayer.getHand().copy();
|
||||||
targetPlayer.revealCards(source, hand, game);
|
targetPlayer.revealCards(source, hand, game);
|
||||||
hand.removeIf(uuid -> {
|
hand.removeIf(uuid -> {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
|
@ -10,18 +8,19 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect.TypeOfName;
|
import mage.abilities.effects.common.ChooseACardNameEffect.TypeOfName;
|
||||||
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
|
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class CheeringFanatic extends CardImpl {
|
public final class CheeringFanatic extends CardImpl {
|
||||||
|
@ -67,6 +66,9 @@ class CheeringFanaticEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source);
|
new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source);
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (cardName == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
FilterCard filter = new FilterCard();
|
FilterCard filter = new FilterCard();
|
||||||
filter.add(new NamePredicate(cardName));
|
filter.add(new NamePredicate(cardName));
|
||||||
ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1);
|
ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1);
|
||||||
|
|
|
@ -74,7 +74,7 @@ enum ChromeReplicatorCondition implements Condition {
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(MageObject::getName)
|
.map(MageObject::getName)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(s -> !"".equals(s))
|
.filter(s -> !s.isEmpty())
|
||||||
.anyMatch(s -> nameMap.compute(s, (x, i) -> i == null ? 1 : Integer.sum(i, 1)) >= 2);
|
.anyMatch(s -> nameMap.compute(s, (x, i) -> i == null ? 1 : Integer.sum(i, 1)) >= 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec
|
||||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
return object != null && CardUtil.haveSameNames(object, cardName, game);
|
return object != null && cardName != null && CardUtil.haveSameNames(object, cardName, game);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.CounterTargetEffect;
|
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
|
import mage.abilities.effects.common.CounterTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -17,8 +16,9 @@ import mage.game.Game;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
import mage.target.targetadjustment.TargetAdjuster;
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class DeclarationOfNaught extends CardImpl {
|
public final class DeclarationOfNaught extends CardImpl {
|
||||||
|
@ -55,6 +55,9 @@ enum DeclarationOfNaughtAdjuster implements TargetAdjuster {
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
String chosenName = (String) game.getState().getValue(ability.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String chosenName = (String) game.getState().getValue(ability.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (chosenName == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
FilterSpell filterSpell = new FilterSpell("spell named " + chosenName);
|
FilterSpell filterSpell = new FilterSpell("spell named " + chosenName);
|
||||||
filterSpell.add(new NamePredicate(chosenName));
|
filterSpell.add(new NamePredicate(chosenName));
|
||||||
TargetSpell target = new TargetSpell(1, filterSpell);
|
TargetSpell target = new TargetSpell(1, filterSpell);
|
||||||
|
|
|
@ -79,7 +79,7 @@ class DementiaSliverEffect extends OneShotEffect {
|
||||||
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
if (opponent != null && sourceObject != null && !cardName.isEmpty()) {
|
if (opponent != null && sourceObject != null && cardName != null && !cardName.isEmpty()) {
|
||||||
if (!opponent.getHand().isEmpty()) {
|
if (!opponent.getHand().isEmpty()) {
|
||||||
Cards revealed = new CardsImpl();
|
Cards revealed = new CardsImpl();
|
||||||
Card card = opponent.getHand().getRandom(game);
|
Card card = opponent.getHand().getRandom(game);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
|
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
|
||||||
|
@ -11,8 +9,9 @@ import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class Dispossess extends CardImpl {
|
public final class Dispossess extends CardImpl {
|
||||||
|
@ -49,6 +48,9 @@ class DispossessEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (cardName == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||||
|
@ -19,6 +17,9 @@ import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author spjspj
|
* @author spjspj
|
||||||
|
@ -72,9 +73,9 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||||
MageObject mageObject = game.getObject(source.getSourceId());
|
MageObject mageObject = game.getObject(source.getSourceId());
|
||||||
if (mageObject != null) {
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
if (mageObject != null && cardName != null) {
|
||||||
return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
|
return "You can't cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -89,9 +90,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
if (object != null && object.getName().equals(cardName)) {
|
return object != null && CardUtil.haveSameNames(object, cardName, game);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp
|
||||||
@Override
|
@Override
|
||||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||||
MageObject mageObject = game.getObject(source.getSourceId());
|
MageObject mageObject = game.getObject(source.getSourceId());
|
||||||
if (mageObject != null) {
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
if (mageObject != null && cardName != null) {
|
||||||
return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
|
return "You can't cast a card named " + cardName + " (" + mageObject.getIdName() + ").";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,6 @@ class GideonsInterventionPreventAllDamageEffect extends PreventionEffectImpl {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
Permanent targetPerm = game.getPermanent(event.getTargetId());
|
Permanent targetPerm = game.getPermanent(event.getTargetId());
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
|
||||||
if (object != null && (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
if (object != null && (event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||||
|| targetPerm != null && (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
|| targetPerm != null && (event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
||||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) {
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) {
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -14,16 +11,8 @@ import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.*;
|
||||||
import mage.cards.CardImpl;
|
import mage.constants.*;
|
||||||
import mage.cards.CardSetInfo;
|
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.SplitCard;
|
|
||||||
import mage.constants.AsThoughEffectType;
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -34,14 +23,16 @@ import mage.target.TargetSpell;
|
||||||
import mage.target.common.TargetCardInExile;
|
import mage.target.common.TargetCardInExile;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class JestersScepter extends CardImpl {
|
public final class JestersScepter extends CardImpl {
|
||||||
|
|
||||||
public JestersScepter(UUID ownerId, CardSetInfo setInfo) {
|
public JestersScepter(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
|
|
||||||
// When Jester's Scepter enters the battlefield, exile the top five cards of target player's library face down.
|
// When Jester's Scepter enters the battlefield, exile the top five cards of target player's library face down.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new JestersScepterEffect(), false);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new JestersScepterEffect(), false);
|
||||||
|
@ -213,14 +204,11 @@ class JestersScepterCounterEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
|
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
|
||||||
if (spell != null) {
|
if (spell != null) {
|
||||||
// In case of Split Card
|
|
||||||
String nameOfExiledCardPayment = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment");
|
String nameOfExiledCardPayment = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment");
|
||||||
String nameOfExiledCardPayment2 = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment2");
|
String nameOfExiledCardPayment2 = (String) game.getState().getValue(source.getSourceId() + "_nameOfExiledCardPayment2");
|
||||||
if (nameOfExiledCardPayment != null) {
|
if (CardUtil.haveSameNames(spell.getCard(), nameOfExiledCardPayment, game)
|
||||||
if (nameOfExiledCardPayment.equals(spell.getCard().getName())
|
|| CardUtil.haveSameNames(spell.getCard(), nameOfExiledCardPayment2, game)) {
|
||||||
|| (nameOfExiledCardPayment2 != null) && nameOfExiledCardPayment2.equals(spell.getCard().getName())) {
|
return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game);
|
||||||
return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -78,7 +78,7 @@ class MedomaisProphecyTriggerEffect extends OneShotEffect {
|
||||||
String cardName = (String) game.getState().getValue(
|
String cardName = (String) game.getState().getValue(
|
||||||
source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY
|
source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY
|
||||||
);
|
);
|
||||||
if (cardName == null || "".equals(cardName)) {
|
if (cardName == null || cardName.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
game.addDelayedTriggeredAbility(new MedomaisProphecyDelayedTriggeredAbility(cardName), source);
|
game.addDelayedTriggeredAbility(new MedomaisProphecyDelayedTriggeredAbility(cardName), source);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
|
@ -11,8 +10,9 @@ import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public final class Memoricide extends CardImpl {
|
public final class Memoricide extends CardImpl {
|
||||||
|
@ -51,6 +51,9 @@ class MemoricideEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (cardName == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -79,7 +80,8 @@ class RegularExpression extends OneShotEffect {
|
||||||
source.getControllerId(), source.getSourceId(), game
|
source.getControllerId(), source.getSourceId(), game
|
||||||
).stream()
|
).stream()
|
||||||
.map(Permanent::getName)
|
.map(Permanent::getName)
|
||||||
.filter(s -> !"".equals(s))
|
.filter(Objects::nonNull)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
.map(NamePredicate::new)
|
.map(NamePredicate::new)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
FilterCard filter
|
FilterCard filter
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -22,8 +18,11 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author MarcoMarin / HCrescent
|
* @author MarcoMarin / HCrescent
|
||||||
*/
|
*/
|
||||||
public final class Shapeshifter extends CardImpl {
|
public final class Shapeshifter extends CardImpl {
|
||||||
|
@ -116,8 +115,8 @@ class ShapeshifterContinuousEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent != null) {
|
String lastChosen = (String) game.getState().getValue(source.getSourceId().toString() + "_Shapeshifter");
|
||||||
String lastChosen = (String) game.getState().getValue(source.getSourceId().toString() + "_Shapeshifter");
|
if (permanent != null && lastChosen != null) {
|
||||||
int lastChosenNumber = Integer.parseInt(lastChosen);
|
int lastChosenNumber = Integer.parseInt(lastChosen);
|
||||||
permanent.getPower().modifyBaseValue(lastChosenNumber);
|
permanent.getPower().modifyBaseValue(lastChosenNumber);
|
||||||
permanent.getToughness().modifyBaseValue(7 - lastChosenNumber);
|
permanent.getToughness().modifyBaseValue(7 - lastChosenNumber);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -15,14 +13,15 @@ import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class SlaughterGames extends CardImpl {
|
public final class SlaughterGames extends CardImpl {
|
||||||
|
|
||||||
public SlaughterGames(UUID ownerId, CardSetInfo setInfo) {
|
public SlaughterGames(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{R}");
|
||||||
|
|
||||||
// Slaughter Games can't be countered.
|
// Slaughter Games can't be countered.
|
||||||
Effect effect = new CantBeCounteredSourceEffect();
|
Effect effect = new CantBeCounteredSourceEffect();
|
||||||
|
@ -60,6 +59,9 @@ class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAn
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (cardName == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ class StaffOfTheLetterMagusEffect extends OneShotEffect {
|
||||||
for (int i = 0; i < spellName.length(); i++) {
|
for (int i = 0; i < spellName.length(); i++) {
|
||||||
char letter = spellName.charAt(i);
|
char letter = spellName.charAt(i);
|
||||||
String chosenLetter = (String) game.getState().getValue(mageObject.getId() + "_letter");
|
String chosenLetter = (String) game.getState().getValue(mageObject.getId() + "_letter");
|
||||||
if (Character.isLetter(letter) && Character.toUpperCase(letter) == chosenLetter.charAt(0)) {
|
if (chosenLetter != null && Character.isLetter(letter) && Character.toUpperCase(letter) == chosenLetter.charAt(0)) {
|
||||||
lifegainValue++;
|
lifegainValue++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||||
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
|
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
|
||||||
|
@ -12,14 +10,15 @@ import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class StainTheMind extends CardImpl {
|
public final class StainTheMind extends CardImpl {
|
||||||
|
|
||||||
public StainTheMind(UUID ownerId, CardSetInfo setInfo) {
|
public StainTheMind(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
|
||||||
|
|
||||||
// Convoke
|
// Convoke
|
||||||
this.addAbility(new ConvokeAbility());
|
this.addAbility(new ConvokeAbility());
|
||||||
|
@ -52,6 +51,9 @@ class StainTheMindEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||||
|
if (cardName == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import mage.ApprovingObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
@ -12,19 +12,21 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.common.FilterNonlandCard;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetCard;
|
||||||
import mage.watchers.common.SpellsCastWatcher;
|
import mage.watchers.common.SpellsCastWatcher;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import mage.ApprovingObject;
|
|
||||||
import mage.filter.common.FilterNonlandCard;
|
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
|
@ -95,7 +97,8 @@ class TwinningGlassEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
List<NamePredicate> predicates = spells.stream()
|
List<NamePredicate> predicates = spells.stream()
|
||||||
.map(Spell::getName)
|
.map(Spell::getName)
|
||||||
.filter(s -> !"".equals(s))
|
.filter(Objects::nonNull)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
.map(NamePredicate::new)
|
.map(NamePredicate::new)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
FilterNonlandCard filterCard = new FilterNonlandCard("nonland card that was cast this turn");
|
FilterNonlandCard filterCard = new FilterNonlandCard("nonland card that was cast this turn");
|
||||||
|
|
File diff suppressed because it is too large
Load diff
32
Mage.Sets/src/mage/sets/SignatureSpellbookChandra.java
Normal file
32
Mage.Sets/src/mage/sets/SignatureSpellbookChandra.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package mage.sets;
|
||||||
|
|
||||||
|
import mage.cards.ExpansionSet;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.SetType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ketsuban
|
||||||
|
*/
|
||||||
|
public final class SignatureSpellbookChandra extends ExpansionSet {
|
||||||
|
|
||||||
|
private static final SignatureSpellbookChandra instance = new SignatureSpellbookChandra();
|
||||||
|
|
||||||
|
public static SignatureSpellbookChandra getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SignatureSpellbookChandra() {
|
||||||
|
super("Signature Spellbook: Chandra", "SS3", ExpansionSet.buildDate(2020, 6, 26), SetType.SUPPLEMENTAL);
|
||||||
|
this.hasBoosters = false;
|
||||||
|
this.hasBasicLands = false;
|
||||||
|
|
||||||
|
cards.add(new SetCardInfo("Chandra, Torch of Defiance", 1, Rarity.MYTHIC, mage.cards.c.ChandraTorchOfDefiance.class));
|
||||||
|
cards.add(new SetCardInfo("Cathartic Reunion", 2, Rarity.RARE, mage.cards.c.CatharticReunion.class));
|
||||||
|
cards.add(new SetCardInfo("Fiery Confluence", 3, Rarity.RARE, mage.cards.f.FieryConfluence.class));
|
||||||
|
cards.add(new SetCardInfo("Past in Flames", 4, Rarity.MYTHIC, mage.cards.p.PastInFlames.class));
|
||||||
|
cards.add(new SetCardInfo("Pyroblast", 5, Rarity.RARE, mage.cards.p.Pyroblast.class));
|
||||||
|
cards.add(new SetCardInfo("Pyromancer Ascension", 6, Rarity.RARE, mage.cards.p.PyromancerAscension.class));
|
||||||
|
cards.add(new SetCardInfo("Rite of Flame", 7, Rarity.RARE, mage.cards.r.RiteOfFlame.class));
|
||||||
|
cards.add(new SetCardInfo("Young Pyromancer", 8, Rarity.RARE, mage.cards.y.YoungPyromancer.class));
|
||||||
|
}
|
||||||
|
}
|
|
@ -99,8 +99,6 @@ public abstract class MageTestBase {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void init() {
|
public static void init() {
|
||||||
Logger.getRootLogger().setLevel(Level.DEBUG);
|
Logger.getRootLogger().setLevel(Level.DEBUG);
|
||||||
logger.info("Starting MAGE tests");
|
|
||||||
logger.info("Logging level: " + logger.getLevel());
|
|
||||||
deleteSavedGames();
|
deleteSavedGames();
|
||||||
ConfigSettings config = ConfigSettings.instance;
|
ConfigSettings config = ConfigSettings.instance;
|
||||||
config.getGameTypes().forEach((gameType) -> {
|
config.getGameTypes().forEach((gameType) -> {
|
||||||
|
@ -148,7 +146,6 @@ public abstract class MageTestBase {
|
||||||
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
||||||
try {
|
try {
|
||||||
classLoader.addURL(new File(PLUGIN_FOLDER + '/' + plugin.getJar()).toURI().toURL());
|
classLoader.addURL(new File(PLUGIN_FOLDER + '/' + plugin.getJar()).toURI().toURL());
|
||||||
logger.info("Loading tournament type: " + plugin.getClassName());
|
|
||||||
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
|
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
|
||||||
|
@ -174,7 +171,7 @@ public abstract class MageTestBase {
|
||||||
protected void parseScenario(String filename) throws FileNotFoundException {
|
protected void parseScenario(String filename) throws FileNotFoundException {
|
||||||
parserState = ParserState.INIT;
|
parserState = ParserState.INIT;
|
||||||
File f = new File(filename);
|
File f = new File(filename);
|
||||||
try(Scanner scanner = new Scanner(f)) {
|
try (Scanner scanner = new Scanner(f)) {
|
||||||
while (scanner.hasNextLine()) {
|
while (scanner.hasNextLine()) {
|
||||||
String line = scanner.nextLine().trim();
|
String line = scanner.nextLine().trim();
|
||||||
if (line == null || line.isEmpty() || line.startsWith("#")) {
|
if (line == null || line.isEmpty() || line.startsWith("#")) {
|
||||||
|
|
|
@ -141,7 +141,6 @@ public abstract class MageTestPlayerBase {
|
||||||
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
private static TournamentType loadTournamentType(GamePlugin plugin) {
|
||||||
try {
|
try {
|
||||||
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
|
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
|
||||||
logger.info("Loading tournament type: " + plugin.getClassName());
|
|
||||||
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
|
||||||
} catch (ClassNotFoundException ex) {
|
} catch (ClassNotFoundException ex) {
|
||||||
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
|
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
|
||||||
|
|
|
@ -108,8 +108,9 @@ public class BoosterGenerationTest extends MageTestBase {
|
||||||
Assert.assertTrue("Slot 1 is white", booster.get(0).getColor(null).isWhite());
|
Assert.assertTrue("Slot 1 is white", booster.get(0).getColor(null).isWhite());
|
||||||
Assert.assertTrue("Slot 2 is white", booster.get(1).getColor(null).isWhite());
|
Assert.assertTrue("Slot 2 is white", booster.get(1).getColor(null).isWhite());
|
||||||
|
|
||||||
Assert.assertTrue("Slot 3 is blue", booster.get(2).getColor(null).isBlue());
|
// Wretched Gryff is colorless, but stores in blue slots
|
||||||
Assert.assertTrue("Slot 4 is blue", booster.get(3).getColor(null).isBlue());
|
Assert.assertTrue("Slot 3 is blue", booster.get(2).getName().equals("Wretched Gryff") || booster.get(2).getColor(null).isBlue());
|
||||||
|
Assert.assertTrue("Slot 4 is blue", booster.get(3).getName().equals("Wretched Gryff") || booster.get(3).getColor(null).isBlue());
|
||||||
|
|
||||||
Assert.assertTrue("Slot 5 is black", booster.get(4).getColor(null).isBlack());
|
Assert.assertTrue("Slot 5 is black", booster.get(4).getColor(null).isBlack());
|
||||||
Assert.assertTrue("Slot 6 is black", booster.get(5).getColor(null).isBlack());
|
Assert.assertTrue("Slot 6 is black", booster.get(5).getColor(null).isBlack());
|
||||||
|
|
|
@ -27,6 +27,9 @@ public class NamePredicate implements Predicate<MageObject> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(MageObject input, Game game) {
|
public boolean apply(MageObject input, Game game) {
|
||||||
|
if (name == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// If a player names a card, the player may name either half of a split card, but not both.
|
// If a player names a card, the player may name either half of a split card, but not both.
|
||||||
// A split card has the chosen name if one of its two names matches the chosen name.
|
// A split card has the chosen name if one of its two names matches the chosen name.
|
||||||
if (input instanceof SplitCard) {
|
if (input instanceof SplitCard) {
|
||||||
|
|
Loading…
Reference in a new issue