mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
[MID] Implemented Hallowed Respite
This commit is contained in:
parent
d93475a5bb
commit
7aa3e75f3a
2 changed files with 89 additions and 0 deletions
Mage.Sets/src/mage
88
Mage.Sets/src/mage/cards/h/HallowedRespite.java
Normal file
88
Mage.Sets/src/mage/cards/h/HallowedRespite.java
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
package mage.cards.h;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||||
|
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
|
||||||
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SuperType;
|
||||||
|
import mage.constants.TimingRule;
|
||||||
|
import mage.counters.CounterType;
|
||||||
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author weirddan455
|
||||||
|
*/
|
||||||
|
public final class HallowedRespite extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonlegendary creature");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public HallowedRespite(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{U}");
|
||||||
|
|
||||||
|
// Exile target nonlegendary creature, then return it to the battlefield under its owner's control. If it entered under your control, put a +1/+1 counter on it. Otherwise, tap it.
|
||||||
|
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect());
|
||||||
|
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false));
|
||||||
|
this.getSpellAbility().addEffect(new HallowedRespiteEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||||
|
|
||||||
|
// Flashback {1}{W}{U}
|
||||||
|
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{W}{U}")));
|
||||||
|
}
|
||||||
|
|
||||||
|
private HallowedRespite(final HallowedRespite card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HallowedRespite copy() {
|
||||||
|
return new HallowedRespite(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class HallowedRespiteEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public HallowedRespiteEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "If it entered under your control, put a +1/+1 counter on it. Otherwise, tap it";
|
||||||
|
}
|
||||||
|
|
||||||
|
private HallowedRespiteEffect(final HallowedRespiteEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HallowedRespiteEffect copy() {
|
||||||
|
return new HallowedRespiteEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
|
if (permanent == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (permanent.isControlledBy(source.getControllerId())) {
|
||||||
|
permanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game);
|
||||||
|
} else {
|
||||||
|
permanent.tap(source, game);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -149,6 +149,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Graveyard Glutton", 104, Rarity.RARE, mage.cards.g.GraveyardGlutton.class));
|
cards.add(new SetCardInfo("Graveyard Glutton", 104, Rarity.RARE, mage.cards.g.GraveyardGlutton.class));
|
||||||
cards.add(new SetCardInfo("Graveyard Trespasser", 104, Rarity.RARE, mage.cards.g.GraveyardTrespasser.class));
|
cards.add(new SetCardInfo("Graveyard Trespasser", 104, Rarity.RARE, mage.cards.g.GraveyardTrespasser.class));
|
||||||
cards.add(new SetCardInfo("Grizzly Ghoul", 226, Rarity.UNCOMMON, mage.cards.g.GrizzlyGhoul.class));
|
cards.add(new SetCardInfo("Grizzly Ghoul", 226, Rarity.UNCOMMON, mage.cards.g.GrizzlyGhoul.class));
|
||||||
|
cards.add(new SetCardInfo("Hallowed Respite", 227, Rarity.RARE, mage.cards.h.HallowedRespite.class));
|
||||||
cards.add(new SetCardInfo("Harvesttide Assailant", 143, Rarity.COMMON, mage.cards.h.HarvesttideAssailant.class));
|
cards.add(new SetCardInfo("Harvesttide Assailant", 143, Rarity.COMMON, mage.cards.h.HarvesttideAssailant.class));
|
||||||
cards.add(new SetCardInfo("Harvesttide Infiltrator", 143, Rarity.COMMON, mage.cards.h.HarvesttideInfiltrator.class));
|
cards.add(new SetCardInfo("Harvesttide Infiltrator", 143, Rarity.COMMON, mage.cards.h.HarvesttideInfiltrator.class));
|
||||||
cards.add(new SetCardInfo("Harvesttide Sentry", 186, Rarity.COMMON, mage.cards.h.HarvesttideSentry.class));
|
cards.add(new SetCardInfo("Harvesttide Sentry", 186, Rarity.COMMON, mage.cards.h.HarvesttideSentry.class));
|
||||||
|
|
Loading…
Add table
Reference in a new issue