mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[VOW] Implemented Edgar, Charmed Groom / Edgar Markov's Coffin
This commit is contained in:
parent
10185a0999
commit
8856d0a0ea
6 changed files with 223 additions and 18 deletions
87
Mage.Sets/src/mage/cards/e/EdgarCharmedGroom.java
Normal file
87
Mage.Sets/src/mage/cards/e/EdgarCharmedGroom.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EdgarCharmedGroom extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.VAMPIRE, "Vampires");
|
||||
|
||||
public EdgarCharmedGroom(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{B}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.VAMPIRE);
|
||||
this.subtype.add(SubType.NOBLE);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.secondSideCardClazz = mage.cards.e.EdgarMarkovsCoffin.class;
|
||||
|
||||
// Other Vampires you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostControlledEffect(
|
||||
1, 1, Duration.WhileOnBattlefield, filter, true
|
||||
)));
|
||||
|
||||
// When Edgar, Charmed Groom dies, return it to the battlefield transformed under its owner's control.
|
||||
this.addAbility(new DiesSourceTriggeredAbility(new EdgarCharmedGroomEffect()));
|
||||
}
|
||||
|
||||
private EdgarCharmedGroom(final EdgarCharmedGroom card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdgarCharmedGroom copy() {
|
||||
return new EdgarCharmedGroom(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EdgarCharmedGroomEffect extends OneShotEffect {
|
||||
|
||||
EdgarCharmedGroomEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "return it to the battlefield transformed under its owner's control";
|
||||
}
|
||||
|
||||
private EdgarCharmedGroomEffect(final EdgarCharmedGroomEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdgarCharmedGroomEffect copy() {
|
||||
return new EdgarCharmedGroomEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (!(sourceObject instanceof Card)) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
controller.moveCards((Card) sourceObject, Zone.BATTLEFIELD, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
86
Mage.Sets/src/mage/cards/e/EdgarMarkovsCoffin.java
Normal file
86
Mage.Sets/src/mage/cards/e/EdgarMarkovsCoffin.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.EdgarMarkovsCoffinToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EdgarMarkovsCoffin extends CardImpl {
|
||||
|
||||
public EdgarMarkovsCoffin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.nightCard = true;
|
||||
|
||||
// At the beginning of your upkeep, create a 1/1 white and black Vampire creature token with lifelink and put a bloodline counter on Edgar Markov's Coffin. Then if there are three or more bloodline counters on it, remove those counters and transform it.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenEffect(new EdgarMarkovsCoffinToken()),
|
||||
TargetController.YOU, false
|
||||
);
|
||||
ability.addEffect(new AddCountersSourceEffect(
|
||||
CounterType.BLOODLINE.createInstance()
|
||||
).concatBy("and"));
|
||||
ability.addEffect(new EdgarMarkovsCoffinEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private EdgarMarkovsCoffin(final EdgarMarkovsCoffin card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdgarMarkovsCoffin copy() {
|
||||
return new EdgarMarkovsCoffin(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EdgarMarkovsCoffinEffect extends OneShotEffect {
|
||||
|
||||
EdgarMarkovsCoffinEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Then if there are three or more bloodline counters on it, remove those counters and transform it";
|
||||
}
|
||||
|
||||
private EdgarMarkovsCoffinEffect(final EdgarMarkovsCoffinEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdgarMarkovsCoffinEffect copy() {
|
||||
return new EdgarMarkovsCoffinEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
int counters = permanent.getCounters(game).getCount(CounterType.BLOODLINE);
|
||||
if (counters < 3) {
|
||||
return false;
|
||||
}
|
||||
permanent.removeCounters(CounterType.BLOODLINE.createInstance(counters), source, game);
|
||||
permanent.transform(source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,7 @@
|
|||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -12,12 +10,14 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author halljared
|
||||
*/
|
||||
|
@ -48,12 +48,12 @@ public final class HarvestHand extends CardImpl {
|
|||
|
||||
class HarvestHandReturnTransformedEffect extends OneShotEffect {
|
||||
|
||||
public HarvestHandReturnTransformedEffect() {
|
||||
HarvestHandReturnTransformedEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Return {this} to the battlefield transformed under your control";
|
||||
}
|
||||
|
||||
public HarvestHandReturnTransformedEffect(final HarvestHandReturnTransformedEffect effect) {
|
||||
private HarvestHandReturnTransformedEffect(final HarvestHandReturnTransformedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -65,17 +65,15 @@ class HarvestHandReturnTransformedEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (!(sourceObject instanceof Card)) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
controller.moveCards((Card) sourceObject, Zone.BATTLEFIELD, source, game);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,9 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Drogskol Armaments", 10, Rarity.COMMON, mage.cards.d.DrogskolArmaments.class));
|
||||
cards.add(new SetCardInfo("Drogskol Infantry", 10, Rarity.COMMON, mage.cards.d.DrogskolInfantry.class));
|
||||
cards.add(new SetCardInfo("Dying to Serve", 109, Rarity.RARE, mage.cards.d.DyingToServe.class));
|
||||
cards.add(new SetCardInfo("Edgar Markov's Coffin", 236, Rarity.RARE, mage.cards.e.EdgarMarkovsCoffin.class));
|
||||
cards.add(new SetCardInfo("Edgar's Awakening", 110, Rarity.UNCOMMON, mage.cards.e.EdgarsAwakening.class));
|
||||
cards.add(new SetCardInfo("Edgar, Charmed Groom", 236, Rarity.RARE, mage.cards.e.EdgarCharmedGroom.class));
|
||||
cards.add(new SetCardInfo("End the Festivities", 155, Rarity.COMMON, mage.cards.e.EndTheFestivities.class));
|
||||
cards.add(new SetCardInfo("Estwald Shieldbasher", 11, Rarity.COMMON, mage.cards.e.EstwaldShieldbasher.class));
|
||||
cards.add(new SetCardInfo("Evolving Wilds", 263, Rarity.COMMON, mage.cards.e.EvolvingWilds.class));
|
||||
|
|
|
@ -21,6 +21,7 @@ public enum CounterType {
|
|||
AWAKENING("awakening"),
|
||||
BLAZE("blaze"),
|
||||
BLOOD("blood"),
|
||||
BLOODLINE("bloodline"),
|
||||
BOOK("book"),
|
||||
BOUNTY("bounty"),
|
||||
BRIBERY("bribery"),
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class EdgarMarkovsCoffinToken extends TokenImpl {
|
||||
|
||||
public EdgarMarkovsCoffinToken() {
|
||||
super("Vampire", "1/1 white and black Vampire creature token with lifelink");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
color.setBlack(true);
|
||||
subtype.add(SubType.VAMPIRE);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
}
|
||||
|
||||
public EdgarMarkovsCoffinToken(final EdgarMarkovsCoffinToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public EdgarMarkovsCoffinToken copy() {
|
||||
return new EdgarMarkovsCoffinToken(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue