@Override public BecomesCreatureTypeTargetEffect copy() { return new BecomesCreatureTypeTargetEffect(this); }
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 BoldwyrIntimidator(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}{R}"); this.subtype.add(SubType.GIANT, SubType.WARRIOR); this.power = new MageInt(5); this.toughness = new MageInt(5); // Cowards can't block Warriors. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoldwyrIntimidatorEffect())); // {R}: Target creature becomes a Coward until end of turn. Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.COWARD); effect.setText("Target creature becomes a Coward until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // {2}{R}: Target creature becomes a Warrior until end of turn. effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.WARRIOR); effect.setText("Target creature becomes a Warrior until end of turn"); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
if (chosenType != null && !chosenType.isEmpty()) { ContinuousEffect effect = new BecomesCreatureTypeTargetEffect(duration, SubType.byDescription(chosenType)); effect.setTargetPointer(new FixedTarget(getTargetPointer().getFirst(game, source))); game.addEffect(effect, source);
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID cardId = this.getTargetPointer().getFirst(game, source); new ReturnFromGraveyardToBattlefieldTargetEffect().apply(game, source); Permanent permanent = game.getPermanent(cardId); if (permanent != null) { ContinuousEffectImpl effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, SubType.NIGHTMARE, false); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Card card = game.getCard(source.getSourceId()); String chosenType = ""; if (player != null && card != null) { Choice typeChoice = new ChoiceCreatureType(); String msg = "Choose a creature type"; typeChoice.setMessage(msg); while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { if (!player.canRespond()) { return false; } } game.informPlayers(card.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); chosenType = typeChoice.getChoice(); if (chosenType != null && !chosenType.isEmpty()) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { ContinuousEffect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, SubType.byDescription(chosenType)); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); } return true; } } return false; }
public OliviaMobilizedForWar(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.KNIGHT); this.power = new MageInt(3); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever another creature enters the battlefield under your control, you may discard a card. If you do, put a +1/+1 counter on that creature, // it gains haste until end of turn, and it becomes a Vampire in addition to its other types. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("put a +1/+1 counter on that creature"); DoIfCostPaid doIfCostPaid = new DoIfCostPaid(effect, new DiscardCardCost()); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect.setText(", it gains haste until end of turn,"); doIfCostPaid.addEffect(effect); effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, SubType.VAMPIRE, false); effect.setText("and it becomes a Vampire in addition to its other types"); doIfCostPaid.addEffect(effect); this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, doIfCostPaid, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, false, SetTargetPointer.PERMANENT, null)); }