forked from External/mage
[filters] Replaced conditions in StackObject filters with Predicates
This commit is contained in:
parent
8598f9ead1
commit
b7f57c8a23
9 changed files with 63 additions and 167 deletions
|
|
@ -86,18 +86,15 @@ public class CantCounterControlledEffect extends ReplacementEffectImpl<CantCount
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == EventType.COUNTER) {
|
||||
filterTarget.getControllerId().clear();
|
||||
filterTarget.getControllerId().add(source.getControllerId());
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null) {
|
||||
if (filterTarget.match(spell, game)) {
|
||||
if (filterSource == null)
|
||||
if (spell != null && spell.getControllerId().equals(source.getControllerId())
|
||||
&& filterTarget.match(spell, game)) {
|
||||
if (filterSource == null)
|
||||
return true;
|
||||
else {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && filterSource.match(sourceObject, game)) {
|
||||
return true;
|
||||
else {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && filterSource.match(sourceObject, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue