mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
implement [EOE] Kavaron Harrier
This commit is contained in:
parent
ac633cf57e
commit
2b7f8869dd
5 changed files with 85 additions and 12 deletions
|
|
@ -91,7 +91,7 @@ class DorotheasRetributionEffect extends OneShotEffect {
|
|||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(
|
||||
new SacrificeTargetEffect()
|
||||
.setTargetPointer(new FixedTargets(token, game))
|
||||
.setText("sacrifce that token")
|
||||
.setText("sacrifice that token")
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
81
Mage.Sets/src/mage/cards/k/KavaronHarrier.java
Normal file
81
Mage.Sets/src/mage/cards/k/KavaronHarrier.java
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.RobotToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class KavaronHarrier extends CardImpl {
|
||||
|
||||
public KavaronHarrier(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{R}");
|
||||
|
||||
this.subtype.add(SubType.ROBOT);
|
||||
this.subtype.add(SubType.SOLDIER);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever this creature attacks, you may pay {2}. If you do, create a 2/2 colorless Robot artifact creature token that's tapped and attacking. Sacrifice that token at end of combat.
|
||||
this.addAbility(new AttacksTriggeredAbility(
|
||||
new DoIfCostPaid(new KavaronHarrierEffect(), new GenericManaCost(2))
|
||||
));
|
||||
}
|
||||
|
||||
private KavaronHarrier(final KavaronHarrier card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KavaronHarrier copy() {
|
||||
return new KavaronHarrier(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class KavaronHarrierEffect extends OneShotEffect {
|
||||
|
||||
KavaronHarrierEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "create a 2/2 colorless Robot artifact creature token that's tapped and attacking. "
|
||||
+ "Sacrifice that token at end of combat";
|
||||
}
|
||||
|
||||
private KavaronHarrierEffect(final KavaronHarrierEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KavaronHarrierEffect copy() {
|
||||
return new KavaronHarrierEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Token token = new RobotToken();
|
||||
token.putOntoBattlefield(1, game, source, source.getControllerId(), true, true);
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(
|
||||
new SacrificeTargetEffect()
|
||||
.setTargetPointer(new FixedTargets(token, game))
|
||||
.setText("sacrifice that token")
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,17 +18,13 @@ import mage.constants.SubType;
|
|||
import mage.filter.StaticFilters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
import mage.util.CardUtil;
|
||||
import mage.util.functions.CopyTokenFunction;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -92,15 +88,9 @@ class PhantomSteedEffect extends OneShotEffect {
|
|||
Token token = CopyTokenFunction.createTokenCopy(card, game);
|
||||
token.addSubType(SubType.ILLUSION);
|
||||
token.putOntoBattlefield(1, game, source, source.getControllerId(), true, true);
|
||||
List<Permanent> permanents = token
|
||||
.getLastAddedTokenIds()
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(
|
||||
new ExileTargetEffect("Sacrifice that token at end of combat")
|
||||
.setTargetPointer(new FixedTargets(permanents, game))
|
||||
.setTargetPointer(new FixedTargets(token, game))
|
||||
), source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ public final class EdgeOfEternities extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Island", 269, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Island", 270, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Island", 368, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Kavaron Harrier", 139, Rarity.UNCOMMON, mage.cards.k.KavaronHarrier.class));
|
||||
cards.add(new SetCardInfo("Kavaron, Memorial World", 255, Rarity.MYTHIC, mage.cards.k.KavaronMemorialWorld.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Kavaron, Memorial World", 281, Rarity.MYTHIC, mage.cards.k.KavaronMemorialWorld.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Kavaron, Memorial World", 376, Rarity.MYTHIC, mage.cards.k.KavaronMemorialWorld.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public class FixedTargets extends TargetPointerImpl {
|
|||
this(token.getLastAddedTokenIds()
|
||||
.stream()
|
||||
.map(game::getPermanent)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList()), game);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue