mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28: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
|
@Override
|
||||||
public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) {
|
public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|||||||
@@ -145,11 +145,17 @@ public class CostPayment extends ManaConversionMatrix {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pd == null || !part.payAsDecided(decisionMaker.getPlayer(), pd, ability)) {
|
if (pd == null || !part.payAsDecided(decisionMaker.getPlayer(), pd, ability)) {
|
||||||
|
if (part instanceof CostPartMana) {
|
||||||
|
((CostPartMana)part).setCardMatrix(null);
|
||||||
|
}
|
||||||
game.costPaymentStack.pop(); // cost is resolved
|
game.costPaymentStack.pop(); // cost is resolved
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.paidCostParts.add(part);
|
this.paidCostParts.add(part);
|
||||||
|
|
||||||
|
if (part instanceof CostPartMana) {
|
||||||
|
((CostPartMana)part).setCardMatrix(null);
|
||||||
|
}
|
||||||
game.costPaymentStack.pop(); // cost is resolved
|
game.costPaymentStack.pop(); // cost is resolved
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user