public RiptideEntrancerTriggeredAbility() { super(Zone.BATTLEFIELD, new DoIfCostPaid( new GainControlTargetEffect(Duration.Custom), new SacrificeSourceCost() ), true); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (super.apply(game, source) && permanent != null) { GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setTargetPointer(targetPointer); game.addEffect(effect, source); return true; } return false; } }
public MightMakesRight(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}"); // At the beginning of combat on your turn, if you control each creature on the battlefield with the greatest power, gain control // of target creature an opponent controls until end of turn. Untap that creature. It gains haste until end of turn. TriggeredAbility gainControlAbility = new BeginningOfCombatTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn), TargetController.YOU, false); gainControlAbility.addEffect(new UntapTargetEffect()); gainControlAbility.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); gainControlAbility.addTarget(new TargetCreaturePermanent(filter)); Ability conditionalAbility = new ConditionalInterveningIfTriggeredAbility(gainControlAbility, ControlsEachCreatureWithGreatestPowerCondition.instance, ruleText); this.addAbility(conditionalAbility); }
public Willbreaker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(2); this.toughness = new MageInt(3); // Whenever a creature an opponent controls becomes the target of a spell or ability you control, gain control of that creature for as long as you control Willbreaker. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null); effect.setText("gain control of that creature for as long as you control {this}"); this.addAbility(new WillbreakerTriggeredAbility(effect)); }
public LegacysAllure(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); // At the beginning of your upkeep, you may put a treasure counter on Legacy's Allure. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.TREASURE.createInstance(), true), TargetController.YOU, true)); // Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true), new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent(0, 0, filter, false)); ability.setTargetAdjuster(LegacysAllureAdjuster.instance); this.addAbility(ability); }
public EntrancingMelody(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); // Gain control of target creature with converted mana cost X. this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().setTargetAdjuster(EntrancingMelodyAdjuster.instance); }
public Evangelize(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}"); // Buyback {2}{W}{W} this.addAbility(new BuybackAbility("{2}{W}{W}")); // Gain control of target creature of an opponent's choice that he or she controls. GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setText("Gain control of target creature of an opponent's choice he or she controls"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetOpponentsChoicePermanent(1, 1, filter, false, true)); }
public Conscription(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); // Gain control of target creature with power 2 or less. It becomes a Trooper in addition to its other types. this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame)); this.getSpellAbility().addEffect(new BecomesCreatureTypeTargetEffect(Duration.EndOfGame, SubType.TROOPER, false) .setText("It becomes a Trooper in addition to its other types")); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); }
public GovernTheGuildless(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{U}"); // Gain control of target monocolored creature. this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // Forecast - {1}{U}, Reveal Govern the Guildless from your hand: Target creature becomes the color or colors of your choice until end of turn. ForecastAbility ability = new ForecastAbility(new BecomesColorTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public AuraGraft(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); // Gain control of target Aura that's attached to a permanent. Attach it to another permanent it can enchant. FilterPermanent filter = new FilterPermanent("Aura that's attached to a permanent"); filter.add(new SubtypePredicate(SubType.AURA)); filter.add(new AttachedToPermanentPredicate()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); Effect gainControlEffect = new GainControlTargetEffect(Duration.EndOfGame); this.getSpellAbility().addEffect(gainControlEffect); this.getSpellAbility().addEffect(new MoveTargetAuraEffect()); }
public ActOfAggression(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R/P}{R/P}"); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that creature")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn.")); }
public Hijack(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}"); // Gain control of target artifact or creature until end of turn. Untap it. It gains haste until end of turn. this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_CREATURE)); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); Effect effect = new UntapTargetEffect(); effect.setText("Untap it"); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect.setText("It gains haste until end of turn"); this.getSpellAbility().addEffect(effect); }
public MetallicMastery(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // Gain control of target artifact until end of turn. Untap that artifact. It gains haste until end of turn. this.getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that artifact")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn.")); }
public ActOfTreason(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // Gain control of target creature until end of turn. Untap that creature. // It gains haste until end of turn. (It can attack and {T} this turn.) this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap that creature")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn.")); }
public Wrangle(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); // Gain control of target creature with power 4 or less until end of turn. Untap that creature. It gains haste until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); Effect effect = new UntapTargetEffect(); effect.setText("Untap that creature"); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect.setText("It gains haste until end of turn"); this.getSpellAbility().addEffect(effect); }
public Goatnapper(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(2); this.toughness = new MageInt(2); Ability ability = new EntersBattlefieldTriggeredAbility(new UntapTargetEffect(), false); ability.addTarget(new TargetPermanent(filter)); ability.addEffect(new GainControlTargetEffect(Duration.EndOfTurn).setText("and gain control of it until end of turn")); ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn")); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { PlayerList players = game.getState().getPlayersInRange(source.getControllerId(), game); int count = players.size(); for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, players.get(RandomUtil.nextInt(count))); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); permanent.untap(game); } return true; }
public KariZevsExpertise(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); // Gain control of target creature or Vehicle until end of turn. Untap it. It gains haste until end of turn. this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gans haste until end of turn.")); // You may cast a card with converted mana cost 2 or less from your hand without paying its mana cost. this.getSpellAbility().addEffect(new CastWithoutPayingManaCostEffect(2)); }
public TraitorousBlood(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); // Gain control of target creature until end of turn. Untap it. It gains trample and haste until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn).setText("It gains trample")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("and hast until end of turn")); }
public Capture(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // Gain control of target creature until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); // Untap that creature. this.getSpellAbility().addEffect(new UntapTargetEffect()); // It gains haste until end of turn. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); // If it has a bounty counter on it, add {R}{R}{R} this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new BasicManaEffect(Mana.RedMana(3)), new TargetHasCounterCondition(CounterType.BOUNTY))); }