mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[ECL] Implement Figure of Fable
This commit is contained in:
parent
265fbcfe82
commit
29ab28fd74
4 changed files with 173 additions and 38 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue