[NEO] Implemented Goro-Goro, Disciple of Ryusei

This commit is contained in:
Evan Kranzler 2022-01-27 22:17:04 -05:00
parent d2a10c3c45
commit b60b7525c0
7 changed files with 156 additions and 6 deletions

View file

@ -1,6 +1,6 @@
package mage.filter.predicate.permanent;
import mage.counters.Counter;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -13,8 +13,12 @@ public enum CounterAnyPredicate implements Predicate<Permanent> {
@Override
public boolean apply(Permanent input, Game game) {
return input.getCounters(game).values().stream().anyMatch(counter -> counter.getCount() > 0);
return input
.getCounters(game)
.values()
.stream()
.mapToInt(Counter::getCount)
.anyMatch(x -> x > 0);
}
@Override

View file

@ -1,6 +1,6 @@
package mage.filter.predicate.permanent;
import mage.constants.SubType;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -19,7 +19,7 @@ public enum EnchantedPredicate implements Predicate<Permanent> {
.stream()
.map(game::getPermanent)
.filter(Objects::nonNull)
.anyMatch(permanent -> permanent.isEnchantment(game));
.anyMatch(permanent -> permanent.hasSubtype(SubType.AURA, game));
}
@Override

View file

@ -0,0 +1,39 @@
package mage.filter.predicate.permanent;
import mage.constants.SubType;
import mage.counters.Counter;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.Objects;
/**
* @author TheElk801
*/
public enum ModifiedPredicate implements Predicate<Permanent> {
instance;
@Override
public boolean apply(Permanent input, Game game) {
return input
.getCounters(game)
.values()
.stream()
.mapToInt(Counter::getCount)
.anyMatch(x -> x > 0)
|| input
.getAttachments()
.stream()
.map(game::getPermanent)
.filter(Objects::nonNull)
.anyMatch(permanent -> permanent.hasSubtype(SubType.EQUIPMENT, game)
|| (permanent.hasSubtype(SubType.AURA, game)
&& permanent.isControlledBy(input.getControllerId())));
}
@Override
public String toString() {
return "modified";
}
}

View file

@ -0,0 +1,31 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class DragonSpiritToken extends TokenImpl {
public DragonSpiritToken() {
super("Dragon Spirit token", "5/5 red Dragon Spirit creature token with flying");
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add(SubType.DRAGON);
subtype.add(SubType.SPIRIT);
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
public DragonSpiritToken(final DragonSpiritToken token) {
super(token);
}
public DragonSpiritToken copy() {
return new DragonSpiritToken(this);
}
}