mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
remove getManaPaid() from SpellAbility because there is already a method getPayingMana()
Remove input/InputPayManaExecuteCommands.java, using Common input instead
This commit is contained in:
@@ -216,14 +216,17 @@ public class CostExile extends CostPartWithList {
|
||||
}
|
||||
}
|
||||
|
||||
public static final String HashListKey = "Exiled";
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.cost.CostPartWithList#getHashForList()
|
||||
*/
|
||||
@Override
|
||||
public String getHashForList() {
|
||||
// TODO Auto-generated method stub
|
||||
return "Exiled";
|
||||
return HashListKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public <T> T accept(ICostVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
|
||||
@@ -115,12 +115,20 @@ public class CostPartMana extends CostPart {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
|
||||
public ManaCost getManaCostFor(SpellAbility sa) {
|
||||
if ( isExiledCreatureCost() && !sa.getPaidList(CostExile.HashListKey).isEmpty()) // back from the brink
|
||||
return sa.getPaidList(CostExile.HashListKey).get(0).getManaCost();
|
||||
else
|
||||
return getManaToPay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) {
|
||||
// TODO Auto-generated method stub
|
||||
sa.getManaPaid().clear();
|
||||
return payer.getController().payManaCost(this, pd, sa);
|
||||
payer.getManaPool().clearManaPaid(sa, false);
|
||||
|
||||
// decision not used here, the whole payment is interactive!
|
||||
return payer.getController().payManaCost(this, sa);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class ManaPool implements Iterable<Mana> {
|
||||
paidAbs.add(saPayment); // assumes some part on the mana produced by the ability will get used
|
||||
for (final Mana mana : abManaPart.getLastManaProduced()) {
|
||||
if( tryPayCostWithMana(saPaidFor, manaCost, mana) )
|
||||
saPaidFor.getManaPaid().add(mana);
|
||||
saPaidFor.getPayingMana().add(mana);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class ManaPool implements Iterable<Mana> {
|
||||
|
||||
boolean result = manaFound != null && tryPayCostWithMana(saPaidFor, manaCost, manaFound);
|
||||
if(result)
|
||||
saPaidFor.getManaPaid().add(manaFound);
|
||||
saPaidFor.getPayingMana().add(manaFound);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,6 @@ public class ManaPool implements Iterable<Mana> {
|
||||
return false;
|
||||
}
|
||||
manaCost.payMana(mana, this);
|
||||
sa.getPayingMana().add(mana);
|
||||
this.removeMana(mana);
|
||||
if (mana.addsNoCounterMagic(sa) && sa.getHostCard() != null) {
|
||||
sa.getHostCard().setCanCounter(false);
|
||||
|
||||
@@ -18,7 +18,6 @@ import forge.game.combat.Combat;
|
||||
import forge.game.cost.Cost;
|
||||
import forge.game.cost.CostPart;
|
||||
import forge.game.cost.CostPartMana;
|
||||
import forge.game.cost.PaymentDecision;
|
||||
import forge.game.mana.Mana;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.replacement.ReplacementEffect;
|
||||
@@ -223,7 +222,10 @@ public abstract class PlayerController {
|
||||
public List<Card> cheatShuffle(List<Card> list) { return list; }
|
||||
public Collection<? extends PaperCard> complainCardsCantPlayWell(Deck myDeck) { return null; }
|
||||
|
||||
public abstract boolean payManaCost(CostPartMana costPartMana, PaymentDecision pd, SpellAbility sa);
|
||||
public final boolean payManaCost(CostPartMana costPartMana, SpellAbility sa) {
|
||||
return payManaCost(costPartMana.getManaCostFor(sa), costPartMana, sa);
|
||||
}
|
||||
public abstract boolean payManaCost(ManaCost toPay, CostPartMana costPartMana, SpellAbility sa);
|
||||
|
||||
public abstract Map<Card, ManaCostShard> chooseCardsForConvoke(SpellAbility sa, ManaCost manaCost, List<Card> untappedCreats);
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
*
|
||||
* @return a {@link java.util.ArrayList} object.
|
||||
*/
|
||||
public ArrayList<Mana> getPayingMana() {
|
||||
public List<Mana> getPayingMana() {
|
||||
return this.payingMana;
|
||||
}
|
||||
|
||||
@@ -490,11 +490,6 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
public List<SpellAbility> getPayingManaAbilities() {
|
||||
return this.paidAbilities;
|
||||
}
|
||||
|
||||
List<Mana> paidMana = new ArrayList<>();
|
||||
public List<Mana> getManaPaid() {
|
||||
return paidMana;
|
||||
}
|
||||
|
||||
// Combined PaidLists
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user