[NEO] Implemented Awakened Awareness

This commit is contained in:
Daniel Bomar 2022-02-01 10:34:06 -06:00
parent df093da63d
commit 2a3efadad0
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 106 additions and 2 deletions

View file

@ -0,0 +1,94 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.counter.AddCountersAttachedEffect;
import mage.constants.*;
import mage.abilities.effects.common.AttachEffect;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
/**
*
* @author weirddan455
*/
public final class AwakenedAwareness extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("artifact or creature");
static {
filter.add(Predicates.or(CardType.ARTIFACT.getPredicate(), CardType.CREATURE.getPredicate()));
}
public AwakenedAwareness(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{U}{U}");
this.subtype.add(SubType.AURA);
// Enchant artifact or creature
TargetPermanent auraTarget = new TargetPermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// When Awakened Awareness enters the battlefield, put X +1/+1 counters on enchanted permanent.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new AddCountersAttachedEffect(CounterType.P1P1.createInstance(), ManacostVariableValue.ETB, "enchanted permanent")
));
// As long as enchanted permanent is a creature, it has base power and toughness 1/1.
this.addAbility(new SimpleStaticAbility(new AwakenedAwarenessEffect()));
}
private AwakenedAwareness(final AwakenedAwareness card) {
super(card);
}
@Override
public AwakenedAwareness copy() {
return new AwakenedAwareness(this);
}
}
class AwakenedAwarenessEffect extends ContinuousEffectImpl {
public AwakenedAwarenessEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.UnboostCreature);
this.staticText = "As long as enchanted permanent is a creature, it has base power and toughness 1/1";
}
private AwakenedAwarenessEffect(final AwakenedAwarenessEffect effect) {
super(effect);
}
@Override
public AwakenedAwarenessEffect copy() {
return new AwakenedAwarenessEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = source.getSourcePermanentIfItStillExists(game);
if (enchantment != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null && creature.isCreature(game)) {
creature.getPower().setValue(1);
creature.getToughness().setValue(1);
return true;
}
}
return false;
}
}

View file

@ -34,6 +34,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Asari Captain", 215, Rarity.UNCOMMON, mage.cards.a.AsariCaptain.class)); cards.add(new SetCardInfo("Asari Captain", 215, Rarity.UNCOMMON, mage.cards.a.AsariCaptain.class));
cards.add(new SetCardInfo("Assassin's Ink", 87, Rarity.UNCOMMON, mage.cards.a.AssassinsInk.class)); cards.add(new SetCardInfo("Assassin's Ink", 87, Rarity.UNCOMMON, mage.cards.a.AssassinsInk.class));
cards.add(new SetCardInfo("Atsushi, the Blazing Sky", 134, Rarity.MYTHIC, mage.cards.a.AtsushiTheBlazingSky.class)); cards.add(new SetCardInfo("Atsushi, the Blazing Sky", 134, Rarity.MYTHIC, mage.cards.a.AtsushiTheBlazingSky.class));
cards.add(new SetCardInfo("Awakened Awareness", 47, Rarity.UNCOMMON, mage.cards.a.AwakenedAwareness.class));
cards.add(new SetCardInfo("Bamboo Grove Archer", 173, Rarity.COMMON, mage.cards.b.BambooGroveArcher.class)); cards.add(new SetCardInfo("Bamboo Grove Archer", 173, Rarity.COMMON, mage.cards.b.BambooGroveArcher.class));
cards.add(new SetCardInfo("Banishing Slash", 3, Rarity.UNCOMMON, mage.cards.b.BanishingSlash.class)); cards.add(new SetCardInfo("Banishing Slash", 3, Rarity.UNCOMMON, mage.cards.b.BanishingSlash.class));
cards.add(new SetCardInfo("Befriending the Moths", 4, Rarity.COMMON, mage.cards.b.BefriendingTheMoths.class)); cards.add(new SetCardInfo("Befriending the Moths", 4, Rarity.COMMON, mage.cards.b.BefriendingTheMoths.class));

View file

@ -74,12 +74,21 @@ public class AddCountersAttachedEffect extends OneShotEffect {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
// put a +1/+1 counter on it // put a +1/+1 counter on it
sb.append("put "); sb.append("put ");
if (counter.getCount() > 1) { boolean plural = true;
if (amount.toString().equals("X")) {
sb.append("X ");
} else if (counter.getCount() > 1) {
sb.append(CardUtil.numberToText(counter.getCount())).append(' '); sb.append(CardUtil.numberToText(counter.getCount())).append(' ');
} else { } else {
sb.append(CounterType.findArticle(counter.getName())).append(' '); sb.append(CounterType.findArticle(counter.getName())).append(' ');
plural = false;
}
sb.append(counter.getName().toLowerCase(Locale.ENGLISH));
if (plural) {
sb.append(" counters on ");
} else {
sb.append(" counter on ");
} }
sb.append(counter.getName().toLowerCase(Locale.ENGLISH)).append(" counter on ");
sb.append(textEnchanted); sb.append(textEnchanted);
if (!amount.getMessage().isEmpty()) { if (!amount.getMessage().isEmpty()) {
sb.append(" for each ").append(amount.getMessage()); sb.append(" for each ").append(amount.getMessage());