mirror of
https://github.com/correl/mage.git
synced 2025-01-14 03:00:10 +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,9 +77,11 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||||
staticText = "Creatures of the chosen color without flying can't attack you";
|
staticText = "Creatures of the chosen color without flying can't attack you";
|
||||||
}
|
}
|
||||||
|
|
||||||
TeferisMoatRestrictionEffect(final TeferisMoatRestrictionEffect effect) {
|
TeferisMoatRestrictionEffect(final TeferisMoatRestrictionEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||||
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||||
|
@ -87,6 +89,12 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
|
||||||
return false;
|
return false;
|
||||||
return permanent.getCardType().contains(CardType.CREATURE) && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && !permanent.getColor(game).shares(chosenColor);
|
return permanent.getCardType().contains(CardType.CREATURE) && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && !permanent.getColor(game).shares(chosenColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||||
|
return !defenderId.equals(source.getControllerId());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TeferisMoatRestrictionEffect copy() {
|
public TeferisMoatRestrictionEffect copy() {
|
||||||
return new TeferisMoatRestrictionEffect(this);
|
return new TeferisMoatRestrictionEffect(this);
|
||||||
|
|
Loading…
Reference in a new issue