[ECL] Implement Figure of Fable

This commit is contained in:
theelk801 2025-09-30 08:51:01 -04:00
parent 265fbcfe82
commit 29ab28fd74
4 changed files with 173 additions and 38 deletions

View file

@ -0,0 +1,42 @@
package mage.abilities.keyword;
import mage.MageItem;
import mage.MageObject;
import mage.filter.StaticFilters;
import mage.game.Game;
import java.util.Optional;
/**
* @author TheElk801
*/
public class ProtectionFromEachOpponentAbility extends ProtectionAbility {
public ProtectionFromEachOpponentAbility() {
super(StaticFilters.FILTER_CARD);
}
private ProtectionFromEachOpponentAbility(final ProtectionFromEachOpponentAbility ability) {
super(ability);
}
@Override
public ProtectionFromEachOpponentAbility copy() {
return new ProtectionFromEachOpponentAbility(this);
}
@Override
public String getRule() {
return "protection from each of your opponents";
}
@Override
public boolean canTarget(MageObject source, Game game) {
return Optional
.ofNullable(source)
.map(MageItem::getId)
.map(game::getControllerId)
.map(uuid -> !game.getOpponents(this.getSourceId()).contains(uuid))
.orElse(true);
}
}