Merge pull request #2466 from spjspj/master

spjspj - SWS Capture - wrong mana cost - If card in .dck file is bork…
This commit is contained in:
spjspj 2016-10-15 16:06:16 +11:00 committed by GitHub
commit 636fdb0afb
2 changed files with 13 additions and 2 deletions

View file

@ -45,7 +45,7 @@ import mage.target.common.TargetCreaturePermanent;
public class Capture extends CardImpl { public class Capture extends CardImpl {
public Capture(UUID ownerId, CardSetInfo setInfo) { public Capture(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
// Gain control of target creature until end of turn. // Gain control of target creature until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -43,7 +43,7 @@ import mage.cards.repository.CardRepository;
*/ */
public class DckDeckImporter extends DeckImporter { public class DckDeckImporter extends DeckImporter {
private static final Pattern pattern = Pattern.compile("(SB:)?\\s*(\\d*)\\s*\\[([^]:]+):([^]:]+)\\].*"); private static final Pattern pattern = Pattern.compile("(SB:)?\\s*(\\d*)\\s*\\[([^]:]+):([^]:]+)\\]\\s*(.*)\\s*$");
private static final Pattern layoutPattern = Pattern.compile("LAYOUT (\\w+):\\((\\d+),(\\d+)\\)([^|]+)\\|(.*)$"); private static final Pattern layoutPattern = Pattern.compile("LAYOUT (\\w+):\\((\\d+),(\\d+)\\)([^|]+)\\|(.*)$");
@ -70,6 +70,17 @@ public class DckDeckImporter extends DeckImporter {
DeckCardInfo deckCardInfo = null; DeckCardInfo deckCardInfo = null;
CardInfo cardInfo = CardRepository.instance.findCard(setCode, cardNum); CardInfo cardInfo = CardRepository.instance.findCard(setCode, cardNum);
if (cardInfo == null) {
// Try alternate based on name
String cardName = m.group(5);
if (cardName != null && cardName.length() > 0) {
cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardName, false);
sbMessage.append("Could not find card '" + cardName + "' in set " + setCode + " of number " + cardNum + ".\n");
if (cardInfo != null) {
sbMessage.append("Made substitution of " + cardInfo.getCardNumber() + ", " + cardInfo.getCard().getExpansionSetCode() + " instead.\n");
}
}
}
if (cardInfo != null) { if (cardInfo != null) {
deckCardInfo = new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode()); deckCardInfo = new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode());
} }