forked from External/mage
[NEC] Implemented Swift Reconfiguration
This commit is contained in:
parent
4b4174b00e
commit
5eb57d2283
2 changed files with 113 additions and 0 deletions
112
Mage.Sets/src/mage/cards/s/SwiftReconfiguration.java
Normal file
112
Mage.Sets/src/mage/cards/s/SwiftReconfiguration.java
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.CrewAbility;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SwiftReconfiguration extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or Vehicle");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
SubType.VEHICLE.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public SwiftReconfiguration(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
||||
// Enchant creature or Vehicle
|
||||
TargetPermanent auraTarget = new TargetPermanent(filter);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
|
||||
// Enchanted permanent is a Vehicle artifact with crew 5 and it loses all other card types.
|
||||
this.addAbility(new SimpleStaticAbility(new SwiftReconfigurationEffect()));
|
||||
}
|
||||
|
||||
private SwiftReconfiguration(final SwiftReconfiguration card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SwiftReconfiguration copy() {
|
||||
return new SwiftReconfiguration(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SwiftReconfigurationEffect extends ContinuousEffectImpl {
|
||||
|
||||
SwiftReconfigurationEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "enchanted permanent is a Vehicle artifact with crew 5 and it loses all other card types";
|
||||
}
|
||||
|
||||
private SwiftReconfigurationEffect(final SwiftReconfigurationEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SwiftReconfigurationEffect copy() {
|
||||
return new SwiftReconfigurationEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent aura = source.getSourcePermanentIfItStillExists(game);
|
||||
if (aura == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(aura.getAttachedTo());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.removeAllCardTypes(game);
|
||||
permanent.addCardType(game, CardType.ARTIFACT);
|
||||
permanent.addSubType(game, SubType.VEHICLE);
|
||||
return true;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
permanent.addAbility(new CrewAbility(5));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.TypeChangingEffects_4
|
||||
|| layer == Layer.AbilityAddingRemovingEffects_6;
|
||||
}
|
||||
}
|
||||
|
|
@ -133,6 +133,7 @@ public final class NeonDynastyCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Spire of Industry", 178, Rarity.RARE, mage.cards.s.SpireOfIndustry.class));
|
||||
cards.add(new SetCardInfo("Sram, Senior Edificer", 88, Rarity.RARE, mage.cards.s.SramSeniorEdificer.class));
|
||||
cards.add(new SetCardInfo("Starstorm", 110, Rarity.RARE, mage.cards.s.Starstorm.class));
|
||||
cards.add(new SetCardInfo("Swift Reconfiguration", 10, Rarity.RARE, mage.cards.s.SwiftReconfiguration.class));
|
||||
cards.add(new SetCardInfo("Swiftfoot Boots", 163, Rarity.UNCOMMON, mage.cards.s.SwiftfootBoots.class));
|
||||
cards.add(new SetCardInfo("Sword of Vengeance", 164, Rarity.RARE, mage.cards.s.SwordOfVengeance.class));
|
||||
cards.add(new SetCardInfo("Swords to Plowshares", 89, Rarity.UNCOMMON, mage.cards.s.SwordsToPlowshares.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue