* Brain in a Jar - Fixed that first ability fizzled when it was sacrificed before the ability resolved (fixes
*/
package mage.cards.b;
+import java.util.UUID;
import mage.abilities.Ability;
-import mage.constants.ComparisonType;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
@@ -40,6 +40,7 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
+import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
@@ -51,8 +52,6 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
-import java.util.UUID;
-
/**
*
* @author LevelX2
@@ -104,7 +103,7 @@ class BrainInAJarCastEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
- Permanent sourceObject = game.getPermanent(source.getSourceId());
+ Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && sourceObject != null) {
int counters = sourceObject.getCounters(game).getCount(CounterType.CHARGE);
FilterCard filter = new FilterInstantOrSorceryCard();
