[VOW] Implemented Biolume Egg / Biolume Serpent

This commit is contained in:
Evan Kranzler 2021-11-10 21:10:01 -05:00
parent 91300cebed
commit f5141843ff
4 changed files with 158 additions and 5 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SacrificeSourceTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
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 TheElk801
*/
public final class BiolumeEgg extends CardImpl {
public BiolumeEgg(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add(SubType.SERPENT);
this.subtype.add(SubType.EGG);
this.power = new MageInt(0);
this.toughness = new MageInt(4);
this.secondSideCardClazz = mage.cards.b.BiolumeSerpent.class;
// Defender
this.addAbility(DefenderAbility.getInstance());
// When Biolume Egg enters the battlefield, scry 2.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(2)));
// When you sacrifice Biolume Egg, return it to the battlefield transformed under its owner's control at the beginning of the next end step.
this.addAbility(new SacrificeSourceTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnLoyalCatharEffect()), true
).setText("return it to the battlefield transformed under its owner's control at the beginning of the next end step"), false));
}
private BiolumeEgg(final BiolumeEgg card) {
super(card);
}
@Override
public BiolumeEgg copy() {
return new BiolumeEgg(this);
}
}
class ReturnLoyalCatharEffect extends OneShotEffect {
public ReturnLoyalCatharEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "return it to the battlefield transformed under your control";
}
public ReturnLoyalCatharEffect(final ReturnLoyalCatharEffect effect) {
super(effect);
}
@Override
public ReturnLoyalCatharEffect copy() {
return new ReturnLoyalCatharEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId(), Boolean.TRUE);
controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null);
}
return true;
}
}

View file

@ -0,0 +1,49 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BiolumeSerpent extends CardImpl {
private static final FilterControlledPermanent filter
= new FilterControlledPermanent(SubType.ISLAND, "Islands");
public BiolumeSerpent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "");
this.subtype.add(SubType.SERPENT);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.color.setBlue(true);
this.nightCard = true;
// Sacrifice two Islands: Biolume Serpent can't be blocked this turn.
this.addAbility(new SimpleActivatedAbility(
new CantBeBlockedSourceEffect(Duration.EndOfTurn),
new SacrificeTargetCost(new TargetControlledPermanent(2, filter))
));
}
private BiolumeSerpent(final BiolumeSerpent card) {
super(card);
}
@Override
public BiolumeSerpent copy() {
return new BiolumeSerpent(this);
}
}

View file

@ -46,6 +46,8 @@ public final class InnistradCrimsonVow extends ExpansionSet {
cards.add(new SetCardInfo("Ballista Wielder", 143, Rarity.UNCOMMON, mage.cards.b.BallistaWielder.class));
cards.add(new SetCardInfo("Belligerent Guest", 144, Rarity.COMMON, mage.cards.b.BelligerentGuest.class));
cards.add(new SetCardInfo("Binding Geist", 48, Rarity.COMMON, mage.cards.b.BindingGeist.class));
cards.add(new SetCardInfo("Biolume Egg", 49, Rarity.UNCOMMON, mage.cards.b.BiolumeEgg.class));
cards.add(new SetCardInfo("Biolume Serpent", 49, Rarity.UNCOMMON, mage.cards.b.BiolumeSerpent.class));
cards.add(new SetCardInfo("Bleed Dry", 94, Rarity.COMMON, mage.cards.b.BleedDry.class));
cards.add(new SetCardInfo("Blood Fountain", 95, Rarity.COMMON, mage.cards.b.BloodFountain.class));
cards.add(new SetCardInfo("Blood Hypnotist", 145, Rarity.UNCOMMON, mage.cards.b.BloodHypnotist.class));

View file

@ -1,5 +1,3 @@
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
@ -7,20 +5,28 @@ import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class SacrificeSourceTriggeredAbility extends TriggeredAbilityImpl {
private final boolean setTargetPointer;
public SacrificeSourceTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, false);
}
public SacrificeSourceTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
super(Zone.ALL, effect, optional);
this.setTargetPointer = setTargetPointer;
}
public SacrificeSourceTriggeredAbility(final SacrificeSourceTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}
@Override
@ -35,11 +41,17 @@ public class SacrificeSourceTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getTargetId().equals(this.getSourceId());
if (!event.getTargetId().equals(this.getSourceId())) {
return false;
}
if (this.setTargetPointer) {
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
}
return true;
}
@Override
public String getTriggerPhrase() {
return "When you sacrifice {this}, " ;
return "When you sacrifice {this}, ";
}
}