mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[MIC] Implemented Curse of Conformity
This commit is contained in:
parent
b43bb44b27
commit
c54e9dd012
2 changed files with 105 additions and 0 deletions
104
Mage.Sets/src/mage/cards/c/CurseOfConformity.java
Normal file
104
Mage.Sets/src/mage/cards/c/CurseOfConformity.java
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.EnchantPlayerControlsPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CurseOfConformity extends CardImpl {
|
||||
|
||||
public CurseOfConformity(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
this.subtype.add(SubType.CURSE);
|
||||
|
||||
// Enchant player
|
||||
TargetPlayer auraTarget = new TargetPlayer();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
|
||||
// Nonlegendary creatures enchanted player controls have base power and toughness 3/3 and lose all creature types.
|
||||
this.addAbility(new SimpleStaticAbility(new CurseOfConformityEffect()));
|
||||
}
|
||||
|
||||
private CurseOfConformity(final CurseOfConformity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CurseOfConformity copy() {
|
||||
return new CurseOfConformity(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CurseOfConformityEffect extends ContinuousEffectImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate()));
|
||||
filter.add(EnchantPlayerControlsPredicate.instance);
|
||||
}
|
||||
|
||||
CurseOfConformityEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.LoseAbility);
|
||||
staticText = "nonlegendary creatures enchanted player controls " +
|
||||
"have base power and toughness 3/3 and lose all creature types";
|
||||
}
|
||||
|
||||
private CurseOfConformityEffect(final CurseOfConformityEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CurseOfConformityEffect copy() {
|
||||
return new CurseOfConformityEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(
|
||||
filter, source.getControllerId(), source.getSourceId(), game
|
||||
)) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.removeAllCreatureTypes(game);
|
||||
break;
|
||||
case PTChangingEffects_7:
|
||||
if (sublayer == SubLayer.SetPT_7b) {
|
||||
permanent.getPower().setValue(3);
|
||||
permanent.getToughness().setValue(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,6 +49,7 @@ public final class MidnightHuntCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Corpse Augur", 109, Rarity.UNCOMMON, mage.cards.c.CorpseAugur.class));
|
||||
cards.add(new SetCardInfo("Crowded Crypt", 17, Rarity.RARE, mage.cards.c.CrowdedCrypt.class));
|
||||
cards.add(new SetCardInfo("Curse of Clinging Webs", 25, Rarity.RARE, mage.cards.c.CurseOfClingingWebs.class));
|
||||
cards.add(new SetCardInfo("Curse of Conformity", 6, Rarity.RARE, mage.cards.c.CurseOfConformity.class));
|
||||
cards.add(new SetCardInfo("Custodi Soulbinders", 83, Rarity.RARE, mage.cards.c.CustodiSoulbinders.class));
|
||||
cards.add(new SetCardInfo("Dark Salvation", 110, Rarity.RARE, mage.cards.d.DarkSalvation.class));
|
||||
cards.add(new SetCardInfo("Darkwater Catacombs", 171, Rarity.RARE, mage.cards.d.DarkwaterCatacombs.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue