mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
commiting to work on home, so far when enchantment goes into battlefiled other creatures are not allowed to attack regardless of color choice
This commit is contained in:
parent
15800987c3
commit
bfc4d2592a
1 changed files with 10 additions and 2 deletions
|
@ -77,17 +77,25 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
|
|||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "Creatures of the chosen color without flying can't attack you";
|
||||
}
|
||||
|
||||
TeferisMoatRestrictionEffect(final TeferisMoatRestrictionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||
if (chosenColor == null)
|
||||
return false;
|
||||
return permanent.getCardType().contains(CardType.CREATURE) && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && !permanent.getColor(game).shares(chosenColor);
|
||||
}
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
return !defenderId.equals(source.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TeferisMoatRestrictionEffect copy() {
|
||||
return new TeferisMoatRestrictionEffect(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue