ObjectColor cardColor = card.getColor(null); if (cardColor != null) { List<ObjectColor> colors = cardColor.getColors();
protected static Paint getBorderPaint(ObjectColor colors, Collection<CardType> types, int width) { if (colors.isMulticolored()) { if (colors.getColorCount() == 2) { List<ObjectColor> twoColors = colors.getColors();
@Override public boolean applies(GameEvent event, Ability source, Game game) { manaUsed = (Mana) game.getState().getValue("ProtectiveSphere" + source.getSourceId().toString()); if (super.applies(event, source, game)) { if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { colorsOfChosenSource = game.getObject(target.getFirstTarget()).getColor(game).getColors(); if (colorsOfChosenSource.stream().anyMatch((c) -> (manaUsed.getColor(c.getOneColoredManaSymbol()) > 0))) { return true; } } } return false; } }
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; if (types.contains(CardType.LAND)) {
@Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { if (permanent.getColor(game).hasColor()) { List<ColorPredicate> colorPredicates = new ArrayList<>(); for (ObjectColor color : permanent.getColor(game).getColors()) { colorPredicates.add(new ColorPredicate(color)); } FilterCard filterColors = new FilterCard("its colors"); filterColors.add(Predicates.or(colorPredicates)); Ability ability = new ProtectionAbility(filterColors); permanent.addAbility(ability, source.getSourceId(), game); } } return true; }
public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(source.getFirstTarget()); if(target != null) { for(ObjectColor color : target.getColor(game).getColors()) { FilterCard filter = new FilterCard(color.getDescription()); filter.add(new ColorPredicate(color)); game.addEffect(new GainAbilityControlledEffect(new ProtectionAbility(filter), Duration.EndOfTurn, new FilterControlledCreaturePermanent()), source); } return true; } return false; } }
private Mana getManaTypes(Game game, Ability source) { Mana types = new Mana(); if (game == null || game.getPhase() == null) { return types; } if (inManaTypeCalculation) { return types; } inManaTypeCalculation = true; ObjectColor permanentColor; List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); for (Permanent permanent : permanents) { permanentColor = permanent.getColor(game); if (permanentColor.isColorless()) { types.add(Mana.ColorlessMana(1)); } else { List<ObjectColor> permanentColors = permanent.getColor(game).getColors(); for (ObjectColor color : permanentColors) { types.add(new Mana(color.getOneColoredManaSymbol())); } } } inManaTypeCalculation = false; return types; }
if (sublayer == SubLayer.NA) { if (game.getState().getValue("opalTitanColor" + source.getSourceId()) != null) { for (ObjectColor color : ((ObjectColor) game.getState().getValue("opalTitanColor" + source.getSourceId())).getColors()) { if (!permanent.getAbilities().contains(ProtectionAbility.from(color))) { permanent.addAbility(ProtectionAbility.from(color));
if (card != null) { for (ObjectColor color : card.getColor(game).getColors()) { if (color.isWhite()) { types.setWhite(1);