mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Some more fixes for ManaOptions #5023
This commit is contained in:
parent
2ec3ebde4c
commit
99cfd86533
6 changed files with 12 additions and 13 deletions
|
@ -66,11 +66,11 @@ class NykthosShrineToNyxManaAbility extends ActivatedManaAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Mana> getNetMana(Game game) {
|
public List<Mana> getNetMana(Game game) {
|
||||||
netMana.clear();
|
ArrayList<Mana> netManaCopy = new ArrayList<>();
|
||||||
if (game != null) {
|
if (game != null) {
|
||||||
netMana.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this));
|
netManaCopy.addAll(((ManaEffect) this.getEffects().get(0)).getNetMana(game, this));
|
||||||
}
|
}
|
||||||
return netMana;
|
return netManaCopy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
package mage.abilities.mana;
|
package mage.abilities.mana;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
|
@ -42,6 +42,7 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Mana> getNetMana(Game game) {
|
public List<Mana> getNetMana(Game game) {
|
||||||
|
List<Mana> netManas = new ArrayList<>();
|
||||||
if (netMana.isEmpty() && game != null) {
|
if (netMana.isEmpty() && game != null) {
|
||||||
Player controller = game.getPlayer(getControllerId());
|
Player controller = game.getPlayer(getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
|
@ -68,7 +69,8 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return netMana;
|
netManas.addAll(netMana);
|
||||||
|
return netManas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,8 +33,6 @@ public class ConditionalManaAbility extends ActivatedManaAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Mana> getNetMana(Game game) {
|
public List<Mana> getNetMana(Game game) {
|
||||||
List<Mana> newNetMana = new ArrayList<>();
|
return new ArrayList<>(conditionalManaEffect.getNetMana(game, this));
|
||||||
newNetMana.addAll(conditionalManaEffect.getNetMana(game, this));
|
|
||||||
return newNetMana;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ManaOptions extends ArrayList<Mana> {
|
||||||
boolean hasTapCost = hasTapCost(abilities.get(0));
|
boolean hasTapCost = hasTapCost(abilities.get(0));
|
||||||
for (Mana netMana : netManas) {
|
for (Mana netMana : netManas) {
|
||||||
for (Mana mana : copy) {
|
for (Mana mana : copy) {
|
||||||
if (!hasTapCost || checkTappedForManaReplacement(abilities.get(0), game, netMana)) {
|
if (!hasTapCost /* || checkTappedForManaReplacement(abilities.get(0), game, netMana) */) { // Seems to produce endless iterations so deactivated for now: https://github.com/magefree/mage/issues/5023
|
||||||
Mana newMana = new Mana();
|
Mana newMana = new Mana();
|
||||||
newMana.add(mana);
|
newMana.add(mana);
|
||||||
newMana.add(netMana);
|
newMana.add(netMana);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
package mage.abilities.mana;
|
package mage.abilities.mana;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
|
@ -55,7 +55,7 @@ public class SimpleManaAbility extends ActivatedManaAbilityImpl {
|
||||||
if (predictable) {
|
if (predictable) {
|
||||||
return super.getNetMana(game);
|
return super.getNetMana(game);
|
||||||
}
|
}
|
||||||
return netMana;
|
return new ArrayList<Mana>(netMana);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.abilities.mana;
|
package mage.abilities.mana;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -54,7 +53,7 @@ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl implemen
|
||||||
}
|
}
|
||||||
return newNetMana;
|
return newNetMana;
|
||||||
}
|
}
|
||||||
return netMana;
|
return new ArrayList<Mana>(netMana);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue