mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge branch 'countersfix' into 'master'
Fix cumulative upkeep counters See merge request core-developers/forge!6488
This commit is contained in:
@@ -900,9 +900,9 @@ public class Cost implements Serializable {
|
|||||||
StringUtils.isNumeric(part.getAmount()) &&
|
StringUtils.isNumeric(part.getAmount()) &&
|
||||||
StringUtils.isNumeric(other.getAmount())) {
|
StringUtils.isNumeric(other.getAmount())) {
|
||||||
String amount = String.valueOf(Integer.parseInt(part.getAmount()) + Integer.parseInt(other.getAmount()));
|
String amount = String.valueOf(Integer.parseInt(part.getAmount()) + Integer.parseInt(other.getAmount()));
|
||||||
if (part instanceof CostPutCounter) { // path for Carth
|
if (part instanceof CostPutCounter) { // path for Carth & Cumulative Upkeep
|
||||||
if (other instanceof CostPutCounter && ((CostPutCounter)other).getCounter().is(CounterEnumType.LOYALTY)) {
|
if (other instanceof CostPutCounter && ((CostPutCounter)other).getCounter().equals(((CostPutCounter) part).getCounter())) {
|
||||||
costParts.add(new CostPutCounter(amount, CounterType.get(CounterEnumType.LOYALTY), part.getType(), part.getTypeDescription()));
|
costParts.add(new CostPutCounter(amount, ((CostPutCounter) part).getCounter(), part.getType(), part.getTypeDescription()));
|
||||||
} else if (other instanceof CostRemoveCounter && ((CostRemoveCounter)other).counter.is(CounterEnumType.LOYALTY)) {
|
} else if (other instanceof CostRemoveCounter && ((CostRemoveCounter)other).counter.is(CounterEnumType.LOYALTY)) {
|
||||||
Integer counters = Integer.parseInt(other.getAmount()) - Integer.parseInt(part.getAmount());
|
Integer counters = Integer.parseInt(other.getAmount()) - Integer.parseInt(part.getAmount());
|
||||||
// the cost can turn positive if multiple Carth raise it
|
// the cost can turn positive if multiple Carth raise it
|
||||||
|
|||||||
Reference in New Issue
Block a user