Fix for colored mana producers only produce colorless mana (#432). The commander mana replacement effect returns now always only a new copy of mana.

This commit is contained in:
LevelX2 2014-08-29 09:45:38 +02:00
parent f08c046c6b
commit 153b87e664
4 changed files with 9 additions and 3 deletions

View file

@ -47,7 +47,7 @@ public class ConditionalMana extends Mana implements Serializable {
/**
* Conditions that should be met (all or any depending on comparison scope) to allow spending {@link Mana} mana.
*/
private List<Condition> conditions = new ArrayList<Condition>();
private List<Condition> conditions = new ArrayList<>();
/**
* Text displayed as a description for conditional mana.
@ -74,6 +74,7 @@ public class ConditionalMana extends Mana implements Serializable {
conditions = conditionalMana.conditions;
scope = conditionalMana.scope;
staticText = conditionalMana.staticText;
manaProducerId = conditionalMana.manaProducerId;
}
public void addCondition(Condition condition) {

View file

@ -81,7 +81,7 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Mana mana = ((ManaEvent) event).getMana();
Mana mana = ((ManaEvent) event).getMana().copy();
if (mana.getBlack() > 0 && commanderMana.getBlack() == 0) {
for (int i = 0; i < mana.getBlack(); i++) {
mana.addColorless();
@ -112,6 +112,7 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
}
mana.setWhite(0);
}
((ManaEvent) event).setMana(mana);
return false;
}

View file

@ -71,6 +71,6 @@ public abstract class ManaAbility extends ActivatedAbilityImpl {
}
public Mana getNetMana(Game game) {
return netMana.copy();
return netMana;
}
}

View file

@ -48,4 +48,8 @@ public class ManaEvent extends GameEvent {
return mana;
}
public void setMana(Mana mana) {
this.mana = mana;
}
}