mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Some rework of handling of mana effects.
This commit is contained in:
parent
25b10c4d67
commit
21e5591e29
254 changed files with 1449 additions and 1399 deletions
|
|
@ -1763,7 +1763,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
//TODO: improve this
|
||||
if (min < max && min == 0) {
|
||||
return RandomUtil.nextInt(max);
|
||||
return RandomUtil.nextInt(max + 1);
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.a;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.ConditionalAnyColorManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.abilities.mana.conditional.ConditionalSpellManaBuilder;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -35,7 +34,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
|
|
@ -59,7 +58,7 @@ public class AstralCornucopia extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance())));
|
||||
|
||||
// {T}: Choose a color. Add one mana of that color for each charge counter on Astral Cornucopia.
|
||||
this.addAbility(new AstralCornucopiaManaAbility());
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AstralCornucopiaManaEffect(), new TapSourceCost()));
|
||||
}
|
||||
|
||||
public AstralCornucopia(final AstralCornucopia card) {
|
||||
|
|
@ -72,35 +71,6 @@ public class AstralCornucopia extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class AstralCornucopiaManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
public AstralCornucopiaManaAbility() {
|
||||
super(Zone.BATTLEFIELD, new AstralCornucopiaManaEffect(), new TapSourceCost());
|
||||
}
|
||||
|
||||
public AstralCornucopiaManaAbility(final AstralCornucopiaManaAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AstralCornucopiaManaAbility copy() {
|
||||
return new AstralCornucopiaManaAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game) {
|
||||
netMana.clear();
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
int counters = sourcePermanent.getCounters(game).getCount(CounterType.CHARGE.getName());
|
||||
if (counters > 0) {
|
||||
netMana.add(new Mana(0, 0, 0, 0, 0, 0, counters, 0));
|
||||
}
|
||||
}
|
||||
return netMana;
|
||||
}
|
||||
}
|
||||
|
||||
class AstralCornucopiaManaEffect extends ManaEffect {
|
||||
|
||||
private final Mana computedMana;
|
||||
|
|
@ -125,42 +95,55 @@ class AstralCornucopiaManaEffect extends ManaEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
choice.setMessage("Choose a color to add mana of that color");
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (choice.getChoice() != null) {
|
||||
String color = choice.getChoice();
|
||||
int counters = sourcePermanent.getCounters(game).getCount(CounterType.CHARGE.getName());
|
||||
switch (color) {
|
||||
case "Red":
|
||||
computedMana.setRed(counters);
|
||||
break;
|
||||
case "Blue":
|
||||
computedMana.setBlue(counters);
|
||||
break;
|
||||
case "White":
|
||||
computedMana.setWhite(counters);
|
||||
break;
|
||||
case "Black":
|
||||
computedMana.setBlack(counters);
|
||||
break;
|
||||
case "Green":
|
||||
computedMana.setGreen(counters);
|
||||
break;
|
||||
}
|
||||
}
|
||||
checkToFirePossibleEvents(computedMana, game, source);
|
||||
controller.getManaPool().addMana(computedMana, game, source);
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Mana mana = new Mana();
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
int counters = sourcePermanent.getCounters(game).getCount(CounterType.CHARGE.getName());
|
||||
if (counters > 0) {
|
||||
if (netMana) {
|
||||
return new Mana(0, 0, 0, 0, 0, 0, counters, 0);
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
choice.setMessage("Choose a color to add mana of that color");
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
if (choice.getChoice() != null) {
|
||||
String color = choice.getChoice();
|
||||
switch (color) {
|
||||
case "Red":
|
||||
mana.setRed(counters);
|
||||
break;
|
||||
case "Blue":
|
||||
mana.setBlue(counters);
|
||||
break;
|
||||
case "White":
|
||||
mana.setWhite(counters);
|
||||
break;
|
||||
case "Black":
|
||||
mana.setBlack(counters);
|
||||
break;
|
||||
case "Green":
|
||||
mana.setGreen(counters);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mana;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbili
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
/**
|
||||
|
|
@ -52,12 +51,6 @@ import mage.target.common.TargetAnyTarget;
|
|||
*/
|
||||
public class AuroraEidolon extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public AuroraEidolon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -70,7 +63,7 @@ public class AuroraEidolon extends CardImpl {
|
|||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
// Whenever you cast a multicolored spell, you may return Aurora Eidolon from your graveyard to your hand.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), StaticFilters.FILTER_SPELL_A_MULTICOLORED, true, false));
|
||||
}
|
||||
|
||||
public AuroraEidolon(final AuroraEidolon card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.b;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -100,11 +100,9 @@ class BloomTenderEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Mana mana = new Mana();
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
|
||||
if (mana.getBlack() == 0 && permanent.getColor(game).isBlack()) {
|
||||
mana.increaseBlack();
|
||||
}
|
||||
|
|
@ -123,8 +121,4 @@ class BloomTenderEffect extends ManaEffect {
|
|||
}
|
||||
return mana;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,9 +44,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SpellAbilityType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -61,12 +59,6 @@ import mage.target.common.TargetControlledPermanent;
|
|||
*/
|
||||
public class BoundDetermined extends SplitCard {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public BoundDetermined(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}{G}", "{G}{U}", SpellAbilityType.SPLIT);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.b;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.b;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.mana.DelayedTriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.condition.common.CardsInControllerGraveCondition;
|
||||
import mage.abilities.decorator.ConditionalManaEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class CagedSunEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||
if (color != null) {
|
||||
return new Mana(ColoredManaSymbol.lookup(color.toString().charAt(0)));
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.mana.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.condition.common.TargetHasCounterCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder("At the beginning of each of your main phases, if you haven't added mana with this ability this turn");
|
||||
StringBuilder sb = new StringBuilder("At the beginning of each of your main phases, if you haven't added mana with this ability this turn, ");
|
||||
return sb.append(super.getRule()).toString();
|
||||
}
|
||||
|
||||
|
|
@ -150,12 +150,23 @@ class CarpetOfFlowersEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller != null && controller.choose(Outcome.Benefit, choice, game)) {
|
||||
Mana mana = new Mana();
|
||||
int count = game.getBattlefield().count(filter, source.getSourceId(), source.getTargets().getFirstTarget(), game);
|
||||
if (count > 0) {
|
||||
Mana mana = new Mana();
|
||||
switch (choice.getChoice()) {
|
||||
case "Black":
|
||||
mana.setBlack(count);
|
||||
|
|
@ -175,16 +186,9 @@ class CarpetOfFlowersEffect extends ManaEffect {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
}
|
||||
return true;
|
||||
return mana;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.mana.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.MageInt;
|
|||
import mage.Mana;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.ChancellorAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import mage.abilities.LoyaltyAbility;
|
|||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.DamagePlayersEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.DelayedTriggeredAbility;
|
|||
import mage.abilities.SpecialAction;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.CreateSpecialActionEffect;
|
||||
import mage.abilities.effects.common.RemoveSpecialActionEffect;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.c;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import mage.abilities.common.TapForManaAllTriggeredManaAbility;
|
|||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
|
|
@ -42,8 +43,8 @@ import mage.abilities.costs.mana.ManaCosts;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.costs.mana.MonoHybridManaCost;
|
||||
import mage.abilities.costs.mana.VariableManaCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -84,8 +85,7 @@ class CharmedPendantAbility extends ActivatedManaAbilityImpl {
|
|||
public CharmedPendantAbility() {
|
||||
super(Zone.BATTLEFIELD, new CharmedPendantManaEffect(), new TapSourceCost());
|
||||
this.addCost(new PutTopCardOfYourLibraryToGraveyardCost());
|
||||
this.netMana.add(new Mana(0, 0, 0, 0, 0, 0, 0, 0));
|
||||
this.setUndoPossible(false); // Otherwise you could retunrn the card from graveyard
|
||||
this.setUndoPossible(false); // Otherwise you could return the card from graveyard
|
||||
}
|
||||
|
||||
public CharmedPendantAbility(Zone zone, Mana mana, Cost cost) {
|
||||
|
|
@ -135,6 +135,18 @@ class CharmedPendantManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Mana mana = new Mana();
|
||||
|
|
@ -178,29 +190,28 @@ class CharmedPendantManaEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
}
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
return true;
|
||||
return mana;
|
||||
}
|
||||
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.isTopCardRevealed()) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
Mana mana = card.getManaCost().getMana().copy();
|
||||
List<Mana> netMana = card.getManaCost().getManaOptions();
|
||||
for (Mana mana : netMana) {
|
||||
mana.setColorless(0);
|
||||
mana.setGeneric(0);
|
||||
return mana;
|
||||
}
|
||||
return netMana;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null; // You don't know if and which amount or color of mana you get
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,6 +150,18 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
player.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent != null && player != null) {
|
||||
|
|
@ -176,14 +188,14 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
if (color.isWhite()) {
|
||||
choice.getChoices().add("White");
|
||||
}
|
||||
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
Mana mana = new Mana();
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
|
||||
if (choice.getChoices().size() == 1) {
|
||||
choice.setChoice(choice.getChoices().iterator().next());
|
||||
} else {
|
||||
if (!player.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
switch (choice.getChoice()) {
|
||||
|
|
@ -208,17 +220,12 @@ class ChromeMoxManaEffect extends ManaEffect {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
player.getManaPool().addMana(mana, game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
}
|
||||
return mana;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.FormidableCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.mana.ActivateIfConditionManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.Mana;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CastFromHandSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -28,20 +28,15 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.ChooseColorEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.mana.AddManaChosenColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -58,7 +53,8 @@ public class ColdsteelHeart extends CardImpl {
|
|||
// As Coldsteel Heart enters the battlefield, choose a color.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral), null, "As {this} enters the battlefield, choose a color.", null));
|
||||
// {T}: Add one mana of the chosen color.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ColdsteelHeartManaEffect(), new TapSourceCost()));
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaChosenColorEffect(), new TapSourceCost()));
|
||||
|
||||
}
|
||||
|
||||
public ColdsteelHeart(final ColdsteelHeart card) {
|
||||
|
|
@ -70,39 +66,3 @@ public class ColdsteelHeart extends CardImpl {
|
|||
return new ColdsteelHeart(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ColdsteelHeartManaEffect extends ManaEffect {
|
||||
|
||||
public ColdsteelHeartManaEffect() {
|
||||
super();
|
||||
staticText = "Add one mana of the chosen color";
|
||||
}
|
||||
|
||||
public ColdsteelHeartManaEffect(final ColdsteelHeartManaEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.getManaPool().addMana(getMana(game, source), game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||
if (color != null) {
|
||||
return new Mana(ColoredManaSymbol.lookup(color.toString().charAt(0)));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColdsteelHeartManaEffect copy() {
|
||||
return new ColdsteelHeartManaEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.Mana;
|
|||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
|
|
|
|||
|
|
@ -117,6 +117,17 @@ class CorruptedGrafstoneManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
player.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Mana types = getManaTypesInGraveyard(game, source);
|
||||
Choice choice = new ChoiceColor(true);
|
||||
choice.getChoices().clear();
|
||||
|
|
@ -143,7 +154,7 @@ class CorruptedGrafstoneManaEffect extends ManaEffect {
|
|||
choice.setChoice(choice.getChoices().iterator().next());
|
||||
} else {
|
||||
if (!player.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Mana computedManaHere = new Mana();
|
||||
|
|
@ -164,18 +175,13 @@ class CorruptedGrafstoneManaEffect extends ManaEffect {
|
|||
computedManaHere.setWhite(1);
|
||||
break;
|
||||
}
|
||||
checkToFirePossibleEvents(computedManaHere, game, source);
|
||||
player.getManaPool().addMana(computedManaHere, game, source);
|
||||
return computedManaHere;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypesInGraveyard(game, source);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.c;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ package mage.cards.c;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.keyword.ExtortAbility;
|
||||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.c;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.Mana;
|
|||
import mage.abilities.condition.common.SpellMasteryCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -148,7 +148,25 @@ class DawnsReflectionManaEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
if (netMana) {
|
||||
return new Mana(0, 0, 0, 0, 0, 0, 2, 0);
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int x = 2;
|
||||
Mana mana = new Mana();
|
||||
for (int i = 0; i < x; i++) {
|
||||
ChoiceColor choiceColor = new ChoiceColor();
|
||||
if (!controller.choose(Outcome.Benefit, choiceColor, game)) {
|
||||
return null;
|
||||
}
|
||||
choiceColor.increaseMana(mana);
|
||||
}
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
return mana;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.keyword.SpliceOntoArcaneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,17 @@ class DoublingCubeEffect extends ManaEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return null;
|
||||
}
|
||||
ManaPool pool = controller.getManaPool();
|
||||
int blackMana = pool.getBlack();
|
||||
int whiteMana = pool.getWhite();
|
||||
|
|
@ -102,15 +113,7 @@ class DoublingCubeEffect extends ManaEffect {
|
|||
redMana += conditionalMana.getRed();
|
||||
colorlessMana += conditionalMana.getColorless();
|
||||
}
|
||||
Mana mana = new Mana(redMana, greenMana, blueMana, whiteMana, blackMana, 0, 0, colorlessMana);
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
pool.addMana(mana, game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
return new Mana(redMana, greenMana, blueMana, whiteMana, blackMana, 0, 0, colorlessMana);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.mana.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.e;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -51,12 +50,6 @@ import mage.target.TargetPlayer;
|
|||
*/
|
||||
public class EnigmaEidolon extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public EnigmaEidolon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -69,7 +62,8 @@ public class EnigmaEidolon extends CardImpl {
|
|||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
// Whenever you cast a multicolored spell, you may return Enigma Eidolon from your graveyard to your hand.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD,
|
||||
new ReturnSourceFromGraveyardToHandEffect(), StaticFilters.FILTER_SPELL_A_MULTICOLORED, true, false));
|
||||
}
|
||||
|
||||
public EnigmaEidolon(final EnigmaEidolon card) {
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -53,12 +52,6 @@ import mage.target.TargetPlayer;
|
|||
*/
|
||||
public class EntropicEidolon extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public EntropicEidolon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
|
@ -74,7 +67,8 @@ public class EntropicEidolon extends CardImpl {
|
|||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
// Whenever you cast a multicolored spell, you may return Entropic Eidolon from your graveyard to your hand.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD,
|
||||
new ReturnSourceFromGraveyardToHandEffect(), StaticFilters.FILTER_SPELL_A_MULTICOLORED, true, false));
|
||||
}
|
||||
|
||||
public EntropicEidolon(final EntropicEidolon card) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.f;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.AddManaAnyColorAttachedControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaAnyColorAttachedControllerEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
|
|
|
|||
|
|
@ -103,6 +103,21 @@ class FoodChainManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
if (netMana) {
|
||||
return null;
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int manaCostExiled = 0;
|
||||
|
|
@ -115,22 +130,12 @@ class FoodChainManaEffect extends ManaEffect {
|
|||
}
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (!controller.choose(Outcome.PutManaInPool, choice, game)) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
Mana chosen = choice.getMana(manaCostExiled + 1);
|
||||
Mana mana = new FoodChainManaBuilder().setMana(chosen, source, game).build();
|
||||
if (mana != null) {
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
return true;
|
||||
}
|
||||
return new FoodChainManaBuilder().setMana(chosen, source, game).build();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
|||
import mage.abilities.condition.common.ModeChoiceSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.common.ChooseModeEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
||||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.mana.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.Mana;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -210,9 +210,8 @@ class GauntletOfPowerEffectEffect2 extends ManaEffect {
|
|||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (land != null) {
|
||||
Player player = game.getPlayer(land.getControllerId());
|
||||
Mana mana = (Mana) getValue("mana");
|
||||
if (player != null && mana != null) {
|
||||
player.getManaPool().addMana(mana, game, source);
|
||||
if (player != null) {
|
||||
player.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -220,7 +219,14 @@ class GauntletOfPowerEffectEffect2 extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (land != null) {
|
||||
Mana mana = (Mana) getValue("mana");
|
||||
if (mana != null) {
|
||||
return mana.copy();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ import mage.abilities.costs.common.ExileFromHandCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalManaEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.mana.ConditionalManaAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.g;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -35,10 +34,9 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -46,12 +44,6 @@ import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
|||
*/
|
||||
public class GloryscaleViashino extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public GloryscaleViashino(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}");
|
||||
this.subtype.add(SubType.VIASHINO);
|
||||
|
|
@ -61,7 +53,7 @@ public class GloryscaleViashino extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you cast a multicolored spell, Gloryscale Viashino gets +3/+3 until end of turn.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), filter, false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), StaticFilters.FILTER_SPELL_A_MULTICOLORED, false));
|
||||
}
|
||||
|
||||
public GloryscaleViashino(final GloryscaleViashino card) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import mage.abilities.condition.Condition;
|
|||
import mage.abilities.costs.common.TapTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import mage.abilities.common.EntersBattlefieldTappedAbility;
|
|||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import mage.abilities.costs.common.DiscardTargetCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.h;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.Mana;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.RevoltCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.h;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.mana.DelayedTriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ package mage.cards.i;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.Mana;
|
||||
import mage.MageObjectReference;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
|
|
@ -48,8 +48,8 @@ import mage.abilities.mana.SimpleManaAbility;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
|
|
@ -235,14 +235,23 @@ class IceCauldronAddManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Permanent iceCauldron = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (iceCauldron != null && controller != null) {
|
||||
storedMana = (Mana) game.getState().getValue("IceCauldronMana" + source.getSourceId().toString());
|
||||
exiledCardMor = (MageObjectReference) game.getState().getValue("IceCauldronCard" + source.getSourceId().toString());
|
||||
if (storedMana != null) { // should be adding the mana even if exiled card is null
|
||||
checkToFirePossibleEvents(storedMana, game, source);
|
||||
|
||||
Card card = exiledCardMor.getCard(game);
|
||||
if (card == null) {
|
||||
card = game.getCard(exiledCardMor.getSourceId());
|
||||
|
|
@ -250,20 +259,15 @@ class IceCauldronAddManaEffect extends ManaEffect {
|
|||
card = null;
|
||||
}
|
||||
}
|
||||
IceCauldronConditionalMana iceCauldronMana = new IceCauldronConditionalMana(storedMana, card);
|
||||
if (iceCauldronMana != null) {
|
||||
controller.getManaPool().addMana(iceCauldronMana, game, source);
|
||||
return true;
|
||||
if (card != null) {
|
||||
return new IceCauldronConditionalMana(storedMana, card);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class IceCauldronConditionalMana extends ConditionalMana {
|
||||
|
|
@ -277,7 +281,7 @@ class IceCauldronConditionalMana extends ConditionalMana {
|
|||
|
||||
class IceCauldronManaCondition implements Condition {
|
||||
|
||||
private static Card exiledCard;
|
||||
private final Card exiledCard;
|
||||
|
||||
public IceCauldronManaCondition(Card exiledCard) {
|
||||
this.exiledCard = exiledCard;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class IceCave extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||
|
||||
// Whenever a player casts a spell, any other player may pay that spell's mana cost. If a player does, counter the spell. (Mana cost includes color.)
|
||||
this.addAbility(new SpellCastAllTriggeredAbility(Zone.BATTLEFIELD, new IceCaveEffect(), StaticFilters.FILTER_A_SPELL, false, SetTargetPointer.SPELL));
|
||||
this.addAbility(new SpellCastAllTriggeredAbility(Zone.BATTLEFIELD, new IceCaveEffect(), StaticFilters.FILTER_SPELL_A, false, SetTargetPointer.SPELL));
|
||||
}
|
||||
|
||||
public IceCave(final IceCave card) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.i;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.i;
|
|||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -91,44 +91,50 @@ class JackInTheMoxManaEffect extends ManaEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
int amount = controller.rollDice(game, 6);
|
||||
switch (amount) {
|
||||
case 1:
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
controller.loseLife(5, game, false);
|
||||
break;
|
||||
case 2:
|
||||
controller.getManaPool().addMana(Mana.WhiteMana(1), game, source);
|
||||
break;
|
||||
case 3:
|
||||
controller.getManaPool().addMana(Mana.BlueMana(1), game, source);
|
||||
break;
|
||||
case 4:
|
||||
controller.getManaPool().addMana(Mana.BlackMana(1), game, source);
|
||||
break;
|
||||
case 5:
|
||||
controller.getManaPool().addMana(Mana.RedMana(1), game, source);
|
||||
break;
|
||||
case 6:
|
||||
controller.getManaPool().addMana(Mana.GreenMana(1), game, source);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (controller != null) {
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JackInTheMoxManaEffect copy() {
|
||||
return new JackInTheMoxManaEffect(this);
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
int amount = controller.rollDice(game, 6);
|
||||
Mana mana = new Mana();
|
||||
switch (amount) {
|
||||
case 1:
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
controller.loseLife(5, game, false);
|
||||
break;
|
||||
case 2:
|
||||
mana.add(Mana.WhiteMana(1));
|
||||
break;
|
||||
case 3:
|
||||
mana.add(Mana.BlueMana(1));
|
||||
break;
|
||||
case 4:
|
||||
mana.add(Mana.BlackMana(1));
|
||||
break;
|
||||
case 5:
|
||||
mana.add(Mana.RedMana(1));
|
||||
break;
|
||||
case 6:
|
||||
mana.add(Mana.GreenMana(1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return mana;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
public JackInTheMoxManaEffect copy() {
|
||||
return new JackInTheMoxManaEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AddConditionalManaEffect;
|
||||
import mage.abilities.effects.mana.AddConditionalManaEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder;
|
||||
import mage.cards.Card;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolSourceControllerEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -137,22 +137,25 @@ class JeweledAmuletAddManaEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent jeweledAmulet = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (jeweledAmulet != null
|
||||
&& controller != null) {
|
||||
storedMana = (Mana) game.getState().getValue("JeweledAmulet" + source.getSourceId().toString());
|
||||
if (storedMana != null) {
|
||||
checkToFirePossibleEvents(storedMana, game, source);
|
||||
controller.getManaPool().addMana(storedMana, game, source);
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
Permanent jeweledAmulet = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (jeweledAmulet != null && controller != null) {
|
||||
storedMana = (Mana) game.getState().getValue("JeweledAmulet" + source.getSourceId().toString());
|
||||
if (storedMana != null) {
|
||||
return storedMana.copy();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.cards.k;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.DynamicManaEffect;
|
||||
import mage.abilities.effects.mana.DynamicManaEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.keyword.DevoidAbility;
|
||||
import mage.abilities.mana.ActivateOncePerTurnManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
|
@ -104,8 +105,25 @@ public class KyrenToy extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
if (netMana) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
return new Mana(0, 0, 0, 0, 0, 0, 0, sourceObject.getCounters(game).getCount(CounterType.CHARGE) + 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
int numberOfMana = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
|
|
@ -113,16 +131,8 @@ public class KyrenToy extends CardImpl {
|
|||
numberOfMana = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
}
|
||||
}
|
||||
Mana mana = new Mana(0, 0, 0, 0, 0, 0, 0, numberOfMana + 1);
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
player.getManaPool().addMana(mana, game, source);
|
||||
return true;
|
||||
return new Mana(0, 0, 0, 0, 0, 0, 0, numberOfMana + 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import mage.Mana;
|
|||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.DiscardHandCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.l;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -42,8 +41,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -51,12 +49,6 @@ import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
|||
*/
|
||||
public class LobberCrew extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public LobberCrew(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.GOBLIN);
|
||||
|
|
@ -70,7 +62,8 @@ public class LobberCrew extends CardImpl {
|
|||
// {T}: Lobber Crew deals 1 damage to each opponent.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), new TapSourceCost()));
|
||||
// Whenever you cast a multicolored spell, untap Lobber Crew.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
new UntapSourceEffect(), StaticFilters.FILTER_SPELL_A_MULTICOLORED, false));
|
||||
}
|
||||
|
||||
public LobberCrew(final LobberCrew card) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.cards.l;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.keyword.SuspendAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ package mage.cards.l;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.EnterBattlefieldPayCostOrPutGraveyardEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.Mana;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
|
|
@ -40,7 +40,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +52,7 @@ public class MadScienceFairProject extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// {tap}: Roll a six-sided die. On a 3 or lower, target player adds {C} to their mana pool. Otherwise, that player adds one mana of any color he or she chooses to their mana pool.
|
||||
this.addAbility(new MadScienceFairProjectManaAbility());
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new MadScienceFairManaEffect(), new TapSourceCost()));
|
||||
}
|
||||
|
||||
public MadScienceFairProject(final MadScienceFairProject card) {
|
||||
|
|
@ -66,22 +65,6 @@ public class MadScienceFairProject extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class MadScienceFairProjectManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
public MadScienceFairProjectManaAbility() {
|
||||
super(Zone.BATTLEFIELD, new MadScienceFairManaEffect(), new TapSourceCost());
|
||||
}
|
||||
|
||||
public MadScienceFairProjectManaAbility(final MadScienceFairProjectManaAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MadScienceFairProjectManaAbility copy() {
|
||||
return new MadScienceFairProjectManaAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MadScienceFairManaEffect extends ManaEffect {
|
||||
|
||||
public MadScienceFairManaEffect() {
|
||||
|
|
@ -101,28 +84,33 @@ class MadScienceFairManaEffect extends ManaEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
int amount = controller.rollDice(game, 6);
|
||||
if (amount <= 3) {
|
||||
controller.getManaPool().addMana(Mana.ColorlessMana(1), game, source);
|
||||
} else {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller.choose(Outcome.PutManaInPool, choice, game)) {
|
||||
Mana chosen = choice.getMana(1);
|
||||
checkToFirePossibleEvents(chosen, game, source);
|
||||
controller.getManaPool().addMana(chosen, game, source);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
if (controller != null) {
|
||||
checkToFirePossibleEvents(getMana(game, source), game, source);
|
||||
controller.getManaPool().addMana(getMana(game, source), game, source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana getMana(Game game, Ability source) {
|
||||
public Mana produceMana(boolean netMana, Game game, Ability source) {
|
||||
if (netMana) {
|
||||
return null;
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int amount = controller.rollDice(game, 6);
|
||||
if (amount <= 3) {
|
||||
return Mana.ColorlessMana(1);
|
||||
} else {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller.choose(Outcome.PutManaInPool, choice, game)) {
|
||||
Mana chosen = choice.getMana(1);
|
||||
checkToFirePossibleEvents(chosen, game, source);
|
||||
return chosen;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.mana.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
|
||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.abilities.mana.ActivateOncePerTurnManaAbility;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue