mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Implement Gnarled Sage from Core 2021 (#6666)
This commit is contained in:
parent
096d44320d
commit
ab5daa026f
2 changed files with 73 additions and 0 deletions
72
Mage.Sets/src/mage/cards/g/GnarledSage.java
Normal file
72
Mage.Sets/src/mage/cards/g/GnarledSage.java
Normal 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 you’ve 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;
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue