@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null) { return !permanent.isTapped(); } return false; }
public static boolean canBlock(Game game, Permanent blocker) { boolean canBlock = true; if (!blocker.isTapped()) { try { canBlock = blocker.canBlock(null, game); } catch (Exception e) { //e.printStackTrace(); } } return canBlock; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (permanent != null) { return !permanent.isTapped(); } return false; }
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { if(super.canTarget(controllerId, id, source, game)){ Permanent permanent = game.getPermanent(id); return permanent.isTapped(); } return false; }
@Override public boolean checkInterveningIfClause(Game game) { Permanent permanent = game.getPermanent(getSourceId()); return permanent != null && !permanent.isTapped(); }
@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify instanceof SpellAbility) { Permanent permanent = game.getPermanent(source.getSourceId()); return permanent != null && !permanent.isTapped(); } return false; }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Permanent attachment = game.getPermanentOrLKIBattlefield(sourceId); Permanent permanent = game.getPermanent(attachment.getAttachedTo()); if (permanent != null) { // return true; // Technically the more correct implementation, but all cards using this cost also come with an "untapped" condition return !permanent.isTapped(); } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); if (permanent != null) { return permanent.isTapped(); } return false; } }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return permanent.getId().equals(source.getSourceId()) && permanent.isControlledBy(game.getActivePlayerId()) && // your untap step permanent.isTapped(); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); if (permanent != null) { return !permanent.isTapped(); } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); if (permanent != null) { return !permanent.isTapped(); } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent.isTapped()) { return false; } return super.applies(event, source, game); }
@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null && sourcePermanent.isTapped()) { return super.applies(abilityToModify, source, game); } return false; }
private static boolean canTap(Permanent permanent) { return !permanent.isTapped() && (!permanent.hasSummoningSickness() || !permanent.getCardType().contains(CardType.CREATURE) || permanent.getAbilities().contains(HasteAbility.getInstance())); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null) { return !permanent.isTapped() && (permanent.canTap() || null != game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.ACTIVATE_HASTE, ability, controllerId, game)); } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (source.isControlledBy(event.getPlayerId())) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && permanent.isTapped()) { return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent attachment = game.getPermanent(source.getSourceId()); if (attachment == null || attachment.getAttachedTo() == null) { return false; } Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); if (attachedTo == null) { return false; } return attachedTo.isTapped(); } }
@Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); if (permanent != null && permanent.isTapped()) { permanent.untap(game); return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent p = game.getPermanent(event.getTargetId()); if (p != null && p.isTapped() && p.isControlledBy(this.controllerId)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; } return false; }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { DamagePlayerEvent damageEvent = (DamagePlayerEvent) event; Permanent damager = game.getPermanentOrLKIBattlefield(damageEvent.getSourceId()); Permanent p = game.getPermanent(source.getSourceId()); if (p != null && !p.isTapped() && damageEvent.isCombatDamage() && damager != null && damager.isAttacking() && !damager.isBlocked(game)) { p.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable()); return true; } return true; }