* Fixed two face card images that it uses wrong image from random set;

This commit is contained in:
Oleg Agafonov 2019-05-29 12:13:44 +04:00
parent 419f43e726
commit d313327b21
3 changed files with 15 additions and 11 deletions

View file

@ -188,13 +188,16 @@ public abstract class ExpansionSet implements Serializable {
protected int addMissingPartner(List<Card> booster, boolean partnerAllowed, int max, int i) {
for (Ability ability : booster.get(booster.size() - 1).getAbilities()) {
Card sourceCard = booster.get(booster.size() - 1);
for (Ability ability : sourceCard.getAbilities()) {
//Check if fetched card has the PartnerWithAbility
if (ability instanceof PartnerWithAbility) {
String partnerName = ((PartnerWithAbility) ability).getPartnerName();
//Check if the pack already contains a partner pair
if (partnerAllowed) {
//Added card always replaces an uncommon card
Card card = CardRepository.instance.findCard(((PartnerWithAbility) ability).getPartnerName()).getCard();
Card card = CardRepository.instance.findCardWPreferredSet(partnerName, sourceCard.getExpansionSetCode(), false).getCard();
if (i < max) {
booster.add(card);
} else {

View file

@ -1,6 +1,5 @@
package mage.cards.mock;
import java.util.List;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -9,6 +8,8 @@ import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import org.apache.log4j.Logger;
import java.util.List;
/**
* @author North
*/
@ -45,7 +46,7 @@ public class MockCard extends CardImpl {
this.transformable = card.isDoubleFaced();
this.nightCard = card.isNightCard();
if (card.getSecondSideName() != null && !card.getSecondSideName().isEmpty()) {
this.secondSideCard = new MockCard(CardRepository.instance.findCard(card.getSecondSideName()));
this.secondSideCard = new MockCard(CardRepository.instance.findCardWPreferredSet(card.getSecondSideName(), card.getSetCode(), false));
}
if (this.isPlaneswalker()) {

View file

@ -1,6 +1,5 @@
package mage.cards.mock;
import java.util.List;
import mage.MageInt;
import mage.abilities.Ability;
import mage.cards.CardSetInfo;
@ -11,8 +10,9 @@ import mage.cards.repository.CardRepository;
import mage.constants.CardType;
import mage.constants.SpellAbilityType;
import java.util.List;
/**
*
* @author North
*/
public class MockSplitCard extends SplitCard {
@ -41,7 +41,7 @@ public class MockSplitCard extends SplitCard {
this.transformable = card.isDoubleFaced();
this.nightCard = card.isNightCard();
if (card.getSecondSideName() != null && !card.getSecondSideName().isEmpty()) {
this.secondSideCard = new MockCard(CardRepository.instance.findCard(card.getSecondSideName()));
this.secondSideCard = new MockCard(CardRepository.instance.findCardWPreferredSet(card.getSecondSideName(), card.getSetCode(), false));
}
this.flipCardName = card.getFlipCardName();
@ -50,16 +50,16 @@ public class MockSplitCard extends SplitCard {
this.addAbility(textAbilityFromString(ruleText));
}
CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card));
CardInfo leftHalf = CardRepository.instance.findCardWPreferredSet(getLeftHalfName(card), card.getSetCode(), false);
if (leftHalf != null) {
this.leftHalfCard = new MockSplitCardHalf(leftHalf);
((SplitCardHalf)this.leftHalfCard).setParentCard(this);
((SplitCardHalf) this.leftHalfCard).setParentCard(this);
}
CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card));
CardInfo rightHalf = CardRepository.instance.findCardWPreferredSet(getRightHalfName(card), card.getSetCode(), false);
if (rightHalf != null) {
this.rightHalfCard = new MockSplitCardHalf(rightHalf);
((SplitCardHalf)this.rightHalfCard).setParentCard(this);
((SplitCardHalf) this.rightHalfCard).setParentCard(this);
}
}