use of mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect in project mage by magefree.
the class LorcanWarlockCollectorReplacementEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (player == null || card == null) {
return false;
}
Cost cost = new PayLifeCost(card.getManaValue());
if (!cost.canPay(source, source, source.getControllerId(), game) || !cost.pay(source, game, source, source.getControllerId(), true)) {
return false;
}
game.addEffect(new AddCardSubTypeTargetEffect(SubType.WARLOCK, Duration.Custom).setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)), source);
player.moveCards(card, Zone.BATTLEFIELD, source, game);
return true;
}
use of mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect in project mage by magefree.
the class AscentOfTheWorthyReturnEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card card = game.getCard(source.getFirstTarget());
if (player == null || card == null) {
return false;
}
player.moveCards(card, Zone.BATTLEFIELD, source, game);
Permanent permanent = game.getPermanent(card.getId());
if (permanent == null) {
return false;
}
permanent.addCounters(CounterType.FLYING.createInstance(), source.getControllerId(), source, game);
game.addEffect(new AddCardSubTypeTargetEffect(SubType.ANGEL, Duration.Custom).setTargetPointer(new FixedTarget(permanent, game)), source);
game.addEffect(new AddCardSubTypeTargetEffect(SubType.WARRIOR, Duration.Custom).setTargetPointer(new FixedTarget(permanent, game)), source);
return true;
}
use of mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect in project mage by magefree.
the class MasterBiomancerEntersBattlefieldEffect method replaceEvent.
@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.getControllerId(), 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;
}
use of mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect in project mage by magefree.
the class MinscBelovedRangerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = source.getManaCostsToPay().getX();
game.addEffect(new SetPowerToughnessTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
game.addEffect(new AddCardSubTypeTargetEffect(SubType.GIANT, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect in project mage by magefree.
the class LimDulTheNecromancerEffect method apply.
@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(game)) {
Permanent creature = game.getPermanent(card.getId());
ContinuousEffect effect = new AddCardSubTypeTargetEffect(SubType.ZOMBIE, Duration.WhileOnBattlefield);
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}
Aggregations