@Override public AddCountersAttachedEffect copy() { return new AddCountersAttachedEffect(this); }
/** * * @param counter * @param amount this amount will be added to the counter instances * @param textEnchanted text used for the enchanted permanent in rule text */ public AddCountersAttachedEffect(Counter counter, DynamicValue amount, String textEnchanted) { super(Outcome.Benefit); this.counter = counter.copy(); this.amount = amount; this.textEnchanted = textEnchanted; setText(); }
public FerocityTriggeredAbility() { super(Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"), true); }
public ArmoryOfIroas(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); this.subtype.add(SubType.EQUIPMENT); // Whenever equipped creature attacks, put a +1/+1 counter on it. this.addAbility(new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "it"))); // Equip {2} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); }
public SadisticGlee(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever a creature dies, put a +1/+1 counter on enchanted creature. this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersAttachedEffect( CounterType.P1P1.createInstance(), "enchanted creature"), false)); }
public SpiritShackle(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); 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); // Whenever enchanted creature becomes tapped, put a -0/-2 counter on it. this.addAbility(new BecomesTappedAttachedTriggeredAbility(new AddCountersAttachedEffect(new BoostCounter(0, -2), "it"), "enchanted creature")); }
public ShapeOfTheWiitigo(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}{G}"); 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 Shape of the Wiitigo enters the battlefield, put six +1/+1 counters on enchanted creature. this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(6), "enchanted creature"))); // At the beginning of your upkeep, put a +1/+1 counter on enchanted creature if it attacked or blocked since your last upkeep. Otherwise, remove a +1/+1 counter from it. Ability triggeredAbility = new BeginningOfUpkeepTriggeredAbility( new ConditionalOneShotEffect(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(1), "enchanted creature"), new RemoveCountersAttachedEffect(CounterType.P1P1.createInstance(1), "it"), new AttachedAttackedOrBlockedSinceYourLastUpkeepCondition(), "put a +1/+1 counter on enchanted creature if it attacked or blocked since your last " + "upkeep. Otherwise, remove a +1/+1 counter from it"), TargetController.YOU, false); triggeredAbility.addWatcher(new AttackedOrBlockedSinceYourLastUpkeepWatcher()); this.addAbility(triggeredAbility); }
public PredatoryHunger(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}"); 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); // Whenever an opponent casts a creature spell, put a +1/+1 counter on enchanted creature. this.addAbility(new SpellCastOpponentTriggeredAbility( new AddCountersAttachedEffect( CounterType.P1P1.createInstance(), "enchanted creature" ), StaticFilters.FILTER_SPELL_A_CREATURE, false )); }
public Torture(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // {1}{B}: Put a -1/-1 counter on enchanted creature. //this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.M1M1.createInstance(), rule), new ManaCostsImpl("[1}{B}"))); this.addAbility(new SimpleActivatedAbility( Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.M1M1.createInstance(),"enchanted creature"), new ManaCostsImpl("{1}{B}"))); }
public DailyRegimen(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // {1}{W}: Put a +1/+1 counter on enchanted creature. this.addAbility(new SimpleActivatedAbility( Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"enchanted creature"), new ManaCostsImpl("{1}{W}"))); }
public BitingTether(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{U}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // You control enchanted creature. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); // At the beginning of your upkeep, put a -1/-1 counter on enchanted creature. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersAttachedEffect(CounterType.M1M1.createInstance(), "enchanted creature"), TargetController.YOU, false)); }
public UnstableMutation(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{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); // Enchanted creature gets +3/+3. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3))); // At the beginning of the upkeep of enchanted creature's controller, put a -1/-1 counter on that creature. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersAttachedEffect(CounterType.M1M1.createInstance(), "that creature"), TargetController.CONTROLLER_ATTACHED_TO, false)); }
public EssenceFlare(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{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); // Enchanted creature gets +2/+0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 0))); // At the beginning of the upkeep of enchanted creature's controller, put a -0/-1 counter on that creature. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersAttachedEffect(new BoostCounter(0, -1), "that creature"), TargetController.CONTROLLER_ATTACHED_TO, false)); }
public OrdealOfHeliod(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Heliod. ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Heliod, you gain 10 life. this.addAbility(new SacrificeSourceTriggeredAbility(new GainLifeEffect(10), false)); }
public OrdealOfThassa(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.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Thassa. ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Thassa, draw two cards. this.addAbility(new SacrificeSourceTriggeredAbility(new DrawCardSourceControllerEffect(2), false)); }
public EpharasEnlightenment(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}{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 Ephara's Enlightenment enters the battlefield, put a +1/+1 counter on enchanted creature. this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), "enchanted creature"), false)); // Enchanted creature has flying. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); // Whenever a creature enters the battlefield under your control, you may return Ephara's Enlightenment to its owner's hand. this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new FilterCreaturePermanent("a creature"), true)); }
public OrdealOfErebos(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Erebos. ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Erebos, target player discards two cards. ability = new SacrificeSourceTriggeredAbility(new DiscardTargetEffect(2), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); }
public OrdealOfPurphoros(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Purphoros. ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Purphoros, it deals 3 damage to any target. ability = new SacrificeSourceTriggeredAbility( new DamageTargetEffect(3, "it"),false); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); }
public OrdealOfNylea(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature attacks, put a +1/+1 counter on it. Then if it has three or more +1/+1 counters on it, sacrifice Ordeal of Nylea. ability = new AttacksAttachedTriggeredAbility(new AddCountersAttachedEffect(CounterType.P1P1.createInstance(),"it"), AttachmentType.AURA, false); ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new AttachedToCounterCondition(CounterType.P1P1, 3), "Then if it has three or more +1/+1 counters on it, sacrifice {this}")); this.addAbility(ability); // When you sacrifice Ordeal of Nylea, search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library. ability = new SacrificeSourceTriggeredAbility( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0,2, StaticFilters.FILTER_CARD_BASIC_LAND),true, true),false); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature != null) { Effect effect = new AddCountersAttachedEffect(CounterType.P1P0.createInstance(), "enchanted creature"); effect.apply(game, source); if (creature.getCounters(game).getCount(CounterType.P1P0) > 2) { Player player = game.getPlayer(creature.getControllerId()); if (player != null) { player.damage(creature.getPower().getValue(), creature.getId(), game, false, true); } effect = new DestroyTargetEffect(true); effect.setTargetPointer(new FixedTarget(creature, game)); effect.apply(game, source); return true; } } return false; } }