[STX] Implemented Mage Hunters' Onslaught

This commit is contained in:
Evan Kranzler 2021-04-06 20:44:41 -04:00
parent f4057e9497
commit 3cc92d6c3e
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.m;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlaneswalker;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MageHuntersOnslaught extends CardImpl {
public MageHuntersOnslaught(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}");
// Destroy target creature or planeswalker.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
// Whenever a creature blocks this turn, its controller loses 1 life.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(
new MageHuntersOnslaughtDelayedTriggeredAbility()
).concatBy("<br>"));
}
private MageHuntersOnslaught(final MageHuntersOnslaught card) {
super(card);
}
@Override
public MageHuntersOnslaught copy() {
return new MageHuntersOnslaught(this);
}
}
class MageHuntersOnslaughtDelayedTriggeredAbility extends DelayedTriggeredAbility {
MageHuntersOnslaughtDelayedTriggeredAbility() {
super(new LoseLifeTargetEffect(1), Duration.EndOfTurn, false, false);
}
private MageHuntersOnslaughtDelayedTriggeredAbility(final MageHuntersOnslaughtDelayedTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent == null) {
return false;
}
getEffects().setTargetPointer(new FixedTarget(permanent.getControllerId()));
return true;
}
@Override
public MageHuntersOnslaughtDelayedTriggeredAbility copy() {
return new MageHuntersOnslaughtDelayedTriggeredAbility(this);
}
@Override
public String getRule() {
return "Whenever a creature blocks this turn, its controller loses 1 life.";
}
}

View file

@ -141,6 +141,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Lorehold Excavation", 200, Rarity.UNCOMMON, mage.cards.l.LoreholdExcavation.class));
cards.add(new SetCardInfo("Lorehold Pledgemage", 201, Rarity.COMMON, mage.cards.l.LoreholdPledgemage.class));
cards.add(new SetCardInfo("Mage Hunter", 76, Rarity.UNCOMMON, mage.cards.m.MageHunter.class));
cards.add(new SetCardInfo("Mage Hunters' Onslaught", 77, Rarity.COMMON, mage.cards.m.MageHuntersOnslaught.class));
cards.add(new SetCardInfo("Magma Opus", 203, Rarity.MYTHIC, mage.cards.m.MagmaOpus.class));
cards.add(new SetCardInfo("Manifestation Sage", 205, Rarity.RARE, mage.cards.m.ManifestationSage.class));
cards.add(new SetCardInfo("Mascot Exhibition", 5, Rarity.MYTHIC, mage.cards.m.MascotExhibition.class));