@Override public ManaCosts<T> getUnpaid() { ManaCosts<T> unpaid = new ManaCostsImpl<>(); for (T cost : this) { if (!(cost instanceof VariableManaCost) && !cost.isPaid()) { unpaid.add((T) cost.getUnpaid()); } } return unpaid; }
@Override public boolean testPay(Mana testMana) { for (ManaCost cost : this) { if (cost.testPay(testMana)) { return true; } } return false; }
@Override public int getConvertedManaCost() { if (manaCost != null) { return manaCost.convertedManaCost(); } return 0; }
public MadnessCastEffect(ManaCosts<ManaCost> madnessCost) { super(Outcome.Benefit); this.madnessCost = madnessCost; staticText = "you may cast it by paying " + madnessCost.getText() + " instead of putting it into your graveyard"; }
@Override public void setPaid() { for (T cost : this) { cost.setPaid(); } }
@Override public void assignPayment(Game game, Ability ability, ManaPool pool, Cost costToPay) { if (!assignColored(ability, game, pool, mana, costToPay)) { assignGeneric(ability, game, pool, mana2, costToPay); } }
@Override public boolean containsColor(ColoredManaSymbol coloredManaSymbol) { for (ManaCost manaCost : this) { if (manaCost.containsColor(coloredManaSymbol)) { return true; } } return false; } }
@Override public boolean isPaid() { if (paid || isColoredPaid(this.mana)) { return true; } return isColorlessPaid(this.mana2); }
LicidEffect(ManaCost specialActionCost) { super(Outcome.Neutral); this.specialActionCost = specialActionCost; this.staticText = "{this} loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay " + specialActionCost.getText() + " to end this effect"; }
@Override public void setSourceFilter(Filter filter) { for (T cost : this) { cost.setSourceFilter(filter); } }
@Override public void assignPayment(Game game, Ability ability, ManaPool pool, Cost costToPay) { if (assignColored(ability, game, pool, this.mana1, costToPay)) { return; } assignColored(ability, game, pool, this.mana2, costToPay); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { for (T cost : this) { if (!cost.canPay(ability, sourceId, controllerId, game)) { return false; } } return true; }
@Override public Filter getSourceFilter() { for (T cost : this) { if (cost.getSourceFilter() != null) { return cost.getSourceFilter(); } } return null; }
@Override public boolean isPaid() { if (paid) { return true; } return this.isColoredPaid(mana); }
@Override public boolean isPaid() { if (paid) { return true; } return this.isColorlessPaid(mana); }
@Override public int convertedManaCost() { int total = 0; for (ManaCost cost : this) { total += cost.convertedManaCost(); } return total; }
@Override public ManaCosts<T> getUnpaidVariableCosts() { ManaCosts<T> unpaid = new ManaCostsImpl<>(); for (ManaCost cost : this) { if (cost instanceof VariableManaCost && !cost.isPaid()) { unpaid.add((T) cost.getUnpaid()); } } return unpaid; }
public PactEffect(ManaCosts cost) { super(Outcome.Neutral); this.cost = cost; staticText = "pay " + cost.getText() + ". If you don't, you lose the game"; }