draw in-game casting cost on card in hand, closes #629

master
melvinzhang 2016-01-05 19:56:49 +08:00
parent af7443359d
commit 0119427739
4 changed files with 10 additions and 4 deletions

View File

@ -214,6 +214,10 @@ public class MagicCard
return getCardDefinition().getCost();
}
public MagicManaCost getGameCost() {
return getGame().modCost(this, getCost());
}
public Iterable<MagicEvent> getCostEvent() {
return getCardDefinition().getCostEvent(this);
}

View File

@ -80,7 +80,6 @@ public class MagicManaCost {
}
private MagicManaCost(final int[] aAmounts, final int aXCount) {
costText = "";
int total = 0;
for (int i = 0; i < aAmounts.length; i++) {
amounts[i] = aAmounts[i];
@ -91,6 +90,7 @@ public class MagicManaCost {
}
XCount = aXCount;
converted = total;
costText = getCanonicalText(amounts, XCount);
}
private void addType(final MagicCostManaType type,final int amount,final int[] convertedArr) {

View File

@ -25,8 +25,10 @@ class TestCostReduction extends TestGameBuilder {
P.setLife(4);
addToLibrary(P, "Mountain", 20);
createPermanent(P, "Mountain", false, 6);
addToHand(P, "Lightning Bolt", 2);
addToHand(P, "Ruby Medallion", 1);
addToHand(P, "Circle of Flame", 1);
addToHand(P, "Jund Battlemage", 1);
addToHand(P, "Ruby Medallion", 2);
addToHand(P, "Ruby Leech", 2);
addToHand(P, "Enrage", 1);
addToHand(P, "Bonfire of the Damned", 1);

View File

@ -261,7 +261,7 @@ public class ImageCardListViewer extends JPanel implements IChoiceViewer {
y2-17
);
} else {
ImageDrawingUtils.drawCostInfo(g,this,card.getCost(),x1,x2-1,y1+2);
ImageDrawingUtils.drawCostInfo(g,this,card.getGameCost(),x1,x2-1,y1+2);
}
if (cardDefinition.isCreature()) {
ImageDrawingUtils.drawAbilityInfo(g,this,cardDefinition.genAbilityFlags(),x1+2,y2-18);