[CLB] Implemented Sarevok, Deathbringer

This commit is contained in:
Evan Kranzler 2022-05-20 17:32:06 -04:00
parent 9ffc8ed11a
commit 50ddb27f5d
3 changed files with 79 additions and 1 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.ChooseABackgroundAbility;
import mage.abilities.condition.Condition;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.watchers.common.RevoltWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SarevokDeathbringer extends CardImpl {
private static final DynamicValue xValue = new SourcePermanentPowerCount(false);
public SarevokDeathbringer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// At the beginning of each player's end step, if no permanents left the battlefield this turn, that player loses X life, where X is Sarevok's power.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
new LoseLifeTargetEffect(xValue), TargetController.EACH_PLAYER,
SarevokDeathbringerCondition.instance, false
), new RevoltWatcher());
// Choose a Background
this.addAbility(ChooseABackgroundAbility.getInstance());
}
private SarevokDeathbringer(final SarevokDeathbringer card) {
super(card);
}
@Override
public SarevokDeathbringer copy() {
return new SarevokDeathbringer(this);
}
}
enum SarevokDeathbringerCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return RevoltWatcher.checkAny(game);
}
@Override
public String toString() {
return "if no permanents left the battlefield this turn";
}
}

View file

@ -90,6 +90,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
cards.add(new SetCardInfo("Raphael, Fiendish Savior", 292, Rarity.RARE, mage.cards.r.RaphaelFiendishSavior.class));
cards.add(new SetCardInfo("Reflecting Pool", 358, Rarity.RARE, mage.cards.r.ReflectingPool.class));
cards.add(new SetCardInfo("Roving Harper", 40, Rarity.COMMON, mage.cards.r.RovingHarper.class));
cards.add(new SetCardInfo("Sarevok, Deathbringer", 144, Rarity.UNCOMMON, mage.cards.s.SarevokDeathbringer.class));
cards.add(new SetCardInfo("Sea Hag", 95, Rarity.COMMON, mage.cards.s.SeaHag.class));
cards.add(new SetCardInfo("Sea of Clouds", 360, Rarity.RARE, mage.cards.s.SeaOfClouds.class));
cards.add(new SetCardInfo("Shameless Charlatan", 96, Rarity.RARE, mage.cards.s.ShamelessCharlatan.class));

View file

@ -4,7 +4,6 @@ import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.watchers.Watcher;
@ -41,6 +40,14 @@ public class RevoltWatcher extends Watcher {
return revoltActivePlayerIds.contains(playerId);
}
public static boolean checkAny(Game game) {
return !game
.getState()
.getWatcher(RevoltWatcher.class)
.revoltActivePlayerIds
.isEmpty();
}
@Override
public void reset() {
super.reset();