@Override public boolean apply(MageObject input, Game game) { return color != null && input.getColor(game).contains(color); }
@Override public boolean apply(MageObject input, Game game) { return color != null && input.getColor(game).shares(color); }
@Override public boolean apply(MageObject input, Game game) { return input.getColor(game).isColorless(); }
@Override public boolean apply(MageObject input, Game game) { return 1 == input.getColor(game).getColorCount(); }
@Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); return object != null && object.hasSubtype(SubType.ELDRAZI, game) && object.getColor(game).isColorless(); } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (!this.used && super.applies(event, source, game)) { if (event.getTargetId().equals(source.getControllerId()) && event.getSourceId().equals(target.getFirstTarget())) { return (game.getObject(target.getFirstTarget()).getColor(game).contains(ObjectColor.BLACK) || game.getObject(target.getFirstTarget()).getColor(game).contains(ObjectColor.RED)); } } return false; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game) && event.getTargetId().equals(targetPointer.getFirst(game, source))) { MageObject object = game.getObject(event.getSourceId()); return object != null && object.getColor(game).isColorless(); } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getControllerId())) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).contains(color)) { return super.applies(event, source, game); } } return false; }
@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; }
@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 checkTrigger(GameEvent event, Game game) { MageObject object = game.getObject(event.getSourceId()); if (object instanceof Spell) { if (event.getTargetId().equals(this.getControllerId()) && object.getColor(game).contains(ObjectColor.WHITE) && (object.isInstant() || object.isSorcery())) { return true; } } 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).isGreen(); }
@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 (super.applies(event, source, game)) { if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE && event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { MageObject sourceObject = game.getObject(event.getSourceId()); if (sourceObject != null && sourceObject.getColor(game).shares(this.color)) { 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(MageObject input, Game game) { // 708.3. Each split card that consists of two halves with different colored mana symbols in their mana costs // is a multicolored card while it's not a spell on the stack. While it's a spell on the stack, it's only the // color or colors of the half or halves being cast. # if (input instanceof SplitCardHalf && game.getState().getZone(input.getId()) != Zone.STACK) { return 1 < ((SplitCardHalf) input).getMainCard().getColor(game).getColorCount(); } else { return 1 < input.getColor(game).getColorCount(); } }
@Override public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) { Permanent permanent = game.getPermanent(input.getSourceId()); if (permanent == null) { return false; } ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); return color != null && input.getObject().getColor(game).shares(color); } }
@Override public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) { mageObject.getColor(game).setColor(sourcePermanent.getColor(game)); mageObject.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); return true; }
@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; }