mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
implemented Crown of Fury
This commit is contained in:
parent
041fb31205
commit
54552a94ad
3 changed files with 150 additions and 0 deletions
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
package mage.filter.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SubTypeSet;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.PermanentIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tschroeder
|
||||
*/
|
||||
|
||||
public class FilterOtherCreatureSharingCreatureSubtype extends FilterCreaturePermanent {
|
||||
|
||||
public FilterOtherCreatureSharingCreatureSubtype(Permanent creature, Game game) {
|
||||
super("creature sharing a creature type with " + creature.toString());
|
||||
|
||||
List<SubtypePredicate> subtypePredicates = new ArrayList<>();
|
||||
for (SubType subtype : creature.getSubtype(game)) {
|
||||
if (subtype.getSubTypeSet() == SubTypeSet.CreatureType) {
|
||||
subtypePredicates.add(new SubtypePredicate(subtype));
|
||||
}
|
||||
}
|
||||
this.add(Predicates.and(
|
||||
Predicates.or(subtypePredicates),
|
||||
Predicates.not(new PermanentIdPredicate(creature.getId()))
|
||||
));
|
||||
}
|
||||
|
||||
public FilterOtherCreatureSharingCreatureSubtype(final FilterOtherCreatureSharingCreatureSubtype filter) {
|
||||
super(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterOtherCreatureSharingCreatureSubtype copy() {
|
||||
return new FilterOtherCreatureSharingCreatureSubtype(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue