forked from External/mage
77 lines
3.1 KiB
Java
77 lines
3.1 KiB
Java
package mage.cards.b;
|
|
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.condition.Condition;
|
|
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
|
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
|
import mage.abilities.dynamicvalue.DynamicValue;
|
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
|
import mage.abilities.effects.common.AttachEffect;
|
|
import mage.abilities.effects.common.CreateTokenEffect;
|
|
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
|
import mage.abilities.hint.Hint;
|
|
import mage.abilities.hint.ValueHint;
|
|
import mage.abilities.keyword.ChannelAbility;
|
|
import mage.abilities.keyword.EnchantAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.CardType;
|
|
import mage.constants.Outcome;
|
|
import mage.constants.SubType;
|
|
import mage.filter.FilterPermanent;
|
|
import mage.filter.StaticFilters;
|
|
import mage.filter.common.FilterControlledPermanent;
|
|
import mage.filter.predicate.Predicates;
|
|
import mage.game.permanent.token.PilotCrewToken;
|
|
import mage.target.TargetPermanent;
|
|
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* @author TheElk801
|
|
*/
|
|
public final class BornToDrive extends CardImpl {
|
|
|
|
private static final FilterPermanent filter = new FilterControlledPermanent();
|
|
|
|
static {
|
|
filter.add(Predicates.or(
|
|
CardType.CREATURE.getPredicate(),
|
|
SubType.VEHICLE.getPredicate()
|
|
));
|
|
}
|
|
|
|
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter);
|
|
private static final Hint hint = new ValueHint("Creatures and Vehicles you control", xValue);
|
|
private static final Condition condition = new AttachedToMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_CREATURE);
|
|
|
|
public BornToDrive(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
|
|
|
this.subtype.add(SubType.AURA);
|
|
|
|
// Enchant artifact or creature
|
|
TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_CREATURE);
|
|
this.getSpellAbility().addTarget(auraTarget);
|
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
|
this.addAbility(new EnchantAbility(auraTarget));
|
|
|
|
// As long as enchanted permanent is a creature, it gets +1/+1 for each creature and/or Vehicle you control.
|
|
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
|
new BoostEnchantedEffect(xValue, xValue), condition, "as long as enchanted permanent " +
|
|
"is a creature, it gets +1/+1 for each creature and/or Vehicle you control"
|
|
)).addHint(hint));
|
|
|
|
// Channel — {2}{W}, Discard Born to Drive: Create two 1/1 colorless Pilot creature tokens with "This creature crews Vehicles as though its power were 2 greater."
|
|
this.addAbility(new ChannelAbility("{2}{W}", new CreateTokenEffect(new PilotCrewToken(), 2)));
|
|
}
|
|
|
|
private BornToDrive(final BornToDrive card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public BornToDrive copy() {
|
|
return new BornToDrive(this);
|
|
}
|
|
}
|