use of mage.abilities.effects.RestrictionEffect in project mage by magefree.
the class TraceUtil method traceCombat.
private static void traceCombat(Game game, Permanent attacker, Permanent blocker) {
String prefix = "> ";
log.error(prefix + "Tracing game state...");
if (blocker != null) {
log.error(prefix + blocker.getLogName() + " could block " + attacker.getLogName());
}
log.error(prefix);
log.error(prefix + "Attacker abilities: ");
for (Ability ability : attacker.getAbilities()) {
log.error(prefix + " " + ability.toString() + ", id=" + ability.getId());
}
if (blocker != null) {
log.error(prefix + "Blocker abilities: ");
for (Ability ability : blocker.getAbilities()) {
log.error(prefix + " " + ability.toString() + ", id=" + ability.getId());
}
}
log.error(prefix);
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());
log.error(prefix);
log.error(prefix + "Restriction effects:");
log.error(prefix + " Applied to ATTACKER:");
Map<RestrictionEffect, Set<Ability>> attackerResEffects = game.getContinuousEffects().getApplicableRestrictionEffects(attacker, game);
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : attackerResEffects.entrySet()) {
log.error(prefix + " " + entry.getKey());
log.error(prefix + " id=" + entry.getKey().getId());
for (Ability ability : entry.getValue()) {
log.error(prefix + " ability=" + ability);
}
}
log.error(prefix + " Applied to BLOCKER:");
if (blocker != null) {
Map<RestrictionEffect, Set<Ability>> blockerResEffects = game.getContinuousEffects().getApplicableRestrictionEffects(blocker, game);
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : blockerResEffects.entrySet()) {
log.error(prefix + " " + entry.getKey());
log.error(prefix + " id=" + entry.getKey().getId());
for (Ability ability : entry.getValue()) {
log.error(prefix + " ability=" + ability);
}
}
}
ContinuousEffectsList<RestrictionEffect> restrictionEffects = (ContinuousEffectsList<RestrictionEffect>) game.getContinuousEffects().getRestrictionEffects();
log.error(prefix);
log.error(prefix + " List of all restriction effects:");
for (RestrictionEffect effect : restrictionEffects) {
log.error(prefix + " " + effect);
log.error(prefix + " id=" + effect.getId());
}
log.error(prefix);
log.error(prefix + " Trace Attacker:");
traceForPermanent(game, attacker, prefix, restrictionEffects);
if (blocker != null) {
log.error(prefix);
log.error(prefix + " Trace Blocker:");
traceForPermanent(game, blocker, prefix, restrictionEffects);
}
log.error(prefix);
}
Aggregations