From e8e243db8c1f0e258e1b0b41d64be54fd850ed99 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 15 Aug 2023 21:02:01 -0400 Subject: [PATCH] Revert "[WOE] Implement Embereth Veteran" This reverts commit bd1b657e24350b0dc2a87ad2251cb31ea445e358. --- .../src/mage/cards/e/EmberethVeteran.java | 49 -------------- Mage.Sets/src/mage/sets/WildsOfEldraine.java | 1 - .../CreateRoleAttachedTargetEffect.java | 64 ------------------- .../main/java/mage/constants/RoleType.java | 34 ---------- .../src/main/java/mage/constants/SubType.java | 1 - .../permanent/token/YoungHeroRoleToken.java | 62 ------------------ 6 files changed, 211 deletions(-) delete mode 100644 Mage.Sets/src/mage/cards/e/EmberethVeteran.java delete mode 100644 Mage/src/main/java/mage/abilities/effects/common/CreateRoleAttachedTargetEffect.java delete mode 100644 Mage/src/main/java/mage/constants/RoleType.java delete mode 100644 Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java diff --git a/Mage.Sets/src/mage/cards/e/EmberethVeteran.java b/Mage.Sets/src/mage/cards/e/EmberethVeteran.java deleted file mode 100644 index 39f9d5fa41e..00000000000 --- a/Mage.Sets/src/mage/cards/e/EmberethVeteran.java +++ /dev/null @@ -1,49 +0,0 @@ -package mage.cards.e; - -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.CreateRoleAttachedTargetEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.RoleType; -import mage.constants.SubType; -import mage.filter.StaticFilters; -import mage.target.TargetPermanent; - -import java.util.UUID; - -/** - * @author TheElk801 - */ -public final class EmberethVeteran extends CardImpl { - - public EmberethVeteran(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); - - this.subtype.add(SubType.HUMAN); - this.subtype.add(SubType.KNIGHT); - this.power = new MageInt(2); - this.toughness = new MageInt(1); - - // {1}, Sacrifice Embereth Veteran: Create a Young Hero Role token attached to another target creature. - Ability ability = new SimpleActivatedAbility( - new CreateRoleAttachedTargetEffect(RoleType.YOUNG_HERO), new GenericManaCost(1) - ); - ability.addCost(new SacrificeSourceCost()); - ability.addTarget(new TargetPermanent(StaticFilters.FILTER_ANOTHER_TARGET_CREATURE)); - this.addAbility(ability); - } - - private EmberethVeteran(final EmberethVeteran card) { - super(card); - } - - @Override - public EmberethVeteran copy() { - return new EmberethVeteran(this); - } -} diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraine.java b/Mage.Sets/src/mage/sets/WildsOfEldraine.java index 9966fe410aa..39024f57726 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -21,7 +21,6 @@ public final class WildsOfEldraine extends ExpansionSet { this.hasBoosters = false; // temporary cards.add(new SetCardInfo("Cruel Somnophage", 222, Rarity.RARE, mage.cards.c.CruelSomnophage.class)); - cards.add(new SetCardInfo("Embereth Veteran", 127, Rarity.UNCOMMON, mage.cards.e.EmberethVeteran.class)); cards.add(new SetCardInfo("Forest", 266, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Glass Casket", 16, Rarity.UNCOMMON, mage.cards.g.GlassCasket.class)); cards.add(new SetCardInfo("Island", 263, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateRoleAttachedTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateRoleAttachedTargetEffect.java deleted file mode 100644 index 56cf5c63f5e..00000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateRoleAttachedTargetEffect.java +++ /dev/null @@ -1,64 +0,0 @@ -package mage.abilities.effects.common; - -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.OneShotEffect; -import mage.constants.Outcome; -import mage.constants.RoleType; -import mage.constants.SubType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; - -import java.util.UUID; - -/** - * @author TheElk801 - */ -public class CreateRoleAttachedTargetEffect extends OneShotEffect { - - private final RoleType roleType; - - public CreateRoleAttachedTargetEffect(RoleType roleType) { - super(Outcome.Benefit); - this.roleType = roleType; - } - - private CreateRoleAttachedTargetEffect(final CreateRoleAttachedTargetEffect effect) { - super(effect); - this.roleType = effect.roleType; - } - - @Override - public CreateRoleAttachedTargetEffect copy() { - return new CreateRoleAttachedTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent == null) { - return false; - } - Token token = roleType.createToken(); - token.putOntoBattlefield(1, game, source); - for (UUID tokenId : token.getLastAddedTokenIds()) { - Permanent aura = game.getPermanent(tokenId); - if (aura == null || !aura.hasSubtype(SubType.AURA, game)) { - continue; - } - aura.getAbilities().get(0).getTargets().get(0).add(source.getFirstTarget(), game); - aura.getAbilities().get(0).getEffects().get(0).apply(game, aura.getAbilities().get(0)); - } - return true; - } - - @Override - public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()) { - return staticText; - } - return "create a " + roleType.getName() + " Role token attached to " + - getTargetPointer().describeTargets(mode.getTargets(), "it"); - } -} diff --git a/Mage/src/main/java/mage/constants/RoleType.java b/Mage/src/main/java/mage/constants/RoleType.java deleted file mode 100644 index a52923cac4e..00000000000 --- a/Mage/src/main/java/mage/constants/RoleType.java +++ /dev/null @@ -1,34 +0,0 @@ -package mage.constants; - -import mage.game.permanent.token.Token; -import mage.game.permanent.token.YoungHeroRoleToken; - -import java.util.function.Supplier; - -/** - * @author TheElk801 - */ -public enum RoleType { - YOUNG_HERO("Young Hero", YoungHeroRoleToken::new); - - private final String name; - private final Supplier supplier; - - RoleType(String name, Supplier supplier) { - this.name = name; - this.supplier = supplier; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return name; - } - - public Token createToken() { - return supplier.get(); - } -} diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index e5f520c1d79..a04eec7225c 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -40,7 +40,6 @@ public enum SubType { CARTOUCHE("Cartouche", SubTypeSet.EnchantmentType), CLASS("Class", SubTypeSet.EnchantmentType), CURSE("Curse", SubTypeSet.EnchantmentType), - ROLE("Role", SubTypeSet.EnchantmentType), RUNE("Rune", SubTypeSet.EnchantmentType), SAGA("Saga", SubTypeSet.EnchantmentType), SHARD("Shard", SubTypeSet.EnchantmentType), diff --git a/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java b/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java deleted file mode 100644 index d73aaf07a81..00000000000 --- a/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java +++ /dev/null @@ -1,62 +0,0 @@ -package mage.game.permanent.token; - -import mage.abilities.Ability; -import mage.abilities.common.AttacksTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; -import mage.abilities.condition.common.SourceMatchesFilterCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.constants.*; -import mage.counters.CounterType; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.ToughnessPredicate; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; - -/** - * @author TheElk801 - */ -public final class YoungHeroRoleToken extends TokenImpl { - - private static final FilterPermanent filter = new FilterCreaturePermanent(); - - static { - filter.add(new ToughnessPredicate(ComparisonType.FEWER_THAN, 4)); - } - - private static final Condition condition = new SourceMatchesFilterCondition(filter); - - public YoungHeroRoleToken() { - super("Young Hero", "Young Hero Role token"); - cardType.add(CardType.ENCHANTMENT); - subtype.add(SubType.AURA); - subtype.add(SubType.ROLE); - - TargetPermanent auraTarget = new TargetCreaturePermanent(); - Ability ability = new EnchantAbility(auraTarget); - ability.addTarget(auraTarget); - ability.addEffect(new AttachEffect(Outcome.BoostCreature)); - this.addAbility(ability); - - // Enchanted creature has "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it." - this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect( - new ConditionalInterveningIfTriggeredAbility( - new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())), - condition, "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it." - ), AttachmentType.AURA - ))); - } - - private YoungHeroRoleToken(final YoungHeroRoleToken token) { - super(token); - } - - public YoungHeroRoleToken copy() { - return new YoungHeroRoleToken(this); - } -}