@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return attacker.hasAbility(FlyingAbility.getInstance().getId(), game); }
@Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return attacker.hasAbility(FlyingAbility.getInstance().getId(), game); }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { return permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId()); }
log.error(prefix+"Flying ability id: " + FlyingAbility.getInstance().getId()); log.error(prefix+"Reach ability id: " + ReachAbility.getInstance().getId()); log.error(prefix+"Intimidate ability id: " + IntimidateAbility.getInstance().getId());
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { switch (layer) { case AbilityAddingRemovingEffects_6: if (sublayer == SubLayer.NA) { permanent.getAbilities().removeIf(entry -> entry.getId().equals(FlyingAbility.getInstance().getId())); } break; } return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { return event.getSourceId().equals(this.getSourceId()) && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { return event.getSourceId().equals(this.getSourceId()) && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); }
@Override public boolean checkTrigger(GameEvent event, Game game) { return event.getSourceId().equals(this.getSourceId()) && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.hasAbility(FlyingAbility.getInstance().getId(), game) || permanent.hasAbility(ReachAbility.getInstance().getId(), game)) { return false; } return game.getOpponents(source.getControllerId()).contains(permanent.getControllerId()); }
@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { if (blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || blocker.getAbilities().containsKey(ReachAbility.getInstance().getId())) { return true; } return false; }
@Override public boolean apply(Game game, Ability source) { for (UUID attackingCreatureId : game.getCombat().getAttackers()) { Permanent attackingCreature = game.getPermanent(attackingCreatureId); if (attackingCreature != null) { if (attackingCreature.getColor(game).isBlack() && attackingCreature.hasAbility(FlyingAbility.getInstance().getId(), game)) { return true; } } } return false; }
@Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { return blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) || blocker.getAbilities().containsKey(ReachAbility.getInstance().getId()) || (null != game.getContinuousEffects().asThough(blocker.getId(), AsThoughEffectType.BLOCK_DRAGON, source, blocker.getControllerId(), game) && attacker.hasSubtype(SubType.DRAGON, game)); }