@Override public boolean testPay(Mana testMana) { return testMana.getColorless() > 0; }
@Override public List<Mana> getNetMana(Game game, Ability source) { List<Mana> netManas = new ArrayList<>(); Mana types = getManaTypes(game, source); if (types.getBlack() > 0) { netManas.add(new Mana(ColoredManaSymbol.B)); } if (types.getRed() > 0) { netManas.add(new Mana(ColoredManaSymbol.R)); } if (types.getBlue() > 0) { netManas.add(new Mana(ColoredManaSymbol.U)); } if (types.getGreen() > 0) { netManas.add(new Mana(ColoredManaSymbol.G)); } if (types.getWhite() > 0) { netManas.add(new Mana(ColoredManaSymbol.W)); } if (types.getColorless() > 0) { netManas.add(Mana.ColorlessMana(1)); } if (types.getAny() > 0) { netManas.add(Mana.AnyMana(1)); } return netManas; }
@Override public List<Mana> getNetMana(Game game, Ability source) { List<Mana> netManas = new ArrayList<>(); Mana types = getManaTypes(game, source); if (types.getBlack() > 0) { netManas.add(new Mana(ColoredManaSymbol.B)); } if (types.getRed() > 0) { netManas.add(new Mana(ColoredManaSymbol.R)); } if (types.getBlue() > 0) { netManas.add(new Mana(ColoredManaSymbol.U)); } if (types.getGreen() > 0) { netManas.add(new Mana(ColoredManaSymbol.G)); } if (types.getWhite() > 0) { netManas.add(new Mana(ColoredManaSymbol.W)); } if (types.getColorless() > 0) { netManas.add(Mana.ColorlessMana(1)); } if (types.getAny() > 0) { netManas.add(Mana.AnyMana(1)); } return netManas; }
@Override public List<Mana> getNetMana(Game game, Ability source) { int manaAmount = getManaAmount(game, source); List<Mana> netManas = new ArrayList(); Mana types = getManaTypes(game, source); if (types.getRed() > 0) { netManas.add(new Mana(manaAmount, 0, 0, 0, 0, 0, 0, 0)); } if (types.getGreen() > 0) { netManas.add(new Mana(0, manaAmount, 0, 0, 0, 0, 0, 0)); } if (types.getBlue() > 0) { netManas.add(new Mana(0, 0, manaAmount, 0, 0, 0, 0, 0)); } if (types.getWhite() > 0) { netManas.add(new Mana(0, 0, 0, manaAmount, 0, 0, 0, 0)); } if (types.getBlack() > 0) { netManas.add(new Mana(0, 0, 0, 0, manaAmount, 0, 0, 0)); } if (types.getColorless() > 0) { netManas.add(new Mana(0, 0, 0, 0, 0, 0, 0, manaAmount)); } if (types.getAny() > 0) { netManas.add(new Mana(0, 0, 0, 0, 0, 0, manaAmount, 0)); } return netManas; }
/** * Adds mana from the passed in {@link Mana} object to this object. * * @param mana mana to add to this object. */ public void add(final Mana mana) { red += mana.getRed(); green += mana.getGreen(); blue += mana.getBlue(); white += mana.getWhite(); black += mana.getBlack(); generic += mana.getGeneric(); colorless += mana.getColorless(); any += mana.getAny(); }
return true; if (currentUnpaidMana.getMana().getColorless() > 0 && choice.getChoices().contains("Colorless")) { choice.setChoice("Colorless"); return true;
choice.getChoices().add("White"); if (types.getColorless() > 0) { choice.getChoices().add("Colorless");
choice.getChoices().add("White"); if (!onlyColors && types.getColorless() > 0) { choice.getChoices().add("Colorless");
choice.getChoices().add("White"); if (!onlyColors && types.getColorless() > 0) { choice.getChoices().add("Colorless");
choice.getChoices().add("White"); if (types.getColorless() > 0) { choice.getChoices().add("Colorless");
choice.getChoices().add("White"); if (types.getColorless() > 0) { choice.getChoices().add("Colorless");
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Mana mana = ((ManaEvent) event).getMana(); if (mana.getBlack() > 0) { mana.set(ManaType.BLACK, mana.getBlack() * 2); } if (mana.getBlue() > 0) { mana.set(ManaType.BLUE, mana.getBlue() * 2); } if (mana.getWhite() > 0) { mana.set(ManaType.WHITE, mana.getWhite() * 2); } if (mana.getGreen() > 0) { mana.set(ManaType.GREEN, mana.getGreen() * 2); } if (mana.getRed() > 0) { mana.set(ManaType.RED, mana.getRed() * 2); } if (mana.getColorless() > 0) { mana.set(ManaType.COLORLESS, mana.getColorless() * 2); } return false; }
if (lessMana.getColorless() > moreMana.getColorless()) { anyDiff -= lessMana.getColorless() - moreMana.getColorless(); if (anyDiff < 0) { return null;
choice.getChoices().add("White"); if (mana.getColorless() > 0) { choice.getChoices().add("Colorless");
public void addMana(Mana manaToAdd, Game game, Ability source, boolean emptyOnTurnsEnd) { if (manaToAdd != null) { Mana mana = manaToAdd.copy(); if (!game.replaceEvent(new ManaEvent(EventType.ADD_MANA, source.getId(), source.getSourceId(), playerId, mana))) { if (mana instanceof ConditionalMana) { ManaPoolItem item = new ManaPoolItem((ConditionalMana) mana, source.getSourceObject(game), ((ConditionalMana) mana).getManaProducerOriginalId() != null ? ((ConditionalMana) mana).getManaProducerOriginalId() : source.getOriginalId()); if (emptyOnTurnsEnd) { item.setDuration(Duration.EndOfTurn); } this.manaItems.add(item); } else { ManaPoolItem item = new ManaPoolItem(mana.getRed(), mana.getGreen(), mana.getBlue(), mana.getWhite(), mana.getBlack(), mana.getGeneric() + mana.getColorless(), source.getSourceObject(game), source.getOriginalId(), mana.getFlag()); if (emptyOnTurnsEnd) { item.setDuration(Duration.EndOfTurn); } this.manaItems.add(item); } ManaEvent manaEvent = new ManaEvent(EventType.MANA_ADDED, source.getId(), source.getSourceId(), playerId, mana); manaEvent.setData(mana.toString()); game.fireEvent(manaEvent); } } }
compare.any = compare.getAny() + compare.getColorless(); if (compare.any < 0) { return false;
int colorlessAmount = mana.getColorless(); int coloredAmount = mana.countColored(); switch (colorChosen.getOneColoredManaSymbol()) {
public Mana getMana(FilterMana filter) { if (filter == null) { return getMana(); } Mana test = getMana(); Mana m = new Mana(); if (filter.isBlack()) { m.setBlack(test.getBlack()); } if (filter.isBlue()) { m.setBlue(test.getBlue()); } if (filter.isGreen()) { m.setGreen(test.getGreen()); } if (filter.isRed()) { m.setRed(test.getRed()); } if (filter.isWhite()) { m.setWhite(test.getWhite()); } if (filter.isColorless()) { m.setColorless(test.getColorless()); } if (filter.isGeneric()) { m.setGeneric(test.getGeneric()); } return m; }
} else if (manaTemplate.getWhite() > 0) { computedMana.setWhite(count); } else if (manaTemplate.getColorless() > 0) { computedMana.setColorless(count); } else if (manaTemplate.getAny() > 0) {
if (mana.includesMana(cost)) { // it can be paid if (cost.getGeneric() > 0 && cost.getGeneric() > (mana.getGeneric() + mana.getColorless())) { Mana coloredCost = cost.copy(); coloredCost.setGeneric(0);