forked from External/mage
[AFR] Implemented Dancing Sword
This commit is contained in:
parent
56d353b53b
commit
9d9c8bf5ab
2 changed files with 114 additions and 0 deletions
113
Mage.Sets/src/mage/cards/d/DancingSword.java
Normal file
113
Mage.Sets/src/mage/cards/d/DancingSword.java
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DancingSword extends CardImpl {
|
||||
|
||||
public DancingSword(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}");
|
||||
|
||||
this.subtype.add(SubType.EQUIPMENT);
|
||||
|
||||
// Equipped creature gets +2/+1.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 1)));
|
||||
|
||||
// When equipped creature dies, you may have Dancing Sword become a 2/1 Construct artifact creature with flying and ward {1}. If you do, it isn't an Equipment.
|
||||
this.addAbility(new DiesAttachedTriggeredAbility(
|
||||
new DancingSwordEffect(), "equipped creature", true
|
||||
));
|
||||
|
||||
// Equip {1}
|
||||
this.addAbility(new EquipAbility(1));
|
||||
}
|
||||
|
||||
private DancingSword(final DancingSword card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DancingSword copy() {
|
||||
return new DancingSword(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DancingSwordEffect extends ContinuousEffectImpl {
|
||||
|
||||
DancingSwordEffect() {
|
||||
super(Duration.Custom, Outcome.Benefit);
|
||||
staticText = "you may have {this} become a 2/1 Construct artifact creature " +
|
||||
"with flying and ward {1}. If you do, it isn't an Equipment";
|
||||
}
|
||||
|
||||
private DancingSwordEffect(final DancingSwordEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DancingSwordEffect copy() {
|
||||
return new DancingSwordEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) {
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
permanent.getCardType().clear();
|
||||
permanent.getCardType().add(CardType.ARTIFACT);
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.removeAllSubTypes(game);
|
||||
permanent.addSubType(game, SubType.CONSTRUCT);
|
||||
return true;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
permanent.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game);
|
||||
permanent.addAbility(new WardAbility(new GenericManaCost(1)), source.getSourceId(), game);
|
||||
return true;
|
||||
case PTChangingEffects_7:
|
||||
if (sublayer == SubLayer.SetPT_7b) {
|
||||
permanent.getPower().setValue(2);
|
||||
permanent.getToughness().setValue(1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
case PTChangingEffects_7:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -57,6 +57,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Cloister Gargoyle", 7, Rarity.UNCOMMON, mage.cards.c.CloisterGargoyle.class));
|
||||
cards.add(new SetCardInfo("Compelled Duel", 178, Rarity.COMMON, mage.cards.c.CompelledDuel.class));
|
||||
cards.add(new SetCardInfo("Contact Other Plane", 52, Rarity.COMMON, mage.cards.c.ContactOtherPlane.class));
|
||||
cards.add(new SetCardInfo("Dancing Sword", 8, Rarity.RARE, mage.cards.d.DancingSword.class));
|
||||
cards.add(new SetCardInfo("Dawnbringer Cleric", 9, Rarity.COMMON, mage.cards.d.DawnbringerCleric.class));
|
||||
cards.add(new SetCardInfo("Deadly Dispute", 94, Rarity.COMMON, mage.cards.d.DeadlyDispute.class));
|
||||
cards.add(new SetCardInfo("Death-Priest of Myrkul", 95, Rarity.UNCOMMON, mage.cards.d.DeathPriestOfMyrkul.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue