@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isRed(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isRed(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { StackObject spell = game.getStack().getStackObject(event.getSourceId()); return spell != null && spell.getColor(game).isRed(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { if (event.getSourceId().equals(source.getSourceId())) { Permanent damageTo = game.getPermanent(event.getTargetId()); return damageTo != null && damageTo.getColor(game).isRed(); } } 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 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; } }
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; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if(sourcePermanent == null) { sourceObject = game.getObject(event.getSourceId()); } else { sourceObject = sourcePermanent; } if (sourceObject != null && sourceObject.getColor(game).isRed()) { return true; } return false; }
@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 apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); if (permanent != null && permanent.getColor(game).isRed()) { permanent.destroy(source.getSourceId(), game, false); } return true; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (sourcePermanent == null) { sourceObject = game.getObject(event.getSourceId()); } else { sourceObject = sourcePermanent; } return sourceObject != null && sourceObject.getColor(game).isRed() && !sourceObject.getId().equals(source.getSourceId()); } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if(source.isControlledBy(game.getControllerId(event.getSourceId()))) { MageObject sourceObject; Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if(sourcePermanent == null) { sourceObject = game.getObject(event.getSourceId()); } else { sourceObject = sourcePermanent; } return sourceObject != null && sourceObject.getColor(game).isRed() && !sourceObject.getId().equals(source.getSourceId()); } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { StackObject spell = game.getStack().getStackObject(event.getSourceId()); return spell != null && spell.isControlledBy(source.getControllerId()) && spell.getColor(game).isRed() && (spell.isInstant() || spell.isSorcery()); }
@Override public boolean apply(Game game, Ability source) { if (game.getStack().getSpell(source.getFirstTarget()).getColor(game).isRed()) { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return true; }
@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 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 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; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).isRed()) { if (sourceObject instanceof Permanent && sourceObject.isCreature() || sourceObject instanceof Spell) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId()))); 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(); } } }