Skip to content

Commit

Permalink
spjspj - SWS Capture - wrong mana cost - If card in .dck file is bork…
Browse files Browse the repository at this point in the history
…ed due to wrong set/number, try loading based on name
  • Loading branch information
spjspj committed Oct 15, 2016
1 parent fa0fe09 commit cac088a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mage.Sets/src/mage/cards/c/Capture.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class Capture extends CardImpl {

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.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
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+)\\)([^|]+)\\|(.*)$");

Expand All @@ -70,6 +70,17 @@ protected void readLine(String line, DeckCardLists deckList) {

DeckCardInfo deckCardInfo = null;
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) {
deckCardInfo = new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode());
}
Expand Down

0 comments on commit cac088a

Please sign in to comment.