[TLE] Implement Animal Attendant (#14262)

This commit is contained in:
Muz 2026-01-17 11:55:44 -06:00 committed by GitHub
parent 7a280a5851
commit 4a9ccabc5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 69 additions and 0 deletions

View file

@ -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());
}
}
}
}

View file

@ -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));