@Override public GainControlTargetEffect copy() { return new GainControlTargetEffect(this); }
@Override public void init(Ability source, Game game) { super.init(source, game); // save target id to be available for hidden state based triggered effect game.getState().setValue("target" + source.getSourceId(), getTargetPointer().getFirst(game, source)); }
@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 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)); }
if (controller != null) { boolean targetStillExists = false; for (UUID permanentId : getTargetPointer().getTargets(game, source)) { Permanent permanent = game.getPermanent(permanentId); if (permanent != null) { discard();
public MassManipulation(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{U}{U}{U}{U}"); // Gain control of X target creatures and/or planeswalkers. this.getSpellAbility().addEffect( new GainControlTargetEffect(Duration.Custom, true) .setText("Gain control of X target creatures and/or planeswalkers.") ); this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); this.getSpellAbility().setTargetAdjuster(MassManipulationAdjuster.instance); }
public TolarianEntrancerDelayedTriggeredAbility() { super(new GainControlTargetEffect(Duration.EndOfGame)); }
public GripOfPhyresis(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); // Gain control of target Equipment, then create a 0/0 black Germ creature token and attach that Equipment to it. GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true); effect.setText("Gain control of target equipment"); this.getSpellAbility().addEffect(effect); Target targetEquipment = new TargetPermanent(filter); this.getSpellAbility().addTarget(targetEquipment); this.getSpellAbility().addEffect(new GripOfPhyresisEffect()); }
GainControlTargetEffect eff = new GainControlTargetEffect(Duration.Custom, true); eff.setTargetPointer(new FixedTarget(target)); game.addEffect(eff, source);
@Override public void init(Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int maxToughness = 2; ManaCosts manaCosts = source.getManaCostsToPay(); if (!manaCosts.getVariableCosts().isEmpty()) { maxToughness = source.getManaCostsToPay().getX(); } Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null && permanent.getToughness().getValue() > maxToughness) { this.discard(); return; } } super.init(source, game); }
@Override public boolean apply(Game game, Ability source) { ConditionalContinuousEffect effect = new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), SourceOnBattlefieldCondition.instance, "gain control of target creature for as long as {this} remains on the battlefield"); game.addEffect(effect, source); return false; } }
public Threaten(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap target creature")); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn).setText("and gain control of it until end of turn")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn.")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }
super.controllingPlayerId = winner.getId(); super.init(source, game);
public RiptideEntrancerTriggeredAbility() { super(Zone.BATTLEFIELD, new DoIfCostPaid( new GainControlTargetEffect(Duration.Custom), new SacrificeSourceCost() ), true); }
public Disharmony(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); // Cast Disharmony only during combat before blockers are declared. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, BeforeBlockersAreDeclaredCondition.instance)); // Untap target attacking creature and remove it from combat. Gain control of that creature until end of turn. this.getSpellAbility().addEffect(new UntapTargetEffect()); this.getSpellAbility().addEffect(new RemoveFromCombatTargetEffect().setText("and remove it from combat.")); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn, true).setText("Gain control of that creature until end of turn.")); this.getSpellAbility().addTarget(new TargetAttackingCreature()); }
public SithMindseer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}{B}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SITH); this.power = new MageInt(3); this.toughness = new MageInt(3); // <i>Hate</i> — When Sith Mindseer enters the battlefield, if an opponent loses life from a source other than combat damage, gain control of target creature for as long as Sith Mindseer remains on the battlefield. Ability ability = new ConditionalInterveningIfTriggeredAbility( new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.WhileOnBattlefield)), HateCondition.instance, "<i>Hate</i> — When Sith Mindseer enters the battlefield, if an opponent loses life from a source other than combat damage, gain control of target creature for as long as Sith Mindseer remains on the battlefield."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); }
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); }
public BeguilerOfWills(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}"); this.subtype.add(SubType.HUMAN, SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}: Gain control of target creature with power less than or equal to the number of creatures you control. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.Custom), new TapSourceCost()); ability.addTarget(new BeguilerOfWillsTarget()); this.addAbility(ability); }
public BlindWithAnger(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); this.subtype.add(SubType.ARCANE); this.getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap target nonlegendary creature")); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn).setText("and gain control of it until end of turn")); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setText("It gains haste until end of turn.")); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); }
public RootwaterMatriarch(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}"); this.subtype.add(SubType.MERFOLK); this.power = new MageInt(2); this.toughness = new MageInt(3); // {T}: Gain control of target creature for as long as that creature is enchanted ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), EnchantedTargetCondition.instance, "Gain control of target creature for as long as that creature is enchanted"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }