mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
fixed Damping Sphere not reducing sources of conditional mana (such as Eldrazi Temple and Mishra's Workshop)
This commit is contained in:
parent
211f36c3cd
commit
342b4486e8
2 changed files with 5 additions and 35 deletions
|
@ -6,57 +6,24 @@
|
||||||
package mage.abilities.effects.mana;
|
package mage.abilities.effects.mana;
|
||||||
|
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.effects.common.ManaEffect;
|
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class AddConditionalColorlessManaEffect extends ManaEffect {
|
public class AddConditionalColorlessManaEffect extends AddConditionalManaEffect {
|
||||||
|
|
||||||
private final int amount;
|
|
||||||
private final ConditionalManaBuilder manaBuilder;
|
|
||||||
|
|
||||||
public AddConditionalColorlessManaEffect(int amount, ConditionalManaBuilder manaBuilder) {
|
public AddConditionalColorlessManaEffect(int amount, ConditionalManaBuilder manaBuilder) {
|
||||||
super();
|
super(Mana.ColorlessMana(amount), manaBuilder);
|
||||||
this.amount = amount;
|
|
||||||
this.manaBuilder = manaBuilder;
|
|
||||||
|
|
||||||
staticText = "Add " + String.format(String.format("%%%ds", amount), " ").replace(" ", "{C}")
|
|
||||||
+ ". " + manaBuilder.getRule();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddConditionalColorlessManaEffect(final AddConditionalColorlessManaEffect effect) {
|
public AddConditionalColorlessManaEffect(final AddConditionalColorlessManaEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.amount = effect.amount;
|
|
||||||
this.manaBuilder = effect.manaBuilder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AddConditionalColorlessManaEffect copy() {
|
public AddConditionalColorlessManaEffect copy() {
|
||||||
return new AddConditionalColorlessManaEffect(this);
|
return new AddConditionalColorlessManaEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
if (controller != null) {
|
|
||||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
|
||||||
return manaBuilder.setMana(Mana.ColorlessMana(amount), source, game).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Mana getMana() {
|
|
||||||
return Mana.ColorlessMana(amount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,7 @@ public class AddConditionalManaEffect extends ManaEffect {
|
||||||
return manaBuilder.setMana(mana, source, game).build();
|
return manaBuilder.setMana(mana, source, game).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mana getMana() {
|
||||||
|
return mana;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue