mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
[AFR] fixed missing predicate in Volo, Guide to Monsters and also slightly reworked card
This commit is contained in:
parent
86afdc52b9
commit
1584bc958a
1 changed files with 13 additions and 10 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
package mage.cards.v;
|
package mage.cards.v;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||||
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -12,9 +11,9 @@ import mage.constants.SuperType;
|
||||||
import mage.filter.FilterSpell;
|
import mage.filter.FilterSpell;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterCreatureSpell;
|
import mage.filter.common.FilterCreatureSpell;
|
||||||
import mage.filter.predicate.ObjectSourcePlayer;
|
import mage.filter.predicate.Predicate;
|
||||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.stack.StackObject;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
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"
|
"with a creature you control or a creature card in your graveyard"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(VoloGuideToMonstersPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public VoloGuideToMonsters(UUID ownerId, CardSetInfo setInfo) {
|
public VoloGuideToMonsters(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
|
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;
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
public boolean apply(StackObject input, Game game) {
|
||||||
Player player = game.getPlayer(input.getPlayerId());
|
Player player = game.getPlayer(input.getControllerId());
|
||||||
if (player != null
|
if (player != null
|
||||||
&& player
|
&& player
|
||||||
.getGraveyard()
|
.getGraveyard()
|
||||||
.getCards(StaticFilters.FILTER_CARD_CREATURE, game)
|
.getCards(StaticFilters.FILTER_CARD_CREATURE, game)
|
||||||
.stream()
|
.stream()
|
||||||
.anyMatch(card -> CardUtil.haveSameNames(card, input.getObject()))) {
|
.anyMatch(card -> CardUtil.haveSameNames(card, input))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return game
|
return game
|
||||||
.getBattlefield()
|
.getBattlefield()
|
||||||
.getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getPlayerId(), game)
|
.getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getControllerId(), game)
|
||||||
.stream()
|
.stream()
|
||||||
.noneMatch(permanent -> CardUtil.haveSameNames(permanent, input.getObject()));
|
.noneMatch(permanent -> CardUtil.haveSameNames(permanent, input));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue