@Override public AddCardSubTypeTargetEffect copy() { return new AddCardSubTypeTargetEffect(this); }
public SenseiGoldenTail(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.FOX); this.subtype.add(SubType.SAMURAI); this.power = new MageInt(2); this.toughness = new MageInt(1); // Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.) this.addAbility(new BushidoAbility(1)); // {1}{W}, {T}: Put a training counter on target creature. // That creature gains bushido 1 and becomes a Samurai in addition to its other creature types. // Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility( Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.TRAINING.createInstance()), new ManaCostsImpl("{1}{W}") ); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); ability.addEffect(new GainAbilityTargetEffect( new BushidoAbility(1), Duration.Custom) .setText("That creature gains bushido 1") ); ability.addEffect( new AddCardSubTypeTargetEffect(SubType.SAMURAI, Duration.Custom) .setText("and becomes a Samurai in addition to its other creature types.") ); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); if (target != null) { if (!target.hasSubtype(addedSubType, game)) { target.getSubtype(game).add(addedSubType); } } else { if (duration == Duration.Custom) { discard(); } } return false; }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent sourceCreature = game.getPermanent(source.getSourceId()); Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (sourceCreature != null && creature != null) { int power = sourceCreature.getPower().getValue(); if (power > 0) { creature.addCounters(CounterType.P1P1.createInstance(power), source, game); } ContinuousEffect effect = new AddCardSubTypeTargetEffect(SubType.MUTANT, Duration.Custom); effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1)); game.addEffect(effect, source); } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game) && card.isCreature()) { Permanent creature = game.getPermanent(card.getId()); ContinuousEffect effect = new AddCardSubTypeTargetEffect(SubType.ZOMBIE, Duration.WhileOnBattlefield); effect.setTargetPointer(new FixedTarget(creature.getId())); game.addEffect(effect, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { Choice typeChoice = new ChoiceCreatureType(permanent); if (!player.choose(Outcome.Detriment, typeChoice, game)) { return false; } game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); ContinuousEffect effect = new AddCardSubTypeTargetEffect(SubType.byDescription(typeChoice.getChoice()), Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); } return false; }
public OliviaVoldaren(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(3); this.toughness = new MageInt(3); String rule = "Gain control of target Vampire for as long as you control {this}"; FilterPermanent filter2 = new FilterPermanent(); filter2.add(new ControllerPredicate(TargetController.YOU)); filter2.add(new CardIdPredicate(this.getId())); this.addAbility(FlyingAbility.getInstance()); // {1}{R}: Olivia Voldaren deals 1 damage to another target creature. That creature becomes a Vampire in addition to its other types. Put a +1/+1 counter on Olivia Voldaren. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}")); ability.addTarget(new TargetCreaturePermanent(filter)); Effect effect = new AddCardSubTypeTargetEffect(SubType.VAMPIRE, Duration.WhileOnBattlefield); effect.setText("That creature becomes a Vampire in addition to its other types"); ability.addEffect(effect); ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); this.addAbility(ability); // {3}{B}{B}: Gain control of target Vampire for as long as you control Olivia Voldaren. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new PermanentsOnTheBattlefieldCondition(filter2), rule), new ManaCostsImpl("{3}{B}{B}")); ability2.addTarget(new TargetCreaturePermanent(vampireFilter)); this.addAbility(ability2); }