diff --git a/Mage.Sets/src/mage/cards/s/SokkaAndSuki.java b/Mage.Sets/src/mage/cards/s/SokkaAndSuki.java new file mode 100644 index 00000000000..ac50d9b86a7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SokkaAndSuki.java @@ -0,0 +1,85 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.AllyToken; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SokkaAndSuki extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.ALLY, "Ally"); + + public SokkaAndSuki(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{R}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARRIOR); + this.subtype.add(SubType.ALLY); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Sokka and Suki or another Ally you control enters, attach up to one target Equipment you control to that creature. + Ability ability = new EntersBattlefieldThisOrAnotherTriggeredAbility( + new SokkaAndSukiEffect(), filter, false, SetTargetPointer.PERMANENT, true + ); + ability.addTarget(new TargetPermanent( + 0, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT + )); + this.addAbility(ability); + + // Whenever an Equipment you control enters, create a 1/1 white Ally creature token. + this.addAbility(new EntersBattlefieldAllTriggeredAbility( + new CreateTokenEffect(new AllyToken()), StaticFilters.FILTER_CONTROLLED_PERMANENT_EQUIPMENT + )); + } + + private SokkaAndSuki(final SokkaAndSuki card) { + super(card); + } + + @Override + public SokkaAndSuki copy() { + return new SokkaAndSuki(this); + } +} + +class SokkaAndSukiEffect extends OneShotEffect { + + SokkaAndSukiEffect() { + super(Outcome.Benefit); + staticText = "attach up to one target Equipment you control to that creature"; + } + + private SokkaAndSukiEffect(final SokkaAndSukiEffect effect) { + super(effect); + } + + @Override + public SokkaAndSukiEffect copy() { + return new SokkaAndSukiEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = (Permanent) getValue("permanentEnteringBattlefield"); + Permanent equipment = game.getPermanent(getTargetPointer().getFirst(game, source)); + return creature != null && equipment != null && creature.addAttachment(equipment.getId(), source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java index b466256bcbc..e482455e95b 100644 --- a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java +++ b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java @@ -241,6 +241,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet { cards.add(new SetCardInfo("Sledding Otter-Penguin", 273, Rarity.COMMON, mage.cards.s.SleddingOtterPenguin.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Smellerbee, Rebel Fighter", 125, Rarity.RARE, mage.cards.s.SmellerbeeRebelFighter.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Smellerbee, Rebel Fighter", 198, Rarity.RARE, mage.cards.s.SmellerbeeRebelFighter.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Sokka and Suki", 71, Rarity.RARE, mage.cards.s.SokkaAndSuki.class)); cards.add(new SetCardInfo("Sokka's Charge", 66, Rarity.RARE, mage.cards.s.SokkasCharge.class)); cards.add(new SetCardInfo("Sokka's Sword Training", 84, Rarity.COMMON, mage.cards.s.SokkasSwordTraining.class)); cards.add(new SetCardInfo("Sokka, Wolf Cove's Protector", 219, Rarity.UNCOMMON, mage.cards.s.SokkaWolfCovesProtector.class, NON_FULL_USE_VARIOUS));