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; } }
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 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; } }
public HumanClericToken() { super("Human Cleric", "1/1 white and black Human Cleric creature token"); cardType.add(CardType.CREATURE); subtype.add(SubType.HUMAN); subtype.add(SubType.CLERIC); color.setWhite(true); color.setBlack(true); power = new MageInt(1); toughness = new MageInt(1); } public HumanClericToken(final HumanClericToken token) {
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && spell.getColor(game).isRed(); }
SelesnyaKeyruneToken() { super("", "3/3 green and white Wolf artifact creature"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); color.setWhite(true); color.setGreen(true); this.subtype.add(SubType.WOLF); power = new MageInt(3); toughness = new MageInt(3); } public SelesnyaKeyruneToken(final SelesnyaKeyruneToken token) {
OjutaiMonumentToken() { super("", "4/4 white and blue Dragon artifact creature with flying"); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); color.setWhite(true); color.setBlue(true); this.subtype.add(SubType.DRAGON); power = new MageInt(4); toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); }
@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 canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return blocker.isArtifact() || blocker.getColor(game).isBlack(); }
@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(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 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).isGreen(); }
@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; } }