@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isGreen(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isGreen(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isGreen(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); return (permanent != null && permanent.isCreature() && permanent.getColor(game).isGreen()); }
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 apply(Game game, Ability source, Ability abilityToModify) { MageObject object = abilityToModify.getSourceObject(game); int reduce = 0; if (object != null) { if (object.getColor(game).isRed()) { reduce++; } if (object.getColor(game).isGreen()) { reduce++; } } CardUtil.reduceCost(abilityToModify, reduce); return true; }
@Override public boolean checkTrigger(GameEvent event, Game game) { return event.getPlayerId().equals(this.getControllerId()) && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature() && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getColor(game).isGreen(); }
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 applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(source.getSourceId())) { for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { //excludes itself (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=23067) if (!Objects.equals(creature.getId(), source.getSourceId())) { ObjectColor color = creature.getColor(game); if (color.isBlack() || color.isGreen()) { return false; } } } return true; } 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) { PermanentsEnteredBattlefieldWatcher watcher = game.getState().getWatcher(PermanentsEnteredBattlefieldWatcher.class); if (watcher != null) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { List<Permanent> permanents = watcher.getThisTurnEnteringPermanents(opponentId); if (permanents != null) { for (Permanent permanent : permanents) { if (permanent.isCreature() && permanent.getColor(game).isGreen()) { return true; } } } } } return false; }
@Override public boolean apply(Game game, Ability source) { boolean applied = false; Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null) { if (target.getColor(game).isRed() || target.getColor(game).isGreen()) { applied = target.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); } else { applied = target.moveToZone(Zone.HAND, source.getSourceId(), game, false); } } return applied; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.isCreature() && permanent.getColor(game).isGreen()) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); 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()); }
@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; } }
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; }