1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-03 09:18:59 -09:00

Additional fixes for getNetMana from , fixed

This commit is contained in:
Oleg Agafonov 2020-01-02 23:47:16 +04:00
parent 62636b5071
commit 3ed27b6314
4 changed files with 54 additions and 62 deletions

View file

@ -1,8 +1,5 @@
package mage.cards.e;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
@ -14,30 +11,25 @@ import mage.abilities.costs.mana.VariableManaCost;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.mana.BasicManaEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.List;
import java.util.UUID;
/**
*
* @author Ketsuban
*/
public final class EverythingamajigC extends CardImpl {
public EverythingamajigC(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
// Mana Screw
// 1: Flip a coin. If you win the flip, add CC to your mana pool. Activate this ability only any time you could cast an instant.
@ -69,7 +61,7 @@ class ManaScrewAbility extends ActivatedManaAbilityImpl {
public ManaScrewAbility() {
super(Zone.BATTLEFIELD, new ManaScrewEffect(), new GenericManaCost(1));
this.netMana.add(new Mana(0, 0, 0, 0, 0, 2, 0, 0));
this.netMana.add(Mana.ColorlessMana(2));
}
public ManaScrewAbility(final ManaScrewAbility ability) {
@ -112,6 +104,11 @@ class ManaScrewEffect extends ManaEffect {
return new ManaScrewEffect(this);
}
@Override
public List<Mana> getNetMana(Game game, Ability source) {
return null;
}
@Override
public Mana produceMana(Game game, Ability source) {
Player player = getPlayer(game, source);

View file

@ -1,7 +1,5 @@
package mage.cards.i;
import java.util.UUID;
import mage.ConditionalMana;
import mage.MageObjectReference;
import mage.Mana;
@ -22,11 +20,7 @@ import mage.abilities.mana.SimpleManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@ -38,8 +32,9 @@ import mage.target.TargetCard;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author L_J (based on jeffwadsworth)
*/
public final class IceCauldron extends CardImpl {
@ -147,10 +142,8 @@ class IceCauldronCastFromExileEffect extends AsThoughEffectImpl {
&& game.getState().getZone(objectId) == Zone.EXILED) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(objectId);
if (player != null
&& card != null) {
return true;
}
return player != null
&& card != null;
}
return false;
}
@ -231,7 +224,6 @@ class IceCauldronAddManaEffect extends ManaEffect {
}
}
return null;
}
}
@ -257,9 +249,7 @@ class IceCauldronManaCondition implements Condition {
public boolean apply(Game game, Ability source) {
if (source instanceof SpellAbility) {
Card card = game.getCard(source.getSourceId());
if (card != null && card.equals(exiledCard)) {
return true;
}
return card != null && card.equals(exiledCard);
}
return false;
}

View file

@ -72,6 +72,35 @@ class AnyColorLandsProduceManaEffect extends ManaEffect {
super(effect);
}
@Override
public List<Mana> getNetMana(Game game, Ability source) {
int manaAmount = getManaAmount(game, source);
List<Mana> netManas = new ArrayList<>();
Mana types = getManaTypes(game, source);
if (types.getRed() > 0) {
netManas.add(Mana.RedMana(manaAmount));
}
if (types.getGreen() > 0) {
netManas.add(Mana.GreenMana(manaAmount));
}
if (types.getBlue() > 0) {
netManas.add(Mana.BlueMana(manaAmount));
}
if (types.getWhite() > 0) {
netManas.add(Mana.WhiteMana(manaAmount));
}
if (types.getBlack() > 0) {
netManas.add(Mana.BlackMana(manaAmount));
}
if (types.getColorless() > 0) {
netManas.add(Mana.ColorlessMana(manaAmount));
}
if (types.getAny() > 0) {
netManas.add(Mana.AnyMana(manaAmount));
}
return netManas;
}
@Override
public Mana produceMana(Game game, Ability source) {
int manaAmount = getManaAmount(game, source);
@ -139,35 +168,6 @@ class AnyColorLandsProduceManaEffect extends ManaEffect {
return mana;
}
@Override
public List<Mana> getNetMana(Game game, Ability source) {
int manaAmount = getManaAmount(game, source);
List<Mana> netManas = new ArrayList<>();
Mana types = getManaTypes(game, source);
if (types.getRed() > 0) {
netManas.add(new Mana(manaAmount, 0, 0, 0, 0, 0, 0, 0));
}
if (types.getGreen() > 0) {
netManas.add(new Mana(0, manaAmount, 0, 0, 0, 0, 0, 0));
}
if (types.getBlue() > 0) {
netManas.add(new Mana(0, 0, manaAmount, 0, 0, 0, 0, 0));
}
if (types.getWhite() > 0) {
netManas.add(new Mana(0, 0, 0, manaAmount, 0, 0, 0, 0));
}
if (types.getBlack() > 0) {
netManas.add(new Mana(0, 0, 0, 0, manaAmount, 0, 0, 0));
}
if (types.getColorless() > 0) {
netManas.add(new Mana(0, 0, 0, 0, 0, 0, 0, manaAmount));
}
if (types.getAny() > 0) {
netManas.add(new Mana(0, 0, 0, 0, 0, 0, manaAmount, 0));
}
return netManas;
}
@Override
public AnyColorLandsProduceManaEffect copy() {
return new AnyColorLandsProduceManaEffect(this);

View file

@ -1,7 +1,5 @@
package mage.cards.j;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
@ -15,8 +13,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.List;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class JackInTheMox extends CardImpl {
@ -62,6 +62,11 @@ class JackInTheMoxManaEffect extends ManaEffect {
super(effect);
}
@Override
public List<Mana> getNetMana(Game game, Ability source) {
return null;
}
@Override
public Mana produceMana(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());