mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[MH2] Implemented Foundry Helix (#7881)
This commit is contained in:
parent
bff38a195d
commit
11a19a8fc1
2 changed files with 70 additions and 0 deletions
69
Mage.Sets/src/mage/cards/f/FoundryHelix.java
Normal file
69
Mage.Sets/src/mage/cards/f/FoundryHelix.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class FoundryHelix extends CardImpl {
|
||||
|
||||
public FoundryHelix(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{W}");
|
||||
|
||||
// As an additional cost to cast this spell, sacrifice a permanent.
|
||||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent()));
|
||||
|
||||
// Foundry Helix deals 4 damage to any target. If the sacrificed permanent was an artifact, you gain 4 life.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeEffect(4), FoundryHelixCondition.instance));
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||
}
|
||||
|
||||
private FoundryHelix(final FoundryHelix card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FoundryHelix copy() {
|
||||
return new FoundryHelix(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum FoundryHelixCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof SacrificeTargetCost) {
|
||||
for (Permanent permanent : ((SacrificeTargetCost) cost).getPermanents()) {
|
||||
if (permanent.isArtifact()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "the sacrificed permanent was an artifact";
|
||||
}
|
||||
}
|
|
@ -113,6 +113,7 @@ public final class ModernHorizons2 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Forest", 489, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Foul Watcher", 43, Rarity.COMMON, mage.cards.f.FoulWatcher.class));
|
||||
cards.add(new SetCardInfo("Foundation Breaker", 160, Rarity.UNCOMMON, mage.cards.f.FoundationBreaker.class));
|
||||
cards.add(new SetCardInfo("Foundry Helix", 196, Rarity.COMMON, mage.cards.f.FoundryHelix.class));
|
||||
cards.add(new SetCardInfo("Fractured Sanity", 44, Rarity.RARE, mage.cards.f.FracturedSanity.class));
|
||||
cards.add(new SetCardInfo("Funnel-Web Recluse", 161, Rarity.COMMON, mage.cards.f.FunnelWebRecluse.class));
|
||||
cards.add(new SetCardInfo("Fury", 126, Rarity.MYTHIC, mage.cards.f.Fury.class));
|
||||
|
|
Loading…
Reference in a new issue