mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Additional fixes for getNetMana from #6132 (final)
This commit is contained in:
parent
579a37c7c8
commit
dceb93e7a6
22 changed files with 219 additions and 238 deletions
|
@ -61,7 +61,6 @@ class ManaScrewAbility extends ActivatedManaAbilityImpl {
|
|||
|
||||
public ManaScrewAbility() {
|
||||
super(Zone.BATTLEFIELD, new ManaScrewEffect(), new GenericManaCost(1));
|
||||
this.netMana.add(Mana.ColorlessMana(2));
|
||||
}
|
||||
|
||||
public ManaScrewAbility(final ManaScrewAbility ability) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -10,8 +8,8 @@ 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.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -27,8 +25,9 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com, nantuko
|
||||
*/
|
||||
public final class GrandArchitect extends CardImpl {
|
||||
|
@ -42,17 +41,22 @@ public final class GrandArchitect extends CardImpl {
|
|||
}
|
||||
|
||||
public GrandArchitect(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||
this.subtype.add(SubType.VEDALKEN);
|
||||
this.subtype.add(SubType.ARTIFICER);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Other blue creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, boostFilter, true)));
|
||||
|
||||
// {U}: Target artifact creature becomes blue until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrandArchitectEffect(), new ManaCostsImpl("{U}"));
|
||||
ability.addTarget(new TargetPermanent(targetFilter));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Tap an untapped blue creature you control: Add {C}{C}. Spend this mana only to cast artifact spells or activate abilities of artifacts.
|
||||
this.addAbility(new GrandArchitectManaAbility());
|
||||
}
|
||||
|
||||
|
@ -137,9 +141,6 @@ class GrandArchitectManaCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object != null && object.isArtifact()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return object != null && object.isArtifact();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -23,8 +19,11 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class KyrenToy extends CardImpl {
|
||||
|
@ -79,6 +78,17 @@ public final class KyrenToy extends CardImpl {
|
|||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.ColorlessMana(sourceObject.getCounters(game).getCount(CounterType.CHARGE) + 1));
|
||||
return netMana;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
@ -89,18 +99,7 @@ public final class KyrenToy extends CardImpl {
|
|||
numberOfMana = ((RemoveVariableCountersSourceCost) cost).getAmount();
|
||||
}
|
||||
}
|
||||
return new Mana(0, 0, 0, 0, 0, 0, 0, numberOfMana + 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(new Mana(0, 0, 0, 0, 0, 0, 0, sourceObject.getCounters(game).getCount(CounterType.CHARGE) + 1));
|
||||
return netMana;
|
||||
return new Mana(Mana.ColorlessMana(numberOfMana + 1));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
@ -10,18 +7,16 @@ import mage.abilities.effects.common.ManaEffect;
|
|||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.choices.ManaChoice;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
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 MadScienceFairProject extends CardImpl {
|
||||
|
@ -59,6 +54,11 @@ class MadScienceFairManaEffect extends ManaEffect {
|
|||
return new MadScienceFairManaEffect(this);
|
||||
}
|
||||
|
||||
@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());
|
||||
|
@ -72,10 +72,4 @@ class MadScienceFairManaEffect extends ManaEffect {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
@ -14,8 +12,10 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author L_J
|
||||
*/
|
||||
public final class ManaScrew extends CardImpl {
|
||||
|
@ -41,7 +41,8 @@ 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));
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ManaScrewAbility(final ManaScrewAbility ability) {
|
||||
|
@ -84,6 +85,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);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
|
@ -11,7 +8,6 @@ import mage.abilities.keyword.EnchantAbility;
|
|||
import mage.abilities.mana.TriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.choices.ManaChoice;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -25,8 +21,11 @@ import mage.players.Player;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class MarketFestival extends CardImpl {
|
||||
|
@ -112,6 +111,13 @@ class MarketFestivalManaEffect extends ManaEffect {
|
|||
return game.getPlayer(sourceObject.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(2));
|
||||
return netMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -18,15 +14,16 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
*/
|
||||
public final class Metalworker extends CardImpl {
|
||||
|
@ -68,6 +65,20 @@ class MetalworkerManaEffect extends ManaEffect {
|
|||
return new MetalworkerManaEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
if (controller == null) {
|
||||
return null;
|
||||
}
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
int artifacts = controller.getHand().count(StaticFilters.FILTER_CARD_ARTIFACT, game);
|
||||
if (artifacts > 0) {
|
||||
netMana.add(Mana.ColorlessMana(artifacts * 2));
|
||||
}
|
||||
return netMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
|
@ -85,17 +96,4 @@ class MetalworkerManaEffect extends ManaEffect {
|
|||
}
|
||||
return new Mana();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
if (controller == null) {
|
||||
return null;
|
||||
}
|
||||
int artifacts = controller.getHand().count(StaticFilters.FILTER_CARD_ARTIFACT, game);
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.ColorlessMana(artifacts * 2));
|
||||
return netMana;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -22,8 +18,11 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
*/
|
||||
public final class MeteorCrater extends CardImpl {
|
||||
|
@ -63,6 +62,28 @@ class MeteorCraterEffect extends ManaEffect {
|
|||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Mana types = getManaTypes(game, source);
|
||||
|
@ -124,28 +145,6 @@ class MeteorCraterEffect extends ManaEffect {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
private Mana getManaTypes(Game game, Ability source) {
|
||||
List<Permanent> controlledPermanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||
Mana types = new Mana();
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
|
@ -16,15 +12,17 @@ import mage.abilities.effects.mana.DoUnlessAnyPlayerPaysManaEffect;
|
|||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.choices.ManaChoice;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jerekwilson
|
||||
*/
|
||||
public final class RhysticCave extends CardImpl {
|
||||
|
@ -95,16 +93,16 @@ class RhysticCaveManaEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
return ManaChoice.chooseAnyColor(controller, game, 1);
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(1));
|
||||
return netMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(new Mana(0, 0, 0, 0, 0, 0, 1, 0));
|
||||
return netMana;
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player controller = getPlayer(game, source);
|
||||
return ManaChoice.chooseAnyColor(controller, game, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +1,24 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Plopman
|
||||
*/
|
||||
|
@ -80,11 +73,15 @@ class SacellumGodspeakerEffect extends ManaEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.GreenMana(controller.getHand().count(filter, game)));
|
||||
int count = controller.getHand().count(filter, game);
|
||||
if (count > 0) {
|
||||
netMana.add(Mana.GreenMana(count));
|
||||
}
|
||||
return netMana;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -28,8 +26,10 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class SasayaOrochiAscendant extends CardImpl {
|
||||
|
@ -130,6 +130,11 @@ class SasayasEssenceManaEffect extends ManaEffect {
|
|||
return new SasayasEssenceManaEffect(this);
|
||||
}
|
||||
|
||||
@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());
|
||||
|
@ -203,9 +208,4 @@ class SasayasEssenceManaEffect extends ManaEffect {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -14,11 +12,11 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.players.ManaPool;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class SavageVentmaw extends CardImpl {
|
||||
|
@ -59,7 +57,7 @@ class SavageVentmawManaEffect extends ManaEffect {
|
|||
|
||||
public SavageVentmawManaEffect(final SavageVentmawManaEffect effect) {
|
||||
super(effect);
|
||||
this.mana = effect.mana;
|
||||
this.mana = effect.mana.copy();
|
||||
this.staticText = effect.staticText;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -15,16 +12,14 @@ import mage.abilities.mana.ActivatedManaAbilityImpl;
|
|||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class SelvalaExplorerReturned extends CardImpl {
|
||||
|
@ -72,6 +67,11 @@ class SelvalaExplorerReturnedEffect extends ManaEffect {
|
|||
return new SelvalaExplorerReturnedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
int parleyCount = ParleyCount.getInstance().calculate(game, source, this);
|
||||
|
@ -81,10 +81,4 @@ class SelvalaExplorerReturnedEffect extends ManaEffect {
|
|||
}
|
||||
return Mana.GreenMana(parleyCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
@ -11,7 +8,6 @@ import mage.abilities.effects.common.ManaEffect;
|
|||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.choices.ManaChoice;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -19,8 +15,11 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Galatolol
|
||||
*/
|
||||
public final class SpectralSearchlight extends CardImpl {
|
||||
|
@ -63,14 +62,16 @@ class SpectralSearchlightManaEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player player = getPlayer(game, source);
|
||||
return ManaChoice.chooseAnyColor(player, game, 1);
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(1));
|
||||
return netMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
return null;
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Player player = getPlayer(game, source);
|
||||
return ManaChoice.chooseAnyColor(player, game, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -26,8 +22,11 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public final class SquanderedResources extends CardImpl {
|
||||
|
@ -62,6 +61,31 @@ class SquanderedResourcesEffect extends ManaEffect {
|
|||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
if (types.getGeneric() > 0) {
|
||||
netManas.add(Mana.ColorlessMana(1));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Mana types = getManaTypes(game, source);
|
||||
|
@ -97,7 +121,7 @@ class SquanderedResourcesEffect extends ManaEffect {
|
|||
Mana mana = new Mana();
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if(player == null){
|
||||
if (player == null) {
|
||||
return mana;
|
||||
}
|
||||
if (choice.getChoices().size() == 1) {
|
||||
|
@ -132,33 +156,7 @@ class SquanderedResourcesEffect extends ManaEffect {
|
|||
return mana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
if (types.getGeneric() > 0) {
|
||||
netManas.add(Mana.ColorlessMana(1));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
private Mana getManaTypes(Game game, Ability source) {
|
||||
|
||||
Mana types = new Mana();
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -27,8 +23,11 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author anonymous
|
||||
*/
|
||||
public final class StarCompass extends CardImpl {
|
||||
|
@ -69,6 +68,31 @@ class StarCompassManaEffect extends ManaEffect {
|
|||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
if (types.getGeneric() > 0) {
|
||||
netManas.add(Mana.ColorlessMana(1));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mana produceMana(Game game, Ability source) {
|
||||
Mana types = getManaTypes(game, source);
|
||||
|
@ -103,7 +127,7 @@ class StarCompassManaEffect extends ManaEffect {
|
|||
}
|
||||
if (!choice.getChoices().isEmpty()) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if(player == null){
|
||||
if (player == null) {
|
||||
return null;
|
||||
}
|
||||
if (choice.getChoices().size() == 1) {
|
||||
|
@ -141,31 +165,6 @@ class StarCompassManaEffect extends ManaEffect {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netManas = new ArrayList<>();
|
||||
Mana types = getManaTypes(game, source);
|
||||
if (types.getBlack() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.B));
|
||||
}
|
||||
if (types.getRed() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.R));
|
||||
}
|
||||
if (types.getBlue() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.U));
|
||||
}
|
||||
if (types.getGreen() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.G));
|
||||
}
|
||||
if (types.getWhite() > 0) {
|
||||
netManas.add(new Mana(ColoredManaSymbol.W));
|
||||
}
|
||||
if (types.getGeneric() > 0) {
|
||||
netManas.add(Mana.ColorlessMana(1));
|
||||
}
|
||||
return netManas;
|
||||
}
|
||||
|
||||
private Mana getManaTypes(Game game, Ability source) {
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||
Mana types = new Mana();
|
||||
|
|
|
@ -85,13 +85,11 @@ class VedalkenEngineerEffect extends ManaEffect {
|
|||
|
||||
private final int amount;
|
||||
private final ConditionalManaBuilder manaBuilder;
|
||||
protected final ArrayList<Mana> netMana = new ArrayList<>();
|
||||
|
||||
public VedalkenEngineerEffect(int amount, ConditionalManaBuilder manaBuilder) {
|
||||
super();
|
||||
this.amount = amount;
|
||||
this.manaBuilder = manaBuilder;
|
||||
netMana.add(Mana.AnyMana(amount));
|
||||
staticText = "Add " + amount + " mana of any one color. " + manaBuilder.getRule();
|
||||
}
|
||||
|
||||
|
@ -99,7 +97,6 @@ class VedalkenEngineerEffect extends ManaEffect {
|
|||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
this.manaBuilder = effect.manaBuilder;
|
||||
this.netMana.addAll(effect.netMana);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -109,6 +106,8 @@ class VedalkenEngineerEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
Mana.AnyMana(amount);
|
||||
return netMana;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -18,8 +16,9 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class VictoryChimes extends CardImpl {
|
||||
|
@ -29,6 +28,7 @@ public final class VictoryChimes extends CardImpl {
|
|||
|
||||
// Untap Victory Chimes during each other player's untap step.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UntapSourceDuringEachOtherPlayersUntapStepEffect()));
|
||||
|
||||
// {T}: A player of your choice adds {C}.
|
||||
ManaEffect effect = new VictoryChimesManaEffect("chosen player");
|
||||
effect.setText("a player of your choice adds {C}");
|
||||
|
|
|
@ -10,10 +10,8 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AddConditionalManaEffect extends ManaEffect {
|
||||
|
@ -30,7 +28,7 @@ public class AddConditionalManaEffect extends ManaEffect {
|
|||
|
||||
public AddConditionalManaEffect(final AddConditionalManaEffect effect) {
|
||||
super(effect);
|
||||
this.mana = effect.mana;
|
||||
this.mana = effect.mana.copy();
|
||||
this.manaBuilder = effect.manaBuilder;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author magenoxx
|
||||
*/
|
||||
public class AddManaToManaPoolSourceControllerEffect extends OneShotEffect {
|
||||
|
@ -29,7 +28,7 @@ public class AddManaToManaPoolSourceControllerEffect extends OneShotEffect {
|
|||
|
||||
public AddManaToManaPoolSourceControllerEffect(final AddManaToManaPoolSourceControllerEffect effect) {
|
||||
super(effect);
|
||||
this.mana = effect.mana;
|
||||
this.mana = effect.mana.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,7 +44,7 @@ public class AddManaToManaPoolTargetControllerEffect extends ManaEffect {
|
|||
|
||||
public AddManaToManaPoolTargetControllerEffect(final AddManaToManaPoolTargetControllerEffect effect) {
|
||||
super(effect);
|
||||
this.mana = effect.mana;
|
||||
this.mana = effect.mana.copy();
|
||||
this.emptyOnlyOnTurnsEnd = effect.emptyOnlyOnTurnsEnd;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import mage.abilities.mana.builder.ConditionalManaBuilder;
|
|||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ConditionalColorlessManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
@ -23,7 +22,6 @@ public class ConditionalColorlessManaAbility extends ActivatedManaAbilityImpl {
|
|||
|
||||
public ConditionalColorlessManaAbility(Cost cost, int amount, ConditionalManaBuilder manaBuilder) {
|
||||
super(Zone.BATTLEFIELD, new AddConditionalColorlessManaEffect(amount, manaBuilder), cost);
|
||||
// this.netMana.add(Mana.ColorlessMana(amount)); // When produced during runtime, condition is added (how to add condition here?)
|
||||
}
|
||||
|
||||
public ConditionalColorlessManaAbility(final ConditionalColorlessManaAbility ability) {
|
||||
|
|
Loading…
Reference in a new issue