mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
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:
parent
f08c046c6b
commit
153b87e664
4 changed files with 9 additions and 3 deletions
|
|
@ -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.
|
* 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.
|
* Text displayed as a description for conditional mana.
|
||||||
|
|
@ -74,6 +74,7 @@ public class ConditionalMana extends Mana implements Serializable {
|
||||||
conditions = conditionalMana.conditions;
|
conditions = conditionalMana.conditions;
|
||||||
scope = conditionalMana.scope;
|
scope = conditionalMana.scope;
|
||||||
staticText = conditionalMana.staticText;
|
staticText = conditionalMana.staticText;
|
||||||
|
manaProducerId = conditionalMana.manaProducerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addCondition(Condition condition) {
|
public void addCondition(Condition condition) {
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
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) {
|
if (mana.getBlack() > 0 && commanderMana.getBlack() == 0) {
|
||||||
for (int i = 0; i < mana.getBlack(); i++) {
|
for (int i = 0; i < mana.getBlack(); i++) {
|
||||||
mana.addColorless();
|
mana.addColorless();
|
||||||
|
|
@ -112,6 +112,7 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
|
||||||
}
|
}
|
||||||
mana.setWhite(0);
|
mana.setWhite(0);
|
||||||
}
|
}
|
||||||
|
((ManaEvent) event).setMana(mana);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,6 @@ public abstract class ManaAbility extends ActivatedAbilityImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mana getNetMana(Game game) {
|
public Mana getNetMana(Game game) {
|
||||||
return netMana.copy();
|
return netMana;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,8 @@ public class ManaEvent extends GameEvent {
|
||||||
return mana;
|
return mana;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMana(Mana mana) {
|
||||||
|
this.mana = mana;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue