@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return blocker.isArtifact() || blocker.getColor(game).isBlack(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isBlack(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isBlack(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getSourceId()); return (permanent != null && permanent.isCreature() && permanent.getColor(game).isBlack()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getColor(game).isBlack()) { return true; } } return false; }
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) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { Card card = player.getLibrary().getFromTop(game); if (card != null) { return card.getColor(game).isBlack(); } } return false; } }
@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).isBlack(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { Permanent targettedPermanent = game.getPermanent(event.getTargetId()); Spell sourceSpell = game.getStack().getSpell(event.getSourceId()); if (targettedPermanent != null && sourceSpell != null) { return sourceSpell.getColor(game).isBlue() || sourceSpell.getColor(game).isBlack(); } } return false; } }
@Override public boolean apply(Game game, Ability source) { for (UUID attackingCreatureId : game.getCombat().getAttackers()) { Permanent attackingCreature = game.getPermanent(attackingCreatureId); if (attackingCreature != null) { if (attackingCreature.getColor(game).isBlack() && attackingCreature.hasAbility(FlyingAbility.getInstance().getId(), game)) { 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 replaceEvent(GameEvent event, Ability source, Game game) { PreventionEffectData preventionData = preventDamageAction(event, source, game); MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && (sourceObject.getColor(game).isBlack() || sourceObject.getColor(game).isRed())) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.gainLife(preventionData.getPreventedDamage(), game, source); } } 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 applies(GameEvent event, Ability source, Game game) { Card targetCard = game.getCard(event.getTargetId()); StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) { if (stackObject.getColor(game).isBlack() || stackObject.getColor(game).isRed()) { if (!stackObject.isControlledBy(source.getControllerId()) && stackObject.isInstant() || stackObject.isSorcery()) { return true; } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (player != null && permanent != null) { permanent.destroy(source.getSourceId(), game, true); game.applyEffects(); if (permanent.getColor(game).isBlack() || permanent.getColor(game).isBlue()) { player.drawCards(1, game); } return true; } return false; } }
@Override public boolean applies(GameEvent event, Ability ability, Game game) { MageObject mageObject = game.getObject(event.getSourceId()); if (game.getPlayer(ability.getControllerId()).hasOpponent(event.getPlayerId(), game) && mageObject instanceof Spell && (mageObject.getColor(game).isBlack() || mageObject.getColor(game).isBlue())) { Permanent permanent = game.getPermanent(event.getTargetId()); return permanent != null && permanent.isControlledBy(ability.getControllerId()); } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new PermanentIdPredicate(targetCreature.getId())); game.addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, false), source); if (targetCreature.getColor(game).isBlack() || targetCreature.getColor(game).isRed()) { return targetCreature.destroy(source.getSourceId(), game, false); } } 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(); } } }