mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Attempting to track exiled card via MageObjectReference
This commit is contained in:
parent
6579354d2b
commit
a2d5bb2bc8
1 changed files with 5 additions and 4 deletions
|
@ -30,6 +30,7 @@ package mage.cards.i;
|
|||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.Mana;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
|
@ -137,7 +138,7 @@ class IceCauldronExileEffect extends OneShotEffect {
|
|||
AsThoughEffect effect = new IceCauldronCastFromExileEffect();
|
||||
effect.setTargetPointer(new FixedTarget(chosenCard.getId()));
|
||||
game.addEffect(effect, source);
|
||||
game.getState().setValue("IceCauldronCard" + source.getSourceId().toString(), chosenCard.getId()); //store the exiled card
|
||||
game.getState().setValue("IceCauldronCard" + source.getSourceId().toString(), new MageObjectReference(chosenCard.getId(), game)); //store the exiled card
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +217,7 @@ class IceCauldronNoteManaEffect extends OneShotEffect {
|
|||
class IceCauldronAddManaEffect extends ManaEffect {
|
||||
|
||||
private static Mana storedMana;
|
||||
private static UUID exiledCardId;
|
||||
private static MageObjectReference exiledCardMor;
|
||||
|
||||
IceCauldronAddManaEffect() {
|
||||
super();
|
||||
|
@ -238,10 +239,10 @@ class IceCauldronAddManaEffect extends ManaEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (iceCauldron != null && controller != null) {
|
||||
storedMana = (Mana) game.getState().getValue("IceCauldronMana" + source.getSourceId().toString());
|
||||
exiledCardId = (UUID) game.getState().getValue("IceCauldronCard" + source.getSourceId().toString());
|
||||
exiledCardMor = (MageObjectReference) game.getState().getValue("IceCauldronCard" + source.getSourceId().toString());
|
||||
if (storedMana != null) { // should be adding the mana even if exiled card is null
|
||||
checkToFirePossibleEvents(storedMana, game, source);
|
||||
IceCauldronConditionalMana iceCauldronMana = new IceCauldronConditionalMana(storedMana, game.getCard(exiledCardId));
|
||||
IceCauldronConditionalMana iceCauldronMana = new IceCauldronConditionalMana(storedMana, exiledCardMor.getCard(game));
|
||||
if (iceCauldronMana != null) {
|
||||
controller.getManaPool().addMana(iceCauldronMana, game, source);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue