Implement Gnarled Sage from Core 2021 (#6666)

This commit is contained in:
arcox 2020-06-18 22:06:56 +00:00 committed by GitHub
parent 096d44320d
commit ab5daa026f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.g;
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.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.ReachAbility;
import mage.abilities.keyword.VigilanceAbility;
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 GnarledSage extends CardImpl {
public GnarledSage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add(SubType.TREEFOLK);
this.subtype.add(SubType.DRUID);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(ReachAbility.getInstance());
// As long as youve drawn two or more cards this turn, Gnarled Sage gets +0/+2 and has vigilance.
Ability ability = new SimpleStaticAbility(
new ConditionalContinuousEffect(
new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield),
GnarledSageCondition.instance,
"As long as you've drawn two or more cards this turn, {this} gets +0/+2"
));
ability.addEffect(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield),
GnarledSageCondition.instance,
"and has vigilance"
));
this.addAbility(ability, new CardsDrawnThisTurnWatcher());
}
private GnarledSage(final GnarledSage card) {
super(card);
}
@Override
public GnarledSage copy() {
return new GnarledSage(this);
}
}
enum GnarledSageCondition 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

@ -122,6 +122,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Ghostly Pilferer", 52, Rarity.RARE, mage.cards.g.GhostlyPilferer.class));
cards.add(new SetCardInfo("Gloom Sower", 100, Rarity.COMMON, mage.cards.g.GloomSower.class));
cards.add(new SetCardInfo("Glorious Anthem", 21, Rarity.RARE, mage.cards.g.GloriousAnthem.class));
cards.add(new SetCardInfo("Gnarled Sage", 187, Rarity.COMMON, mage.cards.g.GnarledSage.class));
cards.add(new SetCardInfo("Goblin Arsonist", 147, Rarity.COMMON, mage.cards.g.GoblinArsonist.class));
cards.add(new SetCardInfo("Goblin Wizardry", 148, Rarity.COMMON, mage.cards.g.GoblinWizardry.class));
cards.add(new SetCardInfo("Goremand", 101, Rarity.UNCOMMON, mage.cards.g.Goremand.class));