mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[ZNR] Implemented Lithoform Blight
This commit is contained in:
parent
2aff2d4437
commit
06d0ac0974
2 changed files with 110 additions and 0 deletions
109
Mage.Sets/src/mage/cards/l/LithoformBlight.java
Normal file
109
Mage.Sets/src/mage/cards/l/LithoformBlight.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class LithoformBlight extends CardImpl {
|
||||
|
||||
public LithoformBlight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant land
|
||||
TargetPermanent auraTarget = new TargetLandPermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Lithoform Blight enters the battlefield, draw a card.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
|
||||
|
||||
// Enchanted land loses all land types and abilities and has "{T}: Add {C}" and "{T}, Pay 1 life: Add one mana of any color."
|
||||
this.addAbility(new SimpleStaticAbility(new BecomesCreatureAttachedEffect()));
|
||||
}
|
||||
|
||||
private LithoformBlight(final LithoformBlight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LithoformBlight copy() {
|
||||
return new LithoformBlight(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
||||
|
||||
BecomesCreatureAttachedEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.LoseAbility);
|
||||
staticText = "Enchanted land loses all land types and abilities " +
|
||||
"and has \"{T}: Add {C}\" and \"{T}, Pay 1 life: Add one mana of any color.\"";
|
||||
}
|
||||
|
||||
private BecomesCreatureAttachedEffect(final BecomesCreatureAttachedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BecomesCreatureAttachedEffect copy() {
|
||||
return new BecomesCreatureAttachedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (permanent == null) {
|
||||
return true;
|
||||
}
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.getSubtype(game).removeAll(SubType.getLandTypes());
|
||||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||
permanent.addAbility(new ColorlessManaAbility(), source.getSourceId(), game);
|
||||
Ability ability = new AnyColorManaAbility();
|
||||
ability.addCost(new PayLifeCost(1));
|
||||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.AbilityAddingRemovingEffects_6
|
||||
|| layer == Layer.TypeChangingEffects_4;
|
||||
}
|
||||
}
|
|
@ -230,6 +230,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Legion Angel", 23, Rarity.RARE, mage.cards.l.LegionAngel.class));
|
||||
cards.add(new SetCardInfo("Leyline Tyrant", 147, Rarity.MYTHIC, mage.cards.l.LeylineTyrant.class));
|
||||
cards.add(new SetCardInfo("Linvala, Shield of Sea Gate", 226, Rarity.RARE, mage.cards.l.LinvalaShieldOfSeaGate.class));
|
||||
cards.add(new SetCardInfo("Lithoform Blight", 109, Rarity.UNCOMMON, mage.cards.l.LithoformBlight.class));
|
||||
cards.add(new SetCardInfo("Living Tempest", 65, Rarity.COMMON, mage.cards.l.LivingTempest.class));
|
||||
cards.add(new SetCardInfo("Lotus Cobra", 193, Rarity.RARE, mage.cards.l.LotusCobra.class));
|
||||
cards.add(new SetCardInfo("Lullmage's Domination", 66, Rarity.UNCOMMON, mage.cards.l.LullmagesDomination.class));
|
||||
|
|
Loading…
Reference in a new issue