@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isWhite(); }
protected static Paint getBackgroundPaint(ObjectColor colors, Collection<CardType> types, SubTypeList subTypes) { if (subTypes.contains(SubType.VEHICLE)) { return BG_TEXTURE_VEHICLE; } else if (types.contains(CardType.LAND)) { return BG_TEXTURE_LAND; } else if (types.contains(CardType.ARTIFACT)) { return BG_TEXTURE_ARTIFACT; } else if (colors.isMulticolored()) { return BG_TEXTURE_GOLD; } else if (colors.isWhite()) { return BG_TEXTURE_WHITE; } else if (colors.isBlue()) { return BG_TEXTURE_BLUE; } else if (colors.isBlack()) { return BG_TEXTURE_BLACK; } else if (colors.isRed()) { return BG_TEXTURE_RED; } else if (colors.isGreen()) { return BG_TEXTURE_GREEN; } else { // Colorless return new Color(71, 86, 101); } }
protected static Color getLandTextboxColor(ObjectColor color) { if (color.isWhite()) { return LAND_TEXTBOX_WHITE; } else if (color.isBlue()) { return LAND_TEXTBOX_BLUE; } else if (color.isBlack()) { return LAND_TEXTBOX_BLACK; } else if (color.isRed()) { return LAND_TEXTBOX_RED; } else if (color.isGreen()) { return LAND_TEXTBOX_GREEN; } else { return ERROR_COLOR; } }
protected static Color getTextboxColor(ObjectColor color) { if (color.isWhite()) { return TEXTBOX_WHITE; } else if (color.isBlue()) { return TEXTBOX_BLUE; } else if (color.isBlack()) { return TEXTBOX_BLACK; } else if (color.isRed()) { return TEXTBOX_RED; } else if (color.isGreen()) { return TEXTBOX_GREEN; } else { return ERROR_COLOR; } }
protected static Color getBorderColor(ObjectColor color) { if (color.isWhite()) { return BORDER_WHITE; } else if (color.isBlue()) { return BORDER_BLUE; } else if (color.isBlack()) { return BORDER_BLACK; } else if (color.isRed()) { return BORDER_RED; } else if (color.isGreen()) { return BORDER_GREEN; } else { return ERROR_COLOR; } }
@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { boolean isWhiteEnchantment = false; boolean isActivated = abilityToModify.getAbilityType() == AbilityType.ACTIVATED; if (isActivated) { MageObject permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null) { isWhiteEnchantment = permanent.isEnchantment() && permanent.getColor(game).isWhite(); } } return isActivated && isWhiteEnchantment; }
@Override public boolean apply(Game game, Ability source) { Map<UUID, Integer> playerCrtCount = new HashMap<>(); for (Iterator<Permanent> it = game.getBattlefield().getActivePermanents(source.getControllerId(), game).iterator(); it.hasNext();) { Permanent perm = it.next(); if (perm != null && perm.isCreature() && perm.getColor(game).isWhite() && perm.moveToExile(null, null, source.getSourceId(), game)) { playerCrtCount.putIfAbsent(perm.getControllerId(), 0); playerCrtCount.compute(perm.getControllerId(), (p, amount) -> amount + 1); } } for (UUID playerId : game.getPlayerList().toList()) { Player player = game.getPlayer(playerId); if (player != null) { player.drawCards(playerCrtCount.getOrDefault(playerId, 0), game); } } return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null && permanent.getColor(game).isWhite()) { permanent.destroy(source.getSourceId(), game, true); } return false; }
private static String getColorName(ObjectColor objectColor) { if (objectColor.isMulticolored()) { return LOG_COLOR_MULTI; } else if (objectColor.isColorless()) { return LOG_COLOR_COLORLESS; } else if (objectColor.isRed()) { return LOG_COLOR_RED; } else if (objectColor.isGreen()) { return LOG_COLOR_GREEN; } else if (objectColor.isBlue()) { return LOG_COLOR_BLUE; } else if (objectColor.isWhite()) { return LOG_COLOR_WHITE; } else { return LOG_COLOR_BLACK; } }
private static String getTooltipColorName(ObjectColor objectColor) { if (objectColor.isMulticolored()) { return LOG_TT_COLOR_MULTI; } else if (objectColor.isColorless()) { return LOG_TT_COLOR_COLORLESS; } else if (objectColor.isRed()) { return LOG_TT_COLOR_RED; } else if (objectColor.isGreen()) { return LOG_TT_COLOR_GREEN; } else if (objectColor.isBlue()) { return LOG_TT_COLOR_BLUE; } else if (objectColor.isWhite()) { return LOG_TT_COLOR_WHITE; } else { return LOG_TT_COLOR_BLACK; } } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { int damage = 1; ObjectColor color = permanent.getColor(game); if (color.isWhite() || color.isBlue()) { damage = 4; } permanent.damage(damage, source.getId(), game, false, false); } return false; } }
protected Color getAdditionalBoxColor(ObjectColor colors, Collection<CardType> types, boolean isNightCard) { if (isUnstableFullArtLand()) { if (colors.isWhite()) { return BOX_UST_WHITE; } else if (colors.isBlue()) { return BOX_UST_BLUE; } else if (colors.isBlack()) { return BOX_UST_BLACK; } else if (colors.isRed()) { return BOX_UST_RED; } else if (colors.isGreen()) { return BOX_UST_GREEN; } } return getBoxColor(colors, types, isNightCard); }
@Override public boolean apply(Game game, Ability source) { Set<Card> attachments = new LinkedHashSet<>(); Player player = game.getPlayer(source.getControllerId()); Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (target != null && player != null) { for (UUID attachmentId : target.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.isControlledBy(source.getControllerId()) && attachment.hasSubtype(SubType.AURA, game) && attachment.getColor(game).isWhite()) { attachments.add(attachment); } } attachments.add(target); player.moveCards(attachments, Zone.HAND, source, game); return true; } return false; } }
public void setColor(ObjectColor color) { this.setBlack(color.isBlack()); this.setBlue(color.isBlue()); this.setGreen(color.isGreen()); this.setRed(color.isRed()); this.setWhite(color.isWhite()); this.setGold(color.isGold()); }
public void addColor(ObjectColor color) { if (color.isWhite()) { setWhite(true); } if (color.isBlue()) { setBlue(true); } if (color.isBlack()) { setBlack(true); } if (color.isRed()) { setRed(true); } if (color.isGreen()) { setGreen(true); } if (color.isGold()) { setGold(true); } }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { Player targetController = game.getPlayer(targetCreature.getControllerId()); targetCreature.destroy(source.getSourceId(), game, false); Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (destroyedCreature.getColor(game).isGreen() || destroyedCreature.getColor(game).isWhite()) { if(targetController != null) { targetController.discard(1, false, source, game); return true; } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature == null) { return false; } game.addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn), source); if (creature.getColor(game).isRed()) { game.addEffect(new GainAbilityTargetEffect( TrampleAbility.getInstance(), Duration.EndOfTurn ), source); } if (creature.getColor(game).isWhite()) { game.addEffect(new GainAbilityTargetEffect( VigilanceAbility.getInstance(), Duration.EndOfTurn ), source); } return true; } }
public void increaseMana(Mana mana) { if (getColor().isBlack()) { mana.increaseBlack(); } else if (getColor().isBlue()) { mana.increaseBlue(); } else if (getColor().isRed()) { mana.increaseRed(); } else if (getColor().isGreen()) { mana.increaseGreen(); } else if (getColor().isWhite()) { mana.increaseWhite(); } else { mana.increaseColorless(); } } }
public Mana getMana(int amount) { Mana mana; if (getColor().isBlack()) { mana = Mana.BlackMana(amount); } else if (getColor().isBlue()) { mana = Mana.BlueMana(amount); } else if (getColor().isRed()) { mana = Mana.RedMana(amount); } else if (getColor().isGreen()) { mana = Mana.GreenMana(amount); } else if (getColor().isWhite()) { mana = Mana.WhiteMana(amount); } else { mana = Mana.ColorlessMana(amount); } return mana; }
@Override public boolean apply(Game game, Ability source) { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent target = game.getPermanent(equipment.getAttachedTo()); if (target != null) { if (addedColor.isBlack()) target.getColor(game).setBlack(true); if (addedColor.isBlue()) target.getColor(game).setBlue(true); if (addedColor.isWhite()) target.getColor(game).setWhite(true); if (addedColor.isGreen()) target.getColor(game).setGreen(true); if (addedColor.isRed()) target.getColor(game).setRed(true); } } return true; }