[MH2] Implemented Blessed Respite

This commit is contained in:
Daniel Bomar 2021-06-02 20:00:24 -05:00
parent 03910cc994
commit ca01eddae0
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author weirddan455
*/
public final class BlessedRespite extends CardImpl {
public BlessedRespite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Target player shuffles their graveyard into their library. Prevent all combat damage that would be dealt this turn.
this.getSpellAbility().addEffect(new BlessedRespiteEffect());
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true));
this.getSpellAbility().addTarget(new TargetPlayer());
}
private BlessedRespite(final BlessedRespite card) {
super(card);
}
@Override
public BlessedRespite copy() {
return new BlessedRespite(this);
}
}
class BlessedRespiteEffect extends OneShotEffect {
public BlessedRespiteEffect() {
super(Outcome.Detriment);
this.staticText = "Target player shuffles their graveyard into their library";
}
private BlessedRespiteEffect(final BlessedRespiteEffect effect) {
super(effect);
}
@Override
public BlessedRespiteEffect copy() {
return new BlessedRespiteEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null) {
targetPlayer.moveCards(targetPlayer.getGraveyard(), Zone.LIBRARY, source, game);
targetPlayer.shuffleLibrary(source, game);
return true;
}
return false;
}
}

View file

@ -49,6 +49,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Batterbone", 221, Rarity.UNCOMMON, mage.cards.b.Batterbone.class));
cards.add(new SetCardInfo("Battle Plan", 114, Rarity.COMMON, mage.cards.b.BattlePlan.class));
cards.add(new SetCardInfo("Blacksmith's Skill", 6, Rarity.COMMON, mage.cards.b.BlacksmithsSkill.class));
cards.add(new SetCardInfo("Blessed Respite", 150, Rarity.UNCOMMON, mage.cards.b.BlessedRespite.class));
cards.add(new SetCardInfo("Bloodbraid Marauder", 116, Rarity.RARE, mage.cards.b.BloodbraidMarauder.class));
cards.add(new SetCardInfo("Blossoming Calm", 7, Rarity.UNCOMMON, mage.cards.b.BlossomingCalm.class));
cards.add(new SetCardInfo("Bone Shards", 76, Rarity.COMMON, mage.cards.b.BoneShards.class));