forked from External/mage
now use manaability child for adding mana of any color, some refactoring and switch to use new ability for that
This commit is contained in:
parent
b707d11aa4
commit
01b43b0d87
48 changed files with 181 additions and 186 deletions
41
Mage/src/mage/abilities/effects/common/BasicManaEffect.java
Normal file
41
Mage/src/mage/abilities/effects/common/BasicManaEffect.java
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
|
||||
public class BasicManaEffect extends ManaEffect<BasicManaEffect> {
|
||||
protected Mana mana;
|
||||
|
||||
public BasicManaEffect(Mana mana) {
|
||||
super();
|
||||
this.mana = mana;
|
||||
}
|
||||
|
||||
public BasicManaEffect(final BasicManaEffect effect) {
|
||||
super(effect);
|
||||
this.mana = effect.mana.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicManaEffect copy() {
|
||||
return new BasicManaEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
game.getPlayer(source.getControllerId()).getManaPool().changeMana(mana);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getText(Ability source) {
|
||||
return "Add " + mana.toString() + " to your mana pool";
|
||||
}
|
||||
|
||||
public Mana getMana() {
|
||||
return mana;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue