Merge pull request #5963 from jmharmon/master

Fixed minor errors for ELD cards
This commit is contained in:
Evan Kranzler 2019-09-05 15:24:00 -04:00 committed by GitHub
commit 2e5e224c93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 17 deletions

View file

@ -31,6 +31,7 @@ public final class CrystalSlipper extends CardImpl {
ability.addEffect(new GainAbilityAttachedEffect(
HasteAbility.getInstance(), AttachmentType.EQUIPMENT).setText("and has haste")
);
this.addAbility(ability);
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -1,14 +1,16 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.permanent.token.TokenImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
@ -30,8 +32,7 @@ public final class WishfulMerfolk extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// {1}{U}: Wishful Merfolk loses defender and becomes a Human until end of turn.
//this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WishfulMerfolkEffect(), new ManaCostsImpl("{1}{U}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new WishfulMerfolkToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WishfulMerfolkEffect(), new ManaCostsImpl("{1}{U}")));
}
public WishfulMerfolk(final WishfulMerfolk card) {
@ -44,22 +45,52 @@ public final class WishfulMerfolk extends CardImpl {
}
}
class WishfulMerfolkToken extends TokenImpl {
class WishfulMerfolkEffect extends ContinuousEffectImpl {
public WishfulMerfolkToken() {
super("Wishful Merfolk", "");
this.cardType.add(CardType.CREATURE);
this.subtype.add(SubType.HUMAN);
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
public WishfulMerfolkEffect() {
super(Duration.EndOfTurn, Outcome.AddAbility);
staticText = "{this} loses defender and becomes a Human until end of turn";
}
public WishfulMerfolkToken(final WishfulMerfolkToken token) {
super(token);
public WishfulMerfolkEffect(final WishfulMerfolkEffect effect) {
super(effect);
}
public WishfulMerfolkToken copy() {
return new WishfulMerfolkToken(this);
@Override
public WishfulMerfolkEffect copy() {
return new WishfulMerfolkEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
switch (layer) {
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
permanent.getAbilities().removeIf(entry -> entry.getId().equals(DefenderAbility.getInstance().getId()));
}
break;
case TypeChangingEffects_4:
if (permanent.getSubtype(game).contains(SubType.MERFOLK)) {
permanent.getSubtype(game).clear();
permanent.getSubtype(game).add(SubType.HUMAN);
}
break;
}
return true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.AbilityAddingRemovingEffects_6
|| layer == Layer.TypeChangingEffects_4;
}
}

View file

@ -1,4 +1,4 @@
package mage.game.permanent.token.custom;
package mage.game.permanent.token;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;