[GRN] Added Guildmages' Forum.

This commit is contained in:
LevelX2 2018-09-22 19:25:10 +02:00
parent 883751f30c
commit 87fd7a2ab0
4 changed files with 160 additions and 4 deletions

View file

@ -16,12 +16,17 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
protected final int amount;
protected final ArrayList<Mana> netMana = new ArrayList<>();
protected final boolean setFlag;
public AddManaOfAnyColorEffect() {
this(1);
}
public AddManaOfAnyColorEffect(int amount) {
this(amount, false);
}
public AddManaOfAnyColorEffect(int amount, boolean setFlag) {
super(new Mana(0, 0, 0, 0, 0, 0, amount, 0));
this.amount = amount;
netMana.add(Mana.GreenMana(amount));
@ -30,12 +35,14 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
netMana.add(Mana.WhiteMana(amount));
netMana.add(Mana.RedMana(amount));
this.staticText = "add " + CardUtil.numberToText(amount) + " mana of any " + (amount > 1 ? "one " : "") + "color";
this.setFlag = setFlag;
}
public AddManaOfAnyColorEffect(final AddManaOfAnyColorEffect effect) {
super(effect);
this.amount = effect.amount;
this.netMana.addAll(effect.netMana);
this.setFlag = effect.setFlag;
}
@Override
@ -66,7 +73,9 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
if (controller.choose(outcome, choice, game)) {
if (choice.getColor() != null) {
return choice.getMana(amount);
Mana mana = choice.getMana(amount);
mana.setFlag(setFlag);
return mana;
}
}
}

View file

@ -1,4 +1,3 @@
package mage.abilities.mana;
import mage.Mana;
@ -8,13 +7,18 @@ import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
import mage.constants.Zone;
public class AnyColorManaAbility extends ActivatedManaAbilityImpl {
public AnyColorManaAbility() {
this(new TapSourceCost());
}
public AnyColorManaAbility(Cost cost) {
super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), cost);
this.netMana.add(new Mana(0,0,0,0,0,0,1, 0));
this(cost, false);
}
public AnyColorManaAbility(Cost cost, boolean setFlag) {
super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(1, setFlag), cost);
this.netMana.add(new Mana(0, 0, 0, 0, 0, 0, 1, 0));
}
public AnyColorManaAbility(final AnyColorManaAbility ability) {