use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.
the class MercurialTransformationEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Token token;
if (player.chooseUse(outcome, "1/1 Frog or 4/4 Octopus?", null, "Frog", "Octopus", source, game)) {
token = new CreatureToken(1, 1).withColor("U").withSubType(SubType.FROG);
} else {
token = new CreatureToken(4, 4).withColor("U").withSubType(SubType.OCTOPUS);
}
game.addEffect(new BecomesCreatureTargetEffect(token, true, false, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.
the class NissaOfShadowedBoughsCreatureEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.chooseUse(Outcome.BecomeCreature, "Have it become a creature?", source, game)) {
return false;
}
game.addEffect(new BecomesCreatureTargetEffect(new CreatureToken(3, 3, "", SubType.ELEMENTAL).withAbility(HasteAbility.getInstance()).withAbility(new MenaceAbility()), false, true, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.
the class NissaWorldwakerToken method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_BASIC_LAND);
if (controller.searchLibrary(target, source, game)) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardId, game);
if (card != null) {
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
Permanent land = game.getPermanent(card.getId());
if (land != null) {
ContinuousEffect effect = new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom);
effect.setTargetPointer(new FixedTarget(land, game));
game.addEffect(effect, source);
}
}
}
}
}
}
controller.shuffleLibrary(source, game);
return true;
}
use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.
the class LifecraftAwakeningToken method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
if (!permanent.isCreature(game) && !permanent.hasSubtype(SubType.VEHICLE, game)) {
ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom);
continuousEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(continuousEffect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect in project mage by magefree.
the class HuntingWildsToken method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Effect sourceEffect : source.getEffects()) {
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets());
if (!foundCards.isEmpty()) {
FixedTargets fixedTargets = new FixedTargets(foundCards, game);
UntapTargetEffect untapEffect = new UntapTargetEffect();
untapEffect.setTargetPointer(fixedTargets);
untapEffect.apply(game, source);
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
becomesCreatureEffect.setTargetPointer(fixedTargets);
game.addEffect(becomesCreatureEffect, source);
}
return true;
}
}
return false;
}
Aggregations