mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Fix of condtitional mana effect (not completed yet).
This commit is contained in:
parent
ef450371fb
commit
2e72503b8c
2 changed files with 71 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.decorator;
|
||||
|
||||
import mage.Mana;
|
||||
|
|
@ -47,7 +46,11 @@ public class ConditionalManaEffect extends ManaEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
Mana mana = getMana(game, source);
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
if (produceMana(true, game, source).getAny() > 0) {
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -56,6 +59,11 @@ public class ConditionalManaEffect extends ManaEffect {
|
|||
return new ConditionalManaEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return produceMana(false, game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Mana mana = new Mana();
|
||||
|
|
@ -75,7 +83,6 @@ public class ConditionalManaEffect extends ManaEffect {
|
|||
mana.setAny(0);
|
||||
mana.add(choice.getMana(amount));
|
||||
}
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
}
|
||||
return mana;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue