[AFR] fixed missing predicate in Volo, Guide to Monsters and also slightly reworked card
package mage.cards.v;
import mage.MageInt;
-import mage.MageObject;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.cards.CardImpl;
@@ -12,9 +11,9 @@ import mage.constants.SuperType;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureSpell;
-import mage.filter.predicate.ObjectSourcePlayer;
-import mage.filter.predicate.ObjectSourcePlayerPredicate;
+import mage.filter.predicate.Predicate;
import mage.game.Game;
+import mage.game.stack.StackObject;
import mage.players.Player;
import mage.util.CardUtil;
@@ -30,6 +29,10 @@ public final class VoloGuideToMonsters extends CardImpl {
"with a creature you control or a creature card in your graveyard"
);
+ static {
+ filter.add(VoloGuideToMonstersPredicate.instance);
+ }
+
public VoloGuideToMonsters(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
@@ -57,24 +60,24 @@ public final class VoloGuideToMonsters extends CardImpl {
}
}
-enum VoloGuideToMonstersPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<MageObject>> {
+enum VoloGuideToMonstersPredicate implements Predicate<StackObject> {
instance;
@Override
- public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
- Player player = game.getPlayer(input.getPlayerId());
+ public boolean apply(StackObject input, Game game) {
+ Player player = game.getPlayer(input.getControllerId());
if (player != null
&& player
.getGraveyard()
.getCards(StaticFilters.FILTER_CARD_CREATURE, game)
.stream()
- .anyMatch(card -> CardUtil.haveSameNames(card, input.getObject()))) {
+ .anyMatch(card -> CardUtil.haveSameNames(card, input))) {
return false;
}
return game
.getBattlefield()
- .getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getPlayerId(), game)
+ .getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getControllerId(), game)
.stream()
- .noneMatch(permanent -> CardUtil.haveSameNames(permanent, input.getObject()));
+ .noneMatch(permanent -> CardUtil.haveSameNames(permanent, input));
}
}
