fix spreading seas

This commit is contained in:
igoudt 2017-08-06 22:58:20 +02:00
parent 5d99bacf73
commit ead0141b5b
8 changed files with 45 additions and 36 deletions

View file

@ -27,7 +27,6 @@
*/
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BecomesTappedAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -39,10 +38,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
* @author Loki
*/
@ -61,7 +63,7 @@ public class ContaminatedGround extends CardImpl {
this.addAbility(ability);
// Enchanted land is a Swamp.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Swamp")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.SWAMP)));
// Whenever enchanted land becomes tapped, its controller loses 2 life.
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land"));

View file

@ -27,7 +27,6 @@
*/
package mage.cards.e;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect;
@ -36,10 +35,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author North
@ -57,7 +59,7 @@ public class EvilPresence extends CardImpl {
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Enchanted land is a Swamp.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Swamp")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.SWAMP)));
}
public EvilPresence(final EvilPresence card) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -39,10 +38,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -61,7 +63,7 @@ public class LingeringMirage extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted land is an Island.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Island")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.ISLAND)));
// Cycling {2}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect;
@ -36,10 +35,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -58,7 +60,7 @@ public class LushGrowth extends CardImpl {
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Enchanted land is a Mountain, Forest, and Plains.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Mountain", "Forest", "Plains")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.MOUNTAIN, SubType.FOREST, SubType.PLAINS)));
}
public LushGrowth(final LushGrowth card) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
@ -37,10 +36,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -59,7 +61,7 @@ public class SeasClaim extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted land is an Island.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Island")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.ISLAND)));
}
public SeasClaim(final SeasClaim card) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -39,10 +38,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -65,7 +67,7 @@ public class SpreadingSeas extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
// Enchanted land is an Island.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Island")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.ISLAND)));
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -39,10 +38,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -63,7 +65,7 @@ public class TaintedWell extends CardImpl {
// When Tainted Well enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
// Enchanted land is a Swamp.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Swamp")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect(SubType.SWAMP)));
}
public TaintedWell(final TaintedWell card) {

View file

@ -30,24 +30,19 @@ package mage.abilities.effects.common.continuous;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.mana.*;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
protected final static ArrayList<String> allLandTypes = new ArrayList<>();
protected List<SubType> landTypes = new ArrayList<>();
protected ArrayList<String> landTypes = new ArrayList<>();
public BecomesBasicLandEnchantedEffect(String... landNames) {
public BecomesBasicLandEnchantedEffect(SubType... landNames) {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
landTypes.addAll(Arrays.asList(landNames));
this.staticText = setText();
@ -77,30 +72,30 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
switch (layer) {
case AbilityAddingRemovingEffects_6:
permanent.removeAllAbilities(source.getSourceId(), game);
for (String landType : landTypes) {
for (SubType landType : landTypes) {
switch (landType) {
case "Swamp":
if (permanent.getSubtype(game).contains("Swamp")) { // type can be removed by other effect with newer timestamp, so no ability adding
case SWAMP:
if (permanent.getSubtype(game).contains(SubType.SWAMP)) { // type can be removed by other effect with newer timestamp, so no ability adding
permanent.addAbility(new BlackManaAbility(), source.getSourceId(), game);
}
break;
case "Mountain":
if (permanent.getSubtype(game).contains("Mountain")) {
case MOUNTAIN:
if (permanent.getSubtype(game).contains(SubType.MOUNTAIN)) {
permanent.addAbility(new RedManaAbility(), source.getSourceId(), game);
}
break;
case "Forest":
if (permanent.getSubtype(game).contains("Forest")) {
case FOREST:
if (permanent.getSubtype(game).contains(SubType.FOREST)) {
permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game);
}
break;
case "Island":
if (permanent.getSubtype(game).contains("Island")) {
case ISLAND:
if (permanent.getSubtype(game).contains(SubType.ISLAND)) {
permanent.addAbility(new BlueManaAbility(), source.getSourceId(), game);
}
break;
case "Plains":
if (permanent.getSubtype(game).contains("Plains")) {
case PLAINS:
if (permanent.getSubtype(game).contains(SubType.PLAINS)) {
permanent.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
}
break;
@ -109,7 +104,7 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
// subtypes are all removed by changing the subtype to a land type.
permanent.getSubtype(game).removeAll(allLandTypes);
permanent.getSubtype(game).removeAll(SubType.getLandTypes(false));
permanent.getSubtype(game).addAll(landTypes);
break;
}
@ -127,7 +122,7 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
private String setText() {
StringBuilder sb = new StringBuilder("Enchanted land is a ");
int i = 1;
for (String landType : landTypes) {
for (SubType landType : landTypes) {
if (i > 1) {
if (i == landTypes.size()) {
sb.append(" and ");