fix text: Silverskin Armor

This commit is contained in:
xenohedron 2023-06-25 15:11:02 -04:00
parent 98e40b2a8b
commit 5722ae27f6
3 changed files with 13 additions and 18 deletions

View file

@ -2,6 +2,8 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.AddCardTypeAttachedEffect; import mage.abilities.effects.common.continuous.AddCardTypeAttachedEffect;
@ -22,8 +24,9 @@ public final class SilverskinArmor extends CardImpl {
this.subtype.add(SubType.EQUIPMENT); this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+1 and is an artifact in addition to its other types. // Equipped creature gets +1/+1 and is an artifact in addition to its other types.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1, Duration.WhileOnBattlefield))); Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(1, 1));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddCardTypeAttachedEffect(CardType.ARTIFACT, Duration.WhileOnBattlefield, AttachmentType.EQUIPMENT))); ability.addEffect(new AddCardTypeAttachedEffect(CardType.ARTIFACT, AttachmentType.EQUIPMENT));
this.addAbility(ability);
// Equip {2} // Equip {2}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{2}"), false)); this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{2}"), false));

View file

@ -7,7 +7,6 @@ import mage.abilities.Ability;
import mage.abilities.common.LicidAbility; import mage.abilities.common.LicidAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.AddCardTypeAttachedEffect; import mage.abilities.effects.common.continuous.AddCardTypeAttachedEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -15,8 +14,6 @@ import mage.cards.CardSetInfo;
import mage.constants.AttachmentType; import mage.constants.AttachmentType;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Zone;
/** /**
* *
@ -34,10 +31,8 @@ public final class TransmogrifyingLicid extends CardImpl {
this.addAbility(new LicidAbility(new GenericManaCost(1), new GenericManaCost(1))); this.addAbility(new LicidAbility(new GenericManaCost(1), new GenericManaCost(1)));
// Enchanted creature gets +1/+1 and is an artifact in addition to its other types. // Enchanted creature gets +1/+1 and is an artifact in addition to its other types.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); Ability ability = new SimpleStaticAbility(new BoostEnchantedEffect(1, 1));
Effect effect = new AddCardTypeAttachedEffect(CardType.ARTIFACT, Duration.WhileOnBattlefield, AttachmentType.AURA); ability.addEffect(new AddCardTypeAttachedEffect(CardType.ARTIFACT, AttachmentType.AURA));
effect.setText("and is an artifact in addition to its other types");
ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -6,6 +6,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.*; import mage.constants.*;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/** /**
* @author nantuko * @author nantuko
@ -15,11 +16,13 @@ public class AddCardTypeAttachedEffect extends ContinuousEffectImpl {
private final CardType addedCardType; private final CardType addedCardType;
private final AttachmentType attachmentType; private final AttachmentType attachmentType;
public AddCardTypeAttachedEffect(CardType addedCardType, Duration duration, AttachmentType attachmentType) { public AddCardTypeAttachedEffect(CardType addedCardType, AttachmentType attachmentType) {
super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
this.addedCardType = addedCardType; this.addedCardType = addedCardType;
this.attachmentType = attachmentType; this.attachmentType = attachmentType;
setText(); staticText = "and is " +
CardUtil.addArticle(CardUtil.getTextWithFirstCharLowerCase(addedCardType.toString())) +
" in addition to its other types";
} }
public AddCardTypeAttachedEffect(final AddCardTypeAttachedEffect effect) { public AddCardTypeAttachedEffect(final AddCardTypeAttachedEffect effect) {
@ -45,10 +48,4 @@ public class AddCardTypeAttachedEffect extends ContinuousEffectImpl {
return new AddCardTypeAttachedEffect(this); return new AddCardTypeAttachedEffect(this);
} }
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append(attachmentType.verb());
sb.append(" creature becomes ").append(addedCardType.toString()).append(" in addition to its other types"); //TODO add attacked card type detection
staticText = sb.toString();
}
} }