mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[ZNR] Implemented Taborax, Hope's Demise
This commit is contained in:
parent
f467bba780
commit
b5370ecf32
2 changed files with 116 additions and 0 deletions
115
Mage.Sets/src/mage/cards/t/TaboraxHopesDemise.java
Normal file
115
Mage.Sets/src/mage/cards/t/TaboraxHopesDemise.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TaboraxHopesDemise extends CardImpl {
|
||||
|
||||
private static final Condition condition = new SourceHasCounterCondition(CounterType.P1P1, 5);
|
||||
private static final FilterPermanent filter
|
||||
= new FilterCreaturePermanent("another nontoken creature you control");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(Predicates.not(TokenPredicate.instance));
|
||||
}
|
||||
|
||||
public TaboraxHopesDemise(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Taborax, Hope's Demise has lifelink as long as it has five or more +1/+1 counters on it.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||
new GainAbilitySourceEffect(LifelinkAbility.getInstance()), condition,
|
||||
"{this} has lifelink as long as it has five or more +1/+1 counters on it"
|
||||
)));
|
||||
|
||||
// Whenever another nontoken creature you control dies, put a +1/+1 counter on Taborax. If that creature was a Cleric, you may draw a card. If you do, you lose 1 life.
|
||||
Ability ability = new DiesCreatureTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
|
||||
false, filter, true
|
||||
);
|
||||
ability.addEffect(new TaboraxHopesDemiseEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private TaboraxHopesDemise(final TaboraxHopesDemise card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaboraxHopesDemise copy() {
|
||||
return new TaboraxHopesDemise(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TaboraxHopesDemiseEffect extends OneShotEffect {
|
||||
|
||||
TaboraxHopesDemiseEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "If that creature was a Cleric, you may draw a card. If you do, you lose 1 life.";
|
||||
}
|
||||
|
||||
private TaboraxHopesDemiseEffect(final TaboraxHopesDemiseEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaboraxHopesDemiseEffect copy() {
|
||||
return new TaboraxHopesDemiseEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null || !permanent.hasSubtype(SubType.CLERIC, game)) {
|
||||
return false;
|
||||
}
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null && player.chooseUse(
|
||||
outcome, "Draw a card and lose 1 life?", source, game
|
||||
) && player.drawCards(1, source.getSourceId(), game) > 0) {
|
||||
player.loseLife(1, game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -362,6 +362,7 @@ public final class ZendikarRising extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Swarm Shambler", 207, Rarity.RARE, mage.cards.s.SwarmShambler.class));
|
||||
cards.add(new SetCardInfo("Synchronized Spellcraft", 168, Rarity.COMMON, mage.cards.s.SynchronizedSpellcraft.class));
|
||||
cards.add(new SetCardInfo("Taborax, Hope's Demise", 129, Rarity.RARE, mage.cards.t.TaboraxHopesDemise.class));
|
||||
cards.add(new SetCardInfo("Tajuru Blightblade", 208, Rarity.COMMON, mage.cards.t.TajuruBlightblade.class));
|
||||
cards.add(new SetCardInfo("Tajuru Paragon", 209, Rarity.RARE, mage.cards.t.TajuruParagon.class));
|
||||
cards.add(new SetCardInfo("Tajuru Snarecaster", 210, Rarity.COMMON, mage.cards.t.TajuruSnarecaster.class));
|
||||
|
|
Loading…
Reference in a new issue