mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Make it so X mana costs are paid using a pre-mana payment announcement
This commit is contained in:
@@ -31,6 +31,8 @@ import forge.util.maps.MapToAmount;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* ManaCostBeingPaid class.
|
||||
@@ -215,6 +217,20 @@ public class ManaCostBeingPaid {
|
||||
return unpaidShards.isEmpty();
|
||||
}
|
||||
|
||||
public final void setXManaCostPaid(final int xPaid, final String xColor) {
|
||||
int xCost = xPaid * cntX;
|
||||
cntX = 0;
|
||||
|
||||
ManaCostShard increaseShard;
|
||||
if (StringUtils.isEmpty(xColor)) {
|
||||
increaseShard = ManaCostShard.COLORLESS;
|
||||
}
|
||||
else {
|
||||
increaseShard = ManaCostShard.valueOf(MagicColor.fromName(xColor));
|
||||
}
|
||||
unpaidShards.add(increaseShard, xCost);
|
||||
}
|
||||
|
||||
public final void increaseColorlessMana(final int manaToAdd) {
|
||||
increaseShard(ManaCostShard.COLORLESS, manaToAdd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user