forked from External/mage
69 lines
2.4 KiB
Java
69 lines
2.4 KiB
Java
|
|
package mage.cards.g;
|
|
|
|
import java.util.UUID;
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.common.AttachableToRestrictedAbility;
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.costs.mana.GenericManaCost;
|
|
import mage.abilities.effects.Effect;
|
|
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
|
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
|
import mage.abilities.keyword.EquipAbility;
|
|
import mage.abilities.keyword.TrampleAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.AttachmentType;
|
|
import mage.constants.CardType;
|
|
import mage.constants.SubType;
|
|
import mage.constants.ComparisonType;
|
|
import mage.constants.Outcome;
|
|
import mage.constants.Zone;
|
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
|
import mage.filter.predicate.mageobject.ToughnessPredicate;
|
|
import mage.target.Target;
|
|
import mage.target.common.TargetControlledCreaturePermanent;
|
|
|
|
/**
|
|
*
|
|
* @author LevelX2
|
|
*/
|
|
public final class GateSmasher extends CardImpl {
|
|
|
|
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature with toughness 4 or greater");
|
|
|
|
static {
|
|
filter.add(new ToughnessPredicate(ComparisonType.MORE_THAN, 3));
|
|
}
|
|
|
|
public GateSmasher(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
|
this.subtype.add(SubType.EQUIPMENT);
|
|
|
|
Target target = new TargetControlledCreaturePermanent(1, 1, filter, false);
|
|
// Gate Smasher can be attached only to a creature with toughness 4 or greater.
|
|
this.addAbility(new AttachableToRestrictedAbility(target));
|
|
|
|
// Equipped creature gets +3/+0 and has trample.
|
|
Effect effect = new BoostEquippedEffect(3, 0);
|
|
effect.setText("Equipped creature gets +3/+0");
|
|
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
|
|
effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT);
|
|
effect.setText("and has trample");
|
|
ability.addEffect(effect);
|
|
this.addAbility(ability);
|
|
|
|
// Equip {3}
|
|
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3), target, false));
|
|
|
|
}
|
|
|
|
private GateSmasher(final GateSmasher card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public GateSmasher copy() {
|
|
return new GateSmasher(this);
|
|
}
|
|
}
|