If Emerge reduces mana cost to zero, pass noMana flag to allow spell to be cast with empty manaCostsToPay. (#12896)

Fixes #12841
This commit is contained in:
Grath 2024-09-21 00:40:15 -04:00 committed by GitHub
parent 360cde3c82
commit 291a28d1db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,7 +112,8 @@ public class EmergeAbility extends SpellAbility {
Permanent creature = game.getPermanent(target.getFirstTarget());
if (creature != null) {
CardUtil.reduceCost(this, creature.getManaValue());
if (super.activate(game, allowedIdentifiers, false)) {
boolean reducedToZero = this.getManaCostsToPay().isEmpty();
if (super.activate(game, allowedIdentifiers, reducedToZero)) {
MageObjectReference mor = new MageObjectReference(creature, game);
if (creature.sacrifice(this, game)) {
this.setCostsTag(EMERGE_ACTIVATION_CREATURE_REFERENCE, mor); //Can access with LKI afterwards