From 9fba8e4bc2ee72cdd797d572868d3ae79d981f37 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 3 Feb 2022 09:23:05 -0500 Subject: [PATCH] [NEO] Implemented Towashi Guide-Bot --- .../src/mage/cards/t/TowashiGuideBot.java | 89 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TowashiGuideBot.java diff --git a/Mage.Sets/src/mage/cards/t/TowashiGuideBot.java b/Mage.Sets/src/mage/cards/t/TowashiGuideBot.java new file mode 100644 index 00000000000..27ddb16b728 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TowashiGuideBot.java @@ -0,0 +1,89 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.CostAdjuster; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.ModifiedPredicate; +import mage.game.Game; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TowashiGuideBot extends CardImpl { + + public TowashiGuideBot(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + + this.subtype.add(SubType.CONSTRUCT); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Towashi Guide-Bot enters the battlefield, put a +1/+1 counter on target creature you control. + Ability ability = new EntersBattlefieldTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()) + ); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + + // {4}, {T}: Draw a card. This ability costs {1} less to activate for each modified creature you control. + ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new GenericManaCost(4)); + ability.addEffect(new InfoEffect("This ability costs {1} less to activate for each modified creature you control")); + ability.addCost(new TapSourceCost()); + ability.setCostAdjuster(TowashiGuideBotAdjuster.instance); + this.addAbility(ability.addHint(TowashiGuideBotAdjuster.getHint())); + } + + private TowashiGuideBot(final TowashiGuideBot card) { + super(card); + } + + @Override + public TowashiGuideBot copy() { + return new TowashiGuideBot(this); + } +} + +enum TowashiGuideBotAdjuster implements CostAdjuster { + instance; + private static final FilterPermanent filter = new FilterControlledCreaturePermanent(); + + static { + filter.add(ModifiedPredicate.instance); + } + + private static final Hint hint = new ValueHint( + "Modified creatures you control", new PermanentsOnBattlefieldCount(filter) + ); + + public static Hint getHint() { + return hint; + } + + @Override + public void adjustCosts(Ability ability, Game game) { + CardUtil.reduceCost(ability, game.getBattlefield().count( + filter, ability.getSourceId(), ability.getControllerId(), game + )); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 98c9fe2ad1b..c9f89d239fb 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -138,6 +138,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("The Wandering Emperor", 42, Rarity.MYTHIC, mage.cards.t.TheWanderingEmperor.class)); cards.add(new SetCardInfo("Thirst for Knowledge", 85, Rarity.UNCOMMON, mage.cards.t.ThirstForKnowledge.class)); cards.add(new SetCardInfo("Thousand-Faced Shadow", 86, Rarity.RARE, mage.cards.t.ThousandFacedShadow.class)); + cards.add(new SetCardInfo("Towashi Guide-Bot", 262, Rarity.UNCOMMON, mage.cards.t.TowashiGuideBot.class)); cards.add(new SetCardInfo("Twinshot Sniper", 168, Rarity.UNCOMMON, mage.cards.t.TwinshotSniper.class)); cards.add(new SetCardInfo("Unstoppable Ogre", 169, Rarity.COMMON, mage.cards.u.UnstoppableOgre.class)); cards.add(new SetCardInfo("Upriser Renegade", 170, Rarity.UNCOMMON, mage.cards.u.UpriserRenegade.class));