@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return !blocker.getAbilities().contains(FlyingAbility.getInstance()); }
@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return attacker.getAbilities().contains(SpaceflightAbility.getInstance()); }
@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return blocker.getAbilities().contains(DefenderAbility.getInstance()); }
@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { if (blocker.getAbilities().contains(FlyingAbility.getInstance())) { return true; } return false; }
@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return attacker.getAbilities().contains(FlyingAbility.getInstance()); }
@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return attacker.getAbilities().contains(FlyingAbility.getInstance()); }
private boolean isAbilityStillExists(final Game game, final Ability ability, ContinuousEffect effect) { final Card card = game.getPermanentOrLKIBattlefield(ability.getSourceId()); if (!(effect instanceof BecomesFaceDownCreatureEffect)) { if (card != null) { if (!card.getAbilities(game).contains(ability)) { return false; } } } return true; }
private static boolean canTap(Permanent permanent) { return !permanent.isTapped() && (!permanent.hasSummoningSickness() || !permanent.getCardType().contains(CardType.CREATURE) || permanent.getAbilities().contains(HasteAbility.getInstance())); }
@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { if (attacker != null && attacker.isControlledBy(source.getControllerId()) && blocker.getAbilities().contains(FlyingAbility.getInstance())) { return false; } return true; }
private static int sumDamage(List<Permanent> attackersThatWontBeBlocked, Player defender) { int damage = 0; for (Permanent attacker : attackersThatWontBeBlocked) { if (!attacker.getAbilities().contains(InfectAbility.getInstance())) { damage += attacker.getPower().getValue(); if (attacker.getAbilities().contains(DoubleStrikeAbility.getInstance())) { damage += attacker.getPower().getValue(); } } } return damage; }
private static int sumPoisonDamage(List<Permanent> attackersThatWontBeBlocked, Player defender) { int damage = 0; for (Permanent attacker : attackersThatWontBeBlocked) { if (attacker.getAbilities().contains(InfectAbility.getInstance())) { damage += attacker.getPower().getValue(); if (attacker.getAbilities().contains(DoubleStrikeAbility.getInstance())) { damage += attacker.getPower().getValue(); } } } return damage; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(getSourceId()); if(permanent != null && permanent.getAbilities().contains(FlyingAbility.getInstance())){ return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(getSourceId()); if (permanent != null && permanent.getAbilities().contains(FlyingAbility.getInstance())) { return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null) { if (creature.isControlledBy(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) { return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game){ Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null && filter.match(creature, game) && game.getOpponents(this.getControllerId()).contains(creature.getControllerId()) && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) { return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null) { if (!target.getAbilities().contains(FlyingAbility.getInstance())) { target.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game); return true; } } return false; }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { Permanent sourceCreature = game.getPermanent(source.getSourceId()); if (sourceCreature != null && sourceCreature.isAttacking()) { return permanent.getAbilities().contains(FlyingAbility.getInstance()) && permanent.canBlock(source.getSourceId(), game); } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent attacker = game.getPermanent(event.getSourceId()); if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) { return false; } if (event.getTargetId().equals(this.getControllerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(attacker.getId())); } return true; } return false; }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); return chosenColor != null && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && permanent.getColor(game).shares(chosenColor) && permanent.isCreature(); }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent attacker = game.getPermanent(event.getSourceId()); if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } return true; } return false; }