mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +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
|
||||
public List<Mana> getNetMana(Game game) {
|
||||
netMana.clear();
|
||||
ArrayList<Mana> netManaCopy = new ArrayList<>();
|
||||
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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
|
@ -42,6 +42,7 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
if (netMana.isEmpty() && game != null) {
|
||||
Player controller = game.getPlayer(getControllerId());
|
||||
if (controller != null) {
|
||||
|
@ -68,7 +69,8 @@ public class CommanderColorIdentityManaAbility extends ActivatedManaAbilityImpl
|
|||
}
|
||||
}
|
||||
}
|
||||
return netMana;
|
||||
netManas.addAll(netMana);
|
||||
return netManas;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,8 +33,6 @@ public class ConditionalManaAbility extends ActivatedManaAbilityImpl {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game) {
|
||||
List<Mana> newNetMana = new ArrayList<>();
|
||||
newNetMana.addAll(conditionalManaEffect.getNetMana(game, this));
|
||||
return newNetMana;
|
||||
return new ArrayList<>(conditionalManaEffect.getNetMana(game, this));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ManaOptions extends ArrayList<Mana> {
|
|||
boolean hasTapCost = hasTapCost(abilities.get(0));
|
||||
for (Mana netMana : netManas) {
|
||||
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();
|
||||
newMana.add(mana);
|
||||
newMana.add(netMana);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
package mage.abilities.mana;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
@ -55,7 +55,7 @@ public class SimpleManaAbility extends ActivatedManaAbilityImpl {
|
|||
if (predictable) {
|
||||
return super.getNetMana(game);
|
||||
}
|
||||
return netMana;
|
||||
return new ArrayList<Mana>(netMana);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.mana;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -54,7 +53,7 @@ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl implemen
|
|||
}
|
||||
return newNetMana;
|
||||
}
|
||||
return netMana;
|
||||
return new ArrayList<Mana>(netMana);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue