public String getDescription() { if (getColorCount() > 1) { return "multicolored"; } else { if (white) { return "white"; } if (blue) { return "blue"; } if (black) { return "black"; } if (red) { return "red"; } if (green) { return "green"; } if (gold) { return "gold"; } } return "colorless"; }
@Override public boolean apply(MageObject input, Game game) { return 1 == input.getColor(game).getColorCount(); }
@Override public boolean apply(MageObject input, Game game) { // 708.3. Each split card that consists of two halves with different colored mana symbols in their mana costs // is a multicolored card while it's not a spell on the stack. While it's a spell on the stack, it's only the // color or colors of the half or halves being cast. # if (input instanceof SplitCardHalf && game.getState().getZone(input.getId()) != Zone.STACK) { return 1 < ((SplitCardHalf) input).getMainCard().getColor(game).getColorCount(); } else { return 1 < input.getColor(game).getColorCount(); } }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Permanent target = game.getPermanentOrLKIBattlefield(sourceAbility.getFirstTarget()); if (target != null) { return 2 * target.getColor(game).getColorCount(); } return 0; }
protected static Paint getBorderPaint(ObjectColor colors, Collection<CardType> types, int width) { if (colors.isMulticolored()) { if (colors.getColorCount() == 2) { List<ObjectColor> twoColors = colors.getColors();
protected static Paint getTextboxPaint(ObjectColor colors, Collection<CardType> types, int width) { if (colors.isMulticolored()) { if (colors.getColorCount() == 2) { List<ObjectColor> twoColors = colors.getColors(); Color[] translatedColors;
@Override public int calculate(Game game, Ability source, Effect effect) { int count = 0; Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null) { Permanent permanent = game.getPermanent(equipment.getAttachedTo()); if (permanent != null) { count = permanent.getColor(game).getColorCount(); } } return count; }
@Override public int calculate(Game game, Ability source, Effect effect) { int count = 0; Permanent aura = game.getPermanent(source.getSourceId()); if (aura != null) { Permanent permanent = game.getPermanent(aura.getAttachedTo()); if (permanent != null) { count = permanent.getColor(game).getColorCount(); } } return count; }
@Override public boolean apply(Game game, Ability source) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (creature != null && !creature.getId().equals(source.getSourceId())) { int colors = creature.getColor(game).getColorCount(); creature.addPower(colors); creature.addToughness(colors); } } return true; } }
protected Color getBoxColor(ObjectColor colors, Collection<CardType> types, boolean isNightCard) { if (cardView.isAbility()) { return Color.BLACK; } else if (colors.getColorCount() == 2 && types.contains(CardType.LAND)) { // Special case for two color lands. Boxes should be normal land colored // rather than multicolor. Three or greater color lands use a multi-color // box as normal. return BOX_LAND; } else if (colors.isMulticolored()) { return isNightCard ? BOX_GOLD_NIGHT : BOX_GOLD; } else if (colors.isColorless()) { if (types.contains(CardType.LAND)) { return BOX_LAND; } else { return isNightCard ? BOX_COLORLESS_NIGHT : BOX_COLORLESS; } } else if (colors.isWhite()) { return isNightCard ? BOX_WHITE_NIGHT : BOX_WHITE; } else if (colors.isBlue()) { return isNightCard ? BOX_BLUE_NIGHT : BOX_BLUE; } else if (colors.isBlack()) { return isNightCard ? BOX_BLACK_NIGHT : BOX_BLACK; } else if (colors.isRed()) { return isNightCard ? BOX_RED_NIGHT : BOX_RED; } else if (colors.isGreen()) { return isNightCard ? BOX_GREEN_NIGHT : BOX_GREEN; } else { return ERROR_COLOR; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetControlledPermanent target = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent("a creature (to sacrifice)"), true); if (target.canChoose(source.getSourceId(), controller.getId(), game)) { if (controller.chooseTarget(outcome, target, source, game)) { Permanent toSacrifice = game.getPermanent(target.getFirstTarget()); if (toSacrifice != null) { toSacrifice.sacrifice(source.getSourceId(), game); game.applyEffects(); int colors = toSacrifice.getColor(game).getColorCount(); if (colors > 0) { TargetCardInYourGraveyard targetCard = new TargetCardInYourGraveyard(0, colors, new FilterCard("up to " + colors + " card" + (colors > 1 ? "s" : "") + " from your graveyard")); controller.chooseTarget(outcome, targetCard, source, game); controller.moveCards(new CardsImpl(targetCard.getTargets()), Zone.HAND, source, game); } } } } return true; } return false; } }