@Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { MageObjectReference blocker = new MageObjectReference(event.getSourceId(), game); MageObjectReference attacker = new MageObjectReference(event.getTargetId(), game); if (blocker.getPermanentOrLKIBattlefield(game).getColor(game).isBlue()){ blockedOrBlockedByBlueThisTurnCreatures.add(attacker); } if (attacker.getPermanentOrLKIBattlefield(game).getColor(game).isBlue()){ blockedOrBlockedByBlueThisTurnCreatures.add(blocker); } } }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isBlue(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isBlue(); }
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) { SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class); if (watcher != null) { List<Spell> spells = watcher.getSpellsCastThisTurn(source.getControllerId()); if (spells != null) { for (Spell spell : spells) { if (!spell.getSourceId().equals(source.getSourceId()) && spell.getColor(game).isBlue()) { return true; } } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); if (permanent != null && permanent.getColor(game).isBlue()) { permanent.destroy(source.getSourceId(), game, false); } return true; }
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; } }
@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; } }
@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; } }
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) { SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class); if (watcher != null) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { List<Spell> spells = watcher.getSpellsCastThisTurn(opponentId); if (spells != null) { for (Spell spell : spells) { if (spell.getColor(game).isBlue()) { return true; } } } } } return false; }
@Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); if(targetSpell != null && targetSpell.getColor(game).isBlue()){ game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; } }
@Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); if (targetSpell != null && targetSpell.getColor(game).isBlue()) { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; }
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) { 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) { targetCreature.destroy(source.getSourceId(), game, false); Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (destroyedCreature.getColor(game).isBlue() || destroyedCreature.getColor(game).isBlack()) { SpiderToken token = new SpiderToken(); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); 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(); } } }