Implement Tome Anima from Core 2021 (#6668)

* Implement Tome Anima from Core 2021

* newline at end of file
This commit is contained in:
arcox 2020-06-19 20:51:16 +00:00 committed by GitHub
parent 6b14c5a4d3
commit c22c93ea90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.CantBeBlockedSourceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.Game;
import mage.watchers.common.CardsDrawnThisTurnWatcher;
import java.util.UUID;
/**
* @author arcox
*/
public final class TomeAnima extends CardImpl {
public TomeAnima(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Tome Anima cant be blocked as long as youve drawn two or more cards this turn.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.WhileOnBattlefield),
TomeAnimaCondition.instance,
"{this} cant be blocked as long as youve drawn two or more cards this turn"
)), new CardsDrawnThisTurnWatcher());
}
private TomeAnima(final TomeAnima card) {
super(card);
}
@Override
public TomeAnima copy() {
return new TomeAnima(this);
}
}
enum TomeAnimaCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
CardsDrawnThisTurnWatcher watcher = game.getState().getWatcher(CardsDrawnThisTurnWatcher.class);
return watcher != null && watcher.getCardsDrawnThisTurn(source.getControllerId()) > 1;
}
}

View file

@ -272,6 +272,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Tide Skimmer", 79, Rarity.UNCOMMON, mage.cards.t.TideSkimmer.class));
cards.add(new SetCardInfo("Titanic Growth", 210, Rarity.COMMON, mage.cards.t.TitanicGrowth.class));
cards.add(new SetCardInfo("Tolarian Kraken", 80, Rarity.UNCOMMON, mage.cards.t.TolarianKraken.class));
cards.add(new SetCardInfo("Tome Anima", 81, Rarity.COMMON, mage.cards.t.TomeAnima.class));
cards.add(new SetCardInfo("Tormod's Crypt", 241, Rarity.UNCOMMON, mage.cards.t.TormodsCrypt.class));
cards.add(new SetCardInfo("Traitorous Greed", 166, Rarity.UNCOMMON, mage.cards.t.TraitorousGreed.class));
cards.add(new SetCardInfo("Tranquil Cove", 258, Rarity.COMMON, mage.cards.t.TranquilCove.class));