fix Xanathar, Guild Kingpin (#12133)

fix #12133
This commit is contained in:
Susucre 2024-04-17 19:59:31 +02:00
parent 92b722d3ca
commit 11373fd75d
3 changed files with 39 additions and 8 deletions

View file

@ -68,15 +68,15 @@ public class PlayFromTopOfLibraryEffect extends AsThoughEffectImpl {
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
// can play lands/spells (must check specific part and allows specific part)
Card cardToCheck = game.getCard(objectId); // maybe this should be removed and only check SpellAbility characteristics
Card cardToCheck = game.getCard(objectId); // maybe this should be removed and only check SpellAbility characteristics -- No! don't forget PlayLandAbility
if (cardToCheck == null) {
return false;
}
if (affectedAbility instanceof SpellAbility) {
SpellAbility spell = (SpellAbility) affectedAbility;
cardToCheck = spell.getCharacteristics(game);
if (spell.getManaCosts().isEmpty()){
return false;
if (spell.getManaCosts().isEmpty()) {
return false; // prevent casting cards without mana cost?
}
}
// only permits you to cast