[SNC] Fix for Roccoo Cabaretti Caterer (#8931)

This commit is contained in:
Alex Vasile 2022-05-12 07:54:19 -06:00 committed by GitHub
commit 6f5ec6e9bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,11 +44,14 @@ public final class RoccoCabarettiCaterer extends CardImpl {
// When Rocco, Cabaretti Caterer enters the battlefield, if you cast it, you may search your library for a creature card with mana value X or less, put it onto the battlefield, then shuffle.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), true
), CastFromEverywhereSourceCondition.instance, "When {this} enters the battlefield, " +
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)),
true
),
CastFromEverywhereSourceCondition.instance,
"When {this} enters the battlefield, " +
"if you cast it, you may search your library for a creature card with mana value X or less, " +
"put it onto the battlefield, then shuffle."
));
"put it onto the battlefield, then shuffle.")
);
}
private RoccoCabarettiCaterer(final RoccoCabarettiCaterer card) {
@ -66,6 +69,9 @@ enum RoccoCabarettiCatererPredicate implements ObjectSourcePlayerPredicate<Card>
@Override
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
if (input.getSource() == null) {
return false;
}
return input.getObject().getManaValue()
<= ManacostVariableValue.ETB.calculate(game, input.getSource(), null);
}