mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
CostPayment: reset CardMatrix after being used
This commit is contained in:
committed by
Michael Kamensky
parent
15eca3f80a
commit
d25825c595
@@ -146,6 +146,16 @@ public class CostPartMana extends CostPart {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CostPart copy() {
|
||||
CostPart copied = super.copy();
|
||||
// when copied, clear cardMatrix
|
||||
if (copied instanceof CostPartMana) {
|
||||
((CostPartMana)copied).cardMatrix = null;
|
||||
}
|
||||
return copied;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -145,11 +145,17 @@ public class CostPayment extends ManaConversionMatrix {
|
||||
}
|
||||
|
||||
if (pd == null || !part.payAsDecided(decisionMaker.getPlayer(), pd, ability)) {
|
||||
if (part instanceof CostPartMana) {
|
||||
((CostPartMana)part).setCardMatrix(null);
|
||||
}
|
||||
game.costPaymentStack.pop(); // cost is resolved
|
||||
return false;
|
||||
}
|
||||
this.paidCostParts.add(part);
|
||||
|
||||
if (part instanceof CostPartMana) {
|
||||
((CostPartMana)part).setCardMatrix(null);
|
||||
}
|
||||
game.costPaymentStack.pop(); // cost is resolved
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user