mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
- refactor some cards and an effect
This commit is contained in:
parent
d6c2f031d0
commit
b11e2a0fe9
6 changed files with 25 additions and 58 deletions
|
@ -19,11 +19,7 @@ import mage.players.Player;
|
||||||
import mage.util.SubTypeList;
|
import mage.util.SubTypeList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bunchOfDevs
|
* @author bunchOfDevs
|
||||||
|
@ -58,6 +54,8 @@ public final class Conspiracy extends CardImpl {
|
||||||
staticText = "Creatures you control are the chosen type. The same is "
|
staticText = "Creatures you control are the chosen type. The same is "
|
||||||
+ "true for creature spells you control and creature cards "
|
+ "true for creature spells you control and creature cards "
|
||||||
+ "you own that aren't on the battlefield.";
|
+ "you own that aren't on the battlefield.";
|
||||||
|
|
||||||
|
this.dependendToTypes.add(DependencyType.BecomeCreature); // Opalescence and Starfield of Nyx
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConspiracyEffect(final ConspiracyEffect effect) {
|
public ConspiracyEffect(final ConspiracyEffect effect) {
|
||||||
|
@ -148,7 +146,8 @@ public final class Conspiracy extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setChosenSubtype(SubTypeList subtype, SubType choice) {
|
private void setChosenSubtype(SubTypeList subtype, SubType choice) {
|
||||||
if (subtype.size() != 1 || !subtype.contains(choice)) {
|
if (subtype.size() != 1
|
||||||
|
|| !subtype.contains(choice)) {
|
||||||
subtype.clear();
|
subtype.clear();
|
||||||
subtype.add(choice);
|
subtype.add(choice);
|
||||||
}
|
}
|
||||||
|
@ -163,16 +162,5 @@ public final class Conspiracy extends CardImpl {
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return layer == Layer.TypeChangingEffects_4;
|
return layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
|
|
||||||
// the dependent classes needs to be an enclosed class for dependent check of continuous effects
|
|
||||||
return allEffectsInLayer.stream()
|
|
||||||
.filter(effect
|
|
||||||
-> mage.cards.s.StarfieldOfNyx.class.equals(effect.getClass().getEnclosingClass())
|
|
||||||
|| mage.cards.o.Opalescence.class.equals(effect.getClass().getEnclosingClass()))
|
|
||||||
.map(Effect::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.ActivatedAbility;
|
import mage.abilities.ActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -52,6 +47,8 @@ public final class NecroticOoze extends CardImpl {
|
||||||
Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||||
staticText = "As long as {this} is on the battlefield, "
|
staticText = "As long as {this} is on the battlefield, "
|
||||||
+ "it has all activated abilities of all creature cards in all graveyards";
|
+ "it has all activated abilities of all creature cards in all graveyards";
|
||||||
|
|
||||||
|
this.dependendToTypes.add(DependencyType.AddingAbility); // Yixlid Jailer
|
||||||
}
|
}
|
||||||
|
|
||||||
public NecroticOozeEffect(final NecroticOozeEffect effect) {
|
public NecroticOozeEffect(final NecroticOozeEffect effect) {
|
||||||
|
@ -88,16 +85,6 @@ public final class NecroticOoze extends CardImpl {
|
||||||
public NecroticOozeEffect copy() {
|
public NecroticOozeEffect copy() {
|
||||||
return new NecroticOozeEffect(this);
|
return new NecroticOozeEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
|
|
||||||
// the dependent classes needs to be an enclosed class for dependent check of continuous effects
|
|
||||||
return allEffectsInLayer.stream()
|
|
||||||
.filter(effect -> mage.cards.y.YixlidJailer.class.equals(effect.getClass().getEnclosingClass()))
|
|
||||||
.map(Effect::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,11 @@ public final class Opalescence extends CardImpl {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.BecomeCreature);
|
super(Duration.WhileOnBattlefield, Outcome.BecomeCreature);
|
||||||
staticText = "Each other non-Aura enchantment is a creature in addition to its other "
|
staticText = "Each other non-Aura enchantment is a creature in addition to its other "
|
||||||
+ "types and has base power and base toughness each equal to its converted mana cost";
|
+ "types and has base power and base toughness each equal to its converted mana cost";
|
||||||
|
|
||||||
|
this.dependendToTypes.add(DependencyType.EnchantmentAddingRemoving); // Enchanted Evening
|
||||||
|
this.dependendToTypes.add(DependencyType.AuraAddingRemoving); // Cloudform
|
||||||
|
|
||||||
|
this.dependencyTypes.add(DependencyType.BecomeCreature); // Conspiracy
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpalescenceEffect(final OpalescenceEffect effect) {
|
public OpalescenceEffect(final OpalescenceEffect effect) {
|
||||||
|
@ -70,7 +75,8 @@ public final class Opalescence extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter,
|
||||||
|
source.getControllerId(), source.getSourceId(), game)) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
if (sublayer == SubLayer.NA) {
|
if (sublayer == SubLayer.NA) {
|
||||||
|
@ -102,15 +108,5 @@ public final class Opalescence extends CardImpl {
|
||||||
return layer == Layer.PTChangingEffects_7
|
return layer == Layer.PTChangingEffects_7
|
||||||
|| layer == Layer.TypeChangingEffects_4;
|
|| layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
|
|
||||||
// the dependent classes needs to be an enclosed class for dependent check of continuous effects
|
|
||||||
return allEffectsInLayer.stream()
|
|
||||||
.filter(effect -> effect.getDependencyTypes().contains(DependencyType.EnchantmentAddingRemoving)
|
|
||||||
|| effect.getDependencyTypes().contains(DependencyType.AuraAddingRemoving)) // Cloudform
|
|
||||||
.map(Effect::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -33,7 +29,8 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
+ "each other non-Aura enchantment you control is a creature in addition to its other types "
|
+ "each other non-Aura enchantment you control is a creature in addition to its other types "
|
||||||
+ "and has base power and base toughness each equal to its converted mana cost.";
|
+ "and has base power and base toughness each equal to its converted mana cost.";
|
||||||
|
|
||||||
private static final FilterCard filterGraveyardEnchantment = new FilterCard("enchantment card from your graveyard");
|
private static final FilterCard filterGraveyardEnchantment
|
||||||
|
= new FilterCard("enchantment card from your graveyard");
|
||||||
private static final FilterEnchantmentPermanent filterEnchantmentYouControl
|
private static final FilterEnchantmentPermanent filterEnchantmentYouControl
|
||||||
= new FilterEnchantmentPermanent("enchantment you control");
|
= new FilterEnchantmentPermanent("enchantment you control");
|
||||||
|
|
||||||
|
@ -88,6 +85,11 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
staticText = "Each other non-Aura enchantment you control is a creature "
|
staticText = "Each other non-Aura enchantment you control is a creature "
|
||||||
+ "in addition to its other types and has base power and "
|
+ "in addition to its other types and has base power and "
|
||||||
+ "toughness each equal to its converted mana cost";
|
+ "toughness each equal to its converted mana cost";
|
||||||
|
|
||||||
|
this.dependendToTypes.add(DependencyType.EnchantmentAddingRemoving); // Enchanted Evening
|
||||||
|
this.dependendToTypes.add(DependencyType.AuraAddingRemoving); // Cloudform
|
||||||
|
|
||||||
|
this.dependencyTypes.add(DependencyType.BecomeCreature); // Conspiracy
|
||||||
}
|
}
|
||||||
|
|
||||||
public StarfieldOfNyxEffect(final StarfieldOfNyxEffect effect) {
|
public StarfieldOfNyxEffect(final StarfieldOfNyxEffect effect) {
|
||||||
|
@ -104,7 +106,7 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
filter.add(CardType.ENCHANTMENT.getPredicate());
|
filter.add(CardType.ENCHANTMENT.getPredicate());
|
||||||
filter.add(Predicates.not(SubType.AURA.getPredicate()));
|
filter.add(Predicates.not(SubType.AURA.getPredicate()));
|
||||||
filter.add(AnotherPredicate.instance);
|
filter.add(AnotherPredicate.instance);
|
||||||
if (game.getState().getBattlefield().getActivePermanents(filter2,
|
if (game.getState().getBattlefield().getActivePermanents(filter2,
|
||||||
source.getControllerId(), source.getSourceId(), game).size() > 4) {
|
source.getControllerId(), source.getSourceId(), game).size() > 4) {
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter,
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter,
|
||||||
source.getControllerId(), source.getSourceId(), game)) {
|
source.getControllerId(), source.getSourceId(), game)) {
|
||||||
|
@ -144,15 +146,5 @@ public final class StarfieldOfNyx extends CardImpl {
|
||||||
return layer == Layer.PTChangingEffects_7
|
return layer == Layer.PTChangingEffects_7
|
||||||
|| layer == Layer.TypeChangingEffects_4;
|
|| layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
|
|
||||||
// the dependent classes needs to be an enclosed class for dependent check of continuous effects
|
|
||||||
return allEffectsInLayer.stream()
|
|
||||||
.filter(effect -> effect.getDependencyTypes().contains(DependencyType.EnchantmentAddingRemoving)
|
|
||||||
|| effect.getDependencyTypes().contains(DependencyType.AuraAddingRemoving)) // Cloudform
|
|
||||||
.map(Effect::getId)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,8 @@ public final class YixlidJailer extends CardImpl {
|
||||||
YixlidJailerEffect() {
|
YixlidJailerEffect() {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.LoseAbility);
|
super(Duration.WhileOnBattlefield, Outcome.LoseAbility);
|
||||||
staticText = "Cards in graveyards lose all abilities.";
|
staticText = "Cards in graveyards lose all abilities.";
|
||||||
|
|
||||||
|
this.dependencyTypes.add(DependencyType.AddingAbility); // Necrotic Ooze
|
||||||
}
|
}
|
||||||
|
|
||||||
YixlidJailerEffect(final YixlidJailerEffect effect) {
|
YixlidJailerEffect(final YixlidJailerEffect effect) {
|
||||||
|
|
|
@ -44,6 +44,8 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl {
|
||||||
this.loseColor = loseColor;
|
this.loseColor = loseColor;
|
||||||
this.loseName = loseName;
|
this.loseName = loseName;
|
||||||
this.loseTypes = loseTypes;
|
this.loseTypes = loseTypes;
|
||||||
|
|
||||||
|
this.dependencyTypes.add(DependencyType.BecomeCreature);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BecomesCreatureAllEffect(final BecomesCreatureAllEffect effect) {
|
public BecomesCreatureAllEffect(final BecomesCreatureAllEffect effect) {
|
||||||
|
|
Loading…
Reference in a new issue