mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Some changes to net mana handling.
This commit is contained in:
parent
43efa36c6f
commit
c4541e49ee
4 changed files with 30 additions and 87 deletions
|
|
@ -36,12 +36,9 @@ import mage.abilities.effects.common.ManaEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ManaEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +51,11 @@ public class CommanderColorIdentityManaAbility extends ManaAbility {
|
|||
public CommanderColorIdentityManaAbility() {
|
||||
super(Zone.BATTLEFIELD, new CommanderIdentityManaEffect(),new TapSourceCost());
|
||||
}
|
||||
|
||||
|
||||
public CommanderColorIdentityManaAbility(Cost cost) {
|
||||
super(Zone.BATTLEFIELD, new CommanderIdentityManaEffect(), cost);
|
||||
}
|
||||
|
||||
public CommanderColorIdentityManaAbility(final CommanderColorIdentityManaAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public abstract class ManaAbility extends ActivatedAbilityImpl {
|
|||
}
|
||||
}
|
||||
|
||||
public ManaAbility(ManaAbility ability) {
|
||||
public ManaAbility(final ManaAbility ability) {
|
||||
super(ability);
|
||||
this.netMana.addAll(ability.netMana);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,14 @@
|
|||
|
||||
package mage.abilities.mana;
|
||||
|
||||
import java.util.List;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -58,4 +61,19 @@ public class SimpleManaAbility extends ManaAbility {
|
|||
return new SimpleManaAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game) {
|
||||
if (netMana.isEmpty()) {
|
||||
for (Effect effect: getEffects()) {
|
||||
if (effect instanceof ManaEffect) {
|
||||
Mana effectMana =((ManaEffect)effect).getMana(game, this);
|
||||
if (effectMana != null) {
|
||||
netMana.add(effectMana);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return netMana;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue