mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[CMR] Implemented Fall from Favor
This commit is contained in:
parent
1a40cfa706
commit
42e00b7a37
2 changed files with 70 additions and 0 deletions
69
Mage.Sets/src/mage/cards/f/FallFromFavor.java
Normal file
69
Mage.Sets/src/mage/cards/f/FallFromFavor.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.BecomesMonarchSourceEffect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
|
||||
import mage.abilities.effects.common.TapEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class FallFromFavor extends CardImpl {
|
||||
|
||||
public FallFromFavor(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Fall from Favor enters the battlefield, tap enchanted creature and you become the monarch.
|
||||
ability = new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect());
|
||||
ability.addEffect(new BecomesMonarchSourceEffect().concatBy("and"));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature doesn't untap during its controller's untap step unless that player is the monarch.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousRuleModifyingEffect(
|
||||
new DontUntapInControllersUntapStepEnchantedEffect(), FallFromFavorCondition.instance
|
||||
).setText("enchanted creature doesn't untap during its controller's untap step unless that player is the monarch")));
|
||||
}
|
||||
|
||||
private FallFromFavor(final FallFromFavor card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallFromFavor copy() {
|
||||
return new FallFromFavor(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum FallFromFavorCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getActivePlayerId().equals(game.getActivePlayerId());
|
||||
}
|
||||
}
|
|
@ -60,6 +60,7 @@ public final class CommanderLegends extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Entourage of Trest", 224, Rarity.COMMON, mage.cards.e.EntourageOfTrest.class));
|
||||
cards.add(new SetCardInfo("Exquisite Huntmaster", 122, Rarity.COMMON, mage.cards.e.ExquisiteHuntmaster.class));
|
||||
cards.add(new SetCardInfo("Eyeblight Cullers", 124, Rarity.COMMON, mage.cards.e.EyeblightCullers.class));
|
||||
cards.add(new SetCardInfo("Fall from Favor", 68, Rarity.COMMON, mage.cards.f.FallFromFavor.class));
|
||||
cards.add(new SetCardInfo("Farhaven Elf", 225, Rarity.COMMON, mage.cards.f.FarhavenElf.class));
|
||||
cards.add(new SetCardInfo("First Response", 22, Rarity.UNCOMMON, mage.cards.f.FirstResponse.class));
|
||||
cards.add(new SetCardInfo("Fleshbag Marauder", 128, Rarity.COMMON, mage.cards.f.FleshbagMarauder.class));
|
||||
|
|
Loading…
Reference in a new issue