diff --git a/Mage.Sets/src/mage/cards/a/AnimalAttendant.java b/Mage.Sets/src/mage/cards/a/AnimalAttendant.java new file mode 100644 index 00000000000..799ee283f4a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AnimalAttendant.java @@ -0,0 +1,68 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.counter.AddCounterEnteringCreatureEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.constants.SubType; +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.watchers.Watcher; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author muz + */ +public final class AnimalAttendant extends CardImpl { + + public AnimalAttendant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.CITIZEN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {T}: Add one mana of any color. If that mana is spent to cast a non-Human creature spell, that creature enters with an additional +1/+1 counter on it. + Ability ability = new AnyColorManaAbility(new TapSourceCost(), true); + ability.getEffects().get(0).setText("Add one mana of any color. If that mana is spent to cast a non-Human creature spell, that creature enters with an additional +1/+1 counter on it"); + this.addAbility(ability, new AnimalAttendantWatcher()); + } + + private AnimalAttendant(final AnimalAttendant card) { + super(card); + } + + @Override + public AnimalAttendant copy() { + return new AnimalAttendant(this); + } +} +class AnimalAttendantWatcher extends Watcher { + + AnimalAttendantWatcher() { + super(WatcherScope.CARD); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.MANA_PAID) { + Spell target = game.getSpell(event.getTargetId()); + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId()) + && target != null && target.isCreature(game) && !target.hasSubtype(SubType.HUMAN, game) + && event.getFlag()) { + game.getState().addEffect(new AddCounterEnteringCreatureEffect(new MageObjectReference(target.getCard(), game)), + target.getSpellAbility()); + } + } + } +} diff --git a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java index a7b26312367..5575a383fde 100644 --- a/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java +++ b/Mage.Sets/src/mage/sets/AvatarTheLastAirbenderEternal.java @@ -35,6 +35,7 @@ public final class AvatarTheLastAirbenderEternal extends ExpansionSet { cards.add(new SetCardInfo("Agent of Treachery", 9, Rarity.MYTHIC, mage.cards.a.AgentOfTreachery.class)); cards.add(new SetCardInfo("Air Nomad Student", 75, Rarity.UNCOMMON, mage.cards.a.AirNomadStudent.class)); cards.add(new SetCardInfo("Allied Teamwork", 213, Rarity.RARE, mage.cards.a.AlliedTeamwork.class)); + cards.add(new SetCardInfo("Animal Attendant", 128, Rarity.UNCOMMON, mage.cards.a.AnimalAttendant.class)); cards.add(new SetCardInfo("Appa, Aang's Companion", 214, Rarity.UNCOMMON, mage.cards.a.AppaAangsCompanion.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Appa, Aang's Companion", 268, Rarity.UNCOMMON, mage.cards.a.AppaAangsCompanion.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Appa, the Vigilant", 62, Rarity.RARE, mage.cards.a.AppaTheVigilant.class));