mirror of
https://github.com/correl/mage.git
synced 2024-12-28 03:00:10 +00:00
[VOW] Implemented Fear of Death
This commit is contained in:
parent
139443971a
commit
8bb3c6ac60
2 changed files with 87 additions and 0 deletions
86
Mage.Sets/src/mage/cards/f/FearOfDeath.java
Normal file
86
Mage.Sets/src/mage/cards/f/FearOfDeath.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class FearOfDeath extends CardImpl {
|
||||
|
||||
public FearOfDeath(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Fear of Death enters the battlefield, mill two cards.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MillCardsControllerEffect(2)));
|
||||
|
||||
// Enchanted creature gets -X/-0, where X is the number of cards in your graveyard.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(FearOfDeathValue.instance, StaticValue.get(0))));
|
||||
}
|
||||
|
||||
private FearOfDeath(final FearOfDeath card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FearOfDeath copy() {
|
||||
return new FearOfDeath(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum FearOfDeathValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller == null) {
|
||||
return 0;
|
||||
}
|
||||
return -controller.getGraveyard().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FearOfDeathValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "-X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the number of cards in your graveyard";
|
||||
}
|
||||
}
|
|
@ -111,6 +111,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Evolving Wilds", 263, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));
|
||||
cards.add(new SetCardInfo("Falkenrath Celebrants", 156, Rarity.COMMON, mage.cards.f.FalkenrathCelebrants.class));
|
||||
cards.add(new SetCardInfo("Falkenrath Forebear", 111, Rarity.RARE, mage.cards.f.FalkenrathForebear.class));
|
||||
cards.add(new SetCardInfo("Fear of Death", 59, Rarity.COMMON, mage.cards.f.FearOfDeath.class));
|
||||
cards.add(new SetCardInfo("Fearful Villager", 157, Rarity.COMMON, mage.cards.f.FearfulVillager.class));
|
||||
cards.add(new SetCardInfo("Fearsome Werewolf", 157, Rarity.COMMON, mage.cards.f.FearsomeWerewolf.class));
|
||||
cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class));
|
||||
|
|
Loading…
Reference in a new issue